@payloadcms/richtext-lexical 4.0.0-internal.cea8867 → 4.0.0-internal.d21c039
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/exports/client/Field-QKAL7KMC.js +2 -0
- package/dist/exports/client/Field-QKAL7KMC.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-43E5QYAA.js +2 -0
- package/dist/exports/client/chunk-43E5QYAA.js.map +7 -0
- package/dist/exports/client/chunk-LN6VX25I.js +2 -0
- package/dist/exports/client/chunk-LN6VX25I.js.map +7 -0
- package/dist/exports/client/component-D5QLYS7W.js +2 -0
- package/dist/exports/client/component-D5QLYS7W.js.map +7 -0
- package/dist/exports/client/index.d.ts +1 -1
- package/dist/exports/client/index.d.ts.map +1 -1
- package/dist/exports/client/index.js +26 -26
- package/dist/exports/client/index.js.map +4 -4
- package/dist/features/blocks/server/index.js +2 -2
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
- package/dist/features/heading/constants.d.ts +2 -0
- package/dist/features/heading/constants.d.ts.map +1 -0
- package/dist/features/heading/constants.js +2 -0
- package/dist/features/heading/constants.js.map +1 -0
- package/dist/features/heading/server/index.d.ts.map +1 -1
- package/dist/features/heading/server/index.js +5 -1
- package/dist/features/heading/server/index.js.map +1 -1
- package/dist/features/heading/server/validate.d.ts +6 -0
- package/dist/features/heading/server/validate.d.ts.map +1 -0
- package/dist/features/heading/server/validate.js +15 -0
- package/dist/features/heading/server/validate.js.map +1 -0
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
- package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts +1 -1
- package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/index.js +2 -2
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +5 -2
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +5 -2
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/shared/constants.d.ts +2 -0
- package/dist/features/lists/shared/constants.d.ts.map +1 -0
- package/dist/features/lists/shared/constants.js +2 -0
- package/dist/features/lists/shared/constants.js.map +1 -0
- package/dist/features/lists/shared/validate.d.ts +5 -0
- package/dist/features/lists/shared/validate.d.ts.map +1 -0
- package/dist/features/lists/shared/validate.js +15 -0
- package/dist/features/lists/shared/validate.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +5 -2
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/index.d.ts +2 -2
- package/dist/features/relationship/client/index.d.ts.map +1 -1
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +2 -2
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +27 -31
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +8 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +28 -11
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +2 -2
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +5 -10
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
- package/dist/features/table/client/index.d.ts.map +1 -0
- package/dist/features/table/client/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +16 -43
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
- package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/debounce.js.map +1 -0
- package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/useDebounce.js.map +1 -0
- package/dist/features/table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/table/markdownTransformer.js.map +1 -0
- package/dist/features/table/server/index.d.ts +3 -0
- package/dist/features/table/server/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/server/index.js +4 -4
- package/dist/features/table/server/index.js.map +1 -0
- package/dist/features/table/server/schema.d.ts.map +1 -0
- package/dist/features/table/server/schema.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +79 -7
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +12 -13
- package/dist/features/typesServer.d.ts +1 -1
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.js +2 -1
- package/dist/features/upload/client/component/index.js.map +1 -1
- package/dist/features/upload/client/index.d.ts +3 -2
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +47 -52
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +6 -2
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +20 -16
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +2 -2
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +4 -8
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts +2 -2
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +3 -0
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +2 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/index.css +19 -22
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +1 -0
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +3 -1
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js +23 -23
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +14 -10
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +68 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +19 -21
- package/dist/lexical/LexicalEditor.js.map +1 -1
- package/dist/lexical/config/server/loader.d.ts +1 -1
- package/dist/lexical/config/server/loader.d.ts.map +1 -1
- package/dist/lexical/config/server/loader.js +2 -2
- package/dist/lexical/config/server/loader.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +2 -2
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +16 -24
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -20
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +0 -1
- package/dist/lexical/theme/EditorTheme.css +25 -37
- package/dist/lexical/ui/ContentEditable.css +17 -15
- package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H3/index.js +13 -6
- package/dist/lexical/ui/icons/H3/index.js.map +1 -1
- package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H4/index.js +13 -6
- package/dist/lexical/ui/icons/H4/index.js.map +1 -1
- package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H5/index.js +13 -6
- package/dist/lexical/ui/icons/H5/index.js.map +1 -1
- package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
- package/dist/lexical/ui/icons/H6/index.js +13 -6
- package/dist/lexical/ui/icons/H6/index.js.map +1 -1
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
- package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +1 -1
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -2
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +6 -6
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js +9 -9
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
- package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
- package/package.json +96 -23
- package/dist/dependencyChecker.spec.js +0 -16
- package/dist/dependencyChecker.spec.js.map +0 -1
- package/dist/exports/client/Field-QGSHF22S.js +0 -2
- package/dist/exports/client/Field-QGSHF22S.js.map +0 -7
- package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
- package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
- package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
- package/dist/exports/client/chunk-X3D4LZS7.js.map +0 -7
- package/dist/exports/client/component-PHZQBOJE.js +0 -2
- package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
- package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
- package/dist/features/experimental_table/client/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
- package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
- package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
- package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
- package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
- package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
- package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
- package/dist/features/experimental_table/server/index.d.ts +0 -3
- package/dist/features/experimental_table/server/index.d.ts.map +0 -1
- package/dist/features/experimental_table/server/index.js.map +0 -1
- package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
- package/dist/features/experimental_table/server/schema.js.map +0 -1
- package/dist/features/link/markdownTransformer.spec.js +0 -195
- package/dist/features/link/markdownTransformer.spec.js.map +0 -1
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
- package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
- package/dist/lexical/utils/url.spec.js +0 -114
- package/dist/lexical/utils/url.spec.js.map +0 -1
- package/dist/utilities/jsx/jsx.spec.js +0 -178
- package/dist/utilities/jsx/jsx.spec.js.map +0 -1
- /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createServerFeature.js","names":["createServerFeature","dependencies","dependenciesPriority","dependenciesSoft","feature","key","featureProviderProviderServer","props","featureProviderServer","serverFeatureProps","config","featureProviderMap","isRoot","parentIsLocalized","resolvedFeatures","unSanitizedEditorConfig","toReturn","sanitizedServerFeatureProps","newFeature"],"sources":["../../src/utilities/createServerFeature.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n FeatureProviderProviderServer,\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeature,\n ServerFeatureProviderMap,\n} from '../features/typesServer.js'\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\n\nexport type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps> = {\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n props: UnSanitizedProps\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n })
|
|
1
|
+
{"version":3,"file":"createServerFeature.js","names":["createServerFeature","dependencies","dependenciesPriority","dependenciesSoft","feature","key","featureProviderProviderServer","props","featureProviderServer","serverFeatureProps","config","featureProviderMap","isRoot","parentIsLocalized","resolvedFeatures","unSanitizedEditorConfig","toReturn","sanitizedServerFeatureProps","newFeature"],"sources":["../../src/utilities/createServerFeature.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n FeatureProviderProviderServer,\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeature,\n ServerFeatureProviderMap,\n} from '../features/typesServer.js'\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\n\nexport type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps> = {\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n props: UnSanitizedProps\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) => ServerFeature<SanitizedProps, ClientProps>)\n | Omit<ServerFeature<SanitizedProps, ClientProps>, 'sanitizedServerFeatureProps'>\n} & Pick<\n FeatureProviderServer<UnSanitizedProps, ClientProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n>\n\nexport const createServerFeature: <\n UnSanitizedProps = undefined,\n SanitizedProps = UnSanitizedProps,\n ClientProps = undefined,\n>(\n args: CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps>,\n) => FeatureProviderProviderServer<UnSanitizedProps, SanitizedProps, ClientProps> = ({\n dependencies,\n dependenciesPriority,\n dependenciesSoft,\n feature,\n key,\n}) => {\n const featureProviderProviderServer: FeatureProviderProviderServer<any, any, any> = (props) => {\n const featureProviderServer: Partial<FeatureProviderServer<any, any, any>> = {\n dependencies,\n dependenciesPriority,\n dependenciesSoft,\n key,\n serverFeatureProps: props,\n }\n\n if (typeof feature === 'function') {\n featureProviderServer.feature = ({\n config,\n featureProviderMap,\n isRoot,\n parentIsLocalized,\n resolvedFeatures,\n unSanitizedEditorConfig,\n }) => {\n const toReturn = feature({\n config,\n featureProviderMap,\n isRoot,\n parentIsLocalized,\n props,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n\n if (toReturn.sanitizedServerFeatureProps === null) {\n toReturn.sanitizedServerFeatureProps = props\n }\n return toReturn\n }\n } else {\n // For explanation why we have to spread feature, see createClientFeature.ts\n const newFeature: ServerFeature<any, any> = { ...feature }\n\n newFeature.sanitizedServerFeatureProps = props\n featureProviderServer.feature = newFeature\n }\n return featureProviderServer as FeatureProviderServer<any, any, any>\n }\n\n return featureProviderProviderServer\n}\n"],"mappings":"AA+BA,OAAO,MAAMA,mBAAA,GAMuEA,CAAC;EACnFC,YAAY;EACZC,oBAAoB;EACpBC,gBAAgB;EAChBC,OAAO;EACPC;AAAG,CACJ;EACC,MAAMC,6BAAA,GAA+EC,KAAA;IACnF,MAAMC,qBAAA,GAAuE;MAC3EP,YAAA;MACAC,oBAAA;MACAC,gBAAA;MACAE,GAAA;MACAI,kBAAA,EAAoBF;IACtB;IAEA,IAAI,OAAOH,OAAA,KAAY,YAAY;MACjCI,qBAAA,CAAsBJ,OAAO,GAAG,CAAC;QAC/BM,MAAM;QACNC,kBAAkB;QAClBC,MAAM;QACNC,iBAAiB;QACjBC,gBAAgB;QAChBC;MAAuB,CACxB;QACC,MAAMC,QAAA,GAAWZ,OAAA,CAAQ;UACvBM,MAAA;UACAC,kBAAA;UACAC,MAAA;UACAC,iBAAA;UACAN,KAAA;UACAO,gBAAA;UACAC;QACF;QAEA,IAAIC,QAAA,CAASC,2BAA2B,KAAK,MAAM;UACjDD,QAAA,CAASC,2BAA2B,GAAGV,KAAA;QACzC;QACA,OAAOS,QAAA;MACT;IACF,OAAO;MACL;MACA,MAAME,UAAA,GAAsC;QAAE,GAAGd;MAAQ;MAEzDc,UAAA,CAAWD,2BAA2B,GAAGV,KAAA;MACzCC,qBAAA,CAAsBJ,OAAO,GAAGc,UAAA;IAClC;IACA,OAAOV,qBAAA;EACT;EAEA,OAAOF,6BAAA;AACT","ignoreList":[]}
|
|
@@ -7,7 +7,7 @@ export declare const editorConfigFactory: {
|
|
|
7
7
|
default: (args: {
|
|
8
8
|
config: SanitizedConfig;
|
|
9
9
|
parentIsLocalized?: boolean;
|
|
10
|
-
}) =>
|
|
10
|
+
}) => SanitizedServerEditorConfig;
|
|
11
11
|
/**
|
|
12
12
|
* If you have instantiated a lexical editor and are accessing it outside a field (=> this is the unsanitized editor),
|
|
13
13
|
* you can extract the editor config from it.
|
|
@@ -22,7 +22,7 @@ export declare const editorConfigFactory: {
|
|
|
22
22
|
isRoot?: boolean;
|
|
23
23
|
lexical?: LexicalEditorConfig;
|
|
24
24
|
parentIsLocalized?: boolean;
|
|
25
|
-
}) =>
|
|
25
|
+
}) => SanitizedServerEditorConfig;
|
|
26
26
|
/**
|
|
27
27
|
* Create a new editor config - behaves just like instantiating a new `lexicalEditor`
|
|
28
28
|
*/
|
|
@@ -32,7 +32,7 @@ export declare const editorConfigFactory: {
|
|
|
32
32
|
isRoot?: boolean;
|
|
33
33
|
lexical?: LexicalEditorConfig;
|
|
34
34
|
parentIsLocalized?: boolean;
|
|
35
|
-
}) =>
|
|
35
|
+
}) => SanitizedServerEditorConfig;
|
|
36
36
|
fromField: (args: {
|
|
37
37
|
field: RichTextField;
|
|
38
38
|
}) => SanitizedServerEditorConfig;
|
|
@@ -41,7 +41,7 @@ export declare const editorConfigFactory: {
|
|
|
41
41
|
field: RichTextField;
|
|
42
42
|
isRoot?: boolean;
|
|
43
43
|
parentIsLocalized?: boolean;
|
|
44
|
-
}) =>
|
|
44
|
+
}) => SanitizedServerEditorConfig;
|
|
45
45
|
};
|
|
46
46
|
export declare const featuresInputToEditorConfig: (args: {
|
|
47
47
|
config: SanitizedConfig;
|
|
@@ -49,9 +49,9 @@ export declare const featuresInputToEditorConfig: (args: {
|
|
|
49
49
|
isRoot?: boolean;
|
|
50
50
|
lexical?: LexicalEditorConfig;
|
|
51
51
|
parentIsLocalized?: boolean;
|
|
52
|
-
}) =>
|
|
52
|
+
}) => {
|
|
53
53
|
features: FeatureProviderServer<unknown, unknown, unknown>[];
|
|
54
54
|
resolvedFeatureMap: ResolvedServerFeatureMap;
|
|
55
55
|
sanitizedConfig: SanitizedServerEditorConfig;
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
57
|
//# sourceMappingURL=editorConfigFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorConfigFactory.d.ts","sourceRoot":"","sources":["../../src/utilities/editorConfigFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,KAAK,EAA2B,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACjG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EACV,aAAa,EAEb,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAO1B,eAAO,MAAM,mBAAmB;IAC9B,OAAO,
|
|
1
|
+
{"version":3,"file":"editorConfigFactory.d.ts","sourceRoot":"","sources":["../../src/utilities/editorConfigFactory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,KAAK,EAA2B,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AACjG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAC7E,OAAO,KAAK,EACV,aAAa,EAEb,8BAA8B,EAC/B,MAAM,mBAAmB,CAAA;AAO1B,eAAO,MAAM,mBAAmB;IAC9B,OAAO,SAAS;QACd,MAAM,EAAE,eAAe,CAAA;QACvB,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,KAAG,2BAA2B;IAM/B;;;;;;;OAOG;IACH,UAAU,SAAS;QACjB,MAAM,EAAE,eAAe,CAAA;QACvB,MAAM,EAAE,8BAA8B,CAAA;QACtC,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,OAAO,CAAC,EAAE,mBAAmB,CAAA;QAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,KAAG,2BAA2B;IAU/B;;OAEG;IACH,YAAY,SAAS;QACnB,MAAM,EAAE,eAAe,CAAA;QACvB,QAAQ,CAAC,EAAE,aAAa,CAAA;QACxB,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,OAAO,CAAC,EAAE,mBAAmB,CAAA;QAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,KAAG,2BAA2B;IAG/B,SAAS,SAAS;QAAE,KAAK,EAAE,aAAa,CAAA;KAAE,KAAG,2BAA2B;IAMxE,oBAAoB,SAAS;QAC3B,MAAM,EAAE,eAAe,CAAA;QACvB,KAAK,EAAE,aAAa,CAAA;QACpB,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAC5B,KAAG,2BAA2B;CAahC,CAAA;AAED,eAAO,MAAM,2BAA2B,SAAU;IAChD,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,KAAG;IACF,QAAQ,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAAA;IAC5D,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,eAAe,EAAE,2BAA2B,CAAA;CA0C7C,CAAA"}
|
|
@@ -3,7 +3,7 @@ import { loadFeatures } from '../lexical/config/server/loader.js';
|
|
|
3
3
|
import { sanitizeServerFeatures } from '../lexical/config/server/sanitize.js';
|
|
4
4
|
import { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js';
|
|
5
5
|
export const editorConfigFactory = {
|
|
6
|
-
default:
|
|
6
|
+
default: args => {
|
|
7
7
|
return getDefaultSanitizedEditorConfig({
|
|
8
8
|
config: args.config,
|
|
9
9
|
parentIsLocalized: args.parentIsLocalized ?? false
|
|
@@ -17,8 +17,8 @@ export const editorConfigFactory = {
|
|
|
17
17
|
* This is the least efficient way to get the editor config, and not recommended. It is recommended to extract the `features` arg
|
|
18
18
|
* into a separate variable and use `fromFeatures` instead.
|
|
19
19
|
*/
|
|
20
|
-
fromEditor:
|
|
21
|
-
const lexicalAdapter =
|
|
20
|
+
fromEditor: args => {
|
|
21
|
+
const lexicalAdapter = args.editor({
|
|
22
22
|
config: args.config,
|
|
23
23
|
isRoot: args.isRoot ?? false,
|
|
24
24
|
parentIsLocalized: args.parentIsLocalized ?? false
|
|
@@ -29,17 +29,17 @@ export const editorConfigFactory = {
|
|
|
29
29
|
/**
|
|
30
30
|
* Create a new editor config - behaves just like instantiating a new `lexicalEditor`
|
|
31
31
|
*/
|
|
32
|
-
fromFeatures:
|
|
33
|
-
return
|
|
32
|
+
fromFeatures: args => {
|
|
33
|
+
return featuresInputToEditorConfig(args).sanitizedConfig;
|
|
34
34
|
},
|
|
35
35
|
fromField: args => {
|
|
36
36
|
const lexicalAdapter = args.field.editor;
|
|
37
37
|
const sanitizedServerEditorConfig = lexicalAdapter.editorConfig;
|
|
38
38
|
return sanitizedServerEditorConfig;
|
|
39
39
|
},
|
|
40
|
-
fromUnsanitizedField:
|
|
40
|
+
fromUnsanitizedField: args => {
|
|
41
41
|
const lexicalAdapterProvider = args.field.editor;
|
|
42
|
-
const lexicalAdapter =
|
|
42
|
+
const lexicalAdapter = lexicalAdapterProvider({
|
|
43
43
|
config: args.config,
|
|
44
44
|
isRoot: args.isRoot ?? false,
|
|
45
45
|
parentIsLocalized: args.parentIsLocalized ?? false
|
|
@@ -48,7 +48,7 @@ export const editorConfigFactory = {
|
|
|
48
48
|
return sanitizedServerEditorConfig;
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
export const featuresInputToEditorConfig =
|
|
51
|
+
export const featuresInputToEditorConfig = args => {
|
|
52
52
|
let features = [];
|
|
53
53
|
if (args.features && typeof args.features === 'function') {
|
|
54
54
|
const rootEditor = args.config.editor;
|
|
@@ -67,7 +67,7 @@ export const featuresInputToEditorConfig = async args => {
|
|
|
67
67
|
features = defaultEditorFeatures;
|
|
68
68
|
}
|
|
69
69
|
const lexical = args.lexical ?? defaultEditorConfig.lexical;
|
|
70
|
-
const resolvedFeatureMap =
|
|
70
|
+
const resolvedFeatureMap = loadFeatures({
|
|
71
71
|
config: args.config,
|
|
72
72
|
isRoot: args.isRoot ?? false,
|
|
73
73
|
parentIsLocalized: args.parentIsLocalized ?? false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorConfigFactory.js","names":["defaultEditorConfig","defaultEditorFeatures","loadFeatures","sanitizeServerFeatures","getDefaultSanitizedEditorConfig","editorConfigFactory","default","args","config","parentIsLocalized","fromEditor","lexicalAdapter","editor","isRoot","sanitizedServerEditorConfig","editorConfig","fromFeatures","featuresInputToEditorConfig","sanitizedConfig","fromField","field","fromUnsanitizedField","lexicalAdapterProvider","features","rootEditor","rootEditorFeatures","defaultFeatures","rootFeatures","lexical","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../src/utilities/editorConfigFactory.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { RichTextAdapterProvider, RichTextField, SanitizedConfig } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from '../features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n FeaturesInput,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from '../types/index.js'\n\nimport { defaultEditorConfig, defaultEditorFeatures } from '../lexical/config/server/default.js'\nimport { loadFeatures } from '../lexical/config/server/loader.js'\nimport { sanitizeServerFeatures } from '../lexical/config/server/sanitize.js'\nimport { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js'\n\nexport const editorConfigFactory = {\n default:
|
|
1
|
+
{"version":3,"file":"editorConfigFactory.js","names":["defaultEditorConfig","defaultEditorFeatures","loadFeatures","sanitizeServerFeatures","getDefaultSanitizedEditorConfig","editorConfigFactory","default","args","config","parentIsLocalized","fromEditor","lexicalAdapter","editor","isRoot","sanitizedServerEditorConfig","editorConfig","fromFeatures","featuresInputToEditorConfig","sanitizedConfig","fromField","field","fromUnsanitizedField","lexicalAdapterProvider","features","rootEditor","rootEditorFeatures","defaultFeatures","rootFeatures","lexical","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../src/utilities/editorConfigFactory.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { RichTextAdapterProvider, RichTextField, SanitizedConfig } from 'payload'\n\nimport type { FeatureProviderServer, ResolvedServerFeatureMap } from '../features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from '../lexical/config/types.js'\nimport type {\n FeaturesInput,\n LexicalRichTextAdapter,\n LexicalRichTextAdapterProvider,\n} from '../types/index.js'\n\nimport { defaultEditorConfig, defaultEditorFeatures } from '../lexical/config/server/default.js'\nimport { loadFeatures } from '../lexical/config/server/loader.js'\nimport { sanitizeServerFeatures } from '../lexical/config/server/sanitize.js'\nimport { getDefaultSanitizedEditorConfig } from './getDefaultSanitizedEditorConfig.js'\n\nexport const editorConfigFactory = {\n default: (args: {\n config: SanitizedConfig\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n return getDefaultSanitizedEditorConfig({\n config: args.config,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })\n },\n /**\n * If you have instantiated a lexical editor and are accessing it outside a field (=> this is the unsanitized editor),\n * you can extract the editor config from it.\n * This is common if you define the editor in a re-usable module scope variable and pass it to the richText field.\n *\n * This is the least efficient way to get the editor config, and not recommended. It is recommended to extract the `features` arg\n * into a separate variable and use `fromFeatures` instead.\n */\n fromEditor: (args: {\n config: SanitizedConfig\n editor: LexicalRichTextAdapterProvider\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n const lexicalAdapter: LexicalRichTextAdapter = args.editor({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n })\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n /**\n * Create a new editor config - behaves just like instantiating a new `lexicalEditor`\n */\n fromFeatures: (args: {\n config: SanitizedConfig\n features?: FeaturesInput\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n return featuresInputToEditorConfig(args).sanitizedConfig\n },\n fromField: (args: { field: RichTextField }): SanitizedServerEditorConfig => {\n const lexicalAdapter: LexicalRichTextAdapter = args.field.editor as LexicalRichTextAdapter\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n fromUnsanitizedField: (args: {\n config: SanitizedConfig\n field: RichTextField\n isRoot?: boolean\n parentIsLocalized?: boolean\n }): SanitizedServerEditorConfig => {\n const lexicalAdapterProvider: RichTextAdapterProvider = args.field\n .editor as RichTextAdapterProvider\n\n const lexicalAdapter: LexicalRichTextAdapter = lexicalAdapterProvider({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n }) as LexicalRichTextAdapter\n\n const sanitizedServerEditorConfig: SanitizedServerEditorConfig = lexicalAdapter.editorConfig\n return sanitizedServerEditorConfig\n },\n}\n\nexport const featuresInputToEditorConfig = (args: {\n config: SanitizedConfig\n features?: FeaturesInput\n isRoot?: boolean\n lexical?: LexicalEditorConfig\n parentIsLocalized?: boolean\n}): {\n features: FeatureProviderServer<unknown, unknown, unknown>[]\n resolvedFeatureMap: ResolvedServerFeatureMap\n sanitizedConfig: SanitizedServerEditorConfig\n} => {\n let features: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (args.features && typeof args.features === 'function') {\n const rootEditor = args.config.editor\n let rootEditorFeatures: FeatureProviderServer<unknown, unknown, unknown>[] = []\n if (typeof rootEditor === 'object' && 'features' in rootEditor) {\n rootEditorFeatures = (rootEditor as LexicalRichTextAdapter).features\n }\n features = args.features({\n defaultFeatures: defaultEditorFeatures,\n rootFeatures: rootEditorFeatures,\n })\n } else {\n features = args.features as FeatureProviderServer<unknown, unknown, unknown>[]\n }\n\n if (!features) {\n features = defaultEditorFeatures\n }\n\n const lexical = args.lexical ?? defaultEditorConfig.lexical\n\n const resolvedFeatureMap = loadFeatures({\n config: args.config,\n isRoot: args.isRoot ?? false,\n parentIsLocalized: args.parentIsLocalized ?? false,\n unSanitizedEditorConfig: {\n features,\n lexical,\n },\n })\n\n return {\n features,\n resolvedFeatureMap,\n sanitizedConfig: {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: args.lexical,\n resolvedFeatureMap,\n },\n }\n}\n"],"mappings":"AAWA,SAASA,mBAAmB,EAAEC,qBAAqB,QAAQ;AAC3D,SAASC,YAAY,QAAQ;AAC7B,SAASC,sBAAsB,QAAQ;AACvC,SAASC,+BAA+B,QAAQ;AAEhD,OAAO,MAAMC,mBAAA,GAAsB;EACjCC,OAAA,EAAUC,IAAA;IAIR,OAAOH,+BAAA,CAAgC;MACrCI,MAAA,EAAQD,IAAA,CAAKC,MAAM;MACnBC,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC/C;EACF;EACA;;;;;;;;EAQAC,UAAA,EAAaH,IAAA;IAOX,MAAMI,cAAA,GAAyCJ,IAAA,CAAKK,MAAM,CAAC;MACzDJ,MAAA,EAAQD,IAAA,CAAKC,MAAM;MACnBK,MAAA,EAAQN,IAAA,CAAKM,MAAM,IAAI;MACvBJ,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC/C;IAEA,MAAMK,2BAAA,GAA2DH,cAAA,CAAeI,YAAY;IAC5F,OAAOD,2BAAA;EACT;EACA;;;EAGAE,YAAA,EAAeT,IAAA;IAOb,OAAOU,2BAAA,CAA4BV,IAAA,EAAMW,eAAe;EAC1D;EACAC,SAAA,EAAYZ,IAAA;IACV,MAAMI,cAAA,GAAyCJ,IAAA,CAAKa,KAAK,CAACR,MAAM;IAEhE,MAAME,2BAAA,GAA2DH,cAAA,CAAeI,YAAY;IAC5F,OAAOD,2BAAA;EACT;EACAO,oBAAA,EAAuBd,IAAA;IAMrB,MAAMe,sBAAA,GAAkDf,IAAA,CAAKa,KAAK,CAC/DR,MAAM;IAET,MAAMD,cAAA,GAAyCW,sBAAA,CAAuB;MACpEd,MAAA,EAAQD,IAAA,CAAKC,MAAM;MACnBK,MAAA,EAAQN,IAAA,CAAKM,MAAM,IAAI;MACvBJ,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC/C;IAEA,MAAMK,2BAAA,GAA2DH,cAAA,CAAeI,YAAY;IAC5F,OAAOD,2BAAA;EACT;AACF;AAEA,OAAO,MAAMG,2BAAA,GAA+BV,IAAA;EAW1C,IAAIgB,QAAA,GAA+D,EAAE;EACrE,IAAIhB,IAAA,CAAKgB,QAAQ,IAAI,OAAOhB,IAAA,CAAKgB,QAAQ,KAAK,YAAY;IACxD,MAAMC,UAAA,GAAajB,IAAA,CAAKC,MAAM,CAACI,MAAM;IACrC,IAAIa,kBAAA,GAAyE,EAAE;IAC/E,IAAI,OAAOD,UAAA,KAAe,YAAY,cAAcA,UAAA,EAAY;MAC9DC,kBAAA,GAAqBD,UAAC,CAAsCD,QAAQ;IACtE;IACAA,QAAA,GAAWhB,IAAA,CAAKgB,QAAQ,CAAC;MACvBG,eAAA,EAAiBzB,qBAAA;MACjB0B,YAAA,EAAcF;IAChB;EACF,OAAO;IACLF,QAAA,GAAWhB,IAAA,CAAKgB,QAAQ;EAC1B;EAEA,IAAI,CAACA,QAAA,EAAU;IACbA,QAAA,GAAWtB,qBAAA;EACb;EAEA,MAAM2B,OAAA,GAAUrB,IAAA,CAAKqB,OAAO,IAAI5B,mBAAA,CAAoB4B,OAAO;EAE3D,MAAMC,kBAAA,GAAqB3B,YAAA,CAAa;IACtCM,MAAA,EAAQD,IAAA,CAAKC,MAAM;IACnBK,MAAA,EAAQN,IAAA,CAAKM,MAAM,IAAI;IACvBJ,iBAAA,EAAmBF,IAAA,CAAKE,iBAAiB,IAAI;IAC7CqB,uBAAA,EAAyB;MACvBP,QAAA;MACAK;IACF;EACF;EAEA,OAAO;IACLL,QAAA;IACAM,kBAAA;IACAX,eAAA,EAAiB;MACfK,QAAA,EAAUpB,sBAAA,CAAuB0B,kBAAA;MACjCD,OAAA,EAASrB,IAAA,CAAKqB,OAAO;MACrBC;IACF;EACF;AACF","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SanitizedConfig } from 'payload';
|
|
2
2
|
import { type SanitizedServerEditorConfig } from '../index.js';
|
|
3
|
-
export declare const getDefaultSanitizedEditorConfig: (
|
|
3
|
+
export declare const getDefaultSanitizedEditorConfig: ({ config, parentIsLocalized, }: {
|
|
4
4
|
config: SanitizedConfig;
|
|
5
5
|
parentIsLocalized: boolean;
|
|
6
|
-
}) =>
|
|
6
|
+
}) => SanitizedServerEditorConfig;
|
|
7
7
|
//# sourceMappingURL=getDefaultSanitizedEditorConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultSanitizedEditorConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"getDefaultSanitizedEditorConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAQ9D,eAAO,MAAM,+BAA+B,mCAGzC;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,iBAAiB,EAAE,OAAO,CAAA;CAC3B,KAAG,2BAGH,CAAA"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
import { defaultEditorConfig } from '../lexical/config/server/default.js';
|
|
2
2
|
import { sanitizeServerEditorConfig } from '../lexical/config/server/sanitize.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
config,
|
|
10
|
-
parentIsLocalized
|
|
11
|
-
} = args;
|
|
12
|
-
if (cachedDefaultSanitizedServerEditorConfig) {
|
|
13
|
-
return await cachedDefaultSanitizedServerEditorConfig;
|
|
14
|
-
}
|
|
15
|
-
cachedDefaultSanitizedServerEditorConfig = sanitizeServerEditorConfig(defaultEditorConfig, config, parentIsLocalized);
|
|
16
|
-
global.payload_lexical_defaultSanitizedServerEditorConfig = cachedDefaultSanitizedServerEditorConfig;
|
|
17
|
-
cachedDefaultSanitizedServerEditorConfig = await cachedDefaultSanitizedServerEditorConfig;
|
|
18
|
-
global.payload_lexical_defaultSanitizedServerEditorConfig = cachedDefaultSanitizedServerEditorConfig;
|
|
19
|
-
return cachedDefaultSanitizedServerEditorConfig;
|
|
3
|
+
const lexicalGlobal = globalThis;
|
|
4
|
+
export const getDefaultSanitizedEditorConfig = ({
|
|
5
|
+
config,
|
|
6
|
+
parentIsLocalized
|
|
7
|
+
}) => {
|
|
8
|
+
return lexicalGlobal._payload_lexical_defaultSanitizedServerEditorConfig ??= sanitizeServerEditorConfig(defaultEditorConfig, config, parentIsLocalized);
|
|
20
9
|
};
|
|
21
10
|
//# sourceMappingURL=getDefaultSanitizedEditorConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDefaultSanitizedEditorConfig.js","names":["defaultEditorConfig","sanitizeServerEditorConfig","
|
|
1
|
+
{"version":3,"file":"getDefaultSanitizedEditorConfig.js","names":["defaultEditorConfig","sanitizeServerEditorConfig","lexicalGlobal","globalThis","getDefaultSanitizedEditorConfig","config","parentIsLocalized","_payload_lexical_defaultSanitizedServerEditorConfig"],"sources":["../../src/utilities/getDefaultSanitizedEditorConfig.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport { type SanitizedServerEditorConfig } from '../index.js'\nimport { defaultEditorConfig } from '../lexical/config/server/default.js'\nimport { sanitizeServerEditorConfig } from '../lexical/config/server/sanitize.js'\n\nconst lexicalGlobal = globalThis as {\n _payload_lexical_defaultSanitizedServerEditorConfig?: SanitizedServerEditorConfig\n} & typeof globalThis\n\nexport const getDefaultSanitizedEditorConfig = ({\n config,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n parentIsLocalized: boolean\n}): SanitizedServerEditorConfig => {\n return (lexicalGlobal._payload_lexical_defaultSanitizedServerEditorConfig ??=\n sanitizeServerEditorConfig(defaultEditorConfig, config, parentIsLocalized))\n}\n"],"mappings":"AAGA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAE3C,MAAMC,aAAA,GAAgBC,UAAA;AAItB,OAAO,MAAMC,+BAAA,GAAkCA,CAAC;EAC9CC,MAAM;EACNC;AAAiB,CAIlB;EACC,OAAQJ,aAAA,CAAcK,mDAAmD,KACvEN,0BAAA,CAA2BD,mBAAA,EAAqBK,MAAA,EAAQC,iBAAA;AAC5D","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.d21c039",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
}
|
|
19
19
|
],
|
|
20
20
|
"sideEffects": [
|
|
21
|
-
"*.scss",
|
|
22
21
|
"*.css"
|
|
23
22
|
],
|
|
24
23
|
"type": "module",
|
|
@@ -113,6 +112,11 @@
|
|
|
113
112
|
"types": "./dist/lexical-proxy/@lexical-utils.d.ts",
|
|
114
113
|
"default": "./dist/lexical-proxy/@lexical-utils.js"
|
|
115
114
|
},
|
|
115
|
+
"./lexical/react/ExtensionComponent": {
|
|
116
|
+
"import": "./dist/lexical-proxy/@lexical-react/ExtensionComponent.js",
|
|
117
|
+
"types": "./dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts",
|
|
118
|
+
"default": "./dist/lexical-proxy/@lexical-react/ExtensionComponent.js"
|
|
119
|
+
},
|
|
116
120
|
"./lexical/react/LexicalAutoEmbedPlugin": {
|
|
117
121
|
"import": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js",
|
|
118
122
|
"types": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts",
|
|
@@ -178,6 +182,16 @@
|
|
|
178
182
|
"types": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts",
|
|
179
183
|
"default": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.js"
|
|
180
184
|
},
|
|
185
|
+
"./lexical/react/LexicalExtensionComposer": {
|
|
186
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js",
|
|
187
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts",
|
|
188
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js"
|
|
189
|
+
},
|
|
190
|
+
"./lexical/react/LexicalExtensionEditorComposer": {
|
|
191
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js",
|
|
192
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts",
|
|
193
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js"
|
|
194
|
+
},
|
|
181
195
|
"./lexical/react/LexicalNodeContextMenuPlugin": {
|
|
182
196
|
"import": "./dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.js",
|
|
183
197
|
"types": "./dist/lexical-proxy/@lexical-react/LexicalNodeContextMenuPlugin.d.ts",
|
|
@@ -268,6 +282,11 @@
|
|
|
268
282
|
"types": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts",
|
|
269
283
|
"default": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js"
|
|
270
284
|
},
|
|
285
|
+
"./lexical/react/LexicalSelectionAlwaysOnDisplay": {
|
|
286
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js",
|
|
287
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts",
|
|
288
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js"
|
|
289
|
+
},
|
|
271
290
|
"./lexical/react/LexicalTabIndentationPlugin": {
|
|
272
291
|
"import": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js",
|
|
273
292
|
"types": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts",
|
|
@@ -293,11 +312,56 @@
|
|
|
293
312
|
"types": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts",
|
|
294
313
|
"default": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js"
|
|
295
314
|
},
|
|
315
|
+
"./lexical/react/ReactExtension": {
|
|
316
|
+
"import": "./dist/lexical-proxy/@lexical-react/ReactExtension.js",
|
|
317
|
+
"types": "./dist/lexical-proxy/@lexical-react/ReactExtension.d.ts",
|
|
318
|
+
"default": "./dist/lexical-proxy/@lexical-react/ReactExtension.js"
|
|
319
|
+
},
|
|
320
|
+
"./lexical/react/ReactPluginHostExtension": {
|
|
321
|
+
"import": "./dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js",
|
|
322
|
+
"types": "./dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts",
|
|
323
|
+
"default": "./dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js"
|
|
324
|
+
},
|
|
325
|
+
"./lexical/react/ReactProviderExtension": {
|
|
326
|
+
"import": "./dist/lexical-proxy/@lexical-react/ReactProviderExtension.js",
|
|
327
|
+
"types": "./dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts",
|
|
328
|
+
"default": "./dist/lexical-proxy/@lexical-react/ReactProviderExtension.js"
|
|
329
|
+
},
|
|
330
|
+
"./lexical/react/TreeViewExtension": {
|
|
331
|
+
"import": "./dist/lexical-proxy/@lexical-react/TreeViewExtension.js",
|
|
332
|
+
"types": "./dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts",
|
|
333
|
+
"default": "./dist/lexical-proxy/@lexical-react/TreeViewExtension.js"
|
|
334
|
+
},
|
|
335
|
+
"./lexical/react/useExtensionComponent": {
|
|
336
|
+
"import": "./dist/lexical-proxy/@lexical-react/useExtensionComponent.js",
|
|
337
|
+
"types": "./dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts",
|
|
338
|
+
"default": "./dist/lexical-proxy/@lexical-react/useExtensionComponent.js"
|
|
339
|
+
},
|
|
340
|
+
"./lexical/react/useExtensionSignalValue": {
|
|
341
|
+
"import": "./dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js",
|
|
342
|
+
"types": "./dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts",
|
|
343
|
+
"default": "./dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js"
|
|
344
|
+
},
|
|
345
|
+
"./lexical/react/useLexicalAriaLiveRegion": {
|
|
346
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js",
|
|
347
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts",
|
|
348
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js"
|
|
349
|
+
},
|
|
296
350
|
"./lexical/react/useLexicalEditable": {
|
|
297
351
|
"import": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.js",
|
|
298
352
|
"types": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts",
|
|
299
353
|
"default": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.js"
|
|
300
354
|
},
|
|
355
|
+
"./lexical/react/useLexicalFocusManagerRef": {
|
|
356
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js",
|
|
357
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts",
|
|
358
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js"
|
|
359
|
+
},
|
|
360
|
+
"./lexical/react/useLexicalFocusTrapRef": {
|
|
361
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js",
|
|
362
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts",
|
|
363
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js"
|
|
364
|
+
},
|
|
301
365
|
"./lexical/react/useLexicalIsTextContentEmpty": {
|
|
302
366
|
"import": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js",
|
|
303
367
|
"types": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts",
|
|
@@ -308,6 +372,16 @@
|
|
|
308
372
|
"types": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts",
|
|
309
373
|
"default": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js"
|
|
310
374
|
},
|
|
375
|
+
"./lexical/react/useLexicalRovingTabIndexRef": {
|
|
376
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js",
|
|
377
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts",
|
|
378
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js"
|
|
379
|
+
},
|
|
380
|
+
"./lexical/react/useLexicalSlotRef": {
|
|
381
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js",
|
|
382
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts",
|
|
383
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js"
|
|
384
|
+
},
|
|
311
385
|
"./lexical/react/useLexicalSubscription": {
|
|
312
386
|
"import": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.js",
|
|
313
387
|
"types": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts",
|
|
@@ -343,25 +417,25 @@
|
|
|
343
417
|
]
|
|
344
418
|
},
|
|
345
419
|
"dependencies": {
|
|
346
|
-
"@lexical/clipboard": "0.
|
|
347
|
-
"@lexical/headless": "0.
|
|
348
|
-
"@lexical/html": "0.
|
|
349
|
-
"@lexical/link": "0.
|
|
350
|
-
"@lexical/list": "0.
|
|
351
|
-
"@lexical/mark": "0.
|
|
352
|
-
"@lexical/markdown": "0.
|
|
353
|
-
"@lexical/react": "0.
|
|
354
|
-
"@lexical/rich-text": "0.
|
|
355
|
-
"@lexical/selection": "0.
|
|
356
|
-
"@lexical/table": "0.
|
|
357
|
-
"@lexical/utils": "0.
|
|
420
|
+
"@lexical/clipboard": "0.50.0",
|
|
421
|
+
"@lexical/headless": "0.50.0",
|
|
422
|
+
"@lexical/html": "0.50.0",
|
|
423
|
+
"@lexical/link": "0.50.0",
|
|
424
|
+
"@lexical/list": "0.50.0",
|
|
425
|
+
"@lexical/mark": "0.50.0",
|
|
426
|
+
"@lexical/markdown": "0.50.0",
|
|
427
|
+
"@lexical/react": "0.50.0",
|
|
428
|
+
"@lexical/rich-text": "0.50.0",
|
|
429
|
+
"@lexical/selection": "0.50.0",
|
|
430
|
+
"@lexical/table": "0.50.0",
|
|
431
|
+
"@lexical/utils": "0.50.0",
|
|
358
432
|
"acorn": "8.16.0",
|
|
359
433
|
"bson-objectid": "2.0.4",
|
|
360
434
|
"csstype": "3.2.3",
|
|
361
435
|
"dequal": "2.0.3",
|
|
362
436
|
"escape-html": "1.0.3",
|
|
363
437
|
"jsox": "1.2.125",
|
|
364
|
-
"lexical": "0.
|
|
438
|
+
"lexical": "0.50.0",
|
|
365
439
|
"mdast-util-from-markdown": "2.0.3",
|
|
366
440
|
"mdast-util-mdx-jsx": "3.2.0",
|
|
367
441
|
"micromark-extension-mdx-jsx": "3.0.2",
|
|
@@ -369,8 +443,8 @@
|
|
|
369
443
|
"react-error-boundary": "6.1.1",
|
|
370
444
|
"ts-essentials": "10.0.3",
|
|
371
445
|
"uuid": "14.0.0",
|
|
372
|
-
"@payloadcms/
|
|
373
|
-
"@payloadcms/
|
|
446
|
+
"@payloadcms/ui": "4.0.0-internal.d21c039",
|
|
447
|
+
"@payloadcms/translations": "4.0.0-internal.d21c039"
|
|
374
448
|
},
|
|
375
449
|
"devDependencies": {
|
|
376
450
|
"@babel/cli": "7.27.2",
|
|
@@ -378,7 +452,7 @@
|
|
|
378
452
|
"@babel/preset-env": "7.27.2",
|
|
379
453
|
"@babel/preset-react": "7.27.1",
|
|
380
454
|
"@babel/preset-typescript": "7.27.1",
|
|
381
|
-
"@lexical/eslint-plugin": "0.
|
|
455
|
+
"@lexical/eslint-plugin": "0.50.0",
|
|
382
456
|
"@types/escape-html": "1.0.4",
|
|
383
457
|
"@types/json-schema": "7.0.15",
|
|
384
458
|
"@types/node": "24.12.3",
|
|
@@ -390,15 +464,14 @@
|
|
|
390
464
|
"esbuild-sass-plugin": "3.3.1",
|
|
391
465
|
"swc-plugin-transform-remove-imports": "8.3.0",
|
|
392
466
|
"@payloadcms/eslint-config": "3.28.0",
|
|
393
|
-
"payload": "4.0.0-internal.
|
|
467
|
+
"payload": "4.0.0-internal.d21c039"
|
|
394
468
|
},
|
|
395
469
|
"peerDependencies": {
|
|
396
470
|
"@faceless-ui/modal": "3.0.1",
|
|
397
471
|
"@faceless-ui/scroll-info": "2.0.0",
|
|
398
472
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
399
473
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
400
|
-
"
|
|
401
|
-
"payload": "4.0.0-internal.cea8867"
|
|
474
|
+
"payload": "4.0.0-internal.d21c039"
|
|
402
475
|
},
|
|
403
476
|
"engines": {
|
|
404
477
|
"node": ">=24.15.0"
|
|
@@ -420,8 +493,8 @@
|
|
|
420
493
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
421
494
|
"build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm build:esbuild:postproces && rm -rf dist/exports/client && mv dist/exports/client_unoptimized dist/exports/client",
|
|
422
495
|
"clean": "rimraf -g {dist,*.tsbuildinfo,esbuild}",
|
|
423
|
-
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
424
|
-
"copyfiles:debug": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
496
|
+
"copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
497
|
+
"copyfiles:debug": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
425
498
|
"lint": "eslint .",
|
|
426
499
|
"lint:fix": "eslint . --fix"
|
|
427
500
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { lexicalTargetVersion } from './index';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import fs from 'fs/promises';
|
|
5
|
-
import { describe, it, expect } from 'vitest';
|
|
6
|
-
const filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const dirname = path.dirname(filename);
|
|
8
|
-
describe('Lexical dependency checker', () => {
|
|
9
|
-
it('ensure lexical version installed in package.json matches dependency checker version', async () => {
|
|
10
|
-
const packageJsonString = await fs.readFile(path.resolve(dirname, '../package.json'), 'utf-8');
|
|
11
|
-
const packageJson = JSON.parse(packageJsonString);
|
|
12
|
-
const packageJsonLexicalVersion = packageJson.dependencies['lexical'];
|
|
13
|
-
expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion);
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=dependencyChecker.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dependencyChecker.spec.js","names":["lexicalTargetVersion","fileURLToPath","path","fs","describe","it","expect","filename","import","meta","url","dirname","packageJsonString","readFile","resolve","packageJson","JSON","parse","packageJsonLexicalVersion","dependencies","toBe"],"sources":["../src/dependencyChecker.spec.ts"],"sourcesContent":["import { lexicalTargetVersion } from './index'\nimport { fileURLToPath } from 'url'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { describe, it, expect } from 'vitest'\n\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\ndescribe('Lexical dependency checker', () => {\n it('ensure lexical version installed in package.json matches dependency checker version', async () => {\n const packageJsonString = await fs.readFile(path.resolve(dirname, '../package.json'), 'utf-8')\n const packageJson = JSON.parse(packageJsonString)\n const packageJsonLexicalVersion = packageJson.dependencies['lexical']\n\n expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion)\n })\n})\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,aAAa,QAAQ;AAC9B,OAAOC,IAAA,MAAU;AACjB,OAAOC,EAAA,MAAQ;AACf,SAASC,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AAErC,MAAMC,QAAA,GAAWN,aAAA,CAAcO,MAAA,CAAAC,IAAA,CAAYC,GAAG;AAC9C,MAAMC,OAAA,GAAUT,IAAA,CAAKS,OAAO,CAACJ,QAAA;AAE7BH,QAAA,CAAS,8BAA8B;EACrCC,EAAA,CAAG,uFAAuF;IACxF,MAAMO,iBAAA,GAAoB,MAAMT,EAAA,CAAGU,QAAQ,CAACX,IAAA,CAAKY,OAAO,CAACH,OAAA,EAAS,oBAAoB;IACtF,MAAMI,WAAA,GAAcC,IAAA,CAAKC,KAAK,CAACL,iBAAA;IAC/B,MAAMM,yBAAA,GAA4BH,WAAA,CAAYI,YAAY,CAAC,UAAU;IAErEb,MAAA,CAAOY,yBAAA,EAA2BE,IAAI,CAACpB,oBAAA;EACzC;AACF","ignoreList":[]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";import{b as Be,d as $,e as K,g as Oe,h as Ie,i as Fe,j as $e,k as Se,l as Pe,m as Ke}from"./chunk-X3D4LZS7.js";import{a as Ae,b as P}from"./chunk-RJ5MAOKZ.js";import{jsx as D,jsxs as le}from"react/jsx-runtime";import{BulkUploadProvider as tn,FieldDescription as on,FieldError as rn,FieldLabel as nn,isFieldRTL as sn,RenderCustomComponent as Mt,useConfig as ln,useEditDepth as an,useEffectEvent as cn,useField as un,useLocale as dn}from"@payloadcms/ui";import{mergeFieldStyles as fn}from"@payloadcms/ui/shared";import{dequal as mn}from"dequal/lite";import At,{useCallback as Bt,useEffect as Ot,useMemo as pn,useState as It}from"react";import{ErrorBoundary as gn}from"react-error-boundary";import"./bundled.css";import{jsx as j}from"react/jsx-runtime";import{LexicalComposer as Yr}from"@lexical/react/LexicalComposer.js";import{useEditDepth as Gr}from"@payloadcms/ui";import*as kt from"react";import{useMemo as Ur}from"react";import{c as _r}from"react/compiler-runtime";import{jsx as E,jsxs as se}from"react/jsx-runtime";import{useLexicalComposerContext as Dr}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as Lr}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Mr}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Ar}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Br}from"@lexical/react/LexicalRichTextPlugin.js";import{useLexicalEditable as Or}from"@lexical/react/useLexicalEditable";import{BLUR_COMMAND as Ir,COMMAND_PRIORITY_LOW as Tt,FOCUS_COMMAND as Fr}from"lexical";import*as Q from"react";import{useEffect as $r,useState as Kr}from"react";import{jsx as je}from"react/jsx-runtime";import"react";var z=({anchorElem:e,clientProps:t,plugin:o})=>o.position==="floatingAnchorElem"&&e?o.Component&&je(o.Component,{anchorElem:e,clientProps:t}):o.Component&&je(o.Component,{clientProps:t});import{c as jt}from"react/compiler-runtime";import{copyToClipboard as ze}from"@lexical/clipboard";import{useLexicalComposerContext as zt}from"@lexical/react/LexicalComposerContext.js";import{objectKlassEquals as Ht}from"@lexical/utils";import He from"bson-objectid";import{$getSelection as Vt,$isNodeSelection as Wt,COMMAND_PRIORITY_LOW as Yt,COPY_COMMAND as Gt}from"lexical";import{useEffect as Ut}from"react";var Te=e=>{if("fields"in e&&typeof e.fields=="object"&&e.fields!==null&&"id"in e.fields?e.fields.id=new He.default().toHexString():"id"in e&&(e.id=new He.default().toHexString()),e.children)for(let t of e.children)Te(t)};function Ve(){let e=jt(3),[t]=zt(),o,r;return e[0]!==t?(o=()=>t.registerCommand(Gt,n=>{let c=Vt();if(Wt(c)){let s=c.getNodes()[0]?.exportJSON(),u=JSON.parse(JSON.stringify(s));Te(u);let d={namespace:t._config.namespace,nodes:[u]},m=JSON.stringify(d);return ze(t,null,{"application/x-lexical-editor":m,"text/plain":""}).catch(Jt),!0}return ze(t,Ht(n,ClipboardEvent)?n:null).then(()=>{if(!(n instanceof ClipboardEvent)||!n.clipboardData)throw new Error("No clipboard event");let l=n.clipboardData.getData("application/x-lexical-editor");if(!l)return!0;let s=JSON.parse(l);for(let d of s.nodes)Te(d);let u=JSON.stringify(s);n.clipboardData.setData("application/x-lexical-editor",u)}).catch(l=>{throw n instanceof ClipboardEvent&&n.clipboardData?.setData("application/x-lexical-editor",""),l}),!0},Yt),r=[t],e[0]=t,e[1]=o,e[2]=r):(o=e[1],r=e[2]),Ut(o,r),null}function Jt(e){throw e}import{c as qt}from"react/compiler-runtime";import{useLexicalComposerContext as Qt}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as fe,mergeRegister as Xt}from"@lexical/utils";import{$createNodeSelection as Zt,$getEditor as oe,$getNearestNodeFromDOMNode as eo,$getSelection as me,$isDecoratorNode as H,$isElementNode as Re,$isLineBreakNode as to,$isNodeSelection as pe,$isRangeSelection as We,$isRootOrShadowRoot as oo,$isTextNode as ro,$setSelection as Ye,CLICK_COMMAND as no,COMMAND_PRIORITY_LOW as Y,KEY_ARROW_DOWN_COMMAND as io,KEY_ARROW_UP_COMMAND as so,KEY_BACKSPACE_COMMAND as lo,KEY_DELETE_COMMAND as ao,SELECTION_CHANGE_COMMAND as co}from"lexical";import{useEffect as uo}from"react";function Ge(){let e=qt(3),[t]=Qt(),o=xo,r,n;return e[0]!==t?(r=()=>Xt(t.registerCommand(no,yo,Y),t.registerCommand(ao,o,Y),t.registerCommand(lo,o,Y),t.registerCommand(co,ho,Y),t.registerCommand(so,po,Y),t.registerCommand(io,fo,Y)),n=[t],e[0]=t,e[1]=r,e[2]=n):(r=e[1],n=e[2]),uo(r,n),null}function fo(e){let t=me();if(pe(t)){e.preventDefault();let l=t.getNodes()[0]?.getNextSibling();if(H(l)){let d=oe().getElementByKey(l.getKey());return d&&re({element:d,node:l}),!0}if(!Re(l))return!0;let s=l.getFirstDescendant()??l;return s&&(fe(s,ge)?.selectEnd(),e.preventDefault()),!0}if(!We(t))return!1;let r=(t.isBackward()?t.anchor:t.focus).getNode(),n=fe(r,mo),c=n?.getNextSibling();if(!n||c!==Ue(n))return!1;if(H(c)){let l=oe().getElementByKey(c.getKey());if(l)return re({element:l,node:c}),e.preventDefault(),!0}return!1}function mo(e){return Ue(e)!==null}function po(e){let t=me();if(pe(t)){let l=t.getNodes()[0]?.getPreviousSibling();if(H(l)){let d=oe().getElementByKey(l.getKey());return d?(re({element:d,node:l}),e.preventDefault(),!0):!1}if(!Re(l))return!1;let s=l.getLastDescendant()??l;return s?(fe(s,ge)?.selectStart(),e.preventDefault(),!0):!1}if(!We(t))return!1;let r=(t.isBackward()?t.anchor:t.focus).getNode(),n=fe(r,go),c=n?.getPreviousSibling();if(!n||c!==Je(n))return!1;if(H(c)){let l=oe().getElementByKey(c.getKey());if(l)return re({element:l,node:c}),e.preventDefault(),!0}return!1}function go(e){return Je(e)!==null}function ho(){let e=bo();return document.querySelector(".decorator-selected")?.classList.remove("decorator-selected"),e?(e.element?.classList.add("decorator-selected"),!0):!1}function yo(e){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let t=Eo(e);if(!t)return!0;let{target:o}=e;return!(o instanceof HTMLElement)||o.isContentEditable||o.closest('button, textarea, input, .react-select, .code-editor, .no-select-decorator, [role="button"]')?Ye(null):re(t),!0}function xo(e){let t=me();return pe(t)?(e.preventDefault(),t.getNodes().forEach(Co),!0):!1}function Co(e){e.remove()}function Eo(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest('[data-lexical-decorator="true"]');if(!(t instanceof HTMLElement))return;let o=eo(t);return H(o)?{element:t,node:o}:void 0}function bo(){let e=me();if(!pe(e))return;let t=e.getNodes();if(t.length!==1)return;let o=t[0];return H(o)?{decorator:o,element:oe().getElementByKey(o.getKey())}:void 0}function re({element:e,node:t}){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let o=Zt();o.add(t.getKey()),Ye(o),e.scrollIntoView({behavior:"smooth",block:"nearest"}),e.classList.add("decorator-selected")}function ge(e){if(H(e)&&!e.isInline())return!0;if(!Re(e)||oo(e))return!1;let t=e.getFirstChild(),o=t===null||to(t)||ro(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&o}function Ue(e){let t=e.getNextSibling();for(;t!==null;){if(ge(t))return t;t=t.getNextSibling()}return null}function Je(e){let t=e.getPreviousSibling();for(;t!==null;){if(ge(t))return t;t=t.getPreviousSibling()}return null}import{jsx as ke}from"react/jsx-runtime";import{useLexicalComposerContext as Ro}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as ko,isHTMLElement as vo}from"lexical";import*as Ze from"react";import{useCallback as _o,useEffect as Xe,useRef as Do,useState as Lo}from"react";import{createPortal as Mo}from"react-dom";var G=(e,t,o,r,n=50,c=25)=>{let l=0;if(e&&!e.contains(r)){let{bottom:s,left:u,right:d,top:m}=e.getBoundingClientRect(),a=m+window.scrollY,i=s+window.scrollY;if(o<a-c||o>i+c||t<u-n||t>d+n)return-1;(t<u||t>d)&&(l=t<u?t-u:t-d)}return l};import{$getNodeByKey as ye}from"lexical";function U(e){let t=e.getBoundingClientRect(),o=getComputedStyle(e).getPropertyValue("transform");if(!o||o==="none")return t;let r=o.split(",").pop();return t.y=t.y-Number(r?.replace(")","")),t}function he(e){let t=(u,d)=>u?parseFloat(window.getComputedStyle(u)[d]):0,{marginBottom:o,marginTop:r}=window.getComputedStyle(e),n=t(e.previousElementSibling,"marginBottom"),c=t(e.nextElementSibling,"marginTop"),l=Math.max(parseFloat(r),n);return{marginBottom:Math.max(parseFloat(o),c),marginTop:l}}import{$getRoot as No}from"lexical";function V(e){return e.getEditorState().read(()=>No().getChildrenKeys())}var wo=1,So=-1,qe=0,B={props:null,result:null};function Po(e,t,o=20){let r=e.x-t.x,n=e.y-t.y;return r*r+n*n<=o*o}function J(e){let{anchorElem:t,cache_threshold:o=20,editor:r,fuzzy:n=!1,horizontalOffset:c=0,point:{x:l,y:s},startIndex:u=0,useEdgeAsDefault:d=!1}=e;if(o>0&&B.props&&B.result&&B.props.fuzzy===e.fuzzy&&B.props.horizontalOffset===e.horizontalOffset&&B.props.useEdgeAsDefault===e.useEdgeAsDefault&&Po(B.props.point,e.point,o))return B.result;let m=t.getBoundingClientRect(),a=V(r),i={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return r.getEditorState().read(()=>{if(d){let p=r.getElementByKey(a[0]),g=r.getElementByKey(a[a.length-1]);if(p&&g){let[f,C]=[U(p),U(g)];if(s<f.top?(i.blockElem=p,i.distance=f.top-s,i.blockNode=ye(a[0]),i.foundAtIndex=0):s>C.bottom&&(i.distance=s-C.bottom,i.blockNode=ye(a[a.length-1]),i.blockElem=g,i.foundAtIndex=a.length-1),i?.blockElem)return{blockElem:null,isFoundNodeEmptyParagraph:!1}}}let x=u,y=qe;for(;x>=0&&x<a.length;){let p=a[x],g=r.getElementByKey(p);if(g===null)break;let f=new K(l+c,s),C=$e.fromDOMRect(U(g)),{marginBottom:h,marginTop:b}=he(g),v=C.generateNewRect({bottom:C.bottom+h,left:m.left,right:m.right,top:C.top-b}),{distance:w,isOnBottomSide:k,isOnTopSide:L}=v.distanceFromPoint(f);if(w===0){i.blockElem=g,i.blockNode=ye(p),i.foundAtIndex=x,i.distance=w,i.blockNode&&i.blockNode.getType()==="paragraph"&&i.blockNode.getTextContent()===""&&(!n&&!e.returnEmptyParagraphs&&(i.blockElem=null,i.blockNode=null),i.isFoundNodeEmptyParagraph=!0);break}else n&&w<i.distance&&(i.blockElem=g,i.blockNode=ye(p),i.distance=w,i.foundAtIndex=x);y===qe&&(L?y=So:k?y=wo:y=1/0),x+=y}}),B.props=e,B.result={blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph},{blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph}}function xe(e,t){return!!e.closest(`.${t}`)}var To=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Qe(e){if(!e||To.includes(e.tagName)||e.offsetHeight===0||e.offsetWidth===0)return!1;let t=window.getComputedStyle(e);return!(t.display==="table-cell"||t.position==="absolute"||t.visibility==="hidden"||t.opacity==="0")}function Ce(e,t,o,r=0){if(!e){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let n=e.getBoundingClientRect(),c=window.getComputedStyle(e),l=t.getBoundingClientRect(),s=o.getBoundingClientRect(),u;if(["LexicalEditorTheme__block","LexicalEditorTheme__upload","LexicalEditorTheme__relationship"].some(a=>e.classList.contains(a)||e.firstElementChild?.classList.contains(a)))u=n.top+8-s.top;else{let a=Qe(e)?parseInt(c.lineHeight,10):0;u=n.top+(a-l.height)/2-s.top}let m=r;t.style.opacity="1",t.style.transform=`translate(${m}px, ${u}px)`}var Ao="add-block-menu",Ee=1/0;function Bo(e){return e===0?1/0:Ee>=0&&Ee<e?Ee:Math.floor(e/2)}function Oo(e,t,o){let r=t.parentElement,{editorConfig:n}=P(),c=n?.admin?.hideGutter?-24:12,l=Do(null),[s,u]=Lo(null);Xe(()=>{function m(a){let i=a.target;if(!vo(i))return;let x=G(r,a.pageX,a.pageY,i);if(x===-1){u(null);return}if(xe(i,Ao))return;let y=V(e),{blockElem:p,blockNode:g,foundAtIndex:f}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-x,point:new K(a.x,a.y),returnEmptyParagraphs:!0,startIndex:Bo(y.length),useEdgeAsDefault:!1});Ee=f,p&&g&&(s?.node!==g||s?.elem!==p)&&u({elem:p,node:g})}return document?.addEventListener("mousemove",m),()=>{document?.removeEventListener("mousemove",m)}},[r,t,e,s]),Xe(()=>{l.current&&s?.node&&Ce(s?.elem,l.current,t,c)},[t,s,c]);let d=_o(m=>{let a=s;a?.node&&(e.update(()=>{let i=!0;if((a?.node.getType()!=="paragraph"||a.node.getTextContent()!=="")&&(i=!1),!i){let x=ko();a?.node.insertAfter(x),setTimeout(()=>{a={elem:e.getElementByKey(x.getKey()),node:x},u(a)},0)}}),setTimeout(()=>{e.update(()=>{e.focus(),a?.node&&"select"in a.node&&typeof a.node.select=="function"&&a.node.select()})},1),setTimeout(()=>{e.dispatchCommand(Ie,{node:a?.node})},2),m.stopPropagation(),m.preventDefault())},[e,s]);return Mo(ke(Ze.Fragment,{children:ke("button",{"aria-label":"Add block",className:"icon add-block-menu",onClick:m=>{d(m)},ref:l,type:"button",children:ke("div",{className:o?"icon":""})})}),t)}function et(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[r]=Ro();return Oo(r,o,r._editable)}import{jsx as be,jsxs as Fo}from"react/jsx-runtime";import{useLexicalComposerContext as $o}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as rt}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as nt,$getNodeByKey as Ko,isHTMLElement as ve}from"lexical";import*as ct from"react";import{useEffect as _e,useRef as ne,useState as it}from"react";import{createPortal as jo}from"react-dom";var tt=0,Io=-24;var W=0;function ot(e,t,o,r,n,c,l,s,u,d=!1){let{height:m,top:a}=r.getBoundingClientRect(),{top:i,width:x}=l.getBoundingClientRect(),{marginBottom:y,marginTop:p}=he(r),g=a,f=c>=a+m/2+window.scrollY,C=!1;if(n?.elem)if(r!==n?.elem)(f&&n?.elem&&n?.elem===r.nextElementSibling||!f&&n?.elem&&n?.elem===r.previousElementSibling)&&(W++,W<200&&(C=!0));else{W++;let w=n?.boundingBox?.y,k=r.getBoundingClientRect().y;(f===n?.isBelow&&w===k||W<200)&&(C=!1)}if(C)return{isBelow:f,willStayInSamePosition:C};d?g+=m/2:f?g+=m+y/2:g-=p/2;let h=0;d||(f?h=-tt:h=tt);let b=g-i+h,v=Io-t;return o.style.width=`calc(${x}px - ${e} - var(--spacer-5))`,o.style.opacity=".8",o.style.transform=`translate(${v}px, calc(${b}px - 2px))`,n?.elem&&(n.elem.style.opacity="",n?.elem===r?f?n.elem.style.marginTop="":n.elem.style.marginBottom="":(n.elem.style.marginBottom="",n.elem.style.marginTop="")),W=0,{isBelow:f,willStayInSamePosition:C}}var zo="draggable-block-menu",st="application/x-lexical-drag-block",ie=1/0;function lt(e){return e===0?1/0:ie>=0&&ie<e?ie:Math.floor(e/2)}function Ho(e,t){let{transform:o}=t.style;e.setDragImage(t,0,0),setTimeout(()=>{t.style.transform=o})}function at(e,t){e&&(e.style.opacity="0"),t&&(t.style.opacity="",t.style.marginBottom="",t.style.marginTop="")}function Vo(e,t,o){let r=t.parentElement,n=ne(null),c=ne(null),l=ne(null),s=ne(!1),u=ne([]),[d,m]=it(null),[a,i]=it(null),{editorConfig:x}=P(),y=x?.admin?.hideGutter?-44:-8;_e(()=>{function f(C){let h=C.target;if(!ve(h))return;let b=G(r,C.pageX,C.pageY,h);if(b===-1){m(null);return}if(xe(h,zo))return;let v=V(e),{blockElem:w,foundAtIndex:k,isFoundNodeEmptyParagraph:L}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-b,point:new K(C.x,C.y),startIndex:lt(v.length),useEdgeAsDefault:!1,verbose:!1});ie=k,!(!w&&!L)&&d!==w&&m(w)}return document?.addEventListener("mousemove",f),()=>{document?.removeEventListener("mousemove",f)}},[r,t,e,d]),_e(()=>{n.current&&Ce(d,n.current,t,y)},[t,d,y]),_e(()=>{function f(h){if(!s.current)return!1;let[b]=rt(h);if(b)return!1;let{pageY:v,target:w}=h;if(!ve(w))return!1;let k=G(r,h.pageX,h.pageY,w,100,50),L=V(e),{blockElem:S,foundAtIndex:I,isFoundNodeEmptyParagraph:R}=J({anchorElem:t,editor:e,fuzzy:!0,horizontalOffset:-k,point:new K(h.x,h.y),startIndex:lt(L.length),useEdgeAsDefault:!0,verbose:!0});ie=I;let F=c.current;if(S===null||F===null)return!1;if(h.preventDefault(),h.dataTransfer.dropEffect="move",d!==S){let{isBelow:_,willStayInSamePosition:M}=ot(x?.admin?.hideGutter?"0px":"var(--spacer-5)",y+(x?.admin?.hideGutter?n?.current?.getBoundingClientRect()?.width??0:-(n?.current?.getBoundingClientRect()?.width??0)),F,S,a,v,t,h,l,R);M||i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:_})}else a?.elem&&(at(F,a.elem),i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:!1}));return!0}function C(h){if(!s.current)return!1;let[b]=rt(h);if(b)return!1;let{dataTransfer:v,pageY:w,target:k}=h,L=v?.getData(st)||"";return e.update(()=>{let S=Ko(L);if(!S||!ve(k))return!1;let I=G(r,h.pageX,h.pageY,k,100,50),{blockElem:R,isFoundNodeEmptyParagraph:F}=J({anchorElem:t,editor:e,fuzzy:!0,horizontalOffset:-I,point:new K(h.x,h.y),useEdgeAsDefault:!0});if(!R)return!1;let _=nt(R);if(!_)return!1;if(_===S)return!0;let{height:M,top:ae}=U(R),Ne=w>=ae+M/2+window.scrollY;F?(_.insertBefore(S),_.remove()):Ne?_.insertAfter(S):_.insertBefore(S),d!==null&&m(null),document.querySelectorAll(".lexical-block-highlighter").forEach(T=>{T.remove()});let we=e.getElementByKey(S.getKey()),ce=setTimeout(()=>{let T=we?.getBoundingClientRect();if(!T)return;let N=document.createElement("div");N.className="lexical-block-highlighter",N.style.backgroundColor="var(--color-bg-inverse)",N.style.transition="opacity 0.5s ease-in-out",N.style.zIndex="1",N.style.pointerEvents="none",N.style.boxSizing="border-box",N.style.borderRadius="4px",N.style.position="absolute",document.body.appendChild(N),N.style.opacity="0.1",N.style.height=`${T.height+8}px`,N.style.width=`${T.width+8}px`,N.style.top=`${T.top+window.scrollY-4}px`,N.style.left=`${T.left-4}px`;let ue=setTimeout(()=>{N.style.opacity="0";let de=setTimeout(()=>{N.remove()},500);u.current.push(de)},1e3);u.current.push(ue)},120);u.current.push(ce)}),!0}return document.addEventListener("dragover",f),document.addEventListener("drop",C),()=>{document.removeEventListener("dragover",f),document.removeEventListener("drop",C),u.current.forEach(clearTimeout),u.current=[]}},[r,y,t,e,a,d,x?.admin?.hideGutter]);function p(f){let C=f.dataTransfer;if(!C||!d)return;Ho(C,d),C.effectAllowed="move";let h="";e.update(()=>{let b=nt(d);b&&(h=b.getKey())}),s.current=!0,C.setData(st,h)}function g(){s.current=!1,a?.elem&&at(c.current,a?.elem)}return jo(Fo(ct.Fragment,{children:[be("button",{"aria-label":"Drag to move",className:"icon draggable-block-menu",draggable:!0,onDragEnd:g,onDragStart:p,ref:n,type:"button",children:be("div",{className:o?"icon":""})}),be("div",{className:"draggable-block-target-line",ref:c}),be("div",{className:"debug-highlight",ref:l})]}),t)}function ut(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[r]=$o();return Vo(r,o,r._editable)}import{c as Wo}from"react/compiler-runtime";import{jsx as De}from"react/jsx-runtime";import{useLexicalComposerContext as Yo}from"@lexical/react/LexicalComposerContext";import{$createParagraphNode as Go,$getRoot as Uo}from"lexical";import"react";var dt="insert-paragraph-at-end",ft=()=>{let e=Wo(2),[t]=Yo(),{editorConfig:o}=P();if(o?.admin?.hideInsertParagraphAtEnd)return null;let r;return e[0]!==t?(r=De("div",{"aria-label":"Insert Paragraph",className:dt,onClick:()=>{t.update(Jo)},role:"button",tabIndex:0,children:De("div",{className:`${dt}-inside`,children:De("span",{children:"+"})})}),e[0]=t,e[1]=r):r=e[1],r};function Jo(){let e=Go();Uo().append(e),e.select()}import{c as qo}from"react/compiler-runtime";import{registerMarkdownShortcuts as Qo}from"@lexical/markdown";import{useLexicalComposerContext as Xo}from"@lexical/react/LexicalComposerContext";import*as mt from"react";var pt=()=>{let e=qo(4),{editorConfig:t}=P(),[o]=Xo(),r,n;return e[0]!==o||e[1]!==t.features.markdownTransformers?(r=()=>Qo(o,t.features.markdownTransformers??[]),n=[o,t.features.markdownTransformers],e[0]=o,e[1]=t.features.markdownTransformers,e[2]=r,e[3]=n):(r=e[2],n=e[3]),mt.useEffect(r,n),null};import{c as Zo}from"react/compiler-runtime";import{useLexicalComposerContext as er}from"@lexical/react/LexicalComposerContext.js";import{$getRoot as tr}from"lexical";import{useEffect as or}from"react";function rr(e){e.update(()=>{let t=o=>{let r=o.getType();if((r==="block"||r==="inlineBlock")&&o.markDirty(),"getChildren"in o&&typeof o.getChildren=="function")for(let n of o.getChildren())t(n)};t(tr())})}function gt(){let e=Zo(5),[t]=er(),{currentView:o,views:r}=$(),n,c;return e[0]!==o||e[1]!==t||e[2]!==r?(n=()=>{r&&(o==="default"?r.default?Se(t,r.default?.nodes):Pe(t):r[o]&&(Pe(t),Se(t,r[o]?.nodes)),rr(t))},c=[t,r,o],e[0]=o,e[1]=t,e[2]=r,e[3]=n,e[4]=c):(n=e[3],c=e[4]),or(n,c),null}import{useLexicalComposerContext as nr}from"@lexical/react/LexicalComposerContext";import{$getSelection as ir,$isRangeSelection as sr,RootNode as lr}from"lexical";import{useEffect as ar}from"react";function ht(){let[e]=nr();return ar(()=>e.registerNodeTransform(lr,t=>{let o=ir();if(sr(o)){let r=o.anchor.getNode(),n=o.focus.getNode();(!r.isAttached()||!n.isAttached())&&(t.selectEnd(),console.warn("updateEditor: selection has been moved to the end of the editor because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node."))}return!1}),[e]),null}import{useLexicalComposerContext as cr}from"@lexical/react/LexicalComposerContext";import{$getSelection as ur,COMMAND_PRIORITY_LOW as dr,SELECT_ALL_COMMAND as fr}from"lexical";import{useEffect as mr}from"react";function yt(){let[e]=cr();return mr(()=>e.registerCommand(fr,()=>{if(ur())return!1;let o=document.activeElement;return o instanceof HTMLInputElement&&o.select(),!0},dr),[e]),null}import{jsx as q,jsxs as Ct}from"react/jsx-runtime";import{useLexicalComposerContext as gr}from"@lexical/react/LexicalComposerContext.js";import{useTranslation as Et}from"@payloadcms/ui";import{useCallback as hr,useMemo as yr,useState as xr}from"react";import"react";import*as bt from"react-dom";import{c as pr}from"react/compiler-runtime";import"react";function xt(e,t){let o=pr(4),{maxLength:r,minLength:n}=t,c=r===void 0?75:r,l=n===void 0?1:n,s;return o[0]!==c||o[1]!==l||o[2]!==e?(s=u=>{let{query:d}=u,m="[^"+e+Oe+"\\s]",i=new RegExp("(^|\\s|\\()(["+e+"]((?:"+m+"){0,"+c+"}))$").exec(d);if(i!==null){let x=i[1],y=i[3];if(y.length>=l)return{leadOffset:i.index+x.length,matchingString:y,replaceableString:i[2]}}return null},o[0]=c,o[1]=l,o[2]=e,o[3]=s):s=o[3],s}var O="slash-menu-popup";function Cr({isSelected:e,item:t,onClick:o,onMouseEnter:r,ref:n}){let{fieldProps:{featureClientSchemaMap:c,schemaPath:l}}=P(),{i18n:s}=Et(),u=`${O}__item ${O}__item-${t.key}`;e&&(u+=` ${O}__item--selected`);let d=t.key;return t.label&&(d=typeof t.label=="function"?t.label({featureClientSchemaMap:c,i18n:s,schemaPath:l}):t.label),d.length>25&&(d=d.substring(0,25)+"..."),Ct("button",{"aria-selected":e,className:u,id:O+"__item-"+t.key,onClick:o,onMouseEnter:r,ref:n,role:"option",tabIndex:-1,type:"button",children:[t?.Icon&&q(t.Icon,{}),q("span",{className:`${O}__item-text`,children:d})]},t.key)}function Nt({anchorElem:e=document.body}){let[t]=gr(),[o,r]=xr(null),{editorConfig:n}=P(),{i18n:c}=Et(),{fieldProps:{featureClientSchemaMap:l,schemaPath:s}}=P(),u=xt("/",{minLength:0}),d=hr(()=>{let a=[];for(let i of n.features.slashMenu.dynamicGroups)if(o){let x=i({editor:t,queryString:o});a=a.concat(x)}return a},[t,o,n?.features]),m=yr(()=>{let a=[];for(let i of n?.features.slashMenu.groups??[])a.push(i);if(o){let i=o.toLowerCase().replace(/[\s\-_]/g,"");a=a.map(y=>{let p=y.items.filter(g=>{let f=g.key;return g.label&&(f=typeof g.label=="function"?g.label({featureClientSchemaMap:l,i18n:c,schemaPath:s}):g.label),new RegExp(o,"gi").exec(f)||f.toLowerCase().replace(/[\s\-_]/g,"").includes(i)?!0:g.keywords!=null?g.keywords.some(h=>new RegExp(o,"gi").exec(h)?!0:h.toLowerCase().replace(/[\s\-_]/g,"").includes(i)):!1});return p.length?{...y,items:p}:null}),a=a.filter(y=>y!=null);let x=d();for(let y of x){let p=a.find(g=>g.key===y.key);p?a=a.filter(g=>g.key!==y.key):p={...y,items:[]},p?.items?.length&&(p.items=p.items.concat(p.items)),a.push(p)}}return a},[o,n?.features.slashMenu.groups,d,l,c,s]);return q(Fe,{anchorElem:e,groups:m,menuRenderFn:(a,{selectedItemKey:i,selectItemAndCleanUp:x,setSelectedItemKey:y})=>a.current&&m.length?bt.createPortal(q("div",{className:O,"data-theme":"dark",children:m.map(p=>{let g=p.key;return p.label&&l&&(g=typeof p.label=="function"?p.label({featureClientSchemaMap:l,i18n:c,schemaPath:s}):p.label),Ct("div",{className:`${O}__group ${O}__group-${p.key}`,children:[q("div",{className:`${O}__group-title`,children:g}),p.items.map((f,C)=>q(Cr,{index:C,isSelected:i===f.key,item:f,onClick:()=>{y(f.key),x(f)},onMouseEnter:()=>{y(f.key)},ref:h=>{f.ref={current:h}}},f.key))]},p.key)})}),a.current):null,onQueryChange:r,triggerFn:u})}import{c as Er}from"react/compiler-runtime";import{useLexicalComposerContext as br}from"@lexical/react/LexicalComposerContext";import{TEXT_TYPE_TO_FORMAT as Nr,TextNode as wr}from"lexical";import{useEffect as Sr}from"react";function wt(e){let t=Er(6),{features:o}=e,[r]=br(),n;t[0]!==r||t[1]!==o.enabledFormats?(n=()=>{let l=Pr(o.enabledFormats);if(l.length!==0)return r.registerNodeTransform(wr,s=>{l.forEach(u=>{s.hasFormat(u)&&s.toggleFormat(u)})})},t[0]=r,t[1]=o.enabledFormats,t[2]=n):n=t[2];let c;return t[3]!==r||t[4]!==o?(c=[r,o],t[3]=r,t[4]=o,t[5]=c):c=t[5],Sr(n,c),null}function Pr(e){let t=Object.keys(Nr),o=new Set(e);return t.filter(r=>!o.has(r))}import{c as Tr}from"react/compiler-runtime";import{jsx as St}from"react/jsx-runtime";import{useLexicalComposerContext as Rr}from"@lexical/react/LexicalComposerContext";import{ContentEditable as kr}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as vr}from"@payloadcms/ui";import"react";function Pt(e){let t=Tr(5),{className:o,editorConfig:r}=e,{t:n}=vr(),[,c]=Rr(),{getTheme:l}=c,s;if(t[0]!==o||t[1]!==r?.admin?.placeholder||t[2]!==l||t[3]!==n){let u=l();s=St(kr,{"aria-placeholder":n("lexical:general:placeholder"),className:o??"ContentEditable__root",placeholder:St("p",{className:u?.placeholder,children:r?.admin?.placeholder??n("lexical:general:placeholder")})}),t[0]=o,t[1]=r?.admin?.placeholder,t[2]=l,t[3]=n,t[4]=s}else s=t[4];return s}var Rt=e=>{let t=_r(13),{editorConfig:o,editorContainerRef:r,isSmallWidthViewport:n,onChange:c,rtl:l}=e,s=P(),[u]=Dr(),d=Or(),[m,a]=Kr(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=f=>{f!==null&&a(f)},t[0]=i):i=t[0];let x=i,y,p;t[1]!==u||t[2]!==s?(y=()=>{if(!s?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}s?.parentEditor?.uuid&&s.parentEditor?.registerChild(s.uuid,s);let f=()=>{s.focusEditor(s)},C=()=>{s.blurEditor(s)},h=u.registerCommand(Fr,()=>(f(),!0),Tt),b=u.registerCommand(Ir,()=>(C(),!0),Tt);return()=>{h(),b(),s.parentEditor?.unregisterChild?.(s.uuid)}},p=[u,s],t[1]=u,t[2]=s,t[3]=y,t[4]=p):(y=t[3],p=t[4]),$r(y,p);let g;return t[5]!==o||t[6]!==r||t[7]!==m||t[8]!==d||t[9]!==n||t[10]!==c||t[11]!==l?(g=se(Q.Fragment,{children:[o.features.plugins?.map(jr),se("div",{className:"editor-container",dir:l?"rtl":void 0,ref:r,children:[o.features.plugins?.map(zr),E(Br,{contentEditable:E("div",{className:"editor-scroller",children:E("div",{className:"editor",ref:x,children:E(Pt,{editorConfig:o})})}),ErrorBoundary:Lr}),E(ht,{}),d&&E(ft,{}),E(Ge,{}),E(Ve,{}),E(wt,{features:o.features}),E(yt,{}),E(gt,{}),d&&E(Ar,{ignoreSelectionChange:!0,onChange:(f,C,h)=>{(!h.has("focus")||h.size>1)&&c?.(f,C,h)}}),m&&se(Q.Fragment,{children:[!n&&d&&se(Q.Fragment,{children:[o.admin?.hideDraggableBlockElement?null:E(ut,{anchorElem:m}),o.admin?.hideAddBlockButton?null:E(et,{anchorElem:m})]}),o.features.plugins?.map(f=>{if(f.position==="floatingAnchorElem"&&!(f.desktopOnly===!0&&n))return E(z,{anchorElem:m,clientProps:f.clientProps,plugin:f},f.key)}),d&&E(Q.Fragment,{children:E(Nt,{anchorElem:m})})]}),d&&se(Q.Fragment,{children:[E(Mr,{}),o?.features?.markdownTransformers?.length>0&&E(pt,{})]}),o.features.plugins?.map(Hr),o.features.plugins?.map(Vr)]}),o.features.plugins?.map(Wr)]}),t[5]=o,t[6]=r,t[7]=m,t[8]=d,t[9]=n,t[10]=c,t[11]=l,t[12]=g):g=t[12],g};function jr(e){if(e.position==="aboveContainer")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function zr(e){if(e.position==="top")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function Hr(e){if(e.position==="normal")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function Vr(e){if(e.position==="bottom")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}function Wr(e){if(e.position==="belowContainer")return E(z,{clientProps:e.clientProps,plugin:e},e.key)}var vt=({children:e,providers:t})=>{if(!t?.length)return e;let o=t[0];return t.length>1?j(o,{children:j(vt,{providers:t.slice(1),children:e})}):j(o,{children:e})},_t=e=>{let{composerKey:t,editorConfig:o,fieldProps:r,isSmallWidthViewport:n,onChange:c,readOnly:l,rtl:s,value:u}=e,{currentView:d,views:m}=$(),a=P(),i=Gr(),x=kt.useRef(null),y=Ur(()=>{if(u&&typeof u!="object")throw new Error("The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: "+JSON.stringify(u));if(u&&Array.isArray(u)&&!("root"in u))throw new Error("You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/lexical/migration#migration-via-migration-script-recommended");if(u&&"jsonContent"in u)throw new Error("You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/lexical/migration#migrating-from-payload-plugin-lexical");let p=m?.[d]?.nodes;return{editable:l!==!0,editorState:u!=null?JSON.stringify(u):void 0,namespace:o.lexical.namespace,nodes:Ke({editorConfig:o,nodeViews:p}),onError:g=>{throw g},theme:o.lexical.theme}},[o,m,d]);return y?j(Yr,{initialConfig:y,children:j(Ae,{editorConfig:o,editorContainerRef:x,fieldProps:r,parentContext:a?.editDepth===i?a:void 0,children:j(vt,{providers:o.features.providers,children:j(Rt,{editorConfig:o,editorContainerRef:x,isSmallWidthViewport:n,onChange:c,rtl:s})})})},t+y.editable+d):j("p",{children:"Loading..."})};import{c as Jr}from"react/compiler-runtime";import{jsx as X,jsxs as qr}from"react/jsx-runtime";import{ChevronIcon as Qr,Popup as Xr,PopupList as Dt}from"@payloadcms/ui";import"react";function Lt(){let e=Jr(5),{currentView:t,setCurrentView:o,views:r}=$();if(!r||Object.keys(r).length===0)return null;let n,c;if(e[0]!==t||e[1]!==o||e[2]!==r){c=Symbol.for("react.early_return_sentinel");e:{let l=Object.keys(r);if(!l.some(en)){c=null;break e}let u=["default",...l.filter(Zr)],d=t.charAt(0).toUpperCase()+t.slice(1);n=X("div",{className:"lexical-view-selector",children:X(Xr,{button:qr("button",{className:"lexical-view-selector__button",type:"button",children:[X("span",{className:"lexical-view-selector__label",children:d}),X(Qr,{className:"lexical-view-selector__icon"})]}),buttonType:"custom",horizontalAlign:"left",render:m=>{let{close:a}=m;return X(Dt.ButtonGroup,{children:u.map(i=>{let x=i.charAt(0).toUpperCase()+i.slice(1);return X(Dt.Button,{active:i===t,disabled:i===t,onClick:()=>{o?.(i),a()},children:x},i)})})},size:"large"})})}e[0]=t,e[1]=o,e[2]=r,e[3]=n,e[4]=c}else n=e[3],c=e[4];return c!==Symbol.for("react.early_return_sentinel")?c:n}function Zr(e){return e!=="default"}function en(e){return e!=="default"}var Z="rich-text-lexical",hn=e=>{let{editorConfig:t,field:o,field:{admin:{className:r,description:n,readOnly:c}={},label:l,localized:s,required:u},path:d,readOnly:m,schemaPath:a,validate:i}=e,x=m||c,y=dn(),{config:{localization:p}}=ln(),g=sn({fieldLocalized:s,locale:y,localizationConfig:p||void 0}),f=an(),{isControlledByParent:C}=$(),h=Bt((A,te)=>typeof i=="function"?i(A,{...te,required:u}):!0,[i,u]),{customComponents:{AfterInput:b,BeforeInput:v,Description:w,Error:k,Label:L}={},disabled:S,initialValue:I,path:R,setValue:F,showError:_,value:M}=un({potentiallyStalePath:d,validate:h}),ae=x||S,[ee,Ne]=It(!1),[Le,we]=It(),ce=At.useRef(I),T=At.useRef(M);Ot(()=>{let A=()=>{let te=window.matchMedia("(max-width: 768px)").matches;te!==ee&&Ne(te)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[ee]);let N=["field-type",Z,r,_&&"error",ae&&`${Z}--read-only`,t?.admin?.hideGutter!==!0&&!ee?`${Z}--show-gutter`:null].filter(Boolean).join(" "),ue=`${R}.${f}`,de=Be(),Ft=Bt(A=>{de(()=>{let Me=A.toJSON();T.current=Me,F(Me)})},[F,de]),$t=pn(()=>fn(o),[o]),Kt=cn(A=>{T.current!==M&&!mn(T.current!=null?JSON.parse(JSON.stringify(T.current)):T.current,M)&&(ce.current=A,T.current=M,we(new Date))});return Ot(()=>{Object.is(I,ce.current)||Kt(I)},[I]),le("div",{className:N,"data-field-path":R,"data-field-schemapath":a,"data-lexical-view":t?.view,style:$t,children:[le("div",{className:`${Z}__label-row`,children:[L||D(nn,{label:l,localized:s,path:R,required:u}),!C&&D(Lt,{})]}),le("div",{className:`${Z}__wrap`,children:[D(Mt,{CustomComponent:k,Fallback:D(rn,{path:R,showError:_})}),le(gn,{fallbackRender:yn,onReset:()=>{},children:[v,D("div",{className:`${Z}__editor-content`,children:D(tn,{modalSlugPrefix:`lexical-${R}`,children:D(_t,{composerKey:ue,editorConfig:t,fieldProps:e,isSmallWidthViewport:ee,onChange:Ft,readOnly:ae,rtl:g,value:M},JSON.stringify({path:R,rerenderProviderKey:Le}))})}),b]}),D(Mt,{CustomComponent:w,Fallback:D(on,{description:n,path:R})})]})]},ue)};function yn({error:e}){return le("div",{className:"errorBoundary",role:"alert",children:[D("p",{children:"Something went wrong:"}),D("pre",{style:{color:"red"},children:e instanceof Error?e.message:String(e)})]})}var kl=hn;export{kl as RichText};
|
|
2
|
-
//# sourceMappingURL=Field-QGSHF22S.js.map
|