@payloadcms/richtext-lexical 0.1.0-beta.0
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/LICENSE.md +22 -0
- package/dist/cell/index.d.ts +6 -0
- package/dist/cell/index.d.ts.map +1 -0
- package/dist/cell/index.js +86 -0
- package/dist/field/Field.d.ts +6 -0
- package/dist/field/Field.d.ts.map +1 -0
- package/dist/field/Field.js +138 -0
- package/dist/field/features/BlockQuote/index.d.ts +3 -0
- package/dist/field/features/BlockQuote/index.d.ts.map +1 -0
- package/dist/field/features/BlockQuote/index.js +82 -0
- package/dist/field/features/BlockQuote/markdownTransformer.d.ts +3 -0
- package/dist/field/features/BlockQuote/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/BlockQuote/markdownTransformer.js +50 -0
- package/dist/field/features/Blocks/component/FormSavePlugin.d.ts +12 -0
- package/dist/field/features/Blocks/component/FormSavePlugin.d.ts.map +1 -0
- package/dist/field/features/Blocks/component/FormSavePlugin.js +33 -0
- package/dist/field/features/Blocks/component/index.d.ts +14 -0
- package/dist/field/features/Blocks/component/index.d.ts.map +1 -0
- package/dist/field/features/Blocks/component/index.js +176 -0
- package/dist/field/features/Blocks/drawer/index.d.ts +10 -0
- package/dist/field/features/Blocks/drawer/index.d.ts.map +1 -0
- package/dist/field/features/Blocks/drawer/index.js +140 -0
- package/dist/field/features/Blocks/index.d.ts +8 -0
- package/dist/field/features/Blocks/index.d.ts.map +1 -0
- package/dist/field/features/Blocks/index.js +80 -0
- package/dist/field/features/Blocks/nodes/BlocksNode.d.ts +38 -0
- package/dist/field/features/Blocks/nodes/BlocksNode.d.ts.map +1 -0
- package/dist/field/features/Blocks/nodes/BlocksNode.js +104 -0
- package/dist/field/features/Blocks/plugin/index.d.ts +7 -0
- package/dist/field/features/Blocks/plugin/index.d.ts.map +1 -0
- package/dist/field/features/Blocks/plugin/index.js +86 -0
- package/dist/field/features/Heading/index.d.ts +8 -0
- package/dist/field/features/Heading/index.d.ts.map +1 -0
- package/dist/field/features/Heading/index.js +104 -0
- package/dist/field/features/Heading/markdownTransformer.d.ts +3 -0
- package/dist/field/features/Heading/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/Heading/markdownTransformer.js +32 -0
- package/dist/field/features/Link/afterReadPromise.d.ts +5 -0
- package/dist/field/features/Link/afterReadPromise.d.ts.map +1 -0
- package/dist/field/features/Link/afterReadPromise.js +51 -0
- package/dist/field/features/Link/drawer/baseFields.d.ts +4 -0
- package/dist/field/features/Link/drawer/baseFields.d.ts.map +1 -0
- package/dist/field/features/Link/drawer/baseFields.js +91 -0
- package/dist/field/features/Link/drawer/index.d.ts +5 -0
- package/dist/field/features/Link/drawer/index.d.ts.map +1 -0
- package/dist/field/features/Link/drawer/index.js +40 -0
- package/dist/field/features/Link/drawer/types.d.ts +8 -0
- package/dist/field/features/Link/drawer/types.d.ts.map +1 -0
- package/dist/field/features/Link/drawer/types.js +6 -0
- package/dist/field/features/Link/index.d.ts +14 -0
- package/dist/field/features/Link/index.d.ts.map +1 -0
- package/dist/field/features/Link/index.js +117 -0
- package/dist/field/features/Link/nodes/AutoLinkNode.d.ts +16 -0
- package/dist/field/features/Link/nodes/AutoLinkNode.d.ts.map +1 -0
- package/dist/field/features/Link/nodes/AutoLinkNode.js +75 -0
- package/dist/field/features/Link/nodes/LinkNode.d.ts +55 -0
- package/dist/field/features/Link/nodes/LinkNode.d.ts.map +1 -0
- package/dist/field/features/Link/nodes/LinkNode.js +368 -0
- package/dist/field/features/Link/plugins/autoLink/index.d.ts +26 -0
- package/dist/field/features/Link/plugins/autoLink/index.d.ts.map +1 -0
- package/dist/field/features/Link/plugins/autoLink/index.js +230 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.d.ts +9 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/LinkEditor/index.js +301 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/index.d.ts +7 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/index.d.ts.map +1 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/index.js +61 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/types.d.ts +13 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/types.d.ts.map +1 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/types.js +6 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/utilities.d.ts +12 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -0
- package/dist/field/features/Link/plugins/floatingLinkEditor/utilities.js +44 -0
- package/dist/field/features/Link/plugins/link/index.d.ts +9 -0
- package/dist/field/features/Link/plugins/link/index.d.ts.map +1 -0
- package/dist/field/features/Link/plugins/link/index.js +74 -0
- package/dist/field/features/Paragraph/index.d.ts +3 -0
- package/dist/field/features/Paragraph/index.d.ts.map +1 -0
- package/dist/field/features/Paragraph/index.js +74 -0
- package/dist/field/features/Relationship/afterReadPromise.d.ts +4 -0
- package/dist/field/features/Relationship/afterReadPromise.d.ts.map +1 -0
- package/dist/field/features/Relationship/afterReadPromise.js +34 -0
- package/dist/field/features/Relationship/drawer/index.d.ts +14 -0
- package/dist/field/features/Relationship/drawer/index.d.ts.map +1 -0
- package/dist/field/features/Relationship/drawer/index.js +135 -0
- package/dist/field/features/Relationship/index.d.ts +4 -0
- package/dist/field/features/Relationship/index.d.ts.map +1 -0
- package/dist/field/features/Relationship/index.js +72 -0
- package/dist/field/features/Relationship/nodes/RelationshipNode.d.ts +34 -0
- package/dist/field/features/Relationship/nodes/RelationshipNode.d.ts.map +1 -0
- package/dist/field/features/Relationship/nodes/RelationshipNode.js +165 -0
- package/dist/field/features/Relationship/nodes/components/RelationshipComponent.d.ts +14 -0
- package/dist/field/features/Relationship/nodes/components/RelationshipComponent.d.ts.map +1 -0
- package/dist/field/features/Relationship/nodes/components/RelationshipComponent.js +158 -0
- package/dist/field/features/Relationship/plugins/index.d.ts +6 -0
- package/dist/field/features/Relationship/plugins/index.d.ts.map +1 -0
- package/dist/field/features/Relationship/plugins/index.js +88 -0
- package/dist/field/features/Relationship/utils/EnabledRelationshipsCondition.d.ts +3 -0
- package/dist/field/features/Relationship/utils/EnabledRelationshipsCondition.d.ts.map +1 -0
- package/dist/field/features/Relationship/utils/EnabledRelationshipsCondition.js +75 -0
- package/dist/field/features/Upload/afterReadPromise.d.ts +5 -0
- package/dist/field/features/Upload/afterReadPromise.d.ts.map +1 -0
- package/dist/field/features/Upload/afterReadPromise.js +51 -0
- package/dist/field/features/Upload/component/ExtraFieldsDrawer/index.d.ts +12 -0
- package/dist/field/features/Upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -0
- package/dist/field/features/Upload/component/ExtraFieldsDrawer/index.js +129 -0
- package/dist/field/features/Upload/component/index.d.ts +10 -0
- package/dist/field/features/Upload/component/index.d.ts.map +1 -0
- package/dist/field/features/Upload/component/index.js +188 -0
- package/dist/field/features/Upload/drawer/index.d.ts +14 -0
- package/dist/field/features/Upload/drawer/index.d.ts.map +1 -0
- package/dist/field/features/Upload/drawer/index.js +131 -0
- package/dist/field/features/Upload/index.d.ts +12 -0
- package/dist/field/features/Upload/index.d.ts.map +1 -0
- package/dist/field/features/Upload/index.js +70 -0
- package/dist/field/features/Upload/nodes/UploadNode.d.ts +44 -0
- package/dist/field/features/Upload/nodes/UploadNode.d.ts.map +1 -0
- package/dist/field/features/Upload/nodes/UploadNode.js +153 -0
- package/dist/field/features/Upload/plugin/index.d.ts +7 -0
- package/dist/field/features/Upload/plugin/index.d.ts.map +1 -0
- package/dist/field/features/Upload/plugin/index.js +97 -0
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +4 -0
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +1 -0
- package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +23 -0
- package/dist/field/features/align/index.d.ts +4 -0
- package/dist/field/features/align/index.d.ts.map +1 -0
- package/dist/field/features/align/index.js +67 -0
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +4 -0
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +1 -0
- package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +21 -0
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +4 -0
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +1 -0
- package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +23 -0
- package/dist/field/features/debug/TreeView/index.d.ts +4 -0
- package/dist/field/features/debug/TreeView/index.d.ts.map +1 -0
- package/dist/field/features/debug/TreeView/index.js +30 -0
- package/dist/field/features/debug/TreeView/plugin.d.ts +3 -0
- package/dist/field/features/debug/TreeView/plugin.d.ts.map +1 -0
- package/dist/field/features/debug/TreeView/plugin.js +66 -0
- package/dist/field/features/format/Bold/index.d.ts +3 -0
- package/dist/field/features/format/Bold/index.d.ts.map +1 -0
- package/dist/field/features/format/Bold/index.js +57 -0
- package/dist/field/features/format/Bold/markdownTransformers.d.ts +6 -0
- package/dist/field/features/format/Bold/markdownTransformers.d.ts.map +1 -0
- package/dist/field/features/format/Bold/markdownTransformers.js +58 -0
- package/dist/field/features/format/InlineCode/index.d.ts +3 -0
- package/dist/field/features/format/InlineCode/index.d.ts.map +1 -0
- package/dist/field/features/format/InlineCode/index.js +49 -0
- package/dist/field/features/format/InlineCode/markdownTransformers.d.ts +3 -0
- package/dist/field/features/format/InlineCode/markdownTransformers.d.ts.map +1 -0
- package/dist/field/features/format/InlineCode/markdownTransformers.js +19 -0
- package/dist/field/features/format/Italic/index.d.ts +3 -0
- package/dist/field/features/format/Italic/index.d.ts.map +1 -0
- package/dist/field/features/format/Italic/index.js +50 -0
- package/dist/field/features/format/Italic/markdownTransformers.d.ts +4 -0
- package/dist/field/features/format/Italic/markdownTransformers.d.ts.map +1 -0
- package/dist/field/features/format/Italic/markdownTransformers.js +35 -0
- package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +4 -0
- package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +1 -0
- package/dist/field/features/format/common/floatingSelectToolbarSection.js +21 -0
- package/dist/field/features/format/strikethrough/index.d.ts +3 -0
- package/dist/field/features/format/strikethrough/index.d.ts.map +1 -0
- package/dist/field/features/format/strikethrough/index.js +49 -0
- package/dist/field/features/format/strikethrough/markdownTransformers.d.ts +3 -0
- package/dist/field/features/format/strikethrough/markdownTransformers.d.ts.map +1 -0
- package/dist/field/features/format/strikethrough/markdownTransformers.js +19 -0
- package/dist/field/features/format/subscript/index.d.ts +3 -0
- package/dist/field/features/format/subscript/index.d.ts.map +1 -0
- package/dist/field/features/format/subscript/index.js +45 -0
- package/dist/field/features/format/superscript/index.d.ts +3 -0
- package/dist/field/features/format/superscript/index.d.ts.map +1 -0
- package/dist/field/features/format/superscript/index.js +45 -0
- package/dist/field/features/format/underline/index.d.ts +3 -0
- package/dist/field/features/format/underline/index.d.ts.map +1 -0
- package/dist/field/features/format/underline/index.js +45 -0
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +4 -0
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +1 -0
- package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +21 -0
- package/dist/field/features/indent/index.d.ts +4 -0
- package/dist/field/features/indent/index.d.ts.map +1 -0
- package/dist/field/features/indent/index.js +67 -0
- package/dist/field/features/lists/CheckList/index.d.ts +3 -0
- package/dist/field/features/lists/CheckList/index.d.ts.map +1 -0
- package/dist/field/features/lists/CheckList/index.js +67 -0
- package/dist/field/features/lists/CheckList/markdownTransformers.d.ts +3 -0
- package/dist/field/features/lists/CheckList/markdownTransformers.d.ts.map +1 -0
- package/dist/field/features/lists/CheckList/markdownTransformers.js +26 -0
- package/dist/field/features/lists/OrderedList/index.d.ts +3 -0
- package/dist/field/features/lists/OrderedList/index.d.ts.map +1 -0
- package/dist/field/features/lists/OrderedList/index.js +65 -0
- package/dist/field/features/lists/OrderedList/markdownTransformer.d.ts +3 -0
- package/dist/field/features/lists/OrderedList/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/lists/OrderedList/markdownTransformer.js +26 -0
- package/dist/field/features/lists/UnorderedList/index.d.ts +3 -0
- package/dist/field/features/lists/UnorderedList/index.d.ts.map +1 -0
- package/dist/field/features/lists/UnorderedList/index.js +65 -0
- package/dist/field/features/lists/UnorderedList/markdownTransformer.d.ts +3 -0
- package/dist/field/features/lists/UnorderedList/markdownTransformer.d.ts.map +1 -0
- package/dist/field/features/lists/UnorderedList/markdownTransformer.js +26 -0
- package/dist/field/features/lists/common/markdown.d.ts +6 -0
- package/dist/field/features/lists/common/markdown.d.ts.map +1 -0
- package/dist/field/features/lists/common/markdown.js +76 -0
- package/dist/field/features/types.d.ts +95 -0
- package/dist/field/features/types.d.ts.map +1 -0
- package/dist/field/features/types.js +6 -0
- package/dist/field/index.d.ts +4 -0
- package/dist/field/index.d.ts.map +1 -0
- package/dist/field/index.js +60 -0
- package/dist/field/lexical/LexicalEditor.d.ts +5 -0
- package/dist/field/lexical/LexicalEditor.d.ts.map +1 -0
- package/dist/field/lexical/LexicalEditor.js +134 -0
- package/dist/field/lexical/LexicalProvider.d.ts +16 -0
- package/dist/field/lexical/LexicalProvider.d.ts.map +1 -0
- package/dist/field/lexical/LexicalProvider.js +89 -0
- package/dist/field/lexical/config/EditorConfigProvider.d.ts +16 -0
- package/dist/field/lexical/config/EditorConfigProvider.d.ts.map +1 -0
- package/dist/field/lexical/config/EditorConfigProvider.js +96 -0
- package/dist/field/lexical/config/default.d.ts +4 -0
- package/dist/field/lexical/config/default.d.ts.map +1 -0
- package/dist/field/lexical/config/default.js +67 -0
- package/dist/field/lexical/config/loader.d.ts +7 -0
- package/dist/field/lexical/config/loader.d.ts.map +1 -0
- package/dist/field/lexical/config/loader.js +133 -0
- package/dist/field/lexical/config/sanitize.d.ts +5 -0
- package/dist/field/lexical/config/sanitize.d.ts.map +1 -0
- package/dist/field/lexical/config/sanitize.js +138 -0
- package/dist/field/lexical/config/types.d.ts +12 -0
- package/dist/field/lexical/config/types.d.ts.map +1 -0
- package/dist/field/lexical/config/types.js +6 -0
- package/dist/field/lexical/nodes/index.d.ts +6 -0
- package/dist/field/lexical/nodes/index.d.ts.map +1 -0
- package/dist/field/lexical/nodes/index.js +15 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +8 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +135 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +17 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +289 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +9 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +36 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +6 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +272 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +40 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +1 -0
- package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js +6 -0
- package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts +10 -0
- package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/MarkdownShortcut/index.js +66 -0
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +63 -0
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -0
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +457 -0
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +26 -0
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +281 -0
- package/dist/field/lexical/plugins/SlashMenu/defaultGroups.d.ts +2 -0
- package/dist/field/lexical/plugins/SlashMenu/defaultGroups.d.ts.map +1 -0
- package/dist/field/lexical/plugins/SlashMenu/defaultGroups.js +3 -0
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts +4 -0
- package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/SlashMenu/index.js +187 -0
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +6 -0
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +264 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts +2 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +24 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.d.ts +2 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +24 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +27 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +160 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +3 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js +37 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +6 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +346 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +3 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +59 -0
- package/dist/field/lexical/plugins/handles/utils/getCollapsedMargins.d.ts +5 -0
- package/dist/field/lexical/plugins/handles/utils/getCollapsedMargins.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/getCollapsedMargins.js +24 -0
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts +3 -0
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +16 -0
- package/dist/field/lexical/plugins/handles/utils/isOnHandleElement.d.ts +2 -0
- package/dist/field/lexical/plugins/handles/utils/isOnHandleElement.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/isOnHandleElement.js +15 -0
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +2 -0
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -0
- package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +27 -0
- package/dist/field/lexical/theme/EditorTheme.d.ts +4 -0
- package/dist/field/lexical/theme/EditorTheme.d.ts.map +1 -0
- package/dist/field/lexical/theme/EditorTheme.js +115 -0
- package/dist/field/lexical/ui/ContentEditable.d.ts +6 -0
- package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -0
- package/dist/field/lexical/ui/ContentEditable.js +59 -0
- package/dist/field/lexical/ui/icons/AI/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/AI/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/AI/index.js +42 -0
- package/dist/field/lexical/ui/icons/AlignCenter/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/AlignCenter/index.js +40 -0
- package/dist/field/lexical/ui/icons/AlignLeft/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/AlignLeft/index.js +40 -0
- package/dist/field/lexical/ui/icons/AlignRight/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/AlignRight/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/AlignRight/index.js +40 -0
- package/dist/field/lexical/ui/icons/Block/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Block/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Block/index.js +49 -0
- package/dist/field/lexical/ui/icons/Blockquote/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Blockquote/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Blockquote/index.js +31 -0
- package/dist/field/lexical/ui/icons/Bold/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Bold/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Bold/index.js +31 -0
- package/dist/field/lexical/ui/icons/Checklist/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Checklist/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Checklist/index.js +39 -0
- package/dist/field/lexical/ui/icons/Code/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Code/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Code/index.js +34 -0
- package/dist/field/lexical/ui/icons/CodeBlock/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/CodeBlock/index.js +34 -0
- package/dist/field/lexical/ui/icons/H1/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/H1/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/H1/index.js +31 -0
- package/dist/field/lexical/ui/icons/H2/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/H2/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/H2/index.js +31 -0
- package/dist/field/lexical/ui/icons/H3/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/H3/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/H3/index.js +31 -0
- package/dist/field/lexical/ui/icons/H4/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/H4/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/H4/index.js +31 -0
- package/dist/field/lexical/ui/icons/H5/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/H5/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/H5/index.js +31 -0
- package/dist/field/lexical/ui/icons/H6/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/H6/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/H6/index.js +31 -0
- package/dist/field/lexical/ui/icons/IndentDecrease/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/IndentDecrease/index.js +43 -0
- package/dist/field/lexical/ui/icons/IndentIncrease/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/IndentIncrease/index.js +43 -0
- package/dist/field/lexical/ui/icons/Italic/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Italic/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Italic/index.js +31 -0
- package/dist/field/lexical/ui/icons/Link/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Link/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Link/index.js +42 -0
- package/dist/field/lexical/ui/icons/OrderedList/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/OrderedList/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/OrderedList/index.js +46 -0
- package/dist/field/lexical/ui/icons/Relationship/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Relationship/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Relationship/index.js +42 -0
- package/dist/field/lexical/ui/icons/Strikethrough/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Strikethrough/index.js +34 -0
- package/dist/field/lexical/ui/icons/Subscript/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Subscript/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Subscript/index.js +31 -0
- package/dist/field/lexical/ui/icons/Superscript/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Superscript/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Superscript/index.js +31 -0
- package/dist/field/lexical/ui/icons/Text/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Text/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Text/index.js +31 -0
- package/dist/field/lexical/ui/icons/Underline/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Underline/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Underline/index.js +34 -0
- package/dist/field/lexical/ui/icons/UnorderedList/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/UnorderedList/index.js +61 -0
- package/dist/field/lexical/ui/icons/Upload/index.d.ts +3 -0
- package/dist/field/lexical/ui/icons/Upload/index.d.ts.map +1 -0
- package/dist/field/lexical/ui/icons/Upload/index.js +43 -0
- package/dist/field/lexical/utils/canUseDOM.d.ts +2 -0
- package/dist/field/lexical/utils/canUseDOM.d.ts.map +1 -0
- package/dist/field/lexical/utils/canUseDOM.js +13 -0
- package/dist/field/lexical/utils/cloneDeep.d.ts +2 -0
- package/dist/field/lexical/utils/cloneDeep.d.ts.map +1 -0
- package/dist/field/lexical/utils/cloneDeep.js +39 -0
- package/dist/field/lexical/utils/getDOMRangeRect.d.ts +2 -0
- package/dist/field/lexical/utils/getDOMRangeRect.d.ts.map +1 -0
- package/dist/field/lexical/utils/getDOMRangeRect.js +26 -0
- package/dist/field/lexical/utils/getSelectedNode.d.ts +3 -0
- package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -0
- package/dist/field/lexical/utils/getSelectedNode.js +33 -0
- package/dist/field/lexical/utils/guard.d.ts +9 -0
- package/dist/field/lexical/utils/guard.d.ts.map +1 -0
- package/dist/field/lexical/utils/guard.js +21 -0
- package/dist/field/lexical/utils/invariant.d.ts +2 -0
- package/dist/field/lexical/utils/invariant.d.ts.map +1 -0
- package/dist/field/lexical/utils/invariant.js +22 -0
- package/dist/field/lexical/utils/isMobileWidth.d.ts +9 -0
- package/dist/field/lexical/utils/isMobileWidth.d.ts.map +1 -0
- package/dist/field/lexical/utils/isMobileWidth.js +9 -0
- package/dist/field/lexical/utils/joinClasses.d.ts +9 -0
- package/dist/field/lexical/utils/joinClasses.d.ts.map +1 -0
- package/dist/field/lexical/utils/joinClasses.js +21 -0
- package/dist/field/lexical/utils/markdown/createBlockNode.d.ts +4 -0
- package/dist/field/lexical/utils/markdown/createBlockNode.d.ts.map +1 -0
- package/dist/field/lexical/utils/markdown/createBlockNode.js +20 -0
- package/dist/field/lexical/utils/point.d.ts +22 -0
- package/dist/field/lexical/utils/point.d.ts.map +1 -0
- package/dist/field/lexical/utils/point.js +61 -0
- package/dist/field/lexical/utils/rect.d.ts +54 -0
- package/dist/field/lexical/utils/rect.d.ts.map +1 -0
- package/dist/field/lexical/utils/rect.js +154 -0
- package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +2 -0
- package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -0
- package/dist/field/lexical/utils/setFloatingElemPosition.js +55 -0
- package/dist/field/lexical/utils/setFloatingElemPositionForLinkEditor.d.ts +2 -0
- package/dist/field/lexical/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -0
- package/dist/field/lexical/utils/setFloatingElemPositionForLinkEditor.js +43 -0
- package/dist/field/lexical/utils/swipe.d.ts +12 -0
- package/dist/field/lexical/utils/swipe.d.ts.map +1 -0
- package/dist/field/lexical/utils/swipe.js +130 -0
- package/dist/field/lexical/utils/url.d.ts +10 -0
- package/dist/field/lexical/utils/url.d.ts.map +1 -0
- package/dist/field/lexical/utils/url.js +40 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +170 -0
- package/dist/populate/defaultValue.d.ts +26 -0
- package/dist/populate/defaultValue.d.ts.map +1 -0
- package/dist/populate/defaultValue.js +41 -0
- package/dist/populate/populate.d.ts +20 -0
- package/dist/populate/populate.d.ts.map +1 -0
- package/dist/populate/populate.js +31 -0
- package/dist/populate/recurseNestedFields.d.ts +16 -0
- package/dist/populate/recurseNestedFields.d.ts.map +1 -0
- package/dist/populate/recurseNestedFields.js +182 -0
- package/dist/populate/richTextRelationshipPromise.d.ts +22 -0
- package/dist/populate/richTextRelationshipPromise.d.ts.map +1 -0
- package/dist/populate/richTextRelationshipPromise.js +71 -0
- package/dist/populate/validation.d.ts +4 -0
- package/dist/populate/validation.d.ts.map +1 -0
- package/dist/populate/validation.js +21 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/package.json +60 -0
- package/src/index.ts +92 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function addSwipeLeftListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
9
|
+
export declare function addSwipeRightListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
10
|
+
export declare function addSwipeUpListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
11
|
+
export declare function addSwipeDownListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
|
|
12
|
+
//# sourceMappingURL=swipe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../../../src/field/lexical/utils/swipe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4EH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,GAC1C,MAAM,IAAI,CAOZ;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,GAC1C,MAAM,IAAI,CAOZ;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,GAC1C,MAAM,IAAI,CAOZ;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,GAC1C,MAAM,IAAI,CAOZ"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/ "use strict";
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
function _export(target, all) {
|
|
12
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: all[name]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
_export(exports, {
|
|
18
|
+
addSwipeLeftListener: function() {
|
|
19
|
+
return addSwipeLeftListener;
|
|
20
|
+
},
|
|
21
|
+
addSwipeRightListener: function() {
|
|
22
|
+
return addSwipeRightListener;
|
|
23
|
+
},
|
|
24
|
+
addSwipeUpListener: function() {
|
|
25
|
+
return addSwipeUpListener;
|
|
26
|
+
},
|
|
27
|
+
addSwipeDownListener: function() {
|
|
28
|
+
return addSwipeDownListener;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const elements = new WeakMap();
|
|
32
|
+
function readTouch(e) {
|
|
33
|
+
const touch = e.changedTouches[0];
|
|
34
|
+
if (touch === undefined) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
return [
|
|
38
|
+
touch.clientX,
|
|
39
|
+
touch.clientY
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
function addListener(element, cb) {
|
|
43
|
+
let elementValues = elements.get(element);
|
|
44
|
+
if (elementValues === undefined) {
|
|
45
|
+
const listeners = new Set();
|
|
46
|
+
const handleTouchstart = (e)=>{
|
|
47
|
+
if (elementValues !== undefined) {
|
|
48
|
+
elementValues.start = readTouch(e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const handleTouchend = (e)=>{
|
|
52
|
+
if (elementValues === undefined) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const { start } = elementValues;
|
|
56
|
+
if (start === null) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const end = readTouch(e);
|
|
60
|
+
for (const listener of listeners){
|
|
61
|
+
if (end !== null) {
|
|
62
|
+
listener([
|
|
63
|
+
end[0] - start[0],
|
|
64
|
+
end[1] - start[1]
|
|
65
|
+
], e);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
element.addEventListener('touchstart', handleTouchstart);
|
|
70
|
+
element.addEventListener('touchend', handleTouchend);
|
|
71
|
+
elementValues = {
|
|
72
|
+
handleTouchend,
|
|
73
|
+
handleTouchstart,
|
|
74
|
+
listeners,
|
|
75
|
+
start: null
|
|
76
|
+
};
|
|
77
|
+
elements.set(element, elementValues);
|
|
78
|
+
}
|
|
79
|
+
elementValues.listeners.add(cb);
|
|
80
|
+
return ()=>{
|
|
81
|
+
deleteListener(element, cb);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function deleteListener(element, cb) {
|
|
85
|
+
const elementValues = elements.get(element);
|
|
86
|
+
if (elementValues === undefined) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const { listeners } = elementValues;
|
|
90
|
+
listeners.delete(cb);
|
|
91
|
+
if (listeners.size === 0) {
|
|
92
|
+
elements.delete(element);
|
|
93
|
+
element.removeEventListener('touchstart', elementValues.handleTouchstart);
|
|
94
|
+
element.removeEventListener('touchend', elementValues.handleTouchend);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
function addSwipeLeftListener(element, cb) {
|
|
98
|
+
return addListener(element, (force, e)=>{
|
|
99
|
+
const [x, y] = force;
|
|
100
|
+
if (x < 0 && -x > Math.abs(y)) {
|
|
101
|
+
cb(x, e);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function addSwipeRightListener(element, cb) {
|
|
106
|
+
return addListener(element, (force, e)=>{
|
|
107
|
+
const [x, y] = force;
|
|
108
|
+
if (x > 0 && x > Math.abs(y)) {
|
|
109
|
+
cb(x, e);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function addSwipeUpListener(element, cb) {
|
|
114
|
+
return addListener(element, (force, e)=>{
|
|
115
|
+
const [x, y] = force;
|
|
116
|
+
if (y < 0 && -y > Math.abs(x)) {
|
|
117
|
+
cb(x, e);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function addSwipeDownListener(element, cb) {
|
|
122
|
+
return addListener(element, (force, e)=>{
|
|
123
|
+
const [x, y] = force;
|
|
124
|
+
if (y > 0 && y > Math.abs(x)) {
|
|
125
|
+
cb(x, e);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9maWVsZC9sZXhpY2FsL3V0aWxzL3N3aXBlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSBNZXRhIFBsYXRmb3JtcywgSW5jLiBhbmQgYWZmaWxpYXRlcy5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBNSVQgbGljZW5zZSBmb3VuZCBpbiB0aGVcbiAqIExJQ0VOU0UgZmlsZSBpbiB0aGUgcm9vdCBkaXJlY3Rvcnkgb2YgdGhpcyBzb3VyY2UgdHJlZS5cbiAqXG4gKi9cblxudHlwZSBGb3JjZSA9IFtudW1iZXIsIG51bWJlcl1cbnR5cGUgTGlzdGVuZXIgPSAoZm9yY2U6IEZvcmNlLCBlOiBUb3VjaEV2ZW50KSA9PiB2b2lkXG5pbnRlcm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RXLE9BQW9CLEVBQ3BCQyxFQUEyQztJQUUzQyxPQUFPRixZQUFZQyxTQUFTLENBQUNrQixPQUFPekI7UUFDbEMsTUFBTSxDQUFDMEIsR0FBR0MsRUFBRSxHQUFHRjtRQUNmLElBQUlFLElBQUksS0FBS0EsSUFBSUMsS0FBS0MsR0FBRyxDQUFDSCxJQUFJO1lBQzVCbEIsR0FBR2tCLEdBQUcxQjtRQUNSO0lBQ0Y7QUFDRiJ9
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function sanitizeUrl(url: string): string;
|
|
9
|
+
export declare function validateUrl(url: string): boolean;
|
|
10
|
+
//# sourceMappingURL=url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../../src/field/lexical/utils/url.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAa/C;AAMD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAIhD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/ "use strict";
|
|
8
|
+
Object.defineProperty(exports, "__esModule", {
|
|
9
|
+
value: true
|
|
10
|
+
});
|
|
11
|
+
function _export(target, all) {
|
|
12
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: all[name]
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
_export(exports, {
|
|
18
|
+
sanitizeUrl: function() {
|
|
19
|
+
return sanitizeUrl;
|
|
20
|
+
},
|
|
21
|
+
validateUrl: function() {
|
|
22
|
+
return validateUrl;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
function sanitizeUrl(url) {
|
|
26
|
+
/** A pattern that matches safe URLs. */ const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi;
|
|
27
|
+
/** A pattern that matches safe data URLs. */ const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z\d+/]+=*$/i;
|
|
28
|
+
url = String(url).trim();
|
|
29
|
+
if (url.match(SAFE_URL_PATTERN) != null || url.match(DATA_URL_PATTERN) != null) return url;
|
|
30
|
+
return 'https://';
|
|
31
|
+
}
|
|
32
|
+
// Source: https://stackoverflow.com/a/8234912/2013580
|
|
33
|
+
const urlRegExp = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=+$,\w]+@)?[A-Za-z\d.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z\d.-]+)((?:\/[+~%/.\w-]*)?\??[-+=&;%@.\w]*#?\w*)?)/;
|
|
34
|
+
function validateUrl(url) {
|
|
35
|
+
// TODO Fix UI for link insertion; it should never default to an invalid URL such as https://.
|
|
36
|
+
// Maybe show a dialog where they user can type the URL before inserting it.
|
|
37
|
+
return url === 'https://' || urlRegExp.test(url);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9maWVsZC9sZXhpY2FsL3V0aWxzL3VybC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiA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LSSxJQUFJO0lBRXRCLElBQUlKLElBQUlLLEtBQUssQ0FBQ0oscUJBQXFCLFFBQVFELElBQUlLLEtBQUssQ0FBQ0gscUJBQXFCLE1BQU0sT0FBT0Y7SUFFdkYsT0FBTztBQUNUO0FBRUEsc0RBQXNEO0FBQ3RELE1BQU1NLFlBQ0o7QUFFSyxTQUFTUCxZQUFZQyxHQUFXO0lBQ3JDLDhGQUE4RjtJQUM5Riw0RUFBNEU7SUFDNUUsT0FBT0EsUUFBUSxjQUFjTSxVQUFVQyxJQUFJLENBQUNQO0FBQzlDIn0=
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RichTextAdapter } from 'payload/types';
|
|
2
|
+
import type { EditorConfig } from './field/lexical/config/types';
|
|
3
|
+
import type { AdapterProps } from './types';
|
|
4
|
+
export declare function createLexical({ userConfig, }: {
|
|
5
|
+
userConfig?: (defaultEditorConfig: EditorConfig) => EditorConfig;
|
|
6
|
+
}): RichTextAdapter<AdapterProps>;
|
|
7
|
+
export { BlockQuoteFeature } from './field/features/BlockQuote';
|
|
8
|
+
export { BlocksFeature } from './field/features/Blocks';
|
|
9
|
+
export { HeadingFeature } from './field/features/Heading';
|
|
10
|
+
export { LinkFeature, LinkFeatureProps } from './field/features/Link';
|
|
11
|
+
export { ParagraphFeature } from './field/features/Paragraph';
|
|
12
|
+
export { RelationshipFeature } from './field/features/Relationship';
|
|
13
|
+
export { UploadFeature, UploadFeatureProps } from './field/features/Upload';
|
|
14
|
+
export { AlignFeature } from './field/features/align';
|
|
15
|
+
export { TextDropdownSectionWithEntries } from './field/features/common/floatingSelectToolbarTextDropdownSection';
|
|
16
|
+
export { TreeviewFeature } from './field/features/debug/TreeView';
|
|
17
|
+
export { BoldTextFeature } from './field/features/format/Bold';
|
|
18
|
+
export { InlineCodeTextFeature } from './field/features/format/InlineCode';
|
|
19
|
+
export { ItalicTextFeature } from './field/features/format/Italic';
|
|
20
|
+
export { SectionWithEntries as FormatSectionWithEntries } from './field/features/format/common/floatingSelectToolbarSection';
|
|
21
|
+
export { StrikethroughTextFeature } from './field/features/format/strikethrough';
|
|
22
|
+
export { SubscriptTextFeature } from './field/features/format/subscript';
|
|
23
|
+
export { SuperscriptTextFeature } from './field/features/format/superscript';
|
|
24
|
+
export { UnderlineTextFeature } from './field/features/format/underline';
|
|
25
|
+
export { IndentFeature } from './field/features/indent';
|
|
26
|
+
export { CheckListFeature } from './field/features/lists/CheckList';
|
|
27
|
+
export { OrderedListFeature } from './field/features/lists/OrderedList';
|
|
28
|
+
export { UnoderedListFeature } from './field/features/lists/UnorderedList';
|
|
29
|
+
export { Feature, FeatureProvider, FeatureProviderMap, ResolvedFeature, ResolvedFeatureMap, SanitizedFeatures, } from './field/features/types';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,OAAO,KAAK,EAAE,YAAY,EAAyB,MAAM,8BAA8B,CAAA;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAS3C,wBAAgB,aAAa,CAAC,EAC5B,UAAU,GACX,EAAE;IACD,UAAU,CAAC,EAAE,CAAC,mBAAmB,EAAE,YAAY,KAAK,YAAY,CAAA;CACjE,GAAG,eAAe,CAAC,YAAY,CAAC,CAyChC;AAED,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,8BAA8B,EAAE,MAAM,kEAAkE,CAAA;AACjH,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,6DAA6D,CAAA;AAC5H,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAA;AAE1E,OAAO,EACL,OAAO,EACP,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,wBAAwB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
createLexical: function() {
|
|
13
|
+
return createLexical;
|
|
14
|
+
},
|
|
15
|
+
BlockQuoteFeature: function() {
|
|
16
|
+
return _BlockQuote.BlockQuoteFeature;
|
|
17
|
+
},
|
|
18
|
+
BlocksFeature: function() {
|
|
19
|
+
return _Blocks.BlocksFeature;
|
|
20
|
+
},
|
|
21
|
+
HeadingFeature: function() {
|
|
22
|
+
return _Heading.HeadingFeature;
|
|
23
|
+
},
|
|
24
|
+
LinkFeature: function() {
|
|
25
|
+
return _Link.LinkFeature;
|
|
26
|
+
},
|
|
27
|
+
LinkFeatureProps: function() {
|
|
28
|
+
return _Link.LinkFeatureProps;
|
|
29
|
+
},
|
|
30
|
+
ParagraphFeature: function() {
|
|
31
|
+
return _Paragraph.ParagraphFeature;
|
|
32
|
+
},
|
|
33
|
+
RelationshipFeature: function() {
|
|
34
|
+
return _Relationship.RelationshipFeature;
|
|
35
|
+
},
|
|
36
|
+
UploadFeature: function() {
|
|
37
|
+
return _Upload.UploadFeature;
|
|
38
|
+
},
|
|
39
|
+
UploadFeatureProps: function() {
|
|
40
|
+
return _Upload.UploadFeatureProps;
|
|
41
|
+
},
|
|
42
|
+
AlignFeature: function() {
|
|
43
|
+
return _align.AlignFeature;
|
|
44
|
+
},
|
|
45
|
+
TextDropdownSectionWithEntries: function() {
|
|
46
|
+
return _floatingSelectToolbarTextDropdownSection.TextDropdownSectionWithEntries;
|
|
47
|
+
},
|
|
48
|
+
TreeviewFeature: function() {
|
|
49
|
+
return _TreeView.TreeviewFeature;
|
|
50
|
+
},
|
|
51
|
+
BoldTextFeature: function() {
|
|
52
|
+
return _Bold.BoldTextFeature;
|
|
53
|
+
},
|
|
54
|
+
InlineCodeTextFeature: function() {
|
|
55
|
+
return _InlineCode.InlineCodeTextFeature;
|
|
56
|
+
},
|
|
57
|
+
ItalicTextFeature: function() {
|
|
58
|
+
return _Italic.ItalicTextFeature;
|
|
59
|
+
},
|
|
60
|
+
FormatSectionWithEntries: function() {
|
|
61
|
+
return _floatingSelectToolbarSection.SectionWithEntries;
|
|
62
|
+
},
|
|
63
|
+
StrikethroughTextFeature: function() {
|
|
64
|
+
return _strikethrough.StrikethroughTextFeature;
|
|
65
|
+
},
|
|
66
|
+
SubscriptTextFeature: function() {
|
|
67
|
+
return _subscript.SubscriptTextFeature;
|
|
68
|
+
},
|
|
69
|
+
SuperscriptTextFeature: function() {
|
|
70
|
+
return _superscript.SuperscriptTextFeature;
|
|
71
|
+
},
|
|
72
|
+
UnderlineTextFeature: function() {
|
|
73
|
+
return _underline.UnderlineTextFeature;
|
|
74
|
+
},
|
|
75
|
+
IndentFeature: function() {
|
|
76
|
+
return _indent.IndentFeature;
|
|
77
|
+
},
|
|
78
|
+
CheckListFeature: function() {
|
|
79
|
+
return _CheckList.CheckListFeature;
|
|
80
|
+
},
|
|
81
|
+
OrderedListFeature: function() {
|
|
82
|
+
return _OrderedList.OrderedListFeature;
|
|
83
|
+
},
|
|
84
|
+
UnoderedListFeature: function() {
|
|
85
|
+
return _UnorderedList.UnoderedListFeature;
|
|
86
|
+
},
|
|
87
|
+
Feature: function() {
|
|
88
|
+
return _types.Feature;
|
|
89
|
+
},
|
|
90
|
+
FeatureProvider: function() {
|
|
91
|
+
return _types.FeatureProvider;
|
|
92
|
+
},
|
|
93
|
+
FeatureProviderMap: function() {
|
|
94
|
+
return _types.FeatureProviderMap;
|
|
95
|
+
},
|
|
96
|
+
ResolvedFeature: function() {
|
|
97
|
+
return _types.ResolvedFeature;
|
|
98
|
+
},
|
|
99
|
+
ResolvedFeatureMap: function() {
|
|
100
|
+
return _types.ResolvedFeatureMap;
|
|
101
|
+
},
|
|
102
|
+
SanitizedFeatures: function() {
|
|
103
|
+
return _types.SanitizedFeatures;
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
const _utilities = require("payload/components/utilities");
|
|
107
|
+
const _cell = require("./cell");
|
|
108
|
+
const _field = require("./field");
|
|
109
|
+
const _default = require("./field/lexical/config/default");
|
|
110
|
+
const _sanitize = require("./field/lexical/config/sanitize");
|
|
111
|
+
const _cloneDeep = require("./field/lexical/utils/cloneDeep");
|
|
112
|
+
const _richTextRelationshipPromise = require("./populate/richTextRelationshipPromise");
|
|
113
|
+
const _BlockQuote = require("./field/features/BlockQuote");
|
|
114
|
+
const _Blocks = require("./field/features/Blocks");
|
|
115
|
+
const _Heading = require("./field/features/Heading");
|
|
116
|
+
const _Link = require("./field/features/Link");
|
|
117
|
+
const _Paragraph = require("./field/features/Paragraph");
|
|
118
|
+
const _Relationship = require("./field/features/Relationship");
|
|
119
|
+
const _Upload = require("./field/features/Upload");
|
|
120
|
+
const _align = require("./field/features/align");
|
|
121
|
+
const _floatingSelectToolbarTextDropdownSection = require("./field/features/common/floatingSelectToolbarTextDropdownSection");
|
|
122
|
+
const _TreeView = require("./field/features/debug/TreeView");
|
|
123
|
+
const _Bold = require("./field/features/format/Bold");
|
|
124
|
+
const _InlineCode = require("./field/features/format/InlineCode");
|
|
125
|
+
const _Italic = require("./field/features/format/Italic");
|
|
126
|
+
const _floatingSelectToolbarSection = require("./field/features/format/common/floatingSelectToolbarSection");
|
|
127
|
+
const _strikethrough = require("./field/features/format/strikethrough");
|
|
128
|
+
const _subscript = require("./field/features/format/subscript");
|
|
129
|
+
const _superscript = require("./field/features/format/superscript");
|
|
130
|
+
const _underline = require("./field/features/format/underline");
|
|
131
|
+
const _indent = require("./field/features/indent");
|
|
132
|
+
const _CheckList = require("./field/features/lists/CheckList");
|
|
133
|
+
const _OrderedList = require("./field/features/lists/OrderedList");
|
|
134
|
+
const _UnorderedList = require("./field/features/lists/UnorderedList");
|
|
135
|
+
const _types = require("./field/features/types");
|
|
136
|
+
function createLexical({ userConfig }) {
|
|
137
|
+
const finalSanitizedEditorConfig = userConfig == null || typeof userConfig != 'function' ? (0, _cloneDeep.cloneDeep)(_default.defaultSanitizedEditorConfig) : (0, _sanitize.sanitizeEditorConfig)(userConfig((0, _cloneDeep.cloneDeep)(_default.defaultEditorConfig)));
|
|
138
|
+
return {
|
|
139
|
+
CellComponent: (0, _utilities.withMergedProps)({
|
|
140
|
+
Component: _cell.RichTextCell,
|
|
141
|
+
toMergeIntoProps: {
|
|
142
|
+
editorConfig: finalSanitizedEditorConfig
|
|
143
|
+
}
|
|
144
|
+
}),
|
|
145
|
+
FieldComponent: (0, _utilities.withMergedProps)({
|
|
146
|
+
Component: _field.RichTextField,
|
|
147
|
+
toMergeIntoProps: {
|
|
148
|
+
editorConfig: finalSanitizedEditorConfig
|
|
149
|
+
}
|
|
150
|
+
}),
|
|
151
|
+
afterReadPromise ({ currentDepth, depth, field, overrideAccess, req, showHiddenFields, siblingDoc }) {
|
|
152
|
+
// check if there are any features with nodes which have afterReadPromises for this field
|
|
153
|
+
if (finalSanitizedEditorConfig?.features?.afterReadPromises?.size) {
|
|
154
|
+
return (0, _richTextRelationshipPromise.richTextRelationshipPromise)({
|
|
155
|
+
afterReadPromises: finalSanitizedEditorConfig.features.afterReadPromises,
|
|
156
|
+
currentDepth,
|
|
157
|
+
depth,
|
|
158
|
+
field,
|
|
159
|
+
overrideAccess,
|
|
160
|
+
req,
|
|
161
|
+
showHiddenFields,
|
|
162
|
+
siblingDoc
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFJpY2hUZXh0QWRhcHRlciB9IGZyb20gJ3BheWxvYWQvdHlwZXMnXG5cbmltcG9ydCB7IHdpdGhNZXJnZWRQcm9wcyB9IGZyb20gJ3BheWxvYWQvY29tcG9uZW50cy91dGlsaXRpZXMnXG5cbmlt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RCQUE0QnFCLFVBQVVDLG1CQUFtQkMsTUFBTTtnQkFDakUsT0FBT0MsSUFBQUEsd0RBQTJCLEVBQUM7b0JBQ2pDRixtQkFBbUJ0QiwyQkFBMkJxQixRQUFRLENBQUNDLGlCQUFpQjtvQkFDeEVSO29CQUNBQztvQkFDQUM7b0JBQ0FDO29CQUNBQztvQkFDQUM7b0JBQ0FDO2dCQUNGO1lBQ0Y7WUFFQSxPQUFPO1FBQ1Q7SUFDRjtBQUNGIn0=
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const defaultRichTextValue: {
|
|
2
|
+
root: {
|
|
3
|
+
children: {
|
|
4
|
+
children: {
|
|
5
|
+
detail: number;
|
|
6
|
+
format: number;
|
|
7
|
+
mode: string;
|
|
8
|
+
style: string;
|
|
9
|
+
text: string;
|
|
10
|
+
type: string;
|
|
11
|
+
version: number;
|
|
12
|
+
}[];
|
|
13
|
+
direction: any;
|
|
14
|
+
format: string;
|
|
15
|
+
indent: number;
|
|
16
|
+
type: string;
|
|
17
|
+
version: number;
|
|
18
|
+
}[];
|
|
19
|
+
direction: any;
|
|
20
|
+
format: string;
|
|
21
|
+
indent: number;
|
|
22
|
+
type: string;
|
|
23
|
+
version: number;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=defaultValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultValue.d.ts","sourceRoot":"","sources":["../../src/populate/defaultValue.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;CA4BhC,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "defaultRichTextValue", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return defaultRichTextValue;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const defaultRichTextValue = {
|
|
12
|
+
root: {
|
|
13
|
+
children: [
|
|
14
|
+
{
|
|
15
|
+
children: [
|
|
16
|
+
{
|
|
17
|
+
detail: 0,
|
|
18
|
+
format: 0,
|
|
19
|
+
mode: 'normal',
|
|
20
|
+
style: '',
|
|
21
|
+
text: '',
|
|
22
|
+
type: 'text',
|
|
23
|
+
version: 1
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
direction: null,
|
|
27
|
+
format: '',
|
|
28
|
+
indent: 0,
|
|
29
|
+
type: 'paragraph',
|
|
30
|
+
version: 1
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
direction: null,
|
|
34
|
+
format: '',
|
|
35
|
+
indent: 0,
|
|
36
|
+
type: 'root',
|
|
37
|
+
version: 1
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wb3B1bGF0ZS9kZWZhdWx0VmFsdWUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IGRlZmF1bHRSaWNoVGV4dFZhbHVlID0ge1xuICByb290OiB7XG4gICAgY2hpbGRyZW46IFtcbiAgICAgIHtcbiAgICAgICAgY2hpbGRyZW46IFtcbiAgICAgICAgICB7XG4gICAgICAgICAgICBkZXRhaWw6IDAsXG4gICAgICAgICAgICBmb3JtYXQ6IDAsXG4gICAgICAgICAgICBtb2RlOiAnbm9ybWFsJyxcbiAgICAgICAgICAgIHN0eWxlOiAnJyxcbiAgICAgICAgICAgIHRleHQ6ICcnLFxuICAgICAgICAgICAgdHlwZTogJ3RleHQnLFxuICAgICAgICAgICAgdmVyc2lvbjogMSxcbiAgICAgICAgICB9LFxuICAgICAgICBdLFxuICAgICAgICBkaXJlY3Rpb246IG51bGwsXG4gICAgICAgIGZvcm1hdDogJycsXG4gICAgICAgIGluZGVudDogMCxcbiAgICAgICAgdHlwZTogJ3BhcmFncmFwaCcsXG4gICAgICAgIHZlcnNpb246IDEsXG4gICAgICB9LFxuICAgIF0sXG4gICAgZGlyZWN0aW9uOiBudWxsLFxuICAgIGZvcm1hdDogJycsXG4gICAgaW5kZW50OiAwLFxuICAgIHR5cGU6ICdyb290JyxcbiAgICB2ZXJzaW9uOiAxLFxuICB9LFxufVxuIl0sIm5hbWVzIjpbImRlZmF1bHRSaWNoVGV4dFZhbHVlIiwicm9vdCIsImNoaWxkcmVuIiwiZGV0YWlsIiwiZm9ybWF0IiwibW9kZSIsInN0eWxlIiwidGV4dCIsInR5cGUiLCJ2ZXJzaW9uIiwiZGlyZWN0aW9uIiwiaW5kZW50Il0sIm1hcHBpbmdzIjoiOzs7OytCQUFhQTs7O2VBQUFBOzs7QUFBTixNQUFNQSx1QkFBdUI7SUFDbENDLE1BQU07UUFDSkMsVUFBVTtZQUNSO2dCQUNFQSxVQUFVO29CQUNSO3dCQUNFQyxRQUFRO3dCQUNSQyxRQUFRO3dCQUNSQyxNQUFNO3dCQUNOQyxPQUFPO3dCQUNQQyxNQUFNO3dCQUNOQyxNQUFNO3dCQUNOQyxTQUFTO29CQUNYO2lCQUNEO2dCQUNEQyxXQUFXO2dCQUNYTixRQUFRO2dCQUNSTyxRQUFRO2dCQUNSSCxNQUFNO2dCQUNOQyxTQUFTO1lBQ1g7U0FDRDtRQUNEQyxXQUFXO1FBQ1hOLFFBQVE7UUFDUk8sUUFBUTtRQUNSSCxNQUFNO1FBQ05DLFNBQVM7SUFDWDtBQUNGIn0=
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PayloadRequest } from 'payload/types';
|
|
2
|
+
import type { Collection, Field, RichTextField } from 'payload/types';
|
|
3
|
+
import type { AdapterProps } from '../types';
|
|
4
|
+
type Arguments = {
|
|
5
|
+
currentDepth?: number;
|
|
6
|
+
data: unknown;
|
|
7
|
+
depth: number;
|
|
8
|
+
field: RichTextField<AdapterProps>;
|
|
9
|
+
key: number | string;
|
|
10
|
+
overrideAccess?: boolean;
|
|
11
|
+
req: PayloadRequest;
|
|
12
|
+
showHiddenFields: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const populate: ({ id, collection, currentDepth, data, depth, key, overrideAccess, req, showHiddenFields, }: Omit<Arguments, "field"> & {
|
|
15
|
+
collection: Collection;
|
|
16
|
+
field: Field;
|
|
17
|
+
id: string;
|
|
18
|
+
}) => Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=populate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"populate.d.ts","sourceRoot":"","sources":["../../src/populate/populate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAE5C,KAAK,SAAS,GAAG;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IAClC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ;gBAWP,UAAU;WACf,KAAK;QACR,MAAM;MACR,QAAQ,IAAI,CAsBf,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "populate", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return populate;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const populate = async ({ id, collection, currentDepth, data, depth, key, overrideAccess, req, showHiddenFields })=>{
|
|
12
|
+
const dataRef = data;
|
|
13
|
+
const doc = await req.payloadDataLoader.load(JSON.stringify([
|
|
14
|
+
req.transactionID,
|
|
15
|
+
collection.config.slug,
|
|
16
|
+
id,
|
|
17
|
+
depth,
|
|
18
|
+
currentDepth + 1,
|
|
19
|
+
req.locale,
|
|
20
|
+
req.fallbackLocale,
|
|
21
|
+
typeof overrideAccess === 'undefined' ? false : overrideAccess,
|
|
22
|
+
showHiddenFields
|
|
23
|
+
]));
|
|
24
|
+
if (doc) {
|
|
25
|
+
dataRef[key] = doc;
|
|
26
|
+
} else {
|
|
27
|
+
dataRef[key] = null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wb3B1bGF0ZS9wb3B1bGF0ZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFBheWxvYWRSZXF1ZXN0IH0gZnJvbSAncGF5bG9hZC90eXBlcydcbmltcG9ydCB0eXBlIHsgQ29sbGVjdGlvbiwgRmllbGQsIFJpY2hUZXh0RmllbGQgfSBmcm9tICdwYXlsb2FkL3R5cGVzJ1xuXG5pbXBvcnQgdHlwZSB7IEFkYXB0ZXJQcm9wcyB9IGZyb20gJy4uL3R5cGVzJ1xuXG50eXBlIEFyZ3VtZW50cyA9IHtcbiAgY3VycmVudERlcHRoPzogbnVtYmVyXG4gIGRhdGE6IHVua25vd25cbiAgZGVwdGg6IG51bWJlclxuICBmaWVsZDogUmljaFRleHRGaWVsZDxBZGFwdGVyUHJvcHM+XG4gIGtleTogbnVtYmVyIHwgc3RyaW5nXG4gIG92ZXJyaWRlQWN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/features/types';
|
|
3
|
+
type NestedRichTextFieldsArgs = {
|
|
4
|
+
afterReadPromises: Map<string, Array<AfterReadPromise>>;
|
|
5
|
+
currentDepth?: number;
|
|
6
|
+
data: unknown;
|
|
7
|
+
depth: number;
|
|
8
|
+
fields: Field[];
|
|
9
|
+
overrideAccess: boolean;
|
|
10
|
+
promises: Promise<void>[];
|
|
11
|
+
req: PayloadRequest;
|
|
12
|
+
showHiddenFields: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const recurseNestedFields: ({ afterReadPromises, currentDepth, data, depth, fields, overrideAccess, promises, req, showHiddenFields, }: NestedRichTextFieldsArgs) => void;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=recurseNestedFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recurseNestedFields.d.ts","sourceRoot":"","sources":["../../src/populate/recurseNestedFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,cAAc,EAAiB,MAAM,eAAe,CAAA;AAIzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAM/D,KAAK,wBAAwB,GAAG;IAC9B,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;IACvD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IACzB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,mBAAmB,+GAU7B,wBAAwB,KAAG,IAoL7B,CAAA"}
|