@domternal/core 0.4.0 → 0.4.1
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/CanChecker.d.ts +79 -0
- package/dist/CanChecker.d.ts.map +1 -0
- package/dist/CanChecker.test.d.ts +2 -0
- package/dist/CanChecker.test.d.ts.map +1 -0
- package/dist/ChainBuilder.d.ts +119 -0
- package/dist/ChainBuilder.d.ts.map +1 -0
- package/dist/ChainBuilder.test.d.ts +2 -0
- package/dist/ChainBuilder.test.d.ts.map +1 -0
- package/dist/CommandManager.d.ts +86 -0
- package/dist/CommandManager.d.ts.map +1 -0
- package/dist/CommandManager.test.d.ts +2 -0
- package/dist/CommandManager.test.d.ts.map +1 -0
- package/dist/Editor.d.ts +262 -0
- package/dist/Editor.d.ts.map +1 -0
- package/dist/Editor.test.d.ts +2 -0
- package/dist/Editor.test.d.ts.map +1 -0
- package/dist/EventEmitter.d.ts +57 -0
- package/dist/EventEmitter.d.ts.map +1 -0
- package/dist/EventEmitter.test.d.ts +2 -0
- package/dist/EventEmitter.test.d.ts.map +1 -0
- package/dist/Extension.d.ts +171 -0
- package/dist/Extension.d.ts.map +1 -0
- package/dist/Extension.test.d.ts +2 -0
- package/dist/Extension.test.d.ts.map +1 -0
- package/dist/ExtensionManager.d.ts +283 -0
- package/dist/ExtensionManager.d.ts.map +1 -0
- package/dist/ExtensionManager.test.d.ts +2 -0
- package/dist/ExtensionManager.test.d.ts.map +1 -0
- package/dist/Mark.d.ts +164 -0
- package/dist/Mark.d.ts.map +1 -0
- package/dist/Mark.test.d.ts +5 -0
- package/dist/Mark.test.d.ts.map +1 -0
- package/dist/Node.d.ts +153 -0
- package/dist/Node.d.ts.map +1 -0
- package/dist/Node.test.d.ts +2 -0
- package/dist/Node.test.d.ts.map +1 -0
- package/dist/ToolbarController.d.ts +169 -0
- package/dist/ToolbarController.d.ts.map +1 -0
- package/dist/ToolbarController.test.d.ts +2 -0
- package/dist/ToolbarController.test.d.ts.map +1 -0
- package/dist/commandPropsBuilder.d.ts +70 -0
- package/dist/commandPropsBuilder.d.ts.map +1 -0
- package/dist/commandPropsBuilder.test.d.ts +2 -0
- package/dist/commandPropsBuilder.test.d.ts.map +1 -0
- package/dist/commands/attributeCommands.d.ts +24 -0
- package/dist/commands/attributeCommands.d.ts.map +1 -0
- package/dist/commands/attributeCommands.test.d.ts +2 -0
- package/dist/commands/attributeCommands.test.d.ts.map +1 -0
- package/dist/commands/builtIn.test.d.ts +2 -0
- package/dist/commands/builtIn.test.d.ts.map +1 -0
- package/dist/commands/contentCommands.d.ts +52 -0
- package/dist/commands/contentCommands.d.ts.map +1 -0
- package/dist/commands/contentCommands.test.d.ts +2 -0
- package/dist/commands/contentCommands.test.d.ts.map +1 -0
- package/dist/commands/index.d.ts +43 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/listCommands.d.ts +15 -0
- package/dist/commands/listCommands.d.ts.map +1 -0
- package/dist/commands/listCommands.test.d.ts +2 -0
- package/dist/commands/listCommands.test.d.ts.map +1 -0
- package/dist/commands/markCommands.d.ts +40 -0
- package/dist/commands/markCommands.d.ts.map +1 -0
- package/dist/commands/markCommands.test.d.ts +2 -0
- package/dist/commands/markCommands.test.d.ts.map +1 -0
- package/dist/commands/nodeCommands.d.ts +53 -0
- package/dist/commands/nodeCommands.d.ts.map +1 -0
- package/dist/commands/nodeCommands.test.d.ts +2 -0
- package/dist/commands/nodeCommands.test.d.ts.map +1 -0
- package/dist/commands/selectionCommands.d.ts +37 -0
- package/dist/commands/selectionCommands.d.ts.map +1 -0
- package/dist/commands/selectionCommands.test.d.ts +2 -0
- package/dist/commands/selectionCommands.test.d.ts.map +1 -0
- package/dist/extensions/BaseKeymap.d.ts +36 -0
- package/dist/extensions/BaseKeymap.d.ts.map +1 -0
- package/dist/extensions/BaseKeymap.test.d.ts +2 -0
- package/dist/extensions/BaseKeymap.test.d.ts.map +1 -0
- package/dist/extensions/BubbleMenu.d.ts +85 -0
- package/dist/extensions/BubbleMenu.d.ts.map +1 -0
- package/dist/extensions/BubbleMenu.test.d.ts +2 -0
- package/dist/extensions/BubbleMenu.test.d.ts.map +1 -0
- package/dist/extensions/CharacterCount.d.ts +60 -0
- package/dist/extensions/CharacterCount.d.ts.map +1 -0
- package/dist/extensions/CharacterCount.test.d.ts +2 -0
- package/dist/extensions/CharacterCount.test.d.ts.map +1 -0
- package/dist/extensions/ClearFormatting.d.ts +25 -0
- package/dist/extensions/ClearFormatting.d.ts.map +1 -0
- package/dist/extensions/ClearFormatting.test.d.ts +2 -0
- package/dist/extensions/ClearFormatting.test.d.ts.map +1 -0
- package/dist/extensions/Dropcursor.d.ts +20 -0
- package/dist/extensions/Dropcursor.d.ts.map +1 -0
- package/dist/extensions/Dropcursor.test.d.ts +2 -0
- package/dist/extensions/Dropcursor.test.d.ts.map +1 -0
- package/dist/extensions/FloatingMenu.d.ts +74 -0
- package/dist/extensions/FloatingMenu.d.ts.map +1 -0
- package/dist/extensions/FloatingMenu.test.d.ts +2 -0
- package/dist/extensions/FloatingMenu.test.d.ts.map +1 -0
- package/dist/extensions/Focus.d.ts +26 -0
- package/dist/extensions/Focus.d.ts.map +1 -0
- package/dist/extensions/Focus.test.d.ts +2 -0
- package/dist/extensions/Focus.test.d.ts.map +1 -0
- package/dist/extensions/FontFamily.d.ts +41 -0
- package/dist/extensions/FontFamily.d.ts.map +1 -0
- package/dist/extensions/FontFamily.test.d.ts +2 -0
- package/dist/extensions/FontFamily.test.d.ts.map +1 -0
- package/dist/extensions/FontSize.d.ts +46 -0
- package/dist/extensions/FontSize.d.ts.map +1 -0
- package/dist/extensions/FontSize.test.d.ts +2 -0
- package/dist/extensions/FontSize.test.d.ts.map +1 -0
- package/dist/extensions/Gapcursor.d.ts +3 -0
- package/dist/extensions/Gapcursor.d.ts.map +1 -0
- package/dist/extensions/Gapcursor.test.d.ts +2 -0
- package/dist/extensions/Gapcursor.test.d.ts.map +1 -0
- package/dist/extensions/Highlight.d.ts +61 -0
- package/dist/extensions/Highlight.d.ts.map +1 -0
- package/dist/extensions/Highlight.test.d.ts +2 -0
- package/dist/extensions/Highlight.test.d.ts.map +1 -0
- package/dist/extensions/History.d.ts +22 -0
- package/dist/extensions/History.d.ts.map +1 -0
- package/dist/extensions/History.test.d.ts +2 -0
- package/dist/extensions/History.test.d.ts.map +1 -0
- package/dist/extensions/InvisibleChars.d.ts +86 -0
- package/dist/extensions/InvisibleChars.d.ts.map +1 -0
- package/dist/extensions/InvisibleChars.test.d.ts +2 -0
- package/dist/extensions/InvisibleChars.test.d.ts.map +1 -0
- package/dist/extensions/LineHeight.d.ts +50 -0
- package/dist/extensions/LineHeight.d.ts.map +1 -0
- package/dist/extensions/LineHeight.test.d.ts +2 -0
- package/dist/extensions/LineHeight.test.d.ts.map +1 -0
- package/dist/extensions/LinkPopover.d.ts +10 -0
- package/dist/extensions/LinkPopover.d.ts.map +1 -0
- package/dist/extensions/ListKeymap.d.ts +10 -0
- package/dist/extensions/ListKeymap.d.ts.map +1 -0
- package/dist/extensions/ListKeymap.test.d.ts +2 -0
- package/dist/extensions/ListKeymap.test.d.ts.map +1 -0
- package/dist/extensions/Placeholder.d.ts +47 -0
- package/dist/extensions/Placeholder.d.ts.map +1 -0
- package/dist/extensions/Placeholder.test.d.ts +2 -0
- package/dist/extensions/Placeholder.test.d.ts.map +1 -0
- package/dist/extensions/Selection.d.ts +71 -0
- package/dist/extensions/Selection.d.ts.map +1 -0
- package/dist/extensions/Selection.test.d.ts +2 -0
- package/dist/extensions/Selection.test.d.ts.map +1 -0
- package/dist/extensions/SelectionDecoration.d.ts +18 -0
- package/dist/extensions/SelectionDecoration.d.ts.map +1 -0
- package/dist/extensions/SelectionDecoration.test.d.ts +2 -0
- package/dist/extensions/SelectionDecoration.test.d.ts.map +1 -0
- package/dist/extensions/StarterKit.d.ts +138 -0
- package/dist/extensions/StarterKit.d.ts.map +1 -0
- package/dist/extensions/StarterKit.test.d.ts +2 -0
- package/dist/extensions/StarterKit.test.d.ts.map +1 -0
- package/dist/extensions/TextAlign.d.ts +32 -0
- package/dist/extensions/TextAlign.d.ts.map +1 -0
- package/dist/extensions/TextAlign.test.d.ts +2 -0
- package/dist/extensions/TextAlign.test.d.ts.map +1 -0
- package/dist/extensions/TextColor.d.ts +55 -0
- package/dist/extensions/TextColor.d.ts.map +1 -0
- package/dist/extensions/TextColor.test.d.ts +2 -0
- package/dist/extensions/TextColor.test.d.ts.map +1 -0
- package/dist/extensions/TrailingNode.d.ts +16 -0
- package/dist/extensions/TrailingNode.d.ts.map +1 -0
- package/dist/extensions/TrailingNode.test.d.ts +2 -0
- package/dist/extensions/TrailingNode.test.d.ts.map +1 -0
- package/dist/extensions/Typography.d.ts +65 -0
- package/dist/extensions/Typography.d.ts.map +1 -0
- package/dist/extensions/Typography.test.d.ts +2 -0
- package/dist/extensions/Typography.test.d.ts.map +1 -0
- package/dist/extensions/UniqueID.d.ts +48 -0
- package/dist/extensions/UniqueID.d.ts.map +1 -0
- package/dist/extensions/UniqueID.test.d.ts +2 -0
- package/dist/extensions/UniqueID.test.d.ts.map +1 -0
- package/dist/extensions/index.d.ts +29 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/isActive-markExclusion.test.d.ts +2 -0
- package/dist/extensions/isActive-markExclusion.test.d.ts.map +1 -0
- package/dist/helpers/callOrReturn.d.ts +30 -0
- package/dist/helpers/callOrReturn.d.ts.map +1 -0
- package/dist/helpers/callOrReturn.test.d.ts +2 -0
- package/dist/helpers/callOrReturn.test.d.ts.map +1 -0
- package/dist/helpers/createDocument.d.ts +48 -0
- package/dist/helpers/createDocument.d.ts.map +1 -0
- package/dist/helpers/createDocument.test.d.ts +2 -0
- package/dist/helpers/createDocument.test.d.ts.map +1 -0
- package/dist/helpers/defaultBlockAt.d.ts +15 -0
- package/dist/helpers/defaultBlockAt.d.ts.map +1 -0
- package/dist/helpers/defaultBlockAt.test.d.ts +2 -0
- package/dist/helpers/defaultBlockAt.test.d.ts.map +1 -0
- package/dist/helpers/findChildren.d.ts +13 -0
- package/dist/helpers/findChildren.d.ts.map +1 -0
- package/dist/helpers/findChildren.test.d.ts +2 -0
- package/dist/helpers/findChildren.test.d.ts.map +1 -0
- package/dist/helpers/findParentNode.d.ts +21 -0
- package/dist/helpers/findParentNode.d.ts.map +1 -0
- package/dist/helpers/findParentNode.test.d.ts +2 -0
- package/dist/helpers/findParentNode.test.d.ts.map +1 -0
- package/dist/helpers/getMarkRange.d.ts +17 -0
- package/dist/helpers/getMarkRange.d.ts.map +1 -0
- package/dist/helpers/getMarkRange.test.d.ts +2 -0
- package/dist/helpers/getMarkRange.test.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +18 -0
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/inputRulesPlugin.d.ts +26 -0
- package/dist/helpers/inputRulesPlugin.d.ts.map +1 -0
- package/dist/helpers/isNodeEmpty.d.ts +52 -0
- package/dist/helpers/isNodeEmpty.d.ts.map +1 -0
- package/dist/helpers/isNodeEmpty.test.d.ts +2 -0
- package/dist/helpers/isNodeEmpty.test.d.ts.map +1 -0
- package/dist/helpers/isValidUrl.d.ts +31 -0
- package/dist/helpers/isValidUrl.d.ts.map +1 -0
- package/dist/helpers/isValidUrl.test.d.ts +2 -0
- package/dist/helpers/isValidUrl.test.d.ts.map +1 -0
- package/dist/helpers/markInputRule.d.ts +88 -0
- package/dist/helpers/markInputRule.d.ts.map +1 -0
- package/dist/helpers/markInputRule.test.d.ts +2 -0
- package/dist/helpers/markInputRule.test.d.ts.map +1 -0
- package/dist/helpers/nodeInputRule.d.ts +41 -0
- package/dist/helpers/nodeInputRule.d.ts.map +1 -0
- package/dist/helpers/normalizeColor.d.ts +7 -0
- package/dist/helpers/normalizeColor.d.ts.map +1 -0
- package/dist/helpers/normalizeColor.test.d.ts +2 -0
- package/dist/helpers/normalizeColor.test.d.ts.map +1 -0
- package/dist/helpers/specBuilder.d.ts +28 -0
- package/dist/helpers/specBuilder.d.ts.map +1 -0
- package/dist/helpers/specBuilder.test.d.ts +2 -0
- package/dist/helpers/specBuilder.test.d.ts.map +1 -0
- package/dist/helpers/ssr.d.ts +80 -0
- package/dist/helpers/ssr.d.ts.map +1 -0
- package/dist/helpers/ssr.test.d.ts +2 -0
- package/dist/helpers/ssr.test.d.ts.map +1 -0
- package/dist/helpers/textInputRule.d.ts +34 -0
- package/dist/helpers/textInputRule.d.ts.map +1 -0
- package/dist/helpers/textblockTypeInputRule.d.ts +41 -0
- package/dist/helpers/textblockTypeInputRule.d.ts.map +1 -0
- package/dist/helpers/wrappingInputRule.d.ts +66 -0
- package/dist/helpers/wrappingInputRule.d.ts.map +1 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/icons/phosphor.d.ts +3 -0
- package/dist/icons/phosphor.d.ts.map +1 -0
- package/dist/index.d.ts +23 -5832
- package/dist/index.d.ts.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/marks/Bold.d.ts +40 -0
- package/dist/marks/Bold.d.ts.map +1 -0
- package/dist/marks/Bold.test.d.ts +2 -0
- package/dist/marks/Bold.test.d.ts.map +1 -0
- package/dist/marks/Code.d.ts +40 -0
- package/dist/marks/Code.d.ts.map +1 -0
- package/dist/marks/Code.test.d.ts +2 -0
- package/dist/marks/Code.test.d.ts.map +1 -0
- package/dist/marks/Italic.d.ts +40 -0
- package/dist/marks/Italic.d.ts.map +1 -0
- package/dist/marks/Italic.test.d.ts +2 -0
- package/dist/marks/Italic.test.d.ts.map +1 -0
- package/dist/marks/Link.d.ts +75 -0
- package/dist/marks/Link.d.ts.map +1 -0
- package/dist/marks/Link.test.d.ts +2 -0
- package/dist/marks/Link.test.d.ts.map +1 -0
- package/dist/marks/Strike.d.ts +39 -0
- package/dist/marks/Strike.d.ts.map +1 -0
- package/dist/marks/Strike.test.d.ts +2 -0
- package/dist/marks/Strike.test.d.ts.map +1 -0
- package/dist/marks/Subscript.d.ts +38 -0
- package/dist/marks/Subscript.d.ts.map +1 -0
- package/dist/marks/Subscript.test.d.ts +2 -0
- package/dist/marks/Subscript.test.d.ts.map +1 -0
- package/dist/marks/Superscript.d.ts +38 -0
- package/dist/marks/Superscript.d.ts.map +1 -0
- package/dist/marks/Superscript.test.d.ts +2 -0
- package/dist/marks/Superscript.test.d.ts.map +1 -0
- package/dist/marks/TextStyle.d.ts +41 -0
- package/dist/marks/TextStyle.d.ts.map +1 -0
- package/dist/marks/TextStyle.test.d.ts +2 -0
- package/dist/marks/TextStyle.test.d.ts.map +1 -0
- package/dist/marks/Underline.d.ts +38 -0
- package/dist/marks/Underline.d.ts.map +1 -0
- package/dist/marks/Underline.test.d.ts +2 -0
- package/dist/marks/Underline.test.d.ts.map +1 -0
- package/dist/marks/helpers/autolinkPlugin.d.ts +48 -0
- package/dist/marks/helpers/autolinkPlugin.d.ts.map +1 -0
- package/dist/marks/helpers/autolinkPlugin.test.d.ts +2 -0
- package/dist/marks/helpers/autolinkPlugin.test.d.ts.map +1 -0
- package/dist/marks/helpers/index.d.ts +10 -0
- package/dist/marks/helpers/index.d.ts.map +1 -0
- package/dist/marks/helpers/linkClickPlugin.d.ts +43 -0
- package/dist/marks/helpers/linkClickPlugin.d.ts.map +1 -0
- package/dist/marks/helpers/linkClickPlugin.test.d.ts +2 -0
- package/dist/marks/helpers/linkClickPlugin.test.d.ts.map +1 -0
- package/dist/marks/helpers/linkExitPlugin.d.ts +37 -0
- package/dist/marks/helpers/linkExitPlugin.d.ts.map +1 -0
- package/dist/marks/helpers/linkExitPlugin.test.d.ts +2 -0
- package/dist/marks/helpers/linkExitPlugin.test.d.ts.map +1 -0
- package/dist/marks/helpers/linkPastePlugin.d.ts +44 -0
- package/dist/marks/helpers/linkPastePlugin.d.ts.map +1 -0
- package/dist/marks/helpers/linkPastePlugin.test.d.ts +2 -0
- package/dist/marks/helpers/linkPastePlugin.test.d.ts.map +1 -0
- package/dist/marks/index.d.ts +16 -0
- package/dist/marks/index.d.ts.map +1 -0
- package/dist/nodes/Blockquote.d.ts +19 -0
- package/dist/nodes/Blockquote.d.ts.map +1 -0
- package/dist/nodes/Blockquote.test.d.ts +2 -0
- package/dist/nodes/Blockquote.test.d.ts.map +1 -0
- package/dist/nodes/BulletList.d.ts +18 -0
- package/dist/nodes/BulletList.d.ts.map +1 -0
- package/dist/nodes/BulletList.test.d.ts +2 -0
- package/dist/nodes/BulletList.test.d.ts.map +1 -0
- package/dist/nodes/CodeBlock.d.ts +29 -0
- package/dist/nodes/CodeBlock.d.ts.map +1 -0
- package/dist/nodes/CodeBlock.test.d.ts +2 -0
- package/dist/nodes/CodeBlock.test.d.ts.map +1 -0
- package/dist/nodes/Document.d.ts +9 -0
- package/dist/nodes/Document.d.ts.map +1 -0
- package/dist/nodes/Document.test.d.ts +2 -0
- package/dist/nodes/Document.test.d.ts.map +1 -0
- package/dist/nodes/HardBreak.d.ts +18 -0
- package/dist/nodes/HardBreak.d.ts.map +1 -0
- package/dist/nodes/HardBreak.test.d.ts +2 -0
- package/dist/nodes/HardBreak.test.d.ts.map +1 -0
- package/dist/nodes/Heading.d.ts +23 -0
- package/dist/nodes/Heading.d.ts.map +1 -0
- package/dist/nodes/Heading.test.d.ts +2 -0
- package/dist/nodes/Heading.test.d.ts.map +1 -0
- package/dist/nodes/HorizontalRule.d.ts +17 -0
- package/dist/nodes/HorizontalRule.d.ts.map +1 -0
- package/dist/nodes/HorizontalRule.test.d.ts +2 -0
- package/dist/nodes/HorizontalRule.test.d.ts.map +1 -0
- package/dist/nodes/ListItem.d.ts +16 -0
- package/dist/nodes/ListItem.d.ts.map +1 -0
- package/dist/nodes/ListItem.test.d.ts +2 -0
- package/dist/nodes/ListItem.test.d.ts.map +1 -0
- package/dist/nodes/OrderedList.d.ts +18 -0
- package/dist/nodes/OrderedList.d.ts.map +1 -0
- package/dist/nodes/OrderedList.test.d.ts +2 -0
- package/dist/nodes/OrderedList.test.d.ts.map +1 -0
- package/dist/nodes/Paragraph.d.ts +17 -0
- package/dist/nodes/Paragraph.d.ts.map +1 -0
- package/dist/nodes/Paragraph.test.d.ts +2 -0
- package/dist/nodes/Paragraph.test.d.ts.map +1 -0
- package/dist/nodes/TaskItem.d.ts +24 -0
- package/dist/nodes/TaskItem.d.ts.map +1 -0
- package/dist/nodes/TaskItem.test.d.ts +2 -0
- package/dist/nodes/TaskItem.test.d.ts.map +1 -0
- package/dist/nodes/TaskList.d.ts +18 -0
- package/dist/nodes/TaskList.d.ts.map +1 -0
- package/dist/nodes/TaskList.test.d.ts +2 -0
- package/dist/nodes/TaskList.test.d.ts.map +1 -0
- package/dist/nodes/Text.d.ts +9 -0
- package/dist/nodes/Text.d.ts.map +1 -0
- package/dist/nodes/Text.test.d.ts +2 -0
- package/dist/nodes/Text.test.d.ts.map +1 -0
- package/dist/nodes/index.d.ts +19 -0
- package/dist/nodes/index.d.ts.map +1 -0
- package/dist/nodes/integration.test.d.ts +7 -0
- package/dist/nodes/integration.test.d.ts.map +1 -0
- package/dist/types/AttributeSpec.d.ts +78 -0
- package/dist/types/AttributeSpec.d.ts.map +1 -0
- package/dist/types/Commands.d.ts +125 -0
- package/dist/types/Commands.d.ts.map +1 -0
- package/dist/types/Content.d.ts +40 -0
- package/dist/types/Content.d.ts.map +1 -0
- package/dist/types/EditorEvents.d.ts +131 -0
- package/dist/types/EditorEvents.d.ts.map +1 -0
- package/dist/types/EditorOptions.d.ts +133 -0
- package/dist/types/EditorOptions.d.ts.map +1 -0
- package/dist/types/ExtensionConfig.d.ts +271 -0
- package/dist/types/ExtensionConfig.d.ts.map +1 -0
- package/dist/types/MarkConfig.d.ts +206 -0
- package/dist/types/MarkConfig.d.ts.map +1 -0
- package/dist/types/NodeConfig.d.ts +263 -0
- package/dist/types/NodeConfig.d.ts.map +1 -0
- package/dist/types/Toolbar.d.ts +172 -0
- package/dist/types/Toolbar.d.ts.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/inlineStyles.d.ts +83 -0
- package/dist/utils/inlineStyles.d.ts.map +1 -0
- package/dist/utils/inlineStyles.test.d.ts +2 -0
- package/dist/utils/inlineStyles.test.d.ts.map +1 -0
- package/dist/utils/positionFloating.d.ts +74 -0
- package/dist/utils/positionFloating.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the closest parent node matching a predicate
|
|
3
|
+
*
|
|
4
|
+
* Returns a curried function: findParentNode(predicate)(selection)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const details = findParentNode(node => node.type.name === 'details')(selection);
|
|
8
|
+
* if (details) {
|
|
9
|
+
* console.log(details.pos, details.node);
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
import type { Node as PMNode } from '@domternal/pm/model';
|
|
13
|
+
import type { Selection } from '@domternal/pm/state';
|
|
14
|
+
export interface FindParentNodeResult {
|
|
15
|
+
pos: number;
|
|
16
|
+
start: number;
|
|
17
|
+
depth: number;
|
|
18
|
+
node: PMNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const findParentNode: (predicate: (node: PMNode) => boolean) => (selection: Selection) => FindParentNodeResult | undefined;
|
|
21
|
+
//# sourceMappingURL=findParentNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findParentNode.d.ts","sourceRoot":"","sources":["../../src/helpers/findParentNode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,eAAO,MAAM,cAAc,GACxB,WAAW,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,MACpC,WAAW,SAAS,KAAG,oBAAoB,GAAG,SAiB9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findParentNode.test.d.ts","sourceRoot":"","sources":["../../src/helpers/findParentNode.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get the range of a mark at a resolved position.
|
|
3
|
+
*
|
|
4
|
+
* Walks backward and forward from the position to find contiguous
|
|
5
|
+
* text nodes that share the same mark type, returning the full range.
|
|
6
|
+
*/
|
|
7
|
+
import type { MarkType, ResolvedPos } from '@domternal/pm/model';
|
|
8
|
+
export interface MarkRange {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Returns the contiguous range of a mark around the given resolved position.
|
|
14
|
+
* Returns undefined if the mark is not present at the position.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getMarkRange($pos: ResolvedPos, type: MarkType): MarkRange | undefined;
|
|
17
|
+
//# sourceMappingURL=getMarkRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMarkRange.d.ts","sourceRoot":"","sources":["../../src/helpers/getMarkRange.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,QAAQ,GACb,SAAS,GAAG,SAAS,CAgCvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMarkRange.test.d.ts","sourceRoot":"","sources":["../../src/helpers/getMarkRange.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper utilities for @domternal/core
|
|
3
|
+
*/
|
|
4
|
+
export { createDocument, type CreateDocumentOptions } from './createDocument.js';
|
|
5
|
+
export { isNodeEmpty, isDocumentEmpty, type IsNodeEmptyOptions, } from './isNodeEmpty.js';
|
|
6
|
+
export { callOrReturn } from './callOrReturn.js';
|
|
7
|
+
export { markInputRule, markInputRulePatterns, type MarkInputRuleOptions, } from './markInputRule.js';
|
|
8
|
+
export { wrappingInputRule, notInsideList, type WrappingInputRuleOptions, } from './wrappingInputRule.js';
|
|
9
|
+
export { textblockTypeInputRule, type TextblockTypeInputRuleOptions, } from './textblockTypeInputRule.js';
|
|
10
|
+
export { textInputRule, type TextInputRuleOptions, } from './textInputRule.js';
|
|
11
|
+
export { nodeInputRule, type NodeInputRuleOptions, } from './nodeInputRule.js';
|
|
12
|
+
export { isValidUrl, type IsValidUrlOptions, } from './isValidUrl.js';
|
|
13
|
+
export { generateHTML, generateJSON, generateText, type GenerateHTMLOptions, type GenerateJSONOptions, type GenerateTextOptions, } from './ssr.js';
|
|
14
|
+
export { getMarkRange, type MarkRange } from './getMarkRange.js';
|
|
15
|
+
export { findParentNode, type FindParentNodeResult, } from './findParentNode.js';
|
|
16
|
+
export { findChildren, type FindChildResult } from './findChildren.js';
|
|
17
|
+
export { defaultBlockAt } from './defaultBlockAt.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EACL,WAAW,EACX,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,KAAK,wBAAwB,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,aAAa,EACb,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,cAAc,EACd,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom inputRules plugin with built-in Backspace undo.
|
|
3
|
+
*
|
|
4
|
+
* Two enhancements over ProseMirror's built-in inputRules plugin:
|
|
5
|
+
*
|
|
6
|
+
* 1. Preserves undo state across appendTransaction (e.g. TrailingNode).
|
|
7
|
+
* PM's plugin clears state on any docChanged transaction, so
|
|
8
|
+
* appendTransaction handlers that fire after an input rule erase the
|
|
9
|
+
* undo info before the user can press Backspace.
|
|
10
|
+
*
|
|
11
|
+
* 2. Handles Backspace directly via handleKeyDown (highest priority in
|
|
12
|
+
* ProseMirror's event dispatch) so no other keymap can intercept it
|
|
13
|
+
* first. If the plugin has stored undo state, Backspace inverts the
|
|
14
|
+
* input rule steps and restores the original typed text.
|
|
15
|
+
*/
|
|
16
|
+
import { Plugin } from '@domternal/pm/state';
|
|
17
|
+
import type { InputRule } from '@domternal/pm/inputrules';
|
|
18
|
+
/**
|
|
19
|
+
* Creates an input rules plugin with built-in Backspace undo.
|
|
20
|
+
*
|
|
21
|
+
* Drop-in replacement for ProseMirror's `inputRules({ rules })`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function inputRulesPlugin({ rules }: {
|
|
24
|
+
rules: InputRule[];
|
|
25
|
+
}): Plugin;
|
|
26
|
+
//# sourceMappingURL=inputRulesPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputRulesPlugin.d.ts","sourceRoot":"","sources":["../../src/helpers/inputRulesPlugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AA6G1D;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,SAAS,EAAE,CAAA;CAAE,GAAG,MAAM,CA4C1E"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a ProseMirror node is empty
|
|
3
|
+
*/
|
|
4
|
+
import type { Node as PMNode } from '@domternal/pm/model';
|
|
5
|
+
/**
|
|
6
|
+
* Options for isNodeEmpty check
|
|
7
|
+
*/
|
|
8
|
+
export interface IsNodeEmptyOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Check child nodes recursively
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
checkChildren?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Ignore hardBreak nodes when checking emptiness
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
ignoreHardBreaks?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Checks if a ProseMirror node is considered empty
|
|
22
|
+
*
|
|
23
|
+
* A node is considered empty if:
|
|
24
|
+
* - It has no content (childCount === 0)
|
|
25
|
+
* - It only contains empty child nodes (when checkChildren is true)
|
|
26
|
+
* - It only contains hardBreaks (when ignoreHardBreaks is true)
|
|
27
|
+
*
|
|
28
|
+
* @param node - ProseMirror node to check
|
|
29
|
+
* @param options - Options for emptiness check
|
|
30
|
+
* @returns true if node is empty
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* // Check if document is empty
|
|
35
|
+
* const empty = isNodeEmpty(editor.state.doc);
|
|
36
|
+
*
|
|
37
|
+
* // Check without recursion
|
|
38
|
+
* const empty = isNodeEmpty(node, { checkChildren: false });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function isNodeEmpty(node: PMNode, options?: IsNodeEmptyOptions): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a document node is empty
|
|
44
|
+
*
|
|
45
|
+
* Convenience wrapper for isNodeEmpty with document-specific defaults.
|
|
46
|
+
* A document is empty if it only contains empty paragraphs or no content.
|
|
47
|
+
*
|
|
48
|
+
* @param doc - Document node to check
|
|
49
|
+
* @returns true if document is empty
|
|
50
|
+
*/
|
|
51
|
+
export declare function isDocumentEmpty(doc: PMNode): boolean;
|
|
52
|
+
//# sourceMappingURL=isNodeEmpty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNodeEmpty.d.ts","sourceRoot":"","sources":["../../src/helpers/isNodeEmpty.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAqCT;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNodeEmpty.test.d.ts","sourceRoot":"","sources":["../../src/helpers/isNodeEmpty.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL Validation Helper
|
|
3
|
+
*
|
|
4
|
+
* Provides a utility for validating URLs.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Options for URL validation
|
|
8
|
+
*/
|
|
9
|
+
export interface IsValidUrlOptions {
|
|
10
|
+
/**
|
|
11
|
+
* List of allowed URL protocols
|
|
12
|
+
* @default ['http:', 'https:']
|
|
13
|
+
*/
|
|
14
|
+
protocols?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a string is a valid URL
|
|
18
|
+
*
|
|
19
|
+
* @param url - The string to validate
|
|
20
|
+
* @param options - Validation options
|
|
21
|
+
* @returns True if the string is a valid URL with an allowed protocol
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```ts
|
|
25
|
+
* isValidUrl('https://example.com'); // true
|
|
26
|
+
* isValidUrl('javascript:alert(1)'); // false (protocol not allowed)
|
|
27
|
+
* isValidUrl('not a url'); // false
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function isValidUrl(url: string, options?: IsValidUrlOptions): boolean;
|
|
31
|
+
//# sourceMappingURL=isValidUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidUrl.d.ts","sourceRoot":"","sources":["../../src/helpers/isValidUrl.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAST"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isValidUrl.test.d.ts","sourceRoot":"","sources":["../../src/helpers/isValidUrl.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mark Input Rule Helper
|
|
3
|
+
*
|
|
4
|
+
* Creates input rules for applying marks based on regex patterns.
|
|
5
|
+
* Used for markdown-style shortcuts like **bold**, *italic*, ~~strike~~, etc.
|
|
6
|
+
*/
|
|
7
|
+
import { InputRule } from '@domternal/pm/inputrules';
|
|
8
|
+
import type { MarkType } from '@domternal/pm/model';
|
|
9
|
+
/**
|
|
10
|
+
* Options for creating a mark input rule
|
|
11
|
+
*/
|
|
12
|
+
export interface MarkInputRuleOptions {
|
|
13
|
+
/**
|
|
14
|
+
* The regex pattern to match.
|
|
15
|
+
* Must have a capture group for the content to be marked.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* // Match **text**
|
|
19
|
+
* /(?:\*\*)([^*]+)(?:\*\*)$/
|
|
20
|
+
*/
|
|
21
|
+
find: RegExp;
|
|
22
|
+
/**
|
|
23
|
+
* The mark type to apply
|
|
24
|
+
*/
|
|
25
|
+
type: MarkType;
|
|
26
|
+
/**
|
|
27
|
+
* Whether Backspace can undo this input rule immediately after it fires.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
undoable?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Optional: get attributes from the match
|
|
33
|
+
*
|
|
34
|
+
* @param match - The regex match array
|
|
35
|
+
* @returns Mark attributes or null to skip
|
|
36
|
+
*/
|
|
37
|
+
getAttributes?: (match: RegExpMatchArray) => Record<string, unknown> | null;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Creates an input rule that applies a mark to matched text.
|
|
41
|
+
*
|
|
42
|
+
* When the user types text matching the pattern, the delimiters are removed
|
|
43
|
+
* and the mark is applied to the content.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* // **text** → applies bold mark to "text"
|
|
47
|
+
* markInputRule({
|
|
48
|
+
* find: /(?:\*\*)([^*]+)(?:\*\*)$/,
|
|
49
|
+
* type: schema.marks.bold,
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // `text` → applies code mark to "text"
|
|
54
|
+
* markInputRule({
|
|
55
|
+
* find: /(?:`)([^`]+)(?:`)$/,
|
|
56
|
+
* type: schema.marks.code,
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* @param options - Configuration options
|
|
60
|
+
* @returns ProseMirror InputRule
|
|
61
|
+
*/
|
|
62
|
+
export declare function markInputRule(options: MarkInputRuleOptions): InputRule;
|
|
63
|
+
/**
|
|
64
|
+
* Pre-built regex patterns for common mark input rules
|
|
65
|
+
*/
|
|
66
|
+
export declare const markInputRulePatterns: {
|
|
67
|
+
/**
|
|
68
|
+
* Bold: **text** or __text__
|
|
69
|
+
* Matches text wrapped in double asterisks or underscores
|
|
70
|
+
*/
|
|
71
|
+
readonly bold: RegExp;
|
|
72
|
+
/**
|
|
73
|
+
* Strike: ~~text~~
|
|
74
|
+
* Matches text wrapped in double tildes
|
|
75
|
+
*/
|
|
76
|
+
readonly strike: RegExp;
|
|
77
|
+
/**
|
|
78
|
+
* Code: `text`
|
|
79
|
+
* Matches text wrapped in backticks
|
|
80
|
+
*/
|
|
81
|
+
readonly code: RegExp;
|
|
82
|
+
/**
|
|
83
|
+
* Highlight: ==text==
|
|
84
|
+
* Matches text wrapped in double equals
|
|
85
|
+
*/
|
|
86
|
+
readonly highlight: RegExp;
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=markInputRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markInputRule.d.ts","sourceRoot":"","sources":["../../src/helpers/markInputRule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7E;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAmCtE;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;IAChC;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;CAEK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markInputRule.test.d.ts","sourceRoot":"","sources":["../../src/helpers/markInputRule.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Input Rule Helper
|
|
3
|
+
*
|
|
4
|
+
* Creates input rules that replace matched text with a node.
|
|
5
|
+
* Used for nodes like HorizontalRule, Image, Emoji, etc.
|
|
6
|
+
*/
|
|
7
|
+
import { InputRule } from '@domternal/pm/inputrules';
|
|
8
|
+
import type { NodeType, Attrs } from '@domternal/pm/model';
|
|
9
|
+
import type { EditorState } from '@domternal/pm/state';
|
|
10
|
+
export interface NodeInputRuleOptions {
|
|
11
|
+
/**
|
|
12
|
+
* The regex pattern to match.
|
|
13
|
+
*/
|
|
14
|
+
find: RegExp;
|
|
15
|
+
/**
|
|
16
|
+
* The node type to insert.
|
|
17
|
+
*/
|
|
18
|
+
type: NodeType;
|
|
19
|
+
/**
|
|
20
|
+
* Whether Backspace can undo this input rule immediately after it fires.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
undoable?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Node attributes, or a function that computes them from the match.
|
|
26
|
+
*/
|
|
27
|
+
getAttributes?: Attrs | null | ((match: RegExpMatchArray, state: EditorState) => Attrs | null);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates an input rule that replaces matched text with a node.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // `:smile:` inserts an emoji node
|
|
34
|
+
* nodeInputRule({
|
|
35
|
+
* find: /:([a-zA-Z0-9_+-]+):$/,
|
|
36
|
+
* type: schema.nodes.emoji,
|
|
37
|
+
* getAttributes: (match) => ({ name: match[1] }),
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
export declare function nodeInputRule(options: NodeInputRuleOptions): InputRule;
|
|
41
|
+
//# sourceMappingURL=nodeInputRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodeInputRule.d.ts","sourceRoot":"","sources":["../../src/helpers/nodeInputRule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;CAChG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAYtE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes browser-computed color values (rgb/rgba) to hex format.
|
|
3
|
+
* Browsers convert hex colors to rgb() in element.style, causing
|
|
4
|
+
* isActive mismatches when comparing stored values after HTML re-parsing.
|
|
5
|
+
*/
|
|
6
|
+
export declare function normalizeColor(color: string): string;
|
|
7
|
+
//# sourceMappingURL=normalizeColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeColor.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizeColor.test.d.ts","sourceRoot":"","sources":["../../src/helpers/normalizeColor.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for building ProseMirror node/mark specs.
|
|
3
|
+
*
|
|
4
|
+
* Used by both Node.createNodeSpec() and Mark.createMarkSpec() to
|
|
5
|
+
* eliminate duplicated attribute conversion and HTML attribute building.
|
|
6
|
+
*/
|
|
7
|
+
import type { AttributeSpecs } from '../types/AttributeSpec.js';
|
|
8
|
+
/**
|
|
9
|
+
* Converts extension AttributeSpecs to ProseMirror-compatible `attrs` object.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* spec.attrs = buildProseMirrorAttrs(attributeSpecs);
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildProseMirrorAttrs(attributeSpecs: AttributeSpecs): Record<string, {
|
|
15
|
+
default?: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Builds an HTML attributes object from a node/mark's attrs using the
|
|
19
|
+
* attribute specs' renderHTML functions.
|
|
20
|
+
*
|
|
21
|
+
* Used inside toDOM wrappers for both nodes and marks.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* const htmlAttrs = buildHTMLAttributes(node.attrs, attrSpecs);
|
|
25
|
+
* return renderFn.call(instance, { node, HTMLAttributes: htmlAttrs });
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildHTMLAttributes(attrs: Record<string, unknown>, attrSpecs: AttributeSpecs): Record<string, unknown>;
|
|
28
|
+
//# sourceMappingURL=specBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specBuilder.d.ts","sourceRoot":"","sources":["../../src/helpers/specBuilder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,cAAc,GAC7B,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAevC;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,SAAS,EAAE,cAAc,GACxB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specBuilder.test.d.ts","sourceRoot":"","sources":["../../src/helpers/specBuilder.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { AnyExtension, JSONContent } from '../types/index.js';
|
|
2
|
+
export interface GenerateHTMLOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Custom document implementation. If not provided, uses native document
|
|
5
|
+
* in browser or linkedom in Node.js.
|
|
6
|
+
*/
|
|
7
|
+
document?: Document;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Generate HTML string from JSON content.
|
|
11
|
+
*
|
|
12
|
+
* @param content - The JSON content to convert
|
|
13
|
+
* @param extensions - Extensions that define the schema
|
|
14
|
+
* @param options - Optional configuration
|
|
15
|
+
* @returns HTML string
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const html = generateHTML(
|
|
20
|
+
* { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }] },
|
|
21
|
+
* [Document, Paragraph, Text]
|
|
22
|
+
* );
|
|
23
|
+
* // Returns: '<p>Hello</p>'
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateHTML(content: JSONContent, extensions: AnyExtension[], options?: GenerateHTMLOptions): string;
|
|
27
|
+
export interface GenerateJSONOptions {
|
|
28
|
+
/**
|
|
29
|
+
* Custom document implementation. If not provided, uses native document
|
|
30
|
+
* in browser or linkedom in Node.js.
|
|
31
|
+
*/
|
|
32
|
+
document?: Document;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generate JSON content from HTML string.
|
|
36
|
+
*
|
|
37
|
+
* @param html - The HTML string to convert
|
|
38
|
+
* @param extensions - Extensions that define the schema
|
|
39
|
+
* @param options - Optional configuration
|
|
40
|
+
* @returns JSON content object
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const json = generateJSON(
|
|
45
|
+
* '<p>Hello</p>',
|
|
46
|
+
* [Document, Paragraph, Text]
|
|
47
|
+
* );
|
|
48
|
+
* // Returns: { type: 'doc', content: [{ type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] }] }
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare function generateJSON(html: string, extensions: AnyExtension[], options?: GenerateJSONOptions): JSONContent;
|
|
52
|
+
export interface GenerateTextOptions {
|
|
53
|
+
/**
|
|
54
|
+
* Separator between block elements.
|
|
55
|
+
* @default '\n\n'
|
|
56
|
+
*/
|
|
57
|
+
blockSeparator?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Generate plain text from JSON content.
|
|
61
|
+
*
|
|
62
|
+
* @param content - The JSON content to extract text from
|
|
63
|
+
* @param extensions - Extensions that define the schema
|
|
64
|
+
* @param options - Optional configuration
|
|
65
|
+
* @returns Plain text string
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const text = generateText(
|
|
70
|
+
* { type: 'doc', content: [
|
|
71
|
+
* { type: 'paragraph', content: [{ type: 'text', text: 'Hello' }] },
|
|
72
|
+
* { type: 'paragraph', content: [{ type: 'text', text: 'World' }] }
|
|
73
|
+
* ]},
|
|
74
|
+
* [Document, Paragraph, Text]
|
|
75
|
+
* );
|
|
76
|
+
* // Returns: 'Hello\n\nWorld'
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare function generateText(content: JSONContent, extensions: AnyExtension[], options?: GenerateTextOptions): string;
|
|
80
|
+
//# sourceMappingURL=ssr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/helpers/ssr.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiDnE,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAcR;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,mBAAwB,GAChC,WAAW,CAab;AAED,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,YAAY,EAAE,EAC1B,OAAO,GAAE,mBAAwB,GAChC,MAAM,CAMR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssr.test.d.ts","sourceRoot":"","sources":["../../src/helpers/ssr.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text Input Rule Helper
|
|
3
|
+
*
|
|
4
|
+
* Creates input rules for simple text replacements (e.g. `--` to em dash).
|
|
5
|
+
*/
|
|
6
|
+
import { InputRule } from '@domternal/pm/inputrules';
|
|
7
|
+
export interface TextInputRuleOptions {
|
|
8
|
+
/**
|
|
9
|
+
* The regex pattern to match.
|
|
10
|
+
*/
|
|
11
|
+
find: RegExp;
|
|
12
|
+
/**
|
|
13
|
+
* The replacement text.
|
|
14
|
+
*/
|
|
15
|
+
replace: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether Backspace can undo this input rule immediately after it fires.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
undoable?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Creates an input rule that replaces matched text with a string.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* // `--` converts to em dash
|
|
27
|
+
* textInputRule({ find: /--$/, replace: '\u2014' });
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* // Non-undoable replacement
|
|
31
|
+
* textInputRule({ find: /->$/, replace: '\u2192', undoable: false });
|
|
32
|
+
*/
|
|
33
|
+
export declare function textInputRule(options: TextInputRuleOptions): InputRule;
|
|
34
|
+
//# sourceMappingURL=textInputRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textInputRule.d.ts","sourceRoot":"","sources":["../../src/helpers/textInputRule.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,SAAS,CAQtE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Textblock Type Input Rule Helper
|
|
3
|
+
*
|
|
4
|
+
* Drop-in replacement for ProseMirror's textblockTypeInputRule that exposes
|
|
5
|
+
* the `undoable` option so extension authors can opt out of Backspace undo.
|
|
6
|
+
*/
|
|
7
|
+
import { InputRule } from '@domternal/pm/inputrules';
|
|
8
|
+
import type { NodeType, Attrs } from '@domternal/pm/model';
|
|
9
|
+
export interface TextblockTypeInputRuleOptions {
|
|
10
|
+
/**
|
|
11
|
+
* The regex pattern to match. Should start with `^` so it only
|
|
12
|
+
* fires at the start of a textblock.
|
|
13
|
+
*/
|
|
14
|
+
find: RegExp;
|
|
15
|
+
/**
|
|
16
|
+
* The node type to change the textblock to.
|
|
17
|
+
*/
|
|
18
|
+
type: NodeType;
|
|
19
|
+
/**
|
|
20
|
+
* Whether Backspace can undo this input rule immediately after it fires.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
undoable?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Node attributes, or a function that computes them from the match.
|
|
26
|
+
*/
|
|
27
|
+
getAttributes?: Attrs | null | ((match: RegExpMatchArray) => Attrs | null);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Creates an input rule that changes the type of a textblock.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // `## ` at start of line converts to heading level 2
|
|
34
|
+
* textblockTypeInputRule({
|
|
35
|
+
* find: /^(#{1,4})\s$/,
|
|
36
|
+
* type: schema.nodes.heading,
|
|
37
|
+
* getAttributes: (match) => ({ level: match[1].length }),
|
|
38
|
+
* });
|
|
39
|
+
*/
|
|
40
|
+
export declare function textblockTypeInputRule(options: TextblockTypeInputRuleOptions): InputRule;
|
|
41
|
+
//# sourceMappingURL=textblockTypeInputRule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textblockTypeInputRule.d.ts","sourceRoot":"","sources":["../../src/helpers/textblockTypeInputRule.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,WAAW,6BAA6B;IAC5C;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,gBAAgB,KAAK,KAAK,GAAG,IAAI,CAAC,CAAC;CAC5E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,SAAS,CAexF"}
|