Skip to content

Commit

Permalink
UI: text editor - add an input to hide specific text (WEKAPP-373373) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mvoloshin0458 authored Mar 21, 2024
1 parent 3ff39f3 commit f00d2c3
Show file tree
Hide file tree
Showing 41 changed files with 2,202 additions and 1,894 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 7,
"ecmaVersion": "latest",
"ecmaFeatures": {
"jsx": true
}
Expand Down
22 changes: 11 additions & 11 deletions dist/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/cjs/types/components/TextEditor/TextEditor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ declare namespace TextEditor {
var FontSizeControls: typeof import("./components/FontSizeControls/FontSizeControls").default;
var LinesCount: typeof import("./components/LinesCount/LinesCount").default;
var SearchButton: typeof import("./components/SearchButton/SearchButton").default;
var HideContentInput: typeof import("./components/HideContentInput/HideContentInput").default;
}
export default TextEditor;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="react" />
import './hideContentInput.scss';
interface HideContentInputProps {
wrapperClass?: string;
}
declare function HideContentInput(props: HideContentInputProps): JSX.Element;
export default HideContentInput;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as HideContentInput } from './HideContentInput';
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export { default as useLinePosition } from './useLinePosition';
export { default as useTags } from './useTags';
export type * from './useTags';
export { default as useForcedLineNumbers } from './useForcedLineNumbers';
export type * from './useForcedLineNumbers';
export { default as useSearch } from './useSearch';
export { default as useOnlyMatching } from './useOnlyMatching';
export type * from './useOnlyMatching';
export { default as useFoldAll } from './useFoldAll';
export { default as useEditor } from './useEditor';
export { default as useHideContent } from './useHideContent';
export { default as useDisableSyntaxCheck } from './useDisableSyntaxCheck';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { IAceEditor } from 'react-ace/lib/types';
declare function useDisableSyntaxCheck({ editor }: {
editor?: IAceEditor;
}): void;
export default useDisableSyntaxCheck;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IAceEditor } from 'react-ace/lib/types';
declare function useForcedLineNumbers({ editor, value, lines }: {
editor?: IAceEditor;
value: string;
lines?: {
number: string;
text: string;
}[];
}): void;
export default useForcedLineNumbers;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare function useHideContent({ value }: {
value?: string;
}): string | undefined;
export default useHideContent;
1 change: 1 addition & 0 deletions dist/cjs/types/components/TextEditor/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './TextEditorFull';
export type * from './TextEditorFull';
export * from './TextViewerLite';
export * from './SearchButton';
export * from './HideContentInput';
8 changes: 7 additions & 1 deletion dist/cjs/types/components/TextEditor/context/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ type TextEditorContextValue = {
visibleLinesCount?: number;
isLiteMode: boolean;
loading?: boolean;
hideContent?: string[];
shouldDisableSyntaxCheck: Set<'hideContent' | 'tags'>;
pageStorageKey?: string;
};
type TextEditorContextType = {
value: TextEditorContextValue;
setTextEditorContext: (setter: (prev: TextEditorContextValue) => TextEditorContextValue) => void;
};
export declare function TextEditorProvider({ children }: PropsWithChildren): JSX.Element;
type TextEditorProviderProps = {
pageStorageKey?: string;
};
export declare function TextEditorProvider({ children, pageStorageKey }: PropsWithChildren<TextEditorProviderProps>): JSX.Element;
export declare function useTextEditorContext(isProviderOptional: true): TextEditorContextType | null;
export declare function useTextEditorContext(componentName: string): TextEditorContextType;
export {};
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
declare function useLinesCount({ value, lines }: {
declare function useLinesCount({ value, lines, filteredValue }: {
value?: string;
lines?: {
number: string;
text: string;
}[];
filteredValue?: string;
}): void;
export default useLinesCount;
22 changes: 11 additions & 11 deletions dist/esm/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/index.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/esm/types/components/TextEditor/TextEditor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ declare namespace TextEditor {
var FontSizeControls: typeof import("./components/FontSizeControls/FontSizeControls").default;
var LinesCount: typeof import("./components/LinesCount/LinesCount").default;
var SearchButton: typeof import("./components/SearchButton/SearchButton").default;
var HideContentInput: typeof import("./components/HideContentInput/HideContentInput").default;
}
export default TextEditor;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// <reference types="react" />
import './hideContentInput.scss';
interface HideContentInputProps {
wrapperClass?: string;
}
declare function HideContentInput(props: HideContentInputProps): JSX.Element;
export default HideContentInput;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as HideContentInput } from './HideContentInput';
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
export { default as useLinePosition } from './useLinePosition';
export { default as useTags } from './useTags';
export type * from './useTags';
export { default as useForcedLineNumbers } from './useForcedLineNumbers';
export type * from './useForcedLineNumbers';
export { default as useSearch } from './useSearch';
export { default as useOnlyMatching } from './useOnlyMatching';
export type * from './useOnlyMatching';
export { default as useFoldAll } from './useFoldAll';
export { default as useEditor } from './useEditor';
export { default as useHideContent } from './useHideContent';
export { default as useDisableSyntaxCheck } from './useDisableSyntaxCheck';
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { IAceEditor } from 'react-ace/lib/types';
declare function useDisableSyntaxCheck({ editor }: {
editor?: IAceEditor;
}): void;
export default useDisableSyntaxCheck;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { IAceEditor } from 'react-ace/lib/types';
declare function useForcedLineNumbers({ editor, value, lines }: {
editor?: IAceEditor;
value: string;
lines?: {
number: string;
text: string;
}[];
}): void;
export default useForcedLineNumbers;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare function useHideContent({ value }: {
value?: string;
}): string | undefined;
export default useHideContent;
1 change: 1 addition & 0 deletions dist/esm/types/components/TextEditor/components/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './TextEditorFull';
export type * from './TextEditorFull';
export * from './TextViewerLite';
export * from './SearchButton';
export * from './HideContentInput';
8 changes: 7 additions & 1 deletion dist/esm/types/components/TextEditor/context/context.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ type TextEditorContextValue = {
visibleLinesCount?: number;
isLiteMode: boolean;
loading?: boolean;
hideContent?: string[];
shouldDisableSyntaxCheck: Set<'hideContent' | 'tags'>;
pageStorageKey?: string;
};
type TextEditorContextType = {
value: TextEditorContextValue;
setTextEditorContext: (setter: (prev: TextEditorContextValue) => TextEditorContextValue) => void;
};
export declare function TextEditorProvider({ children }: PropsWithChildren): JSX.Element;
type TextEditorProviderProps = {
pageStorageKey?: string;
};
export declare function TextEditorProvider({ children, pageStorageKey }: PropsWithChildren<TextEditorProviderProps>): JSX.Element;
export declare function useTextEditorContext(isProviderOptional: true): TextEditorContextType | null;
export declare function useTextEditorContext(componentName: string): TextEditorContextType;
export {};
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
declare function useLinesCount({ value, lines }: {
declare function useLinesCount({ value, lines, filteredValue }: {
value?: string;
lines?: {
number: string;
text: string;
}[];
filteredValue?: string;
}): void;
export default useLinesCount;
11 changes: 10 additions & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ interface CustomizableSelectProps {
}
declare function CustomizableSelect(props: CustomizableSelectProps): JSX.Element;

interface HideContentInputProps {
wrapperClass?: string;
}
declare function HideContentInput(props: HideContentInputProps): JSX.Element;

declare function SearchButton(): JSX.Element;

declare function LinesCount(): JSX.Element;
Expand All @@ -299,7 +304,10 @@ interface ParsedData {
[key: string]: any;
}

declare function TextEditorProvider({ children }: PropsWithChildren): JSX.Element;
type TextEditorProviderProps = {
pageStorageKey?: string;
};
declare function TextEditorProvider({ children, pageStorageKey }: PropsWithChildren<TextEditorProviderProps>): JSX.Element;

interface TextEditorProps {
onChange?: () => void;
Expand Down Expand Up @@ -327,6 +335,7 @@ declare namespace TextEditor {
var FontSizeControls: typeof FontSizeControls;
var LinesCount: typeof LinesCount;
var SearchButton: typeof SearchButton;
var HideContentInput: typeof HideContentInput;
}

declare function Loader(): JSX.Element;
Expand Down
Loading

0 comments on commit f00d2c3

Please sign in to comment.