@payloadcms/richtext-lexical 4.0.0-internal.e7d4ebc → 4.0.0-internal.ee5d8bd
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-334JNLRF.js +2 -0
- package/dist/exports/client/Field-334JNLRF.js.map +7 -0
- package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js → RelationshipComponent-TVK6I4W4.js} +2 -2
- package/dist/exports/client/chunk-BEKGION5.js +2 -0
- package/dist/exports/client/chunk-BEKGION5.js.map +7 -0
- package/dist/exports/client/{chunk-WSAPGI3Z.js → chunk-EA5BHQ2T.js} +1 -1
- package/dist/exports/client/{chunk-WSAPGI3Z.js.map → chunk-EA5BHQ2T.js.map} +1 -1
- package/dist/exports/client/chunk-FAJJXXCW.js +2 -0
- package/dist/exports/client/chunk-FAJJXXCW.js.map +7 -0
- package/dist/exports/client/{chunk-5VIL27GI.js → chunk-IYBYNEKX.js} +1 -1
- package/dist/exports/client/{chunk-5VIL27GI.js.map → chunk-IYBYNEKX.js.map} +1 -1
- package/dist/exports/client/chunk-SE5IITBK.js +2 -0
- package/dist/exports/client/chunk-SE5IITBK.js.map +7 -0
- package/dist/exports/client/component-QENB4QTS.js +2 -0
- package/dist/exports/client/component-QENB4QTS.js.map +7 -0
- package/dist/exports/client/componentInline-AU7IBNY7.js +2 -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/align/client/index.js.map +1 -1
- package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
- package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
- package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
- package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
- package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
- package/dist/features/blocks/client/component/index.d.ts +0 -6
- package/dist/features/blocks/client/component/index.d.ts.map +1 -1
- package/dist/features/blocks/client/component/index.js +199 -109
- package/dist/features/blocks/client/component/index.js.map +1 -1
- package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
- package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
- package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
- package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
- package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
- package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
- package/dist/features/blocks/client/componentInline/index.css +0 -1
- package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +32 -30
- package/dist/features/blocks/client/componentInline/index.js.map +1 -1
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
- package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
- package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
- package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/client/plugin/index.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js +121 -78
- package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
- package/dist/features/blocks/premade/CodeBlock/Component/Code.js +142 -87
- package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
- package/dist/features/blocks/server/index.js +2 -2
- package/dist/features/blocks/server/index.js.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
- package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
- package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
- package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
- package/dist/features/blocks/server/schema.d.ts +2 -0
- package/dist/features/blocks/server/schema.d.ts.map +1 -1
- package/dist/features/blocks/server/schema.js +7 -9
- package/dist/features/blocks/server/schema.js.map +1 -1
- package/dist/features/blocks/server/validate.js +1 -1
- package/dist/features/blocks/server/validate.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/async/converters/upload.js +3 -3
- package/dist/features/converters/lexicalToHtml/async/converters/upload.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/lexicalToHtml/sync/converters/upload.js +3 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/types.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/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
- package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
- package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
- package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
- package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
- package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
- package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
- package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
- package/dist/features/heading/client/index.js.map +1 -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 +12 -2
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
- package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/client/plugin/index.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 +3 -3
- package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
- package/dist/features/horizontalRule/server/schema.d.ts +1 -0
- package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
- package/dist/features/horizontalRule/server/schema.js +6 -5
- package/dist/features/horizontalRule/server/schema.js.map +1 -1
- package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
- package/dist/features/indent/client/IndentPlugin.js +122 -1
- package/dist/features/indent/client/IndentPlugin.js.map +1 -1
- package/dist/features/indent/client/index.d.ts.map +1 -1
- package/dist/features/indent/client/index.js +0 -2
- package/dist/features/indent/client/index.js.map +1 -1
- package/dist/features/indent/server/i18n.d.ts.map +1 -1
- package/dist/features/indent/server/i18n.js +74 -37
- package/dist/features/indent/server/i18n.js.map +1 -1
- package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +18 -7
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -2
- package/dist/features/link/client/plugins/link/index.js.map +1 -1
- package/dist/features/link/markdownTransformer.js +2 -2
- package/dist/features/link/markdownTransformer.js.map +1 -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 +2 -10
- 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 +2 -15
- package/dist/features/link/nodes/LinkNode.js.map +1 -1
- package/dist/features/link/server/baseFields.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/link/server/validate.js +1 -1
- package/dist/features/link/server/validate.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/schema.d.ts.map +1 -1
- package/dist/features/lists/shared/schema.js.map +1 -1
- 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/components/index.css +3 -6
- package/dist/features/relationship/client/drawer/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/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
- package/dist/features/relationship/client/nodes/RelationshipNode.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/nodes/RelationshipNode.d.ts.map +1 -1
- package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
- package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +3 -2
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +9 -12
- 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/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +1 -2
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
- 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/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +47 -24
- 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/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
- 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/{experimental_table → table}/client/plugins/TablePlugin/index.js +54 -18
- 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/textState/defaultColors.js +1 -1
- package/dist/features/textState/defaultColors.js.map +1 -1
- 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 +77 -3
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +145 -71
- 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/inline/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/inline/client/Toolbar/index.js +84 -37
- package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +27 -2
- package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +199 -81
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -14
- package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js +22 -6
- package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +109 -0
- package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
- package/dist/features/typesServer.d.ts +17 -12
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/component/index.css +0 -2
- 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/drawer/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/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/client/nodes/UploadNode.js +0 -7
- package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +50 -53
- 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 +7 -3
- 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/nodes/UploadNode.d.ts.map +1 -1
- package/dist/features/upload/server/nodes/UploadNode.js +1 -9
- package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +4 -16
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +8 -10
- 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 +4 -1
- 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/converters/relationship/index.css +0 -1
- package/dist/field/Diff/converters/unknown/index.css +0 -1
- package/dist/field/Diff/converters/upload/index.css +0 -1
- package/dist/field/Diff/converters/upload/index.js.map +1 -1
- package/dist/field/Diff/index.css +0 -2
- package/dist/field/Diff/index.d.ts +3 -2
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +3 -2
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/Field.d.ts.map +1 -1
- package/dist/field/Field.js +8 -1
- package/dist/field/Field.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/ViewSelector.d.ts.map +1 -1
- package/dist/field/ViewSelector.js +13 -4
- package/dist/field/ViewSelector.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +10 -11
- package/dist/field/index.js.map +1 -1
- package/dist/field/rscEntry.d.ts +2 -2
- package/dist/field/rscEntry.d.ts.map +1 -1
- package/dist/field/rscEntry.js.map +1 -1
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +112 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -5
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +21 -10
- package/dist/lexical/LexicalEditor.d.ts.map +1 -1
- package/dist/lexical/LexicalEditor.js +61 -64
- 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/ClipboardPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
- package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
- 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/MarkdownShortcut/index.js.map +1 -1
- package/dist/lexical/plugins/NodeViewOverridePlugin/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 +236 -108
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/index.css +0 -2
- package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
- package/dist/lexical/plugins/TextPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
- package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +17 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +139 -37
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts +7 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts.map +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js +15 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js.map +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +62 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
- package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
- package/dist/lexical/theme/EditorTheme.css +0 -2
- package/dist/lexical/ui/ContentEditable.css +0 -4
- package/dist/lexical/ui/ContentEditable.d.ts +2 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +32 -11
- package/dist/lexical/ui/ContentEditable.js.map +1 -1
- 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/utils/nodeFormat.d.ts.map +1 -1
- package/dist/lexical/utils/nodeFormat.js +0 -2
- package/dist/lexical/utils/nodeFormat.js.map +1 -1
- package/dist/lexical/utils/url.d.ts.map +1 -1
- package/dist/lexical/utils/url.js +1 -1
- package/dist/lexical/utils/url.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/populateGraphQL/populate.js.map +1 -1
- package/dist/presets/llmInstructions.d.ts +2 -0
- package/dist/presets/llmInstructions.d.ts.map +1 -0
- package/dist/presets/llmInstructions.js +13 -0
- package/dist/presets/llmInstructions.js.map +1 -0
- package/dist/types/builtInNodes.d.ts +1 -1
- package/dist/types/builtInNodes.d.ts.map +1 -1
- package/dist/types/builtInNodes.js +8 -3
- package/dist/types/builtInNodes.js.map +1 -1
- package/dist/types/index.d.ts +4 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/jsonSchemaHelpers.d.ts +5 -1
- package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
- package/dist/types/jsonSchemaHelpers.js +7 -2
- package/dist/types/jsonSchemaHelpers.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +6 -1
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/utilities/buildEditorState.d.ts.map +1 -1
- package/dist/utilities/buildEditorState.js.map +1 -1
- package/dist/utilities/buildInitialState.d.ts +3 -2
- package/dist/utilities/buildInitialState.d.ts.map +1 -1
- package/dist/utilities/buildInitialState.js +1 -0
- package/dist/utilities/buildInitialState.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/fieldsDrawer/Drawer.js +36 -36
- package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/utilities/fieldsDrawer/DrawerContent.js +6 -9
- package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
- package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
- package/dist/utilities/generateImportMap.d.ts +2 -2
- package/dist/utilities/generateImportMap.d.ts.map +1 -1
- package/dist/utilities/generateImportMap.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/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
- package/dist/utilities/initLexicalFeatures.js +38 -4
- package/dist/utilities/initLexicalFeatures.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +6 -3
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/dist/utilities/useLexicalFeature.js +15 -6
- package/dist/utilities/useLexicalFeature.js.map +1 -1
- package/dist/utilities/useRunDeprioritized.js.map +1 -1
- package/dist/validate/hasText.d.ts +2 -2
- package/dist/validate/hasText.d.ts.map +1 -1
- package/dist/validate/hasText.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/package.json +125 -54
- 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/bundled.css +0 -1
- package/dist/exports/client/chunk-ESITTE3C.js +0 -2
- package/dist/exports/client/chunk-ESITTE3C.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/exports/client/componentInline-H24N7GUG.js +0 -2
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
- package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
- package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
- 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/exports/client/{RelationshipComponent-YCPAKOL7.js.map → RelationshipComponent-TVK6I4W4.js.map} +0 -0
- /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-AU7IBNY7.js.map} +0 -0
- /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.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/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.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/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,3 +1,37 @@
|
|
|
1
|
+
@property --fixed-toolbar-fade-start {
|
|
2
|
+
syntax: '<length>';
|
|
3
|
+
inherits: false;
|
|
4
|
+
initial-value: 0px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@property --fixed-toolbar-fade-end {
|
|
8
|
+
syntax: '<length>';
|
|
9
|
+
inherits: false;
|
|
10
|
+
initial-value: 0px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/*
|
|
14
|
+
* Drives the fade widths off the toolbar's own scroll position: fully opaque at rest,
|
|
15
|
+
* fading in on whichever edge still has scrolled-off content once it overflows.
|
|
16
|
+
* Unsupported browsers (no animation-timeline) simply keep the initial 0px fade, i.e. no fade at all.
|
|
17
|
+
*/
|
|
18
|
+
@keyframes fixed-toolbar-scroll-fade {
|
|
19
|
+
0% {
|
|
20
|
+
--fixed-toolbar-fade-start: 0px;
|
|
21
|
+
}
|
|
22
|
+
10%,
|
|
23
|
+
100% {
|
|
24
|
+
--fixed-toolbar-fade-start: var(--spacer-5);
|
|
25
|
+
}
|
|
26
|
+
0%,
|
|
27
|
+
90% {
|
|
28
|
+
--fixed-toolbar-fade-end: var(--spacer-5);
|
|
29
|
+
}
|
|
30
|
+
100% {
|
|
31
|
+
--fixed-toolbar-fade-end: 0px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
1
35
|
@layer payload-default {
|
|
2
36
|
.fixed-toolbar.fixed-toolbar--hide {
|
|
3
37
|
visibility: hidden;
|
|
@@ -7,10 +41,8 @@
|
|
|
7
41
|
|
|
8
42
|
.fixed-toolbar {
|
|
9
43
|
display: flex;
|
|
10
|
-
flex-wrap: wrap;
|
|
11
44
|
align-items: center;
|
|
12
45
|
padding: 0 var(--spacer-2);
|
|
13
|
-
gap: var(--spacer-2);
|
|
14
46
|
vertical-align: middle;
|
|
15
47
|
position: sticky;
|
|
16
48
|
z-index: 2;
|
|
@@ -55,13 +87,55 @@
|
|
|
55
87
|
}
|
|
56
88
|
}
|
|
57
89
|
|
|
90
|
+
.fixed-toolbar__scroll {
|
|
91
|
+
display: flex;
|
|
92
|
+
flex: 1 1 auto;
|
|
93
|
+
flex-wrap: nowrap;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: var(--spacer-2);
|
|
96
|
+
min-width: 0;
|
|
97
|
+
overflow-x: auto;
|
|
98
|
+
scrollbar-width: none;
|
|
99
|
+
-ms-overflow-style: none;
|
|
100
|
+
position: relative;
|
|
101
|
+
z-index: 1;
|
|
102
|
+
animation: fixed-toolbar-scroll-fade linear;
|
|
103
|
+
animation-timeline: scroll(self inline);
|
|
104
|
+
mask: linear-gradient(
|
|
105
|
+
to right,
|
|
106
|
+
transparent,
|
|
107
|
+
black var(--fixed-toolbar-fade-start),
|
|
108
|
+
black calc(100% - var(--fixed-toolbar-fade-end)),
|
|
109
|
+
transparent
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
&::-webkit-scrollbar {
|
|
113
|
+
display: none;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[dir='rtl'] .fixed-toolbar__scroll {
|
|
118
|
+
mask: linear-gradient(
|
|
119
|
+
to left,
|
|
120
|
+
transparent,
|
|
121
|
+
black var(--fixed-toolbar-fade-start),
|
|
122
|
+
black calc(100% - var(--fixed-toolbar-fade-end)),
|
|
123
|
+
transparent
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
58
127
|
.fixed-toolbar__group {
|
|
59
128
|
display: flex;
|
|
60
|
-
flex-wrap:
|
|
129
|
+
flex-wrap: nowrap;
|
|
61
130
|
align-items: center;
|
|
62
131
|
gap: var(--spacer-2);
|
|
63
132
|
align-self: stretch;
|
|
64
133
|
z-index: 1;
|
|
134
|
+
flex-shrink: 0;
|
|
135
|
+
|
|
136
|
+
> * {
|
|
137
|
+
flex-shrink: 0;
|
|
138
|
+
}
|
|
65
139
|
|
|
66
140
|
.divider {
|
|
67
141
|
width: var(--stroke-width-small);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAQrE,OAAO,aAAa,CAAA;AAuQpB,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,wBAAwB,CAuCxE,CAAA"}
|
|
@@ -4,13 +4,16 @@ import { c as _c } from "react/compiler-runtime";
|
|
|
4
4
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
6
6
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
7
|
+
import { getTranslation } from '@payloadcms/translations';
|
|
7
8
|
import { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui';
|
|
8
9
|
import * as React from 'react';
|
|
9
10
|
import { useMemo } from 'react';
|
|
10
11
|
import { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js';
|
|
11
12
|
import { ToolbarButton } from '../../../shared/ToolbarButton/index.js';
|
|
12
13
|
import { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js';
|
|
14
|
+
import { useToolbarKeyboardNavigation } from '../../../shared/useToolbarKeyboardNavigation.js';
|
|
13
15
|
import { useToolbarStates } from '../../../shared/useToolbarStates.js';
|
|
16
|
+
import { useRedirectVerticalWheelToHorizontalScroll } from './horizontalWheelScroll.js';
|
|
14
17
|
import './index.css';
|
|
15
18
|
function ButtonGroupItem({
|
|
16
19
|
active,
|
|
@@ -37,85 +40,141 @@ function ButtonGroupItem({
|
|
|
37
40
|
children: /*#__PURE__*/_jsx(item.ChildComponent, {})
|
|
38
41
|
}, item.key);
|
|
39
42
|
}
|
|
40
|
-
function ToolbarGroupComponent({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
function ToolbarGroupComponent(t0) {
|
|
44
|
+
const $ = _c(22);
|
|
45
|
+
const {
|
|
46
|
+
anchorElem,
|
|
47
|
+
editor,
|
|
48
|
+
editorConfig,
|
|
49
|
+
group,
|
|
50
|
+
index,
|
|
51
|
+
toolbarStates
|
|
52
|
+
} = t0;
|
|
48
53
|
const {
|
|
49
54
|
i18n
|
|
50
55
|
} = useTranslation();
|
|
51
56
|
const {
|
|
52
|
-
fieldProps:
|
|
53
|
-
featureClientSchemaMap,
|
|
54
|
-
schemaPath
|
|
55
|
-
}
|
|
57
|
+
fieldProps: t1
|
|
56
58
|
} = useEditorConfigContext();
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const {
|
|
60
|
+
featureClientSchemaMap,
|
|
61
|
+
schemaPath
|
|
62
|
+
} = t1;
|
|
63
|
+
let t2;
|
|
64
|
+
if ($[0] !== group.key || $[1] !== toolbarStates.groupStates) {
|
|
65
|
+
t2 = toolbarStates.groupStates.get(group.key);
|
|
66
|
+
$[0] = group.key;
|
|
67
|
+
$[1] = toolbarStates.groupStates;
|
|
68
|
+
$[2] = t2;
|
|
69
|
+
} else {
|
|
70
|
+
t2 = $[2];
|
|
71
|
+
}
|
|
72
|
+
const groupState = t2;
|
|
73
|
+
groupState?.activeItems;
|
|
74
|
+
let t3;
|
|
75
|
+
bb0: {
|
|
76
|
+
if (group.type !== "dropdown") {
|
|
77
|
+
t3 = undefined;
|
|
78
|
+
break bb0;
|
|
61
79
|
}
|
|
62
80
|
const activeItem = groupState?.activeItems?.[0];
|
|
63
81
|
if (activeItem) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return group.ChildComponent;
|
|
67
|
-
}, [group, groupState?.activeItems]);
|
|
68
|
-
const dropdownLabel = useMemo(() => {
|
|
69
|
-
if (group.type !== 'dropdown') {
|
|
70
|
-
return undefined;
|
|
71
|
-
}
|
|
72
|
-
const activeItems = groupState?.activeItems;
|
|
73
|
-
if (!activeItems?.length) {
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
if (activeItems.length > 1) {
|
|
77
|
-
return i18n.t('lexical:general:toolbarItemsActive', {
|
|
78
|
-
count: activeItems.length
|
|
79
|
-
});
|
|
82
|
+
t3 = activeItem.ChildComponent;
|
|
83
|
+
break bb0;
|
|
80
84
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
85
|
+
t3 = group.ChildComponent;
|
|
86
|
+
}
|
|
87
|
+
const DropdownIcon = t3;
|
|
88
|
+
let t4;
|
|
89
|
+
if ($[3] !== featureClientSchemaMap || $[4] !== group.type || $[5] !== groupState?.activeItems || $[6] !== i18n || $[7] !== schemaPath) {
|
|
90
|
+
t4 = () => {
|
|
91
|
+
if (group.type !== "dropdown") {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const activeItems = groupState?.activeItems;
|
|
95
|
+
if (!activeItems?.length) {
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (activeItems.length > 1) {
|
|
99
|
+
return i18n.t("lexical:general:toolbarItemsActive", {
|
|
100
|
+
count: activeItems.length
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
const item = activeItems[0];
|
|
104
|
+
let label = item.key;
|
|
105
|
+
if (item.label) {
|
|
106
|
+
label = typeof item.label === "function" ? item.label({
|
|
107
|
+
featureClientSchemaMap,
|
|
108
|
+
i18n,
|
|
109
|
+
schemaPath
|
|
110
|
+
}) : item.label;
|
|
111
|
+
}
|
|
112
|
+
if (label.length > 25) {
|
|
113
|
+
label = label.substring(0, 25) + "...";
|
|
114
|
+
}
|
|
115
|
+
return label;
|
|
116
|
+
};
|
|
117
|
+
$[3] = featureClientSchemaMap;
|
|
118
|
+
$[4] = group.type;
|
|
119
|
+
$[5] = groupState?.activeItems;
|
|
120
|
+
$[6] = i18n;
|
|
121
|
+
$[7] = schemaPath;
|
|
122
|
+
$[8] = t4;
|
|
123
|
+
} else {
|
|
124
|
+
t4 = $[8];
|
|
125
|
+
}
|
|
126
|
+
groupState?.activeItems;
|
|
127
|
+
let t5;
|
|
128
|
+
if ($[9] !== t4) {
|
|
129
|
+
t5 = t4();
|
|
130
|
+
$[9] = t4;
|
|
131
|
+
$[10] = t5;
|
|
132
|
+
} else {
|
|
133
|
+
t5 = $[10];
|
|
134
|
+
}
|
|
135
|
+
const dropdownLabel = t5;
|
|
136
|
+
const t6 = `fixed-toolbar__group fixed-toolbar__group-${group.key}`;
|
|
137
|
+
let t7;
|
|
138
|
+
if ($[11] !== DropdownIcon || $[12] !== anchorElem || $[13] !== dropdownLabel || $[14] !== editor || $[15] !== editorConfig.features.toolbarFixed?.groups.length || $[16] !== group || $[17] !== groupState || $[18] !== index || $[19] !== t6 || $[20] !== toolbarStates.itemStates) {
|
|
139
|
+
t7 = _jsxs("div", {
|
|
140
|
+
className: t6,
|
|
141
|
+
"data-toolbar-group-key": group.key,
|
|
142
|
+
children: [group.type === "dropdown" && group.items.length && groupState ? _jsx(ToolbarDropdown, {
|
|
143
|
+
anchorElem,
|
|
144
|
+
editor,
|
|
145
|
+
group,
|
|
146
|
+
groupState,
|
|
147
|
+
Icon: DropdownIcon,
|
|
148
|
+
itemsContainerClassNames: ["fixed-toolbar__dropdown-items"],
|
|
149
|
+
label: dropdownLabel
|
|
150
|
+
}) : null, group.type === "buttons" && group.items.length ? group.items.map(item_0 => {
|
|
151
|
+
const itemState = toolbarStates.itemStates.get(item_0.key);
|
|
152
|
+
return _jsx(ButtonGroupItem, {
|
|
153
|
+
active: itemState?.active ?? false,
|
|
154
|
+
anchorElem,
|
|
155
|
+
editor,
|
|
156
|
+
enabled: itemState?.enabled ?? true,
|
|
157
|
+
item: item_0
|
|
158
|
+
}, item_0.key);
|
|
159
|
+
}) : null, index < editorConfig.features.toolbarFixed?.groups.length - 1 && _jsx("div", {
|
|
160
|
+
className: "divider"
|
|
161
|
+
})]
|
|
162
|
+
}, group.key);
|
|
163
|
+
$[11] = DropdownIcon;
|
|
164
|
+
$[12] = anchorElem;
|
|
165
|
+
$[13] = dropdownLabel;
|
|
166
|
+
$[14] = editor;
|
|
167
|
+
$[15] = editorConfig.features.toolbarFixed?.groups.length;
|
|
168
|
+
$[16] = group;
|
|
169
|
+
$[17] = groupState;
|
|
170
|
+
$[18] = index;
|
|
171
|
+
$[19] = t6;
|
|
172
|
+
$[20] = toolbarStates.itemStates;
|
|
173
|
+
$[21] = t7;
|
|
174
|
+
} else {
|
|
175
|
+
t7 = $[21];
|
|
176
|
+
}
|
|
177
|
+
return t7;
|
|
119
178
|
}
|
|
120
179
|
function FixedToolbar({
|
|
121
180
|
anchorElem,
|
|
@@ -125,10 +184,21 @@ function FixedToolbar({
|
|
|
125
184
|
parentWithFixedToolbar
|
|
126
185
|
}) {
|
|
127
186
|
const currentToolbarRef = React.useRef(null);
|
|
187
|
+
const keyboardNavigationOptions = useMemo(() => ({
|
|
188
|
+
toolbarRef: currentToolbarRef
|
|
189
|
+
}), []);
|
|
190
|
+
const {
|
|
191
|
+
fieldProps
|
|
192
|
+
} = useEditorConfigContext();
|
|
193
|
+
const {
|
|
194
|
+
i18n
|
|
195
|
+
} = useTranslation();
|
|
196
|
+
useToolbarKeyboardNavigation(keyboardNavigationOptions);
|
|
128
197
|
const isEditable = useLexicalEditable();
|
|
129
198
|
const {
|
|
130
199
|
y
|
|
131
200
|
} = useScrollInfo();
|
|
201
|
+
useRedirectVerticalWheelToHorizontalScroll();
|
|
132
202
|
const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups);
|
|
133
203
|
// Memoize the parent toolbar element
|
|
134
204
|
const parentToolbarElem = useMemo(() => {
|
|
@@ -174,6 +244,7 @@ function FixedToolbar({
|
|
|
174
244
|
}
|
|
175
245
|
}, 50, [currentToolbarRef, parentToolbarElem, y]);
|
|
176
246
|
return /*#__PURE__*/_jsx("div", {
|
|
247
|
+
"aria-label": getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path,
|
|
177
248
|
className: "fixed-toolbar",
|
|
178
249
|
onFocus: event => {
|
|
179
250
|
// Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,
|
|
@@ -181,7 +252,10 @@ function FixedToolbar({
|
|
|
181
252
|
event.stopPropagation();
|
|
182
253
|
},
|
|
183
254
|
ref: currentToolbarRef,
|
|
184
|
-
|
|
255
|
+
role: "toolbar",
|
|
256
|
+
children: isEditable && /*#__PURE__*/_jsx("div", {
|
|
257
|
+
className: "fixed-toolbar__scroll",
|
|
258
|
+
tabIndex: -1,
|
|
185
259
|
children: editorConfig?.features && editorConfig.features?.toolbarFixed?.groups.map((group, i) => {
|
|
186
260
|
return /*#__PURE__*/_jsx(ToolbarGroupComponent, {
|
|
187
261
|
anchorElem: anchorElem,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","useToolbarStates","ButtonGroupItem","active","anchorElem","editor","enabled","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","editorConfig","group","index","toolbarStates","i18n","fieldProps","featureClientSchemaMap","schemaPath","groupState","groupStates","get","DropdownIcon","type","undefined","activeItem","activeItems","dropdownLabel","length","t","count","label","substring","_jsxs","className","items","Icon","itemsContainerClassNames","map","itemState","itemStates","features","toolbarFixed","groups","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","isEditable","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","remove","add","onFocus","event","stopPropagation","ref","Fragment","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","t0","$","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","t1","t2","Symbol","for","bb0","document","body"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { EditorConfigContextType } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport type { SanitizedClientEditorConfig } from '../../../../../lexical/config/types.js'\nimport type { PluginComponent } from '../../../../typesClient.js'\nimport type { ToolbarStates } from '../../../shared/useToolbarStates.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../../types.js'\nimport type { FixedToolbarFeatureProps } from '../../server/index.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { ToolbarButton } from '../../../shared/ToolbarButton/index.js'\nimport { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js'\nimport { useToolbarStates } from '../../../shared/useToolbarStates.js'\nimport './index.css'\n\nfunction ButtonGroupItem({\n active,\n anchorElem,\n editor,\n enabled,\n item,\n}: {\n active: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled: boolean\n item: ToolbarGroupItem\n}): React.ReactNode {\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n )\n }\n\n if (!item.ChildComponent) {\n return null\n }\n\n return (\n <ToolbarButton active={active} editor={editor} enabled={enabled} item={item} key={item.key}>\n <item.ChildComponent />\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n toolbarStates,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n toolbarStates: ToolbarStates\n}): React.ReactNode {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n const groupState = toolbarStates.groupStates.get(group.key)\n\n const DropdownIcon = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItem = groupState?.activeItems?.[0]\n if (activeItem) {\n return activeItem.ChildComponent\n }\n return group.ChildComponent\n }, [group, groupState?.activeItems])\n\n const dropdownLabel = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItems = groupState?.activeItems\n if (!activeItems?.length) {\n return undefined\n }\n if (activeItems.length > 1) {\n return i18n.t('lexical:general:toolbarItemsActive', { count: activeItems.length })\n }\n const item = activeItems[0]!\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n return label\n }, [group, groupState?.activeItems, i18n, featureClientSchemaMap, schemaPath])\n\n return (\n <div\n className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`}\n data-toolbar-group-key={group.key}\n key={group.key}\n >\n {group.type === 'dropdown' && group.items.length && groupState ? (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n groupState={groupState}\n Icon={DropdownIcon}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n />\n ) : null}\n {group.type === 'buttons' && group.items.length\n ? group.items.map((item) => {\n const itemState = toolbarStates.itemStates.get(item.key)\n return (\n <ButtonGroupItem\n active={itemState?.active ?? false}\n anchorElem={anchorElem}\n editor={editor}\n enabled={itemState?.enabled ?? true}\n item={item}\n key={item.key}\n />\n )\n })\n : null}\n {index < editorConfig.features.toolbarFixed?.groups.length - 1 && <div className=\"divider\" />}\n </div>\n )\n}\n\nfunction FixedToolbar({\n anchorElem,\n clientProps,\n editor,\n editorConfig,\n parentWithFixedToolbar,\n}: {\n anchorElem: HTMLElement\n clientProps?: FixedToolbarFeatureProps\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n parentWithFixedToolbar: EditorConfigContextType | false\n}): React.ReactNode {\n const currentToolbarRef = React.useRef<HTMLDivElement>(null)\n const isEditable = useLexicalEditable()\n\n const { y } = useScrollInfo()\n\n const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups)\n\n // Memoize the parent toolbar element\n const parentToolbarElem = useMemo(() => {\n if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {\n return null\n }\n\n const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current\n let sibling = parentEditorElem.previousElementSibling\n while (sibling) {\n if (sibling.classList.contains('fixed-toolbar')) {\n return sibling\n }\n sibling = sibling.previousElementSibling\n }\n return null\n }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar])\n\n useThrottledEffect(\n () => {\n if (!parentToolbarElem) {\n // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo\n return\n }\n const currentToolbarElem = currentToolbarRef.current\n if (!currentToolbarElem) {\n return\n }\n\n const currentRect = currentToolbarElem.getBoundingClientRect()\n const parentRect = parentToolbarElem.getBoundingClientRect()\n\n // we only need to check for vertical overlap\n const overlapping = !(\n currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom\n )\n\n if (overlapping) {\n currentToolbarElem.classList.remove('fixed-toolbar')\n currentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--overlapping')\n parentToolbarElem.classList.remove('fixed-toolbar')\n parentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--hide')\n } else {\n if (!currentToolbarElem.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarElem.classList.remove('fixed-toolbar--overlapping')\n currentToolbarElem.classList.add('fixed-toolbar')\n parentToolbarElem.classList.remove('fixed-toolbar--hide')\n parentToolbarElem.classList.add('fixed-toolbar')\n }\n },\n 50,\n [currentToolbarRef, parentToolbarElem, y],\n )\n\n return (\n <div\n className=\"fixed-toolbar\"\n onFocus={(event) => {\n // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,\n // the parent editor will be focused, and the child editor will lose focus.\n event.stopPropagation()\n }}\n ref={currentToolbarRef}\n >\n {isEditable && (\n <React.Fragment>\n {editorConfig?.features &&\n editorConfig.features?.toolbarFixed?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n group={group}\n index={i}\n key={group.key}\n toolbarStates={toolbarStates}\n />\n )\n })}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nconst getParentEditorWithFixedToolbar = (\n editorConfigContext: EditorConfigContextType,\n): EditorConfigContextType | false => {\n if (editorConfigContext.parentEditor?.editorConfig) {\n if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {\n return editorConfigContext.parentEditor\n } else {\n if (editorConfigContext.parentEditor) {\n return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor)\n }\n }\n }\n return false\n}\n\nexport const FixedToolbarPlugin: PluginComponent<FixedToolbarFeatureProps> = ({ clientProps }) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n if (!isEditable) {\n return null\n }\n\n const { editorConfig: currentEditorConfig } = editorConfigContext\n\n const editor = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editor || currentEditor\n : currentEditor\n\n const editorConfig = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig\n : currentEditorConfig\n\n const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext)\n\n if (clientProps?.disableIfParentHasFixedToolbar) {\n if (parentWithFixedToolbar) {\n return null\n }\n }\n\n if (!editorConfig?.features?.toolbarFixed?.groups?.length) {\n return null\n }\n\n return (\n <FixedToolbar\n anchorElem={document.body}\n clientProps={clientProps}\n editor={editor}\n editorConfig={editorConfig}\n parentWithFixedToolbar={parentWithFixedToolbar}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,QAAQ;AAClE,YAAYC,KAAA,MAAW;AACvB,SAASC,OAAO,QAAQ;AASxB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AAEP,SAASC,gBAAgB;EACvBC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC;AAAI,CAOL;EACC,IAAIA,IAAA,CAAKC,SAAS,EAAE;IAClB,OACED,IAAA,EAAMC,SAAA,iBACJC,IAAA,CAACF,IAAA,CAAKC,S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T,mBAAA,CAAAU,aAAA,EAAA3E,YAAA,IAAmDyE,mBAAA,GACnDA,mBAAA;EAAA,IAAAG,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAN,CAAA,QAAArC,WAAA,IAAAqC,CAAA,QAAA/E,MAAA,IAAA+E,CAAA,QAAAvE,YAAA,IAAAuE,CAAA,QAAAN,mBAAA;IAMOY,EAAA,GAAAC,MAAA,CAAAC,GAAA;IAAAC,GAAA;MAJX,MAAA7C,sBAAA,GAA+B6B,+BAAA,CAAgCC,mBAAA;MAAA,IAE3D/B,WAAA,EAAAO,8BAAA;QAAA,IACEN,sBAAA;UACK0C,EAAA;UAAA,MAAAG,GAAA;QAAA;MAAA;MAAA,KAINhF,YAAA,EAAA8B,QAAA,EAAAC,YAAA,EAAAC,MAAA,EAAAf,MAAA;QACI4D,EAAA;QAAA,MAAAG,GAAA;MAAA;MAIPJ,EAAA,GAAAhF,IAAA,CAAAqC,YAAA;QAAA1C,UAAA,EAAA0F,QAAA,CAAAC,IAAA;QAAAhD,WAAA;QAAA1C,MAAA;QAAAQ,YAAA;QAAAmC;MAAA,C;;;;;;;;;;;;;;;SAAAyC,E;CAQJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","getTranslation","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","useToolbarKeyboardNavigation","useToolbarStates","useRedirectVerticalWheelToHorizontalScroll","ButtonGroupItem","active","anchorElem","editor","enabled","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","t0","$","editorConfig","group","index","toolbarStates","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","t2","groupStates","get","groupState","activeItems","t3","bb0","type","undefined","activeItem","DropdownIcon","t4","length","t","count","label","substring","t5","dropdownLabel","t6","t7","features","toolbarFixed","groups","itemStates","_jsxs","className","children","items","Icon","itemsContainerClassNames","map","item_0","itemState","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","keyboardNavigationOptions","toolbarRef","isEditable","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","remove","add","field","path","onFocus","event","stopPropagation","ref","role","tabIndex","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","Symbol","for","document","body"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { EditorConfigContextType } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport type { SanitizedClientEditorConfig } from '../../../../../lexical/config/types.js'\nimport type { PluginComponent } from '../../../../typesClient.js'\nimport type { ToolbarStates } from '../../../shared/useToolbarStates.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../../types.js'\nimport type { FixedToolbarFeatureProps } from '../../server/index.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { ToolbarButton } from '../../../shared/ToolbarButton/index.js'\nimport { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js'\nimport { useToolbarKeyboardNavigation } from '../../../shared/useToolbarKeyboardNavigation.js'\nimport { useToolbarStates } from '../../../shared/useToolbarStates.js'\nimport { useRedirectVerticalWheelToHorizontalScroll } from './horizontalWheelScroll.js'\nimport './index.css'\n\nfunction ButtonGroupItem({\n active,\n anchorElem,\n editor,\n enabled,\n item,\n}: {\n active: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled: boolean\n item: ToolbarGroupItem\n}): React.ReactNode {\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n )\n }\n\n if (!item.ChildComponent) {\n return null\n }\n\n return (\n <ToolbarButton active={active} editor={editor} enabled={enabled} item={item} key={item.key}>\n <item.ChildComponent />\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n toolbarStates,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n toolbarStates: ToolbarStates\n}): React.ReactNode {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n const groupState = toolbarStates.groupStates.get(group.key)\n\n const DropdownIcon = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItem = groupState?.activeItems?.[0]\n if (activeItem) {\n return activeItem.ChildComponent\n }\n return group.ChildComponent\n }, [group, groupState?.activeItems])\n\n const dropdownLabel = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItems = groupState?.activeItems\n if (!activeItems?.length) {\n return undefined\n }\n if (activeItems.length > 1) {\n return i18n.t('lexical:general:toolbarItemsActive', { count: activeItems.length })\n }\n const item = activeItems[0]!\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n return label\n }, [group, groupState?.activeItems, i18n, featureClientSchemaMap, schemaPath])\n\n return (\n <div\n className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`}\n data-toolbar-group-key={group.key}\n key={group.key}\n >\n {group.type === 'dropdown' && group.items.length && groupState ? (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n groupState={groupState}\n Icon={DropdownIcon}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n />\n ) : null}\n {group.type === 'buttons' && group.items.length\n ? group.items.map((item) => {\n const itemState = toolbarStates.itemStates.get(item.key)\n return (\n <ButtonGroupItem\n active={itemState?.active ?? false}\n anchorElem={anchorElem}\n editor={editor}\n enabled={itemState?.enabled ?? true}\n item={item}\n key={item.key}\n />\n )\n })\n : null}\n {index < editorConfig.features.toolbarFixed?.groups.length - 1 && <div className=\"divider\" />}\n </div>\n )\n}\n\nfunction FixedToolbar({\n anchorElem,\n clientProps,\n editor,\n editorConfig,\n parentWithFixedToolbar,\n}: {\n anchorElem: HTMLElement\n clientProps?: FixedToolbarFeatureProps\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n parentWithFixedToolbar: EditorConfigContextType | false\n}): React.ReactNode {\n const currentToolbarRef = React.useRef<HTMLDivElement>(null)\n const keyboardNavigationOptions = useMemo(() => ({ toolbarRef: currentToolbarRef }), [])\n const { fieldProps } = useEditorConfigContext()\n const { i18n } = useTranslation()\n\n useToolbarKeyboardNavigation(keyboardNavigationOptions)\n\n const isEditable = useLexicalEditable()\n\n const { y } = useScrollInfo()\n\n useRedirectVerticalWheelToHorizontalScroll()\n\n const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups)\n\n // Memoize the parent toolbar element\n const parentToolbarElem = useMemo(() => {\n if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {\n return null\n }\n\n const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current\n let sibling = parentEditorElem.previousElementSibling\n while (sibling) {\n if (sibling.classList.contains('fixed-toolbar')) {\n return sibling\n }\n sibling = sibling.previousElementSibling\n }\n return null\n }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar])\n\n useThrottledEffect(\n () => {\n if (!parentToolbarElem) {\n // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo\n return\n }\n const currentToolbarElem = currentToolbarRef.current\n if (!currentToolbarElem) {\n return\n }\n\n const currentRect = currentToolbarElem.getBoundingClientRect()\n const parentRect = parentToolbarElem.getBoundingClientRect()\n\n // we only need to check for vertical overlap\n const overlapping = !(\n currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom\n )\n\n if (overlapping) {\n currentToolbarElem.classList.remove('fixed-toolbar')\n currentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--overlapping')\n parentToolbarElem.classList.remove('fixed-toolbar')\n parentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--hide')\n } else {\n if (!currentToolbarElem.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarElem.classList.remove('fixed-toolbar--overlapping')\n currentToolbarElem.classList.add('fixed-toolbar')\n parentToolbarElem.classList.remove('fixed-toolbar--hide')\n parentToolbarElem.classList.add('fixed-toolbar')\n }\n },\n 50,\n [currentToolbarRef, parentToolbarElem, y],\n )\n\n return (\n <div\n aria-label={\n getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path\n }\n className=\"fixed-toolbar\"\n onFocus={(event) => {\n // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,\n // the parent editor will be focused, and the child editor will lose focus.\n event.stopPropagation()\n }}\n ref={currentToolbarRef}\n role=\"toolbar\"\n >\n {isEditable && (\n <div className=\"fixed-toolbar__scroll\" tabIndex={-1}>\n {editorConfig?.features &&\n editorConfig.features?.toolbarFixed?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n group={group}\n index={i}\n key={group.key}\n toolbarStates={toolbarStates}\n />\n )\n })}\n </div>\n )}\n </div>\n )\n}\n\nconst getParentEditorWithFixedToolbar = (\n editorConfigContext: EditorConfigContextType,\n): EditorConfigContextType | false => {\n if (editorConfigContext.parentEditor?.editorConfig) {\n if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {\n return editorConfigContext.parentEditor\n } else {\n if (editorConfigContext.parentEditor) {\n return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor)\n }\n }\n }\n return false\n}\n\nexport const FixedToolbarPlugin: PluginComponent<FixedToolbarFeatureProps> = ({ clientProps }) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n if (!isEditable) {\n return null\n }\n\n const { editorConfig: currentEditorConfig } = editorConfigContext\n\n const editor = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editor || currentEditor\n : currentEditor\n\n const editorConfig = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig\n : currentEditorConfig\n\n const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext)\n\n if (clientProps?.disableIfParentHasFixedToolbar) {\n if (parentWithFixedToolbar) {\n return null\n }\n }\n\n if (!editorConfig?.features?.toolbarFixed?.groups?.length) {\n return null\n }\n\n return (\n <FixedToolbar\n anchorElem={document.body}\n clientProps={clientProps}\n editor={editor}\n editorConfig={editorConfig}\n parentWithFixedToolbar={parentWithFixedToolbar}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,QAAQ;AAClE,YAAYC,KAAA,MAAW;AACvB,SAASC,OAAO,QAAQ;AASxB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,gBAAgB,QAAQ;AACjC,SAASC,0CAA0C,QAAQ;AAC3D,OAAO;AAEP,SAASC,gBAAgB;EACvBC,MAAM;EACNC,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AAA;EAAA,IAAAG,EAAA;EAAA,IAAAV,CAAA,QAAA6C,WAAA,IAAA7C,CAAA,QAAAT,MAAA,IAAAS,CAAA,QAAAC,YAAA,IAAAD,CAAA,QAAAiF,mBAAA;IAMOvE,EAAA,GAAAgF,MAAA,CAAAC,GAAA;IAAA3E,GAAA;MAJX,MAAA8B,sBAAA,GAA+BkC,+BAAA,CAAgCC,mBAAA;MAE/D,IAAIpC,WAAA,EAAAS,8BAAa;QACf,IAAIR,sBAAA;UACKpC,EAAA;UAAA,MAAAM,GAAA;QAAA;MACT;MAGF,IAAI,CAACf,YAAA,EAAA8B,QAAwB,EAAAC,YAAc,EAAAC,MAAQ,EAAAX,MAAA;QAC1CZ,EAAA;QAAA,MAAAM,GAAA;MAAA;MAIPT,EAAA,GAAAZ,IAAA,CAACiD,YAAA;QAAAtD,UAAA,EACasG,QAAA,CAAAC,IAAa;QAAAhD,WAAA;QAAAtD,MAAA;QAAAU,YAAA;QAAA6C;;;;;;;;;;;;;;;;SAD3BvC,E;CAQJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/inline/client/Toolbar/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/inline/client/Toolbar/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAW3E,OAAO,aAAa,CAAA;AA0XpB,eAAO,MAAM,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAIpE,CAAA"}
|
|
@@ -5,7 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
|
|
6
6
|
import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
|
|
7
7
|
import { mergeRegister } from '@lexical/utils';
|
|
8
|
-
import {
|
|
8
|
+
import { getTranslation } from '@payloadcms/translations';
|
|
9
|
+
import { useTranslation } from '@payloadcms/ui';
|
|
10
|
+
import { $getSelection, $isRangeSelection, $isTextNode, $onUpdate, COMMAND_PRIORITY_LOW, getDOMSelection, SELECTION_CHANGE_COMMAND } from 'lexical';
|
|
9
11
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
10
12
|
import * as React from 'react';
|
|
11
13
|
import { createPortal } from 'react-dom';
|
|
@@ -14,6 +16,7 @@ import { getDOMRangeRect } from '../../../../../lexical/utils/getDOMRangeRect.js
|
|
|
14
16
|
import { setFloatingElemPosition } from '../../../../../lexical/utils/setFloatingElemPosition.js';
|
|
15
17
|
import { ToolbarButton } from '../../../shared/ToolbarButton/index.js';
|
|
16
18
|
import { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js';
|
|
19
|
+
import { useToolbarKeyboardNavigation } from '../../../shared/useToolbarKeyboardNavigation.js';
|
|
17
20
|
import { useToolbarStates } from '../../../shared/useToolbarStates.js';
|
|
18
21
|
import './index.css';
|
|
19
22
|
function ButtonGroupItem({
|
|
@@ -41,52 +44,94 @@ function ButtonGroupItem({
|
|
|
41
44
|
children: /*#__PURE__*/_jsx(item.ChildComponent, {})
|
|
42
45
|
}, item.key);
|
|
43
46
|
}
|
|
44
|
-
function ToolbarGroupComponent({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
function ToolbarGroupComponent(t0) {
|
|
48
|
+
const $ = _c(13);
|
|
49
|
+
const {
|
|
50
|
+
anchorElem,
|
|
51
|
+
editor,
|
|
52
|
+
group,
|
|
53
|
+
index,
|
|
54
|
+
toolbarStates
|
|
55
|
+
} = t0;
|
|
51
56
|
const {
|
|
52
57
|
editorConfig
|
|
53
58
|
} = useEditorConfigContext();
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
let t1;
|
|
60
|
+
if ($[0] !== group.key || $[1] !== toolbarStates.groupStates) {
|
|
61
|
+
t1 = toolbarStates.groupStates.get(group.key);
|
|
62
|
+
$[0] = group.key;
|
|
63
|
+
$[1] = toolbarStates.groupStates;
|
|
64
|
+
$[2] = t1;
|
|
65
|
+
} else {
|
|
66
|
+
t1 = $[2];
|
|
67
|
+
}
|
|
68
|
+
const groupState = t1;
|
|
69
|
+
groupState?.activeItems;
|
|
70
|
+
let t2;
|
|
71
|
+
bb0: {
|
|
72
|
+
if (group.type !== "dropdown") {
|
|
73
|
+
t2 = undefined;
|
|
74
|
+
break bb0;
|
|
58
75
|
}
|
|
59
76
|
const activeItem = groupState?.activeItems?.[0];
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
group: group,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
t2 = activeItem?.ChildComponent ?? group.ChildComponent;
|
|
78
|
+
}
|
|
79
|
+
const DropdownIcon = t2;
|
|
80
|
+
const t3 = `inline-toolbar-popup__group inline-toolbar-popup__group-${group.key}`;
|
|
81
|
+
let t4;
|
|
82
|
+
if ($[3] !== DropdownIcon || $[4] !== anchorElem || $[5] !== editor || $[6] !== editorConfig.features.toolbarInline?.groups.length || $[7] !== group || $[8] !== groupState || $[9] !== index || $[10] !== t3 || $[11] !== toolbarStates.itemStates) {
|
|
83
|
+
t4 = _jsxs("div", {
|
|
84
|
+
className: t3,
|
|
85
|
+
"data-toolbar-group-key": group.key,
|
|
86
|
+
children: [group.type === "dropdown" && group.items.length && groupState ? _jsx(ToolbarDropdown, {
|
|
87
|
+
anchorElem,
|
|
88
|
+
editor,
|
|
89
|
+
group,
|
|
90
|
+
groupState,
|
|
91
|
+
Icon: DropdownIcon
|
|
92
|
+
}) : null, group.type === "buttons" && group.items.length ? group.items.map(item => {
|
|
93
|
+
const itemState = toolbarStates.itemStates.get(item.key);
|
|
94
|
+
return _jsx(ButtonGroupItem, {
|
|
95
|
+
active: itemState?.active ?? false,
|
|
96
|
+
anchorElem,
|
|
97
|
+
editor,
|
|
98
|
+
enabled: itemState?.enabled ?? true,
|
|
99
|
+
item
|
|
100
|
+
}, item.key);
|
|
101
|
+
}) : null, index < editorConfig.features.toolbarInline?.groups.length - 1 && _jsx("div", {
|
|
102
|
+
className: "divider"
|
|
103
|
+
})]
|
|
104
|
+
}, group.key);
|
|
105
|
+
$[3] = DropdownIcon;
|
|
106
|
+
$[4] = anchorElem;
|
|
107
|
+
$[5] = editor;
|
|
108
|
+
$[6] = editorConfig.features.toolbarInline?.groups.length;
|
|
109
|
+
$[7] = group;
|
|
110
|
+
$[8] = groupState;
|
|
111
|
+
$[9] = index;
|
|
112
|
+
$[10] = t3;
|
|
113
|
+
$[11] = toolbarStates.itemStates;
|
|
114
|
+
$[12] = t4;
|
|
115
|
+
} else {
|
|
116
|
+
t4 = $[12];
|
|
117
|
+
}
|
|
118
|
+
return t4;
|
|
84
119
|
}
|
|
85
120
|
function InlineToolbar({
|
|
86
121
|
anchorElem,
|
|
87
122
|
editor
|
|
88
123
|
}) {
|
|
89
124
|
const floatingToolbarRef = useRef(null);
|
|
125
|
+
const keyboardNavigationOptions = useMemo(() => ({
|
|
126
|
+
toolbarRef: floatingToolbarRef
|
|
127
|
+
}), []);
|
|
128
|
+
const {
|
|
129
|
+
fieldProps
|
|
130
|
+
} = useEditorConfigContext();
|
|
131
|
+
const {
|
|
132
|
+
i18n
|
|
133
|
+
} = useTranslation();
|
|
134
|
+
useToolbarKeyboardNavigation(keyboardNavigationOptions);
|
|
90
135
|
const caretRef = useRef(null);
|
|
91
136
|
const {
|
|
92
137
|
editorConfig
|
|
@@ -203,13 +248,15 @@ function InlineToolbar({
|
|
|
203
248
|
$updateTextFormatFloatingToolbar();
|
|
204
249
|
});
|
|
205
250
|
}), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
|
|
206
|
-
$
|
|
251
|
+
$onUpdate(() => editor.read('latest', $updateTextFormatFloatingToolbar));
|
|
207
252
|
return false;
|
|
208
253
|
}, COMMAND_PRIORITY_LOW));
|
|
209
254
|
}, [editor, $updateTextFormatFloatingToolbar]);
|
|
210
255
|
return /*#__PURE__*/_jsxs("div", {
|
|
256
|
+
"aria-label": getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path,
|
|
211
257
|
className: "inline-toolbar-popup",
|
|
212
258
|
ref: floatingToolbarRef,
|
|
259
|
+
role: "toolbar",
|
|
213
260
|
children: [/*#__PURE__*/_jsx("div", {
|
|
214
261
|
className: "caret",
|
|
215
262
|
ref: caretRef
|