@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
|
@@ -1,151 +1,188 @@
|
|
|
1
1
|
export const i18n = {
|
|
2
2
|
ar: {
|
|
3
3
|
decreaseLabel: 'تقليل المسافة البادئة',
|
|
4
|
-
increaseLabel: 'زيادة المسافة البادئة'
|
|
4
|
+
increaseLabel: 'زيادة المسافة البادئة',
|
|
5
|
+
keyboardHint: 'اضغط على Escape، ثم Tab أو Shift+Tab لنقل التركيز خارج المحرر.'
|
|
5
6
|
},
|
|
6
7
|
az: {
|
|
7
8
|
decreaseLabel: 'İntervalı Azaltın',
|
|
8
|
-
increaseLabel: 'Girintiyi Artırın'
|
|
9
|
+
increaseLabel: 'Girintiyi Artırın',
|
|
10
|
+
keyboardHint: 'Fokusu redaktordan çıxarmaq üçün Escape, sonra Tab və ya Shift+Tab basın.'
|
|
9
11
|
},
|
|
10
12
|
bg: {
|
|
11
13
|
decreaseLabel: 'Намали отстоянието',
|
|
12
|
-
increaseLabel: 'Увеличете отстоянието'
|
|
14
|
+
increaseLabel: 'Увеличете отстоянието',
|
|
15
|
+
keyboardHint: 'Натиснете Escape, след това Tab или Shift+Tab, за да преместите фокуса извън редактора.'
|
|
13
16
|
},
|
|
14
17
|
cs: {
|
|
15
18
|
decreaseLabel: 'Zmenšit odsazení',
|
|
16
|
-
increaseLabel: 'Zvětšit odsazení'
|
|
19
|
+
increaseLabel: 'Zvětšit odsazení',
|
|
20
|
+
keyboardHint: 'Pro přesunutí fokusu mimo editor stiskněte Escape a poté Tab nebo Shift+Tab.'
|
|
17
21
|
},
|
|
18
22
|
da: {
|
|
19
23
|
decreaseLabel: 'Reducer Indrykning',
|
|
20
|
-
increaseLabel: 'Forøg indrykning'
|
|
24
|
+
increaseLabel: 'Forøg indrykning',
|
|
25
|
+
keyboardHint: 'Tryk på Escape og derefter Tab eller Shift+Tab for at flytte fokus ud af editoren.'
|
|
21
26
|
},
|
|
22
27
|
de: {
|
|
23
28
|
decreaseLabel: 'Einzug verkleinern',
|
|
24
|
-
increaseLabel: 'Einzug erhöhen'
|
|
29
|
+
increaseLabel: 'Einzug erhöhen',
|
|
30
|
+
keyboardHint: 'Drücke Escape und dann Tab oder Shift+Tab, um den Fokus aus dem Editor zu bewegen.'
|
|
25
31
|
},
|
|
26
32
|
en: {
|
|
27
33
|
decreaseLabel: 'Decrease Indent',
|
|
28
|
-
increaseLabel: 'Increase Indent'
|
|
34
|
+
increaseLabel: 'Increase Indent',
|
|
35
|
+
keyboardHint: 'Press Escape, then Tab or Shift+Tab to move focus out of the editor.'
|
|
29
36
|
},
|
|
30
37
|
es: {
|
|
31
38
|
decreaseLabel: 'Disminuir Sangría',
|
|
32
|
-
increaseLabel: 'Aumentar Sangría'
|
|
39
|
+
increaseLabel: 'Aumentar Sangría',
|
|
40
|
+
keyboardHint: 'Pulsa Escape y luego Tab o Shift+Tab para mover el foco fuera del editor.'
|
|
33
41
|
},
|
|
34
42
|
et: {
|
|
35
43
|
decreaseLabel: 'Taande vähendamine',
|
|
36
|
-
increaseLabel: 'Taande suurendamine'
|
|
44
|
+
increaseLabel: 'Taande suurendamine',
|
|
45
|
+
keyboardHint: 'Fookuse redaktorist välja viimiseks vajuta Escape ja seejärel Tab või Shift+Tab.'
|
|
37
46
|
},
|
|
38
47
|
fa: {
|
|
39
48
|
decreaseLabel: 'کاهش تورفتگی',
|
|
40
|
-
increaseLabel: 'افزایش تورفتگی'
|
|
49
|
+
increaseLabel: 'افزایش تورفتگی',
|
|
50
|
+
keyboardHint: 'برای انتقال تمرکز به خارج از ویرایشگر، Escape و سپس Tab یا Shift+Tab را فشار دهید.'
|
|
41
51
|
},
|
|
42
52
|
fr: {
|
|
43
53
|
decreaseLabel: "Diminuer l'indentation",
|
|
44
|
-
increaseLabel: "Augmenter l'indentation"
|
|
54
|
+
increaseLabel: "Augmenter l'indentation",
|
|
55
|
+
keyboardHint: 'Appuyez sur Échap, puis sur Tab ou Maj+Tab pour déplacer le focus hors de l’éditeur.'
|
|
45
56
|
},
|
|
46
57
|
he: {
|
|
47
58
|
decreaseLabel: 'הקטן הזחה',
|
|
48
|
-
increaseLabel: 'הגדל כניסה'
|
|
59
|
+
increaseLabel: 'הגדל כניסה',
|
|
60
|
+
keyboardHint: 'כדי להעביר את המיקוד אל מחוץ לעורך, יש ללחוץ על Escape ואז על Tab או Shift+Tab.'
|
|
49
61
|
},
|
|
50
62
|
hr: {
|
|
51
63
|
decreaseLabel: 'Smanji uvlačenje',
|
|
52
|
-
increaseLabel: 'Povećaj uvlačenje'
|
|
64
|
+
increaseLabel: 'Povećaj uvlačenje',
|
|
65
|
+
keyboardHint: 'Pritisnite Escape, a zatim Tab ili Shift+Tab za premještanje fokusa izvan uređivača.'
|
|
53
66
|
},
|
|
54
67
|
hu: {
|
|
55
68
|
decreaseLabel: 'Csökkentse a behúzást',
|
|
56
|
-
increaseLabel: 'Behúzás növelése'
|
|
69
|
+
increaseLabel: 'Behúzás növelése',
|
|
70
|
+
keyboardHint: 'A fókusz szerkesztőn kívülre helyezéséhez nyomja meg az Escape, majd a Tab vagy Shift+Tab billentyűt.'
|
|
57
71
|
},
|
|
58
72
|
is: {
|
|
59
73
|
decreaseLabel: 'Minnka inndrátt',
|
|
60
|
-
increaseLabel: 'Auka inndrátt'
|
|
74
|
+
increaseLabel: 'Auka inndrátt',
|
|
75
|
+
keyboardHint: 'Ýttu á Escape og síðan Tab eða Shift+Tab til að færa fókus úr ritlinum.'
|
|
61
76
|
},
|
|
62
77
|
it: {
|
|
63
78
|
decreaseLabel: 'Diminuisci rientro',
|
|
64
|
-
increaseLabel: 'Aumenta Rientro'
|
|
79
|
+
increaseLabel: 'Aumenta Rientro',
|
|
80
|
+
keyboardHint: 'Premi Escape, poi Tab o Shift+Tab per spostare il focus fuori dall’editor.'
|
|
65
81
|
},
|
|
66
82
|
ja: {
|
|
67
83
|
decreaseLabel: 'インデントを減らす',
|
|
68
|
-
increaseLabel: 'インデントを増やす'
|
|
84
|
+
increaseLabel: 'インデントを増やす',
|
|
85
|
+
keyboardHint: 'Escape を押してから Tab または Shift+Tab を押すと、フォーカスがエディターの外に移動します。'
|
|
69
86
|
},
|
|
70
87
|
ko: {
|
|
71
88
|
decreaseLabel: '들여쓰기 줄이기',
|
|
72
|
-
increaseLabel: '들여쓰기 늘리기'
|
|
89
|
+
increaseLabel: '들여쓰기 늘리기',
|
|
90
|
+
keyboardHint: 'Escape를 누른 다음 Tab 또는 Shift+Tab을 눌러 편집기 밖으로 초점을 이동하세요.'
|
|
73
91
|
},
|
|
74
92
|
my: {
|
|
75
93
|
decreaseLabel: 'Kurangkan Inden',
|
|
76
|
-
increaseLabel: 'Tingkatkan Inden'
|
|
94
|
+
increaseLabel: 'Tingkatkan Inden',
|
|
95
|
+
keyboardHint: 'အယ်ဒီတာအပြင်သို့ အာရုံစိုက်မှု ရွှေ့ရန် Escape ကိုနှိပ်ပြီး Tab သို့မဟုတ် Shift+Tab ကိုနှိပ်ပါ။'
|
|
77
96
|
},
|
|
78
97
|
nb: {
|
|
79
98
|
decreaseLabel: 'Reduser innrykk',
|
|
80
|
-
increaseLabel: 'Øke innrykk'
|
|
99
|
+
increaseLabel: 'Øke innrykk',
|
|
100
|
+
keyboardHint: 'Trykk Escape og deretter Tab eller Shift+Tab for å flytte fokus ut av redigeringsfeltet.'
|
|
81
101
|
},
|
|
82
102
|
nl: {
|
|
83
103
|
decreaseLabel: 'Verminder Inspringing',
|
|
84
|
-
increaseLabel: 'Inspring verhogen'
|
|
104
|
+
increaseLabel: 'Inspring verhogen',
|
|
105
|
+
keyboardHint: 'Druk op Escape en daarna op Tab of Shift+Tab om de focus buiten de editor te verplaatsen.'
|
|
85
106
|
},
|
|
86
107
|
pl: {
|
|
87
108
|
decreaseLabel: 'Zmniejsz wcięcie',
|
|
88
|
-
increaseLabel: 'Zwiększ wcięcie'
|
|
109
|
+
increaseLabel: 'Zwiększ wcięcie',
|
|
110
|
+
keyboardHint: 'Naciśnij Escape, a następnie Tab lub Shift+Tab, aby przenieść fokus poza edytor.'
|
|
89
111
|
},
|
|
90
112
|
pt: {
|
|
91
113
|
decreaseLabel: 'Diminuir recuo',
|
|
92
|
-
increaseLabel: 'Aumentar Indentação'
|
|
114
|
+
increaseLabel: 'Aumentar Indentação',
|
|
115
|
+
keyboardHint: 'Pressione Escape e depois Tab ou Shift+Tab para mover o foco para fora do editor.'
|
|
93
116
|
},
|
|
94
117
|
ro: {
|
|
95
118
|
decreaseLabel: 'Reducere indentare',
|
|
96
|
-
increaseLabel: 'Crește indentarea'
|
|
119
|
+
increaseLabel: 'Crește indentarea',
|
|
120
|
+
keyboardHint: 'Apăsați Escape, apoi Tab sau Shift+Tab pentru a muta focalizarea în afara editorului.'
|
|
97
121
|
},
|
|
98
122
|
rs: {
|
|
99
123
|
decreaseLabel: 'Смањи увлачење',
|
|
100
|
-
increaseLabel: 'Повећај увлачење'
|
|
124
|
+
increaseLabel: 'Повећај увлачење',
|
|
125
|
+
keyboardHint: 'Притисните Escape, а затим Tab или Shift+Tab да преместите фокус изван уређивача.'
|
|
101
126
|
},
|
|
102
127
|
'rs-latin': {
|
|
103
128
|
decreaseLabel: 'Smanji uvlačenje',
|
|
104
|
-
increaseLabel: 'Povećaj uvlačenje'
|
|
129
|
+
increaseLabel: 'Povećaj uvlačenje',
|
|
130
|
+
keyboardHint: 'Pritisnite Escape, a zatim Tab ili Shift+Tab da premestite fokus izvan uređivača.'
|
|
105
131
|
},
|
|
106
132
|
ru: {
|
|
107
133
|
decreaseLabel: 'Уменьшить отступ',
|
|
108
|
-
increaseLabel: 'Увеличить отступ'
|
|
134
|
+
increaseLabel: 'Увеличить отступ',
|
|
135
|
+
keyboardHint: 'Нажмите Escape, затем Tab или Shift+Tab, чтобы переместить фокус за пределы редактора.'
|
|
109
136
|
},
|
|
110
137
|
sk: {
|
|
111
138
|
decreaseLabel: 'Znížiť odsadenie',
|
|
112
|
-
increaseLabel: 'Zväčšiť odsadenie'
|
|
139
|
+
increaseLabel: 'Zväčšiť odsadenie',
|
|
140
|
+
keyboardHint: 'Na presunutie fokusu mimo editora stlačte Escape a potom Tab alebo Shift+Tab.'
|
|
113
141
|
},
|
|
114
142
|
sl: {
|
|
115
143
|
decreaseLabel: 'Zmanjšaj zamik',
|
|
116
|
-
increaseLabel: 'Povečaj zamik'
|
|
144
|
+
increaseLabel: 'Povečaj zamik',
|
|
145
|
+
keyboardHint: 'Pritisnite Escape in nato Tab ali Shift+Tab, da premaknete fokus iz urejevalnika.'
|
|
117
146
|
},
|
|
118
147
|
sv: {
|
|
119
148
|
decreaseLabel: 'Minska indrag',
|
|
120
|
-
increaseLabel: 'Öka indrag'
|
|
149
|
+
increaseLabel: 'Öka indrag',
|
|
150
|
+
keyboardHint: 'Tryck på Escape och sedan Tab eller Shift+Tab för att flytta fokus ut ur redigeraren.'
|
|
121
151
|
},
|
|
122
152
|
ta: {
|
|
123
153
|
decreaseLabel: 'இடதுபுறச் செருகலை குறைக்கவும்',
|
|
124
|
-
increaseLabel: 'இடதுபுறச் செருகலை அதிகரிக்கவும்'
|
|
154
|
+
increaseLabel: 'இடதுபுறச் செருகலை அதிகரிக்கவும்',
|
|
155
|
+
keyboardHint: 'தொகுப்பிக்கு வெளியே கவனத்தை நகர்த்த Escape அழுத்தி, பின்னர் Tab அல்லது Shift+Tab அழுத்தவும்.'
|
|
125
156
|
},
|
|
126
157
|
th: {
|
|
127
158
|
decreaseLabel: 'ลดการเยื้อง',
|
|
128
|
-
increaseLabel: 'เพิ่มการเยื้อง'
|
|
159
|
+
increaseLabel: 'เพิ่มการเยื้อง',
|
|
160
|
+
keyboardHint: 'กด Escape แล้วกด Tab หรือ Shift+Tab เพื่อย้ายโฟกัสออกจากตัวแก้ไข'
|
|
129
161
|
},
|
|
130
162
|
tr: {
|
|
131
163
|
decreaseLabel: 'Girintiyi Azalt',
|
|
132
|
-
increaseLabel: 'Girintiyi Artır'
|
|
164
|
+
increaseLabel: 'Girintiyi Artır',
|
|
165
|
+
keyboardHint: 'Odağı düzenleyicinin dışına taşımak için Escape, ardından Tab veya Shift+Tab tuşuna basın.'
|
|
133
166
|
},
|
|
134
167
|
uk: {
|
|
135
168
|
decreaseLabel: 'Зменшити відступ',
|
|
136
|
-
increaseLabel: 'Збільшити відступ'
|
|
169
|
+
increaseLabel: 'Збільшити відступ',
|
|
170
|
+
keyboardHint: 'Натисніть Escape, потім Tab або Shift+Tab, щоб перемістити фокус за межі редактора.'
|
|
137
171
|
},
|
|
138
172
|
vi: {
|
|
139
173
|
decreaseLabel: 'Giảm lề',
|
|
140
|
-
increaseLabel: 'Tăng lề'
|
|
174
|
+
increaseLabel: 'Tăng lề',
|
|
175
|
+
keyboardHint: 'Nhấn Escape, sau đó nhấn Tab hoặc Shift+Tab để di chuyển tiêu điểm ra khỏi trình soạn thảo.'
|
|
141
176
|
},
|
|
142
177
|
zh: {
|
|
143
178
|
decreaseLabel: '减少缩进',
|
|
144
|
-
increaseLabel: '增加缩进'
|
|
179
|
+
increaseLabel: '增加缩进',
|
|
180
|
+
keyboardHint: '按 Escape,然后按 Tab 或 Shift+Tab 将焦点移出编辑器。'
|
|
145
181
|
},
|
|
146
182
|
'zh-TW': {
|
|
147
183
|
decreaseLabel: '減少縮排',
|
|
148
|
-
increaseLabel: '增加縮排'
|
|
184
|
+
increaseLabel: '增加縮排',
|
|
185
|
+
keyboardHint: '按 Escape,然後按 Tab 或 Shift+Tab 將焦點移出編輯器。'
|
|
149
186
|
}
|
|
150
187
|
};
|
|
151
188
|
//# sourceMappingURL=i18n.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":["i18n","ar","decreaseLabel","increaseLabel","az","bg","cs","da","de","en","es","et","fa","fr","he","hr","hu","is","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sl","sv","ta","th","tr","uk","vi","zh"],"sources":["../../../../src/features/indent/server/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: {\n decreaseLabel: 'تقليل المسافة البادئة',\n increaseLabel: 'زيادة المسافة البادئة',\n },\n az: {\n decreaseLabel: 'İntervalı Azaltın',\n increaseLabel: 'Girintiyi Artırın',\n },\n bg: {\n decreaseLabel: 'Намали отстоянието',\n increaseLabel: 'Увеличете отстоянието',\n },\n cs: {\n decreaseLabel: 'Zmenšit odsazení',\n increaseLabel: 'Zvětšit odsazení',\n },\n da: {\n decreaseLabel: 'Reducer Indrykning',\n increaseLabel: 'Forøg indrykning',\n },\n de: {\n decreaseLabel: 'Einzug verkleinern',\n increaseLabel: 'Einzug erhöhen',\n },\n en: {\n decreaseLabel: 'Decrease Indent',\n increaseLabel: 'Increase Indent',\n },\n es: {\n decreaseLabel: 'Disminuir Sangría',\n increaseLabel: 'Aumentar Sangría',\n },\n et: {\n decreaseLabel: 'Taande vähendamine',\n increaseLabel: 'Taande suurendamine',\n },\n fa: {\n decreaseLabel: 'کاهش تورفتگی',\n increaseLabel: 'افزایش تورفتگی',\n },\n fr: {\n decreaseLabel: \"Diminuer l'indentation\",\n increaseLabel: \"Augmenter l'indentation\",\n },\n he: {\n decreaseLabel: 'הקטן הזחה',\n increaseLabel: 'הגדל כניסה',\n },\n hr: {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n },\n hu: {\n decreaseLabel: 'Csökkentse a behúzást',\n increaseLabel: 'Behúzás növelése',\n },\n is: {\n decreaseLabel: 'Minnka inndrátt',\n increaseLabel: 'Auka inndrátt',\n },\n it: {\n decreaseLabel: 'Diminuisci rientro',\n increaseLabel: 'Aumenta Rientro',\n },\n ja: {\n decreaseLabel: 'インデントを減らす',\n increaseLabel: 'インデントを増やす',\n },\n ko: {\n decreaseLabel: '들여쓰기 줄이기',\n increaseLabel: '들여쓰기 늘리기',\n },\n my: {\n decreaseLabel: 'Kurangkan Inden',\n increaseLabel: 'Tingkatkan Inden',\n },\n nb: {\n decreaseLabel: 'Reduser innrykk',\n increaseLabel: 'Øke innrykk',\n },\n nl: {\n decreaseLabel: 'Verminder Inspringing',\n increaseLabel: 'Inspring verhogen',\n },\n pl: {\n decreaseLabel: 'Zmniejsz wcięcie',\n increaseLabel: 'Zwiększ wcięcie',\n },\n pt: {\n decreaseLabel: 'Diminuir recuo',\n increaseLabel: 'Aumentar Indentação',\n },\n ro: {\n decreaseLabel: 'Reducere indentare',\n increaseLabel: 'Crește indentarea',\n },\n rs: {\n decreaseLabel: 'Смањи увлачење',\n increaseLabel: 'Повећај увлачење',\n },\n 'rs-latin': {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n },\n ru: {\n decreaseLabel: 'Уменьшить отступ',\n increaseLabel: 'Увеличить отступ',\n },\n sk: {\n decreaseLabel: 'Znížiť odsadenie',\n increaseLabel: 'Zväčšiť odsadenie',\n },\n sl: {\n decreaseLabel: 'Zmanjšaj zamik',\n increaseLabel: 'Povečaj zamik',\n },\n sv: {\n decreaseLabel: 'Minska indrag',\n increaseLabel: 'Öka indrag',\n },\n ta: {\n decreaseLabel: 'இடதுபுறச் செருகலை குறைக்கவும்',\n increaseLabel: 'இடதுபுறச் செருகலை அதிகரிக்கவும்',\n },\n th: {\n decreaseLabel: 'ลดการเยื้อง',\n increaseLabel: 'เพิ่มการเยื้อง',\n },\n tr: {\n decreaseLabel: 'Girintiyi Azalt',\n increaseLabel: 'Girintiyi Artır',\n },\n uk: {\n decreaseLabel: 'Зменшити відступ',\n increaseLabel: 'Збільшити відступ',\n },\n vi: {\n decreaseLabel: 'Giảm lề',\n increaseLabel: 'Tăng lề',\n },\n zh: {\n decreaseLabel: '减少缩进',\n increaseLabel: '增加缩进',\n },\n 'zh-TW': {\n decreaseLabel: '減少縮排',\n increaseLabel: '增加縮排',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,IAAA,GAAkC;EAC7CC,EAAA,EAAI;IACFC,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAC,EAAA,EAAI;IACFF,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAE,EAAA,EAAI;IACFH,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAG,EAAA,EAAI;IACFJ,aAAA,EAAe;IACfC,aAAA,EAAe;E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ACAwB,EAAA,EAAI;IACFzB,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA,YAAY;IACVD,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAyB,EAAA,EAAI;IACF1B,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA0B,EAAA,EAAI;IACF3B,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA2B,EAAA,EAAI;IACF5B,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA4B,EAAA,EAAI;IACF7B,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA6B,EAAA,EAAI;IACF9B,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA8B,EAAA,EAAI;IACF/B,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA+B,EAAA,EAAI;IACFhC,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAgC,EAAA,EAAI;IACFjC,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAiC,EAAA,EAAI;IACFlC,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACAkC,EAAA,EAAI;IACFnC,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;EACA,SAAS;IACPD,aAAA,EAAe;IACfC,aAAA,EAAe;EACjB;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["i18n","ar","decreaseLabel","increaseLabel","keyboardHint","az","bg","cs","da","de","en","es","et","fa","fr","he","hr","hu","is","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sl","sv","ta","th","tr","uk","vi","zh"],"sources":["../../../../src/features/indent/server/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: {\n decreaseLabel: 'تقليل المسافة البادئة',\n increaseLabel: 'زيادة المسافة البادئة',\n keyboardHint: 'اضغط على Escape، ثم Tab أو Shift+Tab لنقل التركيز خارج المحرر.',\n },\n az: {\n decreaseLabel: 'İntervalı Azaltın',\n increaseLabel: 'Girintiyi Artırın',\n keyboardHint: 'Fokusu redaktordan çıxarmaq üçün Escape, sonra Tab və ya Shift+Tab basın.',\n },\n bg: {\n decreaseLabel: 'Намали отстоянието',\n increaseLabel: 'Увеличете отстоянието',\n keyboardHint:\n 'Натиснете Escape, след това Tab или Shift+Tab, за да преместите фокуса извън редактора.',\n },\n cs: {\n decreaseLabel: 'Zmenšit odsazení',\n increaseLabel: 'Zvětšit odsazení',\n keyboardHint: 'Pro přesunutí fokusu mimo editor stiskněte Escape a poté Tab nebo Shift+Tab.',\n },\n da: {\n decreaseLabel: 'Reducer Indrykning',\n increaseLabel: 'Forøg indrykning',\n keyboardHint:\n 'Tryk på Escape og derefter Tab eller Shift+Tab for at flytte fokus ud af editoren.',\n },\n de: {\n decreaseLabel: 'Einzug verkleinern',\n increaseLabel: 'Einzug erhöhen',\n keyboardHint:\n 'Drücke Escape und dann Tab oder Shift+Tab, um den Fokus aus dem Editor zu bewegen.',\n },\n en: {\n decreaseLabel: 'Decrease Indent',\n increaseLabel: 'Increase Indent',\n keyboardHint: 'Press Escape, then Tab or Shift+Tab to move focus out of the editor.',\n },\n es: {\n decreaseLabel: 'Disminuir Sangría',\n increaseLabel: 'Aumentar Sangría',\n keyboardHint: 'Pulsa Escape y luego Tab o Shift+Tab para mover el foco fuera del editor.',\n },\n et: {\n decreaseLabel: 'Taande vähendamine',\n increaseLabel: 'Taande suurendamine',\n keyboardHint:\n 'Fookuse redaktorist välja viimiseks vajuta Escape ja seejärel Tab või Shift+Tab.',\n },\n fa: {\n decreaseLabel: 'کاهش تورفتگی',\n increaseLabel: 'افزایش تورفتگی',\n keyboardHint:\n 'برای انتقال تمرکز به خارج از ویرایشگر، Escape و سپس Tab یا Shift+Tab را فشار دهید.',\n },\n fr: {\n decreaseLabel: \"Diminuer l'indentation\",\n increaseLabel: \"Augmenter l'indentation\",\n keyboardHint:\n 'Appuyez sur Échap, puis sur Tab ou Maj+Tab pour déplacer le focus hors de l’éditeur.',\n },\n he: {\n decreaseLabel: 'הקטן הזחה',\n increaseLabel: 'הגדל כניסה',\n keyboardHint: 'כדי להעביר את המיקוד אל מחוץ לעורך, יש ללחוץ על Escape ואז על Tab או Shift+Tab.',\n },\n hr: {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n keyboardHint:\n 'Pritisnite Escape, a zatim Tab ili Shift+Tab za premještanje fokusa izvan uređivača.',\n },\n hu: {\n decreaseLabel: 'Csökkentse a behúzást',\n increaseLabel: 'Behúzás növelése',\n keyboardHint:\n 'A fókusz szerkesztőn kívülre helyezéséhez nyomja meg az Escape, majd a Tab vagy Shift+Tab billentyűt.',\n },\n is: {\n decreaseLabel: 'Minnka inndrátt',\n increaseLabel: 'Auka inndrátt',\n keyboardHint: 'Ýttu á Escape og síðan Tab eða Shift+Tab til að færa fókus úr ritlinum.',\n },\n it: {\n decreaseLabel: 'Diminuisci rientro',\n increaseLabel: 'Aumenta Rientro',\n keyboardHint: 'Premi Escape, poi Tab o Shift+Tab per spostare il focus fuori dall’editor.',\n },\n ja: {\n decreaseLabel: 'インデントを減らす',\n increaseLabel: 'インデントを増やす',\n keyboardHint:\n 'Escape を押してから Tab または Shift+Tab を押すと、フォーカスがエディターの外に移動します。',\n },\n ko: {\n decreaseLabel: '들여쓰기 줄이기',\n increaseLabel: '들여쓰기 늘리기',\n keyboardHint: 'Escape를 누른 다음 Tab 또는 Shift+Tab을 눌러 편집기 밖으로 초점을 이동하세요.',\n },\n my: {\n decreaseLabel: 'Kurangkan Inden',\n increaseLabel: 'Tingkatkan Inden',\n keyboardHint:\n 'အယ်ဒီတာအပြင်သို့ အာရုံစိုက်မှု ရွှေ့ရန် Escape ကိုနှိပ်ပြီး Tab သို့မဟုတ် Shift+Tab ကိုနှိပ်ပါ။',\n },\n nb: {\n decreaseLabel: 'Reduser innrykk',\n increaseLabel: 'Øke innrykk',\n keyboardHint:\n 'Trykk Escape og deretter Tab eller Shift+Tab for å flytte fokus ut av redigeringsfeltet.',\n },\n nl: {\n decreaseLabel: 'Verminder Inspringing',\n increaseLabel: 'Inspring verhogen',\n keyboardHint:\n 'Druk op Escape en daarna op Tab of Shift+Tab om de focus buiten de editor te verplaatsen.',\n },\n pl: {\n decreaseLabel: 'Zmniejsz wcięcie',\n increaseLabel: 'Zwiększ wcięcie',\n keyboardHint:\n 'Naciśnij Escape, a następnie Tab lub Shift+Tab, aby przenieść fokus poza edytor.',\n },\n pt: {\n decreaseLabel: 'Diminuir recuo',\n increaseLabel: 'Aumentar Indentação',\n keyboardHint:\n 'Pressione Escape e depois Tab ou Shift+Tab para mover o foco para fora do editor.',\n },\n ro: {\n decreaseLabel: 'Reducere indentare',\n increaseLabel: 'Crește indentarea',\n keyboardHint:\n 'Apăsați Escape, apoi Tab sau Shift+Tab pentru a muta focalizarea în afara editorului.',\n },\n rs: {\n decreaseLabel: 'Смањи увлачење',\n increaseLabel: 'Повећај увлачење',\n keyboardHint:\n 'Притисните Escape, а затим Tab или Shift+Tab да преместите фокус изван уређивача.',\n },\n 'rs-latin': {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n keyboardHint:\n 'Pritisnite Escape, a zatim Tab ili Shift+Tab da premestite fokus izvan uređivača.',\n },\n ru: {\n decreaseLabel: 'Уменьшить отступ',\n increaseLabel: 'Увеличить отступ',\n keyboardHint:\n 'Нажмите Escape, затем Tab или Shift+Tab, чтобы переместить фокус за пределы редактора.',\n },\n sk: {\n decreaseLabel: 'Znížiť odsadenie',\n increaseLabel: 'Zväčšiť odsadenie',\n keyboardHint: 'Na presunutie fokusu mimo editora stlačte Escape a potom Tab alebo Shift+Tab.',\n },\n sl: {\n decreaseLabel: 'Zmanjšaj zamik',\n increaseLabel: 'Povečaj zamik',\n keyboardHint:\n 'Pritisnite Escape in nato Tab ali Shift+Tab, da premaknete fokus iz urejevalnika.',\n },\n sv: {\n decreaseLabel: 'Minska indrag',\n increaseLabel: 'Öka indrag',\n keyboardHint:\n 'Tryck på Escape och sedan Tab eller Shift+Tab för att flytta fokus ut ur redigeraren.',\n },\n ta: {\n decreaseLabel: 'இடதுபுறச் செருகலை குறைக்கவும்',\n increaseLabel: 'இடதுபுறச் செருகலை அதிகரிக்கவும்',\n keyboardHint:\n 'தொகுப்பிக்கு வெளியே கவனத்தை நகர்த்த Escape அழுத்தி, பின்னர் Tab அல்லது Shift+Tab அழுத்தவும்.',\n },\n th: {\n decreaseLabel: 'ลดการเยื้อง',\n increaseLabel: 'เพิ่มการเยื้อง',\n keyboardHint: 'กด Escape แล้วกด Tab หรือ Shift+Tab เพื่อย้ายโฟกัสออกจากตัวแก้ไข',\n },\n tr: {\n decreaseLabel: 'Girintiyi Azalt',\n increaseLabel: 'Girintiyi Artır',\n keyboardHint:\n 'Odağı düzenleyicinin dışına taşımak için Escape, ardından Tab veya Shift+Tab tuşuna basın.',\n },\n uk: {\n decreaseLabel: 'Зменшити відступ',\n increaseLabel: 'Збільшити відступ',\n keyboardHint:\n 'Натисніть Escape, потім Tab або Shift+Tab, щоб перемістити фокус за межі редактора.',\n },\n vi: {\n decreaseLabel: 'Giảm lề',\n increaseLabel: 'Tăng lề',\n keyboardHint:\n 'Nhấn Escape, sau đó nhấn Tab hoặc Shift+Tab để di chuyển tiêu điểm ra khỏi trình soạn thảo.',\n },\n zh: {\n decreaseLabel: '减少缩进',\n increaseLabel: '增加缩进',\n keyboardHint: '按 Escape,然后按 Tab 或 Shift+Tab 将焦点移出编辑器。',\n },\n 'zh-TW': {\n decreaseLabel: '減少縮排',\n increaseLabel: '增加縮排',\n keyboardHint: '按 Escape,然後按 Tab 或 Shift+Tab 將焦點移出編輯器。',\n },\n}\n"],"mappings":"AAEA,OAAO,MAAMA,IAAA,GAAkC;EAC7CC,EAAA,EAAI;IACFC,aAAA,EAAe;IACfC,aAAA,EAAe;IACfC,YAAA,EAAc;EAChB;EACAC,EAAA,EAAI;IACFH,aAAA,EAAe;IACfC,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;EACJ;EACAgC,EAAA,EAAI;IACFlC,aAAA,EAAe;IACfC,aAAA,EAAe;IACfC,YAAA,EACE;EACJ;EACAiC,EAAA,EAAI;IACFnC,aAAA,EAAe;IACfC,aAAA,EAAe;IACfC,YAAA,EACE;EACJ;EACAkC,EAAA,EAAI;IACFpC,aAAA,EAAe;IACfC,aAAA,EAAe;IACfC,YAAA,EAAc;EAChB;EACA,SAAS;IACPF,aAAA,EAAe;IACfC,aAAA,EAAe;IACfC,YAAA,EAAc;EAChB;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAoE,MAAM,OAAO,CAAA;AAwBxF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,WAAW,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAoE,MAAM,OAAO,CAAA;AAwBxF,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,WAAW,CAAA;CAAE,GAAG,KAAK,CAAC,SAAS,CAkavF"}
|
|
@@ -232,8 +232,10 @@ export function LinkEditor({
|
|
|
232
232
|
}), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
|
|
233
233
|
void $updateLinkEditor();
|
|
234
234
|
return true;
|
|
235
|
-
}, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ESCAPE_COMMAND,
|
|
235
|
+
}, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_ESCAPE_COMMAND, event => {
|
|
236
236
|
if (isLink) {
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
event.stopImmediatePropagation();
|
|
237
239
|
setNotLink();
|
|
238
240
|
return true;
|
|
239
241
|
}
|
|
@@ -258,6 +260,7 @@ export function LinkEditor({
|
|
|
258
260
|
children: [/*#__PURE__*/_jsx("div", {
|
|
259
261
|
className: "link-editor",
|
|
260
262
|
"data-theme": "dark",
|
|
263
|
+
hidden: !isLink,
|
|
261
264
|
ref: editorRef,
|
|
262
265
|
children: /*#__PURE__*/_jsxs("div", {
|
|
263
266
|
className: "link-input",
|
|
@@ -289,8 +292,8 @@ export function LinkEditor({
|
|
|
289
292
|
children: [/*#__PURE__*/_jsx("button", {
|
|
290
293
|
"aria-label": "Edit link",
|
|
291
294
|
className: "link-edit",
|
|
292
|
-
onClick:
|
|
293
|
-
|
|
295
|
+
onClick: event_0 => {
|
|
296
|
+
event_0.preventDefault();
|
|
294
297
|
toggleDrawer();
|
|
295
298
|
},
|
|
296
299
|
onMouseDown: preventDefault,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","$findMatchingParent","mergeRegister","getTranslation","formatDrawerSlug","NewTabIcon","useConfig","useEditDepth","useLocale","useTranslation","WriteIcon","requests","$getSelection","$isLineBreakNode","$isRangeSelection","COMMAND_PRIORITY_HIGH","COMMAND_PRIORITY_LOW","getDOMSelection","KEY_ESCAPE_COMMAND","SELECTION_CHANGE_COMMAND","formatAdminURL","React","useCallback","useEffect","useLayoutEffect","useRef","useState","useEditorConfigContext","LinkIcon","PageIcon","TrashIcon","getSelectedNode","setFloatingElemPositionForLinkEditor","FieldsDrawer","useLexicalDrawer","$isAutoLinkNode","$createLinkNode","$isLinkNode","TOGGLE_LINK_COMMAND","TOGGLE_LINK_WITH_MODAL_COMMAND","preventDefault","event","LinkEditor","anchorElem","editor","linkNode","setLinkNode","editorRef","selectedNodeRectRef","linkUrl","setLinkUrl","linkLabel","setLinkLabel","fieldProps","schemaPath","uuid","isEditable","config","getEntityConfig","i18n","t","stateData","setStateData","editDepth","isLink","setIsLink","selectedNodes","setSelectedNodes","locale","isAutoLink","setIsAutoLink","drawerSlug","slug","depth","toggleDrawer","setNotLink","current","style","opacity","transform","undefined","$updateLinkEditor","selection","selectedNodeDomRect","focusNode","getElementByKey","getKey","getBoundingClientRect","focusLinkParent","badNode","getNodes","filter","node","find","is","fields","getFields","data","id","getID","text","getTextContent","linkType","url","routes","admin","doc","relationTo","value","relatedField","collectionSlug","label","String","collection","Error","loadingLabel","labels","singular","replace","get","apiRoute","api","path","serverURL","headers","language","params","code","then","res","ok","status","json","useAsTitle","title","catch","editorElem","nativeSelection","_window","activeElement","document","rootElement","getRootElement","contains","anchorNode","getRangeAt","y","className","registerCommand","payload","dispatchCommand","scrollerElem","parentElement","update","getEditorState","read","window","addEventListener","removeEventListener","registerUpdateListener","editorState","_jsxs","Fragment","_jsx","ref","__fields","length","href","rel","target","newTab","_Fragment","size","onClick","onMouseDown","tabIndex","type","small","drawerTitle","featureKey","handleDrawerSubmit","newLinkPayload","bareLinkFields","linkParent","getParent","schemaPathSuffix"],"sources":["../../../../../../../src/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.tsx"],"sourcesContent":["'use client'\nimport type { ElementNode, LexicalNode } from 'lexical'\nimport type { Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n formatDrawerSlug,\n NewTabIcon,\n useConfig,\n useEditDepth,\n useLocale,\n useTranslation,\n WriteIcon,\n} from '@payloadcms/ui'\nimport { requests } from '@payloadcms/ui/shared'\nimport {\n $getSelection,\n $isLineBreakNode,\n $isRangeSelection,\n COMMAND_PRIORITY_HIGH,\n COMMAND_PRIORITY_LOW,\n getDOMSelection,\n KEY_ESCAPE_COMMAND,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport type { LinkNode } from '../../../../nodes/LinkNode.js'\nimport type { LinkFields } from '../../../../server/schema.js'\nimport type { LinkPayload } from '../types.js'\n\nimport { useEditorConfigContext } from '../../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { LinkIcon } from '../../../../../../lexical/ui/icons/Link/index.js'\nimport { PageIcon } from '../../../../../../lexical/ui/icons/Page/index.js'\nimport { TrashIcon } from '../../../../../../lexical/ui/icons/Trash/index.js'\nimport { getSelectedNode } from '../../../../../../lexical/utils/getSelectedNode.js'\nimport { setFloatingElemPositionForLinkEditor } from '../../../../../../lexical/utils/setFloatingElemPositionForLinkEditor.js'\nimport { FieldsDrawer } from '../../../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDrawer } from '../../../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isAutoLinkNode } from '../../../../nodes/AutoLinkNode.js'\nimport { $createLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '../../../../nodes/LinkNode.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './commands.js'\n\nfunction preventDefault(\n event: React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLElement>,\n): void {\n event.preventDefault()\n}\n\nexport function LinkEditor({ anchorElem }: { anchorElem: HTMLElement }): React.ReactNode {\n const [editor] = useLexicalComposerContext()\n // TO-DO: There are several states that should not be state, because they\n // are derived from linkNode (linkUrl, linkLabel, stateData, isLink, isAutoLink...)\n const [linkNode, setLinkNode] = useState<LinkNode>()\n\n const editorRef = useRef<HTMLDivElement | null>(null)\n const selectedNodeRectRef = useRef<DOMRect | null>(null)\n const [linkUrl, setLinkUrl] = useState<null | string>(null)\n const [linkLabel, setLinkLabel] = useState<null | string>(null)\n\n const {\n fieldProps: { schemaPath },\n uuid,\n } = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n\n const { config, getEntityConfig } = useConfig()\n\n const { i18n, t } = useTranslation<object, 'lexical:link:loadingWithEllipsis'>()\n\n const [stateData, setStateData] = useState<\n ({ id?: string; text: string } & LinkFields) | undefined\n >()\n\n const editDepth = useEditDepth()\n const [isLink, setIsLink] = useState(false)\n const [selectedNodes, setSelectedNodes] = useState<LexicalNode[]>([])\n const locale = useLocale()\n\n const [isAutoLink, setIsAutoLink] = useState(false)\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-rich-text-link-` + uuid,\n depth: editDepth,\n })\n\n const { toggleDrawer } = useLexicalDrawer(drawerSlug)\n\n const setNotLink = useCallback(() => {\n setIsLink(false)\n if (editorRef && editorRef.current) {\n editorRef.current.style.opacity = '0'\n editorRef.current.style.transform = 'translate(-10000px, -10000px)'\n }\n setIsAutoLink(false)\n setLinkUrl(null)\n setLinkLabel(null)\n setSelectedNodes([])\n setStateData(undefined)\n }, [setIsLink, setLinkUrl, setLinkLabel, setSelectedNodes])\n\n const $updateLinkEditor = useCallback(() => {\n const selection = $getSelection()\n let selectedNodeDomRect: DOMRect | undefined\n\n if (!$isRangeSelection(selection) || !selection) {\n void setNotLink()\n return\n }\n\n // Handle the data displayed in the floating link editor & drawer when you click on a link node\n\n const focusNode = getSelectedNode(selection)\n selectedNodeDomRect = editor.getElementByKey(focusNode.getKey())?.getBoundingClientRect()\n const focusLinkParent = $findMatchingParent(focusNode, $isLinkNode)\n\n // Prevent link modal from showing if selection spans further than the link: https://github.com/facebook/lexical/issues/4064\n const badNode = selection\n .getNodes()\n .filter((node) => !$isLineBreakNode(node))\n .find((node) => {\n const linkNode = $findMatchingParent(node, $isLinkNode)\n return (\n (focusLinkParent && !focusLinkParent.is(linkNode)) ||\n (linkNode && !linkNode.is(focusLinkParent))\n )\n })\n\n if (focusLinkParent == null || badNode) {\n setNotLink()\n return\n }\n setLinkNode(focusLinkParent)\n\n const fields = focusLinkParent.getFields()\n\n // Initial state:\n const data: { text: string } & LinkFields = {\n ...fields,\n id: focusLinkParent.getID(),\n text: focusLinkParent.getTextContent(),\n }\n\n if (fields?.linkType === 'custom') {\n setLinkUrl(fields?.url ?? null)\n setLinkLabel(null)\n } else {\n // internal link\n setLinkUrl(\n `${config.routes.admin === '/' ? '' : config.routes.admin}/collections/${fields?.doc?.relationTo}/${\n fields?.doc?.value\n }`,\n )\n\n const relatedField = fields?.doc?.relationTo\n ? getEntityConfig({ collectionSlug: fields?.doc?.relationTo })\n : undefined\n if (!relatedField) {\n // Usually happens if the user removed all default fields. In this case, we let them specify the label or do not display the label at all.\n // label could be a virtual field the user added. This is useful if they want to use the link feature for things other than links.\n setLinkLabel(fields?.label ? String(fields?.label) : null)\n setLinkUrl(fields?.url ? String(fields?.url) : null)\n } else {\n const id = typeof fields.doc?.value === 'object' ? fields.doc.value.id : fields.doc?.value\n const collection = fields.doc?.relationTo\n if (!id || !collection) {\n throw new Error(`Focus link parent is missing doc.value or doc.relationTo`)\n }\n\n const loadingLabel = t('fields:linkedTo', {\n label: `${getTranslation(relatedField.labels.singular, i18n)} - ${t('lexical:link:loadingWithEllipsis', i18n)}`,\n }).replace(/<[^>]*>?/g, '')\n setLinkLabel(loadingLabel)\n\n requests\n .get(\n formatAdminURL({\n apiRoute: config.routes.api,\n path: `/${collection}/${id}`,\n serverURL: config.serverURL,\n }),\n {\n headers: {\n 'Accept-Language': i18n.language,\n },\n params: {\n depth: 0,\n locale: locale?.code,\n },\n },\n )\n .then(async (res) => {\n if (!res.ok) {\n throw new Error(`HTTP error! Status: ${res.status}`)\n }\n const data = await res.json()\n const useAsTitle = relatedField?.admin?.useAsTitle || 'id'\n const title = data[useAsTitle]\n const label = t('fields:linkedTo', {\n label: `${getTranslation(relatedField.labels.singular, i18n)} - ${title}`,\n }).replace(/<[^>]*>?/g, '')\n setLinkLabel(label)\n })\n .catch(() => {\n const label = t('fields:linkedTo', {\n label: `${getTranslation(relatedField.labels.singular, i18n)} - ${t('general:untitled', i18n)} - ID: ${id}`,\n }).replace(/<[^>]*>?/g, '')\n setLinkLabel(label)\n })\n }\n }\n\n setStateData(data)\n setIsLink(true)\n setSelectedNodes(selection ? selection?.getNodes() : [])\n\n if ($isAutoLinkNode(focusLinkParent)) {\n setIsAutoLink(true)\n } else {\n setIsAutoLink(false)\n }\n\n const editorElem = editorRef.current\n const nativeSelection = getDOMSelection(editor._window)\n const { activeElement } = document\n\n if (editorElem === null) {\n return\n }\n\n const rootElement = editor.getRootElement()\n\n if (\n nativeSelection !== null &&\n rootElement !== null &&\n rootElement.contains(nativeSelection.anchorNode)\n ) {\n if (!selectedNodeDomRect) {\n // Get the DOM rect of the selected node using the native selection. This sometimes produces the wrong\n // result, which is why we use lexical's selection preferably.\n selectedNodeDomRect = nativeSelection.getRangeAt(0).getBoundingClientRect()\n }\n\n if (selectedNodeDomRect != null) {\n selectedNodeDomRect.y += 40\n // Store the rect for positioning in useLayoutEffect after content renders\n selectedNodeRectRef.current = selectedNodeDomRect\n }\n } else if (activeElement == null || activeElement.className !== 'link-input') {\n if (rootElement !== null) {\n setFloatingElemPositionForLinkEditor(null, editorElem, anchorElem)\n }\n setLinkUrl(null)\n setLinkLabel(null)\n }\n\n return true\n }, [\n editor,\n setNotLink,\n config.routes.admin,\n config.routes.api,\n config.serverURL,\n getEntityConfig,\n t,\n i18n,\n locale?.code,\n anchorElem,\n ])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n TOGGLE_LINK_WITH_MODAL_COMMAND,\n (payload: LinkPayload) => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, payload)\n\n // Now, open the modal\n $updateLinkEditor()\n toggleDrawer()\n\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, $updateLinkEditor, toggleDrawer, drawerSlug])\n\n useEffect(() => {\n const scrollerElem = anchorElem.parentElement\n\n const update = (): void => {\n editor.getEditorState().read(() => {\n void $updateLinkEditor()\n })\n }\n\n window.addEventListener('resize', update)\n\n if (scrollerElem != null) {\n scrollerElem.addEventListener('scroll', update)\n }\n\n return () => {\n window.removeEventListener('resize', update)\n\n if (scrollerElem != null) {\n scrollerElem.removeEventListener('scroll', update)\n }\n }\n }, [anchorElem.parentElement, editor, $updateLinkEditor])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n void $updateLinkEditor()\n })\n }),\n\n editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n void $updateLinkEditor()\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(\n KEY_ESCAPE_COMMAND,\n () => {\n if (isLink) {\n setNotLink()\n\n return true\n }\n return false\n },\n COMMAND_PRIORITY_HIGH,\n ),\n )\n }, [editor, $updateLinkEditor, isLink, setNotLink])\n\n useEffect(() => {\n editor.getEditorState().read(() => {\n void $updateLinkEditor()\n })\n }, [editor, $updateLinkEditor])\n\n // Position the tooltip after React renders the link content\n useLayoutEffect(() => {\n if (!isLink || !editorRef.current || !anchorElem || !selectedNodeRectRef.current) {\n return\n }\n\n // Now the DOM has the actual link element, we can position the tooltip\n setFloatingElemPositionForLinkEditor(selectedNodeRectRef.current, editorRef.current, anchorElem)\n // linkNode dependency ensures re-positioning when clicking between different links with the same URL\n }, [linkUrl, linkLabel, isLink, anchorElem, linkNode])\n\n return (\n <React.Fragment>\n <div className=\"link-editor\" data-theme=\"dark\" ref={editorRef}>\n <div className=\"link-input\">\n {linkNode?.__fields?.linkType === 'custom' ? <LinkIcon /> : <PageIcon />}\n {linkUrl && linkUrl.length > 0 ? (\n <a className=\"link-input__url\" href={linkUrl} rel=\"noopener noreferrer\" target=\"_blank\">\n {linkLabel != null && linkLabel.length > 0 ? linkLabel : linkUrl}\n {linkNode?.__fields.newTab ? (\n <>\n <NewTabIcon size={16} /> <div className=\"link-input__divider\" />{' '}\n </>\n ) : null}\n </a>\n ) : linkLabel != null && linkLabel.length > 0 ? (\n <>\n <span className=\"link-input__label-pure\">{linkLabel}</span>\n {linkNode?.__fields.newTab ? (\n <>\n <NewTabIcon size={16} /> <div className=\"link-input__divider\" />{' '}\n </>\n ) : null}\n </>\n ) : null}\n\n {isEditable && (\n <div className=\"link-input__actions\">\n <button\n aria-label=\"Edit link\"\n className=\"link-edit\"\n onClick={(event) => {\n event.preventDefault()\n toggleDrawer()\n }}\n onMouseDown={preventDefault}\n tabIndex={0}\n type=\"button\"\n >\n <WriteIcon />\n </button>\n {!isAutoLink && (\n <button\n aria-label=\"Remove link\"\n className=\"link-trash\"\n onClick={() => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }}\n onMouseDown={preventDefault}\n tabIndex={0}\n type=\"button\"\n >\n <TrashIcon small />\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n <FieldsDrawer\n className=\"lexical-link-edit-drawer\"\n data={stateData}\n drawerSlug={drawerSlug}\n drawerTitle={t('fields:editLink')}\n featureKey=\"link\"\n handleDrawerSubmit={(fields: FormState, data: Data) => {\n const newLinkPayload = data as { text: string } & LinkFields\n\n const bareLinkFields: LinkFields = {\n ...newLinkPayload,\n }\n delete bareLinkFields.text\n\n // See: https://github.com/facebook/lexical/pull/5536. This updates autolink nodes to link nodes whenever a change was made (which is good!).\n editor.update(() => {\n const selection = $getSelection()\n let linkParent: ElementNode | null = null\n if ($isRangeSelection(selection)) {\n linkParent = getSelectedNode(selection).getParent()\n } else {\n if (selectedNodes.length) {\n linkParent = selectedNodes[0]?.getParent() ?? null\n }\n }\n\n if (linkParent && $isAutoLinkNode(linkParent)) {\n const linkNode = $createLinkNode({\n fields: bareLinkFields,\n })\n linkParent.replace(linkNode, true)\n }\n })\n\n // Needs to happen AFTER a potential auto link => link node conversion, as otherwise, the updated text to display may be lost due to\n // it being applied to the auto link node instead of the link node.\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, {\n fields: bareLinkFields,\n selectedNodes,\n text: newLinkPayload.text,\n })\n }}\n schemaPath={schemaPath}\n schemaPathSuffix=\"fields\"\n />\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AA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UAAA,GAAarH,aAAa,CAAC,EAAE,EAAEsH,SAAA,MAAe;YAChD;UACF;UAEA,IAAID,UAAA,IAAcpJ,eAAA,CAAgBoJ,UAAA,GAAa;YAC7C,MAAM1I,UAAA,GAAWT,eAAA,CAAgB;cAC/B2D,MAAA,EAAQuF;YACV;YACAC,UAAA,CAAWjE,OAAO,CAACzE,UAAA,EAAU;UAC/B;QACF;QAEA;QACA;QACAD,MAAA,CAAO0G,eAAe,CAAChH,mBAAA,EAAqB;UAC1CyD,MAAA,EAAQuF,cAAA;UACRpH,aAAA;UACAkC,IAAA,EAAMiF,cAAA,CAAejF;QACvB;MACF;MACA9C,UAAA,EAAYA,UAAA;MACZmI,gBAAA,EAAiB;;;AAIzB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","$findMatchingParent","mergeRegister","getTranslation","formatDrawerSlug","NewTabIcon","useConfig","useEditDepth","useLocale","useTranslation","WriteIcon","requests","$getSelection","$isLineBreakNode","$isRangeSelection","COMMAND_PRIORITY_HIGH","COMMAND_PRIORITY_LOW","getDOMSelection","KEY_ESCAPE_COMMAND","SELECTION_CHANGE_COMMAND","formatAdminURL","React","useCallback","useEffect","useLayoutEffect","useRef","useState","useEditorConfigContext","LinkIcon","PageIcon","TrashIcon","getSelectedNode","setFloatingElemPositionForLinkEditor","FieldsDrawer","useLexicalDrawer","$isAutoLinkNode","$createLinkNode","$isLinkNode","TOGGLE_LINK_COMMAND","TOGGLE_LINK_WITH_MODAL_COMMAND","preventDefault","event","LinkEditor","anchorElem","editor","linkNode","setLinkNode","editorRef","selectedNodeRectRef","linkUrl","setLinkUrl","linkLabel","setLinkLabel","fieldProps","schemaPath","uuid","isEditable","config","getEntityConfig","i18n","t","stateData","setStateData","editDepth","isLink","setIsLink","selectedNodes","setSelectedNodes","locale","isAutoLink","setIsAutoLink","drawerSlug","slug","depth","toggleDrawer","setNotLink","current","style","opacity","transform","undefined","$updateLinkEditor","selection","selectedNodeDomRect","focusNode","getElementByKey","getKey","getBoundingClientRect","focusLinkParent","badNode","getNodes","filter","node","find","is","fields","getFields","data","id","getID","text","getTextContent","linkType","url","routes","admin","doc","relationTo","value","relatedField","collectionSlug","label","String","collection","Error","loadingLabel","labels","singular","replace","get","apiRoute","api","path","serverURL","headers","language","params","code","then","res","ok","status","json","useAsTitle","title","catch","editorElem","nativeSelection","_window","activeElement","document","rootElement","getRootElement","contains","anchorNode","getRangeAt","y","className","registerCommand","payload","dispatchCommand","scrollerElem","parentElement","update","getEditorState","read","window","addEventListener","removeEventListener","registerUpdateListener","editorState","stopImmediatePropagation","_jsxs","Fragment","_jsx","hidden","ref","__fields","length","href","rel","target","newTab","_Fragment","size","onClick","onMouseDown","tabIndex","type","small","drawerTitle","featureKey","handleDrawerSubmit","newLinkPayload","bareLinkFields","linkParent","getParent","schemaPathSuffix"],"sources":["../../../../../../../src/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.tsx"],"sourcesContent":["'use client'\nimport type { ElementNode, LexicalNode } from 'lexical'\nimport type { Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n formatDrawerSlug,\n NewTabIcon,\n useConfig,\n useEditDepth,\n useLocale,\n useTranslation,\n WriteIcon,\n} from '@payloadcms/ui'\nimport { requests } from '@payloadcms/ui/shared'\nimport {\n $getSelection,\n $isLineBreakNode,\n $isRangeSelection,\n COMMAND_PRIORITY_HIGH,\n COMMAND_PRIORITY_LOW,\n getDOMSelection,\n KEY_ESCAPE_COMMAND,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical'\nimport { formatAdminURL } from 'payload/shared'\nimport React, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport type { LinkNode } from '../../../../nodes/LinkNode.js'\nimport type { LinkFields } from '../../../../server/schema.js'\nimport type { LinkPayload } from '../types.js'\n\nimport { useEditorConfigContext } from '../../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { LinkIcon } from '../../../../../../lexical/ui/icons/Link/index.js'\nimport { PageIcon } from '../../../../../../lexical/ui/icons/Page/index.js'\nimport { TrashIcon } from '../../../../../../lexical/ui/icons/Trash/index.js'\nimport { getSelectedNode } from '../../../../../../lexical/utils/getSelectedNode.js'\nimport { setFloatingElemPositionForLinkEditor } from '../../../../../../lexical/utils/setFloatingElemPositionForLinkEditor.js'\nimport { FieldsDrawer } from '../../../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDrawer } from '../../../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isAutoLinkNode } from '../../../../nodes/AutoLinkNode.js'\nimport { $createLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND } from '../../../../nodes/LinkNode.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './commands.js'\n\nfunction preventDefault(\n event: React.KeyboardEvent<HTMLInputElement> | React.MouseEvent<HTMLElement>,\n): void {\n event.preventDefault()\n}\n\nexport function LinkEditor({ anchorElem }: { anchorElem: HTMLElement }): React.ReactNode {\n const [editor] = useLexicalComposerContext()\n // TO-DO: There are several states that should not be state, because they\n // are derived from linkNode (linkUrl, linkLabel, stateData, isLink, isAutoLink...)\n const [linkNode, setLinkNode] = useState<LinkNode>()\n\n const editorRef = useRef<HTMLDivElement | null>(null)\n const selectedNodeRectRef = useRef<DOMRect | null>(null)\n const [linkUrl, setLinkUrl] = useState<null | string>(null)\n const [linkLabel, setLinkLabel] = useState<null | string>(null)\n\n const {\n fieldProps: { schemaPath },\n uuid,\n } = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n\n const { config, getEntityConfig } = useConfig()\n\n const { i18n, t } = useTranslation<object, 'lexical:link:loadingWithEllipsis'>()\n\n const [stateData, setStateData] = useState<\n ({ id?: string; text: string } & LinkFields) | undefined\n >()\n\n const editDepth = useEditDepth()\n const [isLink, setIsLink] = useState(false)\n const [selectedNodes, setSelectedNodes] = useState<LexicalNode[]>([])\n const locale = useLocale()\n\n const [isAutoLink, setIsAutoLink] = useState(false)\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-rich-text-link-` + uuid,\n depth: editDepth,\n })\n\n const { toggleDrawer } = useLexicalDrawer(drawerSlug)\n\n const setNotLink = useCallback(() => {\n setIsLink(false)\n if (editorRef && editorRef.current) {\n editorRef.current.style.opacity = '0'\n editorRef.current.style.transform = 'translate(-10000px, -10000px)'\n }\n setIsAutoLink(false)\n setLinkUrl(null)\n setLinkLabel(null)\n setSelectedNodes([])\n setStateData(undefined)\n }, [setIsLink, setLinkUrl, setLinkLabel, setSelectedNodes])\n\n const $updateLinkEditor = useCallback(() => {\n const selection = $getSelection()\n let selectedNodeDomRect: DOMRect | undefined\n\n if (!$isRangeSelection(selection) || !selection) {\n void setNotLink()\n return\n }\n\n // Handle the data displayed in the floating link editor & drawer when you click on a link node\n\n const focusNode = getSelectedNode(selection)\n selectedNodeDomRect = editor.getElementByKey(focusNode.getKey())?.getBoundingClientRect()\n const focusLinkParent = $findMatchingParent(focusNode, $isLinkNode)\n\n // Prevent link modal from showing if selection spans further than the link: https://github.com/facebook/lexical/issues/4064\n const badNode = selection\n .getNodes()\n .filter((node) => !$isLineBreakNode(node))\n .find((node) => {\n const linkNode = $findMatchingParent(node, $isLinkNode)\n return (\n (focusLinkParent && !focusLinkParent.is(linkNode)) ||\n (linkNode && !linkNode.is(focusLinkParent))\n )\n })\n\n if (focusLinkParent == null || badNode) {\n setNotLink()\n return\n }\n setLinkNode(focusLinkParent)\n\n const fields = focusLinkParent.getFields()\n\n // Initial state:\n const data: { text: string } & LinkFields = {\n ...fields,\n id: focusLinkParent.getID(),\n text: focusLinkParent.getTextContent(),\n }\n\n if (fields?.linkType === 'custom') {\n setLinkUrl(fields?.url ?? null)\n setLinkLabel(null)\n } else {\n // internal link\n setLinkUrl(\n `${config.routes.admin === '/' ? '' : config.routes.admin}/collections/${fields?.doc?.relationTo}/${\n fields?.doc?.value\n }`,\n )\n\n const relatedField = fields?.doc?.relationTo\n ? getEntityConfig({ collectionSlug: fields?.doc?.relationTo })\n : undefined\n if (!relatedField) {\n // Usually happens if the user removed all default fields. In this case, we let them specify the label or do not display the label at all.\n // label could be a virtual field the user added. This is useful if they want to use the link feature for things other than links.\n setLinkLabel(fields?.label ? String(fields?.label) : null)\n setLinkUrl(fields?.url ? String(fields?.url) : null)\n } else {\n const id = typeof fields.doc?.value === 'object' ? fields.doc.value.id : fields.doc?.value\n const collection = fields.doc?.relationTo\n if (!id || !collection) {\n throw new Error(`Focus link parent is missing doc.value or doc.relationTo`)\n }\n\n const loadingLabel = t('fields:linkedTo', {\n label: `${getTranslation(relatedField.labels.singular, i18n)} - ${t('lexical:link:loadingWithEllipsis', i18n)}`,\n }).replace(/<[^>]*>?/g, '')\n setLinkLabel(loadingLabel)\n\n requests\n .get(\n formatAdminURL({\n apiRoute: config.routes.api,\n path: `/${collection}/${id}`,\n serverURL: config.serverURL,\n }),\n {\n headers: {\n 'Accept-Language': i18n.language,\n },\n params: {\n depth: 0,\n locale: locale?.code,\n },\n },\n )\n .then(async (res) => {\n if (!res.ok) {\n throw new Error(`HTTP error! Status: ${res.status}`)\n }\n const data = await res.json()\n const useAsTitle = relatedField?.admin?.useAsTitle || 'id'\n const title = data[useAsTitle]\n const label = t('fields:linkedTo', {\n label: `${getTranslation(relatedField.labels.singular, i18n)} - ${title}`,\n }).replace(/<[^>]*>?/g, '')\n setLinkLabel(label)\n })\n .catch(() => {\n const label = t('fields:linkedTo', {\n label: `${getTranslation(relatedField.labels.singular, i18n)} - ${t('general:untitled', i18n)} - ID: ${id}`,\n }).replace(/<[^>]*>?/g, '')\n setLinkLabel(label)\n })\n }\n }\n\n setStateData(data)\n setIsLink(true)\n setSelectedNodes(selection ? selection?.getNodes() : [])\n\n if ($isAutoLinkNode(focusLinkParent)) {\n setIsAutoLink(true)\n } else {\n setIsAutoLink(false)\n }\n\n const editorElem = editorRef.current\n const nativeSelection = getDOMSelection(editor._window)\n const { activeElement } = document\n\n if (editorElem === null) {\n return\n }\n\n const rootElement = editor.getRootElement()\n\n if (\n nativeSelection !== null &&\n rootElement !== null &&\n rootElement.contains(nativeSelection.anchorNode)\n ) {\n if (!selectedNodeDomRect) {\n // Get the DOM rect of the selected node using the native selection. This sometimes produces the wrong\n // result, which is why we use lexical's selection preferably.\n selectedNodeDomRect = nativeSelection.getRangeAt(0).getBoundingClientRect()\n }\n\n if (selectedNodeDomRect != null) {\n selectedNodeDomRect.y += 40\n // Store the rect for positioning in useLayoutEffect after content renders\n selectedNodeRectRef.current = selectedNodeDomRect\n }\n } else if (activeElement == null || activeElement.className !== 'link-input') {\n if (rootElement !== null) {\n setFloatingElemPositionForLinkEditor(null, editorElem, anchorElem)\n }\n setLinkUrl(null)\n setLinkLabel(null)\n }\n\n return true\n }, [\n editor,\n setNotLink,\n config.routes.admin,\n config.routes.api,\n config.serverURL,\n getEntityConfig,\n t,\n i18n,\n locale?.code,\n anchorElem,\n ])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n TOGGLE_LINK_WITH_MODAL_COMMAND,\n (payload: LinkPayload) => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, payload)\n\n // Now, open the modal\n $updateLinkEditor()\n toggleDrawer()\n\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, $updateLinkEditor, toggleDrawer, drawerSlug])\n\n useEffect(() => {\n const scrollerElem = anchorElem.parentElement\n\n const update = (): void => {\n editor.getEditorState().read(() => {\n void $updateLinkEditor()\n })\n }\n\n window.addEventListener('resize', update)\n\n if (scrollerElem != null) {\n scrollerElem.addEventListener('scroll', update)\n }\n\n return () => {\n window.removeEventListener('resize', update)\n\n if (scrollerElem != null) {\n scrollerElem.removeEventListener('scroll', update)\n }\n }\n }, [anchorElem.parentElement, editor, $updateLinkEditor])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n void $updateLinkEditor()\n })\n }),\n\n editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n void $updateLinkEditor()\n return true\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(\n KEY_ESCAPE_COMMAND,\n (event) => {\n if (isLink) {\n event.preventDefault()\n event.stopImmediatePropagation()\n setNotLink()\n\n return true\n }\n return false\n },\n COMMAND_PRIORITY_HIGH,\n ),\n )\n }, [editor, $updateLinkEditor, isLink, setNotLink])\n\n useEffect(() => {\n editor.getEditorState().read(() => {\n void $updateLinkEditor()\n })\n }, [editor, $updateLinkEditor])\n\n // Position the tooltip after React renders the link content\n useLayoutEffect(() => {\n if (!isLink || !editorRef.current || !anchorElem || !selectedNodeRectRef.current) {\n return\n }\n\n // Now the DOM has the actual link element, we can position the tooltip\n setFloatingElemPositionForLinkEditor(selectedNodeRectRef.current, editorRef.current, anchorElem)\n // linkNode dependency ensures re-positioning when clicking between different links with the same URL\n }, [linkUrl, linkLabel, isLink, anchorElem, linkNode])\n\n return (\n <React.Fragment>\n <div className=\"link-editor\" data-theme=\"dark\" hidden={!isLink} ref={editorRef}>\n <div className=\"link-input\">\n {linkNode?.__fields?.linkType === 'custom' ? <LinkIcon /> : <PageIcon />}\n {linkUrl && linkUrl.length > 0 ? (\n <a className=\"link-input__url\" href={linkUrl} rel=\"noopener noreferrer\" target=\"_blank\">\n {linkLabel != null && linkLabel.length > 0 ? linkLabel : linkUrl}\n {linkNode?.__fields.newTab ? (\n <>\n <NewTabIcon size={16} /> <div className=\"link-input__divider\" />{' '}\n </>\n ) : null}\n </a>\n ) : linkLabel != null && linkLabel.length > 0 ? (\n <>\n <span className=\"link-input__label-pure\">{linkLabel}</span>\n {linkNode?.__fields.newTab ? (\n <>\n <NewTabIcon size={16} /> <div className=\"link-input__divider\" />{' '}\n </>\n ) : null}\n </>\n ) : null}\n\n {isEditable && (\n <div className=\"link-input__actions\">\n <button\n aria-label=\"Edit link\"\n className=\"link-edit\"\n onClick={(event) => {\n event.preventDefault()\n toggleDrawer()\n }}\n onMouseDown={preventDefault}\n tabIndex={0}\n type=\"button\"\n >\n <WriteIcon />\n </button>\n {!isAutoLink && (\n <button\n aria-label=\"Remove link\"\n className=\"link-trash\"\n onClick={() => {\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }}\n onMouseDown={preventDefault}\n tabIndex={0}\n type=\"button\"\n >\n <TrashIcon small />\n </button>\n )}\n </div>\n )}\n </div>\n </div>\n <FieldsDrawer\n className=\"lexical-link-edit-drawer\"\n data={stateData}\n drawerSlug={drawerSlug}\n drawerTitle={t('fields:editLink')}\n featureKey=\"link\"\n handleDrawerSubmit={(fields: FormState, data: Data) => {\n const newLinkPayload = data as { text: string } & LinkFields\n\n const bareLinkFields: LinkFields = {\n ...newLinkPayload,\n }\n delete bareLinkFields.text\n\n // See: https://github.com/facebook/lexical/pull/5536. This updates autolink nodes to link nodes whenever a change was made (which is good!).\n editor.update(() => {\n const selection = $getSelection()\n let linkParent: ElementNode | null = null\n if ($isRangeSelection(selection)) {\n linkParent = getSelectedNode(selection).getParent()\n } else {\n if (selectedNodes.length) {\n linkParent = selectedNodes[0]?.getParent() ?? null\n }\n }\n\n if (linkParent && $isAutoLinkNode(linkParent)) {\n const linkNode = $createLinkNode({\n fields: bareLinkFields,\n })\n linkParent.replace(linkNode, true)\n }\n })\n\n // Needs to happen AFTER a potential auto link => link node conversion, as otherwise, the updated text to display may be lost due to\n // it being applied to the auto link node instead of the link node.\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, {\n fields: bareLinkFields,\n selectedNodes,\n text: newLinkPayload.text,\n })\n }}\n schemaPath={schemaPath}\n schemaPathSuffix=\"fields\"\n />\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,mBAAmB,EAAEC,aAAa,QA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YACL,IAAIxH,aAAA,CAAcsG,MAAM,EAAE;cACxBiB,UAAA,GAAavH,aAAa,CAAC,EAAE,EAAEwH,SAAA,MAAe;YAChD;UACF;UAEA,IAAID,UAAA,IAActJ,eAAA,CAAgBsJ,UAAA,GAAa;YAC7C,MAAM5I,UAAA,GAAWT,eAAA,CAAgB;cAC/B2D,MAAA,EAAQyF;YACV;YACAC,UAAA,CAAWnE,OAAO,CAACzE,UAAA,EAAU;UAC/B;QACF;QAEA;QACA;QACAD,MAAA,CAAO0G,eAAe,CAAChH,mBAAA,EAAqB;UAC1CyD,MAAA,EAAQyF,cAAA;UACRtH,aAAA;UACAkC,IAAA,EAAMmF,cAAA,CAAenF;QACvB;MACF;MACA9C,UAAA,EAAYA,UAAA;MACZqI,gBAAA,EAAiB;;;AAIzB","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ import { createAutoLinkNodeJSONSchema, createLinkNodeJSONSchema } from './schema
|
|
|
10
10
|
import { transformExtraFields } from './transformExtraFields.js';
|
|
11
11
|
import { linkValidation } from './validate.js';
|
|
12
12
|
export const LinkFeature = createServerFeature({
|
|
13
|
-
feature:
|
|
13
|
+
feature: ({
|
|
14
14
|
config: _config,
|
|
15
15
|
isRoot,
|
|
16
16
|
parentIsLocalized,
|
|
@@ -21,7 +21,7 @@ export const LinkFeature = createServerFeature({
|
|
|
21
21
|
}
|
|
22
22
|
const validRelationships = _config.collections.map(c => c.slug) || [];
|
|
23
23
|
const _transformedFields = transformExtraFields(props.fields ? props.fields : null, _config, props.enabledCollections, props.disabledCollections, props.maxDepth);
|
|
24
|
-
const sanitizedFields =
|
|
24
|
+
const sanitizedFields = sanitizeFields({
|
|
25
25
|
config: _config,
|
|
26
26
|
fields: _transformedFields,
|
|
27
27
|
parentIsLocalized,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["sanitizeFields","createServerFeature","createNode","createPayloadLinkTransformer","AutoLinkNode","LinkNode","linkPopulationPromiseHOC","i18n","createAutoLinkNodeJSONSchema","createLinkNodeJSONSchema","transformExtraFields","linkValidation","LinkFeature","feature","config","_config","isRoot","parentIsLocalized","props","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","sanitizedFieldsWithoutText","filter","field","name","linkTypeField","linkURLField","defaultLinkType","defaultValue","undefined","defaultLinkURL","ClientFeature","clientFeatureProps","disableAutoLinks","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","markdownTransformers","internalDocToHref","nodes","jsonSchema","node","validations","getSubFields","getSubFieldsData","graphQLPopulationPromises","Boolean","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/link/server/index.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FieldAffectingData,\n FieldSchemaMap,\n SanitizedConfig,\n} from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { NodeWithHooks } from '../../typesServer.js'\nimport type { ClientProps } from '../client/index.js'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { createPayloadLinkTransformer } from '../markdownTransformer.js'\nimport { AutoLinkNode } from '../nodes/AutoLinkNode.js'\nimport { LinkNode } from '../nodes/LinkNode.js'\nimport { linkPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport {\n createAutoLinkNodeJSONSchema,\n createLinkNodeJSONSchema,\n type SerializedLinkNode,\n} from './schema.js'\nimport { transformExtraFields } from './transformExtraFields.js'\nimport { linkValidation } from './validate.js'\n\nexport type { LinkFields, SerializedAutoLinkNode, SerializedLinkNode } from './schema.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: CollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: CollectionSlug[]\n }\n\nexport type LinkFeatureServerProps = {\n /**\n * Disables the automatic creation of links from URLs pasted into the editor, as well\n * as auto link nodes.\n *\n * If set to 'creationOnly', only the creation of new auto link nodes will be disabled.\n * Existing auto link nodes will still be editable.\n *\n * @default false\n */\n disableAutoLinks?: 'creationOnly' | true\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldAffectingData[]\n }) => (Field | FieldAffectingData)[])\n | Field[]\n /**\n * Resolves an internal link node to a URL string for use in the markdown converter.\n * Internal links store a doc reference rather than a URL, so without this the markdown\n * output will have an empty href: `[link text]()`.\n */\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n /**\n * Sets a maximum population depth for the internal doc default field of link, regardless of the remaining depth when the field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveLinkCollectionsProps\n\nexport const LinkFeature = createServerFeature<\n LinkFeatureServerProps,\n LinkFeatureServerProps,\n ClientProps\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = {}\n }\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n props.fields ? props.fields : null,\n _config,\n props.enabledCollections,\n props.disabledCollections,\n props.maxDepth,\n )\n\n const sanitizedFields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n props.fields = sanitizedFields\n\n // the text field is not included in the node data.\n // Thus, for tasks like validation, we do not want to pass it a text field in the schema which will never have data.\n // Otherwise, it will cause a validation error (field is required).\n const sanitizedFieldsWithoutText = sanitizedFields.filter(\n (field) => !('name' in field) || field.name !== 'text',\n )\n\n let linkTypeField: Field | null = null\n let linkURLField: Field | null = null\n\n for (const field of sanitizedFields) {\n if ('name' in field && field.name === 'linkType') {\n linkTypeField = field\n }\n\n if ('name' in field && field.name === 'url') {\n linkURLField = field\n }\n }\n\n const defaultLinkType = linkTypeField\n ? 'defaultValue' in linkTypeField && typeof linkTypeField.defaultValue === 'string'\n ? linkTypeField.defaultValue\n : 'custom'\n : undefined\n\n const defaultLinkURL = linkURLField\n ? 'defaultValue' in linkURLField && typeof linkURLField.defaultValue === 'string'\n ? linkURLField.defaultValue\n : 'https://'\n : undefined\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#LinkFeatureClient',\n clientFeatureProps: {\n defaultLinkType,\n defaultLinkURL,\n disableAutoLinks: props.disableAutoLinks,\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ClientProps,\n generateSchemaMap: () => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [\n createPayloadLinkTransformer({ internalDocToHref: props.internalDocToHref }),\n ],\n nodes: [\n props?.disableAutoLinks === true\n ? null\n : createNode({\n jsonSchema: createAutoLinkNodeJSONSchema(sanitizedFieldsWithoutText),\n node: AutoLinkNode,\n // Since AutoLinkNodes are just internal links, they need no hooks or graphQL population promises\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n createNode({\n getSubFields: () => {\n return sanitizedFieldsWithoutText\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [linkPopulationPromiseHOC(props)],\n jsonSchema: createLinkNodeJSONSchema(sanitizedFieldsWithoutText),\n node: LinkNode,\n validations: [linkValidation(props, sanitiz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ACDC,KAAA,EAAO,CACLnC,KAAA,EAAOyB,gBAAA,KAAqB,OACxB,OACAzC,UAAA,CAAW;QACToD,UAAA,EAAY9C,4BAAA,CAA6BuB,0BAAA;QACzCwB,IAAA,EAAMnD,YAAA;QACN;QACAoD,WAAA,EAAa,CAAC7C,cAAA,CAAeO,KAAA,EAAOa,0BAAA;MACtC,IACJ7B,UAAA,CAAW;QACTuD,YAAA,EAAcA,CAAA;UACZ,OAAO1B,0BAAA;QACT;QACA2B,gBAAA,EAAkBA,CAAC;UAAEH;QAAI,CAAE;UACzB,OAAOA,IAAA,EAAM9B,MAAA;QACf;QACAkC,yBAAA,EAA2B,CAACrD,wBAAA,CAAyBY,KAAA,EAAO;QAC5DoC,UAAA,EAAY7C,wBAAA,CAAyBsB,0BAAA;QACrCwB,IAAA,EAAMlD,QAAA;QACNmD,WAAA,EAAa,CAAC7C,cAAA,CAAeO,KAAA,EAAOa,0BAAA;MACtC,GACD,CAACC,MAAM,CAAC4B,OAAA;MACTC,2BAAA,EAA6B3C;IAC/B;EACF;EACA4C,GAAA,EAAK;AACP","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["sanitizeFields","createServerFeature","createNode","createPayloadLinkTransformer","AutoLinkNode","LinkNode","linkPopulationPromiseHOC","i18n","createAutoLinkNodeJSONSchema","createLinkNodeJSONSchema","transformExtraFields","linkValidation","LinkFeature","feature","config","_config","isRoot","parentIsLocalized","props","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","sanitizedFieldsWithoutText","filter","field","name","linkTypeField","linkURLField","defaultLinkType","defaultValue","undefined","defaultLinkURL","ClientFeature","clientFeatureProps","disableAutoLinks","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","markdownTransformers","internalDocToHref","nodes","jsonSchema","node","validations","getSubFields","getSubFieldsData","graphQLPopulationPromises","Boolean","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/link/server/index.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FieldAffectingData,\n FieldSchemaMap,\n SanitizedConfig,\n} from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { NodeWithHooks } from '../../typesServer.js'\nimport type { ClientProps } from '../client/index.js'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { createPayloadLinkTransformer } from '../markdownTransformer.js'\nimport { AutoLinkNode } from '../nodes/AutoLinkNode.js'\nimport { LinkNode } from '../nodes/LinkNode.js'\nimport { linkPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport {\n createAutoLinkNodeJSONSchema,\n createLinkNodeJSONSchema,\n type SerializedLinkNode,\n} from './schema.js'\nimport { transformExtraFields } from './transformExtraFields.js'\nimport { linkValidation } from './validate.js'\n\nexport type { LinkFields, SerializedAutoLinkNode, SerializedLinkNode } from './schema.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: CollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: CollectionSlug[]\n }\n\nexport type LinkFeatureServerProps = {\n /**\n * Disables the automatic creation of links from URLs pasted into the editor, as well\n * as auto link nodes.\n *\n * If set to 'creationOnly', only the creation of new auto link nodes will be disabled.\n * Existing auto link nodes will still be editable.\n *\n * @default false\n */\n disableAutoLinks?: 'creationOnly' | true\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldAffectingData[]\n }) => (Field | FieldAffectingData)[])\n | Field[]\n /**\n * Resolves an internal link node to a URL string for use in the markdown converter.\n * Internal links store a doc reference rather than a URL, so without this the markdown\n * output will have an empty href: `[link text]()`.\n */\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n /**\n * Sets a maximum population depth for the internal doc default field of link, regardless of the remaining depth when the field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveLinkCollectionsProps\n\nexport const LinkFeature = createServerFeature<\n LinkFeatureServerProps,\n LinkFeatureServerProps,\n ClientProps\n>({\n feature: ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = {}\n }\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n props.fields ? props.fields : null,\n _config,\n props.enabledCollections,\n props.disabledCollections,\n props.maxDepth,\n )\n\n const sanitizedFields = sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n props.fields = sanitizedFields\n\n // the text field is not included in the node data.\n // Thus, for tasks like validation, we do not want to pass it a text field in the schema which will never have data.\n // Otherwise, it will cause a validation error (field is required).\n const sanitizedFieldsWithoutText = sanitizedFields.filter(\n (field) => !('name' in field) || field.name !== 'text',\n )\n\n let linkTypeField: Field | null = null\n let linkURLField: Field | null = null\n\n for (const field of sanitizedFields) {\n if ('name' in field && field.name === 'linkType') {\n linkTypeField = field\n }\n\n if ('name' in field && field.name === 'url') {\n linkURLField = field\n }\n }\n\n const defaultLinkType = linkTypeField\n ? 'defaultValue' in linkTypeField && typeof linkTypeField.defaultValue === 'string'\n ? linkTypeField.defaultValue\n : 'custom'\n : undefined\n\n const defaultLinkURL = linkURLField\n ? 'defaultValue' in linkURLField && typeof linkURLField.defaultValue === 'string'\n ? linkURLField.defaultValue\n : 'https://'\n : undefined\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#LinkFeatureClient',\n clientFeatureProps: {\n defaultLinkType,\n defaultLinkURL,\n disableAutoLinks: props.disableAutoLinks,\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ClientProps,\n generateSchemaMap: () => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [\n createPayloadLinkTransformer({ internalDocToHref: props.internalDocToHref }),\n ],\n nodes: [\n props?.disableAutoLinks === true\n ? null\n : createNode({\n jsonSchema: createAutoLinkNodeJSONSchema(sanitizedFieldsWithoutText),\n node: AutoLinkNode,\n // Since AutoLinkNodes are just internal links, they need no hooks or graphQL population promises\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n createNode({\n getSubFields: () => {\n return sanitizedFieldsWithoutText\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [linkPopulationPromiseHOC(props)],\n jsonSchema: createLinkNodeJSONSchema(sanitizedFieldsWithoutText),\n node: LinkNode,\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n ].filter(Boolean) as Array<NodeWithHooks>,\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'link',\n})\n"],"mappings":"AASA,SAASA,cAAc,QAAQ;AAK/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,YAAY,QAAQ;AAC7B,SAASC,QAAQ,QAAQ;AACzB,SAASC,wBAAwB,QAAQ;AACzC,SAASC,IAAI,QAAQ;AACrB,SACEC,4BAA4B,EAC5BC,wBAAwB,QAEnB;AACP,SAASC,oBAAoB,QAAQ;AACrC,SAASC,cAAc,QAAQ;AA8D/B,OAAO,MAAMC,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AAA,EAAY7C,wBAAA,CAAyBsB,0BAAA;QACrCwB,IAAA,EAAMlD,QAAA;QACNmD,WAAA,EAAa,CAAC7C,cAAA,CAAeO,KAAA,EAAOa,0BAAA;MACtC,GACD,CAACC,MAAM,CAAC4B,OAAA;MACTC,2BAAA,EAA6B3C;IAC/B;EACF;EACA4C,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/lists/checklist/server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/lists/checklist/server/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB,kGAuB3B,CAAA"}
|
|
@@ -4,6 +4,7 @@ import { createServerFeature } from '../../../../utilities/createServerFeature.j
|
|
|
4
4
|
import { createNode } from '../../../typeUtilities.js';
|
|
5
5
|
import { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js';
|
|
6
6
|
import { shouldRegisterListBaseNodes } from '../../shared/shouldRegisterListBaseNodes.js';
|
|
7
|
+
import { listItemValidation, listValidation } from '../../shared/validate.js';
|
|
7
8
|
import { i18n } from './i18n.js';
|
|
8
9
|
export const ChecklistFeature = createServerFeature({
|
|
9
10
|
feature: ({
|
|
@@ -15,10 +16,12 @@ export const ChecklistFeature = createServerFeature({
|
|
|
15
16
|
markdownTransformers: [CHECK_LIST],
|
|
16
17
|
nodes: shouldRegisterListBaseNodes('checklist', featureProviderMap) ? [createNode({
|
|
17
18
|
jsonSchema: listNodeJSONSchema,
|
|
18
|
-
node: ListNode
|
|
19
|
+
node: ListNode,
|
|
20
|
+
validations: [listValidation]
|
|
19
21
|
}), createNode({
|
|
20
22
|
jsonSchema: listItemNodeJSONSchema,
|
|
21
|
-
node: ListItemNode
|
|
23
|
+
node: ListItemNode,
|
|
24
|
+
validations: [listItemValidation]
|
|
22
25
|
})] : []
|
|
23
26
|
};
|
|
24
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["ListItemNode","ListNode","CHECK_LIST","createServerFeature","createNode","listItemNodeJSONSchema","listNodeJSONSchema","shouldRegisterListBaseNodes","i18n","ChecklistFeature","feature","featureProviderMap","ClientFeature","markdownTransformers","nodes","jsonSchema","node","key"],"sources":["../../../../../src/features/lists/checklist/server/index.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { CHECK_LIST } from '@lexical/markdown'\n\nimport { createServerFeature } from '../../../../utilities/createServerFeature.js'\nimport { createNode } from '../../../typeUtilities.js'\nimport { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js'\nimport { shouldRegisterListBaseNodes } from '../../shared/shouldRegisterListBaseNodes.js'\nimport { i18n } from './i18n.js'\n\nexport const ChecklistFeature = createServerFeature({\n feature: ({ featureProviderMap }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#ChecklistFeatureClient',\n i18n,\n markdownTransformers: [CHECK_LIST],\n nodes: shouldRegisterListBaseNodes('checklist', featureProviderMap)\n ? [\n createNode({\n jsonSchema: listNodeJSONSchema,\n node: ListNode,\n }),\n createNode({\n jsonSchema: listItemNodeJSONSchema,\n node: ListItemNode,\n }),\n ]\n : [],\n }\n },\n key: 'checklist',\n})\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,UAAU,QAAQ;AAE3B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ;AAC3D,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,gBAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["ListItemNode","ListNode","CHECK_LIST","createServerFeature","createNode","listItemNodeJSONSchema","listNodeJSONSchema","shouldRegisterListBaseNodes","listItemValidation","listValidation","i18n","ChecklistFeature","feature","featureProviderMap","ClientFeature","markdownTransformers","nodes","jsonSchema","node","validations","key"],"sources":["../../../../../src/features/lists/checklist/server/index.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { CHECK_LIST } from '@lexical/markdown'\n\nimport { createServerFeature } from '../../../../utilities/createServerFeature.js'\nimport { createNode } from '../../../typeUtilities.js'\nimport { listItemNodeJSONSchema, listNodeJSONSchema } from '../../shared/schema.js'\nimport { shouldRegisterListBaseNodes } from '../../shared/shouldRegisterListBaseNodes.js'\nimport { listItemValidation, listValidation } from '../../shared/validate.js'\nimport { i18n } from './i18n.js'\n\nexport const ChecklistFeature = createServerFeature({\n feature: ({ featureProviderMap }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#ChecklistFeatureClient',\n i18n,\n markdownTransformers: [CHECK_LIST],\n nodes: shouldRegisterListBaseNodes('checklist', featureProviderMap)\n ? [\n createNode({\n jsonSchema: listNodeJSONSchema,\n node: ListNode,\n validations: [listValidation],\n }),\n createNode({\n jsonSchema: listItemNodeJSONSchema,\n node: ListItemNode,\n validations: [listItemValidation],\n }),\n ]\n : [],\n }\n },\n key: 'checklist',\n})\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,UAAU,QAAQ;AAE3B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,sBAAsB,EAAEC,kBAAkB,QAAQ;AAC3D,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,kBAAkB,EAAEC,cAAc,QAAQ;AACnD,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,gBAAA,GAAmBR,mBAAA,CAAoB;EAClDS,OAAA,EAASA,CAAC;IAAEC;EAAkB,CAAE;IAC9B,OAAO;MACLC,aAAA,EAAe;MACfJ,IAAA;MACAK,oBAAA,EAAsB,CAACb,UAAA,CAAW;MAClCc,KAAA,EAAOT,2BAAA,CAA4B,aAAaM,kBAAA,IAC5C,CACET,UAAA,CAAW;QACTa,UAAA,EAAYX,kBAAA;QACZY,IAAA,EAAMjB,QAAA;QACNkB,WAAA,EAAa,CAACV,cAAA;MAChB,IACAL,UAAA,CAAW;QACTa,UAAA,EAAYZ,sBAAA;QACZa,IAAA,EAAMlB,YAAA;QACNmB,WAAA,EAAa,CAACX,kBAAA;MAChB,GACD,GACD;IACN;EACF;EACAY,GAAA,EAAK;AACP","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/lists/orderedList/server/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/lists/orderedList/server/index.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,kBAAkB,kGAuB7B,CAAA"}
|