@payloadcms/richtext-lexical 3.0.0-beta.134 → 3.0.0-beta.135
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-KKSJXHR7.js +2 -0
- package/dist/exports/client/Field-KKSJXHR7.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-QPPOQTHD.js +2 -0
- package/dist/exports/client/{chunk-OOBB5GCO.js.map → chunk-QPPOQTHD.js.map} +3 -3
- package/dist/exports/client/index.js +15 -13
- package/dist/exports/client/index.js.map +4 -4
- package/dist/exports/server/ast/mdx.d.ts +7 -0
- package/dist/exports/server/ast/mdx.d.ts.map +1 -0
- package/dist/exports/server/ast/mdx.js +37 -0
- package/dist/exports/server/ast/mdx.js.map +1 -0
- package/dist/exports/shared.d.ts +4 -0
- package/dist/exports/shared.d.ts.map +1 -0
- package/dist/exports/shared.js +4 -0
- package/dist/exports/shared.js.map +1 -0
- package/dist/features/blocks/client/index.d.ts +1 -5
- package/dist/features/blocks/client/index.d.ts.map +1 -1
- package/dist/features/blocks/client/index.js +138 -154
- package/dist/features/blocks/client/index.js.map +1 -1
- package/dist/features/blocks/client/markdownTransformer.d.ts +16 -0
- package/dist/features/blocks/client/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/client/markdownTransformer.js +144 -0
- package/dist/features/blocks/client/markdownTransformer.js.map +1 -0
- package/dist/features/blocks/client/plugin/index.d.ts +1 -2
- package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/server/index.d.ts +1 -2
- package/dist/features/blocks/server/index.d.ts.map +1 -1
- package/dist/features/blocks/server/index.js +5 -8
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts +22 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js +136 -0
- package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts +22 -0
- package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -0
- package/dist/features/blocks/server/markdownTransformer.js +400 -0
- package/dist/features/blocks/server/markdownTransformer.js.map +1 -0
- package/dist/features/experimental_table/client/index.d.ts.map +1 -1
- package/dist/features/experimental_table/client/index.js +2 -0
- package/dist/features/experimental_table/client/index.js.map +1 -1
- package/dist/features/experimental_table/markdownTransformer.d.ts +5 -0
- package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/experimental_table/markdownTransformer.js +127 -0
- package/dist/features/experimental_table/markdownTransformer.js.map +1 -0
- package/dist/features/experimental_table/server/index.d.ts.map +1 -1
- package/dist/features/experimental_table/server/index.js +2 -0
- package/dist/features/experimental_table/server/index.js.map +1 -1
- package/dist/features/typesClient.d.ts +11 -2
- package/dist/features/typesClient.d.ts.map +1 -1
- package/dist/features/typesClient.js.map +1 -1
- package/dist/features/typesServer.d.ts +6 -2
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +68 -164
- package/dist/field/Field.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.d.ts.map +1 -1
- package/dist/field/index.js +23 -14
- package/dist/field/index.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lexical/config/client/loader.d.ts +6 -1
- package/dist/lexical/config/client/loader.d.ts.map +1 -1
- package/dist/lexical/config/client/loader.js +6 -0
- package/dist/lexical/config/client/loader.js.map +1 -1
- package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/client/sanitize.js +15 -2
- package/dist/lexical/config/client/sanitize.js.map +1 -1
- package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
- package/dist/lexical/config/server/sanitize.js +15 -2
- package/dist/lexical/config/server/sanitize.js.map +1 -1
- package/dist/lexical/nodes/index.d.ts +4 -0
- package/dist/lexical/nodes/index.d.ts.map +1 -1
- package/dist/lexical/nodes/index.js +8 -1
- package/dist/lexical/nodes/index.js.map +1 -1
- package/dist/lexical-proxy/@lexical-headless.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-headless.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-headless.js +2 -0
- package/dist/lexical-proxy/@lexical-headless.js.map +1 -0
- package/dist/lexical-proxy/@lexical-link.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-link.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-link.js +2 -0
- package/dist/lexical-proxy/@lexical-link.js.map +1 -0
- package/dist/lexical-proxy/@lexical-list.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-list.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-list.js +2 -0
- package/dist/lexical-proxy/@lexical-list.js.map +1 -0
- package/dist/lexical-proxy/@lexical-mark.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-mark.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-mark.js +2 -0
- package/dist/lexical-proxy/@lexical-mark.js.map +1 -0
- package/dist/lexical-proxy/@lexical-markdown.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-markdown.js +2 -0
- package/dist/lexical-proxy/@lexical-markdown.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js +2 -0
- package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js +2 -0
- package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js.map +1 -0
- package/dist/lexical-proxy/@lexical-rich-text.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-rich-text.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-rich-text.js +2 -0
- package/dist/lexical-proxy/@lexical-rich-text.js.map +1 -0
- package/dist/lexical-proxy/@lexical-selection.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-selection.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-selection.js +2 -0
- package/dist/lexical-proxy/@lexical-selection.js.map +1 -0
- package/dist/lexical-proxy/@lexical-utils.d.ts +2 -0
- package/dist/lexical-proxy/@lexical-utils.d.ts.map +1 -0
- package/dist/lexical-proxy/@lexical-utils.js +2 -0
- package/dist/lexical-proxy/@lexical-utils.js.map +1 -0
- package/dist/lexical-proxy/lexical.d.ts +2 -0
- package/dist/lexical-proxy/lexical.d.ts.map +1 -0
- package/dist/lexical-proxy/lexical.js +2 -0
- package/dist/lexical-proxy/lexical.js.map +1 -0
- package/dist/utilities/createClientFeature.d.ts +5 -0
- package/dist/utilities/createClientFeature.d.ts.map +1 -1
- package/dist/utilities/createClientFeature.js +6 -0
- package/dist/utilities/createClientFeature.js.map +1 -1
- package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
- package/dist/utilities/initLexicalFeatures.js +3 -2
- package/dist/utilities/initLexicalFeatures.js.map +1 -1
- package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts +52 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts.map +1 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js +79 -0
- package/dist/utilities/jsx/collectTopLevelJSXInLines.js.map +1 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts +12 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts.map +1 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js +125 -0
- package/dist/utilities/jsx/extractPropsFromJSXPropsString.js.map +1 -0
- package/dist/utilities/jsx/jsx.d.ts +26 -0
- package/dist/utilities/jsx/jsx.d.ts.map +1 -0
- package/dist/utilities/jsx/jsx.js +105 -0
- package/dist/utilities/jsx/jsx.js.map +1 -0
- package/dist/utilities/jsx/jsx.spec.d.ts +2 -0
- package/dist/utilities/jsx/jsx.spec.d.ts.map +1 -0
- package/dist/utilities/jsx/jsx.spec.js +142 -0
- package/dist/utilities/jsx/jsx.spec.js.map +1 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts +11 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts.map +1 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.js +61 -0
- package/dist/utilities/jsx/lexicalMarkdownCopy.js.map +1 -0
- package/package.json +284 -7
- package/dist/exports/client/Field-S5G27AVI.js +0 -2
- package/dist/exports/client/Field-S5G27AVI.js.map +0 -7
- package/dist/exports/client/chunk-OOBB5GCO.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx.spec.js","names":["extractPropsFromJSXPropsString","propsToJSXString","describe","INPUT_AND_OUTPUT","input","output","key","object","test","inputFromOutput","global","packageId","uniqueId","update","hello","something","nested","it","replace","propsObject","propsString","console","log","expect","toStrictEqual","originalInput","props","replaceAll","toBe"],"sources":["../../../src/utilities/jsx/jsx.spec.ts"],"sourcesContent":["import { extractPropsFromJSXPropsString } from './extractPropsFromJSXPropsString.js'\nimport { propsToJSXString } from './jsx.js'\n\ndescribe('jsx', () => {\n describe('prop string to object', () => {\n const INPUT_AND_OUTPUT = [\n {\n input: 'key=\"value\"',\n output: {\n key: 'value',\n },\n },\n {\n input: 'key={[1, 2, 3]}',\n output: {\n key: [1, 2, 3],\n },\n },\n {\n input: 'key={[1, 2, 3, [1, 2]]}',\n output: {\n key: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={4}',\n output: {\n object: 4,\n },\n },\n {\n input: 'object={{\"test\": 1}}',\n output: {\n object: { test: 1 },\n },\n },\n {\n input: 'object={[1, 2, 3, [1, 2]]}',\n output: {\n object: [1, 2, 3, [1, 2]],\n },\n },\n {\n input: 'object={[1, 2]}',\n output: {\n object: [1, 2],\n },\n },\n {\n input: 'key=\"value\" object={{key: \"value\"}}',\n inputFromOutput: 'key=\"value\" object={{\"key\": \"value\"}}',\n output: {\n key: 'value',\n object: { key: 'value' },\n },\n },\n {\n input: 'global packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'global key=\"value\" object={{key: \"value\", something: \"test\", hello: 1}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"something\": \"test\"}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: { hello: 1, key: 'value', something: 'test' },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n {\n input:\n 'object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}}',\n inputFromOutput:\n 'object={{\"hello\": 1, \"key\": \"value\", \"nested\": {\"key\": \"value\"}, \"something\": \"test\", \"test\": [1, 2, 3]}}',\n output: {\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n },\n },\n {\n input:\n 'global key=\"value\" object={{hello: 1, key: \"value\", nested: { key: \"value\" }, something: \"test\", test: [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n inputFromOutput:\n 'global key=\"value\" object={{\"hello\": 1, \"key\": \"value\", \"nested\": { \"key\": \"value\" }, \"something\": \"test\", \"test\": [1, 2, 3]}} packageId=\"myId\" uniqueId=\"some unique id!\" update',\n output: {\n global: true,\n key: 'value',\n object: {\n hello: 1,\n key: 'value',\n nested: { key: 'value' },\n something: 'test',\n test: [1, 2, 3],\n },\n packageId: 'myId',\n uniqueId: 'some unique id!',\n update: true,\n },\n },\n ]\n\n for (const { input, output } of INPUT_AND_OUTPUT) {\n it(`can correctly convert to object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsObject = extractPropsFromJSXPropsString({ propsString: input })\n console.log({ output, propsObject })\n\n expect(propsObject).toStrictEqual(output)\n })\n }\n\n for (const { input: originalInput, inputFromOutput, output } of INPUT_AND_OUTPUT) {\n const input = inputFromOutput || originalInput\n it(`can correctly convert from object: \"${input.replace(/\\n/g, '\\\\n')}\"`, () => {\n const propsString = propsToJSXString({ props: output })\n console.log({ input, propsString })\n\n expect(propsString.replaceAll(' ', '')).toBe(input.replaceAll(' ', ''))\n })\n }\n })\n})\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Transformer } from '@lexical/markdown';
|
|
2
|
+
import type { ElementNode } from 'lexical';
|
|
3
|
+
export declare function normalizeMarkdown(input: string, shouldMergeAdjacentLines?: boolean): string;
|
|
4
|
+
/**
|
|
5
|
+
* Renders markdown from a string. The selection is moved to the start after the operation.
|
|
6
|
+
*
|
|
7
|
+
* @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions
|
|
8
|
+
* @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.
|
|
9
|
+
*/
|
|
10
|
+
export declare function $convertFromMarkdownString(markdown: string, transformers?: Array<Transformer>, node?: ElementNode, shouldPreserveNewLines?: boolean, shouldMergeAdjacentLines?: boolean): void;
|
|
11
|
+
//# sourceMappingURL=lexicalMarkdownCopy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicalMarkdownCopy.d.ts","sourceRoot":"","sources":["../../../src/utilities/jsx/lexicalMarkdownCopy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAqB1C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,wBAAwB,UAAQ,GAAG,MAAM,CA6DzF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,YAAY,GAAE,KAAK,CAAC,WAAW,CAAgB,EAC/C,IAAI,CAAC,EAAE,WAAW,EAClB,sBAAsB,UAAQ,EAC9B,wBAAwB,UAAO,GAC9B,IAAI,CAMN"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* eslint-disable regexp/no-unused-capturing-group */import { $convertFromMarkdownString as $originalConvertFromMarkdownString, TRANSFORMERS } from '@lexical/markdown';
|
|
2
|
+
const EMPTY_OR_WHITESPACE_ONLY = /^[\t ]*$/;
|
|
3
|
+
const ORDERED_LIST_REGEX = /^(\s*)(\d+)\.\s/;
|
|
4
|
+
const UNORDERED_LIST_REGEX = /^(\s*)[-*+]\s/;
|
|
5
|
+
const CHECK_LIST_REGEX = /^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i;
|
|
6
|
+
const HEADING_REGEX = /^(#{1,6})\s/;
|
|
7
|
+
const QUOTE_REGEX = /^>\s/;
|
|
8
|
+
const CODE_START_REGEX = /^[ \t]*```(\w+)?/;
|
|
9
|
+
const CODE_END_REGEX = /[ \t]*```$/;
|
|
10
|
+
const CODE_SINGLE_LINE_REGEX = /^[ \t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/;
|
|
11
|
+
const TABLE_ROW_REG_EXP = /^\|(.+)\|\s?$/;
|
|
12
|
+
const TABLE_ROW_DIVIDER_REG_EXP = /^(\| ?:?-*:? ?)+\|\s?$/;
|
|
13
|
+
const TAG_START_REGEX = /^[ \t]*<[a-z_][\w-]*(?:\s[^<>]*)?\/?>/i;
|
|
14
|
+
const TAG_END_REGEX = /^[ \t]*<\/[a-z_][\w-]*\s*>/i;
|
|
15
|
+
export function normalizeMarkdown(input, shouldMergeAdjacentLines = false) {
|
|
16
|
+
const lines = input.split('\n');
|
|
17
|
+
let inCodeBlock = false;
|
|
18
|
+
const sanitizedLines = [];
|
|
19
|
+
for (let i = 0; i < lines.length; i++) {
|
|
20
|
+
const line = lines[i];
|
|
21
|
+
const lastLine = sanitizedLines[sanitizedLines.length - 1];
|
|
22
|
+
// Code blocks of ```single line``` don't toggle the inCodeBlock flag
|
|
23
|
+
if (CODE_SINGLE_LINE_REGEX.test(line)) {
|
|
24
|
+
sanitizedLines.push(line);
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
if (CODE_START_REGEX.test(line) && !inCodeBlock || CODE_END_REGEX.test(line) && inCodeBlock) {
|
|
28
|
+
inCodeBlock = !inCodeBlock;
|
|
29
|
+
}
|
|
30
|
+
// Detect the start or end of a code block
|
|
31
|
+
if (CODE_START_REGEX.test(line) || CODE_END_REGEX.test(line)) {
|
|
32
|
+
sanitizedLines.push(line);
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// If we are inside a code block, keep the line unchanged
|
|
36
|
+
if (inCodeBlock) {
|
|
37
|
+
sanitizedLines.push(line);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
// In markdown the concept of "empty paragraphs" does not exist.
|
|
41
|
+
// Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.
|
|
42
|
+
if (EMPTY_OR_WHITESPACE_ONLY.test(line) || EMPTY_OR_WHITESPACE_ONLY.test(lastLine) || !lastLine || HEADING_REGEX.test(lastLine) || HEADING_REGEX.test(line) || QUOTE_REGEX.test(line) || ORDERED_LIST_REGEX.test(line) || UNORDERED_LIST_REGEX.test(line) || CHECK_LIST_REGEX.test(line) || TABLE_ROW_REG_EXP.test(line) || TABLE_ROW_DIVIDER_REG_EXP.test(line) || !shouldMergeAdjacentLines || TAG_START_REGEX.test(line) || TAG_END_REGEX.test(line) || TAG_START_REGEX.test(lastLine) || TAG_END_REGEX.test(lastLine)) {
|
|
43
|
+
sanitizedLines.push(line);
|
|
44
|
+
} else {
|
|
45
|
+
sanitizedLines[sanitizedLines.length - 1] = lastLine + ' ' + line.trim();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return sanitizedLines.join('\n');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Renders markdown from a string. The selection is moved to the start after the operation.
|
|
52
|
+
*
|
|
53
|
+
* @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions
|
|
54
|
+
* @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.
|
|
55
|
+
*/
|
|
56
|
+
export function $convertFromMarkdownString(markdown, transformers = TRANSFORMERS, node, shouldPreserveNewLines = false, shouldMergeAdjacentLines = true) {
|
|
57
|
+
const sanitizedMarkdown = shouldPreserveNewLines ? markdown : normalizeMarkdown(markdown, shouldMergeAdjacentLines);
|
|
58
|
+
return $originalConvertFromMarkdownString(sanitizedMarkdown, transformers, node) // shouldPreserveNewLines to true, as we do our own, modified markdown normalization here.
|
|
59
|
+
;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=lexicalMarkdownCopy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicalMarkdownCopy.js","names":["$convertFromMarkdownString","$originalConvertFromMarkdownString","TRANSFORMERS","EMPTY_OR_WHITESPACE_ONLY","ORDERED_LIST_REGEX","UNORDERED_LIST_REGEX","CHECK_LIST_REGEX","HEADING_REGEX","QUOTE_REGEX","CODE_START_REGEX","CODE_END_REGEX","CODE_SINGLE_LINE_REGEX","TABLE_ROW_REG_EXP","TABLE_ROW_DIVIDER_REG_EXP","TAG_START_REGEX","TAG_END_REGEX","normalizeMarkdown","input","shouldMergeAdjacentLines","lines","split","inCodeBlock","sanitizedLines","i","length","line","lastLine","test","push","trim","join","markdown","transformers","node","shouldPreserveNewLines","sanitizedMarkdown"],"sources":["../../../src/utilities/jsx/lexicalMarkdownCopy.ts"],"sourcesContent":["/* eslint-disable regexp/no-unused-capturing-group */\n\nimport type {\n MultilineElementTransformer as _MultilineElementTransformer,\n Transformer,\n} from '@lexical/markdown'\nimport type { ElementNode } from 'lexical'\n\nimport {\n $convertFromMarkdownString as $originalConvertFromMarkdownString,\n TRANSFORMERS,\n} from '@lexical/markdown'\n\nconst EMPTY_OR_WHITESPACE_ONLY = /^[\\t ]*$/\nconst ORDERED_LIST_REGEX = /^(\\s*)(\\d+)\\.\\s/\nconst UNORDERED_LIST_REGEX = /^(\\s*)[-*+]\\s/\nconst CHECK_LIST_REGEX = /^(\\s*)(?:-\\s)?\\s?(\\[(\\s|x)?\\])\\s/i\nconst HEADING_REGEX = /^(#{1,6})\\s/\nconst QUOTE_REGEX = /^>\\s/\nconst CODE_START_REGEX = /^[ \\t]*```(\\w+)?/\nconst CODE_END_REGEX = /[ \\t]*```$/\nconst CODE_SINGLE_LINE_REGEX = /^[ \\t]*```[^`]+(?:(?:`{1,2}|`{4,})[^`]+)*```(?:[^`]|$)/\nconst TABLE_ROW_REG_EXP = /^\\|(.+)\\|\\s?$/\nconst TABLE_ROW_DIVIDER_REG_EXP = /^(\\| ?:?-*:? ?)+\\|\\s?$/\nconst TAG_START_REGEX = /^[ \\t]*<[a-z_][\\w-]*(?:\\s[^<>]*)?\\/?>/i\nconst TAG_END_REGEX = /^[ \\t]*<\\/[a-z_][\\w-]*\\s*>/i\n\nexport function normalizeMarkdown(input: string, shouldMergeAdjacentLines = false): string {\n const lines = input.split('\\n')\n let inCodeBlock = false\n const sanitizedLines: string[] = []\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n const lastLine = sanitizedLines[sanitizedLines.length - 1]\n\n // Code blocks of ```single line``` don't toggle the inCodeBlock flag\n if (CODE_SINGLE_LINE_REGEX.test(line)) {\n sanitizedLines.push(line)\n continue\n }\n\n if (\n (CODE_START_REGEX.test(line) && !inCodeBlock) ||\n (CODE_END_REGEX.test(line) && inCodeBlock)\n ) {\n inCodeBlock = !inCodeBlock\n }\n\n // Detect the start or end of a code block\n if (CODE_START_REGEX.test(line) || CODE_END_REGEX.test(line)) {\n sanitizedLines.push(line)\n continue\n }\n\n // If we are inside a code block, keep the line unchanged\n if (inCodeBlock) {\n sanitizedLines.push(line)\n continue\n }\n\n // In markdown the concept of \"empty paragraphs\" does not exist.\n // Blocks must be separated by an empty line. Non-empty adjacent lines must be merged.\n if (\n EMPTY_OR_WHITESPACE_ONLY.test(line) ||\n EMPTY_OR_WHITESPACE_ONLY.test(lastLine) ||\n !lastLine ||\n HEADING_REGEX.test(lastLine) ||\n HEADING_REGEX.test(line) ||\n QUOTE_REGEX.test(line) ||\n ORDERED_LIST_REGEX.test(line) ||\n UNORDERED_LIST_REGEX.test(line) ||\n CHECK_LIST_REGEX.test(line) ||\n TABLE_ROW_REG_EXP.test(line) ||\n TABLE_ROW_DIVIDER_REG_EXP.test(line) ||\n !shouldMergeAdjacentLines ||\n TAG_START_REGEX.test(line) ||\n TAG_END_REGEX.test(line) ||\n TAG_START_REGEX.test(lastLine) ||\n TAG_END_REGEX.test(lastLine)\n ) {\n sanitizedLines.push(line)\n } else {\n sanitizedLines[sanitizedLines.length - 1] = lastLine + ' ' + line.trim()\n }\n }\n\n return sanitizedLines.join('\\n')\n}\n\n/**\n * Renders markdown from a string. The selection is moved to the start after the operation.\n *\n * @param {boolean} [shouldPreserveNewLines] By setting this to true, new lines will be preserved between conversions\n * @param {boolean} [shouldMergeAdjacentLines] By setting this to true, adjacent non empty lines will be merged according to commonmark spec: https://spec.commonmark.org/0.24/#example-177. Not applicable if shouldPreserveNewLines = true.\n */\nexport function $convertFromMarkdownString(\n markdown: string,\n transformers: Array<Transformer> = TRANSFORMERS,\n node?: ElementNode,\n shouldPreserveNewLines = false,\n shouldMergeAdjacentLines = true, // Changed from false to true here\n): void {\n const sanitizedMarkdown = shouldPreserveNewLines\n ? markdown\n : normalizeMarkdown(markdown, shouldMergeAdjacentLines)\n\n return $originalConvertFromMarkdownString(sanitizedMarkdown, transformers, node) // shouldPreserveNewLines to true, as we do our own, modified markdown normalization here.\n}\n"],"mappings":"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","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/richtext-lexical",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.135",
|
|
4
4
|
"description": "The officially supported Lexical richtext adapter for Payload",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
6
|
"repository": {
|
|
@@ -39,6 +39,271 @@
|
|
|
39
39
|
"import": "./dist/exports/server/migrate.js",
|
|
40
40
|
"types": "./dist/exports/server/migrate.d.ts",
|
|
41
41
|
"default": "./dist/exports/server/migrate.js"
|
|
42
|
+
},
|
|
43
|
+
"./lexical": {
|
|
44
|
+
"import": "./dist/lexical-proxy/lexical.js",
|
|
45
|
+
"types": "./dist/lexical-proxy/lexical.d.ts",
|
|
46
|
+
"default": "./dist/lexical-proxy/lexical.js"
|
|
47
|
+
},
|
|
48
|
+
"./lexical/headless": {
|
|
49
|
+
"import": "./dist/lexical-proxy/@lexical-headless.js",
|
|
50
|
+
"types": "./dist/lexical-proxy/@lexical-headless.d.ts",
|
|
51
|
+
"default": "./dist/lexical-proxy/@lexical-headless.js"
|
|
52
|
+
},
|
|
53
|
+
"./lexical/link": {
|
|
54
|
+
"import": "./dist/lexical-proxy/@lexical-link.js",
|
|
55
|
+
"types": "./dist/lexical-proxy/@lexical-link.d.ts",
|
|
56
|
+
"default": "./dist/lexical-proxy/@lexical-link.js"
|
|
57
|
+
},
|
|
58
|
+
"./lexical/list": {
|
|
59
|
+
"import": "./dist/lexical-proxy/@lexical-list.js",
|
|
60
|
+
"types": "./dist/lexical-proxy/@lexical-list.d.ts",
|
|
61
|
+
"default": "./dist/lexical-proxy/@lexical-list.js"
|
|
62
|
+
},
|
|
63
|
+
"./lexical/mark": {
|
|
64
|
+
"import": "./dist/lexical-proxy/@lexical-mark.js",
|
|
65
|
+
"types": "./dist/lexical-proxy/@lexical-mark.d.ts",
|
|
66
|
+
"default": "./dist/lexical-proxy/@lexical-mark.js"
|
|
67
|
+
},
|
|
68
|
+
"./lexical/markdown": {
|
|
69
|
+
"import": "./dist/lexical-proxy/@lexical-markdown.js",
|
|
70
|
+
"types": "./dist/lexical-proxy/@lexical-markdown.d.ts",
|
|
71
|
+
"default": "./dist/lexical-proxy/@lexical-markdown.js"
|
|
72
|
+
},
|
|
73
|
+
"./lexical/rich-text": {
|
|
74
|
+
"import": "./dist/lexical-proxy/@lexical-rich-text.js",
|
|
75
|
+
"types": "./dist/lexical-proxy/@lexical-rich-text.d.ts",
|
|
76
|
+
"default": "./dist/lexical-proxy/@lexical-rich-text.js"
|
|
77
|
+
},
|
|
78
|
+
"./lexical/selection": {
|
|
79
|
+
"import": "./dist/lexical-proxy/@lexical-selection.js",
|
|
80
|
+
"types": "./dist/lexical-proxy/@lexical-selection.d.ts",
|
|
81
|
+
"default": "./dist/lexical-proxy/@lexical-selection.js"
|
|
82
|
+
},
|
|
83
|
+
"./lexical/utils": {
|
|
84
|
+
"import": "./dist/lexical-proxy/@lexical-utils.js",
|
|
85
|
+
"types": "./dist/lexical-proxy/@lexical-utils.d.ts",
|
|
86
|
+
"default": "./dist/lexical-proxy/@lexical-utils.js"
|
|
87
|
+
},
|
|
88
|
+
"./lexical/react/LexicalAutoEmbedPlugin": {
|
|
89
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js",
|
|
90
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts",
|
|
91
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js"
|
|
92
|
+
},
|
|
93
|
+
"./lexical/react/LexicalAutoFocusPlugin": {
|
|
94
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js",
|
|
95
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts",
|
|
96
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js"
|
|
97
|
+
},
|
|
98
|
+
"./lexical/react/LexicalAutoLinkPlugin": {
|
|
99
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js",
|
|
100
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts",
|
|
101
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js"
|
|
102
|
+
},
|
|
103
|
+
"./lexical/react/LexicalBlockWithAlignableContents": {
|
|
104
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js",
|
|
105
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts",
|
|
106
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js"
|
|
107
|
+
},
|
|
108
|
+
"./lexical/react/LexicalCharacterLimitPlugin": {
|
|
109
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js",
|
|
110
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts",
|
|
111
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js"
|
|
112
|
+
},
|
|
113
|
+
"./lexical/react/LexicalCheckListPlugin": {
|
|
114
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js",
|
|
115
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts",
|
|
116
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js"
|
|
117
|
+
},
|
|
118
|
+
"./lexical/react/LexicalClearEditorPlugin": {
|
|
119
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js",
|
|
120
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts",
|
|
121
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js"
|
|
122
|
+
},
|
|
123
|
+
"./lexical/react/LexicalClickableLinkPlugin": {
|
|
124
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js",
|
|
125
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts",
|
|
126
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js"
|
|
127
|
+
},
|
|
128
|
+
"./lexical/react/LexicalCollaborationContext": {
|
|
129
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js",
|
|
130
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts",
|
|
131
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js"
|
|
132
|
+
},
|
|
133
|
+
"./lexical/react/LexicalCollaborationPlugin": {
|
|
134
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js",
|
|
135
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts",
|
|
136
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js"
|
|
137
|
+
},
|
|
138
|
+
"./lexical/react/LexicalComposer": {
|
|
139
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalComposer.js",
|
|
140
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts",
|
|
141
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalComposer.js"
|
|
142
|
+
},
|
|
143
|
+
"./lexical/react/LexicalComposerContext": {
|
|
144
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalComposerContext.js",
|
|
145
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts",
|
|
146
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalComposerContext.js"
|
|
147
|
+
},
|
|
148
|
+
"./lexical/react/LexicalContentEditable": {
|
|
149
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.js",
|
|
150
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts",
|
|
151
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalContentEditable.js"
|
|
152
|
+
},
|
|
153
|
+
"./lexical/react/LexicalContextMenuPlugin": {
|
|
154
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js",
|
|
155
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts",
|
|
156
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js"
|
|
157
|
+
},
|
|
158
|
+
"./lexical/react/LexicalDecoratorBlockNode": {
|
|
159
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js",
|
|
160
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts",
|
|
161
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js"
|
|
162
|
+
},
|
|
163
|
+
"./lexical/react/LexicalDraggableBlockPlugin": {
|
|
164
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js",
|
|
165
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts",
|
|
166
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js"
|
|
167
|
+
},
|
|
168
|
+
"./lexical/react/LexicalEditorRefPlugin": {
|
|
169
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js",
|
|
170
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts",
|
|
171
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js"
|
|
172
|
+
},
|
|
173
|
+
"./lexical/react/LexicalErrorBoundary": {
|
|
174
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js",
|
|
175
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts",
|
|
176
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js"
|
|
177
|
+
},
|
|
178
|
+
"./lexical/react/LexicalHashtagPlugin": {
|
|
179
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js",
|
|
180
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts",
|
|
181
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js"
|
|
182
|
+
},
|
|
183
|
+
"./lexical/react/LexicalHistoryPlugin": {
|
|
184
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js",
|
|
185
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts",
|
|
186
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js"
|
|
187
|
+
},
|
|
188
|
+
"./lexical/react/LexicalHorizontalRuleNode": {
|
|
189
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js",
|
|
190
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts",
|
|
191
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js"
|
|
192
|
+
},
|
|
193
|
+
"./lexical/react/LexicalHorizontalRulePlugin": {
|
|
194
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js",
|
|
195
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts",
|
|
196
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js"
|
|
197
|
+
},
|
|
198
|
+
"./lexical/react/LexicalLinkPlugin": {
|
|
199
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js",
|
|
200
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts",
|
|
201
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js"
|
|
202
|
+
},
|
|
203
|
+
"./lexical/react/LexicalListPlugin": {
|
|
204
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalListPlugin.js",
|
|
205
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts",
|
|
206
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalListPlugin.js"
|
|
207
|
+
},
|
|
208
|
+
"./lexical/react/LexicalMarkdownShortcutPlugin": {
|
|
209
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js",
|
|
210
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts",
|
|
211
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js"
|
|
212
|
+
},
|
|
213
|
+
"./lexical/react/LexicalNestedComposer": {
|
|
214
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js",
|
|
215
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts",
|
|
216
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js"
|
|
217
|
+
},
|
|
218
|
+
"./lexical/react/LexicalNodeEventPlugin": {
|
|
219
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js",
|
|
220
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts",
|
|
221
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js"
|
|
222
|
+
},
|
|
223
|
+
"./lexical/react/LexicalNodeMenuPlugin": {
|
|
224
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js",
|
|
225
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts",
|
|
226
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js"
|
|
227
|
+
},
|
|
228
|
+
"./lexical/react/LexicalOnChangePlugin": {
|
|
229
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js",
|
|
230
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts",
|
|
231
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js"
|
|
232
|
+
},
|
|
233
|
+
"./lexical/react/LexicalPlainTextPlugin": {
|
|
234
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js",
|
|
235
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts",
|
|
236
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js"
|
|
237
|
+
},
|
|
238
|
+
"./lexical/react/LexicalRichTextPlugin": {
|
|
239
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js",
|
|
240
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts",
|
|
241
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js"
|
|
242
|
+
},
|
|
243
|
+
"./lexical/react/LexicalTabIndentationPlugin": {
|
|
244
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js",
|
|
245
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts",
|
|
246
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js"
|
|
247
|
+
},
|
|
248
|
+
"./lexical/react/LexicalTableOfContents": {
|
|
249
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js",
|
|
250
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts",
|
|
251
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js"
|
|
252
|
+
},
|
|
253
|
+
"./lexical/react/LexicalTableOfContentsPlugin": {
|
|
254
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js",
|
|
255
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts",
|
|
256
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js"
|
|
257
|
+
},
|
|
258
|
+
"./lexical/react/LexicalTablePlugin": {
|
|
259
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js",
|
|
260
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts",
|
|
261
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js"
|
|
262
|
+
},
|
|
263
|
+
"./lexical/react/LexicalTreeView": {
|
|
264
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalTreeView.js",
|
|
265
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts",
|
|
266
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalTreeView.js"
|
|
267
|
+
},
|
|
268
|
+
"./lexical/react/LexicalTypeaheadMenuPlugin": {
|
|
269
|
+
"import": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js",
|
|
270
|
+
"types": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts",
|
|
271
|
+
"default": "./dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js"
|
|
272
|
+
},
|
|
273
|
+
"./lexical/react/useLexicalEditable": {
|
|
274
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.js",
|
|
275
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts",
|
|
276
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalEditable.js"
|
|
277
|
+
},
|
|
278
|
+
"./lexical/react/useLexicalIsTextContentEmpty": {
|
|
279
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js",
|
|
280
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts",
|
|
281
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js"
|
|
282
|
+
},
|
|
283
|
+
"./lexical/react/useLexicalNodeSelection": {
|
|
284
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js",
|
|
285
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts",
|
|
286
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js"
|
|
287
|
+
},
|
|
288
|
+
"./lexical/react/useLexicalSubscription": {
|
|
289
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.js",
|
|
290
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts",
|
|
291
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalSubscription.js"
|
|
292
|
+
},
|
|
293
|
+
"./lexical/react/useLexicalTextEntity": {
|
|
294
|
+
"import": "./dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js",
|
|
295
|
+
"types": "./dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts",
|
|
296
|
+
"default": "./dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js"
|
|
297
|
+
},
|
|
298
|
+
"./ast/mdx": {
|
|
299
|
+
"import": "./dist/exports/server/ast/mdx.js",
|
|
300
|
+
"types": "./dist/exports/server/ast/mdx.d.ts",
|
|
301
|
+
"default": "./dist/exports/server/ast/mdx.js"
|
|
302
|
+
},
|
|
303
|
+
"./shared": {
|
|
304
|
+
"import": "./dist/exports/shared.js",
|
|
305
|
+
"types": "./dist/exports/shared.d.ts",
|
|
306
|
+
"default": "./dist/exports/shared.js"
|
|
42
307
|
}
|
|
43
308
|
},
|
|
44
309
|
"main": "./dist/index.js",
|
|
@@ -46,6 +311,14 @@
|
|
|
46
311
|
"files": [
|
|
47
312
|
"dist"
|
|
48
313
|
],
|
|
314
|
+
"lint-staged": {
|
|
315
|
+
"**/package.json": "sort-package-json",
|
|
316
|
+
"*.{md,mdx,yml,json}": "prettier --write",
|
|
317
|
+
"*.{js,jsx,ts,tsx}": [
|
|
318
|
+
"prettier --write",
|
|
319
|
+
"eslint --cache --fix"
|
|
320
|
+
]
|
|
321
|
+
},
|
|
49
322
|
"dependencies": {
|
|
50
323
|
"@lexical/headless": "0.20.0",
|
|
51
324
|
"@lexical/link": "0.20.0",
|
|
@@ -57,15 +330,19 @@
|
|
|
57
330
|
"@lexical/selection": "0.20.0",
|
|
58
331
|
"@lexical/utils": "0.20.0",
|
|
59
332
|
"@types/uuid": "10.0.0",
|
|
333
|
+
"acorn": "8.12.1",
|
|
60
334
|
"bson-objectid": "2.0.4",
|
|
61
335
|
"dequal": "2.0.3",
|
|
62
336
|
"escape-html": "1.0.3",
|
|
63
337
|
"lexical": "0.20.0",
|
|
338
|
+
"mdast-util-from-markdown": "2.0.2",
|
|
339
|
+
"mdast-util-mdx-jsx": "3.1.3",
|
|
340
|
+
"micromark-extension-mdx-jsx": "3.0.1",
|
|
64
341
|
"react-error-boundary": "4.0.13",
|
|
65
342
|
"ts-essentials": "10.0.3",
|
|
66
343
|
"uuid": "10.0.0",
|
|
67
|
-
"@payloadcms/translations": "3.0.0-beta.
|
|
68
|
-
"@payloadcms/ui": "3.0.0-beta.
|
|
344
|
+
"@payloadcms/translations": "3.0.0-beta.135",
|
|
345
|
+
"@payloadcms/ui": "3.0.0-beta.135"
|
|
69
346
|
},
|
|
70
347
|
"devDependencies": {
|
|
71
348
|
"@babel/cli": "^7.24.5",
|
|
@@ -85,8 +362,8 @@
|
|
|
85
362
|
"esbuild-sass-plugin": "3.3.1",
|
|
86
363
|
"eslint-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
|
|
87
364
|
"swc-plugin-transform-remove-imports": "1.15.0",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
365
|
+
"@payloadcms/eslint-config": "3.0.0-beta.112",
|
|
366
|
+
"payload": "3.0.0-beta.135"
|
|
90
367
|
},
|
|
91
368
|
"peerDependencies": {
|
|
92
369
|
"@faceless-ui/modal": "3.0.0-beta.2",
|
|
@@ -104,8 +381,8 @@
|
|
|
104
381
|
"lexical": "0.20.0",
|
|
105
382
|
"react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
106
383
|
"react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
|
|
107
|
-
"@payloadcms/next": "3.0.0-beta.
|
|
108
|
-
"payload": "3.0.0-beta.
|
|
384
|
+
"@payloadcms/next": "3.0.0-beta.135",
|
|
385
|
+
"payload": "3.0.0-beta.135"
|
|
109
386
|
},
|
|
110
387
|
"engines": {
|
|
111
388
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";import{b as z,c as D,e as Pe,f as we,g as Re,h as ke,i as Te}from"./chunk-OOBB5GCO.js";import{a as Ne,b as T}from"./chunk-CUIBIFW2.js";import{c as oo}from"react/compiler-runtime";import{jsx as pe,jsxs as fe}from"react/jsx-runtime";import{FieldLabel as no,useEditDepth as ro,useField as io,withCondition as so}from"@payloadcms/ui";import"react";import{ErrorBoundary as lo}from"react-error-boundary";import{jsx as F}from"react/jsx-runtime";import{LexicalComposer as eo}from"@lexical/react/LexicalComposer.js";import*as nt from"react";import{useMemo as to}from"react";import{c as Ht}from"react/compiler-runtime";import{jsx as R,jsxs as X}from"react/jsx-runtime";import{useLexicalComposerContext as jt}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as zt}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Kt}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Gt}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Wt}from"@lexical/react/LexicalRichTextPlugin.js";import{TabIndentationPlugin as Yt}from"@lexical/react/LexicalTabIndentationPlugin.js";import{BLUR_COMMAND as Ut,COMMAND_PRIORITY_LOW as Ze,FOCUS_COMMAND as Vt}from"lexical";import*as U from"react";import{useEffect as et,useState as tt}from"react";import{jsx as Se}from"react/jsx-runtime";import"react";var _=({anchorElem:t,clientProps:e,plugin:o})=>o.position==="floatingAnchorElem"&&t?o.Component&&Se(o.Component,{anchorElem:t,clientProps:e}):o.Component&&Se(o.Component,{clientProps:e});import{jsx as be}from"react/jsx-runtime";import{useLexicalComposerContext as ut}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as ft}from"lexical";import*as Be from"react";import{useCallback as pt,useEffect as Me,useRef as gt,useState as ht}from"react";import{createPortal as yt}from"react-dom";var K=(t,e,o,s,i=50,f=25)=>{let l=0;if(t&&!t.contains(s)){let{bottom:m,left:d,right:h,top:p}=t.getBoundingClientRect(),a=p+window.scrollY,n=m+window.scrollY;if(o<a-f||o>n+f||e<d-i||e>h+i)return-1;(e<d||e>h)&&(l=e<d?e-d:e-h)}return l};import{$getNodeByKey as se}from"lexical";function G(t){let e=t.getBoundingClientRect(),o=getComputedStyle(t).getPropertyValue("transform");if(!o||o==="none")return e;let s=o.split(",").pop();return e.y=e.y-Number(s?.replace(")","")),e}function ie(t){let e=(d,h)=>d?parseFloat(window.getComputedStyle(d)[h]):0,{marginBottom:o,marginTop:s}=window.getComputedStyle(t),i=e(t.previousElementSibling,"marginBottom"),f=e(t.nextElementSibling,"marginTop"),l=Math.max(parseFloat(s),i);return{marginBottom:Math.max(parseFloat(o),f),marginTop:l}}import{$getRoot as lt}from"lexical";function $(t){return t.getEditorState().read(()=>lt().getChildrenKeys())}var at=1,ct=-1,ve=0,B={props:null,result:null};function mt(t,e,o=20){let s=t.x-e.x,i=t.y-e.y;return s*s+i*i<=o*o}function W(t){let{anchorElem:e,cache_threshold:o=20,editor:s,fuzzy:i=!1,horizontalOffset:f=0,point:{x:l,y:m},startIndex:d=0,useEdgeAsDefault:h=!1}=t;if(o>0&&B.props&&B.result&&B.props.fuzzy===t.fuzzy&&B.props.horizontalOffset===t.horizontalOffset&&B.props.useEdgeAsDefault===t.useEdgeAsDefault&&mt(B.props.point,t.point,o))return B.result;let p=e.getBoundingClientRect(),a=$(s),n={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return s.getEditorState().read(()=>{if(h){let[y,c]=[s.getElementByKey(a[0]),s.getElementByKey(a[a.length-1])];if(y&&c){let[g,r]=[G(y),G(c)];if(m<g.top?(n.blockElem=y,n.distance=g.top-m,n.blockNode=se(a[0]),n.foundAtIndex=0):m>r.bottom&&(n.distance=m-r.bottom,n.blockNode=se(a[a.length-1]),n.blockElem=c,n.foundAtIndex=a.length-1),n?.blockElem)return{blockElem:null,isFoundNodeEmptyParagraph:!1}}}let u=d,x=ve;for(;u>=0&&u<a.length;){let y=a[u],c=s.getElementByKey(y);if(c===null)break;let g=new D(l+f,m),r=ke.fromDOMRect(G(c)),{marginBottom:E,marginTop:b}=ie(c),P=r.generateNewRect({bottom:r.bottom+E,left:p.left,right:p.right,top:r.top-b}),{distance:C,isOnBottomSide:k,isOnTopSide:w}=P.distanceFromPoint(g);if(C===0){n.blockElem=c,n.blockNode=se(y),n.foundAtIndex=u,n.distance=C,n.blockNode&&n.blockNode.getType()==="paragraph"&&n.blockNode.getTextContent()===""&&(!i&&!t.returnEmptyParagraphs&&(n.blockElem=null,n.blockNode=null),n.isFoundNodeEmptyParagraph=!0);break}else i&&C<n.distance&&(n.blockElem=c,n.blockNode=se(y),n.distance=C,n.foundAtIndex=u);x===ve&&(w?x=ct:k?x=at:x=1/0),u+=x}}),B.props=t,B.result={blockElem:n.blockElem,blockNode:n.blockNode,foundAtIndex:n.foundAtIndex,isFoundNodeEmptyParagraph:n.isFoundNodeEmptyParagraph},{blockElem:n.blockElem,blockNode:n.blockNode,foundAtIndex:n.foundAtIndex,isFoundNodeEmptyParagraph:n.isFoundNodeEmptyParagraph}}function le(t,e){return!!t.closest(`.${e}`)}var dt=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Ie(t){if(!t||dt.includes(t.tagName)||t.offsetHeight===0||t.offsetWidth===0)return!1;let e=window.getComputedStyle(t);return!(e.display==="table-cell"||e.position==="absolute"||e.visibility==="hidden"||e.opacity==="0")}function ae(t,e,o,s=0){if(!t){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let i=t.getBoundingClientRect(),f=window.getComputedStyle(t),l=e.getBoundingClientRect(),m=o.getBoundingClientRect(),d;if(["lexical-block","lexical-upload","lexical-relationship"].some(a=>t.firstElementChild?.classList.contains(a)))d=i.top+8-m.top;else{let a=Ie(t)?parseInt(f.lineHeight,10):0;d=i.top+(a-l.height)/2-m.top}let p=s;e.style.opacity="1",e.style.transform=`translate(${p}px, ${d}px)`}var xt="add-block-menu",ce=1/0;function Et(t){return t===0?1/0:ce>=0&&ce<t?ce:Math.floor(t/2)}function bt(t,e,o){let s=e.parentElement,{editorConfig:i}=T(),f=i?.admin?.hideGutter?-24:12,l=gt(null),[m,d]=ht(null);Me(()=>{function p(a){let n=a.target;if(!z(n))return;let u=K(s,a.pageX,a.pageY,n);if(u===-1){d(null);return}if(le(n,xt))return;let x=$(t),{blockElem:y,blockNode:c,foundAtIndex:g}=W({anchorElem:e,cache_threshold:0,editor:t,horizontalOffset:-u,point:new D(a.x,a.y),returnEmptyParagraphs:!0,startIndex:Et(x.length),useEdgeAsDefault:!1});ce=g,y&&c&&(m?.node!==c||m?.elem!==y)&&d({elem:y,node:c})}return document?.addEventListener("mousemove",p),()=>{document?.removeEventListener("mousemove",p)}},[s,e,t,m]),Me(()=>{l.current&&m?.node&&ae(m?.elem,l.current,e,f)},[e,m,f]);let h=pt(p=>{let a=m;a?.node&&(t.update(()=>{let n=!0;if((a?.node.getType()!=="paragraph"||a.node.getTextContent()!=="")&&(n=!1),!n){let u=ft();a?.node.insertAfter(u),setTimeout(()=>{a={elem:t.getElementByKey(u.getKey()),node:u},d(a)},0)}}),setTimeout(()=>{t.update(()=>{t.focus(),a?.node&&"select"in a.node&&typeof a.node.select=="function"&&a.node.select()})},1),setTimeout(()=>{t.dispatchCommand(we,{node:a?.node})},2),p.stopPropagation(),p.preventDefault())},[t,m]);return yt(be(Be.Fragment,{children:be("button",{className:"icon add-block-menu",onClick:p=>{h(p)},ref:l,type:"button",children:be("div",{className:o?"icon":""})})}),e)}function Le(t){let{anchorElem:e}=t,o=e===void 0?document.body:e,[s]=ut();return bt(s,o,s._editable)}import{jsx as me,jsxs as Nt}from"react/jsx-runtime";import{useLexicalComposerContext as Pt}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as Fe}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as Oe,$getNodeByKey as wt}from"lexical";import*as ze from"react";import{useEffect as Ce,useRef as de,useState as _e}from"react";import{createPortal as Rt}from"react-dom";var Ae=0,Ct=-24;var H=0;function De(t,e,o,s,i,f,l,m,d,h=!1){let{height:p,top:a}=s.getBoundingClientRect(),{top:n,width:u}=l.getBoundingClientRect(),{marginBottom:x,marginTop:y}=ie(s),c=a,g=f>=a+p/2+window.scrollY,r=!1;if(i?.elem)if(s!==i?.elem)(g&&i?.elem&&i?.elem===s.nextElementSibling||!g&&i?.elem&&i?.elem===s.previousElementSibling)&&(H++,H<200&&(r=!0));else{H++;let C=i?.boundingBox?.y,k=s.getBoundingClientRect().y;(g===i?.isBelow&&C===k||H<200)&&(r=!1)}if(r)return{isBelow:g,willStayInSamePosition:r};h?c+=p/2:g?c+=p+x/2:c-=y/2;let E=0;h||(g?E=-Ae:E=Ae);let b=c-n+E,P=Ct-e;return o.style.width=`calc(${u}px - ${t})`,o.style.opacity=".8",o.style.transform=`translate(${P}px, calc(${b}px - 2px))`,i?.elem&&(i.elem.style.opacity="",i?.elem===s?g?i.elem.style.marginTop="":i.elem.style.marginBottom="":(i.elem.style.marginBottom="",i.elem.style.marginTop="")),H=0,{isBelow:g,willStayInSamePosition:r}}var kt="draggable-block-menu",$e="application/x-lexical-drag-block",Q=1/0;function He(t){return t===0?1/0:Q>=0&&Q<t?Q:Math.floor(t/2)}function Tt(t,e){let{transform:o}=e.style;t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=o})}function je(t,e){t&&(t.style.opacity="0"),e&&(e.style.opacity="",e.style.marginBottom="",e.style.marginTop="")}function St(t,e,o){let s=e.parentElement,i=de(null),f=de(null),l=de(null),m=de(!1),[d,h]=_e(null),[p,a]=_e(null),{editorConfig:n}=T(),u=n?.admin?.hideGutter?-44:-8;Ce(()=>{function c(g){let r=g.target;if(!z(r))return;let E=K(s,g.pageX,g.pageY,r);if(E===-1){h(null);return}if(le(r,kt))return;let b=$(t),{blockElem:P,foundAtIndex:C,isFoundNodeEmptyParagraph:k}=W({anchorElem:e,cache_threshold:0,editor:t,horizontalOffset:-E,point:new D(g.x,g.y),startIndex:He(b.length),useEdgeAsDefault:!1,verbose:!1});Q=C,!(!P&&!k)&&d!==P&&h(P)}return document?.addEventListener("mousemove",c),()=>{document?.removeEventListener("mousemove",c)}},[s,e,t,d]),Ce(()=>{i.current&&ae(d,i.current,e,u)},[e,d,u]),Ce(()=>{function c(r){if(!m.current)return!1;let[E]=Fe(r);if(E)return!1;let{pageY:b,target:P}=r;if(!z(P))return!1;let C=K(s,r.pageX,r.pageY,P,100,50),k=$(t),{blockElem:w,foundAtIndex:V,isFoundNodeEmptyParagraph:I}=W({anchorElem:e,editor:t,fuzzy:!0,horizontalOffset:-C,point:new D(r.x,r.y),startIndex:He(k.length),useEdgeAsDefault:!0,verbose:!0});Q=V;let M=f.current;if(w===null||M===null)return!1;if(d!==w){let{isBelow:v,willStayInSamePosition:O}=De(n?.admin?.hideGutter?"0px":"3rem",u+(n?.admin?.hideGutter?i?.current?.getBoundingClientRect()?.width??0:-(i?.current?.getBoundingClientRect()?.width??0)),M,w,p,b,e,r,l,I);r.preventDefault(),O||a({boundingBox:w.getBoundingClientRect(),elem:w,isBelow:v})}else p?.elem&&(je(M,p.elem),a({boundingBox:w.getBoundingClientRect(),elem:w,isBelow:!1}));return!0}function g(r){if(!m.current)return!1;let[E]=Fe(r);if(E)return!1;let{dataTransfer:b,pageY:P,target:C}=r,k=b?.getData($e)||"";return t.update(()=>{let w=wt(k);if(!w||!z(C))return!1;let V=K(s,r.pageX,r.pageY,C,100,50),{blockElem:I,isFoundNodeEmptyParagraph:M}=W({anchorElem:e,editor:t,fuzzy:!0,horizontalOffset:-V,point:new D(r.x,r.y),useEdgeAsDefault:!0});if(!I)return!1;let v=Oe(I);if(!v)return!1;if(v===w)return!0;let{height:O,top:j}=G(I),q=P>=j+O/2+window.scrollY;M?(v.insertBefore(w),v.remove()):q?v.insertAfter(w):v.insertBefore(w),d!==null&&h(null),document.querySelectorAll(".lexical-block-highlighter").forEach(S=>{S.remove()});let J=t.getElementByKey(w.getKey());setTimeout(()=>{let S=J?.getBoundingClientRect();if(!S)return;let N=document.createElement("div");N.className="lexical-block-highlighter",N.style.backgroundColor="var(--theme-elevation-1000",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=`${S.height+8}px`,N.style.width=`${S.width+8}px`,N.style.top=`${S.top+window.scrollY-4}px`,N.style.left=`${S.left-4}px`,setTimeout(()=>{N.style.opacity="0",setTimeout(()=>{N.remove()},500)},1e3)},120)}),!0}return document.addEventListener("dragover",c),document.addEventListener("drop",g),()=>{document.removeEventListener("dragover",c),document.removeEventListener("drop",g)}},[s,u,e,t,p,d,n?.admin?.hideGutter]);function x(c){let g=c.dataTransfer;if(!g||!d)return;Tt(g,d);let r="";t.update(()=>{let E=Oe(d);E&&(r=E.getKey())}),m.current=!0,g.setData($e,r)}function y(){m.current=!1,p?.elem&&je(f.current,p?.elem)}return Rt(Nt(ze.Fragment,{children:[me("div",{className:"icon draggable-block-menu",draggable:!0,onDragEnd:y,onDragStart:x,ref:i,children:me("div",{className:o?"icon":""})}),me("div",{className:"draggable-block-target-line",ref:f}),me("div",{className:"debug-highlight",ref:l})]}),e)}function Ke(t){let{anchorElem:e}=t,o=e===void 0?document.body:e,[s]=Pt();return St(s,o,s._editable)}import{c as vt}from"react/compiler-runtime";import{jsx as It}from"react/jsx-runtime";import{MarkdownShortcutPlugin as Mt}from"@lexical/react/LexicalMarkdownShortcutPlugin.js";import"react";var Ge=()=>{let t=vt(2),{editorConfig:e}=T(),o;return t[0]!==e.features.markdownTransformers?(o=It(Mt,{transformers:e.features.markdownTransformers}),t[0]=e.features.markdownTransformers,t[1]=o):o=t[1],o};import{jsx as Y,jsxs as Ue}from"react/jsx-runtime";import{useLexicalComposerContext as Lt}from"@lexical/react/LexicalComposerContext.js";import{useTranslation as Ve}from"@payloadcms/ui";import{useCallback as Ye,useMemo as At,useState as Dt}from"react";import"react";import*as qe from"react-dom";import{c as Bt}from"react/compiler-runtime";import"react";function We(t,e){let o=Bt(4),{maxLength:s,minLength:i}=e,f=s===void 0?75:s,l=i===void 0?1:i,m;return o[0]!==t||o[1]!==f||o[2]!==l?(m=d=>{let{query:h}=d,p="[^"+t+Pe+"\\s]",n=new RegExp("(^|\\s|\\()(["+t+"]((?:"+p+"){0,"+f+"}))$").exec(h);if(n!==null){let u=n[1],x=n[3];if(x.length>=l)return{leadOffset:n.index+u.length,matchingString:x,replaceableString:n[2]}}return null},o[0]=t,o[1]=f,o[2]=l,o[3]=m):m=o[3],m}var L="slash-menu-popup";function Ft({isSelected:t,item:e,onClick:o,onMouseEnter:s}){let{fieldProps:{featureClientSchemaMap:i,schemaPath:f}}=T(),{i18n:l}=Ve(),m=`${L}__item ${L}__item-${e.key}`;t&&(m+=` ${L}__item--selected`);let d=e.key;return e.label&&(d=typeof e.label=="function"?e.label({featureClientSchemaMap:i,i18n:l,schemaPath:f}):e.label),d.length>25&&(d=d.substring(0,25)+"..."),Ue("button",{"aria-selected":t,className:m,id:L+"__item-"+e.key,onClick:o,onMouseEnter:s,ref:h=>{e.ref={current:h}},role:"option",tabIndex:-1,type:"button",children:[e?.Icon&&Y(e.Icon,{}),Y("span",{className:`${L}__item-text`,children:d})]},e.key)}function Je({anchorElem:t=document.body}){let[e]=Lt(),[o,s]=Dt(null),{editorConfig:i}=T(),{i18n:f}=Ve(),{fieldProps:{featureClientSchemaMap:l,schemaPath:m}}=T(),d=We("/",{minLength:0}),h=Ye(()=>{let n=[];for(let u of i.features.slashMenu.dynamicGroups)if(o){let x=u({editor:e,queryString:o});n=n.concat(x)}return n},[e,o,i?.features]),p=At(()=>{let n=[];for(let u of i?.features.slashMenu.groups??[])n.push(u);if(o){n=n.map(x=>{let y=x.items.filter(c=>{let g=c.key;return c.label&&(g=typeof c.label=="function"?c.label({featureClientSchemaMap:l,i18n:f,schemaPath:m}):c.label),new RegExp(o,"gi").exec(g)?!0:c.keywords!=null?c.keywords.some(r=>new RegExp(o,"gi").exec(r)):!1});return y.length?{...x,items:y}:null}),n=n.filter(x=>x!=null);let u=h();for(let x of u){let y=n.find(c=>c.key===x.key);y?n=n.filter(c=>c.key!==x.key):y={...x,items:[]},y?.items?.length&&(y.items=y.items.concat(y.items)),n.push(y)}}return n},[o,i?.features.slashMenu.groups,h,l,f,m]),a=Ye((n,u,x)=>{u(),n.onSelect({editor:e,queryString:x})},[e]);return Y(Re,{anchorElem:t,groups:p,menuRenderFn:(n,{selectedItemKey:u,selectItemAndCleanUp:x,setSelectedItemKey:y})=>n.current&&p.length?qe.createPortal(Y("div",{className:L,children:p.map(c=>{let g=c.key;return c.label&&l&&(g=typeof c.label=="function"?c.label({featureClientSchemaMap:l,i18n:f,schemaPath:m}):c.label),Ue("div",{className:`${L}__group ${L}__group-${c.key}`,children:[Y("div",{className:`${L}__group-title`,children:g}),c.items.map((r,E)=>Y(Ft,{index:E,isSelected:u===r.key,item:r,onClick:()=>{y(r.key),x(r)},onMouseEnter:()=>{y(r.key)}},r.key))]},c.key)})}),n.current):null,onQueryChange:s,onSelectItem:a,triggerFn:d})}import{c as Ot}from"react/compiler-runtime";import{jsx as Qe}from"react/jsx-runtime";import{ContentEditable as _t}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as $t}from"@payloadcms/ui";import"react";function Xe(t){let e=Ot(3),{className:o}=t,{t:s}=$t(),i;return e[0]!==s||e[1]!==o?(i=Qe(_t,{"aria-placeholder":s("lexical:general:placeholder"),className:o??"ContentEditable__root",placeholder:Qe("p",{className:"editor-placeholder",children:s("lexical:general:placeholder")})}),e[0]=s,e[1]=o,e[2]=i):i=e[2],i}var ot=t=>{let e=Ht(22),{editorConfig:o,editorContainerRef:s,onChange:i}=t,f=T(),[l]=jt(),[m,d]=tt(null),h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=r=>{r!==null&&d(r)},e[0]=h):h=e[0];let p=h,a,n;e[1]!==f||e[2]!==l?(a=()=>{if(!f?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}f?.parentEditor?.uuid&&f.parentEditor?.registerChild(f.uuid,f);let r=()=>{f.focusEditor(f)},E=()=>{f.blurEditor(f)},b=l.registerCommand(Vt,()=>(r(),!0),Ze),P=l.registerCommand(Ut,()=>(E(),!0),Ze);return()=>{b(),P(),f.parentEditor?.unregisterChild?.(f.uuid)}},n=[l,f],e[1]=f,e[2]=l,e[3]=a,e[4]=n):(a=e[3],n=e[4]),et(a,n);let[u,x]=tt(!1),y,c;e[5]!==u?(y=()=>{let r=()=>{let E=window.matchMedia("(max-width: 768px)").matches;E!==u&&x(E)};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},c=[u],e[5]=u,e[6]=y,e[7]=c):(y=e[6],c=e[7]),et(y,c);let g;if(e[8]!==o.features||e[9]!==i||e[10]!==m||e[11]!==u||e[12]!==l||e[13]!==s){let r;e[15]!==i?(r=(b,P,C)=>{(!C.has("focus")||C.size>1)&&i?.(b,P,C)},e[15]=i,e[16]=r):r=e[16];let E;e[17]!==m||e[18]!==u||e[19]!==l||e[20]!==o?(E=m&&X(U.Fragment,{children:[!u&&l.isEditable()&&X(U.Fragment,{children:[R(Ke,{anchorElem:m}),R(Le,{anchorElem:m})]}),o.features.plugins?.map(b=>{if(b.position==="floatingAnchorElem"&&!(b.desktopOnly===!0&&u))return R(_,{anchorElem:m,clientProps:b.clientProps,plugin:b},b.key)}),l.isEditable()&&R(U.Fragment,{children:R(Je,{anchorElem:m})})]}),e[17]=m,e[18]=u,e[19]=l,e[20]=o,e[21]=E):E=e[21],g=X(U.Fragment,{children:[o.features.plugins?.map(qt),X("div",{className:"editor-container",ref:s,children:[o.features.plugins?.map(Jt),R(Wt,{contentEditable:R("div",{className:"editor-scroller",children:R("div",{className:"editor",ref:p,children:R(Xe,{})})}),ErrorBoundary:zt}),R(Gt,{ignoreSelectionChange:!0,onChange:r}),E,l.isEditable()&&X(U.Fragment,{children:[R(Kt,{}),o?.features?.markdownTransformers?.length>0&&R(Ge,{})]}),R(Yt,{}),o.features.plugins?.map(Qt),o.features.plugins?.map(Xt)]}),o.features.plugins?.map(Zt)]}),e[8]=o.features,e[9]=i,e[10]=m,e[11]=u,e[12]=l,e[13]=s,e[14]=g}else g=e[14];return g};function qt(t){if(t.position==="aboveContainer")return R(_,{clientProps:t.clientProps,plugin:t},t.key)}function Jt(t){if(t.position==="top")return R(_,{clientProps:t.clientProps,plugin:t},t.key)}function Qt(t){if(t.position==="normal")return R(_,{clientProps:t.clientProps,plugin:t},t.key)}function Xt(t){if(t.position==="bottom")return R(_,{clientProps:t.clientProps,plugin:t},t.key)}function Zt(t){if(t.position==="belowContainer")return R(_,{clientProps:t.clientProps,plugin:t},t.key)}var rt=({children:t,providers:e})=>{if(!e?.length)return t;let o=e[0];return e.length>1?F(o,{children:F(rt,{providers:e.slice(1),children:t})}):F(o,{children:t})},it=t=>{let{composerKey:e,editorConfig:o,fieldProps:s,onChange:i,readOnly:f,value:l}=t,m=T(),d=nt.useRef(null),h=to(()=>{if(l&&typeof l!="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(l));if(l&&Array.isArray(l)&&!("root"in l))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/beta/lexical/migration#migration-via-migration-script-recommended");if(l&&"jsonContent"in l)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/beta/lexical/migration#migrating-from-payload-plugin-lexical");return{editable:f!==!0,editorState:l!=null?JSON.stringify(l):void 0,namespace:o.lexical.namespace,nodes:Te({editorConfig:o}),onError:p=>{throw p},theme:o.lexical.theme}},[o]);return h?F(eo,{initialConfig:h,children:F(Ne,{editorConfig:o,editorContainerRef:d,fieldProps:s,parentContext:m,children:F(rt,{providers:o.features.providers,children:F(ot,{editorConfig:o,editorContainerRef:d,onChange:i})})})},e+h.editable):F("p",{children:"Loading..."})};import"./bundled.css";var ue="rich-text-lexical",ao=t=>{let e=oo(42),{editorConfig:o,field:s,path:i,readOnly:f,validate:l}=t,{name:m,admin:d,label:h,localized:p,required:a}=s,n;e[0]!==d?(n=d===void 0?{}:d,e[0]=d,e[1]=n):n=e[1];let{className:u,readOnly:x,style:y,width:c}=n,g=f||x,r=i??m,E=ro(),b;e[2]!==l||e[3]!==a?(b=(A,st)=>{if(typeof l=="function")return l(A,{...st,required:a})},e[2]=l,e[3]=a,e[4]=b):b=e[4];let P=b,C;e[5]!==r||e[6]!==P?(C={path:r,validate:P},e[5]=r,e[6]=P,e[7]=C):C=e[7];let{customComponents:k,formInitializing:w,formProcessing:V,initialValue:I,setValue:M,showError:v,value:O}=io(C),j;e[8]!==k?(j=k===void 0?{}:k,e[8]=k,e[9]=j):j=e[9];let{AfterInput:Z,BeforeInput:q,Description:ee,Error:J,Label:S}=j,N=g||V||w,ge=v&&"error",he=N&&`${ue}--read-only`,ye=o?.admin?.hideGutter!==!0?`${ue}--show-gutter`:null,te;e[10]!==u||e[11]!==ge||e[12]!==he||e[13]!==ye?(te=[ue,"field-type",u,ge,he,ye].filter(Boolean),e[10]=u,e[11]=ge,e[12]=he,e[13]=ye,e[14]=te):te=e[14];let xe=te.join(" "),oe=`${r}.${E}`,ne;e[15]!==M?(ne=A=>{M(A.toJSON())},e[15]=M,e[16]=ne):ne=e[16];let Ee=ne,re;if(e[17]!==y||e[18]!==c||e[19]!==S||e[20]!==h||e[21]!==p||e[22]!==a||e[23]!==oe||e[24]!==o||e[25]!==t||e[26]!==Ee||e[27]!==N||e[28]!==O||e[29]!==I||e[30]!==r||e[31]!==q||e[32]!==Z||e[33]!==ee||e[34]!==J||e[35]!==xe){let A;e[37]!==S||e[38]!==h||e[39]!==p||e[40]!==a?(A=S||pe(no,{label:h,localized:p,required:a}),e[37]=S,e[38]=h,e[39]=p,e[40]=a,e[41]=A):A=e[41],re=fe("div",{className:xe,style:{...y,width:c},children:[J,A,fe("div",{className:`${ue}__wrap`,children:[fe(lo,{fallbackRender:co,onReset:mo,children:[q,pe(it,{composerKey:oe,editorConfig:o,fieldProps:t,onChange:Ee,readOnly:N,value:O},JSON.stringify({initialValue:I,path:r})),Z]}),ee]})]},oe),e[17]=y,e[18]=c,e[19]=S,e[20]=h,e[21]=p,e[22]=a,e[23]=oe,e[24]=o,e[25]=t,e[26]=Ee,e[27]=N,e[28]=O,e[29]=I,e[30]=r,e[31]=q,e[32]=Z,e[33]=ee,e[34]=J,e[35]=xe,e[36]=re}else re=e[36];return re};function co({error:t}){return fe("div",{className:"errorBoundary",role:"alert",children:[pe("p",{children:"Something went wrong:"}),pe("pre",{style:{color:"red"},children:t.message})]})}var Er=so(ao);function mo(){}export{Er as RichText};
|
|
2
|
-
//# sourceMappingURL=Field-S5G27AVI.js.map
|