@payloadcms/richtext-lexical 3.61.0-internal.c252d14 → 3.61.0-internal.c47b5e9

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.
Files changed (136) hide show
  1. package/dist/cell/rscEntry.d.ts +2 -10
  2. package/dist/cell/rscEntry.d.ts.map +1 -1
  3. package/dist/cell/rscEntry.js +1 -2
  4. package/dist/cell/rscEntry.js.map +1 -1
  5. package/dist/exports/client/Field-F2KOJLMQ.js +2 -0
  6. package/dist/exports/client/{Field-YYMTSGSP.js.map → Field-F2KOJLMQ.js.map} +3 -3
  7. package/dist/exports/client/RelationshipComponent-UCIWIEVD.js +2 -0
  8. package/dist/exports/client/RelationshipComponent-UCIWIEVD.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/chunk-52JG5GGJ.js +2 -0
  11. package/dist/exports/client/chunk-52JG5GGJ.js.map +7 -0
  12. package/dist/exports/client/component-5YLBQB5B.js +2 -0
  13. package/dist/exports/client/component-5YLBQB5B.js.map +7 -0
  14. package/dist/exports/client/componentInline-QEXUNJU4.js +2 -0
  15. package/dist/exports/client/index.js +21 -21
  16. package/dist/exports/client/index.js.map +3 -3
  17. package/dist/features/blocks/client/component/BlockContent.js +1 -1
  18. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  19. package/dist/features/blocks/client/component/index.d.ts +1 -0
  20. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  21. package/dist/features/blocks/client/component/index.js +23 -20
  22. package/dist/features/blocks/client/component/index.js.map +1 -1
  23. package/dist/features/blocks/client/componentInline/index.d.ts +2 -1
  24. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  25. package/dist/features/blocks/client/componentInline/index.js +6 -6
  26. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  27. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
  28. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  29. package/dist/features/blocks/client/nodes/BlocksNode.js +5 -3
  30. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  31. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -2
  32. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  33. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +5 -3
  34. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  35. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +2 -1
  36. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  37. package/dist/features/blocks/server/nodes/BlocksNode.js +9 -2
  38. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  39. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +1 -1
  40. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  41. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +6 -5
  42. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  43. package/dist/features/link/nodes/AutoLinkNode.js +1 -1
  44. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  45. package/dist/features/link/nodes/LinkNode.js +1 -1
  46. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  47. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  48. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +4 -4
  49. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  50. package/dist/features/migrations/slateToLexical/feature.server.d.ts +29 -0
  51. package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
  52. package/dist/features/migrations/slateToLexical/feature.server.js +18 -0
  53. package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
  54. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  55. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +4 -4
  56. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  57. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
  58. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  59. package/dist/features/relationship/client/components/RelationshipComponent.js +2 -2
  60. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  61. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  62. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  63. package/dist/features/relationship/client/nodes/RelationshipNode.js +3 -2
  64. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  65. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +2 -1
  66. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  67. package/dist/features/relationship/server/nodes/RelationshipNode.js +9 -2
  68. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  69. package/dist/features/typesServer.d.ts +2 -2
  70. package/dist/features/typesServer.d.ts.map +1 -1
  71. package/dist/features/typesServer.js.map +1 -1
  72. package/dist/features/upload/client/component/index.d.ts +1 -0
  73. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  74. package/dist/features/upload/client/component/index.js +2 -2
  75. package/dist/features/upload/client/component/index.js.map +1 -1
  76. package/dist/features/upload/client/nodes/UploadNode.d.ts +2 -2
  77. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  78. package/dist/features/upload/client/nodes/UploadNode.js +2 -1
  79. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  80. package/dist/features/upload/client/plugin/index.js +2 -2
  81. package/dist/features/upload/client/plugin/index.js.map +1 -1
  82. package/dist/features/upload/server/nodes/UploadNode.d.ts +2 -1
  83. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  84. package/dist/features/upload/server/nodes/UploadNode.js +6 -0
  85. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  86. package/dist/field/bundled.css +1 -1
  87. package/dist/field/index.d.ts.map +1 -1
  88. package/dist/field/index.js +48 -40
  89. package/dist/field/index.js.map +1 -1
  90. package/dist/field/rscEntry.d.ts +2 -3
  91. package/dist/field/rscEntry.d.ts.map +1 -1
  92. package/dist/field/rscEntry.js +3 -1
  93. package/dist/field/rscEntry.js.map +1 -1
  94. package/dist/index.d.ts.map +1 -1
  95. package/dist/index.js +8 -25
  96. package/dist/index.js.map +1 -1
  97. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  98. package/dist/lexical/config/client/loader.js +2 -4
  99. package/dist/lexical/config/client/loader.js.map +1 -1
  100. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  101. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +1 -1
  102. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  103. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  104. package/dist/lexical/theme/EditorTheme.js +3 -39
  105. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  106. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  107. package/dist/lexical/ui/ContentEditable.js +16 -9
  108. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  109. package/dist/types.d.ts +6 -2
  110. package/dist/types.d.ts.map +1 -1
  111. package/dist/types.js.map +1 -1
  112. package/dist/utilities/editorConfigFactory.js +1 -1
  113. package/dist/utilities/editorConfigFactory.js.map +1 -1
  114. package/dist/utilities/generateImportMap.d.ts +2 -0
  115. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  116. package/dist/utilities/generateImportMap.js +5 -13
  117. package/dist/utilities/generateImportMap.js.map +1 -1
  118. package/dist/{getDefaultSanitizedEditorConfig.d.ts → utilities/getDefaultSanitizedEditorConfig.d.ts} +1 -1
  119. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -0
  120. package/dist/{getDefaultSanitizedEditorConfig.js → utilities/getDefaultSanitizedEditorConfig.js} +2 -2
  121. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -0
  122. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  123. package/dist/utilities/initLexicalFeatures.js +12 -13
  124. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  125. package/package.json +7 -7
  126. package/dist/exports/client/Field-YYMTSGSP.js +0 -2
  127. package/dist/exports/client/RelationshipComponent-JXQOFHXF.js +0 -2
  128. package/dist/exports/client/RelationshipComponent-JXQOFHXF.js.map +0 -7
  129. package/dist/exports/client/chunk-ADWHGDDR.js +0 -2
  130. package/dist/exports/client/chunk-ADWHGDDR.js.map +0 -7
  131. package/dist/exports/client/component-WT25HAJA.js +0 -2
  132. package/dist/exports/client/component-WT25HAJA.js.map +0 -7
  133. package/dist/exports/client/componentInline-MIPTDFRK.js +0 -2
  134. package/dist/getDefaultSanitizedEditorConfig.d.ts.map +0 -1
  135. package/dist/getDefaultSanitizedEditorConfig.js.map +0 -1
  136. /package/dist/exports/client/{componentInline-MIPTDFRK.js.map → componentInline-QEXUNJU4.js.map} +0 -0
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["afterChangeTraverseFields","afterReadTraverseFields","beforeChangeTraverseFields","beforeValidateTraverseFields","checkDependencies","deepMergeSimple","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","translations","CellComponent","path","serverProps","admin","sanitizedEditorConfig","DiffComponent","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","fieldLabelPath","mergeLocaleActions","siblingDocWithLocales","skipValidation","originalNodeWithLocalesIDMap","beforeChangeHooks","beforeChangeHooksForNode","originalNodeWithLocales","nodeSiblingDocWithLocales","newOriginalNodeIDMap","previousOriginalValue","beforeValidate","beforeValidateHooks","beforeValidateHooksForNode","outputSchema","collectionIDFieldTypes","interfaceNameDefinitions","isRequired","properties","additionalProperties","items","tsType","version","required","direction","oneOf","enum","format","indent","modifyOutputSchema","generatedTypes","modifyOutputSchemas","currentSchema","validate","AlignFeature","BlockquoteFeature","CodeBlock","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","convertHTMLToLexical","lexicalHTMLField","LinebreakHTMLConverter","ParagraphHTMLConverter","TabHTMLConverter","TextHTMLConverter","defaultHTMLConverters","convertLexicalNodesToHTML","convertLexicalToHTML","consolidateHTMLConverters","lexicalHTML","HTMLConverterFeature","convertLexicalToMarkdown","convertMarkdownToLexical","getPayloadPopulateFn","getRestPopulateFn","DebugJsxConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","$createAutoLinkNode","$isAutoLinkNode","AutoLinkNode","$createLinkNode","$isLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","defaultColors","TextStateFeature","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","buildDefaultEditorState","buildEditorState","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 deepMergeSimple,\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.35.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 config.i18n.translations = deepMergeSimple(config.i18n.translations, featureI18n)\n\n return {\n CellComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n serverProps: {\n admin: args?.admin,\n sanitizedEditorConfig: finalSanitizedEditorConfig,\n },\n },\n DiffComponent: {\n path: '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent',\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 fieldLabelPath,\n global,\n indexPath,\n mergeLocaleActions,\n operation,\n originalDoc,\n overrideAccess,\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\n const previousNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\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 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 fieldLabelPath,\n fields: subFields,\n global,\n mergeLocaleActions: mergeLocaleActions!,\n operation: operation!,\n 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: 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 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 tsType: 'any',\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 { CodeBlock } from './features/blocks/premade/CodeBlock/index.js'\nexport { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js'\n\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n type BlockFields,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\n\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\n\nexport { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js'\nexport { LinebreakHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js'\n\nexport { ParagraphHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js'\n\nexport { TabHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/tab.js'\nexport { TextHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/text.js'\nexport { defaultHTMLConverters } from './features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js'\n\nexport {\n convertLexicalNodesToHTML,\n convertLexicalToHTML,\n} from './features/converters/lexicalToHtml_deprecated/converter/index.js'\nexport type { HTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/types.js'\nexport {\n consolidateHTMLConverters,\n lexicalHTML,\n} from './features/converters/lexicalToHtml_deprecated/field/index.js'\nexport {\n HTMLConverterFeature,\n type HTMLConverterFeatureProps,\n} from './features/converters/lexicalToHtml_deprecated/index.js'\nexport { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js'\nexport { convertMarkdownToLexical } from './features/converters/markdownToLexical/index.js'\nexport { getPayloadPopulateFn } from './features/converters/utilities/payloadPopulateFn.js'\n\nexport { getRestPopulateFn } from './features/converters/utilities/restPopulateFn.js'\nexport { DebugJsxConverterFeature } from './features/debug/jsxConverter/server/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'\nexport {\n $createAutoLinkNode,\n $isAutoLinkNode,\n AutoLinkNode,\n} from './features/link/nodes/AutoLinkNode.js'\nexport { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js'\n\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\n\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'\nexport type {\n SlateNode,\n SlateNodeConverter,\n} from './features/migrations/slateToLexical/converter/types.js'\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\n\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 { defaultColors } from './features/textState/defaultColors.js'\nexport { TextStateFeature } from './features/textState/feature.server.js'\n\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/index.js'\nexport type { UploadFeatureProps } from './features/upload/server/index.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 { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\n\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,eAAe,EACfC,0BAA0B,QACrB;AAMP,SAASC,+BAA+B,QAAQ;AAChD,SAASC,IAAI,QAAQ;AACrB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,2BAA2B,QAAQ;AAC5C,S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AAS5H,QAAQ,QAAQ;AAIzB,SAAS6H,uBAAuB,EAAEC,gBAAgB,QAAQ;AAC1D,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,mBAAmB,QAAQ;AAGpC,SAASC,8BAA8B,QAAQ;AAE/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","deepMergeSimple","withNullableJSONSchemaType","i18n","defaultEditorFeatures","populateLexicalPopulationPromises","featuresInputToEditorConfig","getGenerateImportMap","getGenerateSchemaMap","getDefaultSanitizedEditorConfig","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","lang","lexicalI18nForLang","general","translations","CellComponent","DiffComponent","editorConfig","FieldComponent","path","serverProps","admin","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","fieldLabelPath","mergeLocaleActions","siblingDocWithLocales","skipValidation","originalNodeWithLocalesIDMap","beforeChangeHooks","beforeChangeHooksForNode","originalNodeWithLocales","nodeSiblingDocWithLocales","newOriginalNodeIDMap","previousOriginalValue","beforeValidate","beforeValidateHooks","beforeValidateHooksForNode","outputSchema","collectionIDFieldTypes","interfaceNameDefinitions","isRequired","properties","additionalProperties","items","tsType","version","required","direction","oneOf","enum","format","indent","modifyOutputSchema","generatedTypes","modifyOutputSchemas","currentSchema","validate","AlignFeature","BlockquoteFeature","CodeBlock","BlocksFeature","$createServerBlockNode","$isServerBlockNode","ServerBlockNode","convertHTMLToLexical","lexicalHTMLField","LinebreakHTMLConverter","ParagraphHTMLConverter","TabHTMLConverter","TextHTMLConverter","defaultHTMLConverters","convertLexicalNodesToHTML","convertLexicalToHTML","consolidateHTMLConverters","lexicalHTML","HTMLConverterFeature","convertLexicalToMarkdown","convertMarkdownToLexical","getPayloadPopulateFn","getRestPopulateFn","DebugJsxConverterFeature","TestRecorderFeature","TreeViewFeature","EXPERIMENTAL_TableFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","$createAutoLinkNode","$isAutoLinkNode","AutoLinkNode","$createLinkNode","$isLinkNode","LinkNode","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","RelationshipServerNode","defaultColors","TextStateFeature","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","buildDefaultEditorState","buildEditorState","createServerFeature","editorConfigFactory","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString","upgradeLexicalData"],"sources":["../src/index.ts"],"sourcesContent":["import type { GenericLanguages, GenericTranslationsObject } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport {\n afterChangeTraverseFields,\n afterReadTraverseFields,\n beforeChangeTraverseFields,\n beforeValidateTraverseFields,\n checkDependencies,\n deepMergeSimple,\n type RichTextAdapter,\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 { 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 { getDefaultSanitizedEditorConfig } from './utilities/getDefaultSanitizedEditorConfig.js'\nimport { recurseNodeTree } from './utilities/recurseNodeTree.js'\nimport { richTextValidateHOC } from './validate/index.js'\n\nlet checkedDependencies = false\n\nexport const lexicalTargetVersion = '0.35.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: Partial<GenericLanguages> = finalSanitizedEditorConfig.features.i18n\n for (const _lang in i18n) {\n const lang = _lang as keyof typeof i18n\n const lexicalI18nForLang = ((featureI18n[lang] ??= {}).lexical ??=\n {}) as GenericTranslationsObject\n\n lexicalI18nForLang.general = i18n[lang] ?? {}\n }\n\n config.i18n.translations = deepMergeSimple(config.i18n.translations, featureI18n)\n\n return {\n CellComponent: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell',\n DiffComponent: '@payloadcms/richtext-lexical/rsc#LexicalDiffComponent',\n editorConfig: finalSanitizedEditorConfig,\n features,\n FieldComponent: {\n path: '@payloadcms/richtext-lexical/rsc#RscEntryLexicalField',\n serverProps: {\n admin: args?.admin,\n // SanitizedEditorConfig is manually passed by `renderField` in `fieldSchemasToFormState/renderField.tsx`\n // in order to reduce the size of the field schema\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 fieldLabelPath,\n global,\n indexPath,\n mergeLocaleActions,\n operation,\n originalDoc,\n overrideAccess,\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\n const previousNodeIDMap: {\n [key: string]: SerializedLexicalNode\n } = {}\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 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 fieldLabelPath,\n fields: subFields,\n global,\n mergeLocaleActions: mergeLocaleActions!,\n operation: operation!,\n 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: 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 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 tsType: 'any',\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 { CodeBlock } from './features/blocks/premade/CodeBlock/index.js'\nexport { BlocksFeature, type BlocksFeatureProps } from './features/blocks/server/index.js'\n\nexport {\n $createServerBlockNode,\n $isServerBlockNode,\n type BlockFields,\n ServerBlockNode,\n} from './features/blocks/server/nodes/BlocksNode.js'\n\nexport { convertHTMLToLexical } from './features/converters/htmlToLexical/index.js'\n\nexport { lexicalHTMLField } from './features/converters/lexicalToHtml/async/field/index.js'\nexport { LinebreakHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js'\n\nexport { ParagraphHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js'\n\nexport { TabHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/tab.js'\nexport { TextHTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/converters/text.js'\nexport { defaultHTMLConverters } from './features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js'\n\nexport {\n convertLexicalNodesToHTML,\n convertLexicalToHTML,\n} from './features/converters/lexicalToHtml_deprecated/converter/index.js'\nexport type { HTMLConverter } from './features/converters/lexicalToHtml_deprecated/converter/types.js'\nexport {\n consolidateHTMLConverters,\n lexicalHTML,\n} from './features/converters/lexicalToHtml_deprecated/field/index.js'\nexport {\n HTMLConverterFeature,\n type HTMLConverterFeatureProps,\n} from './features/converters/lexicalToHtml_deprecated/index.js'\nexport { convertLexicalToMarkdown } from './features/converters/lexicalToMarkdown/index.js'\nexport { convertMarkdownToLexical } from './features/converters/markdownToLexical/index.js'\nexport { getPayloadPopulateFn } from './features/converters/utilities/payloadPopulateFn.js'\n\nexport { getRestPopulateFn } from './features/converters/utilities/restPopulateFn.js'\nexport { DebugJsxConverterFeature } from './features/debug/jsxConverter/server/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'\nexport {\n $createAutoLinkNode,\n $isAutoLinkNode,\n AutoLinkNode,\n} from './features/link/nodes/AutoLinkNode.js'\nexport { $createLinkNode, $isLinkNode, LinkNode } from './features/link/nodes/LinkNode.js'\n\nexport type { LinkFields } from './features/link/nodes/types.js'\nexport { LinkFeature, type LinkFeatureServerProps } from './features/link/server/index.js'\n\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'\nexport type {\n SlateNode,\n SlateNodeConverter,\n} from './features/migrations/slateToLexical/converter/types.js'\nexport { ParagraphFeature } from './features/paragraph/server/index.js'\n\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 { defaultColors } from './features/textState/defaultColors.js'\nexport { TextStateFeature } from './features/textState/feature.server.js'\n\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/index.js'\nexport type { UploadFeatureProps } from './features/upload/server/index.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 { buildDefaultEditorState, buildEditorState } from './utilities/buildEditorState.js'\nexport { createServerFeature } from './utilities/createServerFeature.js'\n\nexport { editorConfigFactory } from './utilities/editorConfigFactory.js'\nexport type { FieldsDrawerProps } from './utilities/fieldsDrawer/Drawer.js'\n\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":"AAIA,SACEA,yBAAyB,EACzBC,uBAAuB,EACvBC,0BAA0B,EAC1BC,4BAA4B,EAC5BC,iBAAiB,EACjBC,eAAe,EAEfC,0BAA0B,QACrB;AAMP,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,+BAA+B,QAAQ;AAChD,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,KAAKZ,iBAAA,CAAkB;MACrBoB,gBAAA,EAAkB,CAChB;QACEC,IAAA,EAAM;QACNC,YAAA,EAAc,CACZ,WACA,qBACA,iBACA,iBACA,iBACA,kBACA,sBACA,sBACA,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AAmB,EACnB7N,qBAAqB,EACrB8N,0BAA0B,QACrB;AACP,SAASC,YAAY,EAAEC,6BAA6B,QAAQ;AAE5D,SACEC,0BAA0B,EAC1BC,sBAAsB,QACjB;AASP,SAASC,eAAe,EAAEC,8BAA8B,QAAQ;AAMhE,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;AAEP,SAASC,WAAW,EAAEC,WAAW,QAAQ;AAIzC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,oBAAoB,QAAQ;AACrC,SAAS5H,QAAQ,QAAQ;AAIzB,SAAS6H,uBAAuB,EAAEC,gBAAgB,QAAQ;AAC1D,SAASC,mBAAmB,QAAQ;AAEpC,SAASC,mBAAmB,QAAQ;AAGpC,SAASC,8BAA8B,QAAQ;AAE/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX;AACP,SAASC,kBAAkB,QAAQ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEhE,OAAO,KAAK,EAGV,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3C,sBAAsB,EAAE,sBAAsB,CAAA;IAC9C,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,wBAAwB,CAsD3B"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEhE,OAAO,KAAK,EAGV,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3C,sBAAsB,EAAE,sBAAsB,CAAA;IAC9C,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,wBAAwB,CAoD3B"}
@@ -12,17 +12,15 @@ export function loadClientFeatures({
12
12
  schemaPath,
13
13
  unSanitizedEditorConfig
14
14
  }) {
15
+ const featureProviderMap = new Map();
15
16
  for (const featureProvider of unSanitizedEditorConfig.features) {
16
17
  if (!featureProvider?.clientFeatureProps?.featureKey || featureProvider?.clientFeatureProps?.order === undefined || featureProvider?.clientFeatureProps?.order === null) {
17
18
  throw new Error('A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.');
18
19
  }
20
+ featureProviderMap.set(featureProvider.clientFeatureProps.featureKey, featureProvider);
19
21
  }
20
22
  // sort unSanitizedEditorConfig.features by order
21
23
  unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.sort((a, b) => a.clientFeatureProps.order - b.clientFeatureProps.order);
22
- const featureProviderMap = new Map();
23
- for (const feature of unSanitizedEditorConfig.features) {
24
- featureProviderMap.set(feature.clientFeatureProps.featureKey, feature);
25
- }
26
24
  const resolvedFeatures = new Map();
27
25
  // Make sure all dependencies declared in the respective features exist
28
26
  let loaded = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","names":["loadClientFeatures","config","featureClientImportMap","featureClientSchemaMap","field","schemaPath","unSanitizedEditorConfig","featureProvider","features","clientFeatureProps","featureKey","order","undefined","Error","sort","a","b","featureProviderMap","Map","feature","set","resolvedFeatures","loaded","key"],"sources":["../../../../src/lexical/config/client/loader.ts"],"sourcesContent":["'use client'\n\nimport type { ClientConfig, RichTextFieldClient } from 'payload'\n\nimport type {\n ClientFeatureProviderMap,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n} from '../../../features/typesClient.js'\nimport type { FeatureClientSchemaMap } from '../../../types.js'\nimport type { ClientEditorConfig } from '../types.js'\n\n/**\n * This function expects client functions to ALREADY be ordered & dependencies checked on the server\n * @param unSanitizedEditorConfig\n */\nexport function loadClientFeatures({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field,\n schemaPath,\n unSanitizedEditorConfig,\n}: {\n config: ClientConfig\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n field?: RichTextFieldClient\n schemaPath: string\n unSanitizedEditorConfig: ClientEditorConfig\n}): ResolvedClientFeatureMap {\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (\n !featureProvider?.clientFeatureProps?.featureKey ||\n featureProvider?.clientFeatureProps?.order === undefined ||\n featureProvider?.clientFeatureProps?.order === null\n ) {\n throw new Error(\n 'A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.',\n )\n }\n }\n\n // sort unSanitizedEditorConfig.features by order\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.sort(\n (a, b) => a.clientFeatureProps.order - b.clientFeatureProps.order,\n )\n\n const featureProviderMap: ClientFeatureProviderMap = new Map()\n for (const feature of unSanitizedEditorConfig.features) {\n featureProviderMap.set(feature.clientFeatureProps.featureKey, feature)\n }\n\n const resolvedFeatures: ResolvedClientFeatureMap = new Map()\n\n // Make sure all dependencies declared in the respective features exist\n let loaded = 0\n for (const featureProvider of unSanitizedEditorConfig.features) {\n const feature: Partial<ResolvedClientFeature<any>> =\n typeof featureProvider.feature === 'function'\n ? featureProvider.feature({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n featureProviderMap,\n field,\n resolvedFeatures,\n schemaPath,\n unSanitizedEditorConfig,\n })\n : featureProvider.feature\n\n feature.key = featureProvider.clientFeatureProps.featureKey\n feature.order = loaded\n\n resolvedFeatures.set(\n featureProvider.clientFeatureProps.featureKey,\n feature as ResolvedClientFeature<any>,\n )\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"mappings":"AAAA;;AAYA;;;;AAIA,OAAO,SAASA,mBAAmB;EACjCC,MAAM;EACNC,sBAAsB;EACtBC,sBAAsB;EACtBC,KAAK;EACLC,UAAU;EACVC;AAAuB,CAQxB;EACC,KAAK,MAAMC,eAAA,IAAmBD,uBAAA,CAAwBE,QAAQ,EAAE;IAC9D,IACE,CAACD,eAAA,EAAiBE,kBAAA,EAAoBC,UAAA,IACtCH,eAAA,EAAiBE,kBAAA,EAAoBE,KAAA,KAAUC,SAAA,IAC/CL,eAAA,EAAiBE,kBAAA,EAAoBE,KAAA,KAAU,MAC/C;MACA,MAAM,IAAIE,KAAA,CACR;IAEJ;EACF;EAEA;EACAP,uBAAA,CAAwBE,QAAQ,GAAGF,uBAAA,CAAwBE,QAAQ,CAACM,IAAI,CACtE,CAACC,CAAA,EAAGC,CAAA,KAAMD,CAAA,CAAEN,kBAAkB,CAACE,KAAK,GAAGK,CAAA,CAAEP,kBAAkB,CAACE,KAAK;EAGnE,MAAMM,kBAAA,GAA+C,IAAIC,GAAA;EACzD,KAAK,MAAMC,OAAA,IAAWb,uBAAA,CAAwBE,QAAQ,EAAE;IACtDS,kBAAA,CAAmBG,GAAG,CAACD,OAAA,CAAQV,kBAAkB,CAACC,UAAU,EAAES,OAAA;EAChE;EAEA,MAAME,gBAAA,GAA6C,IAAIH,GAAA;EAEvD;EACA,IAAII,MAAA,GAAS;EACb,KAAK,MAAMf,eAAA,IAAmBD,uBAAA,CAAwBE,QAAQ,EAAE;IAC9D,MAAMW,OAAA,GACJ,OAAOZ,eAAA,CAAgBY,OAAO,KAAK,aAC/BZ,eAAA,CAAgBY,OAAO,CAAC;MACtBlB,MAAA;MACAC,sBAAA;MACAC,sBAAA;MACAc,kBAAA;MACAb,KAAA;MACAiB,gBAAA;MACAhB,UAAA;MACAC;IACF,KACAC,eAAA,CAAgBY,OAAO;IAE7BA,OAAA,CAAQI,GAAG,GAAGhB,eAAA,CAAgBE,kBAAkB,CAACC,UAAU;IAC3DS,OAAA,CAAQR,KAAK,GAAGW,MAAA;IAEhBD,gBAAA,CAAiBD,GAAG,CAClBb,eAAA,CAAgBE,kBAAkB,CAACC,UAAU,EAC7CS,OAAA;IAGFG,MAAA;EACF;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"loader.js","names":["loadClientFeatures","config","featureClientImportMap","featureClientSchemaMap","field","schemaPath","unSanitizedEditorConfig","featureProviderMap","Map","featureProvider","features","clientFeatureProps","featureKey","order","undefined","Error","set","sort","a","b","resolvedFeatures","loaded","feature","key"],"sources":["../../../../src/lexical/config/client/loader.ts"],"sourcesContent":["'use client'\n\nimport type { ClientConfig, RichTextFieldClient } from 'payload'\n\nimport type {\n ClientFeatureProviderMap,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n} from '../../../features/typesClient.js'\nimport type { FeatureClientSchemaMap } from '../../../types.js'\nimport type { ClientEditorConfig } from '../types.js'\n\n/**\n * This function expects client functions to ALREADY be ordered & dependencies checked on the server\n * @param unSanitizedEditorConfig\n */\nexport function loadClientFeatures({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field,\n schemaPath,\n unSanitizedEditorConfig,\n}: {\n config: ClientConfig\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n field?: RichTextFieldClient\n schemaPath: string\n unSanitizedEditorConfig: ClientEditorConfig\n}): ResolvedClientFeatureMap {\n const featureProviderMap: ClientFeatureProviderMap = new Map()\n\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (\n !featureProvider?.clientFeatureProps?.featureKey ||\n featureProvider?.clientFeatureProps?.order === undefined ||\n featureProvider?.clientFeatureProps?.order === null\n ) {\n throw new Error(\n 'A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.',\n )\n }\n featureProviderMap.set(featureProvider.clientFeatureProps.featureKey, featureProvider)\n }\n\n // sort unSanitizedEditorConfig.features by order\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.sort(\n (a, b) => a.clientFeatureProps.order - b.clientFeatureProps.order,\n )\n\n const resolvedFeatures: ResolvedClientFeatureMap = new Map()\n\n // Make sure all dependencies declared in the respective features exist\n let loaded = 0\n for (const featureProvider of unSanitizedEditorConfig.features) {\n const feature: Partial<ResolvedClientFeature<any>> =\n typeof featureProvider.feature === 'function'\n ? featureProvider.feature({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n featureProviderMap,\n field,\n resolvedFeatures,\n schemaPath,\n unSanitizedEditorConfig,\n })\n : featureProvider.feature\n\n feature.key = featureProvider.clientFeatureProps.featureKey\n feature.order = loaded\n\n resolvedFeatures.set(\n featureProvider.clientFeatureProps.featureKey,\n feature as ResolvedClientFeature<any>,\n )\n\n lo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IAEhBD,gBAAA,CAAiBJ,GAAG,CAClBP,eAAA,CAAgBE,kBAAkB,CAACC,UAAU,EAC7CU,OAAA;IAGFD,MAAA;EACF;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QAmCvB"}
1
+ {"version":3,"file":"setHandlePosition.d.ts","sourceRoot":"","sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"names":[],"mappings":"AAGA,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,WAAW,GAAG,IAAI,EAC9B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,WAAW,EACvB,UAAU,GAAE,MAAU,QAyCvB"}
@@ -12,7 +12,7 @@ export function setHandlePosition(targetElem, handleElem, anchorElem, leftOffset
12
12
  const floatingElemRect = handleElem.getBoundingClientRect();
13
13
  const anchorElementRect = anchorElem.getBoundingClientRect();
14
14
  let top;
15
- const isBlockStyle = ['lexical-block', 'lexical-upload', 'lexical-relationship'].some(classes => targetElem.firstElementChild?.classList.contains(classes));
15
+ const isBlockStyle = ['LexicalEditorTheme__block', 'LexicalEditorTheme__upload', 'LexicalEditorTheme__relationship'].some(classes => targetElem.classList.contains(classes) || targetElem.firstElementChild?.classList.contains(classes));
16
16
  if (!isBlockStyle) {
17
17
  // No need to let line height affect the re-positioning of the floating element if line height has no
18
18
  // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.
@@ -1 +1 @@
1
- {"version":3,"file":"setHandlePosition.js","names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","isBlockStyle","some","classes","firstElementChild","classList","contains","actualLineHeight","parseInt","lineHeight","height","left"],"sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const isBlockStyle = ['lexical-block', 'lexical-upload', 'lexical-relationship'].some((classes) =>\n targetElem.firstElementChild?.classList.contains(classes),\n )\n\n if (!isBlockStyle) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top = targetRect.top + 8 - anchorElementRect.top\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"mappings":"AAAA;;AACA,SAASA,2BAA2B,QAAQ;AAE5C,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,UAAA,GAAqB,CAAC;EAEtB,IAAI,CAACH,UAAA,EAAY;IACfC,UAAA,CAAWG,KAAK,CAACC,OAAO,GAAG;IAC3BJ,UAAA,CAAWG,KAAK,CAACE,SAAS,GAAG;IAC7B;EACF;EAEA,MAAMC,UAAA,GAAaP,UAAA,CAAWQ,qBAAqB;EACnD,MAAMC,WAAA,GAAcC,MAAA,CAAOC,gBAAgB,CAACX,UAAA;EAC5C,MAAMY,gBAAA,GAAmBX,UAAA,CAAWO,qBAAqB;EACzD,MAAMK,iBAAA,GAAoBX,UAAA,CAAWM,qBAAqB;EAE1D,IAAIM,GAAA;EAEJ,MAAMC,YAAA,GAAe,CAAC,iBAAiB,kBAAkB,uBAAuB,CAACC,IAAI,CAAEC,OAAA,IACrFjB,UAAA,CAAWkB,iBAAiB,EAAEC,SAAA,CAAUC,QAAA,CAASH,OAAA;EAGnD,IAAI,CAACF,YAAA,EAAc;IACjB;IACA;IACA,MAAMM,gBAAA,GAAmBvB,2BAAA,CAA4BE,UAAA,IACjDsB,QAAA,CAASb,WAAA,CAAYc,UAAU,EAAE,MACjC;IAEJT,GAAA,GAAMP,UAAA,CAAWO,GAAG,GAAG,CAACO,gBAAA,GAAmBT,gBAAA,CAAiBY,MAAM,IAAI,IAAIX,iBAAA,CAAkBC,GAAG;EACjG,OAAO;IACLA,GAAA,GAAMP,UAAA,CAAWO,GAAG,GAAG,IAAID,iBAAA,CAAkBC,GAAG;EAClD;EAEA,MAAMW,IAAA,GAAOtB,UAAA;EAEbF,UAAA,CAAWG,KAAK,CAACC,OAAO,GAAG;EAC3BJ,UAAA,CAAWG,KAAK,CAACE,SAAS,GAAG,aAAamB,IAAA,OAAWX,GAAA,KAAQ;AAC/D","ignoreList":[]}
1
+ {"version":3,"file":"setHandlePosition.js","names":["doesLineHeightAffectElement","setHandlePosition","targetElem","handleElem","anchorElem","leftOffset","style","opacity","transform","targetRect","getBoundingClientRect","targetStyle","window","getComputedStyle","floatingElemRect","anchorElementRect","top","isBlockStyle","some","classes","classList","contains","firstElementChild","actualLineHeight","parseInt","lineHeight","height","left"],"sources":["../../../../../src/lexical/plugins/handles/utils/setHandlePosition.ts"],"sourcesContent":["'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const isBlockStyle = [\n 'LexicalEditorTheme__block',\n 'LexicalEditorTheme__upload',\n 'LexicalEditorTheme__relationship',\n ].some(\n (classes) =>\n targetElem.classList.contains(classes) ||\n targetElem.firstElementChild?.classList.contains(classes),\n )\n\n if (!isBlockStyle) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top = targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top\n } else {\n top = targetRect.top + 8 - anchorElementRect.top\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"mappings":"AAAA;;AACA,SAASA,2BAA2B,QAAQ;AAE5C,OAAO,SAASC,kBACdC,UAA8B,EAC9BC,UAAuB,EACvBC,UAAuB,EACvBC,UAAA,GAAqB,CAAC;EAEtB,IAAI,CAACH,UAAA,EAAY;IACfC,UAAA,CAAWG,KAAK,CAACC,OAAO,GAAG;IAC3BJ,UAAA,CAAWG,KAAK,CAACE,SAAS,GAAG;IAC7B;EACF;EAEA,MAAMC,UAAA,GAAaP,UAAA,CAAWQ,qBAAqB;EACnD,MAAMC,WAAA,GAAcC,MAAA,CAAOC,gBAAgB,CAACX,UAAA;EAC5C,MAAMY,gBAAA,GAAmBX,UAAA,CAAWO,qBAAqB;EACzD,MAAMK,iBAAA,GAAoBX,UAAA,CAAWM,qBAAqB;EAE1D,IAAIM,GAAA;EAEJ,MAAMC,YAAA,GAAe,CACnB,6BACA,8BACA,mCACD,CAACC,IAAI,CACHC,OAAA,IACCjB,UAAA,CAAWkB,SAAS,CAACC,QAAQ,CAACF,OAAA,KAC9BjB,UAAA,CAAWoB,iBAAiB,EAAEF,SAAA,CAAUC,QAAA,CAASF,OAAA;EAGrD,IAAI,CAACF,YAAA,EAAc;IACjB;IACA;IACA,MAAMM,gBAAA,GAAmBvB,2BAAA,CAA4BE,UAAA,IACjDsB,QAAA,CAASb,WAAA,CAAYc,UAAU,EAAE,MACjC;IAEJT,GAAA,GAAMP,UAAA,CAAWO,GAAG,GAAG,CAACO,gBAAA,GAAmBT,gBAAA,CAAiBY,MAAM,IAAI,IAAIX,iBAAA,CAAkBC,GAAG;EACjG,OAAO;IACLA,GAAA,GAAMP,UAAA,CAAWO,GAAG,GAAG,IAAID,iBAAA,CAAkBC,GAAG;EAClD;EAEA,MAAMW,IAAA,GAAOtB,UAAA;EAEbF,UAAA,CAAWG,KAAK,CAACC,OAAO,GAAG;EAC3BJ,UAAA,CAAWG,KAAK,CAACE,SAAS,GAAG,aAAamB,IAAA,OAAWX,GAAA,KAAQ;AAC/D","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"EditorTheme.d.ts","sourceRoot":"","sources":["../../../src/lexical/theme/EditorTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,eAAO,MAAM,kBAAkB,EAAE,kBA6GhC,CAAA"}
1
+ {"version":3,"file":"EditorTheme.d.ts","sourceRoot":"","sources":["../../../src/lexical/theme/EditorTheme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,eAAO,MAAM,kBAAkB,EAAE,kBA0EhC,CAAA"}
@@ -3,43 +3,7 @@ export const LexicalEditorTheme = {
3
3
  blockCursor: 'LexicalEditorTheme__blockCursor',
4
4
  characterLimit: 'LexicalEditorTheme__characterLimit',
5
5
  code: 'LexicalEditorTheme__code',
6
- codeHighlight: {
7
- atrule: 'LexicalEditorTheme__tokenAttr',
8
- attr: 'LexicalEditorTheme__tokenAttr',
9
- boolean: 'LexicalEditorTheme__tokenProperty',
10
- builtin: 'LexicalEditorTheme__tokenSelector',
11
- cdata: 'LexicalEditorTheme__tokenComment',
12
- char: 'LexicalEditorTheme__tokenSelector',
13
- class: 'LexicalEditorTheme__tokenFunction',
14
- 'class-name': 'LexicalEditorTheme__tokenFunction',
15
- comment: 'LexicalEditorTheme__tokenComment',
16
- constant: 'LexicalEditorTheme__tokenProperty',
17
- deleted: 'LexicalEditorTheme__tokenProperty',
18
- doctype: 'LexicalEditorTheme__tokenComment',
19
- entity: 'LexicalEditorTheme__tokenOperator',
20
- function: 'LexicalEditorTheme__tokenFunction',
21
- important: 'LexicalEditorTheme__tokenVariable',
22
- inserted: 'LexicalEditorTheme__tokenSelector',
23
- keyword: 'LexicalEditorTheme__tokenAttr',
24
- namespace: 'LexicalEditorTheme__tokenVariable',
25
- number: 'LexicalEditorTheme__tokenProperty',
26
- operator: 'LexicalEditorTheme__tokenOperator',
27
- prolog: 'LexicalEditorTheme__tokenComment',
28
- property: 'LexicalEditorTheme__tokenProperty',
29
- punctuation: 'LexicalEditorTheme__tokenPunctuation',
30
- regex: 'LexicalEditorTheme__tokenVariable',
31
- selector: 'LexicalEditorTheme__tokenSelector',
32
- string: 'LexicalEditorTheme__tokenSelector',
33
- symbol: 'LexicalEditorTheme__tokenProperty',
34
- tag: 'LexicalEditorTheme__tokenProperty',
35
- url: 'LexicalEditorTheme__tokenOperator',
36
- variable: 'LexicalEditorTheme__tokenVariable'
37
- },
38
- embedBlock: {
39
- base: 'LexicalEditorTheme__embedBlock',
40
- focus: 'LexicalEditorTheme__embedBlockFocus'
41
- },
42
- hashtag: 'LexicalEditorTheme__hashtag',
6
+ inlineBlock: 'LexicalEditorTheme__inlineBlock',
43
7
  heading: {
44
8
  h1: 'LexicalEditorTheme__h1',
45
9
  h2: 'LexicalEditorTheme__h2',
@@ -51,7 +15,6 @@ export const LexicalEditorTheme = {
51
15
  hr: 'LexicalEditorTheme__hr',
52
16
  hrSelected: 'LexicalEditorTheme__hrSelected',
53
17
  indent: 'LexicalEditorTheme__indent',
54
- inlineImage: 'LexicalEditor__inline-image',
55
18
  link: 'LexicalEditorTheme__link',
56
19
  list: {
57
20
  checklist: 'LexicalEditorTheme__checklist',
@@ -68,6 +31,7 @@ export const LexicalEditorTheme = {
68
31
  mark: 'LexicalEditorTheme__mark',
69
32
  markOverlap: 'LexicalEditorTheme__markOverlap',
70
33
  paragraph: 'LexicalEditorTheme__paragraph',
34
+ placeholder: 'LexicalEditorTheme__placeholder',
71
35
  quote: 'LexicalEditorTheme__quote',
72
36
  relationship: 'LexicalEditorTheme__relationship',
73
37
  rtl: 'LexicalEditorTheme__rtl',
@@ -100,6 +64,6 @@ export const LexicalEditorTheme = {
100
64
  underline: 'LexicalEditorTheme__textUnderline',
101
65
  underlineStrikethrough: 'LexicalEditorTheme__textUnderlineStrikethrough'
102
66
  },
103
- upload: 'editor-upload'
67
+ upload: 'LexicalEditorTheme__upload'
104
68
  };
105
69
  //# sourceMappingURL=EditorTheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorTheme.js","names":["LexicalEditorTheme","block","blockCursor","characterLimit","code","codeHighlight","atrule","attr","boolean","builtin","cdata","char","class","comment","constant","deleted","doctype","entity","function","important","inserted","keyword","namespace","number","operator","prolog","property","punctuation","regex","selector","string","symbol","tag","url","variable","embedBlock","base","focus","hashtag","heading","h1","h2","h3","h4","h5","h6","hr","hrSelected","indent","inlineImage","link","list","checklist","listitem","listitemChecked","listitemUnchecked","nested","olDepth","ul","ltr","mark","markOverlap","paragraph","quote","relationship","rtl","tab","table","tableAddColumns","tableAddRows","tableAlignment","center","right","tableCell","tableCellActionButton","tableCellActionButtonContainer","tableCellHeader","tableCellResizer","tableCellSelected","tableFrozenColumn","tableRowStriping","tableScrollableWrapper","tableSelected","tableSelection","text","bold","italic","strikethrough","subscript","superscript","underline","underlineStrikethrough","upload"],"sources":["../../../src/lexical/theme/EditorTheme.tsx"],"sourcesContent":["import type { EditorThemeClasses } from 'lexical'\n\nexport const LexicalEditorTheme: EditorThemeClasses = {\n block: 'LexicalEditorTheme__block',\n blockCursor: 'LexicalEditorTheme__blockCursor',\n characterLimit: 'LexicalEditorTheme__characterLimit',\n code: 'LexicalEditorTheme__code',\n codeHighlight: {\n atrule: 'LexicalEditorTheme__tokenAttr',\n attr: 'LexicalEditorTheme__tokenAttr',\n boolean: 'LexicalEditorTheme__tokenProperty',\n builtin: 'LexicalEditorTheme__tokenSelector',\n cdata: 'LexicalEditorTheme__tokenComment',\n char: 'LexicalEditorTheme__tokenSelector',\n class: 'LexicalEditorTheme__tokenFunction',\n 'class-name': 'LexicalEditorTheme__tokenFunction',\n comment: 'LexicalEditorTheme__tokenComment',\n constant: 'LexicalEditorTheme__tokenProperty',\n deleted: 'LexicalEditorTheme__tokenProperty',\n doctype: 'LexicalEditorTheme__tokenComment',\n entity: 'LexicalEditorTheme__tokenOperator',\n function: 'LexicalEditorTheme__tokenFunction',\n important: 'LexicalEditorTheme__tokenVariable',\n inserted: 'LexicalEditorTheme__tokenSelector',\n keyword: 'LexicalEditorTheme__tokenAttr',\n namespace: 'LexicalEditorTheme__tokenVariable',\n number: 'LexicalEditorTheme__tokenProperty',\n operator: 'LexicalEditorTheme__tokenOperator',\n prolog: 'LexicalEditorTheme__tokenComment',\n property: 'LexicalEditorTheme__tokenProperty',\n punctuation: 'LexicalEditorTheme__tokenPunctuation',\n regex: 'LexicalEditorTheme__tokenVariable',\n selector: 'LexicalEditorTheme__tokenSelector',\n string: 'LexicalEditorTheme__tokenSelector',\n symbol: 'LexicalEditorTheme__tokenProperty',\n tag: 'LexicalEditorTheme__tokenProperty',\n url: 'LexicalEditorTheme__tokenOperator',\n variable: 'LexicalEditorTheme__tokenVariable',\n },\n embedBlock: {\n base: 'LexicalEditorTheme__embedBlock',\n focus: 'LexicalEditorTheme__embedBlockFocus',\n },\n hashtag: 'LexicalEditorTheme__hashtag',\n heading: {\n h1: 'LexicalEditorTheme__h1',\n h2: 'LexicalEditorTheme__h2',\n h3: 'LexicalEditorTheme__h3',\n h4: 'LexicalEditorTheme__h4',\n h5: 'LexicalEditorTheme__h5',\n h6: 'LexicalEditorTheme__h6',\n },\n hr: 'LexicalEditorTheme__hr',\n hrSelected: 'LexicalEditorTheme__hrSelected',\n indent: 'LexicalEditorTheme__indent',\n inlineImage: 'LexicalEditor__inline-image',\n link: 'LexicalEditorTheme__link',\n list: {\n checklist: 'LexicalEditorTheme__checklist',\n listitem: 'LexicalEditorTheme__listItem',\n listitemChecked: 'LexicalEditorTheme__listItemChecked',\n listitemUnchecked: 'LexicalEditorTheme__listItemUnchecked',\n nested: {\n listitem: 'LexicalEditorTheme__nestedListItem',\n },\n olDepth: [\n 'LexicalEditorTheme__ol1',\n 'LexicalEditorTheme__ol2',\n 'LexicalEditorTheme__ol3',\n 'LexicalEditorTheme__ol4',\n 'LexicalEditorTheme__ol5',\n ],\n ul: 'LexicalEditorTheme__ul',\n },\n ltr: 'LexicalEditorTheme__ltr',\n mark: 'LexicalEditorTheme__mark',\n markOverlap: 'LexicalEditorTheme__markOverlap',\n paragraph: 'LexicalEditorTheme__paragraph',\n quote: 'LexicalEditorTheme__quote',\n relationship: 'LexicalEditorTheme__relationship',\n rtl: 'LexicalEditorTheme__rtl',\n tab: 'LexicalEditorTheme__tabNode',\n table: 'LexicalEditorTheme__table',\n tableAddColumns: 'LexicalEditorTheme__tableAddColumns',\n tableAddRows: 'LexicalEditorTheme__tableAddRows',\n tableAlignment: {\n center: 'LexicalEditorTheme__tableAlignmentCenter',\n right: 'LexicalEditorTheme__tableAlignmentRight',\n },\n tableCell: 'LexicalEditorTheme__tableCell',\n tableCellActionButton: 'LexicalEditorTheme__tableCellActionButton',\n tableCellActionButtonContainer: 'LexicalEditorTheme__tableCellActionButtonContainer',\n tableCellHeader: 'LexicalEditorTheme__tableCellHeader',\n tableCellResizer: 'LexicalEditorTheme__tableCellResizer',\n tableCellSelected: 'LexicalEditorTheme__tableCellSelected',\n tableFrozenColumn: 'LexicalEditorTheme__tableFrozenColumn',\n tableRowStriping: 'LexicalEditorTheme__tableRowStriping',\n tableScrollableWrapper: 'LexicalEditorTheme__tableScrollableWrapper',\n tableSelected: 'LexicalEditorTheme__tableSelected',\n tableSelection: 'LexicalEditorTheme__tableSelection',\n text: {\n bold: 'LexicalEditorTheme__textBold',\n code: 'LexicalEditorTheme__textCode',\n italic: 'LexicalEditorTheme__textItalic',\n strikethrough: 'LexicalEditorTheme__textStrikethrough',\n subscript: 'LexicalEditorTheme__textSubscript',\n superscript: 'LexicalEditorTheme__textSuperscript',\n underline: 'LexicalEditorTheme__textUnderline',\n underlineStrikethrough: 'LexicalEditorTheme__textUnderlineStrikethrough',\n },\n upload: 'editor-upload',\n}\n"],"mappings":"AAEA,OAAO,MAAMA,kBAAA,GAAyC;EACpDC,KAAA,EAAO;EACPC,WAAA,EAAa;EACbC,cAAA,EAAgB;EAChBC,IAAA,EAAM;EACNC,aAAA,EAAe;IACbC,MAAA,EAAQ;IACRC,IAAA,EAAM;IACNC,OAAA,EAAS;IACTC,OAAA,EAAS;IACTC,KAAA,EAAO;IACPC,IAAA,EAAM;IACNC,KAAA,EAAO;IACP,cAAc;IACdC,OAAA,EAAS;IACTC,QAAA,EAAU;IACVC,OAAA,EAAS;IACTC,OAAA,EAAS;IACTC,MAAA,EAAQ;IACRC,QAAA,EAAU;IACVC,SAAA,EAAW;IACXC,QAAA,EAAU;IACVC,OAAA,EAAS;IACTC,SAAA,EAAW;IACXC,MAAA,EAAQ;IACRC,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,QAAA,EAAU;IACVC,WAAA,EAAa;IACbC,KAAA,EAAO;IACPC,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,MAAA,EAA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AAwB;EAC1B;EACAC,MAAA,EAAQ;AACV","ignoreList":[]}
1
+ {"version":3,"file":"EditorTheme.js","names":["LexicalEditorTheme","block","blockCursor","characterLimit","code","inlineBlock","heading","h1","h2","h3","h4","h5","h6","hr","hrSelected","indent","link","list","checklist","listitem","listitemChecked","listitemUnchecked","nested","olDepth","ul","ltr","mark","markOverlap","paragraph","placeholder","quote","relationship","rtl","tab","table","tableAddColumns","tableAddRows","tableAlignment","center","right","tableCell","tableCellActionButton","tableCellActionButtonContainer","tableCellHeader","tableCellResizer","tableCellSelected","tableFrozenColumn","tableRowStriping","tableScrollableWrapper","tableSelected","tableSelection","text","bold","italic","strikethrough","subscript","superscript","underline","underlineStrikethrough","upload"],"sources":["../../../src/lexical/theme/EditorTheme.tsx"],"sourcesContent":["import type { EditorThemeClasses } from 'lexical'\n\nexport const LexicalEditorTheme: EditorThemeClasses = {\n block: 'LexicalEditorTheme__block',\n blockCursor: 'LexicalEditorTheme__blockCursor',\n characterLimit: 'LexicalEditorTheme__characterLimit',\n code: 'LexicalEditorTheme__code',\n inlineBlock: 'LexicalEditorTheme__inlineBlock',\n\n heading: {\n h1: 'LexicalEditorTheme__h1',\n h2: 'LexicalEditorTheme__h2',\n h3: 'LexicalEditorTheme__h3',\n h4: 'LexicalEditorTheme__h4',\n h5: 'LexicalEditorTheme__h5',\n h6: 'LexicalEditorTheme__h6',\n },\n hr: 'LexicalEditorTheme__hr',\n hrSelected: 'LexicalEditorTheme__hrSelected',\n indent: 'LexicalEditorTheme__indent',\n link: 'LexicalEditorTheme__link',\n list: {\n checklist: 'LexicalEditorTheme__checklist',\n listitem: 'LexicalEditorTheme__listItem',\n listitemChecked: 'LexicalEditorTheme__listItemChecked',\n listitemUnchecked: 'LexicalEditorTheme__listItemUnchecked',\n nested: {\n listitem: 'LexicalEditorTheme__nestedListItem',\n },\n olDepth: [\n 'LexicalEditorTheme__ol1',\n 'LexicalEditorTheme__ol2',\n 'LexicalEditorTheme__ol3',\n 'LexicalEditorTheme__ol4',\n 'LexicalEditorTheme__ol5',\n ],\n ul: 'LexicalEditorTheme__ul',\n },\n ltr: 'LexicalEditorTheme__ltr',\n mark: 'LexicalEditorTheme__mark',\n markOverlap: 'LexicalEditorTheme__markOverlap',\n paragraph: 'LexicalEditorTheme__paragraph',\n placeholder: 'LexicalEditorTheme__placeholder',\n quote: 'LexicalEditorTheme__quote',\n relationship: 'LexicalEditorTheme__relationship',\n rtl: 'LexicalEditorTheme__rtl',\n tab: 'LexicalEditorTheme__tabNode',\n table: 'LexicalEditorTheme__table',\n tableAddColumns: 'LexicalEditorTheme__tableAddColumns',\n tableAddRows: 'LexicalEditorTheme__tableAddRows',\n tableAlignment: {\n center: 'LexicalEditorTheme__tableAlignmentCenter',\n right: 'LexicalEditorTheme__tableAlignmentRight',\n },\n tableCell: 'LexicalEditorTheme__tableCell',\n tableCellActionButton: 'LexicalEditorTheme__tableCellActionButton',\n tableCellActionButtonContainer: 'LexicalEditorTheme__tableCellActionButtonContainer',\n tableCellHeader: 'LexicalEditorTheme__tableCellHeader',\n tableCellResizer: 'LexicalEditorTheme__tableCellResizer',\n tableCellSelected: 'LexicalEditorTheme__tableCellSelected',\n tableFrozenColumn: 'LexicalEditorTheme__tableFrozenColumn',\n tableRowStriping: 'LexicalEditorTheme__tableRowStriping',\n tableScrollableWrapper: 'LexicalEditorTheme__tableScrollableWrapper',\n tableSelected: 'LexicalEditorTheme__tableSelected',\n tableSelection: 'LexicalEditorTheme__tableSelection',\n text: {\n bold: 'LexicalEditorTheme__textBold',\n code: 'LexicalEditorTheme__textCode',\n italic: 'LexicalEditorTheme__textItalic',\n strikethrough: 'LexicalEditorTheme__textStrikethrough',\n subscript: 'LexicalEditorTheme__textSubscript',\n superscript: 'LexicalEditorTheme__textSuperscript',\n underline: 'LexicalEditorTheme__textUnderline',\n underlineStrikethrough: 'LexicalEditorTheme__textUnderlineStrikethrough',\n },\n upload: 'LexicalEditorTheme__upload',\n}\n"],"mappings":"AAEA,OAAO,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,EAAQ;AACV","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,GACb,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,2BAA2B,CAAA;CAC1C,GAAG,GAAG,CAAC,OAAO,CAcd"}
1
+ {"version":3,"file":"ContentEditable.d.ts","sourceRoot":"","sources":["../../../src/lexical/ui/ContentEditable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,wBAAwB,CAAA;AAI/B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAErE,wBAAgB,sBAAsB,CAAC,EACrC,SAAS,EACT,YAAY,GACb,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,2BAA2B,CAAA;CAC1C,GAAG,GAAG,CAAC,OAAO,CAgBd"}
@@ -2,11 +2,12 @@
2
2
 
3
3
  import { c as _c } from "react/compiler-runtime";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
5
6
  import { ContentEditable } from '@lexical/react/LexicalContentEditable.js';
6
7
  import { useTranslation } from '@payloadcms/ui';
7
8
  import * as React from 'react';
8
9
  export function LexicalContentEditable(t0) {
9
- const $ = _c(4);
10
+ const $ = _c(5);
10
11
  const {
11
12
  className,
12
13
  editorConfig
@@ -14,23 +15,29 @@ export function LexicalContentEditable(t0) {
14
15
  const {
15
16
  t
16
17
  } = useTranslation();
17
- let t1;
18
- if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== t) {
19
- t1 = _jsx(ContentEditable, {
18
+ const [, t1] = useLexicalComposerContext();
19
+ const {
20
+ getTheme
21
+ } = t1;
22
+ let t2;
23
+ if ($[0] !== className || $[1] !== editorConfig?.admin?.placeholder || $[2] !== getTheme || $[3] !== t) {
24
+ const theme = getTheme();
25
+ t2 = _jsx(ContentEditable, {
20
26
  "aria-placeholder": t("lexical:general:placeholder"),
21
27
  className: className ?? "ContentEditable__root",
22
28
  placeholder: _jsx("p", {
23
- className: "editor-placeholder",
29
+ className: theme?.placeholder,
24
30
  children: editorConfig?.admin?.placeholder ?? t("lexical:general:placeholder")
25
31
  })
26
32
  });
27
33
  $[0] = className;
28
34
  $[1] = editorConfig?.admin?.placeholder;
29
- $[2] = t;
30
- $[3] = t1;
35
+ $[2] = getTheme;
36
+ $[3] = t;
37
+ $[4] = t2;
31
38
  } else {
32
- t1 = $[3];
39
+ t2 = $[4];
33
40
  }
34
- return t1;
41
+ return t2;
35
42
  }
36
43
  //# sourceMappingURL=ContentEditable.js.map