@payloadcms/richtext-lexical 3.25.0 → 3.26.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/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/{chunk-EE27FURT.js → chunk-QBDC3MVG.js} +2 -2
- package/dist/exports/client/{chunk-EE27FURT.js.map → chunk-QBDC3MVG.js.map} +2 -2
- package/dist/exports/client/componentInline-IBB73SHH.js +2 -0
- package/dist/exports/client/index.js +2 -2
- package/dist/exports/client/index.js.map +2 -2
- package/dist/exports/react/components/RichText/converter/converters/upload.d.ts.map +1 -1
- package/dist/exports/react/components/RichText/converter/converters/upload.js +15 -15
- package/dist/exports/react/components/RichText/converter/converters/upload.js.map +1 -1
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +1 -0
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +1 -0
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/converters/htmlToLexical/index.d.ts +13 -0
- package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -0
- package/dist/features/converters/htmlToLexical/index.js +31 -0
- package/dist/features/converters/htmlToLexical/index.js.map +1 -0
- package/dist/features/upload/server/nodes/UploadNode.d.ts +17 -1
- package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -35
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +28 -27
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +57 -0
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -0
- package/dist/utilities/editorConfigFactory.js +89 -0
- package/dist/utilities/editorConfigFactory.js.map +1 -0
- package/package.json +7 -7
- package/dist/exports/client/componentInline-XEH2GDVO.js +0 -2
- /package/dist/exports/client/{componentInline-XEH2GDVO.js.map → componentInline-IBB73SHH.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AdapterProps, LexicalEditorProps, LexicalRichTextAdapterProvider } from './types.js';
|
|
2
2
|
export declare const lexicalTargetVersion = "0.21.0";
|
|
3
|
-
export declare function lexicalEditor(
|
|
3
|
+
export declare function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider;
|
|
4
4
|
export { AlignFeature } from './features/align/server/index.js';
|
|
5
5
|
export { BlockquoteFeature } from './features/blockquote/server/index.js';
|
|
6
6
|
export { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js';
|
|
@@ -14,6 +14,7 @@ export { convertLexicalNodesToHTML, convertLexicalToHTML, } from './features/con
|
|
|
14
14
|
export type { HTMLConverter } from './features/converters/html/converter/types.js';
|
|
15
15
|
export { consolidateHTMLConverters, lexicalHTML } from './features/converters/html/field/index.js';
|
|
16
16
|
export { HTMLConverterFeature, type HTMLConverterFeatureProps, } from './features/converters/html/index.js';
|
|
17
|
+
export { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js';
|
|
17
18
|
export { TestRecorderFeature } from './features/debug/testRecorder/server/index.js';
|
|
18
19
|
export { TreeViewFeature } from './features/debug/treeView/server/index.js';
|
|
19
20
|
export { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js';
|
|
@@ -52,8 +53,8 @@ export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig,
|
|
|
52
53
|
export { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js';
|
|
53
54
|
export { sanitizeServerEditorConfig, sanitizeServerFeatures, } from './lexical/config/server/sanitize.js';
|
|
54
55
|
export type { ClientEditorConfig, SanitizedClientEditorConfig, SanitizedServerEditorConfig, ServerEditorConfig, } from './lexical/config/types.js';
|
|
55
|
-
export { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js';
|
|
56
56
|
export type { AdapterProps };
|
|
57
|
+
export { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js';
|
|
57
58
|
export type { SlashMenuGroup, SlashMenuItem, } from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
|
|
58
59
|
export { DETAIL_TYPE_TO_DETAIL, DOUBLE_LINE_BREAK, ELEMENT_FORMAT_TO_TYPE, ELEMENT_TYPE_TO_FORMAT, IS_ALL_FORMATTING, LTR_REGEX, NodeFormat, NON_BREAKING_SPACE, RTL_REGEX, TEXT_MODE_TO_TYPE, TEXT_TYPE_TO_FORMAT, TEXT_TYPE_TO_MODE, } from './lexical/utils/nodeFormat.js';
|
|
59
60
|
export { sanitizeUrl, validateUrl } from './lexical/utils/url.js';
|
|
@@ -61,8 +62,9 @@ export type * from './nodeTypes.js';
|
|
|
61
62
|
export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js';
|
|
62
63
|
export { defaultRichTextValue } from './populateGraphQL/defaultValue.js';
|
|
63
64
|
export { populate } from './populateGraphQL/populate.js';
|
|
64
|
-
export type { LexicalEditorProps, LexicalRichTextAdapter } from './types.js';
|
|
65
|
+
export type { LexicalEditorProps, LexicalFieldAdminProps, LexicalRichTextAdapter } from './types.js';
|
|
65
66
|
export { createServerFeature } from './utilities/createServerFeature.js';
|
|
67
|
+
export { editorConfigFactory } from './utilities/editorConfigFactory.js';
|
|
66
68
|
export type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js';
|
|
67
69
|
export { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js';
|
|
68
70
|
export { extractFrontmatter, frontmatterToObject, objectToFrontmatter, propsToJSXString, } from './utilities/jsx/jsx.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAA;AAclG,eAAO,MAAM,oBAAoB,WAAW,CAAA;AAE5C,wBAAgB,aAAa,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,8BAA8B,CA4zBvF;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAC1F,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,WAAW,EAChB,eAAe,GAChB,MAAM,8CAA8C,CAAA;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,8DAA8D,CAAA;AAErG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAA;AAEzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAA;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,2DAA2D,CAAA;AACjG,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,+CAA+C,CAAA;AAEtD,YAAY,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAA;AAClF,OAAO,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAClG,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,GAC/B,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAA;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,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angeTraverseFields, afterReadTraverseFields, beforeChangeTraverseFields, beforeValidateTraverseFields, checkDependencies, withNullableJSONSchemaType } from 'payload';
|
|
2
2
|
import { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js';
|
|
3
3
|
import { i18n } from './i18n.js';
|
|
4
|
-
import {
|
|
5
|
-
import { loadFeatures } from './lexical/config/server/loader.js';
|
|
6
|
-
import { sanitizeServerFeatures } from './lexical/config/server/sanitize.js';
|
|
4
|
+
import { defaultEditorFeatures } from './lexical/config/server/default.js';
|
|
7
5
|
import { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js';
|
|
6
|
+
import { featuresInputToEditorConfig } from './utilities/editorConfigFactory.js';
|
|
8
7
|
import { getGenerateImportMap } from './utilities/generateImportMap.js';
|
|
9
8
|
import { getGenerateSchemaMap } from './utilities/generateSchemaMap.js';
|
|
10
9
|
import { recurseNodeTree } from './utilities/recurseNodeTree.js';
|
|
11
10
|
import { richTextValidateHOC } from './validate/index.js';
|
|
12
11
|
let checkedDependencies = false;
|
|
13
12
|
export const lexicalTargetVersion = '0.21.0';
|
|
14
|
-
export function lexicalEditor(
|
|
13
|
+
export function lexicalEditor(args) {
|
|
15
14
|
if (process.env.NODE_ENV !== 'production' && process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' && !checkedDependencies) {
|
|
16
15
|
checkedDependencies = true;
|
|
17
16
|
void checkDependencies({
|
|
@@ -31,7 +30,7 @@ export function lexicalEditor(props) {
|
|
|
31
30
|
let resolvedFeatureMap;
|
|
32
31
|
let finalSanitizedEditorConfig // For server only
|
|
33
32
|
;
|
|
34
|
-
if (!
|
|
33
|
+
if (!args || !args.features && !args.lexical) {
|
|
35
34
|
finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({
|
|
36
35
|
config,
|
|
37
36
|
parentIsLocalized
|
|
@@ -39,37 +38,16 @@ export function lexicalEditor(props) {
|
|
|
39
38
|
features = defaultEditorFeatures;
|
|
40
39
|
resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap;
|
|
41
40
|
} else {
|
|
42
|
-
|
|
43
|
-
const rootEditor = config.editor;
|
|
44
|
-
let rootEditorFeatures = [];
|
|
45
|
-
if (typeof rootEditor === 'object' && 'features' in rootEditor) {
|
|
46
|
-
rootEditorFeatures = rootEditor.features;
|
|
47
|
-
}
|
|
48
|
-
features = props.features({
|
|
49
|
-
defaultFeatures: defaultEditorFeatures,
|
|
50
|
-
rootFeatures: rootEditorFeatures
|
|
51
|
-
});
|
|
52
|
-
} else {
|
|
53
|
-
features = props.features;
|
|
54
|
-
}
|
|
55
|
-
if (!features) {
|
|
56
|
-
features = defaultEditorFeatures;
|
|
57
|
-
}
|
|
58
|
-
const lexical = props.lexical ?? defaultEditorConfig.lexical;
|
|
59
|
-
resolvedFeatureMap = await loadFeatures({
|
|
41
|
+
const result = await featuresInputToEditorConfig({
|
|
60
42
|
config,
|
|
43
|
+
features: args?.features,
|
|
61
44
|
isRoot,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
features,
|
|
65
|
-
lexical
|
|
66
|
-
}
|
|
45
|
+
lexical: args?.lexical,
|
|
46
|
+
parentIsLocalized
|
|
67
47
|
});
|
|
68
|
-
finalSanitizedEditorConfig =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
resolvedFeatureMap
|
|
72
|
-
};
|
|
48
|
+
finalSanitizedEditorConfig = result.sanitizedConfig;
|
|
49
|
+
features = result.features;
|
|
50
|
+
resolvedFeatureMap = result.resolvedFeatureMap;
|
|
73
51
|
}
|
|
74
52
|
const featureI18n = finalSanitizedEditorConfig.features.i18n;
|
|
75
53
|
for (const lang in i18n) {
|
|
@@ -85,7 +63,7 @@ export function lexicalEditor(props) {
|
|
|
85
63
|
CellComponent: {
|
|
86
64
|
path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',
|
|
87
65
|
serverProps: {
|
|
88
|
-
admin:
|
|
66
|
+
admin: args?.admin,
|
|
89
67
|
sanitizedEditorConfig: finalSanitizedEditorConfig
|
|
90
68
|
}
|
|
91
69
|
},
|
|
@@ -94,7 +72,7 @@ export function lexicalEditor(props) {
|
|
|
94
72
|
FieldComponent: {
|
|
95
73
|
path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',
|
|
96
74
|
serverProps: {
|
|
97
|
-
admin:
|
|
75
|
+
admin: args?.admin,
|
|
98
76
|
sanitizedEditorConfig: finalSanitizedEditorConfig
|
|
99
77
|
}
|
|
100
78
|
},
|
|
@@ -771,6 +749,7 @@ export { defaultHTMLConverters } from './features/converters/html/converter/defa
|
|
|
771
749
|
export { convertLexicalNodesToHTML, convertLexicalToHTML } from './features/converters/html/converter/index.js';
|
|
772
750
|
export { consolidateHTMLConverters, lexicalHTML } from './features/converters/html/field/index.js';
|
|
773
751
|
export { HTMLConverterFeature } from './features/converters/html/index.js';
|
|
752
|
+
export { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js';
|
|
774
753
|
export { TestRecorderFeature } from './features/debug/testRecorder/server/index.js';
|
|
775
754
|
export { TreeViewFeature } from './features/debug/treeView/server/index.js';
|
|
776
755
|
export { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js';
|
|
@@ -808,6 +787,7 @@ export { $convertFromMarkdownString } from './packages/@lexical/markdown/index.j
|
|
|
808
787
|
export { defaultRichTextValue } from './populateGraphQL/defaultValue.js';
|
|
809
788
|
export { populate } from './populateGraphQL/populate.js';
|
|
810
789
|
export { createServerFeature } from './utilities/createServerFeature.js';
|
|
790
|
+
export { editorConfigFactory } from './utilities/editorConfigFactory.js';
|
|
811
791
|
export { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js';
|
|
812
792
|
export { extractFrontmatter, frontmatterToObject, objectToFrontmatter, propsToJSXString } from './utilities/jsx/jsx.js';
|
|
813
793
|
export { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["afterChangeTraverseFields","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","checkDependencies","withNullableJSONSchemaType","getDefaultSanitizedEditorConfig","i18n","defaultEditorConfig","defaultEditorFeatures","loadFeatures","sanitizeServerFeatures","populateLexicalPopulationPromises","getGenerateImportMap","getGenerateSchemaMap","recurseNodeTree","richTextValidateHOC","checkedDependencies","lexicalTargetVersion","lexicalEditor","props","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","config","isRoot","parentIsLocalized","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","rootEditor","editor","rootEditorFeatures","defaultFeatures","rootFeatures","unSanitizedEditorConfig","featureI18n","lang","general","CellComponent","path","serverProps","admin","sanitizedEditorConfig","editorConfig","FieldComponent","generateImportMap","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","afterChange","args","collection","_context","data","global","indexPath","operation","originalDoc","previousDoc","previousValue","schemaPath","value","length","hook","nodeHooks","getSubFields","nodeIDMap","previousNodeIDMap","originalNodeIDMap","internal","richText","join","Object","keys","nodes","root","children","id","node","entries","afterChangeHooks","afterChangeHooksForNode","get","type","console","warn","originalNode","parentRichTextFieldPath","parentRichTextFieldSchemaPath","previousNode","subFieldFn","subFieldDataFn","getSubFieldsData","subFields","nodeSiblingData","nodeSiblingDoc","nodePreviousSiblingDoc","blockData","doc","fields","parentIndexPath","localized","parentPath","parentSchemaPath","previousSiblingDoc","siblingData","afterRead","fallbackLocale","locale","populate","triggerAccessControl","triggerHooks","flattenedNodes","afterReadHooks","afterReadHooksForNode","populateArg","beforeChange","docWithLocales","errors","mergeLocaleActions","siblingDocWithLocales","skipValidation","originalNodeWithLocalesIDMap","beforeChangeHooks","beforeChangeHooksForNode","originalNodeWithLocales","nodeSiblingDocWithLocales","newOriginalNodeIDMap","previousOriginalValue","beforeValidate","beforeValidateHooks","beforeValidateHooksForNode","outputSchema","collectionIDFieldTypes","interfaceNameDefinitions","isRequired","properties","additionalProperties","items","version","required","direction","oneOf","enum","format","indent","modifyOutputSchema","generatedTypes","modifyOutputSchemas","currentSchema","validate","AlignFeature","BlockquoteFeature","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","LinebreakHTMLConverter","ParagraphHTMLConverter","TabHTMLConverter","TextHTMLConverter","defaultHTMLConverters","convertLexicalNodesToHTML","convertLexicalToHTML","consolidateHTMLConverters","lexicalHTML","HTMLConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","AutoLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorLexicalConfig","sortFeaturesForOptimalLoading","sanitizeServerEditorConfig","getEnabledNodes","getEnabledNodesFromServerNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","$convertFromMarkdownString","defaultRichTextValue","createServerFeature","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport {\n afterChangeTraverseFields,\n afterReadTraverseFields,\n beforeChangeTraverseFields,\n beforeValidateTraverseFields,\n checkDependencies,\n withNullableJSONSchemaType,\n} from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type {\n AdapterProps,\n LexicalEditorProps,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from './types.js'\n\nimport { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js'\nimport { i18n } from './i18n.js'\nimport { defaultEditorConfig, defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { loadFeatures } from './lexical/config/server/loader.js'\nimport { sanitizeServerFeatures } from './lexical/config/server/sanitize.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { recurseNodeTree } from './utilities/recurseNodeTree.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.21.0'\n\nexport function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: lexicalTargetVersion,\n },\n ],\n })\n }\n return async ({ config, isRoot, parentIsLocalized }) => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!props || (!props.features && !props.lexical)) {\n finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({\n config,\n parentIsLocalized,\n })\n\n features = defaultEditorFeatures\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n if (props.features && typeof props.features === 'function') {\n const rootEditor = config.editor\n let rootEditorFeatures: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (typeof rootEditor === 'object' && 'features' in rootEditor) {\n rootEditorFeatures = (rootEditor as LexicalRichTextAdapter).features\n }\n features = props.features({\n defaultFeatures: defaultEditorFeatures,\n rootFeatures: rootEditorFeatures,\n })\n } else {\n features = props.features as FeatureProviderServer<unknown, unknown, unknown>[]\n }\n\n if (!features) {\n features = defaultEditorFeatures\n }\n\n const lexical = props.lexical ?? defaultEditorConfig.lexical\n\n resolvedFeatureMap = await loadFeatures({\n config,\n isRoot,\n parentIsLocalized,\n unSanitizedEditorConfig: {\n features,\n lexical,\n },\n })\n\n finalSanitizedEditorConfig = {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: props.lexical,\n resolvedFeatureMap,\n }\n }\n\n const featureI18n = finalSanitizedEditorConfig.features.i18n\n for (const lang in i18n) {\n if (!featureI18n[lang as keyof typeof featureI18n]) {\n featureI18n[lang as keyof typeof featureI18n] = {\n lexical: {},\n }\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n featureI18n[lang].lexical.general = i18n[lang]\n }\n\n return {\n CellComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n serverProps: {\n admin: props?.admin,\n sanitizedEditorConfig: finalSanitizedEditorConfig,\n },\n },\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: props?.admin,\n sanitizedEditorConfig: finalSanitizedEditorConfig,\n },\n },\n generateImportMap: getGenerateImportMap({\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: {\n afterChange: [\n async (args) => {\n const {\n collection,\n context: _context,\n data,\n field,\n global,\n indexPath,\n operation,\n originalDoc,\n parentIsLocalized,\n path,\n previousDoc,\n previousValue,\n req,\n schemaPath,\n } = args\n\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.afterChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterChange) {\n value = await hook(args)\n }\n }\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n // TO-DO: We should not use context, as it is intended for external use only\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n const previousNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n recurseNodeTree({\n nodeIDMap: previousNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const afterChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterChange\n const afterChangeHooksForNode = afterChangeHooks?.get(node.type)\n if (afterChangeHooksForNode) {\n for (const hook of afterChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(afterChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n\n previousNode: previousNodeIDMap[id]!,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n\n const nodeSiblingDoc = subFieldDataFn({ node: originalNodeIDMap[id]!, req }) ?? {}\n const nodePreviousSiblingDoc =\n subFieldDataFn({ node: previousNodeIDMap[id]!, req }) ?? {}\n\n if (subFields?.length) {\n await afterChangeTraverseFields({\n blockData: nodeSiblingData,\n collection,\n context,\n data: data ?? {},\n doc: originalDoc,\n fields: subFields,\n global,\n operation,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n previousDoc,\n previousSiblingDoc: { ...nodePreviousSiblingDoc },\n req,\n siblingData: nodeSiblingData || {},\n siblingDoc: { ...nodeSiblingDoc },\n })\n }\n }\n }\n return value\n },\n ],\n afterRead: [\n /**\n * afterRead hooks do not receive the originalNode. Thus, they can run on all nodes, not just nodes with an ID.\n */\n async (args) => {\n const {\n collection,\n context: context,\n currentDepth,\n depth,\n draft,\n fallbackLocale,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n global,\n indexPath,\n locale,\n originalDoc,\n overrideAccess,\n parentIsLocalized,\n path,\n populate,\n populationPromises,\n req,\n schemaPath,\n showHiddenFields,\n triggerAccessControl,\n triggerHooks,\n } = args\n\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.afterRead?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterRead) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterRead?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n const flattenedNodes: SerializedLexicalNode[] = []\n\n recurseNodeTree({\n flattenedNodes,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n for (let node of flattenedNodes) {\n const afterReadHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterRead\n const afterReadHooksForNode = afterReadHooks?.get(node.type)\n if (afterReadHooksForNode) {\n for (const hook of afterReadHooksForNode) {\n node = await hook({\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n locale: locale!,\n node,\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n populateArg: populate,\n populationPromises: populationPromises!,\n req,\n showHiddenFields: showHiddenFields!,\n triggerAccessControl: triggerAccessControl!,\n triggerHooks: triggerHooks!,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n\n if (subFields?.length) {\n afterReadTraverseFields({\n blockData: nodeSiblingData,\n collection,\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n doc: originalDoc,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n fields: subFields,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n global,\n locale: locale!,\n overrideAccess: overrideAccess!,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n populate,\n populationPromises: populationPromises!,\n req,\n showHiddenFields: showHiddenFields!,\n siblingDoc: nodeSiblingData,\n triggerAccessControl,\n triggerHooks,\n })\n }\n }\n }\n\n return value\n },\n ],\n beforeChange: [\n async (args) => {\n const {\n collection,\n context: _context,\n data,\n docWithLocales,\n errors,\n field,\n global,\n indexPath,\n mergeLocaleActions,\n operation,\n originalDoc,\n parentIsLocalized,\n path,\n previousValue,\n req,\n schemaPath,\n siblingData,\n siblingDocWithLocales,\n skipValidation,\n } = args\n\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeChange) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n // TO-DO: We should not use context, as it is intended for external use only\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n const previousNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n const originalNodeWithLocalesIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n recurseNodeTree({\n nodeIDMap: previousNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n if (field.name && siblingDocWithLocales?.[field.name]) {\n recurseNodeTree({\n nodeIDMap: originalNodeWithLocalesIDMap,\n nodes:\n (siblingDocWithLocales[field.name] as SerializedEditorState)?.root?.children ??\n [],\n })\n }\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.beforeChange\n const beforeChangeHooksForNode = beforeChangeHooks?.get(node.type)\n if (beforeChangeHooksForNode) {\n for (const hook of beforeChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n errors: errors!,\n mergeLocaleActions: mergeLocaleActions!,\n node,\n operation: operation!,\n originalNode: originalNodeIDMap[id],\n originalNodeWithLocales: originalNodeWithLocalesIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n\n previousNode: previousNodeIDMap[id]!,\n req,\n skipValidation: skipValidation!,\n })\n }\n }\n\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n const nodeSiblingDocWithLocales =\n subFieldDataFn({\n node: originalNodeWithLocalesIDMap[id]!,\n req,\n }) ?? {}\n const nodePreviousSiblingDoc =\n subFieldDataFn({ node: previousNodeIDMap[id]!, req }) ?? {}\n\n if (subFields?.length) {\n await beforeChangeTraverseFields({\n id,\n blockData: nodeSiblingData,\n collection,\n context,\n data: data ?? {},\n doc: originalDoc ?? {},\n docWithLocales: docWithLocales ?? {},\n errors: errors!,\n fields: subFields,\n global,\n mergeLocaleActions: mergeLocaleActions!,\n operation: operation!,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n req,\n siblingData: nodeSiblingData,\n siblingDoc: nodePreviousSiblingDoc,\n siblingDocWithLocales: nodeSiblingDocWithLocales ?? {},\n skipValidation,\n })\n }\n }\n }\n\n /**\n * within the beforeChange hook, id's may be re-generated.\n * Example:\n * 1. Seed data contains IDs for block feature blocks.\n * 2. Those are used in beforeValidate\n * 3. in beforeChange, those IDs are regenerated, because you cannot provide IDs during document creation. See baseIDField beforeChange hook for reasoning\n * 4. Thus, in order for all post-beforeChange hooks to receive the correct ID, we need to update the originalNodeIDMap with the new ID's, by regenerating the nodeIDMap.\n * The reason this is not generated for every hook, is to save on performance. We know we only really have to generate it in beforeValidate, which is the first hook,\n * and in beforeChange, which is where modifications to the provided IDs can occur.\n */\n const newOriginalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n const previousOriginalValue = siblingData[field.name!]\n\n recurseNodeTree({\n nodeIDMap: newOriginalNodeIDMap,\n nodes: (previousOriginalValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!context.internal.richText) {\n context.internal.richText = {}\n }\n context.internal.richText[path.join('.')] = {\n originalNodeIDMap: newOriginalNodeIDMap,\n }\n\n return value\n },\n ],\n beforeValidate: [\n async (args) => {\n const {\n collection,\n context,\n data,\n field,\n global,\n indexPath,\n operation,\n originalDoc,\n overrideAccess,\n parentIsLocalized,\n path,\n previousValue,\n req,\n schemaPath,\n } = args\n\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeValidate?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeValidate) {\n value = await hook(args)\n }\n }\n\n // return value if there are NO hooks\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n /**\n * beforeValidate is the first field hook which runs. This is where we can create the node map, which can then be used in the other hooks.\n *\n */\n\n /**\n * flattenedNodes contains all nodes in the editor, in the order they appear in the editor. They will be used for the following hooks:\n * - afterRead\n *\n * The other hooks require nodes to have IDs, which is why those are ran only from the nodeIDMap. They require IDs because they have both doc/siblingDoc and data/siblingData, and\n * thus require a reliable way to match new node data to old node data. Given that node positions can change in between hooks, this is only reliably possible for nodes which are saved with\n * an ID.\n */\n //const flattenedNodes: SerializedLexicalNode[] = []\n\n /**\n * Only nodes with id's (so, nodes with hooks added to them) will be added to the nodeIDMap. They will be used for the following hooks:\n * - afterChange\n * - beforeChange\n * - beforeValidate\n *\n * Other hooks are handled by the flattenedNodes. All nodes in the nodeIDMap are part of flattenedNodes.\n */\n\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap: originalNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!(context as any).internal.richText) {\n ;(context as any).internal.richText = {}\n }\n ;(context as any).internal.richText[path.join('.')] = {\n originalNodeIDMap,\n }\n\n /**\n * Now that the maps for all hooks are set up, we can run the validate hook\n */\n if (!finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size) {\n return value\n }\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n recurseNodeTree({\n //flattenedNodes,\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeValidateHooks =\n finalSanitizedEditorConfig.features.nodeHooks.beforeValidate\n const beforeValidateHooksForNode = beforeValidateHooks?.get(node.type)\n if (beforeValidateHooksForNode) {\n for (const hook of beforeValidateHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeValidate) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n\n const nodeSiblingDoc = subFieldDataFn({ node: originalNodeIDMap[id]!, req }) ?? {}\n\n if (subFields?.length) {\n await beforeValidateTraverseFields({\n id,\n blockData: nodeSiblingData,\n collection,\n context,\n data,\n doc: originalDoc,\n fields: subFields,\n global,\n operation,\n overrideAccess: overrideAccess!,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n req,\n siblingData: nodeSiblingData,\n siblingDoc: nodeSiblingDoc,\n })\n }\n }\n }\n\n return value\n },\n ],\n },\n i18n: featureI18n,\n outputSchema: ({\n collectionIDFieldTypes,\n config,\n field,\n i18n,\n interfaceNameDefinitions,\n isRequired,\n }) => {\n let outputSchema: JSONSchema4 = {\n // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.\n // In the future, we should\n // 1) allow recursive children\n // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.\n type: withNullableJSONSchemaType('object', isRequired),\n properties: {\n root: {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: {\n type: 'string',\n },\n children: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: {\n type: 'string',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['type', 'version'],\n },\n },\n direction: {\n oneOf: [\n {\n enum: ['ltr', 'rtl'],\n },\n {\n type: 'null',\n },\n ],\n },\n format: {\n type: 'string',\n enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''], // ElementFormatType, since the root node is an element\n },\n indent: {\n type: 'integer',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['children', 'direction', 'format', 'indent', 'type', 'version'],\n },\n },\n required: ['root'],\n }\n for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes\n .modifyOutputSchemas) {\n outputSchema = modifyOutputSchema({\n collectionIDFieldTypes,\n config,\n currentSchema: outputSchema,\n field,\n i18n,\n interfaceNameDefinitions,\n isRequired,\n })\n }\n\n return outputSchema\n },\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js'\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n type BlockFields,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\n\nexport { LinebreakHTMLConverter } from './features/converters/html/converter/converters/linebreak.js'\nexport { ParagraphHTMLConverter } from './features/converters/html/converter/converters/paragraph.js'\n\nexport { TabHTMLConverter } from './features/converters/html/converter/converters/tab.js'\n\nexport { TextHTMLConverter } from './features/converters/html/converter/converters/text.js'\nexport { defaultHTMLConverters } from './features/converters/html/converter/defaultConverters.js'\nexport {\n convertLexicalNodesToHTML,\n convertLexicalToHTML,\n} from './features/converters/html/converter/index.js'\n\nexport type { HTMLConverter } from './features/converters/html/converter/types.js'\nexport { consolidateHTMLConverters, lexicalHTML } from './features/converters/html/field/index.js'\nexport {\n HTMLConverterFeature,\n type HTMLConverterFeatureProps,\n} from './features/converters/html/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\n\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\nexport { IndentFeature } from './features/indent/server/index.js'\n\nexport { AutoLinkNode } from './features/link/nodes/AutoLinkNode.js'\n\nexport { LinkNode } from './features/link/nodes/LinkNode.js'\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport type {\n SlateNode,\n SlateNodeConverter,\n} from './features/migrations/slateToLexical/converter/types.js'\n\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\nexport {\n type RelationshipData,\n RelationshipServerNode,\n} from './features/relationship/server/nodes/RelationshipNode.js'\n\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\n\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/feature.server.js'\n\nexport type { UploadFeatureProps } from './features/upload/server/feature.server.js'\nexport { type UploadData, UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\n\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\n\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\n\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js'\nexport type { AdapterProps }\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\n\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport type * from './nodeTypes.js'\n\nexport { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js'\n\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\nexport { populate } from './populateGraphQL/populate.js'\nexport type { LexicalEditorProps, LexicalRichTextAdapter } from './types.js'\n\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\nexport { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js'\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from './utilities/jsx/jsx.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js'\n"],"mappings":"AAGA,SACEA,yBAAyB,EACzBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,iBAAiB,EACjBC,0BAA0B,QACrB;AAWP,SAASC,+BAA+B,QAAQ;AAChD,SAASC,IAAI,QAAQ;AACrB,SAASC,mBAAmB,EAAEC,qBAAqB,QAAQ;AAC3D,SAASC,YAAY,QAAQ;AAC7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,mBAAA,GAAsB;AAE1B,OAAO,MAAMC,oBAAA,G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Q;AACjC,SAASC,cAAc,QAAkC;AACzD,SAASC,qBAAqB,QAAQ;AACtC,SAASC,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAE7B,SAASC,QAAQ,QAAQ;AAEzB,SAASC,WAAW,QAAqC;AACzD,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,oBAAoB,QAAQ;AAOrC,SAASC,gBAAgB,QAAQ;AACjC,SACEC,mBAAmB,QAEd;AACP,SAEEC,sBAAsB,QACjB;AAEP,SAASC,mBAAmB,QAAQ;AACpC,SAASC,oBAAoB,QAAQ;AAsCrC,SAASC,UAAU,QAAQ,8BAA6B,CAAC;AAEzD,SAASC,aAAa,QAAQ;AAG9B,SAA0BC,gBAAgB,QAAQ;AAGlD,SACE/M,mBAAmB,EACnBC,qBAAqB,EACrB+M,0BAA0B,QACrB;AAEP,SAAS9M,YAAY,EAAE+M,6BAA6B,QAAQ;AAC5D,SACEC,0BAA0B,EAC1B/M,sBAAsB,QACjB;AAQP,SAASgN,eAAe,EAAEC,8BAA8B,QAAQ;AAQhE,SACEC,qBAAqB,EACrBC,iBAAiB,EACjBC,sBAAsB,EACtBC,sBAAsB,EACtBC,iBAAiB,EACjBC,SAAS,EACTC,UAAU,EACVC,kBAAkB,EAClBC,SAAS,EACTC,iBAAiB,EACjBC,mBAAmB,EACnBC,iBAAiB,QACZ;AACP,SAASC,WAAW,EAAEC,WAAW,QAAQ;AAIzC,SAASC,0BAA0B,QAAQ;AAE3C,SAASC,oBAAoB,QAAQ;AACrC,SAASzG,QAAQ,QAAQ;AAGzB,SAAS0G,mBAAmB,QAAQ;AAGpC,SAASC,8BAA8B,QAAQ;AAC/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["afterChangeTraverseFields","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","checkDependencies","withNullableJSONSchemaType","getDefaultSanitizedEditorConfig","i18n","defaultEditorFeatures","populateLexicalPopulationPromises","featuresInputToEditorConfig","getGenerateImportMap","getGenerateSchemaMap","recurseNodeTree","richTextValidateHOC","checkedDependencies","lexicalTargetVersion","lexicalEditor","args","process","env","NODE_ENV","PAYLOAD_DISABLE_DEPENDENCY_CHECKER","dependencyGroups","name","dependencies","targetVersion","config","isRoot","parentIsLocalized","features","resolvedFeatureMap","finalSanitizedEditorConfig","lexical","result","sanitizedConfig","featureI18n","lang","general","CellComponent","path","serverProps","admin","sanitizedEditorConfig","editorConfig","FieldComponent","generateImportMap","generateSchemaMap","graphQLPopulationPromises","context","currentDepth","depth","draft","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","size","editorPopulationPromises","hooks","afterChange","collection","_context","data","global","indexPath","operation","originalDoc","previousDoc","previousValue","schemaPath","value","length","hook","nodeHooks","getSubFields","nodeIDMap","previousNodeIDMap","originalNodeIDMap","internal","richText","join","Object","keys","nodes","root","children","id","node","entries","afterChangeHooks","afterChangeHooksForNode","get","type","console","warn","originalNode","parentRichTextFieldPath","parentRichTextFieldSchemaPath","previousNode","subFieldFn","subFieldDataFn","getSubFieldsData","subFields","nodeSiblingData","nodeSiblingDoc","nodePreviousSiblingDoc","blockData","doc","fields","parentIndexPath","localized","parentPath","parentSchemaPath","previousSiblingDoc","siblingData","afterRead","fallbackLocale","locale","populate","triggerAccessControl","triggerHooks","flattenedNodes","afterReadHooks","afterReadHooksForNode","populateArg","beforeChange","docWithLocales","errors","mergeLocaleActions","siblingDocWithLocales","skipValidation","originalNodeWithLocalesIDMap","beforeChangeHooks","beforeChangeHooksForNode","originalNodeWithLocales","nodeSiblingDocWithLocales","newOriginalNodeIDMap","previousOriginalValue","beforeValidate","beforeValidateHooks","beforeValidateHooksForNode","outputSchema","collectionIDFieldTypes","interfaceNameDefinitions","isRequired","properties","additionalProperties","items","version","required","direction","oneOf","enum","format","indent","modifyOutputSchema","generatedTypes","modifyOutputSchemas","currentSchema","validate","AlignFeature","BlockquoteFeature","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","LinebreakHTMLConverter","ParagraphHTMLConverter","TabHTMLConverter","TextHTMLConverter","defaultHTMLConverters","convertLexicalNodesToHTML","convertLexicalToHTML","consolidateHTMLConverters","lexicalHTML","HTMLConverterFeature","convertHTMLToLexical","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","AutoLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","FixedToolbarFeature","InlineToolbarFeature","createNode","UploadFeature","UploadServerNode","defaultEditorConfig","defaultEditorLexicalConfig","loadFeatures","sortFeaturesForOptimalLoading","sanitizeServerEditorConfig","sanitizeServerFeatures","getEnabledNodes","getEnabledNodesFromServerNodes","DETAIL_TYPE_TO_DETAIL","DOUBLE_LINE_BREAK","ELEMENT_FORMAT_TO_TYPE","ELEMENT_TYPE_TO_FORMAT","IS_ALL_FORMATTING","LTR_REGEX","NodeFormat","NON_BREAKING_SPACE","RTL_REGEX","TEXT_MODE_TO_TYPE","TEXT_TYPE_TO_FORMAT","TEXT_TYPE_TO_MODE","sanitizeUrl","validateUrl","$convertFromMarkdownString","defaultRichTextValue","createServerFeature","editorConfigFactory","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport {\n afterChangeTraverseFields,\n afterReadTraverseFields,\n beforeChangeTraverseFields,\n beforeValidateTraverseFields,\n checkDependencies,\n withNullableJSONSchemaType,\n} from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type { AdapterProps, LexicalEditorProps, LexicalRichTextAdapterProvider } from './types.js'\n\nimport { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js'\nimport { i18n } from './i18n.js'\nimport { defaultEditorFeatures } from './lexical/config/server/default.js'\nimport { populateLexicalPopulationPromises } from './populateGraphQL/populateLexicalPopulationPromises.js'\nimport { featuresInputToEditorConfig } from './utilities/editorConfigFactory.js'\nimport { getGenerateImportMap } from './utilities/generateImportMap.js'\nimport { getGenerateSchemaMap } from './utilities/generateSchemaMap.js'\nimport { recurseNodeTree } from './utilities/recurseNodeTree.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.21.0'\n\nexport function lexicalEditor(args?: LexicalEditorProps): LexicalRichTextAdapterProvider {\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.PAYLOAD_DISABLE_DEPENDENCY_CHECKER !== 'true' &&\n !checkedDependencies\n ) {\n checkedDependencies = true\n void checkDependencies({\n dependencyGroups: [\n {\n name: 'lexical',\n dependencies: [\n 'lexical',\n '@lexical/headless',\n '@lexical/link',\n '@lexical/list',\n '@lexical/mark',\n '@lexical/react',\n '@lexical/rich-text',\n '@lexical/selection',\n '@lexical/utils',\n ],\n targetVersion: lexicalTargetVersion,\n },\n ],\n })\n }\n return async ({ config, isRoot, parentIsLocalized }) => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n let resolvedFeatureMap: ResolvedServerFeatureMap\n\n let finalSanitizedEditorConfig: SanitizedServerEditorConfig // For server only\n if (!args || (!args.features && !args.lexical)) {\n finalSanitizedEditorConfig = await getDefaultSanitizedEditorConfig({\n config,\n parentIsLocalized,\n })\n\n features = defaultEditorFeatures\n\n resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap\n } else {\n const result = await featuresInputToEditorConfig({\n config,\n features: args?.features,\n isRoot,\n lexical: args?.lexical,\n parentIsLocalized,\n })\n finalSanitizedEditorConfig = result.sanitizedConfig\n features = result.features\n resolvedFeatureMap = result.resolvedFeatureMap\n }\n\n const featureI18n = finalSanitizedEditorConfig.features.i18n\n for (const lang in i18n) {\n if (!featureI18n[lang as keyof typeof featureI18n]) {\n featureI18n[lang as keyof typeof featureI18n] = {\n lexical: {},\n }\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n featureI18n[lang].lexical.general = i18n[lang]\n }\n\n return {\n CellComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n serverProps: {\n admin: args?.admin,\n sanitizedEditorConfig: finalSanitizedEditorConfig,\n },\n },\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: args?.admin,\n sanitizedEditorConfig: finalSanitizedEditorConfig,\n },\n },\n generateImportMap: getGenerateImportMap({\n resolvedFeatureMap,\n }),\n generateSchemaMap: getGenerateSchemaMap({\n resolvedFeatureMap,\n }),\n graphQLPopulationPromises({\n context,\n currentDepth,\n depth,\n draft,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n }) {\n // check if there are any features with nodes which have populationPromises for this field\n if (finalSanitizedEditorConfig?.features?.graphQLPopulationPromises?.size) {\n populateLexicalPopulationPromises({\n context,\n currentDepth: currentDepth ?? 0,\n depth,\n draft,\n editorPopulationPromises: finalSanitizedEditorConfig.features.graphQLPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n parentIsLocalized,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n },\n hooks: {\n afterChange: [\n async (args) => {\n const {\n collection,\n context: _context,\n data,\n field,\n global,\n indexPath,\n operation,\n originalDoc,\n parentIsLocalized,\n path,\n previousDoc,\n previousValue,\n req,\n schemaPath,\n } = args\n\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.afterChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterChange) {\n value = await hook(args)\n }\n }\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n // TO-DO: We should not use context, as it is intended for external use only\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n const previousNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n recurseNodeTree({\n nodeIDMap: previousNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const afterChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterChange\n const afterChangeHooksForNode = afterChangeHooks?.get(node.type)\n if (afterChangeHooksForNode) {\n for (const hook of afterChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(afterChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n\n previousNode: previousNodeIDMap[id]!,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n\n const nodeSiblingDoc = subFieldDataFn({ node: originalNodeIDMap[id]!, req }) ?? {}\n const nodePreviousSiblingDoc =\n subFieldDataFn({ node: previousNodeIDMap[id]!, req }) ?? {}\n\n if (subFields?.length) {\n await afterChangeTraverseFields({\n blockData: nodeSiblingData,\n collection,\n context,\n data: data ?? {},\n doc: originalDoc,\n fields: subFields,\n global,\n operation,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n previousDoc,\n previousSiblingDoc: { ...nodePreviousSiblingDoc },\n req,\n siblingData: nodeSiblingData || {},\n siblingDoc: { ...nodeSiblingDoc },\n })\n }\n }\n }\n return value\n },\n ],\n afterRead: [\n /**\n * afterRead hooks do not receive the originalNode. Thus, they can run on all nodes, not just nodes with an ID.\n */\n async (args) => {\n const {\n collection,\n context: context,\n currentDepth,\n depth,\n draft,\n fallbackLocale,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n global,\n indexPath,\n locale,\n originalDoc,\n overrideAccess,\n parentIsLocalized,\n path,\n populate,\n populationPromises,\n req,\n schemaPath,\n showHiddenFields,\n triggerAccessControl,\n triggerHooks,\n } = args\n\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.afterRead?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.afterRead) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.afterRead?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n const flattenedNodes: SerializedLexicalNode[] = []\n\n recurseNodeTree({\n flattenedNodes,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n for (let node of flattenedNodes) {\n const afterReadHooks = finalSanitizedEditorConfig.features.nodeHooks?.afterRead\n const afterReadHooksForNode = afterReadHooks?.get(node.type)\n if (afterReadHooksForNode) {\n for (const hook of afterReadHooksForNode) {\n node = await hook({\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n locale: locale!,\n node,\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n populateArg: populate,\n populationPromises: populationPromises!,\n req,\n showHiddenFields: showHiddenFields!,\n triggerAccessControl: triggerAccessControl!,\n triggerHooks: triggerHooks!,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n\n if (subFields?.length) {\n afterReadTraverseFields({\n blockData: nodeSiblingData,\n collection,\n context,\n currentDepth: currentDepth!,\n depth: depth!,\n doc: originalDoc,\n draft: draft!,\n fallbackLocale: fallbackLocale!,\n fieldPromises: fieldPromises!,\n fields: subFields,\n findMany: findMany!,\n flattenLocales: flattenLocales!,\n global,\n locale: locale!,\n overrideAccess: overrideAccess!,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n populate,\n populationPromises: populationPromises!,\n req,\n showHiddenFields: showHiddenFields!,\n siblingDoc: nodeSiblingData,\n triggerAccessControl,\n triggerHooks,\n })\n }\n }\n }\n\n return value\n },\n ],\n beforeChange: [\n async (args) => {\n const {\n collection,\n context: _context,\n data,\n docWithLocales,\n errors,\n field,\n global,\n indexPath,\n mergeLocaleActions,\n operation,\n originalDoc,\n parentIsLocalized,\n path,\n previousValue,\n req,\n schemaPath,\n siblingData,\n siblingDocWithLocales,\n skipValidation,\n } = args\n\n let { value } = args\n\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeChange?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeChange) {\n value = await hook(args)\n }\n }\n\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n // TO-DO: We should not use context, as it is intended for external use only\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const context: any = _context\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n /**\n * Get the originalNodeIDMap from the beforeValidate hook, which is always run before this hook.\n */\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = context?.internal?.richText?.[path.join('.')]?.originalNodeIDMap\n\n if (!originalNodeIDMap || !Object.keys(originalNodeIDMap).length || !value) {\n return value\n }\n const previousNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n const originalNodeWithLocalesIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n recurseNodeTree({\n nodeIDMap: previousNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n if (field.name && siblingDocWithLocales?.[field.name]) {\n recurseNodeTree({\n nodeIDMap: originalNodeWithLocalesIDMap,\n nodes:\n (siblingDocWithLocales[field.name] as SerializedEditorState)?.root?.children ??\n [],\n })\n }\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeChangeHooks = finalSanitizedEditorConfig.features.nodeHooks?.beforeChange\n const beforeChangeHooksForNode = beforeChangeHooks?.get(node.type)\n if (beforeChangeHooksForNode) {\n for (const hook of beforeChangeHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeChange) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n errors: errors!,\n mergeLocaleActions: mergeLocaleActions!,\n node,\n operation: operation!,\n originalNode: originalNodeIDMap[id],\n originalNodeWithLocales: originalNodeWithLocalesIDMap[id],\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n\n previousNode: previousNodeIDMap[id]!,\n req,\n skipValidation: skipValidation!,\n })\n }\n }\n\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n const nodeSiblingDocWithLocales =\n subFieldDataFn({\n node: originalNodeWithLocalesIDMap[id]!,\n req,\n }) ?? {}\n const nodePreviousSiblingDoc =\n subFieldDataFn({ node: previousNodeIDMap[id]!, req }) ?? {}\n\n if (subFields?.length) {\n await beforeChangeTraverseFields({\n id,\n blockData: nodeSiblingData,\n collection,\n context,\n data: data ?? {},\n doc: originalDoc ?? {},\n docWithLocales: docWithLocales ?? {},\n errors: errors!,\n fields: subFields,\n global,\n mergeLocaleActions: mergeLocaleActions!,\n operation: operation!,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n req,\n siblingData: nodeSiblingData,\n siblingDoc: nodePreviousSiblingDoc,\n siblingDocWithLocales: nodeSiblingDocWithLocales ?? {},\n skipValidation,\n })\n }\n }\n }\n\n /**\n * within the beforeChange hook, id's may be re-generated.\n * Example:\n * 1. Seed data contains IDs for block feature blocks.\n * 2. Those are used in beforeValidate\n * 3. in beforeChange, those IDs are regenerated, because you cannot provide IDs during document creation. See baseIDField beforeChange hook for reasoning\n * 4. Thus, in order for all post-beforeChange hooks to receive the correct ID, we need to update the originalNodeIDMap with the new ID's, by regenerating the nodeIDMap.\n * The reason this is not generated for every hook, is to save on performance. We know we only really have to generate it in beforeValidate, which is the first hook,\n * and in beforeChange, which is where modifications to the provided IDs can occur.\n */\n const newOriginalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n const previousOriginalValue = siblingData[field.name!]\n\n recurseNodeTree({\n nodeIDMap: newOriginalNodeIDMap,\n nodes: (previousOriginalValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!context.internal.richText) {\n context.internal.richText = {}\n }\n context.internal.richText[path.join('.')] = {\n originalNodeIDMap: newOriginalNodeIDMap,\n }\n\n return value\n },\n ],\n beforeValidate: [\n async (args) => {\n const {\n collection,\n context,\n data,\n field,\n global,\n indexPath,\n operation,\n originalDoc,\n overrideAccess,\n parentIsLocalized,\n path,\n previousValue,\n req,\n schemaPath,\n } = args\n\n let { value } = args\n if (finalSanitizedEditorConfig?.features?.hooks?.beforeValidate?.length) {\n for (const hook of finalSanitizedEditorConfig.features.hooks.beforeValidate) {\n value = await hook(args)\n }\n }\n\n // return value if there are NO hooks\n if (\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.afterChange?.size &&\n !finalSanitizedEditorConfig.features.nodeHooks?.beforeChange?.size &&\n !finalSanitizedEditorConfig.features.getSubFields?.size\n ) {\n return value\n }\n\n /**\n * beforeValidate is the first field hook which runs. This is where we can create the node map, which can then be used in the other hooks.\n *\n */\n\n /**\n * flattenedNodes contains all nodes in the editor, in the order they appear in the editor. They will be used for the following hooks:\n * - afterRead\n *\n * The other hooks require nodes to have IDs, which is why those are ran only from the nodeIDMap. They require IDs because they have both doc/siblingDoc and data/siblingData, and\n * thus require a reliable way to match new node data to old node data. Given that node positions can change in between hooks, this is only reliably possible for nodes which are saved with\n * an ID.\n */\n //const flattenedNodes: SerializedLexicalNode[] = []\n\n /**\n * Only nodes with id's (so, nodes with hooks added to them) will be added to the nodeIDMap. They will be used for the following hooks:\n * - afterChange\n * - beforeChange\n * - beforeValidate\n *\n * Other hooks are handled by the flattenedNodes. All nodes in the nodeIDMap are part of flattenedNodes.\n */\n\n const originalNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n\n recurseNodeTree({\n nodeIDMap: originalNodeIDMap,\n nodes: (previousValue as SerializedEditorState)?.root?.children ?? [],\n })\n\n if (!context.internal) {\n // Add to context, for other hooks to use\n context.internal = {}\n }\n if (!(context as any).internal.richText) {\n ;(context as any).internal.richText = {}\n }\n ;(context as any).internal.richText[path.join('.')] = {\n originalNodeIDMap,\n }\n\n /**\n * Now that the maps for all hooks are set up, we can run the validate hook\n */\n if (!finalSanitizedEditorConfig.features.nodeHooks?.beforeValidate?.size) {\n return value\n }\n const nodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\n recurseNodeTree({\n //flattenedNodes,\n nodeIDMap,\n nodes: (value as SerializedEditorState)?.root?.children ?? [],\n })\n\n // eslint-disable-next-line prefer-const\n for (let [id, node] of Object.entries(nodeIDMap)) {\n const beforeValidateHooks =\n finalSanitizedEditorConfig.features.nodeHooks.beforeValidate\n const beforeValidateHooksForNode = beforeValidateHooks?.get(node.type)\n if (beforeValidateHooksForNode) {\n for (const hook of beforeValidateHooksForNode) {\n if (!originalNodeIDMap[id]) {\n console.warn(\n '(beforeValidate) No original node found for node with id',\n id,\n 'node:',\n node,\n 'path',\n path.join('.'),\n )\n continue\n }\n node = await hook({\n context,\n node,\n operation,\n originalNode: originalNodeIDMap[id],\n overrideAccess: overrideAccess!,\n parentRichTextFieldPath: path,\n parentRichTextFieldSchemaPath: schemaPath,\n req,\n })\n }\n }\n const subFieldFn = finalSanitizedEditorConfig.features.getSubFields?.get(node.type)\n const subFieldDataFn = finalSanitizedEditorConfig.features.getSubFieldsData?.get(\n node.type,\n )\n\n if (subFieldFn && subFieldDataFn) {\n const subFields = subFieldFn({ node, req })\n const nodeSiblingData = subFieldDataFn({ node, req }) ?? {}\n\n const nodeSiblingDoc = subFieldDataFn({ node: originalNodeIDMap[id]!, req }) ?? {}\n\n if (subFields?.length) {\n await beforeValidateTraverseFields({\n id,\n blockData: nodeSiblingData,\n collection,\n context,\n data,\n doc: originalDoc,\n fields: subFields,\n global,\n operation,\n overrideAccess: overrideAccess!,\n parentIndexPath: indexPath.join('-'),\n parentIsLocalized: parentIsLocalized || field.localized || false,\n parentPath: path.join('.'),\n parentSchemaPath: schemaPath.join('.'),\n req,\n siblingData: nodeSiblingData,\n siblingDoc: nodeSiblingDoc,\n })\n }\n }\n }\n\n return value\n },\n ],\n },\n i18n: featureI18n,\n outputSchema: ({\n collectionIDFieldTypes,\n config,\n field,\n i18n,\n interfaceNameDefinitions,\n isRequired,\n }) => {\n let outputSchema: JSONSchema4 = {\n // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.\n // In the future, we should\n // 1) allow recursive children\n // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.\n type: withNullableJSONSchemaType('object', isRequired),\n properties: {\n root: {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: {\n type: 'string',\n },\n children: {\n type: 'array',\n items: {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: {\n type: 'string',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['type', 'version'],\n },\n },\n direction: {\n oneOf: [\n {\n enum: ['ltr', 'rtl'],\n },\n {\n type: 'null',\n },\n ],\n },\n format: {\n type: 'string',\n enum: ['left', 'start', 'center', 'right', 'end', 'justify', ''], // ElementFormatType, since the root node is an element\n },\n indent: {\n type: 'integer',\n },\n version: {\n type: 'integer',\n },\n },\n required: ['children', 'direction', 'format', 'indent', 'type', 'version'],\n },\n },\n required: ['root'],\n }\n for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes\n .modifyOutputSchemas) {\n outputSchema = modifyOutputSchema({\n collectionIDFieldTypes,\n config,\n currentSchema: outputSchema,\n field,\n i18n,\n interfaceNameDefinitions,\n isRequired,\n })\n }\n\n return outputSchema\n },\n validate: richTextValidateHOC({\n editorConfig: finalSanitizedEditorConfig,\n }),\n }\n }\n}\n\nexport { AlignFeature } from './features/align/server/index.js'\nexport { BlockquoteFeature } from './features/blockquote/server/index.js'\nexport { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js'\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n type BlockFields,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\n\nexport { LinebreakHTMLConverter } from './features/converters/html/converter/converters/linebreak.js'\nexport { ParagraphHTMLConverter } from './features/converters/html/converter/converters/paragraph.js'\n\nexport { TabHTMLConverter } from './features/converters/html/converter/converters/tab.js'\n\nexport { TextHTMLConverter } from './features/converters/html/converter/converters/text.js'\nexport { defaultHTMLConverters } from './features/converters/html/converter/defaultConverters.js'\nexport {\n convertLexicalNodesToHTML,\n convertLexicalToHTML,\n} from './features/converters/html/converter/index.js'\n\nexport type { HTMLConverter } from './features/converters/html/converter/types.js'\nexport { consolidateHTMLConverters, lexicalHTML } from './features/converters/html/field/index.js'\nexport {\n HTMLConverterFeature,\n type HTMLConverterFeatureProps,\n} from './features/converters/html/index.js'\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\nexport { TestRecorderFeature } from './features/debug/testRecorder/server/index.js'\nexport { TreeViewFeature } from './features/debug/treeView/server/index.js'\nexport { EXPERIMENTAL_TableFeature } from './features/experimental_table/server/index.js'\nexport { BoldFeature } from './features/format/bold/feature.server.js'\nexport { InlineCodeFeature } from './features/format/inlineCode/feature.server.js'\n\nexport { ItalicFeature } from './features/format/italic/feature.server.js'\nexport { StrikethroughFeature } from './features/format/strikethrough/feature.server.js'\nexport { SubscriptFeature } from './features/format/subscript/feature.server.js'\nexport { SuperscriptFeature } from './features/format/superscript/feature.server.js'\nexport { UnderlineFeature } from './features/format/underline/feature.server.js'\nexport { HeadingFeature, type HeadingFeatureProps } from './features/heading/server/index.js'\nexport { HorizontalRuleFeature } from './features/horizontalRule/server/index.js'\n\nexport { IndentFeature } from './features/indent/server/index.js'\n\nexport { AutoLinkNode } from './features/link/nodes/AutoLinkNode.js'\nexport { LinkNode } from './features/link/nodes/LinkNode.js'\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\nexport { ChecklistFeature } from './features/lists/checklist/server/index.js'\nexport { OrderedListFeature } from './features/lists/orderedList/server/index.js'\n\nexport { UnorderedListFeature } from './features/lists/unorderedList/server/index.js'\n\nexport type {\n SlateNode,\n SlateNodeConverter,\n} from './features/migrations/slateToLexical/converter/types.js'\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\nexport {\n RelationshipFeature,\n type RelationshipFeatureProps,\n} from './features/relationship/server/index.js'\n\nexport {\n type RelationshipData,\n RelationshipServerNode,\n} from './features/relationship/server/nodes/RelationshipNode.js'\nexport { FixedToolbarFeature } from './features/toolbars/fixed/server/index.js'\n\nexport { InlineToolbarFeature } from './features/toolbars/inline/server/index.js'\nexport type { ToolbarGroup, ToolbarGroupItem } from './features/toolbars/types.js'\nexport type {\n BaseClientFeatureProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n PluginComponent,\n PluginComponentWithAnchor,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n SanitizedPlugin,\n} from './features/typesClient.js'\n\nexport type {\n AfterChangeNodeHook,\n AfterChangeNodeHookArgs,\n AfterReadNodeHook,\n AfterReadNodeHookArgs,\n BaseNodeHookArgs,\n BeforeChangeNodeHook,\n BeforeChangeNodeHookArgs,\n BeforeValidateNodeHook,\n BeforeValidateNodeHookArgs,\n FeatureProviderProviderServer,\n FeatureProviderServer,\n NodeValidation,\n NodeWithHooks,\n PopulationPromise,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n ServerFeature,\n ServerFeatureProviderMap,\n} from './features/typesServer.js'\n\nexport { createNode } from './features/typeUtilities.js' // Only useful in feature.server.ts\n\nexport { UploadFeature } from './features/upload/server/feature.server.js'\nexport type { UploadFeatureProps } from './features/upload/server/feature.server.js'\n\nexport { type UploadData, UploadServerNode } from './features/upload/server/nodes/UploadNode.js'\nexport type { EditorConfigContextType } from './lexical/config/client/EditorConfigProvider.js'\n\nexport {\n defaultEditorConfig,\n defaultEditorFeatures,\n defaultEditorLexicalConfig,\n} from './lexical/config/server/default.js'\nexport { loadFeatures, sortFeaturesForOptimalLoading } from './lexical/config/server/loader.js'\n\nexport {\n sanitizeServerEditorConfig,\n sanitizeServerFeatures,\n} from './lexical/config/server/sanitize.js'\nexport type {\n ClientEditorConfig,\n SanitizedClientEditorConfig,\n SanitizedServerEditorConfig,\n ServerEditorConfig,\n} from './lexical/config/types.js'\nexport type { AdapterProps }\n\nexport { getEnabledNodes, getEnabledNodesFromServerNodes } from './lexical/nodes/index.js'\n\nexport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from './lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nexport {\n DETAIL_TYPE_TO_DETAIL,\n DOUBLE_LINE_BREAK,\n ELEMENT_FORMAT_TO_TYPE,\n ELEMENT_TYPE_TO_FORMAT,\n IS_ALL_FORMATTING,\n LTR_REGEX,\n NodeFormat,\n NON_BREAKING_SPACE,\n RTL_REGEX,\n TEXT_MODE_TO_TYPE,\n TEXT_TYPE_TO_FORMAT,\n TEXT_TYPE_TO_MODE,\n} from './lexical/utils/nodeFormat.js'\n\nexport { sanitizeUrl, validateUrl } from './lexical/utils/url.js'\n\nexport type * from './nodeTypes.js'\n\nexport { $convertFromMarkdownString } from './packages/@lexical/markdown/index.js'\nexport { defaultRichTextValue } from './populateGraphQL/defaultValue.js'\nexport { populate } from './populateGraphQL/populate.js'\n\nexport type { LexicalEditorProps, LexicalFieldAdminProps, LexicalRichTextAdapter } from './types.js'\n\nexport { createServerFeature } from './utilities/createServerFeature.js'\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\nexport { extractPropsFromJSXPropsString } from './utilities/jsx/extractPropsFromJSXPropsString.js'\n\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from './utilities/jsx/jsx.js'\nexport { upgradeLexicalData } from './utilities/upgradeLexicalData/index.js'\n"],"mappings":"AAGA,SACEA,yBAAyB,EACzBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,iBAAiB,EACjBC,0BAA0B,QACrB;AAMP,SAASC,+BAA+B,QAAQ;AAChD,SAASC,IAAI,QAAQ;AACrB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,mBAAA,GAAsB;AAE1B,OAAO,MAAMC,oBAAA,GAAuB;AAEpC,OAAO,SAASC,cAAcC,IAAyB;EACrD,IACEC,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,gBACzBF,OAAA,CAAQC,GAAG,CAACE,kCAAkC,KAAK,UACnD,CAACP,mBAAA,EACD;IACAA,mBAAA,GAAsB;IACtB,KAAKX,iBAAA,CAAkB;MACrBmB,gBAAA,EAAkB,CAChB;QACEC,IAAA,EAAM;QACNC,YAAA,EAAc,CACZ,WACA,qBACA,iBACA,iBACA,iBACA,kBACA,sBACA,sBACA,iBACD;QACDC,aAAA,EAAeV;MACjB;IAEJ;EACF;EACA,OAAO,OAAO;IAAEW,MAAM;IAAEC,MAAM;IAAEC;EAAiB,CAAE;IACjD,IAAIC,QAAA,GAA+D,EAAE;I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,QAAQ;AACrC,SAAS7G,QAAQ,QAAQ;AAIzB,SAAS8G,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,8BAA8B,QAAQ;AAE/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ","ignoreList":[]}
|
package/dist/types.d.ts
CHANGED
|
@@ -21,35 +21,36 @@ export type LexicalFieldAdminProps = {
|
|
|
21
21
|
export type LexicalFieldAdminClientProps = {
|
|
22
22
|
placeholder?: string;
|
|
23
23
|
} & Omit<LexicalFieldAdminProps, 'placeholder'>;
|
|
24
|
+
export type FeaturesInput = (({ defaultFeatures, rootFeatures, }: {
|
|
25
|
+
/**
|
|
26
|
+
* This opinionated array contains all "recommended" default features.
|
|
27
|
+
*
|
|
28
|
+
* @Example
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* editor: lexicalEditor({
|
|
32
|
+
* features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],
|
|
33
|
+
* })
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
defaultFeatures: FeatureProviderServer<any, any, any>[];
|
|
37
|
+
/**
|
|
38
|
+
* This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).
|
|
39
|
+
* If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty.
|
|
40
|
+
*
|
|
41
|
+
* @Example
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* editor: lexicalEditor({
|
|
45
|
+
* features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],
|
|
46
|
+
* })
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
rootFeatures: FeatureProviderServer<any, any, any>[];
|
|
50
|
+
}) => FeatureProviderServer<any, any, any>[]) | FeatureProviderServer<any, any, any>[];
|
|
24
51
|
export type LexicalEditorProps = {
|
|
25
52
|
admin?: LexicalFieldAdminProps;
|
|
26
|
-
features?:
|
|
27
|
-
/**
|
|
28
|
-
* This opinionated array contains all "recommended" default features.
|
|
29
|
-
*
|
|
30
|
-
* @Example
|
|
31
|
-
*
|
|
32
|
-
* ```ts
|
|
33
|
-
* editor: lexicalEditor({
|
|
34
|
-
* features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],
|
|
35
|
-
* })
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
defaultFeatures: FeatureProviderServer<any, any, any>[];
|
|
39
|
-
/**
|
|
40
|
-
* This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).
|
|
41
|
-
* If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty.
|
|
42
|
-
*
|
|
43
|
-
* @Example
|
|
44
|
-
*
|
|
45
|
-
* ```ts
|
|
46
|
-
* editor: lexicalEditor({
|
|
47
|
-
* features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],
|
|
48
|
-
* })
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
rootFeatures: FeatureProviderServer<any, any, any>[];
|
|
52
|
-
}) => FeatureProviderServer<any, any, any>[]) | FeatureProviderServer<any, any, any>[];
|
|
53
|
+
features?: FeaturesInput;
|
|
53
54
|
lexical?: LexicalEditorConfig;
|
|
54
55
|
};
|
|
55
56
|
export type LexicalRichTextAdapter = {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EACV,WAAW,EACX,+BAA+B,EAC/B,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,WAAW,EACZ,MAAM,SAAS,CAAA;AAEhB,OAAO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],"sources":["../src/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'\nimport type {\n ClientField,\n DefaultServerCellComponentProps,\n LabelFunction,\n RichTextAdapter,\n RichTextFieldClient,\n RichTextFieldClientProps,\n SanitizedConfig,\n ServerFieldBase,\n StaticLabel,\n} from 'payload'\n\nimport type {\n BaseClientFeatureProps,\n FeatureProviderProviderClient,\n} from './features/typesClient.js'\nimport type { FeatureProviderServer } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type { InitialLexicalFormState } from './utilities/buildInitialState.js'\n\nexport type LexicalFieldAdminProps = {\n /**\n * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false\n */\n hideGutter?: boolean\n /**\n * Controls if the insert paragraph at the end button should be hidden. @default false\n */\n hideInsertParagraphAtEnd?: boolean\n /**\n * Changes the placeholder text in the editor if no content is present.\n */\n placeholder?: LabelFunction | StaticLabel\n}\n\nexport type LexicalFieldAdminClientProps = {\n placeholder?: string\n} & Omit<LexicalFieldAdminProps, 'placeholder'>\n\nexport type
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'\nimport type {\n ClientField,\n DefaultServerCellComponentProps,\n LabelFunction,\n RichTextAdapter,\n RichTextFieldClient,\n RichTextFieldClientProps,\n SanitizedConfig,\n ServerFieldBase,\n StaticLabel,\n} from 'payload'\n\nimport type {\n BaseClientFeatureProps,\n FeatureProviderProviderClient,\n} from './features/typesClient.js'\nimport type { FeatureProviderServer } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\nimport type { InitialLexicalFormState } from './utilities/buildInitialState.js'\n\nexport type LexicalFieldAdminProps = {\n /**\n * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false\n */\n hideGutter?: boolean\n /**\n * Controls if the insert paragraph at the end button should be hidden. @default false\n */\n hideInsertParagraphAtEnd?: boolean\n /**\n * Changes the placeholder text in the editor if no content is present.\n */\n placeholder?: LabelFunction | StaticLabel\n}\n\nexport type LexicalFieldAdminClientProps = {\n placeholder?: string\n} & Omit<LexicalFieldAdminProps, 'placeholder'>\n\nexport type FeaturesInput =\n | (({\n defaultFeatures,\n rootFeatures,\n }: {\n /**\n * This opinionated array contains all \"recommended\" default features.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n defaultFeatures: FeatureProviderServer<any, any, any>[]\n /**\n * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).\n * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n rootFeatures: FeatureProviderServer<any, any, any>[]\n }) => FeatureProviderServer<any, any, any>[])\n | FeatureProviderServer<any, any, any>[]\n\nexport type LexicalEditorProps = {\n admin?: LexicalFieldAdminProps\n features?: FeaturesInput\n lexical?: LexicalEditorConfig\n}\n\nexport type LexicalRichTextAdapter = {\n editorConfig: SanitizedServerEditorConfig\n features: FeatureProviderServer<any, any, any>[]\n} & RichTextAdapter<SerializedEditorState, AdapterProps>\n\nexport type LexicalRichTextAdapterProvider =\n /**\n * This is being called during the payload sanitization process\n */\n ({\n config,\n isRoot,\n parentIsLocalized,\n }: {\n config: SanitizedConfig\n isRoot?: boolean\n parentIsLocalized: boolean\n }) => Promise<LexicalRichTextAdapter>\n\nexport type SingleFeatureClientSchemaMap = {\n [key: string]: ClientField[]\n}\nexport type FeatureClientSchemaMap = {\n [featureKey: string]: SingleFeatureClientSchemaMap\n}\n\nexport type LexicalRichTextFieldProps = {\n admin?: LexicalFieldAdminClientProps\n // clientFeatures is added through the rsc field\n clientFeatures: {\n [featureKey: string]: {\n clientFeatureProps?: object\n clientFeatureProvider?: FeatureProviderProviderClient<any, any>\n }\n }\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n initialLexicalFormState: InitialLexicalFormState\n lexicalEditorConfig: LexicalEditorConfig | undefined // Undefined if default lexical editor config should be used\n} & Pick<ServerFieldBase, 'permissions'> &\n RichTextFieldClientProps<SerializedEditorState, AdapterProps, object>\n\nexport type LexicalRichTextCellProps = DefaultServerCellComponentProps<\n RichTextFieldClient<SerializedEditorState, AdapterProps, object>,\n SerializedEditorState\n>\n\nexport type AdapterProps = {\n editorConfig: SanitizedServerEditorConfig\n}\n\nexport type GeneratedFeatureProviderComponent = {\n clientFeature: FeatureProviderProviderClient<any, any>\n clientFeatureProps: BaseClientFeatureProps<object>\n}\n"],"mappings":"AAkIA","ignoreList":[]}
|