@payloadcms/richtext-lexical 3.0.0-beta.133 → 3.0.0-beta.134
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/dist/exports/client/Field-S5G27AVI.js +2 -0
- package/dist/exports/client/Field-S5G27AVI.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-2CYU43GM.js +2 -0
- package/dist/exports/client/chunk-2CYU43GM.js.map +7 -0
- package/dist/exports/client/chunk-C7S3V4EB.js +2 -0
- package/dist/exports/client/chunk-C7S3V4EB.js.map +7 -0
- package/dist/exports/client/chunk-U7O7EYCP.js +2 -0
- package/dist/exports/client/chunk-U7O7EYCP.js.map +7 -0
- package/dist/exports/client/component-H3EYQ5KG.js +2 -0
- package/dist/exports/client/{component-YICNYPTU.js.map → component-H3EYQ5KG.js.map} +1 -1
- package/dist/exports/client/componentInline-ZGO3K4TA.js +2 -0
- package/dist/exports/client/componentInline-ZGO3K4TA.js.map +7 -0
- package/dist/exports/client/index.d.ts +7 -0
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +7 -7
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/client/component/BlockContent.d.ts +34 -9
- package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js +63 -158
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts +11 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js +37 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.d.ts +3 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.js +22 -0
- package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts +3 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts.map +1 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js +22 -0
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -0
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +242 -63
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts +5 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +28 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts +3 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +22 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -0
- package/dist/features/blocks/client/componentInline/index.d.ts +13 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +219 -43
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +7 -10
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +1 -3
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/commands.d.ts +0 -4
- package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/commands.js +0 -1
- package/dist/features/blocks/client/plugin/commands.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/index.js +28 -135
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +28 -2
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/typesClient.d.ts +1 -17
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +163 -78
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js +23 -1
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/lexical/LexicalProvider.d.ts.map +1 -1
- package/dist/lexical/LexicalProvider.js +9 -18
- package/dist/lexical/LexicalProvider.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.js +0 -12
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +27 -0
- package/dist/utilities/buildInitialState.d.ts.map +1 -0
- package/dist/utilities/buildInitialState.js +53 -0
- package/dist/utilities/buildInitialState.js.map +1 -0
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -5
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +8 -8
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
- package/package.json +6 -6
- package/dist/exports/client/Field-GWJ72IYP.js +0 -2
- package/dist/exports/client/Field-GWJ72IYP.js.map +0 -7
- package/dist/exports/client/chunk-D7PD5DUW.js +0 -2
- package/dist/exports/client/chunk-D7PD5DUW.js.map +0 -7
- package/dist/exports/client/chunk-XDEGE6I5.js +0 -2
- package/dist/exports/client/chunk-XDEGE6I5.js.map +0 -7
- package/dist/exports/client/chunk-YGRKYSDC.js +0 -2
- package/dist/exports/client/chunk-YGRKYSDC.js.map +0 -7
- package/dist/exports/client/component-KLNTKKNE.js +0 -2
- package/dist/exports/client/component-KLNTKKNE.js.map +0 -7
- package/dist/exports/client/component-YICNYPTU.js +0 -2
- package/dist/exports/client/componentInline-6RPSMLNJ.js +0 -2
- package/dist/exports/client/componentInline-6RPSMLNJ.js.map +0 -7
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts +0 -11
- package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +0 -1
- package/dist/features/blocks/client/component/FormSavePlugin.js +0 -53
- package/dist/features/blocks/client/component/FormSavePlugin.js.map +0 -1
package/dist/field/Field.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { FieldLabel, useEditDepth, useField, withCondition } from '@payloadcms/ui';
|
|
5
6
|
import React, { useCallback } from 'react';
|
|
@@ -8,102 +9,185 @@ import { LexicalProvider } from '../lexical/LexicalProvider.js';
|
|
|
8
9
|
import './bundled.css';
|
|
9
10
|
const baseClass = 'rich-text-lexical';
|
|
10
11
|
const RichTextComponent = props => {
|
|
12
|
+
const $ = _c(42);
|
|
11
13
|
const {
|
|
12
14
|
editorConfig,
|
|
13
|
-
field:
|
|
14
|
-
name,
|
|
15
|
-
admin: {
|
|
16
|
-
className,
|
|
17
|
-
readOnly: readOnlyFromAdmin,
|
|
18
|
-
style,
|
|
19
|
-
width
|
|
20
|
-
} = {},
|
|
21
|
-
label,
|
|
22
|
-
localized,
|
|
23
|
-
required
|
|
24
|
-
},
|
|
15
|
+
field: t0,
|
|
25
16
|
path: pathFromProps,
|
|
26
17
|
readOnly: readOnlyFromTopLevelProps,
|
|
27
18
|
validate
|
|
28
19
|
} = props;
|
|
20
|
+
const {
|
|
21
|
+
name,
|
|
22
|
+
admin: t1,
|
|
23
|
+
label,
|
|
24
|
+
localized,
|
|
25
|
+
required
|
|
26
|
+
} = t0;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[0] !== t1) {
|
|
29
|
+
t2 = t1 === undefined ? {} : t1;
|
|
30
|
+
$[0] = t1;
|
|
31
|
+
$[1] = t2;
|
|
32
|
+
} else {
|
|
33
|
+
t2 = $[1];
|
|
34
|
+
}
|
|
35
|
+
const {
|
|
36
|
+
className,
|
|
37
|
+
readOnly: readOnlyFromAdmin,
|
|
38
|
+
style,
|
|
39
|
+
width
|
|
40
|
+
} = t2;
|
|
29
41
|
const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin;
|
|
30
42
|
const path = pathFromProps ?? name;
|
|
31
43
|
const editDepth = useEditDepth();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
let t3;
|
|
45
|
+
if ($[2] !== validate || $[3] !== required) {
|
|
46
|
+
t3 = (value, validationOptions) => {
|
|
47
|
+
if (typeof validate === "function") {
|
|
48
|
+
return validate(value, {
|
|
49
|
+
...validationOptions,
|
|
50
|
+
required
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
$[2] = validate;
|
|
55
|
+
$[3] = required;
|
|
56
|
+
$[4] = t3;
|
|
57
|
+
} else {
|
|
58
|
+
t3 = $[4];
|
|
59
|
+
}
|
|
60
|
+
const memoizedValidate = t3;
|
|
61
|
+
let t4;
|
|
62
|
+
if ($[5] !== path || $[6] !== memoizedValidate) {
|
|
63
|
+
t4 = {
|
|
64
|
+
path,
|
|
65
|
+
validate: memoizedValidate
|
|
66
|
+
};
|
|
67
|
+
$[5] = path;
|
|
68
|
+
$[6] = memoizedValidate;
|
|
69
|
+
$[7] = t4;
|
|
70
|
+
} else {
|
|
71
|
+
t4 = $[7];
|
|
72
|
+
}
|
|
45
73
|
const {
|
|
46
|
-
customComponents:
|
|
47
|
-
AfterInput,
|
|
48
|
-
BeforeInput,
|
|
49
|
-
Description,
|
|
50
|
-
Error,
|
|
51
|
-
Label
|
|
52
|
-
} = {},
|
|
74
|
+
customComponents: t5,
|
|
53
75
|
formInitializing,
|
|
54
76
|
formProcessing,
|
|
55
77
|
initialValue,
|
|
56
78
|
setValue,
|
|
57
79
|
showError,
|
|
58
80
|
value: value_0
|
|
59
|
-
} = useField(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
81
|
+
} = useField(t4);
|
|
82
|
+
let t6;
|
|
83
|
+
if ($[8] !== t5) {
|
|
84
|
+
t6 = t5 === undefined ? {} : t5;
|
|
85
|
+
$[8] = t5;
|
|
86
|
+
$[9] = t6;
|
|
87
|
+
} else {
|
|
88
|
+
t6 = $[9];
|
|
89
|
+
}
|
|
90
|
+
const {
|
|
91
|
+
AfterInput,
|
|
92
|
+
BeforeInput,
|
|
93
|
+
Description,
|
|
94
|
+
Error,
|
|
95
|
+
Label
|
|
96
|
+
} = t6;
|
|
64
97
|
const disabled = readOnlyFromProps || formProcessing || formInitializing;
|
|
65
|
-
const
|
|
98
|
+
const t7 = showError && "error";
|
|
99
|
+
const t8 = disabled && `${baseClass}--read-only`;
|
|
100
|
+
const t9 = editorConfig?.admin?.hideGutter !== true ? `${baseClass}--show-gutter` : null;
|
|
101
|
+
let t10;
|
|
102
|
+
if ($[10] !== className || $[11] !== t7 || $[12] !== t8 || $[13] !== t9) {
|
|
103
|
+
t10 = [baseClass, "field-type", className, t7, t8, t9].filter(Boolean);
|
|
104
|
+
$[10] = className;
|
|
105
|
+
$[11] = t7;
|
|
106
|
+
$[12] = t8;
|
|
107
|
+
$[13] = t9;
|
|
108
|
+
$[14] = t10;
|
|
109
|
+
} else {
|
|
110
|
+
t10 = $[14];
|
|
111
|
+
}
|
|
112
|
+
const classes = t10.join(" ");
|
|
66
113
|
const pathWithEditDepth = `${path}.${editDepth}`;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
let t11;
|
|
115
|
+
if ($[15] !== setValue) {
|
|
116
|
+
t11 = editorState => {
|
|
117
|
+
setValue(editorState.toJSON());
|
|
118
|
+
};
|
|
119
|
+
$[15] = setValue;
|
|
120
|
+
$[16] = t11;
|
|
121
|
+
} else {
|
|
122
|
+
t11 = $[16];
|
|
123
|
+
}
|
|
124
|
+
const handleChange = t11;
|
|
125
|
+
let t12;
|
|
126
|
+
if ($[17] !== style || $[18] !== width || $[19] !== Label || $[20] !== label || $[21] !== localized || $[22] !== required || $[23] !== pathWithEditDepth || $[24] !== editorConfig || $[25] !== props || $[26] !== handleChange || $[27] !== disabled || $[28] !== value_0 || $[29] !== initialValue || $[30] !== path || $[31] !== BeforeInput || $[32] !== AfterInput || $[33] !== Description || $[34] !== Error || $[35] !== classes) {
|
|
127
|
+
let t13;
|
|
128
|
+
if ($[37] !== Label || $[38] !== label || $[39] !== localized || $[40] !== required) {
|
|
129
|
+
t13 = Label || _jsx(FieldLabel, {
|
|
130
|
+
label,
|
|
131
|
+
localized,
|
|
132
|
+
required
|
|
133
|
+
});
|
|
134
|
+
$[37] = Label;
|
|
135
|
+
$[38] = label;
|
|
136
|
+
$[39] = localized;
|
|
137
|
+
$[40] = required;
|
|
138
|
+
$[41] = t13;
|
|
139
|
+
} else {
|
|
140
|
+
t13 = $[41];
|
|
141
|
+
}
|
|
142
|
+
t12 = _jsxs("div", {
|
|
143
|
+
className: classes,
|
|
144
|
+
style: {
|
|
145
|
+
...style,
|
|
146
|
+
width
|
|
147
|
+
},
|
|
148
|
+
children: [Error, t13, _jsxs("div", {
|
|
149
|
+
className: `${baseClass}__wrap`,
|
|
150
|
+
children: [_jsxs(ErrorBoundary, {
|
|
151
|
+
fallbackRender,
|
|
152
|
+
onReset: _temp,
|
|
153
|
+
children: [BeforeInput, _jsx(LexicalProvider, {
|
|
154
|
+
composerKey: pathWithEditDepth,
|
|
155
|
+
editorConfig,
|
|
156
|
+
fieldProps: props,
|
|
157
|
+
onChange: handleChange,
|
|
158
|
+
readOnly: disabled,
|
|
159
|
+
value: value_0
|
|
160
|
+
}, JSON.stringify({
|
|
161
|
+
initialValue,
|
|
162
|
+
path
|
|
163
|
+
})), AfterInput]
|
|
164
|
+
}), Description]
|
|
165
|
+
})]
|
|
166
|
+
}, pathWithEditDepth);
|
|
167
|
+
$[17] = style;
|
|
168
|
+
$[18] = width;
|
|
169
|
+
$[19] = Label;
|
|
170
|
+
$[20] = label;
|
|
171
|
+
$[21] = localized;
|
|
172
|
+
$[22] = required;
|
|
173
|
+
$[23] = pathWithEditDepth;
|
|
174
|
+
$[24] = editorConfig;
|
|
175
|
+
$[25] = props;
|
|
176
|
+
$[26] = handleChange;
|
|
177
|
+
$[27] = disabled;
|
|
178
|
+
$[28] = value_0;
|
|
179
|
+
$[29] = initialValue;
|
|
180
|
+
$[30] = path;
|
|
181
|
+
$[31] = BeforeInput;
|
|
182
|
+
$[32] = AfterInput;
|
|
183
|
+
$[33] = Description;
|
|
184
|
+
$[34] = Error;
|
|
185
|
+
$[35] = classes;
|
|
186
|
+
$[36] = t12;
|
|
187
|
+
} else {
|
|
188
|
+
t12 = $[36];
|
|
189
|
+
}
|
|
190
|
+
return t12;
|
|
107
191
|
};
|
|
108
192
|
function fallbackRender({
|
|
109
193
|
error
|
|
@@ -123,4 +207,5 @@ function fallbackRender({
|
|
|
123
207
|
});
|
|
124
208
|
}
|
|
125
209
|
export const RichText = withCondition(RichTextComponent);
|
|
210
|
+
function _temp() {}
|
|
126
211
|
//# sourceMappingURL=Field.js.map
|
package/dist/field/Field.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","names":["FieldLabel","useEditDepth","useField","withCondition","React","useCallback","ErrorBoundary","LexicalProvider","baseClass","RichTextComponent","props","editorConfig","field","
|
|
1
|
+
{"version":3,"file":"Field.js","names":["c","_c","FieldLabel","useEditDepth","useField","withCondition","React","useCallback","ErrorBoundary","LexicalProvider","baseClass","RichTextComponent","props","$","editorConfig","field","t0","path","pathFromProps","readOnly","readOnlyFromTopLevelProps","validate","name","admin","t1","label","localized","required","t2","undefined","className","readOnlyFromAdmin","style","width","readOnlyFromProps","editDepth","t3","value","validationOptions","memoizedValidate","t4","customComponents","t5","formInitializing","formProcessing","initialValue","setValue","showError","value_0","t6","AfterInput","BeforeInput","Description","Error","Label","disabled","t7","t8","t9","hideGutter","t10","filter","Boolean","classes","join","pathWithEditDepth","t11","editorState","toJSON","handleChange","t12","t13","_jsx","_jsxs","children","fallbackRender","onReset","_temp","composerKey","fieldProps","onChange","JSON","stringify","error","role","color","message","RichText"],"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { EditorState, SerializedEditorState } from 'lexical'\n\nimport { FieldLabel, useEditDepth, useField, withCondition } from '@payloadcms/ui'\nimport React, { useCallback } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalRichTextFieldProps } from '../types.js'\n\nimport { LexicalProvider } from '../lexical/LexicalProvider.js'\nimport './bundled.css'\nimport './index.scss'\nimport '../lexical/theme/EditorTheme.scss'\n\nconst baseClass = 'rich-text-lexical'\n\nconst RichTextComponent: React.FC<\n {\n readonly editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n } & LexicalRichTextFieldProps\n> = (props) => {\n const {\n editorConfig,\n field: {\n name,\n admin: { className, readOnly: readOnlyFromAdmin, style, width } = {},\n label,\n localized,\n required,\n },\n path: pathFromProps,\n readOnly: readOnlyFromTopLevelProps,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n const path = pathFromProps ?? name\n\n const editDepth = useEditDepth()\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, required })\n }\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n formInitializing,\n formProcessing,\n initialValue,\n setValue,\n showError,\n value,\n } = useField<SerializedEditorState>({\n path,\n // @ts-expect-error: TODO: Fix this\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || formProcessing || formInitializing\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n disabled && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true ? `${baseClass}--show-gutter` : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n const pathWithEditDepth = `${path}.${editDepth}`\n\n const handleChange = useCallback(\n (editorState: EditorState) => {\n setValue(editorState.toJSON())\n },\n [setValue],\n )\n\n return (\n <div\n className={classes}\n key={pathWithEditDepth}\n style={{\n ...style,\n width,\n }}\n >\n {Error}\n {Label || <FieldLabel label={label} localized={localized} required={required} />}\n <div className={`${baseClass}__wrap`}>\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n {BeforeInput}\n <LexicalProvider\n composerKey={pathWithEditDepth}\n editorConfig={editorConfig}\n fieldProps={props}\n key={JSON.stringify({ initialValue, path })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={handleChange}\n readOnly={disabled}\n value={value}\n />\n {AfterInput}\n </ErrorBoundary>\n {Description}\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }): React.ReactElement {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = withCondition(RichTextComponent)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,UAAU,EAAEC,YAAY,EAAEC,QAAQ,EAAEC,aAAa,QAAQ;AAClE,OAAOC,KAAA,IAASC,WAAW,QAAQ;AACnC,SAASC,aAAa,QAAQ;AAK9B,SAASC,eAAe,QAAQ;AAChC,OAAO;AAIP,MAAMC,SAAA,GAAY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