@domternal/core 0.4.1 → 0.5.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/README.md +1 -1
- package/dist/index.cjs +19 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +5844 -23
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/CanChecker.d.ts +0 -79
- package/dist/CanChecker.d.ts.map +0 -1
- package/dist/CanChecker.test.d.ts +0 -2
- package/dist/CanChecker.test.d.ts.map +0 -1
- package/dist/ChainBuilder.d.ts +0 -119
- package/dist/ChainBuilder.d.ts.map +0 -1
- package/dist/ChainBuilder.test.d.ts +0 -2
- package/dist/ChainBuilder.test.d.ts.map +0 -1
- package/dist/CommandManager.d.ts +0 -86
- package/dist/CommandManager.d.ts.map +0 -1
- package/dist/CommandManager.test.d.ts +0 -2
- package/dist/CommandManager.test.d.ts.map +0 -1
- package/dist/Editor.d.ts +0 -262
- package/dist/Editor.d.ts.map +0 -1
- package/dist/Editor.test.d.ts +0 -2
- package/dist/Editor.test.d.ts.map +0 -1
- package/dist/EventEmitter.d.ts +0 -57
- package/dist/EventEmitter.d.ts.map +0 -1
- package/dist/EventEmitter.test.d.ts +0 -2
- package/dist/EventEmitter.test.d.ts.map +0 -1
- package/dist/Extension.d.ts +0 -171
- package/dist/Extension.d.ts.map +0 -1
- package/dist/Extension.test.d.ts +0 -2
- package/dist/Extension.test.d.ts.map +0 -1
- package/dist/ExtensionManager.d.ts +0 -283
- package/dist/ExtensionManager.d.ts.map +0 -1
- package/dist/ExtensionManager.test.d.ts +0 -2
- package/dist/ExtensionManager.test.d.ts.map +0 -1
- package/dist/Mark.d.ts +0 -164
- package/dist/Mark.d.ts.map +0 -1
- package/dist/Mark.test.d.ts +0 -5
- package/dist/Mark.test.d.ts.map +0 -1
- package/dist/Node.d.ts +0 -153
- package/dist/Node.d.ts.map +0 -1
- package/dist/Node.test.d.ts +0 -2
- package/dist/Node.test.d.ts.map +0 -1
- package/dist/ToolbarController.d.ts +0 -169
- package/dist/ToolbarController.d.ts.map +0 -1
- package/dist/ToolbarController.test.d.ts +0 -2
- package/dist/ToolbarController.test.d.ts.map +0 -1
- package/dist/commandPropsBuilder.d.ts +0 -70
- package/dist/commandPropsBuilder.d.ts.map +0 -1
- package/dist/commandPropsBuilder.test.d.ts +0 -2
- package/dist/commandPropsBuilder.test.d.ts.map +0 -1
- package/dist/commands/attributeCommands.d.ts +0 -24
- package/dist/commands/attributeCommands.d.ts.map +0 -1
- package/dist/commands/attributeCommands.test.d.ts +0 -2
- package/dist/commands/attributeCommands.test.d.ts.map +0 -1
- package/dist/commands/builtIn.test.d.ts +0 -2
- package/dist/commands/builtIn.test.d.ts.map +0 -1
- package/dist/commands/contentCommands.d.ts +0 -52
- package/dist/commands/contentCommands.d.ts.map +0 -1
- package/dist/commands/contentCommands.test.d.ts +0 -2
- package/dist/commands/contentCommands.test.d.ts.map +0 -1
- package/dist/commands/index.d.ts +0 -43
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/listCommands.d.ts +0 -15
- package/dist/commands/listCommands.d.ts.map +0 -1
- package/dist/commands/listCommands.test.d.ts +0 -2
- package/dist/commands/listCommands.test.d.ts.map +0 -1
- package/dist/commands/markCommands.d.ts +0 -40
- package/dist/commands/markCommands.d.ts.map +0 -1
- package/dist/commands/markCommands.test.d.ts +0 -2
- package/dist/commands/markCommands.test.d.ts.map +0 -1
- package/dist/commands/nodeCommands.d.ts +0 -53
- package/dist/commands/nodeCommands.d.ts.map +0 -1
- package/dist/commands/nodeCommands.test.d.ts +0 -2
- package/dist/commands/nodeCommands.test.d.ts.map +0 -1
- package/dist/commands/selectionCommands.d.ts +0 -37
- package/dist/commands/selectionCommands.d.ts.map +0 -1
- package/dist/commands/selectionCommands.test.d.ts +0 -2
- package/dist/commands/selectionCommands.test.d.ts.map +0 -1
- package/dist/extensions/BaseKeymap.d.ts +0 -36
- package/dist/extensions/BaseKeymap.d.ts.map +0 -1
- package/dist/extensions/BaseKeymap.test.d.ts +0 -2
- package/dist/extensions/BaseKeymap.test.d.ts.map +0 -1
- package/dist/extensions/BubbleMenu.d.ts +0 -85
- package/dist/extensions/BubbleMenu.d.ts.map +0 -1
- package/dist/extensions/BubbleMenu.test.d.ts +0 -2
- package/dist/extensions/BubbleMenu.test.d.ts.map +0 -1
- package/dist/extensions/CharacterCount.d.ts +0 -60
- package/dist/extensions/CharacterCount.d.ts.map +0 -1
- package/dist/extensions/CharacterCount.test.d.ts +0 -2
- package/dist/extensions/CharacterCount.test.d.ts.map +0 -1
- package/dist/extensions/ClearFormatting.d.ts +0 -25
- package/dist/extensions/ClearFormatting.d.ts.map +0 -1
- package/dist/extensions/ClearFormatting.test.d.ts +0 -2
- package/dist/extensions/ClearFormatting.test.d.ts.map +0 -1
- package/dist/extensions/Dropcursor.d.ts +0 -20
- package/dist/extensions/Dropcursor.d.ts.map +0 -1
- package/dist/extensions/Dropcursor.test.d.ts +0 -2
- package/dist/extensions/Dropcursor.test.d.ts.map +0 -1
- package/dist/extensions/FloatingMenu.d.ts +0 -74
- package/dist/extensions/FloatingMenu.d.ts.map +0 -1
- package/dist/extensions/FloatingMenu.test.d.ts +0 -2
- package/dist/extensions/FloatingMenu.test.d.ts.map +0 -1
- package/dist/extensions/Focus.d.ts +0 -26
- package/dist/extensions/Focus.d.ts.map +0 -1
- package/dist/extensions/Focus.test.d.ts +0 -2
- package/dist/extensions/Focus.test.d.ts.map +0 -1
- package/dist/extensions/FontFamily.d.ts +0 -41
- package/dist/extensions/FontFamily.d.ts.map +0 -1
- package/dist/extensions/FontFamily.test.d.ts +0 -2
- package/dist/extensions/FontFamily.test.d.ts.map +0 -1
- package/dist/extensions/FontSize.d.ts +0 -46
- package/dist/extensions/FontSize.d.ts.map +0 -1
- package/dist/extensions/FontSize.test.d.ts +0 -2
- package/dist/extensions/FontSize.test.d.ts.map +0 -1
- package/dist/extensions/Gapcursor.d.ts +0 -3
- package/dist/extensions/Gapcursor.d.ts.map +0 -1
- package/dist/extensions/Gapcursor.test.d.ts +0 -2
- package/dist/extensions/Gapcursor.test.d.ts.map +0 -1
- package/dist/extensions/Highlight.d.ts +0 -61
- package/dist/extensions/Highlight.d.ts.map +0 -1
- package/dist/extensions/Highlight.test.d.ts +0 -2
- package/dist/extensions/Highlight.test.d.ts.map +0 -1
- package/dist/extensions/History.d.ts +0 -22
- package/dist/extensions/History.d.ts.map +0 -1
- package/dist/extensions/History.test.d.ts +0 -2
- package/dist/extensions/History.test.d.ts.map +0 -1
- package/dist/extensions/InvisibleChars.d.ts +0 -86
- package/dist/extensions/InvisibleChars.d.ts.map +0 -1
- package/dist/extensions/InvisibleChars.test.d.ts +0 -2
- package/dist/extensions/InvisibleChars.test.d.ts.map +0 -1
- package/dist/extensions/LineHeight.d.ts +0 -50
- package/dist/extensions/LineHeight.d.ts.map +0 -1
- package/dist/extensions/LineHeight.test.d.ts +0 -2
- package/dist/extensions/LineHeight.test.d.ts.map +0 -1
- package/dist/extensions/LinkPopover.d.ts +0 -10
- package/dist/extensions/LinkPopover.d.ts.map +0 -1
- package/dist/extensions/ListKeymap.d.ts +0 -10
- package/dist/extensions/ListKeymap.d.ts.map +0 -1
- package/dist/extensions/ListKeymap.test.d.ts +0 -2
- package/dist/extensions/ListKeymap.test.d.ts.map +0 -1
- package/dist/extensions/Placeholder.d.ts +0 -47
- package/dist/extensions/Placeholder.d.ts.map +0 -1
- package/dist/extensions/Placeholder.test.d.ts +0 -2
- package/dist/extensions/Placeholder.test.d.ts.map +0 -1
- package/dist/extensions/Selection.d.ts +0 -71
- package/dist/extensions/Selection.d.ts.map +0 -1
- package/dist/extensions/Selection.test.d.ts +0 -2
- package/dist/extensions/Selection.test.d.ts.map +0 -1
- package/dist/extensions/SelectionDecoration.d.ts +0 -18
- package/dist/extensions/SelectionDecoration.d.ts.map +0 -1
- package/dist/extensions/SelectionDecoration.test.d.ts +0 -2
- package/dist/extensions/SelectionDecoration.test.d.ts.map +0 -1
- package/dist/extensions/StarterKit.d.ts +0 -138
- package/dist/extensions/StarterKit.d.ts.map +0 -1
- package/dist/extensions/StarterKit.test.d.ts +0 -2
- package/dist/extensions/StarterKit.test.d.ts.map +0 -1
- package/dist/extensions/TextAlign.d.ts +0 -32
- package/dist/extensions/TextAlign.d.ts.map +0 -1
- package/dist/extensions/TextAlign.test.d.ts +0 -2
- package/dist/extensions/TextAlign.test.d.ts.map +0 -1
- package/dist/extensions/TextColor.d.ts +0 -55
- package/dist/extensions/TextColor.d.ts.map +0 -1
- package/dist/extensions/TextColor.test.d.ts +0 -2
- package/dist/extensions/TextColor.test.d.ts.map +0 -1
- package/dist/extensions/TrailingNode.d.ts +0 -16
- package/dist/extensions/TrailingNode.d.ts.map +0 -1
- package/dist/extensions/TrailingNode.test.d.ts +0 -2
- package/dist/extensions/TrailingNode.test.d.ts.map +0 -1
- package/dist/extensions/Typography.d.ts +0 -65
- package/dist/extensions/Typography.d.ts.map +0 -1
- package/dist/extensions/Typography.test.d.ts +0 -2
- package/dist/extensions/Typography.test.d.ts.map +0 -1
- package/dist/extensions/UniqueID.d.ts +0 -48
- package/dist/extensions/UniqueID.d.ts.map +0 -1
- package/dist/extensions/UniqueID.test.d.ts +0 -2
- package/dist/extensions/UniqueID.test.d.ts.map +0 -1
- package/dist/extensions/index.d.ts +0 -29
- package/dist/extensions/index.d.ts.map +0 -1
- package/dist/extensions/isActive-markExclusion.test.d.ts +0 -2
- package/dist/extensions/isActive-markExclusion.test.d.ts.map +0 -1
- package/dist/helpers/callOrReturn.d.ts +0 -30
- package/dist/helpers/callOrReturn.d.ts.map +0 -1
- package/dist/helpers/callOrReturn.test.d.ts +0 -2
- package/dist/helpers/callOrReturn.test.d.ts.map +0 -1
- package/dist/helpers/createDocument.d.ts +0 -48
- package/dist/helpers/createDocument.d.ts.map +0 -1
- package/dist/helpers/createDocument.test.d.ts +0 -2
- package/dist/helpers/createDocument.test.d.ts.map +0 -1
- package/dist/helpers/defaultBlockAt.d.ts +0 -15
- package/dist/helpers/defaultBlockAt.d.ts.map +0 -1
- package/dist/helpers/defaultBlockAt.test.d.ts +0 -2
- package/dist/helpers/defaultBlockAt.test.d.ts.map +0 -1
- package/dist/helpers/findChildren.d.ts +0 -13
- package/dist/helpers/findChildren.d.ts.map +0 -1
- package/dist/helpers/findChildren.test.d.ts +0 -2
- package/dist/helpers/findChildren.test.d.ts.map +0 -1
- package/dist/helpers/findParentNode.d.ts +0 -21
- package/dist/helpers/findParentNode.d.ts.map +0 -1
- package/dist/helpers/findParentNode.test.d.ts +0 -2
- package/dist/helpers/findParentNode.test.d.ts.map +0 -1
- package/dist/helpers/getMarkRange.d.ts +0 -17
- package/dist/helpers/getMarkRange.d.ts.map +0 -1
- package/dist/helpers/getMarkRange.test.d.ts +0 -2
- package/dist/helpers/getMarkRange.test.d.ts.map +0 -1
- package/dist/helpers/index.d.ts +0 -18
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/inputRulesPlugin.d.ts +0 -26
- package/dist/helpers/inputRulesPlugin.d.ts.map +0 -1
- package/dist/helpers/isNodeEmpty.d.ts +0 -52
- package/dist/helpers/isNodeEmpty.d.ts.map +0 -1
- package/dist/helpers/isNodeEmpty.test.d.ts +0 -2
- package/dist/helpers/isNodeEmpty.test.d.ts.map +0 -1
- package/dist/helpers/isValidUrl.d.ts +0 -31
- package/dist/helpers/isValidUrl.d.ts.map +0 -1
- package/dist/helpers/isValidUrl.test.d.ts +0 -2
- package/dist/helpers/isValidUrl.test.d.ts.map +0 -1
- package/dist/helpers/markInputRule.d.ts +0 -88
- package/dist/helpers/markInputRule.d.ts.map +0 -1
- package/dist/helpers/markInputRule.test.d.ts +0 -2
- package/dist/helpers/markInputRule.test.d.ts.map +0 -1
- package/dist/helpers/nodeInputRule.d.ts +0 -41
- package/dist/helpers/nodeInputRule.d.ts.map +0 -1
- package/dist/helpers/normalizeColor.d.ts +0 -7
- package/dist/helpers/normalizeColor.d.ts.map +0 -1
- package/dist/helpers/normalizeColor.test.d.ts +0 -2
- package/dist/helpers/normalizeColor.test.d.ts.map +0 -1
- package/dist/helpers/specBuilder.d.ts +0 -28
- package/dist/helpers/specBuilder.d.ts.map +0 -1
- package/dist/helpers/specBuilder.test.d.ts +0 -2
- package/dist/helpers/specBuilder.test.d.ts.map +0 -1
- package/dist/helpers/ssr.d.ts +0 -80
- package/dist/helpers/ssr.d.ts.map +0 -1
- package/dist/helpers/ssr.test.d.ts +0 -2
- package/dist/helpers/ssr.test.d.ts.map +0 -1
- package/dist/helpers/textInputRule.d.ts +0 -34
- package/dist/helpers/textInputRule.d.ts.map +0 -1
- package/dist/helpers/textblockTypeInputRule.d.ts +0 -41
- package/dist/helpers/textblockTypeInputRule.d.ts.map +0 -1
- package/dist/helpers/wrappingInputRule.d.ts +0 -66
- package/dist/helpers/wrappingInputRule.d.ts.map +0 -1
- package/dist/icons/index.d.ts +0 -2
- package/dist/icons/index.d.ts.map +0 -1
- package/dist/icons/phosphor.d.ts +0 -3
- package/dist/icons/phosphor.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.test.d.ts +0 -2
- package/dist/index.test.d.ts.map +0 -1
- package/dist/marks/Bold.d.ts +0 -40
- package/dist/marks/Bold.d.ts.map +0 -1
- package/dist/marks/Bold.test.d.ts +0 -2
- package/dist/marks/Bold.test.d.ts.map +0 -1
- package/dist/marks/Code.d.ts +0 -40
- package/dist/marks/Code.d.ts.map +0 -1
- package/dist/marks/Code.test.d.ts +0 -2
- package/dist/marks/Code.test.d.ts.map +0 -1
- package/dist/marks/Italic.d.ts +0 -40
- package/dist/marks/Italic.d.ts.map +0 -1
- package/dist/marks/Italic.test.d.ts +0 -2
- package/dist/marks/Italic.test.d.ts.map +0 -1
- package/dist/marks/Link.d.ts +0 -75
- package/dist/marks/Link.d.ts.map +0 -1
- package/dist/marks/Link.test.d.ts +0 -2
- package/dist/marks/Link.test.d.ts.map +0 -1
- package/dist/marks/Strike.d.ts +0 -39
- package/dist/marks/Strike.d.ts.map +0 -1
- package/dist/marks/Strike.test.d.ts +0 -2
- package/dist/marks/Strike.test.d.ts.map +0 -1
- package/dist/marks/Subscript.d.ts +0 -38
- package/dist/marks/Subscript.d.ts.map +0 -1
- package/dist/marks/Subscript.test.d.ts +0 -2
- package/dist/marks/Subscript.test.d.ts.map +0 -1
- package/dist/marks/Superscript.d.ts +0 -38
- package/dist/marks/Superscript.d.ts.map +0 -1
- package/dist/marks/Superscript.test.d.ts +0 -2
- package/dist/marks/Superscript.test.d.ts.map +0 -1
- package/dist/marks/TextStyle.d.ts +0 -41
- package/dist/marks/TextStyle.d.ts.map +0 -1
- package/dist/marks/TextStyle.test.d.ts +0 -2
- package/dist/marks/TextStyle.test.d.ts.map +0 -1
- package/dist/marks/Underline.d.ts +0 -38
- package/dist/marks/Underline.d.ts.map +0 -1
- package/dist/marks/Underline.test.d.ts +0 -2
- package/dist/marks/Underline.test.d.ts.map +0 -1
- package/dist/marks/helpers/autolinkPlugin.d.ts +0 -48
- package/dist/marks/helpers/autolinkPlugin.d.ts.map +0 -1
- package/dist/marks/helpers/autolinkPlugin.test.d.ts +0 -2
- package/dist/marks/helpers/autolinkPlugin.test.d.ts.map +0 -1
- package/dist/marks/helpers/index.d.ts +0 -10
- package/dist/marks/helpers/index.d.ts.map +0 -1
- package/dist/marks/helpers/linkClickPlugin.d.ts +0 -43
- package/dist/marks/helpers/linkClickPlugin.d.ts.map +0 -1
- package/dist/marks/helpers/linkClickPlugin.test.d.ts +0 -2
- package/dist/marks/helpers/linkClickPlugin.test.d.ts.map +0 -1
- package/dist/marks/helpers/linkExitPlugin.d.ts +0 -37
- package/dist/marks/helpers/linkExitPlugin.d.ts.map +0 -1
- package/dist/marks/helpers/linkExitPlugin.test.d.ts +0 -2
- package/dist/marks/helpers/linkExitPlugin.test.d.ts.map +0 -1
- package/dist/marks/helpers/linkPastePlugin.d.ts +0 -44
- package/dist/marks/helpers/linkPastePlugin.d.ts.map +0 -1
- package/dist/marks/helpers/linkPastePlugin.test.d.ts +0 -2
- package/dist/marks/helpers/linkPastePlugin.test.d.ts.map +0 -1
- package/dist/marks/index.d.ts +0 -16
- package/dist/marks/index.d.ts.map +0 -1
- package/dist/nodes/Blockquote.d.ts +0 -19
- package/dist/nodes/Blockquote.d.ts.map +0 -1
- package/dist/nodes/Blockquote.test.d.ts +0 -2
- package/dist/nodes/Blockquote.test.d.ts.map +0 -1
- package/dist/nodes/BulletList.d.ts +0 -18
- package/dist/nodes/BulletList.d.ts.map +0 -1
- package/dist/nodes/BulletList.test.d.ts +0 -2
- package/dist/nodes/BulletList.test.d.ts.map +0 -1
- package/dist/nodes/CodeBlock.d.ts +0 -29
- package/dist/nodes/CodeBlock.d.ts.map +0 -1
- package/dist/nodes/CodeBlock.test.d.ts +0 -2
- package/dist/nodes/CodeBlock.test.d.ts.map +0 -1
- package/dist/nodes/Document.d.ts +0 -9
- package/dist/nodes/Document.d.ts.map +0 -1
- package/dist/nodes/Document.test.d.ts +0 -2
- package/dist/nodes/Document.test.d.ts.map +0 -1
- package/dist/nodes/HardBreak.d.ts +0 -18
- package/dist/nodes/HardBreak.d.ts.map +0 -1
- package/dist/nodes/HardBreak.test.d.ts +0 -2
- package/dist/nodes/HardBreak.test.d.ts.map +0 -1
- package/dist/nodes/Heading.d.ts +0 -23
- package/dist/nodes/Heading.d.ts.map +0 -1
- package/dist/nodes/Heading.test.d.ts +0 -2
- package/dist/nodes/Heading.test.d.ts.map +0 -1
- package/dist/nodes/HorizontalRule.d.ts +0 -17
- package/dist/nodes/HorizontalRule.d.ts.map +0 -1
- package/dist/nodes/HorizontalRule.test.d.ts +0 -2
- package/dist/nodes/HorizontalRule.test.d.ts.map +0 -1
- package/dist/nodes/ListItem.d.ts +0 -16
- package/dist/nodes/ListItem.d.ts.map +0 -1
- package/dist/nodes/ListItem.test.d.ts +0 -2
- package/dist/nodes/ListItem.test.d.ts.map +0 -1
- package/dist/nodes/OrderedList.d.ts +0 -18
- package/dist/nodes/OrderedList.d.ts.map +0 -1
- package/dist/nodes/OrderedList.test.d.ts +0 -2
- package/dist/nodes/OrderedList.test.d.ts.map +0 -1
- package/dist/nodes/Paragraph.d.ts +0 -17
- package/dist/nodes/Paragraph.d.ts.map +0 -1
- package/dist/nodes/Paragraph.test.d.ts +0 -2
- package/dist/nodes/Paragraph.test.d.ts.map +0 -1
- package/dist/nodes/TaskItem.d.ts +0 -24
- package/dist/nodes/TaskItem.d.ts.map +0 -1
- package/dist/nodes/TaskItem.test.d.ts +0 -2
- package/dist/nodes/TaskItem.test.d.ts.map +0 -1
- package/dist/nodes/TaskList.d.ts +0 -18
- package/dist/nodes/TaskList.d.ts.map +0 -1
- package/dist/nodes/TaskList.test.d.ts +0 -2
- package/dist/nodes/TaskList.test.d.ts.map +0 -1
- package/dist/nodes/Text.d.ts +0 -9
- package/dist/nodes/Text.d.ts.map +0 -1
- package/dist/nodes/Text.test.d.ts +0 -2
- package/dist/nodes/Text.test.d.ts.map +0 -1
- package/dist/nodes/index.d.ts +0 -19
- package/dist/nodes/index.d.ts.map +0 -1
- package/dist/nodes/integration.test.d.ts +0 -7
- package/dist/nodes/integration.test.d.ts.map +0 -1
- package/dist/types/AttributeSpec.d.ts +0 -78
- package/dist/types/AttributeSpec.d.ts.map +0 -1
- package/dist/types/Commands.d.ts +0 -125
- package/dist/types/Commands.d.ts.map +0 -1
- package/dist/types/Content.d.ts +0 -40
- package/dist/types/Content.d.ts.map +0 -1
- package/dist/types/EditorEvents.d.ts +0 -131
- package/dist/types/EditorEvents.d.ts.map +0 -1
- package/dist/types/EditorOptions.d.ts +0 -133
- package/dist/types/EditorOptions.d.ts.map +0 -1
- package/dist/types/ExtensionConfig.d.ts +0 -271
- package/dist/types/ExtensionConfig.d.ts.map +0 -1
- package/dist/types/MarkConfig.d.ts +0 -206
- package/dist/types/MarkConfig.d.ts.map +0 -1
- package/dist/types/NodeConfig.d.ts +0 -263
- package/dist/types/NodeConfig.d.ts.map +0 -1
- package/dist/types/Toolbar.d.ts +0 -172
- package/dist/types/Toolbar.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.d.ts.map +0 -1
- package/dist/utils/inlineStyles.d.ts +0 -83
- package/dist/utils/inlineStyles.d.ts.map +0 -1
- package/dist/utils/inlineStyles.test.d.ts +0 -2
- package/dist/utils/inlineStyles.test.d.ts.map +0 -1
- package/dist/utils/positionFloating.d.ts +0 -74
- package/dist/utils/positionFloating.d.ts.map +0 -1
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extension configuration types
|
|
3
|
-
*
|
|
4
|
-
* These types define the configuration object passed to Extension.create(),
|
|
5
|
-
* Node.create(), and Mark.create() factory methods.
|
|
6
|
-
*/
|
|
7
|
-
import type { Plugin, Transaction, EditorState } from '@domternal/pm/state';
|
|
8
|
-
import type { InputRule } from '@domternal/pm/inputrules';
|
|
9
|
-
import type { EditorView } from '@domternal/pm/view';
|
|
10
|
-
import type { Command, KeyboardShortcutCommand, SingleCommands } from './Commands.js';
|
|
11
|
-
import type { ToolbarItem } from './Toolbar.js';
|
|
12
|
-
/**
|
|
13
|
-
* Editor instance type (forward declaration)
|
|
14
|
-
*/
|
|
15
|
-
export interface ExtensionEditor {
|
|
16
|
-
readonly state: EditorState;
|
|
17
|
-
readonly view: EditorView;
|
|
18
|
-
readonly schema: unknown;
|
|
19
|
-
readonly commands: SingleCommands;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Any extension type (forward declaration)
|
|
23
|
-
*/
|
|
24
|
-
export interface AnyExtensionConfig {
|
|
25
|
-
name: string;
|
|
26
|
-
type?: 'extension' | 'node' | 'mark';
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Global attribute specification for injecting attributes into multiple node/mark types.
|
|
30
|
-
* Used by extensions like TextAlign to add alignment to heading, paragraph, etc.
|
|
31
|
-
*/
|
|
32
|
-
export interface GlobalAttributeSpec {
|
|
33
|
-
/**
|
|
34
|
-
* Default value for the attribute.
|
|
35
|
-
*/
|
|
36
|
-
default?: unknown;
|
|
37
|
-
/**
|
|
38
|
-
* Parse attribute value from HTML element.
|
|
39
|
-
* @param element - The DOM element to parse from
|
|
40
|
-
* @returns The parsed attribute value
|
|
41
|
-
*/
|
|
42
|
-
parseHTML?: (element: HTMLElement) => unknown;
|
|
43
|
-
/**
|
|
44
|
-
* Render attribute value to HTML attributes.
|
|
45
|
-
* @param attributes - The node/mark attributes
|
|
46
|
-
* @returns Object of HTML attributes to set, or null/empty to skip
|
|
47
|
-
*/
|
|
48
|
-
renderHTML?: (attributes: Record<string, unknown>) => Record<string, string> | null;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Global attributes definition for injecting into node/mark types.
|
|
52
|
-
*/
|
|
53
|
-
export interface GlobalAttributes {
|
|
54
|
-
/**
|
|
55
|
-
* Node or mark type names to add these attributes to.
|
|
56
|
-
* @example ['heading', 'paragraph']
|
|
57
|
-
*/
|
|
58
|
-
types: string[];
|
|
59
|
-
/**
|
|
60
|
-
* Attribute specifications to add.
|
|
61
|
-
* @example { textAlign: { default: 'left', parseHTML: (el) => el.style.textAlign } }
|
|
62
|
-
*/
|
|
63
|
-
attributes: Record<string, GlobalAttributeSpec>;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Context interface that describes what `this` will be in config methods.
|
|
67
|
-
* This enables proper typing of `this.options`, `this.editor`, etc.
|
|
68
|
-
* without creating circular dependencies.
|
|
69
|
-
*
|
|
70
|
-
* @typeParam Options - Extension options type
|
|
71
|
-
* @typeParam Storage - Extension storage type
|
|
72
|
-
*/
|
|
73
|
-
export interface ExtensionContext<Options = unknown, Storage = unknown> {
|
|
74
|
-
/** Extension type identifier */
|
|
75
|
-
readonly type: 'extension' | 'node' | 'mark';
|
|
76
|
-
/** Unique extension name */
|
|
77
|
-
readonly name: string;
|
|
78
|
-
/** Extension options (immutable after creation) */
|
|
79
|
-
readonly options: Options;
|
|
80
|
-
/** Extension storage (mutable state) */
|
|
81
|
-
storage: Storage;
|
|
82
|
-
/** Editor instance (null until bound by ExtensionManager) */
|
|
83
|
-
editor: ExtensionEditor | null;
|
|
84
|
-
/**
|
|
85
|
-
* Reference to the parent config method when using extend().
|
|
86
|
-
* Available only inside overridden config methods.
|
|
87
|
-
* Use `this.parent?.()` to call the parent's version of the current method.
|
|
88
|
-
*/
|
|
89
|
-
parent?: ((...args: unknown[]) => unknown) | undefined;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Base configuration properties for all extension types.
|
|
93
|
-
* This interface contains just the properties without ThisType,
|
|
94
|
-
* allowing Node and Mark configs to use their own context types.
|
|
95
|
-
*
|
|
96
|
-
* @typeParam Options - Extension options type
|
|
97
|
-
* @typeParam Storage - Extension storage type
|
|
98
|
-
*/
|
|
99
|
-
export interface ExtensionConfigBase<Options = unknown, Storage = unknown> {
|
|
100
|
-
/**
|
|
101
|
-
* Unique extension name
|
|
102
|
-
* Used for identification, storage access, and error messages
|
|
103
|
-
*/
|
|
104
|
-
name: string;
|
|
105
|
-
/**
|
|
106
|
-
* Extension priority (higher = loaded first)
|
|
107
|
-
*
|
|
108
|
-
* Reserved ranges:
|
|
109
|
-
* - 900-1000: Core nodes (Document, Text, Paragraph)
|
|
110
|
-
* - 500-899: Standard extensions (Heading, Bold, etc.)
|
|
111
|
-
* - 100-499: Default range for user extensions
|
|
112
|
-
* - 0-99: Low priority extensions (run after everything)
|
|
113
|
-
*
|
|
114
|
-
* @default 100
|
|
115
|
-
*/
|
|
116
|
-
priority?: number;
|
|
117
|
-
/**
|
|
118
|
-
* Required extensions that must be present
|
|
119
|
-
* ExtensionManager throws if any dependency is missing
|
|
120
|
-
*
|
|
121
|
-
* @example
|
|
122
|
-
* dependencies: ['bulletList', 'orderedList']
|
|
123
|
-
*/
|
|
124
|
-
dependencies?: string[];
|
|
125
|
-
/**
|
|
126
|
-
* Default options for this extension
|
|
127
|
-
* Called during extension creation with `this` bound to the extension
|
|
128
|
-
*/
|
|
129
|
-
addOptions?: () => Options;
|
|
130
|
-
/**
|
|
131
|
-
* Initial storage state for this extension
|
|
132
|
-
* Storage is mutable and accessible via editor.storage[extensionName]
|
|
133
|
-
*/
|
|
134
|
-
addStorage?: () => Storage;
|
|
135
|
-
/**
|
|
136
|
-
* Commands this extension provides
|
|
137
|
-
* Commands are accessible via editor.commands.commandName()
|
|
138
|
-
*
|
|
139
|
-
* @example
|
|
140
|
-
* addCommands() {
|
|
141
|
-
* return {
|
|
142
|
-
* toggleBold: () => ({ commands }) => commands.toggleMark('bold'),
|
|
143
|
-
* };
|
|
144
|
-
* }
|
|
145
|
-
*/
|
|
146
|
-
addCommands?: () => Record<string, (...args: never[]) => Command>;
|
|
147
|
-
/**
|
|
148
|
-
* Keyboard shortcuts for this extension
|
|
149
|
-
* Keys are shortcut strings (e.g., 'Mod-b'), values are handler functions
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* addKeyboardShortcuts() {
|
|
153
|
-
* return {
|
|
154
|
-
* 'Mod-b': () => this.editor.commands.toggleBold(),
|
|
155
|
-
* };
|
|
156
|
-
* }
|
|
157
|
-
*/
|
|
158
|
-
addKeyboardShortcuts?: () => Record<string, KeyboardShortcutCommand>;
|
|
159
|
-
/**
|
|
160
|
-
* Input rules (markdown-style shortcuts)
|
|
161
|
-
* Triggered when user types matching patterns
|
|
162
|
-
*
|
|
163
|
-
* @example
|
|
164
|
-
* addInputRules() {
|
|
165
|
-
* return [
|
|
166
|
-
* textblockTypeInputRule(/^## $/, this.type),
|
|
167
|
-
* ];
|
|
168
|
-
* }
|
|
169
|
-
*/
|
|
170
|
-
addInputRules?: () => InputRule[];
|
|
171
|
-
/**
|
|
172
|
-
* ProseMirror plugins for this extension
|
|
173
|
-
*/
|
|
174
|
-
addProseMirrorPlugins?: () => Plugin[];
|
|
175
|
-
/**
|
|
176
|
-
* Nested extensions (for extension bundles like StarterKit)
|
|
177
|
-
* These extensions are flattened and processed like top-level extensions
|
|
178
|
-
*/
|
|
179
|
-
addExtensions?: () => AnyExtensionConfig[];
|
|
180
|
-
/**
|
|
181
|
-
* Global attributes to add to multiple node/mark types.
|
|
182
|
-
* Useful for extensions like TextAlign that need to add attributes
|
|
183
|
-
* to several nodes (heading, paragraph, etc.) without modifying each.
|
|
184
|
-
*
|
|
185
|
-
* @example
|
|
186
|
-
* addGlobalAttributes() {
|
|
187
|
-
* return [{
|
|
188
|
-
* types: ['heading', 'paragraph'],
|
|
189
|
-
* attributes: {
|
|
190
|
-
* textAlign: {
|
|
191
|
-
* default: 'left',
|
|
192
|
-
* parseHTML: (element) => element.style.textAlign || 'left',
|
|
193
|
-
* renderHTML: (attrs) => attrs.textAlign !== 'left'
|
|
194
|
-
* ? { style: `text-align: ${attrs.textAlign}` }
|
|
195
|
-
* : null,
|
|
196
|
-
* },
|
|
197
|
-
* },
|
|
198
|
-
* }];
|
|
199
|
-
* }
|
|
200
|
-
*/
|
|
201
|
-
addGlobalAttributes?: () => GlobalAttributes[];
|
|
202
|
-
/**
|
|
203
|
-
* Toolbar items this extension contributes.
|
|
204
|
-
* Framework toolbar components read these to auto-generate buttons.
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* addToolbarItems() {
|
|
208
|
-
* return [{
|
|
209
|
-
* type: 'button',
|
|
210
|
-
* name: 'bold',
|
|
211
|
-
* command: 'toggleBold',
|
|
212
|
-
* isActive: 'bold',
|
|
213
|
-
* icon: 'textB',
|
|
214
|
-
* label: 'Bold',
|
|
215
|
-
* shortcut: 'Mod-b',
|
|
216
|
-
* group: 'format',
|
|
217
|
-
* }];
|
|
218
|
-
* }
|
|
219
|
-
*/
|
|
220
|
-
addToolbarItems?: () => ToolbarItem[];
|
|
221
|
-
/**
|
|
222
|
-
* Called before editor is created
|
|
223
|
-
* Can be used to modify editor options
|
|
224
|
-
*/
|
|
225
|
-
onBeforeCreate?: () => void;
|
|
226
|
-
/**
|
|
227
|
-
* Called when editor is fully initialized and ready
|
|
228
|
-
*/
|
|
229
|
-
onCreate?: () => void;
|
|
230
|
-
/**
|
|
231
|
-
* Called when document content changes
|
|
232
|
-
*/
|
|
233
|
-
onUpdate?: () => void;
|
|
234
|
-
/**
|
|
235
|
-
* Called when selection changes (without content change)
|
|
236
|
-
*/
|
|
237
|
-
onSelectionUpdate?: () => void;
|
|
238
|
-
/**
|
|
239
|
-
* Called on every transaction
|
|
240
|
-
* Can be used to intercept or modify transactions
|
|
241
|
-
*/
|
|
242
|
-
onTransaction?: (props: {
|
|
243
|
-
transaction: Transaction;
|
|
244
|
-
}) => void;
|
|
245
|
-
/**
|
|
246
|
-
* Called when editor receives focus
|
|
247
|
-
*/
|
|
248
|
-
onFocus?: (props: {
|
|
249
|
-
event: FocusEvent;
|
|
250
|
-
}) => void;
|
|
251
|
-
/**
|
|
252
|
-
* Called when editor loses focus
|
|
253
|
-
*/
|
|
254
|
-
onBlur?: (props: {
|
|
255
|
-
event: FocusEvent;
|
|
256
|
-
}) => void;
|
|
257
|
-
/**
|
|
258
|
-
* Called when editor is being destroyed
|
|
259
|
-
* Use for cleanup (remove event listeners, etc.)
|
|
260
|
-
*/
|
|
261
|
-
onDestroy?: () => void;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Full configuration type for Extension.create()
|
|
265
|
-
* Combines base properties with ThisType for proper `this` typing.
|
|
266
|
-
*
|
|
267
|
-
* @typeParam Options - Extension options type
|
|
268
|
-
* @typeParam Storage - Extension storage type
|
|
269
|
-
*/
|
|
270
|
-
export type ExtensionConfig<Options = unknown, Storage = unknown> = ExtensionConfigBase<Options, Storage> & ThisType<ExtensionContext<Options, Storage>>;
|
|
271
|
-
//# sourceMappingURL=ExtensionConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionConfig.d.ts","sourceRoot":"","sources":["../../src/types/ExtensionConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,K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kBAAkB,EAAE,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,mBAAmB,CAAC,EAAE,MAAM,gBAAgB,EAAE,CAAC;IAE/C;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,CAAC,EAAE,MAAM,WAAW,EAAE,CAAC;IAItC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAE/B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,WAAW,CAAA;KAAE,KAAK,IAAI,CAAC;IAE9D;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAEjD;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;IAEhD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,IAC9D,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GACrC,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mark configuration types
|
|
3
|
-
*
|
|
4
|
-
* These types define the configuration object passed to Mark.create()
|
|
5
|
-
* for creating ProseMirror mark extensions.
|
|
6
|
-
*/
|
|
7
|
-
import type { Mark as PMMark, DOMOutputSpec, MarkType } from '@domternal/pm/model';
|
|
8
|
-
import type { EditorState } from '@domternal/pm/state';
|
|
9
|
-
import type { EditorView } from '@domternal/pm/view';
|
|
10
|
-
import type { ExtensionConfigBase, ExtensionContext } from './ExtensionConfig.js';
|
|
11
|
-
import type { AttributeSpecs } from './AttributeSpec.js';
|
|
12
|
-
/**
|
|
13
|
-
* Editor interface for Mark context
|
|
14
|
-
* Includes schema with marks for MarkType getter
|
|
15
|
-
*/
|
|
16
|
-
export interface MarkEditorContext {
|
|
17
|
-
readonly state: EditorState;
|
|
18
|
-
readonly view: EditorView;
|
|
19
|
-
readonly schema: {
|
|
20
|
-
marks: Record<string, MarkType>;
|
|
21
|
-
};
|
|
22
|
-
readonly commands: Record<string, (...args: unknown[]) => boolean>;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Context interface for Mark config methods.
|
|
26
|
-
* Extends ExtensionContext with mark-specific properties.
|
|
27
|
-
* This enables proper typing of `this.options`, `this.markType`, etc.
|
|
28
|
-
*
|
|
29
|
-
* @typeParam Options - Mark options type
|
|
30
|
-
* @typeParam Storage - Mark storage type
|
|
31
|
-
*/
|
|
32
|
-
export interface MarkContext<Options = unknown, Storage = unknown> extends Omit<ExtensionContext<Options, Storage>, 'editor' | 'type'> {
|
|
33
|
-
/** Mark type identifier */
|
|
34
|
-
readonly type: 'mark';
|
|
35
|
-
/** Editor instance with schema access */
|
|
36
|
-
editor: MarkEditorContext | null;
|
|
37
|
-
/** ProseMirror MarkType (null until editor is initialized) */
|
|
38
|
-
readonly markType: MarkType | null;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Parse rule for converting HTML to ProseMirror mark
|
|
42
|
-
* Simplified version of ProseMirror's ParseRule for marks
|
|
43
|
-
*/
|
|
44
|
-
export interface MarkParseRule {
|
|
45
|
-
/**
|
|
46
|
-
* CSS selector or tag name to match
|
|
47
|
-
* @example 'strong', 'b', 'span.bold'
|
|
48
|
-
*/
|
|
49
|
-
tag?: string;
|
|
50
|
-
/**
|
|
51
|
-
* Match by CSS style property
|
|
52
|
-
* Can include expected value after '='
|
|
53
|
-
* @example 'font-weight', 'font-weight=bold'
|
|
54
|
-
*/
|
|
55
|
-
style?: string;
|
|
56
|
-
/**
|
|
57
|
-
* Priority for this rule (higher = checked first)
|
|
58
|
-
* @default 50
|
|
59
|
-
*/
|
|
60
|
-
priority?: number;
|
|
61
|
-
/**
|
|
62
|
-
* Whether to consume the matched element
|
|
63
|
-
* @default true
|
|
64
|
-
*/
|
|
65
|
-
consuming?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Get attributes from the matched element
|
|
68
|
-
* Return null/undefined to skip this rule
|
|
69
|
-
* Return false to explicitly not match
|
|
70
|
-
*
|
|
71
|
-
* For style rules, receives the style value as string
|
|
72
|
-
*/
|
|
73
|
-
getAttrs?: ((node: HTMLElement | string) => Record<string, unknown> | false | null) | null;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Props passed to renderHTML function for marks
|
|
77
|
-
*/
|
|
78
|
-
export interface MarkRenderHTMLProps {
|
|
79
|
-
/**
|
|
80
|
-
* The ProseMirror mark being rendered
|
|
81
|
-
*/
|
|
82
|
-
mark: PMMark;
|
|
83
|
-
/**
|
|
84
|
-
* Merged HTML attributes from all sources
|
|
85
|
-
*/
|
|
86
|
-
HTMLAttributes: Record<string, unknown>;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Mark-specific configuration properties (schema-related)
|
|
90
|
-
*/
|
|
91
|
-
interface MarkSchemaProperties {
|
|
92
|
-
/**
|
|
93
|
-
* Whether this mark should be active when the cursor
|
|
94
|
-
* is at its end (or beginning for marks that open).
|
|
95
|
-
*
|
|
96
|
-
* When true, typing at the mark's boundary continues the mark.
|
|
97
|
-
* When false, typing creates unmarked content.
|
|
98
|
-
*
|
|
99
|
-
* @default true
|
|
100
|
-
*/
|
|
101
|
-
inclusive?: boolean | (() => boolean);
|
|
102
|
-
/**
|
|
103
|
-
* Marks that this mark excludes (cannot coexist with)
|
|
104
|
-
*
|
|
105
|
-
* - '_' excludes all marks
|
|
106
|
-
* - Space-separated mark names exclude specific marks
|
|
107
|
-
* - Empty string or undefined means no exclusions
|
|
108
|
-
*
|
|
109
|
-
* @example 'code' - excludes code mark
|
|
110
|
-
* @example 'bold italic' - excludes bold and italic
|
|
111
|
-
* @example '_' - excludes all other marks
|
|
112
|
-
*/
|
|
113
|
-
excludes?: string;
|
|
114
|
-
/**
|
|
115
|
-
* Mark group(s) this mark belongs to
|
|
116
|
-
* Used in node's marks property
|
|
117
|
-
*
|
|
118
|
-
* @example 'formatting', 'inline'
|
|
119
|
-
*/
|
|
120
|
-
group?: string;
|
|
121
|
-
/**
|
|
122
|
-
* Whether this mark can span multiple nodes
|
|
123
|
-
*
|
|
124
|
-
* When true (default), the mark persists across inline nodes.
|
|
125
|
-
* When false, the mark only applies within a single text node.
|
|
126
|
-
*
|
|
127
|
-
* @default true
|
|
128
|
-
*/
|
|
129
|
-
spanning?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Whether this mark represents visual formatting.
|
|
132
|
-
*
|
|
133
|
-
* Used by `unsetAllMarks` to decide which marks to remove.
|
|
134
|
-
* Marks with `isFormatting: false` survive clear formatting
|
|
135
|
-
* (e.g., links, comments, annotations).
|
|
136
|
-
*
|
|
137
|
-
* Can be overridden via `.configure()`:
|
|
138
|
-
* ```ts
|
|
139
|
-
* Link.configure({ isFormatting: true }) // make links clearable
|
|
140
|
-
* ```
|
|
141
|
-
*
|
|
142
|
-
* @default true
|
|
143
|
-
*/
|
|
144
|
-
isFormatting?: boolean;
|
|
145
|
-
/**
|
|
146
|
-
* Define mark attributes
|
|
147
|
-
* Returns attribute specifications
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* addAttributes() {
|
|
151
|
-
* return {
|
|
152
|
-
* color: { default: null },
|
|
153
|
-
* };
|
|
154
|
-
* }
|
|
155
|
-
*/
|
|
156
|
-
addAttributes?: () => AttributeSpecs;
|
|
157
|
-
/**
|
|
158
|
-
* Parse rules for converting HTML to this mark
|
|
159
|
-
* Each rule defines how to match and parse HTML elements
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* parseHTML() {
|
|
163
|
-
* return [
|
|
164
|
-
* { tag: 'strong' },
|
|
165
|
-
* { tag: 'b' },
|
|
166
|
-
* { style: 'font-weight', getAttrs: (value) => /bold|[5-9]\d{2}/.test(value) && null },
|
|
167
|
-
* ];
|
|
168
|
-
* }
|
|
169
|
-
*/
|
|
170
|
-
parseHTML?: () => MarkParseRule[];
|
|
171
|
-
/**
|
|
172
|
-
* Render this mark to DOM
|
|
173
|
-
* Returns DOMOutputSpec (tag, attributes, hole)
|
|
174
|
-
*
|
|
175
|
-
* The 0 in the return array indicates where child content goes.
|
|
176
|
-
*
|
|
177
|
-
* @example
|
|
178
|
-
* renderHTML({ mark, HTMLAttributes }) {
|
|
179
|
-
* return ['strong', HTMLAttributes, 0];
|
|
180
|
-
* }
|
|
181
|
-
*/
|
|
182
|
-
renderHTML?: (props: MarkRenderHTMLProps) => DOMOutputSpec;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Configuration for Mark extensions
|
|
186
|
-
* Combines ExtensionConfigBase with mark-specific schema properties.
|
|
187
|
-
* Uses ThisType<MarkContext> to provide proper typing for `this` in config methods.
|
|
188
|
-
*
|
|
189
|
-
* @typeParam Options - Mark options type
|
|
190
|
-
* @typeParam Storage - Mark storage type
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* const Bold = Mark.create({
|
|
194
|
-
* name: 'bold',
|
|
195
|
-
* parseHTML() {
|
|
196
|
-
* // `this` is properly typed here!
|
|
197
|
-
* return [{ tag: 'strong' }, { tag: 'b' }];
|
|
198
|
-
* },
|
|
199
|
-
* renderHTML({ HTMLAttributes }) {
|
|
200
|
-
* return ['strong', HTMLAttributes, 0];
|
|
201
|
-
* },
|
|
202
|
-
* });
|
|
203
|
-
*/
|
|
204
|
-
export type MarkConfig<Options = unknown, Storage = unknown> = ExtensionConfigBase<Options, Storage> & MarkSchemaProperties & ThisType<MarkContext<Options, Storage>>;
|
|
205
|
-
export {};
|
|
206
|
-
//# sourceMappingURL=MarkConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MarkConfig.d.ts","sourceRoot":"","sources":["../../src/types/MarkConfig.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE;QACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACjC,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC;CACpE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW,CAAC,OAAO,GAAG,OAAO,EAAE,OAAO,GAAG,OAAO,CAC/D,SAAQ,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACnE,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,MAAM,E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