@payloadcms/richtext-lexical 4.0.0-internal.c3ac604 → 4.0.0-internal.cb69780
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-TS5CRYHE.js +2 -0
- package/dist/exports/client/Field-TS5CRYHE.js.map +7 -0
- package/dist/exports/client/bundled.css +1 -1
- package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
- package/dist/exports/client/{chunk-SSMQFWCQ.js.map → chunk-3LRZDIIG.js.map} +4 -4
- package/dist/exports/client/{chunk-ESITTE3C.js → chunk-ZFGDYZDE.js} +2 -2
- package/dist/exports/client/{chunk-ESITTE3C.js.map → chunk-ZFGDYZDE.js.map} +2 -2
- package/dist/exports/client/componentInline-55HZXGUS.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/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/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 +133 -76
- 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/index.d.ts.map +1 -1
- package/dist/features/blocks/client/componentInline/index.js +2 -2
- package/dist/features/blocks/client/componentInline/index.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/converters/lexicalToHtml/async/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
- package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
- package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
- package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
- package/dist/features/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/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/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/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/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +6 -3
- package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
- package/dist/features/link/server/index.js +2 -2
- package/dist/features/link/server/index.js.map +1 -1
- package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
- package/dist/features/lists/checklist/server/index.js +5 -2
- package/dist/features/lists/checklist/server/index.js.map +1 -1
- package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/orderedList/server/index.js +5 -2
- package/dist/features/lists/orderedList/server/index.js.map +1 -1
- package/dist/features/lists/shared/constants.d.ts +2 -0
- package/dist/features/lists/shared/constants.d.ts.map +1 -0
- package/dist/features/lists/shared/constants.js +2 -0
- package/dist/features/lists/shared/constants.js.map +1 -0
- package/dist/features/lists/shared/validate.d.ts +5 -0
- package/dist/features/lists/shared/validate.d.ts.map +1 -0
- package/dist/features/lists/shared/validate.js +15 -0
- package/dist/features/lists/shared/validate.js.map +1 -0
- package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
- package/dist/features/lists/unorderedList/server/index.js +5 -2
- package/dist/features/lists/unorderedList/server/index.js.map +1 -1
- package/dist/features/relationship/client/index.d.ts +2 -2
- package/dist/features/relationship/client/index.d.ts.map +1 -1
- package/dist/features/relationship/client/index.js.map +1 -1
- package/dist/features/relationship/client/plugins/index.d.ts +2 -2
- package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
- package/dist/features/relationship/client/plugins/index.js +27 -31
- package/dist/features/relationship/client/plugins/index.js.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
- package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
- package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
- package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
- package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/relationship/server/index.d.ts +8 -1
- package/dist/features/relationship/server/index.d.ts.map +1 -1
- package/dist/features/relationship/server/index.js +28 -11
- package/dist/features/relationship/server/index.js.map +1 -1
- package/dist/features/relationship/server/schema.d.ts +2 -2
- package/dist/features/relationship/server/schema.d.ts.map +1 -1
- package/dist/features/relationship/server/schema.js +5 -10
- package/dist/features/relationship/server/schema.js.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
- package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
- package/dist/features/table/client/index.d.ts.map +1 -0
- package/dist/features/table/client/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
- package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +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 +41 -18
- package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
- package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
- package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/debounce.js.map +1 -0
- package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
- package/dist/features/table/client/utils/useDebounce.js.map +1 -0
- package/dist/features/table/markdownTransformer.d.ts.map +1 -0
- package/dist/features/table/markdownTransformer.js.map +1 -0
- package/dist/features/table/server/index.d.ts +3 -0
- package/dist/features/table/server/index.d.ts.map +1 -0
- package/dist/features/{experimental_table → table}/server/index.js +4 -4
- package/dist/features/table/server/index.js.map +1 -0
- package/dist/features/table/server/schema.d.ts.map +1 -0
- package/dist/features/table/server/schema.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
- package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
- package/dist/features/toolbars/fixed/client/Toolbar/index.css +77 -3
- package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
- package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
- package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
- 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 +85 -32
- package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
- package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -11
- package/dist/features/typesServer.d.ts +1 -1
- package/dist/features/typesServer.d.ts.map +1 -1
- package/dist/features/typesServer.js.map +1 -1
- package/dist/features/upload/client/index.d.ts +3 -2
- package/dist/features/upload/client/index.d.ts.map +1 -1
- package/dist/features/upload/client/index.js.map +1 -1
- package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
- package/dist/features/upload/client/plugin/index.js +47 -52
- package/dist/features/upload/client/plugin/index.js.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
- package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
- package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
- package/dist/features/upload/server/index.d.ts +6 -2
- package/dist/features/upload/server/index.d.ts.map +1 -1
- package/dist/features/upload/server/index.js +20 -16
- package/dist/features/upload/server/index.js.map +1 -1
- package/dist/features/upload/server/schema.d.ts +2 -2
- package/dist/features/upload/server/schema.d.ts.map +1 -1
- package/dist/features/upload/server/schema.js +4 -8
- package/dist/features/upload/server/schema.js.map +1 -1
- package/dist/features/upload/server/validate.d.ts +2 -2
- package/dist/features/upload/server/validate.d.ts.map +1 -1
- package/dist/features/upload/server/validate.js +3 -0
- package/dist/features/upload/server/validate.js.map +1 -1
- package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
- package/dist/field/Diff/converters/listitem/index.js +2 -1
- package/dist/field/Diff/converters/listitem/index.js.map +1 -1
- package/dist/field/Diff/index.d.ts +3 -2
- package/dist/field/Diff/index.d.ts.map +1 -1
- package/dist/field/Diff/index.js +1 -0
- package/dist/field/Diff/index.js.map +1 -1
- package/dist/field/RenderLexical/index.d.ts +3 -1
- package/dist/field/RenderLexical/index.d.ts.map +1 -1
- package/dist/field/RenderLexical/index.js +23 -23
- package/dist/field/RenderLexical/index.js.map +1 -1
- package/dist/field/ViewSelector.d.ts.map +1 -1
- package/dist/field/ViewSelector.js +1 -0
- package/dist/field/ViewSelector.js.map +1 -1
- package/dist/field/bundled.css +1 -1
- package/dist/field/index.css +10 -10
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +68 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/lexical/LexicalEditor.css +20 -9
- 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/InsertParagraphAtEnd/index.css +18 -24
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
- package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -1
- package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.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 +1 -0
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
- package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
- 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 +65 -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/ui/ContentEditable.d.ts +2 -1
- package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
- package/dist/lexical/ui/ContentEditable.js +9 -6
- 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/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/nodeTypes.d.ts +1 -1
- package/dist/types/nodeTypes.d.ts.map +1 -1
- package/dist/types/nodeTypes.js.map +1 -1
- package/dist/utilities/createServerFeature.d.ts +1 -1
- package/dist/utilities/createServerFeature.d.ts.map +1 -1
- package/dist/utilities/createServerFeature.js +2 -2
- package/dist/utilities/createServerFeature.js.map +1 -1
- package/dist/utilities/editorConfigFactory.d.ts +6 -6
- package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
- package/dist/utilities/editorConfigFactory.js +9 -9
- package/dist/utilities/editorConfigFactory.js.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
- package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
- package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
- package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
- package/dist/utilities/upgradeLexicalData/index.js +6 -3
- package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
- package/package.json +22 -22
- package/dist/dependencyChecker.spec.js +0 -16
- package/dist/dependencyChecker.spec.js.map +0 -1
- package/dist/exports/client/Field-IZKDIUJY.js +0 -2
- package/dist/exports/client/Field-IZKDIUJY.js.map +0 -7
- package/dist/exports/client/chunk-SSMQFWCQ.js +0 -2
- package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
- 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/{componentInline-H24N7GUG.js.map → componentInline-55HZXGUS.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.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
- /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
|
@@ -28,18 +28,19 @@
|
|
|
28
28
|
style['text-align'] = 'center';
|
|
29
29
|
break;
|
|
30
30
|
case 'end':
|
|
31
|
-
style['text-align'] = '
|
|
31
|
+
style['text-align'] = 'end';
|
|
32
32
|
break;
|
|
33
33
|
case 'justify':
|
|
34
34
|
style['text-align'] = 'justify';
|
|
35
35
|
break;
|
|
36
36
|
case 'left':
|
|
37
|
+
style['text-align'] = 'left';
|
|
37
38
|
break;
|
|
38
39
|
case 'right':
|
|
39
40
|
style['text-align'] = 'right';
|
|
40
41
|
break;
|
|
41
42
|
case 'start':
|
|
42
|
-
style['text-align'] = '
|
|
43
|
+
style['text-align'] = 'start';
|
|
43
44
|
break;
|
|
44
45
|
}
|
|
45
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findConverterForNode.js","names":["findConverterForNode","converters","disableIndent","disableTextAlign","node","unknownConverter","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","style","Array","isArray","includes","format","indent","Number","providedCSSString","key","Object","keys","providedStyleTag","length"],"sources":["../../../../../src/features/converters/lexicalToHtml/shared/findConverterForNode.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js'\nimport type { HTMLConverterAsync, HTMLConvertersAsync } from '../async/types.js'\nimport type { HTMLConverter, HTMLConverters } from '../sync/types.js'\nimport type { ProvidedCSS } from './types.js'\n\nexport function findConverterForNode<\n TConverters extends HTMLConverters | HTMLConvertersAsync,\n TConverter extends HTMLConverter | HTMLConverterAsync,\n>({\n converters,\n disableIndent,\n disableTextAlign,\n node,\n unknownConverter,\n}: {\n converters: TConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n node: SerializedLexicalNode\n unknownConverter: TConverter\n}): {\n converterForNode: TConverter | undefined\n providedCSSString: string\n providedStyleTag: string\n} {\n let converterForNode: TConverter | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[\n (node as SerializedBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode = converters?.inlineBlocks?.[\n (node as SerializedInlineBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as TConverter\n }\n\n const style: ProvidedCSS = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style['text-align'] = 'center'\n break\n case 'end':\n style['text-align'] = '
|
|
1
|
+
{"version":3,"file":"findConverterForNode.js","names":["findConverterForNode","converters","disableIndent","disableTextAlign","node","unknownConverter","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","style","Array","isArray","includes","format","indent","Number","providedCSSString","key","Object","keys","providedStyleTag","length"],"sources":["../../../../../src/features/converters/lexicalToHtml/shared/findConverterForNode.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js'\nimport type { HTMLConverterAsync, HTMLConvertersAsync } from '../async/types.js'\nimport type { HTMLConverter, HTMLConverters } from '../sync/types.js'\nimport type { ProvidedCSS } from './types.js'\n\nexport function findConverterForNode<\n TConverters extends HTMLConverters | HTMLConvertersAsync,\n TConverter extends HTMLConverter | HTMLConverterAsync,\n>({\n converters,\n disableIndent,\n disableTextAlign,\n node,\n unknownConverter,\n}: {\n converters: TConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n node: SerializedLexicalNode\n unknownConverter: TConverter\n}): {\n converterForNode: TConverter | undefined\n providedCSSString: string\n providedStyleTag: string\n} {\n let converterForNode: TConverter | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[\n (node as SerializedBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode = converters?.inlineBlocks?.[\n (node as SerializedInlineBlockNode)?.fields?.blockType\n ] as TConverter\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => HTML converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as TConverter\n }\n\n const style: ProvidedCSS = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style['text-align'] = 'center'\n break\n case 'end':\n style['text-align'] = 'end'\n break\n case 'justify':\n style['text-align'] = 'justify'\n break\n case 'left':\n style['text-align'] = 'left'\n break\n case 'right':\n style['text-align'] = 'right'\n break\n case 'start':\n style['text-align'] = 'start'\n break\n }\n }\n }\n\n if (!disableIndent && (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style['padding-inline-start'] = `${Number(node.indent) * 40}px`\n }\n }\n\n let providedCSSString: string = ''\n for (const key of Object.keys(style)) {\n // @ts-expect-error we're iterating over the keys of the object\n providedCSSString += `${key}: ${style[key]};`\n }\n const providedStyleTag = providedCSSString?.length ? ` style=\"${providedCSSString}\"` : ''\n\n return {\n converterForNode: converterForNode ?? unknownConverter,\n provid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AAK,CAAC,aAAa,GAAG;UACtB;QACF,KAAK;UACHA,KAAK,CAAC,aAAa,GAAG;UACtB;QACF,KAAK;UACHA,KAAK,CAAC,aAAa,GAAG;UACtB;MACJ;IACF;EACF;EAEA,IAAI,CAACZ,aAAA,KAAkB,CAACa,KAAA,CAAMC,OAAO,CAACd,aAAA,KAAkB,CAACA,aAAA,EAAee,QAAA,CAASb,IAAA,CAAKG,IAAI,IAAI;IAC5F,IAAI,YAAYH,IAAA,IAAQA,IAAA,CAAKe,MAAM,IAAIf,IAAA,CAAKG,IAAI,KAAK,YAAY;MAC/D;MACA;MACA;MACA;MACAO,KAAK,CAAC,uBAAuB,GAAG,GAAGM,MAAA,CAAOhB,IAAA,CAAKe,MAAM,IAAI,MAAM;IACjE;EACF;EAEA,IAAIE,iBAAA,GAA4B;EAChC,KAAK,MAAMC,GAAA,IAAOC,MAAA,CAAOC,IAAI,CAACV,KAAA,GAAQ;IACpC;IACAO,iBAAA,IAAqB,GAAGC,GAAA,KAAQR,KAAK,CAACQ,GAAA,CAAI,GAAG;EAC/C;EACA,MAAMG,gBAAA,GAAmBJ,iBAAA,EAAmBK,MAAA,GAAS,WAAWL,iBAAA,GAAoB,GAAG;EAEvF,OAAO;IACLf,gBAAA,EAAkBA,gBAAA,IAAoBD,gBAAA;IACtCgB,iBAAA;IACAI;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","
|
|
1
|
+
{"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","HeadingHTMLConverter","heading","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/heading.ts"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nimport { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js'\n\nexport const HeadingHTMLConverter: HTMLConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const tag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return `<${tag}${providedStyleTag}>${children}</${tag}>`\n },\n}\n"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,oBAAA,GAA8D;EACzEC,OAAA,EAASA,CAAC;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IAC/C,MAAMC,QAAA,GAAWF,WAAA,CAAY;MAC3BG,KAAA,EAAOJ,IAAA,CAAKG;IACd,GAAGE,IAAI,CAAC;IAER,MAAMC,GAAA,GAAMT,oBAAA,CAAqBU,GAAG,CAACP,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAE5D,OAAO,IAAIA,GAAA,GAAMJ,gBAAA,IAAoBC,QAAA,KAAaG,GAAA,GAAM;EAC1D;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAMjD,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,sBAAsB,GAAG,kBAAkB,CA4CzF,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import escapeHTML from 'escape-html';
|
|
1
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
-
|
|
3
|
+
import { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js';
|
|
3
4
|
const ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number']);
|
|
4
5
|
export const ListHTMLConverter = {
|
|
5
6
|
list: ({
|
|
@@ -32,7 +33,7 @@ export const ListHTMLConverter = {
|
|
|
32
33
|
role="checkbox"
|
|
33
34
|
style="list-style-type: none;${providedCSSString}"
|
|
34
35
|
tabIndex="-1"
|
|
35
|
-
value="${node.value}"
|
|
36
|
+
value="${escapeHTML(String(node.value))}"
|
|
36
37
|
>
|
|
37
38
|
${hasSubLists ? children : `<input${node.checked ? ' checked' : ''} id="${uuid}" readOnly="true" type="checkbox" />
|
|
38
39
|
<label htmlFor="${uuid}">${children}</label>
|
|
@@ -42,7 +43,7 @@ export const ListHTMLConverter = {
|
|
|
42
43
|
return `<li
|
|
43
44
|
class="${hasSubLists ? 'nestedListItem' : ''}"
|
|
44
45
|
style="${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}"
|
|
45
|
-
value="${node.value}"
|
|
46
|
+
value="${escapeHTML(String(node.value))}"
|
|
46
47
|
>${children}</li>`;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":["v4","uuidv4","ALLOWED_LIST_TAGS","
|
|
1
|
+
{"version":3,"file":"list.js","names":["escapeHTML","v4","uuidv4","ALLOWED_LIST_TAGS","ALLOWED_LIST_TYPES","Set","ListHTMLConverter","list","node","nodesToHTML","providedStyleTag","children","nodes","join","tag","has","listType","listitem","parent","providedCSSString","hasSubLists","some","child","type","uuid","checked","String","value"],"sources":["../../../../../../src/features/converters/lexicalToHtml/sync/converters/list.ts"],"sourcesContent":["import escapeHTML from 'escape-html'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { HTMLConverters } from '../types.js'\n\nimport { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js'\n\nconst ALLOWED_LIST_TYPES = new Set(['bullet', 'check', 'number'])\n\nexport const ListHTMLConverter: HTMLConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToHTML, providedStyleTag }) => {\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n const tag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n const listType = ALLOWED_LIST_TYPES.has(node.listType) ? node.listType : 'bullet'\n\n return `<${tag}${providedStyleTag} class=\"list-${listType}\">${children}</${tag}>`\n },\n listitem: ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToHTML({\n nodes: node.children,\n }).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n return `<li\n aria-checked=\"${node.checked ? 'true' : 'false'}\"\n class=\"list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}\"\n role=\"checkbox\"\n style=\"list-style-type: none;${providedCSSString}\"\n tabIndex=\"-1\"\n value=\"${escapeHTML(String(node.value))}\"\n >\n ${\n hasSubLists\n ? children\n : `<input${node.checked ? ' checked' : ''} id=\"${uuid}\" readOnly=\"true\" type=\"checkbox\" />\n <label htmlFor=\"${uuid}\">${children}</label>\n <br />`\n }\n </li>`\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${escapeHTML(String(node.value))}\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,EAAA,IAAMC,MAAM,QAAQ;AAK7B,SAASC,iBAAiB,QAAQ;AAElC,MAAMC,kBAAA,GAAqB,IAAIC,GAAA,CAAI,CAAC,UAAU,SAAS,SAAS;AAEhE,OAAO,MAAMC,iBAAA,GAAiF;EAC5FC,IAAA,EAAMA,CAAC;IAAEC,IAAI;IAAE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D,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DnB,UAAA,CAAW0B,MAAA,CAAOlB,IAAA,CAAKmB,KAAK;WACpChB,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,qBAAqB,CAUpE,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js';
|
|
2
3
|
export const HeadingJSXConverter = {
|
|
3
4
|
heading: ({
|
|
4
5
|
node,
|
|
@@ -7,7 +8,7 @@ export const HeadingJSXConverter = {
|
|
|
7
8
|
const children = nodesToJSX({
|
|
8
9
|
nodes: node.children
|
|
9
10
|
});
|
|
10
|
-
const NodeTag = node.tag;
|
|
11
|
+
const NodeTag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1';
|
|
11
12
|
return /*#__PURE__*/_jsx(NodeTag, {
|
|
12
13
|
children: children
|
|
13
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","names":["HeadingJSXConverter","heading","node","nodesToJSX","children","nodes","NodeTag","tag","_jsx"],"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/heading.tsx"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const HeadingJSXConverter: JSXConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = node.tag\n\n return <NodeTag>{children}</NodeTag>\n },\n}\n"],"mappings":";AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"heading.js","names":["ALLOWED_HEADING_TAGS","HeadingJSXConverter","heading","node","nodesToJSX","children","nodes","NodeTag","has","tag","_jsx"],"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/heading.tsx"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../types/nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nimport { ALLOWED_HEADING_TAGS } from '../../../../heading/constants.js'\n\nexport const HeadingJSXConverter: JSXConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = ALLOWED_HEADING_TAGS.has(node.tag) ? node.tag : 'h1'\n\n return <NodeTag>{children}</NodeTag>\n },\n}\n"],"mappings":";AAGA,SAASA,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,mBAAA,GAA4D;EACvEC,OAAA,EAASA,CAAC;IAAEC,IAAI;IAAEC;EAAU,CAAE;IAC5B,MAAMC,QAAA,GAAWD,UAAA,CAAW;MAC1BE,KAAA,EAAOH,IAAA,CAAKE;IACd;IAEA,MAAME,OAAA,GAAUP,oBAAA,CAAqBQ,GAAG,CAACL,IAAA,CAAKM,GAAG,IAAIN,IAAA,CAAKM,GAAG,GAAG;IAEhE,oBAAOC,IAAA,CAACH,OAAA;gBAASF;;EACnB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AACnG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAIhD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,sBAAsB,GAAG,kBAAkB,CAqDvF,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js';
|
|
3
4
|
export const ListJSXConverter = {
|
|
4
5
|
list: ({
|
|
5
6
|
node,
|
|
@@ -8,7 +9,7 @@ export const ListJSXConverter = {
|
|
|
8
9
|
const children = nodesToJSX({
|
|
9
10
|
nodes: node.children
|
|
10
11
|
});
|
|
11
|
-
const NodeTag = node.tag;
|
|
12
|
+
const NodeTag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul';
|
|
12
13
|
return /*#__PURE__*/_jsx(NodeTag, {
|
|
13
14
|
className: `list-${node?.listType}`,
|
|
14
15
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":["v4","uuidv4","ListJSXConverter","list","node","nodesToJSX","children","nodes","NodeTag","tag","_jsx","className","listType","listitem","parent","hasSubLists","some","child","type","uuid","checked","role","style","listStyleType","tabIndex","value","_jsxs","_Fragment","id","readOnly","htmlFor","undefined"],"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/list.tsx"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const ListJSXConverter: JSXConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = node.tag\n\n return <NodeTag className={`list-${node?.listType}`}>{children}</NodeTag>\n },\n listitem: ({ node, nodesToJSX, parent }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return (\n <li\n aria-checked={node.checked ? 'true' : 'false'}\n className={`list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n style={{ listStyleType: 'none' }}\n tabIndex={-1}\n value={node?.value}\n >\n {hasSubLists ? (\n children\n ) : (\n <>\n <input checked={node.checked} id={uuid} readOnly={true} type=\"checkbox\" />\n <label htmlFor={uuid}>{children}</label>\n <br />\n </>\n )}\n </li>\n )\n } else {\n return (\n <li\n className={`${hasSubLists ? 'nestedListItem' : ''}`}\n style={hasSubLists ? { listStyleType: 'none' } : undefined}\n value={node?.value}\n >\n {children}\n </li>\n )\n }\n },\n}\n"],"mappings":";AAAA,SAASA,EAAA,IAAMC,MAAM,QAAQ;AAK7B,OAAO,MAAMC,gBAAA,GAA+E;EAC1FC,IAAA,EAAMA,CAAC;IAAEC,IAAI;IAAEC;EAAU,CAAE;IACzB,MAAMC,QAAA,GAAWD,UAAA,CAAW;MAC1BE,KAAA,EAAOH,IAAA,CAAKE;IACd;IAEA,MAAME,OAAA,
|
|
1
|
+
{"version":3,"file":"list.js","names":["v4","uuidv4","ALLOWED_LIST_TAGS","ListJSXConverter","list","node","nodesToJSX","children","nodes","NodeTag","has","tag","_jsx","className","listType","listitem","parent","hasSubLists","some","child","type","uuid","checked","role","style","listStyleType","tabIndex","value","_jsxs","_Fragment","id","readOnly","htmlFor","undefined"],"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/list.tsx"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../types/nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nimport { ALLOWED_LIST_TAGS } from '../../../../lists/shared/constants.js'\n\nexport const ListJSXConverter: JSXConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = ALLOWED_LIST_TAGS.has(node.tag) ? node.tag : 'ul'\n\n return <NodeTag className={`list-${node?.listType}`}>{children}</NodeTag>\n },\n listitem: ({ node, nodesToJSX, parent }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return (\n <li\n aria-checked={node.checked ? 'true' : 'false'}\n className={`list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n style={{ listStyleType: 'none' }}\n tabIndex={-1}\n value={node?.value}\n >\n {hasSubLists ? (\n children\n ) : (\n <>\n <input checked={node.checked} id={uuid} readOnly={true} type=\"checkbox\" />\n <label htmlFor={uuid}>{children}</label>\n <br />\n </>\n )}\n </li>\n )\n } else {\n return (\n <li\n className={`${hasSubLists ? 'nestedListItem' : ''}`}\n style={hasSubLists ? { listStyleType: 'none' } : undefined}\n value={node?.value}\n >\n {children}\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jB,IAAA,CAAKiB,OAAO;YAAEQ,EAAA,EAAIT,IAAA;YAAMU,QAAA,EAAU;YAAMX,IAAA,EAAK;2BAC7DR,IAAA,CAAC;YAAMoB,OAAA,EAASX,IAAA;sBAAOd;2BACvBK,IAAA,CAAC;;;IAKX,OAAO;MACL,oBACEA,IAAA,CAAC;QACCC,SAAA,EAAW,GAAGI,WAAA,GAAc,mBAAmB,IAAI;QACnDO,KAAA,EAAOP,WAAA,GAAc;UAAEQ,aAAA,EAAe;QAAO,IAAIQ,SAAA;QACjDN,KAAA,EAAOtB,IAAA,EAAMsB,KAAA;kBAEZpB;;IAGP;EACF;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payloadPopulateFn.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/utilities/payloadPopulateFn.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"payloadPopulateFn.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/utilities/payloadPopulateFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAA;AAEnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAIrE,eAAO,MAAM,oBAAoB,EAAE,CACjC,IAAI,EAAE;IACJ,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,WAAW,CAAA;IAEpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,CACA;IACE;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAA;CACZ,GACD;IACE;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAA;IACf;;;OAGG;IACH,GAAG,EAAE,cAAc,CAAA;CACpB,CACJ,KACE,OAAO,CAAC,cAAc,CAyC1B,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPayloadRequest } from 'payload';
|
|
2
2
|
import { populate } from '../../../populateGraphQL/populate.js';
|
|
3
3
|
export const getPayloadPopulateFn = async ({
|
|
4
4
|
currentDepth,
|
|
@@ -11,7 +11,9 @@ export const getPayloadPopulateFn = async ({
|
|
|
11
11
|
}) => {
|
|
12
12
|
let reqToUse = req;
|
|
13
13
|
if (req === undefined && payload) {
|
|
14
|
-
reqToUse = await
|
|
14
|
+
reqToUse = await createPayloadRequest({
|
|
15
|
+
payload
|
|
16
|
+
});
|
|
15
17
|
}
|
|
16
18
|
if (!reqToUse) {
|
|
17
19
|
throw new Error('No req or payload provided');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payloadPopulateFn.js","names":["
|
|
1
|
+
{"version":3,"file":"payloadPopulateFn.js","names":["createPayloadRequest","populate","getPayloadPopulateFn","currentDepth","depth","draft","overrideAccess","payload","req","showHiddenFields","reqToUse","undefined","Error","populateFn","id","collectionSlug","select","dataContainer","data","key","value"],"sources":["../../../../src/features/converters/utilities/payloadPopulateFn.ts"],"sourcesContent":["import { createPayloadRequest, type Payload, type PayloadRequest, type TypedLocale } from 'payload'\n\nimport type { HTMLPopulateFn } from '../lexicalToHtml/async/types.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\n\nexport const getPayloadPopulateFn: (\n args: {\n currentDepth: number\n depth: number\n draft?: boolean\n locale?: TypedLocale\n\n overrideAccess?: boolean\n showHiddenFields?: boolean\n } & (\n | {\n /**\n * This payload property will only be used if req is undefined. If localization is enabled, you must pass `req` instead.\n */\n payload: Payload\n /**\n * When the converter is called, req CAN be passed in depending on where it's run.\n * If this is undefined and config is passed through, lexical will create a new req object for you.\n */\n req?: never\n }\n | {\n /**\n * This payload property will only be used if req is undefined. If localization is enabled, you must pass `req` instead.\n */\n payload?: never\n /**\n * When the converter is called, req CAN be passed in depending on where it's run.\n * If this is undefined and config is passed through, lexical will create a new req object for you.\n */\n req: PayloadRequest\n }\n ),\n) => Promise<HTMLPopulateFn> = async ({\n currentDepth,\n depth,\n draft,\n overrideAccess,\n payload,\n req,\n showHiddenFields,\n}) => {\n let reqToUse: PayloadRequest | undefined = req\n if (req === undefined && payload) {\n reqToUse = await createPayloadRequest({ payload })\n }\n\n if (!reqToUse) {\n throw new Error('No req or payload provided')\n }\n\n const populateFn: HTMLPopulateFn = async ({ id, collectionSlug, select }) => {\n const dataContainer: {\n value?: any\n } = {}\n\n await populate({\n id,\n collectionSlug,\n currentDepth,\n data: dataContainer,\n depth,\n draft: draft ?? false,\n key: 'value',\n overrideAccess: overrideAccess ?? true,\n req: reqToUse,\n select,\n showHiddenFields: showHiddenFields ?? false,\n })\n\n return dataContainer.value\n }\n\n return populateFn\n}\n"],"mappings":"AAAA,SAASA,oBAAoB,QAA6D;AAI1F,SAASC,QAAQ,QAAQ;AAEzB,OAAO,MAAMC,oBAAA,GAiCkB,MAAAA,CAAO;EACpCC,YAAY;EACZC,KAAK;EACLC,KAAK;EACLC,cAAc;EACdC,OAAO;EACPC,GAAG;EACHC;AAAgB,CACjB;EACC,IAAIC,QAAA,GAAuCF,GAAA;EAC3C,IAAIA,GAAA,KAAQG,SAAA,IAAaJ,OAAA,EAAS;IAChCG,QAAA,GAAW,MAAMV,oBAAA,CAAqB;MAAEO;IAAQ;EAClD;EAEA,IAAI,CAACG,QAAA,EAAU;IACb,MAAM,IAAIE,KAAA,CAAM;EAClB;EAEA,MAAMC,UAAA,GAA6B,MAAAA,CAAO;IAAEC,EAAE;IAAEC,cAAc;IAAEC;EAAM,CAAE;IACtE,MAAMC,aAAA,GAEF,CAAC;IAEL,MAAMhB,QAAA,CAAS;MACba,EAAA;MACAC,cAAA;MACAZ,YAAA;MACAe,IAAA,EAAMD,aAAA;MACNb,KAAA;MACAC,KAAA,EAAOA,KAAA,IAAS;MAChBc,GAAA,EAAK;MACLb,cAAA,EAAgBA,cAAA,IAAkB;MAClCE,GAAA,EAAKE,QAAA;MACLM,MAAA;MACAP,gBAAA,EAAkBA,gBAAA,IAAoB;IACxC;IAEA,OAAOQ,aAAA,CAAcG,KAAK;EAC5B;EAEA,OAAOP,UAAA;AACT","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/features/heading/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,aAAgD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","names":["ALLOWED_HEADING_TAGS","Set"],"sources":["../../../src/features/heading/constants.ts"],"sourcesContent":["export const ALLOWED_HEADING_TAGS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6'])\n"],"mappings":"AAAA,OAAO,MAAMA,oBAAA,GAAuB,IAAIC,GAAA,CAAI,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM,KAAK","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/heading/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/heading/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAWxD,YAAY,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAExD,MAAM,MAAM,mBAAmB,GAAG;IAChC,mBAAmB,CAAC,EAAE,cAAc,EAAE,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,cAAc,6HA+BzB,CAAA"}
|
|
@@ -4,6 +4,7 @@ import { createNode } from '../../typeUtilities.js';
|
|
|
4
4
|
import { PAYLOAD_HEADING } from '../markdownTransformer.js';
|
|
5
5
|
import { i18n } from './i18n.js';
|
|
6
6
|
import { createHeadingJSONSchema } from './schema.js';
|
|
7
|
+
import { headingValidation } from './validate.js';
|
|
7
8
|
export const HeadingFeature = createServerFeature({
|
|
8
9
|
feature: ({
|
|
9
10
|
props
|
|
@@ -22,7 +23,10 @@ export const HeadingFeature = createServerFeature({
|
|
|
22
23
|
markdownTransformers: enabledHeadingSizes.length > 0 ? [PAYLOAD_HEADING(enabledHeadingSizes)] : [],
|
|
23
24
|
nodes: [createNode({
|
|
24
25
|
jsonSchema: createHeadingJSONSchema(enabledHeadingSizes),
|
|
25
|
-
node: HeadingNode
|
|
26
|
+
node: HeadingNode,
|
|
27
|
+
validations: [headingValidation({
|
|
28
|
+
enabledHeadingSizes
|
|
29
|
+
})]
|
|
26
30
|
})],
|
|
27
31
|
sanitizedServerFeatureProps: props
|
|
28
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["HeadingNode","createServerFeature","createNode","PAYLOAD_HEADING","i18n","createHeadingJSONSchema","HeadingFeature","feature","props","enabledHeadingSizes","sort","ClientFeature","clientFeatureProps","markdownTransformers","length","nodes","jsonSchema","node","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/heading/server/index.ts"],"sourcesContent":["import type { HeadingTagType } from '@lexical/rich-text'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { PAYLOAD_HEADING } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\nimport { createHeadingJSONSchema } from './schema.js'\n\nexport type { SerializedHeadingNode } from './schema.js'\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n enabledHeadingSizes.sort()\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#HeadingFeatureClient',\n clientFeatureProps: props,\n i18n,\n markdownTransformers:\n enabledHeadingSizes.length > 0 ? [PAYLOAD_HEADING(enabledHeadingSizes)] : [],\n nodes: [\n createNode({\n jsonSchema: createHeadingJSONSchema(enabledHeadingSizes),\n node: HeadingNode,\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"mappings":"AAEA,SAASA,WAAW,QAAQ;AAE5B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,eAAe,QAAQ;AAChC,SAASC,IAAI,QAAQ;AACrB,SAASC,uBAAuB,QAAQ;
|
|
1
|
+
{"version":3,"file":"index.js","names":["HeadingNode","createServerFeature","createNode","PAYLOAD_HEADING","i18n","createHeadingJSONSchema","headingValidation","HeadingFeature","feature","props","enabledHeadingSizes","sort","ClientFeature","clientFeatureProps","markdownTransformers","length","nodes","jsonSchema","node","validations","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/heading/server/index.ts"],"sourcesContent":["import type { HeadingTagType } from '@lexical/rich-text'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { PAYLOAD_HEADING } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\nimport { createHeadingJSONSchema } from './schema.js'\nimport { headingValidation } from './validate.js'\n\nexport type { SerializedHeadingNode } from './schema.js'\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n enabledHeadingSizes.sort()\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#HeadingFeatureClient',\n clientFeatureProps: props,\n i18n,\n markdownTransformers:\n enabledHeadingSizes.length > 0 ? [PAYLOAD_HEADING(enabledHeadingSizes)] : [],\n nodes: [\n createNode({\n jsonSchema: createHeadingJSONSchema(enabledHeadingSizes),\n node: HeadingNode,\n validations: [headingValidation({ enabledHeadingSizes })],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"mappings":"AAEA,SAASA,WAAW,QAAQ;AAE5B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,eAAe,QAAQ;AAChC,SAASC,IAAI,QAAQ;AACrB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,iBAAiB,QAAQ;AAQlC,OAAO,MAAMC,cAAA,GAAiBN,mBAAA,CAI5B;EACAO,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ,CAAC;IACX;IAEA,MAAM;MAAEC,mBAAA,GAAsB,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM;IAAK,CAAE,GAAGD,KAAA;IAEvEC,mBAAA,CAAoBC,IAAI;IAExB,OAAO;MACLC,aAAA,EAAe;MACfC,kBAAA,EAAoBJ,KAAA;MACpBL,IAAA;MACAU,oBAAA,EACEJ,mBAAA,CAAoBK,MAAM,GAAG,IAAI,CAACZ,eAAA,CAAgBO,mBAAA,EAAqB,GAAG,EAAE;MAC9EM,KAAA,EAAO,CACLd,UAAA,CAAW;QACTe,UAAA,EAAYZ,uBAAA,CAAwBK,mBAAA;QACpCQ,IAAA,EAAMlB,WAAA;QACNmB,WAAA,EAAa,CAACb,iBAAA,CAAkB;UAAEI;QAAoB;MACxD,GACD;MACDU,2BAAA,EAA6BX;IAC/B;EACF;EACAY,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HeadingTagType, SerializedHeadingNode } from '@lexical/rich-text';
|
|
2
|
+
import type { NodeValidation } from '../../typesServer.js';
|
|
3
|
+
export declare const headingValidation: ({ enabledHeadingSizes, }: {
|
|
4
|
+
enabledHeadingSizes: HeadingTagType[];
|
|
5
|
+
}) => NodeValidation<SerializedHeadingNode>;
|
|
6
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/heading/server/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAE/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAI1D,eAAO,MAAM,iBAAiB,6BAE3B;IACD,mBAAmB,EAAE,cAAc,EAAE,CAAA;CACtC,KAAG,cAAc,CAAC,qBAAqB,CAcvC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ALLOWED_HEADING_TAGS } from '../constants.js';
|
|
2
|
+
export const headingValidation = ({
|
|
3
|
+
enabledHeadingSizes
|
|
4
|
+
}) => {
|
|
5
|
+
const allowedHeadingTags = new Set(enabledHeadingSizes.filter(tag => ALLOWED_HEADING_TAGS.has(tag)));
|
|
6
|
+
return ({
|
|
7
|
+
node
|
|
8
|
+
}) => {
|
|
9
|
+
if (allowedHeadingTags.has(node.tag)) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return allowedHeadingTags.size > 0 ? `Heading tag must be one of ${Array.from(allowedHeadingTags).join(', ')}.` : 'Headings are not enabled.';
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","names":["ALLOWED_HEADING_TAGS","headingValidation","enabledHeadingSizes","allowedHeadingTags","Set","filter","tag","has","node","size","Array","from","join"],"sources":["../../../../src/features/heading/server/validate.ts"],"sourcesContent":["import type { HeadingTagType, SerializedHeadingNode } from '@lexical/rich-text'\n\nimport type { NodeValidation } from '../../typesServer.js'\n\nimport { ALLOWED_HEADING_TAGS } from '../constants.js'\n\nexport const headingValidation = ({\n enabledHeadingSizes,\n}: {\n enabledHeadingSizes: HeadingTagType[]\n}): NodeValidation<SerializedHeadingNode> => {\n const allowedHeadingTags = new Set(\n enabledHeadingSizes.filter((tag) => ALLOWED_HEADING_TAGS.has(tag)),\n )\n\n return ({ node }) => {\n if (allowedHeadingTags.has(node.tag)) {\n return true\n }\n\n return allowedHeadingTags.size > 0\n ? `Heading tag must be one of ${Array.from(allowedHeadingTags).join(', ')}.`\n : 'Headings are not enabled.'\n }\n}\n"],"mappings":"AAIA,SAASA,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,iBAAA,GAAoBA,CAAC;EAChCC;AAAmB,CAGpB;EACC,MAAMC,kBAAA,GAAqB,IAAIC,GAAA,CAC7BF,mBAAA,CAAoBG,MAAM,CAAEC,GAAA,IAAQN,oBAAA,CAAqBO,GAAG,CAACD,GAAA;EAG/D,OAAO,CAAC;IAAEE;EAAI,CAAE;IACd,IAAIL,kBAAA,CAAmBI,GAAG,CAACC,IAAA,CAAKF,GAAG,GAAG;MACpC,OAAO;IACT;IAEA,OAAOH,kBAAA,CAAmBM,IAAI,GAAG,IAC7B,8BAA8BC,KAAA,CAAMC,IAAI,CAACR,kBAAA,EAAoBS,IAAI,CAAC,QAAQ,GAC1E;EACN;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndentPlugin.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IndentPlugin.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC,kBAAkB,CAmO5D,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
3
|
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin';
|
|
4
4
|
import { $findMatchingParent, mergeRegister } from '@lexical/utils';
|
|
5
|
-
import { $getSelection, $isElementNode, $isRangeSelection, COMMAND_PRIORITY_LOW, INDENT_CONTENT_COMMAND, KEY_TAB_COMMAND, OUTDENT_CONTENT_COMMAND, TabNode } from 'lexical';
|
|
5
|
+
import { $addUpdateTag, $getSelection, $isElementNode, $isRangeSelection, $isRootOrShadowRoot, BLUR_COMMAND, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, FOCUS_COMMAND, INDENT_CONTENT_COMMAND, KEY_ESCAPE_COMMAND, KEY_TAB_COMMAND, OUTDENT_CONTENT_COMMAND, SELECTION_CHANGE_COMMAND, SKIP_DOM_SELECTION_TAG, TabNode } from 'lexical';
|
|
6
6
|
import { useEffect } from 'react';
|
|
7
7
|
export const IndentPlugin = ({
|
|
8
8
|
clientProps
|
|
@@ -12,6 +12,127 @@ export const IndentPlugin = ({
|
|
|
12
12
|
disabledNodes,
|
|
13
13
|
disableTabNode
|
|
14
14
|
} = clientProps;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
let canTabOut = false;
|
|
17
|
+
let hasTabbedOut = false;
|
|
18
|
+
const resetTabExit = () => {
|
|
19
|
+
canTabOut = false;
|
|
20
|
+
};
|
|
21
|
+
let restoreTabIndexes;
|
|
22
|
+
let restoreTabTimer;
|
|
23
|
+
let rootEvents;
|
|
24
|
+
function resetKeyboardExit() {
|
|
25
|
+
resetTabExit();
|
|
26
|
+
hasTabbedOut = false;
|
|
27
|
+
}
|
|
28
|
+
function handleKeyDownCapture(event) {
|
|
29
|
+
if (event.key !== 'Tab' || !canTabOut) {
|
|
30
|
+
if (!['Escape', 'Shift', 'Tab'].includes(event.key)) {
|
|
31
|
+
resetTabExit();
|
|
32
|
+
}
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const root = editor.getRootElement();
|
|
36
|
+
if (!root) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
resetTabExit();
|
|
40
|
+
hasTabbedOut = true;
|
|
41
|
+
event.stopPropagation();
|
|
42
|
+
restoreTabIndexes?.();
|
|
43
|
+
clearTimeout(restoreTabTimer);
|
|
44
|
+
const container = root.closest('.rich-text-lexical') ?? root;
|
|
45
|
+
const tabStops = new Set([root, ...container.querySelectorAll('[tabindex], [contenteditable="true"], a[href], button, input, select, textarea, summary, iframe, audio[controls], video[controls]')]);
|
|
46
|
+
const tabIndexes = new Map();
|
|
47
|
+
// Let the browser take Tab outside the entire editor, including decorator controls.
|
|
48
|
+
// Restore its tab stops after the native focus move so ordinary Tab navigation is unchanged.
|
|
49
|
+
for (const element of tabStops) {
|
|
50
|
+
tabIndexes.set(element, element.getAttribute('tabindex'));
|
|
51
|
+
element.setAttribute('tabindex', '-1');
|
|
52
|
+
}
|
|
53
|
+
restoreTabIndexes = () => {
|
|
54
|
+
for (const [element, tabIndex] of tabIndexes) {
|
|
55
|
+
if (tabIndex === null) {
|
|
56
|
+
element.removeAttribute('tabindex');
|
|
57
|
+
} else {
|
|
58
|
+
element.setAttribute('tabindex', tabIndex);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
restoreTabIndexes = undefined;
|
|
62
|
+
};
|
|
63
|
+
restoreTabTimer = setTimeout(() => restoreTabIndexes?.(), 0);
|
|
64
|
+
editor.update(() => $addUpdateTag(SKIP_DOM_SELECTION_TAG));
|
|
65
|
+
}
|
|
66
|
+
function handleKeyDown(event) {
|
|
67
|
+
if (event.key === 'Escape' && !event.defaultPrevented && editor.isEditable()) {
|
|
68
|
+
// A second press can dismiss the containing drawer; holding Escape must not.
|
|
69
|
+
if (canTabOut && !event.repeat) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Menus handle Escape first. This also reaches inputs inside decorator blocks.
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
canTabOut = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const unregisterRootListener = editor.registerRootListener(root => {
|
|
79
|
+
rootEvents?.abort();
|
|
80
|
+
rootEvents = new AbortController();
|
|
81
|
+
const {
|
|
82
|
+
signal
|
|
83
|
+
} = rootEvents;
|
|
84
|
+
/* eslint-disable @eslint-react/web-api/no-leaked-event-listener -- Aborted on root replacement and effect cleanup. */
|
|
85
|
+
root?.addEventListener('pointerdown', resetKeyboardExit, {
|
|
86
|
+
signal
|
|
87
|
+
});
|
|
88
|
+
root?.addEventListener('keydown', handleKeyDownCapture, {
|
|
89
|
+
capture: true,
|
|
90
|
+
signal
|
|
91
|
+
});
|
|
92
|
+
root?.addEventListener('keydown', handleKeyDown, {
|
|
93
|
+
signal
|
|
94
|
+
});
|
|
95
|
+
/* eslint-enable @eslint-react/web-api/no-leaked-event-listener */
|
|
96
|
+
});
|
|
97
|
+
const unregisterCommands = mergeRegister(editor.registerCommand(KEY_ESCAPE_COMMAND, event => {
|
|
98
|
+
if (!editor.isEditable()) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
handleKeyDown(event);
|
|
102
|
+
return true;
|
|
103
|
+
}, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_TAB_COMMAND, () => {
|
|
104
|
+
const selection = $getSelection();
|
|
105
|
+
const isRootSelection = $isRangeSelection(selection) && selection.isCollapsed() && $isRootOrShadowRoot(selection.anchor.getNode());
|
|
106
|
+
// A root selection between decorator blocks has no text block to indent.
|
|
107
|
+
if (!isRootSelection) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
resetTabExit();
|
|
111
|
+
hasTabbedOut = true;
|
|
112
|
+
$addUpdateTag(SKIP_DOM_SELECTION_TAG);
|
|
113
|
+
return true;
|
|
114
|
+
}, COMMAND_PRIORITY_HIGH), editor.registerCommand(BLUR_COMMAND, () => {
|
|
115
|
+
resetTabExit();
|
|
116
|
+
return false;
|
|
117
|
+
}, COMMAND_PRIORITY_HIGH), editor.registerCommand(FOCUS_COMMAND, () => {
|
|
118
|
+
resetKeyboardExit();
|
|
119
|
+
return false;
|
|
120
|
+
}, COMMAND_PRIORITY_HIGH), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
|
|
121
|
+
const root = editor.getRootElement();
|
|
122
|
+
// A delayed selectionchange must not reclaim focus after native Tab navigation.
|
|
123
|
+
if (hasTabbedOut && root?.ownerDocument.activeElement !== root) {
|
|
124
|
+
$addUpdateTag(SKIP_DOM_SELECTION_TAG);
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
}, COMMAND_PRIORITY_HIGH));
|
|
128
|
+
return () => {
|
|
129
|
+
unregisterCommands();
|
|
130
|
+
unregisterRootListener();
|
|
131
|
+
rootEvents?.abort();
|
|
132
|
+
clearTimeout(restoreTabTimer);
|
|
133
|
+
restoreTabIndexes?.();
|
|
134
|
+
};
|
|
135
|
+
}, [editor]);
|
|
15
136
|
useEffect(() => {
|
|
16
137
|
if (!editor || !disabledNodes?.length) {
|
|
17
138
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IndentPlugin.js","names":["useLexicalComposerContext","TabIndentationPlugin","$findMatchingParent","mergeRegister","$getSelection","$isElementNode","$isRangeSelection","COMMAND_PRIORITY_LOW","INDENT_CONTENT_COMMAND","KEY_TAB_COMMAND","OUTDENT_CONTENT_COMMAND","TabNode","useEffect","IndentPlugin","clientProps","editor","disabledNodes","disableTabNode","length","registerCommand","$handleIndentAndOutdent","block","includes","getType","indent","getIndent","setIndent","registerUpdateListener","dirtyElements","editorState","update","nodeKey","node","_nodeMap","get","currentIndent","event","preventDefault","dispatchCommand","shiftKey","undefined","registerNodeTransform","remove","_jsx","indentOrOutdent","selection","alreadyHandled","Set","nodes","getNodes","i","key","getKey","has","parentBlock","parentNode","isInline","parentKey","canIndent","add","size"],"sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"sourcesContent":["import type { ElementNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isElementNode,\n $isRangeSelection,\n COMMAND_PRIORITY_LOW,\n INDENT_CONTENT_COMMAND,\n KEY_TAB_COMMAND,\n OUTDENT_CONTENT_COMMAND,\n TabNode,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../typesClient.js'\nimport type { IndentFeatureProps } from '../server/index.js'\n\nexport const IndentPlugin: PluginComponent<IndentFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const { disabledNodes, disableTabNode } = clientProps\n\n useEffect(() => {\n if (!editor || !disabledNodes?.length) {\n return\n }\n return mergeRegister(\n editor.registerCommand(\n INDENT_CONTENT_COMMAND,\n () => {\n return $handleIndentAndOutdent((block) => {\n if (!disabledNodes.includes(block.getType())) {\n const indent = block.getIndent()\n block.setIndent(indent + 1)\n }\n })\n },\n COMMAND_PRIORITY_LOW,\n ),\n // If we disable indenting for certain nodes, we need to ensure that these are not indented,\n // if they get transformed from an indented state (e.g. an indented list node gets transformed into a\n // paragraph node for which indenting is disabled).\n editor.registerUpdateListener(({ dirtyElements, editorState }) => {\n editor.update(() => {\n for (const [nodeKey] of dirtyElements) {\n const node = editorState._nodeMap.get(nodeKey)\n if ($isElementNode(node) && disabledNodes.includes(node.getType())) {\n const currentIndent = node.getIndent()\n if (currentIndent > 0) {\n node.setIndent(0)\n }\n }\n }\n })\n }),\n )\n }, [editor, disabledNodes])\n\n useEffect(() => {\n if (!editor || !disableTabNode) {\n return\n }\n return mergeRegister(\n // This is so that when you press Tab in the middle of a paragraph,\n // it indents the paragraph, instead of inserting a TabNode.\n editor.registerCommand<KeyboardEvent>(\n KEY_TAB_COMMAND,\n (event) => {\n event.preventDefault()\n return editor.dispatchCommand(\n event.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND,\n undefined,\n )\n },\n COMMAND_PRIORITY_LOW,\n ),\n // Tab isn't the only way to insert a TabNode. We have to make sure\n // it doesn't happen, for example, when pasting from the clipboard.\n editor.registerNodeTransform(TabNode, (node) => {\n node.remove()\n }),\n )\n }, [editor, disableTabNode])\n\n return <TabIndentationPlugin />\n}\n\nfunction $handleIndentAndOutdent(indentOrOutdent: (block: ElementNode) => void): boolean {\n const selection = $getSelection()\n if (!$isRangeSelection(selection)) {\n return false\n }\n const alreadyHandled = new Set()\n const nodes = selection.getNodes()\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]!\n const key = node.getKey()\n if (alreadyHandled.has(key)) {\n continue\n }\n const parentBlock = $findMatchingParent(\n node,\n (parentNode): parentNode is ElementNode =>\n $isElementNode(parentNode) && !parentNode.isInline(),\n )\n if (parentBlock === null) {\n continue\n }\n const parentKey = parentBlock.getKey()\n if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n alreadyHandled.add(parentKey)\n indentOrOutdent(parentBlock)\n }\n }\n return alreadyHandled.size > 0\n}\n"],"mappings":";AAEA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,EAAEC,aAAa,QAAQ;AACnD,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,oBAAoB,EACpBC,sBAAsB,EACtBC,eAAe,EACfC,uBAAuB,EACvBC,OAAO,QACF;AACP,SAASC,SAAS,QAAQ;AAK1B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ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"IndentPlugin.js","names":["useLexicalComposerContext","TabIndentationPlugin","$findMatchingParent","mergeRegister","$addUpdateTag","$getSelection","$isElementNode","$isRangeSelection","$isRootOrShadowRoot","BLUR_COMMAND","COMMAND_PRIORITY_HIGH","COMMAND_PRIORITY_LOW","FOCUS_COMMAND","INDENT_CONTENT_COMMAND","KEY_ESCAPE_COMMAND","KEY_TAB_COMMAND","OUTDENT_CONTENT_COMMAND","SELECTION_CHANGE_COMMAND","SKIP_DOM_SELECTION_TAG","TabNode","useEffect","IndentPlugin","clientProps","editor","disabledNodes","disableTabNode","canTabOut","hasTabbedOut","resetTabExit","restoreTabIndexes","restoreTabTimer","rootEvents","resetKeyboardExit","handleKeyDownCapture","event","key","includes","root","getRootElement","stopPropagation","clearTimeout","container","closest","tabStops","Set","querySelectorAll","tabIndexes","Map","element","set","getAttribute","setAttribute","tabIndex","removeAttribute","undefined","setTimeout","update","handleKeyDown","defaultPrevented","isEditable","repeat","preventDefault","unregisterRootListener","registerRootListener","abort","AbortController","signal","addEventListener","capture","unregisterCommands","registerCommand","selection","isRootSelection","isCollapsed","anchor","getNode","ownerDocument","activeElement","length","$handleIndentAndOutdent","block","getType","indent","getIndent","setIndent","registerUpdateListener","dirtyElements","editorState","nodeKey","node","_nodeMap","get","currentIndent","dispatchCommand","shiftKey","registerNodeTransform","remove","_jsx","indentOrOutdent","alreadyHandled","nodes","getNodes","i","getKey","has","parentBlock","parentNode","isInline","parentKey","canIndent","add","size"],"sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"sourcesContent":["import type { ElementNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport {\n $addUpdateTag,\n $getSelection,\n $isElementNode,\n $isRangeSelection,\n $isRootOrShadowRoot,\n BLUR_COMMAND,\n COMMAND_PRIORITY_HIGH,\n COMMAND_PRIORITY_LOW,\n FOCUS_COMMAND,\n INDENT_CONTENT_COMMAND,\n KEY_ESCAPE_COMMAND,\n KEY_TAB_COMMAND,\n OUTDENT_CONTENT_COMMAND,\n SELECTION_CHANGE_COMMAND,\n SKIP_DOM_SELECTION_TAG,\n TabNode,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../typesClient.js'\nimport type { IndentFeatureProps } from '../server/index.js'\n\nexport const IndentPlugin: PluginComponent<IndentFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const { disabledNodes, disableTabNode } = clientProps\n\n useEffect(() => {\n let canTabOut = false\n let hasTabbedOut = false\n const resetTabExit = () => {\n canTabOut = false\n }\n let restoreTabIndexes: (() => void) | undefined\n let restoreTabTimer: ReturnType<typeof setTimeout> | undefined\n let rootEvents: AbortController | undefined\n\n function resetKeyboardExit() {\n resetTabExit()\n hasTabbedOut = false\n }\n\n function handleKeyDownCapture(event: KeyboardEvent) {\n if (event.key !== 'Tab' || !canTabOut) {\n if (!['Escape', 'Shift', 'Tab'].includes(event.key)) {\n resetTabExit()\n }\n return\n }\n\n const root = editor.getRootElement()\n\n if (!root) {\n return\n }\n resetTabExit()\n hasTabbedOut = true\n event.stopPropagation()\n restoreTabIndexes?.()\n clearTimeout(restoreTabTimer)\n\n const container = root.closest('.rich-text-lexical') ?? root\n const tabStops = new Set([\n root,\n ...container.querySelectorAll<HTMLElement>(\n '[tabindex], [contenteditable=\"true\"], a[href], button, input, select, textarea, summary, iframe, audio[controls], video[controls]',\n ),\n ])\n const tabIndexes = new Map<HTMLElement, null | string>()\n\n // Let the browser take Tab outside the entire editor, including decorator controls.\n // Restore its tab stops after the native focus move so ordinary Tab navigation is unchanged.\n for (const element of tabStops) {\n tabIndexes.set(element, element.getAttribute('tabindex'))\n element.setAttribute('tabindex', '-1')\n }\n restoreTabIndexes = () => {\n for (const [element, tabIndex] of tabIndexes) {\n if (tabIndex === null) {\n element.removeAttribute('tabindex')\n } else {\n element.setAttribute('tabindex', tabIndex)\n }\n }\n restoreTabIndexes = undefined\n }\n restoreTabTimer = setTimeout(() => restoreTabIndexes?.(), 0)\n editor.update(() => $addUpdateTag(SKIP_DOM_SELECTION_TAG))\n }\n\n function handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape' && !event.defaultPrevented && editor.isEditable()) {\n // A second press can dismiss the containing drawer; holding Escape must not.\n if (canTabOut && !event.repeat) {\n return\n }\n // Menus handle Escape first. This also reaches inputs inside decorator blocks.\n event.preventDefault()\n event.stopPropagation()\n canTabOut = true\n }\n }\n\n const unregisterRootListener = editor.registerRootListener((root) => {\n rootEvents?.abort()\n rootEvents = new AbortController()\n const { signal } = rootEvents\n\n /* eslint-disable @eslint-react/web-api/no-leaked-event-listener -- Aborted on root replacement and effect cleanup. */\n root?.addEventListener('pointerdown', resetKeyboardExit, { signal })\n root?.addEventListener('keydown', handleKeyDownCapture, { capture: true, signal })\n root?.addEventListener('keydown', handleKeyDown, { signal })\n /* eslint-enable @eslint-react/web-api/no-leaked-event-listener */\n })\n\n const unregisterCommands = mergeRegister(\n editor.registerCommand(\n KEY_ESCAPE_COMMAND,\n (event) => {\n if (!editor.isEditable()) {\n return false\n }\n handleKeyDown(event)\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(\n KEY_TAB_COMMAND,\n () => {\n const selection = $getSelection()\n const isRootSelection =\n $isRangeSelection(selection) &&\n selection.isCollapsed() &&\n $isRootOrShadowRoot(selection.anchor.getNode())\n\n // A root selection between decorator blocks has no text block to indent.\n if (!isRootSelection) {\n return false\n }\n resetTabExit()\n hasTabbedOut = true\n $addUpdateTag(SKIP_DOM_SELECTION_TAG)\n return true\n },\n COMMAND_PRIORITY_HIGH,\n ),\n editor.registerCommand(\n BLUR_COMMAND,\n () => {\n resetTabExit()\n return false\n },\n COMMAND_PRIORITY_HIGH,\n ),\n editor.registerCommand(\n FOCUS_COMMAND,\n () => {\n resetKeyboardExit()\n return false\n },\n COMMAND_PRIORITY_HIGH,\n ),\n editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n const root = editor.getRootElement()\n\n // A delayed selectionchange must not reclaim focus after native Tab navigation.\n if (hasTabbedOut && root?.ownerDocument.activeElement !== root) {\n $addUpdateTag(SKIP_DOM_SELECTION_TAG)\n }\n return false\n },\n COMMAND_PRIORITY_HIGH,\n ),\n )\n\n return () => {\n unregisterCommands()\n unregisterRootListener()\n rootEvents?.abort()\n clearTimeout(restoreTabTimer)\n restoreTabIndexes?.()\n }\n }, [editor])\n\n useEffect(() => {\n if (!editor || !disabledNodes?.length) {\n return\n }\n return mergeRegister(\n editor.registerCommand(\n INDENT_CONTENT_COMMAND,\n () => {\n return $handleIndentAndOutdent((block) => {\n if (!disabledNodes.includes(block.getType())) {\n const indent = block.getIndent()\n block.setIndent(indent + 1)\n }\n })\n },\n COMMAND_PRIORITY_LOW,\n ),\n // If we disable indenting for certain nodes, we need to ensure that these are not indented,\n // if they get transformed from an indented state (e.g. an indented list node gets transformed into a\n // paragraph node for which indenting is disabled).\n editor.registerUpdateListener(({ dirtyElements, editorState }) => {\n editor.update(() => {\n for (const [nodeKey] of dirtyElements) {\n const node = editorState._nodeMap.get(nodeKey)\n if ($isElementNode(node) && disabledNodes.includes(node.getType())) {\n const currentIndent = node.getIndent()\n if (currentIndent > 0) {\n node.setIndent(0)\n }\n }\n }\n })\n }),\n )\n }, [editor, disabledNodes])\n\n useEffect(() => {\n if (!editor || !disableTabNode) {\n return\n }\n return mergeRegister(\n // This is so that when you press Tab in the middle of a paragraph,\n // it indents the paragraph, instead of inserting a TabNode.\n editor.registerCommand<KeyboardEvent>(\n KEY_TAB_COMMAND,\n (event) => {\n event.preventDefault()\n return editor.dispatchCommand(\n event.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND,\n undefined,\n )\n },\n COMMAND_PRIORITY_LOW,\n ),\n // Tab isn't the only way to insert a TabNode. We have to make sure\n // it doesn't happen, for example, when pasting from the clipboard.\n editor.registerNodeTransform(TabNode, (node) => {\n node.remove()\n }),\n )\n }, [editor, disableTabNode])\n\n return <TabIndentationPlugin />\n}\n\nfunction $handleIndentAndOutdent(indentOrOutdent: (block: ElementNode) => void): boolean {\n const selection = $getSelection()\n if (!$isRangeSelection(selection)) {\n return false\n }\n const alreadyHandled = new Set()\n const nodes = selection.getNodes()\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]!\n const key = node.getKey()\n if (alreadyHandled.has(key)) {\n continue\n }\n const parentBlock = $findMatchingParent(\n node,\n (parentNode): parentNode is ElementNode =>\n $isElementNode(parentNode) && !parentNode.isInline(),\n )\n if (parentBlock === null) {\n continue\n }\n const parentKey = parentBlock.getKey()\n if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n alreadyHandled.add(parentKey)\n indentOrOutdent(parentBlock)\n }\n }\n return alreadyHandled.size > 0\n}\n"],"mappings":";AAEA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,EAAEC,aAAa,QAAQ;AACnD,SACEC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,mBAAmB,EACnBC,YAAY,EACZC,qBAAqB,EACrBC,oBAAoB,EACpBC,aAAa,EACbC,sBAAsB,EACtBC,kBAAkB,EAClBC,eAAe,EACfC,uBAAuB,EACvBC,wBAAwB,EACxBC,sBAAsB,EACtBC,OAAO,QACF;AACP,SAASC,SAAS,QAAQ;AAK1B,OAAO,MAAMC,YAAA,GAAoDA,CAAC;EAAEC;AAAW,CAAE;EAC/E,MAAM,CAACC,MAAA,CAAO,GAAGvB,yBAAA;EACjB,MAAM;IAAEwB,aAAa;IAAEC;EAAc,CAAE,GAAGH,WAAA;EAE1CF,SAAA,CAAU;IACR,IAAIM,SAAA,GAAY;IAChB,IAAIC,YAAA,GAAe;IACnB,MAAMC,YAAA,GAAeA,CAAA;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rC,MAAMb,IAAA,GAAOW,KAAK,CAACE,CAAA,CAAE;IACrB,MAAMnE,GAAA,GAAMsD,IAAA,CAAKc,MAAM;IACvB,IAAIJ,cAAA,CAAeK,GAAG,CAACrE,GAAA,GAAM;MAC3B;IACF;IACA,MAAMsE,WAAA,GAAcvG,mBAAA,CAClBuF,IAAA,EACCiB,UAAA,IACCpG,cAAA,CAAeoG,UAAA,KAAe,CAACA,UAAA,CAAWC,QAAQ;IAEtD,IAAIF,WAAA,KAAgB,MAAM;MACxB;IACF;IACA,MAAMG,SAAA,GAAYH,WAAA,CAAYF,MAAM;IACpC,IAAIE,WAAA,CAAYI,SAAS,MAAM,CAACV,cAAA,CAAeK,GAAG,CAACI,SAAA,GAAY;MAC7DT,cAAA,CAAeW,GAAG,CAACF,SAAA;MACnBV,eAAA,CAAgBO,WAAA;IAClB;EACF;EACA,OAAON,cAAA,CAAeY,IAAI,GAAG;AAC/B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/server/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/server/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAkN1C,CAAA"}
|