@datarobot/design-system 30.6.4 → 30.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/button/button.d.ts +21 -21
- package/cjs/chat/chat-message-body.js +9 -7
- package/cjs/chat/utils.js +5 -1
- package/cjs/datetime-picker/datetime-picker.d.ts +2 -2
- package/cjs/datetime-range-picker/helpers.d.ts +12 -12
- package/cjs/dropdown-menu/dropdown-menu-content.d.ts +1 -1
- package/cjs/dropdown-menu/utils.d.ts +30 -31
- package/cjs/file-uploader/file-uploader-hook.d.ts +1 -1
- package/cjs/floating-panel/constants.d.ts +0 -1
- package/cjs/font-awesome-icon/font-awesome-icon.d.ts +0 -1
- package/cjs/form-field/utilities.d.ts +1 -1
- package/cjs/full-screen-drawer/useFullScreenDrawer.d.ts +0 -1
- package/cjs/hooks/use-analytics/use-analytics.d.ts +13 -13
- package/cjs/hooks/use-focus-trap/use-focus-trap.d.ts +0 -1
- package/cjs/hooks/use-non-native-button-attrs/use-non-native-button-attrs.d.ts +2 -2
- package/cjs/hooks/use-ordering/use-ordering.d.ts +0 -1
- package/cjs/hooks/use-paginated-search/use-paginated-search.d.ts +2 -2
- package/cjs/hooks/use-translation/use-translation.d.ts +20 -19
- package/cjs/input/input.d.ts +54 -54
- package/cjs/range-slider/context.d.ts +0 -1
- package/cjs/table/hooks/use-checkbox-cells-state/use-checkbox-cells-state.d.ts +0 -1
- package/cjs/table-react/hooks/useTableReact.d.ts +3 -3
- package/cjs/table-react/utils/getHeaderColumnsActions.d.ts +1 -1
- package/cjs/text-editor/edited-text.js +12 -4
- package/cjs/text-editor/text-editor.js +8 -1
- package/cjs/textarea/textarea.d.ts +2 -2
- package/cjs/time-from-now/time-from-now.d.ts +1 -1
- package/cjs/tour/advanced-tour/hooks.d.ts +0 -1
- package/cjs/tour/hooks.d.ts +0 -1
- package/cjs/typeahead/use-visible-options.d.ts +3 -3
- package/esm/button/button.d.ts +21 -21
- package/esm/chat/chat-message-body.js +9 -7
- package/esm/chat/utils.js +4 -1
- package/esm/datetime-picker/datetime-picker.d.ts +2 -2
- package/esm/datetime-range-picker/helpers.d.ts +12 -12
- package/esm/dropdown-menu/dropdown-menu-content.d.ts +1 -1
- package/esm/dropdown-menu/utils.d.ts +30 -31
- package/esm/file-uploader/file-uploader-hook.d.ts +1 -1
- package/esm/floating-panel/constants.d.ts +0 -1
- package/esm/font-awesome-icon/font-awesome-icon.d.ts +0 -1
- package/esm/form-field/utilities.d.ts +1 -1
- package/esm/full-screen-drawer/useFullScreenDrawer.d.ts +0 -1
- package/esm/hooks/use-analytics/use-analytics.d.ts +13 -13
- package/esm/hooks/use-focus-trap/use-focus-trap.d.ts +0 -1
- package/esm/hooks/use-non-native-button-attrs/use-non-native-button-attrs.d.ts +2 -2
- package/esm/hooks/use-ordering/use-ordering.d.ts +0 -1
- package/esm/hooks/use-paginated-search/use-paginated-search.d.ts +2 -2
- package/esm/hooks/use-translation/use-translation.d.ts +20 -19
- package/esm/input/input.d.ts +54 -54
- package/esm/range-slider/context.d.ts +0 -1
- package/esm/table/hooks/use-checkbox-cells-state/use-checkbox-cells-state.d.ts +0 -1
- package/esm/table-react/hooks/useTableReact.d.ts +3 -3
- package/esm/table-react/utils/getHeaderColumnsActions.d.ts +1 -1
- package/esm/text-editor/edited-text.js +12 -4
- package/esm/text-editor/text-editor.js +8 -1
- package/esm/textarea/textarea.d.ts +2 -2
- package/esm/time-from-now/time-from-now.d.ts +1 -1
- package/esm/tour/advanced-tour/hooks.d.ts +0 -1
- package/esm/tour/hooks.d.ts +0 -1
- package/esm/typeahead/use-visible-options.d.ts +3 -3
- package/js/bundle/bundle.js +89 -18
- package/js/bundle/bundle.min.js +1 -1
- package/js/bundle/index.d.ts +135 -134
- package/package.json +55 -55
|
@@ -9,54 +9,55 @@ export declare function useTranslation(): {
|
|
|
9
9
|
length: 3;
|
|
10
10
|
toString(): string;
|
|
11
11
|
toLocaleString(): string;
|
|
12
|
+
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
12
13
|
pop(): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined> | undefined;
|
|
13
14
|
push(...items: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]): number;
|
|
14
15
|
concat(...items: ConcatArray<boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>[]): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
15
16
|
concat(...items: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined> | ConcatArray<boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>)[]): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
16
|
-
join(separator?: string
|
|
17
|
+
join(separator?: string): string;
|
|
17
18
|
reverse(): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
18
19
|
shift(): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined> | undefined;
|
|
19
|
-
slice(start?: number
|
|
20
|
+
slice(start?: number, end?: number): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
20
21
|
sort(compareFn?: ((a: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, b: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>) => number) | undefined): import("react-i18next").UseTranslationResponse<string, undefined>;
|
|
21
|
-
splice(start: number, deleteCount?: number
|
|
22
|
+
splice(start: number, deleteCount?: number): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
22
23
|
splice(start: number, deleteCount: number, ...items: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
23
24
|
unshift(...items: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]): number;
|
|
24
|
-
indexOf(searchElement: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, fromIndex?: number
|
|
25
|
-
lastIndexOf(searchElement: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, fromIndex?: number
|
|
25
|
+
indexOf(searchElement: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, fromIndex?: number): number;
|
|
26
|
+
lastIndexOf(searchElement: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, fromIndex?: number): number;
|
|
26
27
|
every<S extends boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => value is S, thisArg?: any): this is S[];
|
|
27
28
|
every(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): boolean;
|
|
28
29
|
some(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): boolean;
|
|
29
30
|
forEach(callbackfn: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => void, thisArg?: any): void;
|
|
30
31
|
map<U>(callbackfn: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => U, thisArg?: any): U[];
|
|
31
|
-
filter<
|
|
32
|
+
filter<S extends boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => value is S, thisArg?: any): S[];
|
|
32
33
|
filter(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
33
34
|
reduce(callbackfn: (previousValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentIndex: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>;
|
|
34
35
|
reduce(callbackfn: (previousValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentIndex: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, initialValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>;
|
|
35
|
-
reduce<
|
|
36
|
+
reduce<U>(callbackfn: (previousValue: U, currentValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentIndex: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => U, initialValue: U): U;
|
|
36
37
|
reduceRight(callbackfn: (previousValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentIndex: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>;
|
|
37
38
|
reduceRight(callbackfn: (previousValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentIndex: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, initialValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>;
|
|
38
|
-
reduceRight<
|
|
39
|
-
find<
|
|
39
|
+
reduceRight<U>(callbackfn: (previousValue: U, currentValue: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, currentIndex: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => U, initialValue: U): U;
|
|
40
|
+
find<S extends boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, obj: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => value is S, thisArg?: any): S | undefined;
|
|
40
41
|
find(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, obj: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined> | undefined;
|
|
41
42
|
findIndex(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, obj: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): number;
|
|
42
|
-
fill(value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, start?: number
|
|
43
|
-
copyWithin(target: number, start: number, end?: number
|
|
44
|
-
entries():
|
|
45
|
-
keys():
|
|
46
|
-
values():
|
|
47
|
-
includes(searchElement: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, fromIndex?: number
|
|
48
|
-
flatMap<
|
|
43
|
+
fill(value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, start?: number, end?: number): import("react-i18next").UseTranslationResponse<string, undefined>;
|
|
44
|
+
copyWithin(target: number, start: number, end?: number): import("react-i18next").UseTranslationResponse<string, undefined>;
|
|
45
|
+
entries(): ArrayIterator<[number, boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>]>;
|
|
46
|
+
keys(): ArrayIterator<number>;
|
|
47
|
+
values(): ArrayIterator<boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>;
|
|
48
|
+
includes(searchElement: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, fromIndex?: number): boolean;
|
|
49
|
+
flatMap<U, This = undefined>(callback: (this: This, value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
49
50
|
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
50
51
|
at(index: number): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined> | undefined;
|
|
51
|
-
findLast<
|
|
52
|
+
findLast<S extends boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => value is S, thisArg?: any): S | undefined;
|
|
52
53
|
findLast(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined> | undefined;
|
|
53
54
|
findLastIndex(predicate: (value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, index: number, array: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]) => unknown, thisArg?: any): number;
|
|
54
55
|
toReversed(): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
55
56
|
toSorted(compareFn?: ((a: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>, b: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>) => number) | undefined): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
56
57
|
toSpliced(start: number, deleteCount: number, ...items: (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[]): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
57
|
-
toSpliced(start: number, deleteCount?: number
|
|
58
|
+
toSpliced(start: number, deleteCount?: number): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
58
59
|
with(index: number, value: boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>): (boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>)[];
|
|
59
|
-
[Symbol.iterator]():
|
|
60
|
+
[Symbol.iterator](): ArrayIterator<boolean | import("i18next").i18n | import("i18next").TFunction<string, undefined>>;
|
|
60
61
|
[Symbol.unscopables]: {
|
|
61
62
|
[x: number]: boolean | undefined;
|
|
62
63
|
length?: boolean | undefined;
|
package/esm/input/input.d.ts
CHANGED
|
@@ -88,62 +88,62 @@ export type InputProps = {
|
|
|
88
88
|
* @alpine-light-supported
|
|
89
89
|
*/
|
|
90
90
|
declare const Input: React.ForwardRefExoticComponent<{
|
|
91
|
-
value?: string | number
|
|
92
|
-
id?: string
|
|
93
|
-
helperText?: string
|
|
94
|
-
helperTextPosition?: HELPER_TEXT_POSITION
|
|
95
|
-
className?: string
|
|
96
|
-
isDisabled?: boolean
|
|
97
|
-
isOptional?: boolean
|
|
98
|
-
isHighlighted?: boolean
|
|
99
|
-
optionalLabelText?: string
|
|
100
|
-
autoFocus?: boolean
|
|
101
|
-
disabledInfo?: string
|
|
102
|
-
touched?: boolean
|
|
103
|
-
validationTestId?: string
|
|
104
|
-
validity?: FormFieldValidity | null
|
|
105
|
-
asyncValidation?: AsyncValidation
|
|
106
|
-
leftIcon?: IconLookup | null
|
|
107
|
-
rightIcon?: IconLookup | null
|
|
108
|
-
iconTooltipText?: string
|
|
91
|
+
value?: string | number;
|
|
92
|
+
id?: string;
|
|
93
|
+
helperText?: string;
|
|
94
|
+
helperTextPosition?: HELPER_TEXT_POSITION;
|
|
95
|
+
className?: string;
|
|
96
|
+
isDisabled?: boolean;
|
|
97
|
+
isOptional?: boolean;
|
|
98
|
+
isHighlighted?: boolean;
|
|
99
|
+
optionalLabelText?: string;
|
|
100
|
+
autoFocus?: boolean;
|
|
101
|
+
disabledInfo?: string;
|
|
102
|
+
touched?: boolean;
|
|
103
|
+
validationTestId?: string;
|
|
104
|
+
validity?: FormFieldValidity | null;
|
|
105
|
+
asyncValidation?: AsyncValidation;
|
|
106
|
+
leftIcon?: IconLookup | null;
|
|
107
|
+
rightIcon?: IconLookup | null;
|
|
108
|
+
iconTooltipText?: string;
|
|
109
109
|
label?: React.ReactNode;
|
|
110
|
-
labelTestId?: string
|
|
111
|
-
labelIcon?: IconLookup | null
|
|
112
|
-
labelIconTestId?: string
|
|
113
|
-
labelIconTooltipText?: string
|
|
114
|
-
isLabelIconTooltipInteractive?: boolean
|
|
115
|
-
fieldClass?: string
|
|
116
|
-
placeholder?: string
|
|
117
|
-
required?: boolean
|
|
118
|
-
onClear?: (
|
|
119
|
-
onChange?: (
|
|
110
|
+
labelTestId?: string;
|
|
111
|
+
labelIcon?: IconLookup | null;
|
|
112
|
+
labelIconTestId?: string;
|
|
113
|
+
labelIconTooltipText?: string;
|
|
114
|
+
isLabelIconTooltipInteractive?: boolean;
|
|
115
|
+
fieldClass?: string;
|
|
116
|
+
placeholder?: string;
|
|
117
|
+
required?: boolean;
|
|
118
|
+
onClear?: () => void;
|
|
119
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>, params: {
|
|
120
120
|
normalizedValue: string | number;
|
|
121
|
-
}) => void
|
|
122
|
-
onBlur?: (
|
|
123
|
-
onFocus?: (
|
|
124
|
-
type?: InputTypes
|
|
121
|
+
}) => void;
|
|
122
|
+
onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
123
|
+
onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
|
|
124
|
+
type?: InputTypes;
|
|
125
125
|
/** if type="password", spellcheck is disabled by default */
|
|
126
|
-
spellCheck?: boolean
|
|
127
|
-
shouldDisplayControls?: boolean
|
|
128
|
-
inputSize?: InputSizes
|
|
129
|
-
isHorizontalLayout?: boolean
|
|
130
|
-
name?: string
|
|
131
|
-
step?:
|
|
132
|
-
size?: number
|
|
133
|
-
readOnly?: boolean
|
|
134
|
-
minlength?: number
|
|
135
|
-
min?: number
|
|
136
|
-
maxLength?: number
|
|
137
|
-
max?: number
|
|
138
|
-
autoComplete?: string
|
|
139
|
-
passwordToggleButtonTexts?: PasswordToggleButtonTextsProps
|
|
140
|
-
validationValues?: ValidationValuesProps
|
|
141
|
-
onKeyDown?: (
|
|
142
|
-
onPaste?: (
|
|
143
|
-
wrapperClass?: string
|
|
144
|
-
role?: string
|
|
145
|
-
fieldTestId?: string
|
|
146
|
-
useFont?: boolean
|
|
147
|
-
disableApplyButton?: boolean
|
|
126
|
+
spellCheck?: boolean;
|
|
127
|
+
shouldDisplayControls?: boolean;
|
|
128
|
+
inputSize?: InputSizes;
|
|
129
|
+
isHorizontalLayout?: boolean;
|
|
130
|
+
name?: string;
|
|
131
|
+
step?: number | string;
|
|
132
|
+
size?: number;
|
|
133
|
+
readOnly?: boolean;
|
|
134
|
+
minlength?: number;
|
|
135
|
+
min?: number;
|
|
136
|
+
maxLength?: number;
|
|
137
|
+
max?: number;
|
|
138
|
+
autoComplete?: string;
|
|
139
|
+
passwordToggleButtonTexts?: PasswordToggleButtonTextsProps;
|
|
140
|
+
validationValues?: ValidationValuesProps;
|
|
141
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
142
|
+
onPaste?: (event: React.ClipboardEvent<HTMLInputElement>) => void;
|
|
143
|
+
wrapperClass?: string;
|
|
144
|
+
role?: string;
|
|
145
|
+
fieldTestId?: string;
|
|
146
|
+
useFont?: boolean;
|
|
147
|
+
disableApplyButton?: boolean;
|
|
148
148
|
} & FormFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
149
149
|
export default Input;
|
|
@@ -42,7 +42,7 @@ export declare function useTableReact<FiltersData>({ tableId, version, debounceS
|
|
|
42
42
|
};
|
|
43
43
|
reset: () => void;
|
|
44
44
|
defaultState: {
|
|
45
|
-
defaultColumnSizing?: ColumnSizingState
|
|
45
|
+
defaultColumnSizing?: ColumnSizingState;
|
|
46
46
|
sorting: SortingState;
|
|
47
47
|
visible: {};
|
|
48
48
|
pagination: PaginationState;
|
|
@@ -51,7 +51,7 @@ export declare function useTableReact<FiltersData>({ tableId, version, debounceS
|
|
|
51
51
|
selected: {};
|
|
52
52
|
expandedRows: {};
|
|
53
53
|
columnOrder: ColumnOrderState;
|
|
54
|
-
touched?: Touched
|
|
54
|
+
touched?: Touched;
|
|
55
55
|
filters?: FiltersData | undefined;
|
|
56
56
|
columnSizing: {};
|
|
57
57
|
} | {
|
|
@@ -64,7 +64,7 @@ export declare function useTableReact<FiltersData>({ tableId, version, debounceS
|
|
|
64
64
|
selected: {};
|
|
65
65
|
expandedRows: {};
|
|
66
66
|
columnOrder: ColumnOrderState;
|
|
67
|
-
touched?: Touched
|
|
67
|
+
touched?: Touched;
|
|
68
68
|
filters?: FiltersData | undefined;
|
|
69
69
|
};
|
|
70
70
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useContext, useEffect } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import isEqual from 'lodash-es/isEqual';
|
|
4
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
4
5
|
import { withHistory } from 'slate-history';
|
|
5
6
|
import { resetNodes } from '../chat';
|
|
6
7
|
import TextEditorContext from './text-editor-context';
|
|
@@ -29,12 +30,19 @@ function EditedTextComponent({
|
|
|
29
30
|
Slate
|
|
30
31
|
} = slateReact;
|
|
31
32
|
const editor = useMemo(() => withLinks(withHistory(withReact(createEditor()))), []);
|
|
33
|
+
|
|
34
|
+
// Clone the incoming value so this editor instance owns its own Slate node
|
|
35
|
+
// references. slate-dom 0.123+ keys internal WeakMaps by node identity, and
|
|
36
|
+
// sharing node references across editors (e.g. the same value bound to a
|
|
37
|
+
// form's TextEditor and a preview's EditedText at the same time) makes
|
|
38
|
+
// findPath throw "Unable to find the path for Slate node".
|
|
39
|
+
const slateValue = useMemo(() => value ? cloneDeep(value) : value, [value]);
|
|
32
40
|
useEffect(() => {
|
|
33
|
-
if (
|
|
41
|
+
if (slateValue && !isEqual(editor.children, slateValue)) {
|
|
34
42
|
// Update the cached value inside the editor
|
|
35
|
-
resetNodes(editor,
|
|
43
|
+
resetNodes(editor, slateValue);
|
|
36
44
|
}
|
|
37
|
-
}, [
|
|
45
|
+
}, [slateValue, editor]);
|
|
38
46
|
const ariaAttrs = useMemo(() => {
|
|
39
47
|
return {
|
|
40
48
|
'aria-label': ariaLabel
|
|
@@ -45,7 +53,7 @@ function EditedTextComponent({
|
|
|
45
53
|
// Slate throws an error when no onChange is given, providing a noop func to avoid issues
|
|
46
54
|
_jsx(Slate, {
|
|
47
55
|
editor: editor,
|
|
48
|
-
initialValue:
|
|
56
|
+
initialValue: slateValue,
|
|
49
57
|
onChange: () => undefined,
|
|
50
58
|
children: /*#__PURE__*/_jsx(TextEditorContent, {
|
|
51
59
|
placeholder: placeholder,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useMemo, useRef, useContext, useState, useEffect, useCallback } from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import isEqual from 'lodash-es/isEqual';
|
|
4
|
+
import cloneDeep from 'lodash-es/cloneDeep';
|
|
4
5
|
import { withHistory } from 'slate-history';
|
|
5
6
|
import { ValidityMessages, getErrorAriaAttributes, useDefaultValidationValues } from '../form-field';
|
|
6
7
|
import { resetNodes, CharactersCounter, withMaxLength } from '../chat';
|
|
@@ -71,7 +72,13 @@ function TextEditorComponent({
|
|
|
71
72
|
}, [getCharactersCounterString]);
|
|
72
73
|
const editor = useMemo(() => withMaxLength(maxLength)(withLinks(withHistory(withReact(createEditor())))), [maxLength]);
|
|
73
74
|
const selection = useRef(null);
|
|
74
|
-
|
|
75
|
+
// Clone the incoming value so this editor instance owns its own Slate node
|
|
76
|
+
// references. slate-dom 0.123+ keys internal WeakMaps by node identity, and
|
|
77
|
+
// sharing the same node references across editors (e.g. several editors
|
|
78
|
+
// falling back to TEXT_EDITOR_DEFAULT_VALUE, or the same parent state being
|
|
79
|
+
// bound to multiple editors at once) makes findPath throw
|
|
80
|
+
// "Unable to find the path for Slate node".
|
|
81
|
+
const slateValue = useMemo(() => cloneDeep(value || initialValue || TEXT_EDITOR_DEFAULT_VALUE), [value, initialValue]);
|
|
75
82
|
useEffect(() => {
|
|
76
83
|
if (!isEqual(editor.children, slateValue)) {
|
|
77
84
|
// Update the cached value inside the editor
|
|
@@ -19,6 +19,6 @@ export function TextArea(props: FormFieldProps) {
|
|
|
19
19
|
* [CAPITALIZATION] Don't have mixed format in one text block, use sentence case
|
|
20
20
|
*/
|
|
21
21
|
export declare const TextArea: React.ForwardRefExoticComponent<FormFieldProps & Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & {
|
|
22
|
-
useFont?: boolean
|
|
23
|
-
allowResizing?: boolean | TextAreaResizeValues
|
|
22
|
+
useFont?: boolean;
|
|
23
|
+
allowResizing?: boolean | TextAreaResizeValues;
|
|
24
24
|
} & React.RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -9,6 +9,6 @@ export type TimeFromNowProps = {
|
|
|
9
9
|
tooltipPlacement?: TooltipPlacementsType;
|
|
10
10
|
tooltipDelayType?: TooltipDelayType;
|
|
11
11
|
};
|
|
12
|
-
export declare const getLocalTime: (timestamp: number | string, standard?:
|
|
12
|
+
export declare const getLocalTime: (timestamp: number | string, standard?: "utc") => moment.Moment;
|
|
13
13
|
declare const TimeFromNow: ({ timestamp, format, standard, hideSuffix, showTooltip, tooltipPlacement, tooltipDelayType, }: TimeFromNowProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export default TimeFromNow;
|
package/esm/tour/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TypeaheadOption } from './typeahead';
|
|
2
2
|
export declare const useVisibleOptions: ({ formatSearchValue, searchValue, options, searchFields, isShowAll, }: {
|
|
3
|
-
formatSearchValue?: (
|
|
4
|
-
searchValue?: string
|
|
3
|
+
formatSearchValue?: (value?: string) => string;
|
|
4
|
+
searchValue?: string;
|
|
5
5
|
options: TypeaheadOption[];
|
|
6
|
-
searchFields?: string[]
|
|
6
|
+
searchFields?: string[];
|
|
7
7
|
isShowAll: boolean;
|
|
8
8
|
}) => {
|
|
9
9
|
visibleOptions: TypeaheadOption[];
|
package/js/bundle/bundle.js
CHANGED
|
@@ -15015,6 +15015,48 @@ function trimmedEndIndex(string) {
|
|
|
15015
15015
|
|
|
15016
15016
|
/***/ }),
|
|
15017
15017
|
|
|
15018
|
+
/***/ "../../node_modules/lodash-es/cloneDeep.js":
|
|
15019
|
+
/*!*************************************************!*\
|
|
15020
|
+
!*** ../../node_modules/lodash-es/cloneDeep.js ***!
|
|
15021
|
+
\*************************************************/
|
|
15022
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
15023
|
+
|
|
15024
|
+
"use strict";
|
|
15025
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
15026
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
15027
|
+
/* harmony export */ });
|
|
15028
|
+
/* harmony import */ var _baseClone_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_baseClone.js */ "../../node_modules/lodash-es/_baseClone.js");
|
|
15029
|
+
|
|
15030
|
+
|
|
15031
|
+
/** Used to compose bitmasks for cloning. */
|
|
15032
|
+
var CLONE_DEEP_FLAG = 1,
|
|
15033
|
+
CLONE_SYMBOLS_FLAG = 4;
|
|
15034
|
+
|
|
15035
|
+
/**
|
|
15036
|
+
* This method is like `_.clone` except that it recursively clones `value`.
|
|
15037
|
+
*
|
|
15038
|
+
* @static
|
|
15039
|
+
* @memberOf _
|
|
15040
|
+
* @since 1.0.0
|
|
15041
|
+
* @category Lang
|
|
15042
|
+
* @param {*} value The value to recursively clone.
|
|
15043
|
+
* @returns {*} Returns the deep cloned value.
|
|
15044
|
+
* @see _.clone
|
|
15045
|
+
* @example
|
|
15046
|
+
*
|
|
15047
|
+
* var objects = [{ 'a': 1 }, { 'b': 2 }];
|
|
15048
|
+
*
|
|
15049
|
+
* var deep = _.cloneDeep(objects);
|
|
15050
|
+
* console.log(deep[0] === objects[0]);
|
|
15051
|
+
* // => false
|
|
15052
|
+
*/
|
|
15053
|
+
function cloneDeep(value) {
|
|
15054
|
+
return (0,_baseClone_js__WEBPACK_IMPORTED_MODULE_0__["default"])(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
15055
|
+
}
|
|
15056
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cloneDeep);
|
|
15057
|
+
|
|
15058
|
+
/***/ }),
|
|
15059
|
+
|
|
15018
15060
|
/***/ "../../node_modules/lodash-es/constant.js":
|
|
15019
15061
|
/*!************************************************!*\
|
|
15020
15062
|
!*** ../../node_modules/lodash-es/constant.js ***!
|
|
@@ -45651,7 +45693,8 @@ var CharactersCounter = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.memo)
|
|
|
45651
45693
|
/* harmony export */ });
|
|
45652
45694
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
45653
45695
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
45654
|
-
/* harmony import */ var
|
|
45696
|
+
/* harmony import */ var lodash_es_isEqual__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash-es/isEqual */ "../../node_modules/lodash-es/isEqual.js");
|
|
45697
|
+
/* harmony import */ var lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! lodash-es/cloneDeep */ "../../node_modules/lodash-es/cloneDeep.js");
|
|
45655
45698
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
45656
45699
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
|
|
45657
45700
|
/* harmony import */ var slate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! slate */ "slate");
|
|
@@ -45685,6 +45728,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
|
45685
45728
|
|
|
45686
45729
|
|
|
45687
45730
|
|
|
45731
|
+
|
|
45688
45732
|
function ChatMessageBodyBase(_ref) {
|
|
45689
45733
|
var itemKey = _ref.itemKey,
|
|
45690
45734
|
textBoxAriaLabel = _ref.textBoxAriaLabel,
|
|
@@ -45702,8 +45746,10 @@ function ChatMessageBodyBase(_ref) {
|
|
|
45702
45746
|
editableContentClassName = _ref.editableContentClassName,
|
|
45703
45747
|
mentionsPropmptText = _ref.mentionsPropmptText,
|
|
45704
45748
|
autoFocus = _ref.autoFocus,
|
|
45705
|
-
|
|
45706
|
-
|
|
45749
|
+
value = _ref.value;
|
|
45750
|
+
var slateValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
45751
|
+
return (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_12__["default"])(value !== null && value !== void 0 ? value : _constants__WEBPACK_IMPORTED_MODULE_9__.DEFAULT_VALUE);
|
|
45752
|
+
}, [value]);
|
|
45707
45753
|
var anchorRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
45708
45754
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),
|
|
45709
45755
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -45734,10 +45780,10 @@ function ChatMessageBodyBase(_ref) {
|
|
|
45734
45780
|
event.preventDefault();
|
|
45735
45781
|
onSubmit({
|
|
45736
45782
|
key: itemKey,
|
|
45737
|
-
value:
|
|
45783
|
+
value: slateValue
|
|
45738
45784
|
});
|
|
45739
45785
|
}
|
|
45740
|
-
}, [mentions, target,
|
|
45786
|
+
}, [mentions, target, slateValue, itemKey, onSubmit]);
|
|
45741
45787
|
var handleChange = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (val) {
|
|
45742
45788
|
onChange({
|
|
45743
45789
|
key: itemKey,
|
|
@@ -45807,13 +45853,13 @@ function ChatMessageBodyBase(_ref) {
|
|
|
45807
45853
|
});
|
|
45808
45854
|
}, [search]);
|
|
45809
45855
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
45810
|
-
if (!(0,
|
|
45811
|
-
(0,_utils__WEBPACK_IMPORTED_MODULE_11__.resetNodes)(editor,
|
|
45856
|
+
if (!(0,lodash_es_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(editor.children, slateValue)) {
|
|
45857
|
+
(0,_utils__WEBPACK_IMPORTED_MODULE_11__.resetNodes)(editor, slateValue);
|
|
45812
45858
|
}
|
|
45813
|
-
}, [
|
|
45859
|
+
}, [slateValue, editor]);
|
|
45814
45860
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(slate_react__WEBPACK_IMPORTED_MODULE_3__.Slate, {
|
|
45815
45861
|
editor: editor,
|
|
45816
|
-
initialValue:
|
|
45862
|
+
initialValue: slateValue,
|
|
45817
45863
|
onChange: handleChange
|
|
45818
45864
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
|
45819
45865
|
"test-id": "chat-item-body-editable-content-".concat(itemKey),
|
|
@@ -46436,6 +46482,7 @@ var getOptionsTriggerIcon = function getOptionsTriggerIcon() {
|
|
|
46436
46482
|
/* harmony export */ });
|
|
46437
46483
|
/* harmony import */ var slate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! slate */ "slate");
|
|
46438
46484
|
/* harmony import */ var slate__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(slate__WEBPACK_IMPORTED_MODULE_0__);
|
|
46485
|
+
/* harmony import */ var lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash-es/cloneDeep */ "../../node_modules/lodash-es/cloneDeep.js");
|
|
46439
46486
|
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./src/components/chat/constants.ts");
|
|
46440
46487
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
46441
46488
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -46445,6 +46492,7 @@ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(
|
|
|
46445
46492
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
46446
46493
|
|
|
46447
46494
|
|
|
46495
|
+
|
|
46448
46496
|
function isMentionElement(type) {
|
|
46449
46497
|
return type === _constants__WEBPACK_IMPORTED_MODULE_1__.CUSTOM_ELEMENT_TYPES.mention;
|
|
46450
46498
|
}
|
|
@@ -46471,11 +46519,13 @@ function resetNodes(editor, nodes) {
|
|
|
46471
46519
|
node: node
|
|
46472
46520
|
});
|
|
46473
46521
|
});
|
|
46522
|
+
|
|
46523
|
+
// Clone nodes before inserting so multiple editors never share Slate node refs.
|
|
46474
46524
|
nodes.forEach(function (node, i) {
|
|
46475
46525
|
return editor.apply({
|
|
46476
46526
|
type: 'insert_node',
|
|
46477
46527
|
path: [i],
|
|
46478
|
-
node: node
|
|
46528
|
+
node: (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_2__["default"])(node)
|
|
46479
46529
|
});
|
|
46480
46530
|
});
|
|
46481
46531
|
var point = slate__WEBPACK_IMPORTED_MODULE_0__.Editor.end(editor, []);
|
|
@@ -83181,7 +83231,8 @@ function TabularDataTooltip(_ref) {
|
|
|
83181
83231
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
83182
83232
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
83183
83233
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
|
|
83184
|
-
/* harmony import */ var
|
|
83234
|
+
/* harmony import */ var lodash_es_isEqual__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! lodash-es/isEqual */ "../../node_modules/lodash-es/isEqual.js");
|
|
83235
|
+
/* harmony import */ var lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! lodash-es/cloneDeep */ "../../node_modules/lodash-es/cloneDeep.js");
|
|
83185
83236
|
/* harmony import */ var slate_history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! slate-history */ "slate-history");
|
|
83186
83237
|
/* harmony import */ var slate_history__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(slate_history__WEBPACK_IMPORTED_MODULE_2__);
|
|
83187
83238
|
/* harmony import */ var _chat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../chat */ "./src/components/chat/index.ts");
|
|
@@ -83201,6 +83252,7 @@ function TabularDataTooltip(_ref) {
|
|
|
83201
83252
|
|
|
83202
83253
|
|
|
83203
83254
|
|
|
83255
|
+
|
|
83204
83256
|
function EditedTextComponent(_ref) {
|
|
83205
83257
|
var value = _ref.value,
|
|
83206
83258
|
placeholder = _ref.placeholder,
|
|
@@ -83221,12 +83273,21 @@ function EditedTextComponent(_ref) {
|
|
|
83221
83273
|
var editor = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
83222
83274
|
return (0,_hooks_with_links__WEBPACK_IMPORTED_MODULE_6__["default"])((0,slate_history__WEBPACK_IMPORTED_MODULE_2__.withHistory)(withReact(createEditor())));
|
|
83223
83275
|
}, []);
|
|
83276
|
+
|
|
83277
|
+
// Clone the incoming value so this editor instance owns its own Slate node
|
|
83278
|
+
// references. slate-dom 0.123+ keys internal WeakMaps by node identity, and
|
|
83279
|
+
// sharing node references across editors (e.g. the same value bound to a
|
|
83280
|
+
// form's TextEditor and a preview's EditedText at the same time) makes
|
|
83281
|
+
// findPath throw "Unable to find the path for Slate node".
|
|
83282
|
+
var slateValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
83283
|
+
return value ? (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_9__["default"])(value) : value;
|
|
83284
|
+
}, [value]);
|
|
83224
83285
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
83225
|
-
if (
|
|
83286
|
+
if (slateValue && !(0,lodash_es_isEqual__WEBPACK_IMPORTED_MODULE_10__["default"])(editor.children, slateValue)) {
|
|
83226
83287
|
// Update the cached value inside the editor
|
|
83227
|
-
(0,_chat__WEBPACK_IMPORTED_MODULE_3__.resetNodes)(editor,
|
|
83288
|
+
(0,_chat__WEBPACK_IMPORTED_MODULE_3__.resetNodes)(editor, slateValue);
|
|
83228
83289
|
}
|
|
83229
|
-
}, [
|
|
83290
|
+
}, [slateValue, editor]);
|
|
83230
83291
|
var ariaAttrs = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
83231
83292
|
return {
|
|
83232
83293
|
'aria-label': ariaLabel
|
|
@@ -83237,7 +83298,7 @@ function EditedTextComponent(_ref) {
|
|
|
83237
83298
|
// Slate throws an error when no onChange is given, providing a noop func to avoid issues
|
|
83238
83299
|
react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Slate, {
|
|
83239
83300
|
editor: editor,
|
|
83240
|
-
initialValue:
|
|
83301
|
+
initialValue: slateValue,
|
|
83241
83302
|
onChange: function onChange() {
|
|
83242
83303
|
return undefined;
|
|
83243
83304
|
}
|
|
@@ -85225,7 +85286,8 @@ function TextEditorToolbar(_ref) {
|
|
|
85225
85286
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
85226
85287
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js");
|
|
85227
85288
|
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
|
|
85228
|
-
/* harmony import */ var
|
|
85289
|
+
/* harmony import */ var lodash_es_isEqual__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! lodash-es/isEqual */ "../../node_modules/lodash-es/isEqual.js");
|
|
85290
|
+
/* harmony import */ var lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! lodash-es/cloneDeep */ "../../node_modules/lodash-es/cloneDeep.js");
|
|
85229
85291
|
/* harmony import */ var slate_history__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! slate-history */ "slate-history");
|
|
85230
85292
|
/* harmony import */ var slate_history__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(slate_history__WEBPACK_IMPORTED_MODULE_2__);
|
|
85231
85293
|
/* harmony import */ var _form_field__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../form-field */ "./src/components/form-field/index.ts");
|
|
@@ -85271,6 +85333,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
85271
85333
|
|
|
85272
85334
|
|
|
85273
85335
|
|
|
85336
|
+
|
|
85274
85337
|
function TextEditorComponent(_ref) {
|
|
85275
85338
|
var name = _ref.name,
|
|
85276
85339
|
type = _ref.type,
|
|
@@ -85337,9 +85400,17 @@ function TextEditorComponent(_ref) {
|
|
|
85337
85400
|
return (0,_chat__WEBPACK_IMPORTED_MODULE_4__.withMaxLength)(maxLength)((0,_hooks_with_links__WEBPACK_IMPORTED_MODULE_9__["default"])((0,slate_history__WEBPACK_IMPORTED_MODULE_2__.withHistory)(withReact(createEditor()))));
|
|
85338
85401
|
}, [maxLength]);
|
|
85339
85402
|
var selection = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
85340
|
-
|
|
85403
|
+
// Clone the incoming value so this editor instance owns its own Slate node
|
|
85404
|
+
// references. slate-dom 0.123+ keys internal WeakMaps by node identity, and
|
|
85405
|
+
// sharing the same node references across editors (e.g. several editors
|
|
85406
|
+
// falling back to TEXT_EDITOR_DEFAULT_VALUE, or the same parent state being
|
|
85407
|
+
// bound to multiple editors at once) makes findPath throw
|
|
85408
|
+
// "Unable to find the path for Slate node".
|
|
85409
|
+
var slateValue = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
85410
|
+
return (0,lodash_es_cloneDeep__WEBPACK_IMPORTED_MODULE_16__["default"])(value || initialValue || _text_editor_constants__WEBPACK_IMPORTED_MODULE_11__.TEXT_EDITOR_DEFAULT_VALUE);
|
|
85411
|
+
}, [value, initialValue]);
|
|
85341
85412
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
85342
|
-
if (!(0,
|
|
85413
|
+
if (!(0,lodash_es_isEqual__WEBPACK_IMPORTED_MODULE_17__["default"])(editor.children, slateValue)) {
|
|
85343
85414
|
// Update the cached value inside the editor
|
|
85344
85415
|
(0,_chat__WEBPACK_IMPORTED_MODULE_4__.resetNodes)(editor, slateValue);
|
|
85345
85416
|
}
|