@domternal/core 0.5.1 → 0.6.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 +5 -4
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +5845 -23
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/package.json +14 -12
- 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 -144
- 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 -139
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domternal/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Framework-agnostic ProseMirror editor engine",
|
|
5
5
|
"author": "https://github.com/ThomasNowHere",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,8 +28,18 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"build": "tsup --clean && node scripts/fix-dts.mjs",
|
|
33
|
+
"dev": "tsup --watch",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:watch": "vitest",
|
|
36
|
+
"lint": "eslint src",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"prepublishOnly": "node -e \"const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));delete p.devDependencies;if(p.dependencies){for(const[k,v]of Object.entries(p.dependencies)){if(v==='workspace:*')p.dependencies[k]='>=0.6.0'}}require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
|
|
39
|
+
"postpublish": "git checkout package.json"
|
|
40
|
+
},
|
|
31
41
|
"dependencies": {
|
|
32
|
-
"@domternal/pm": ">=0.
|
|
42
|
+
"@domternal/pm": ">=0.6.0",
|
|
33
43
|
"@floating-ui/dom": "^1.7.5",
|
|
34
44
|
"linkifyjs": "^4.3.2"
|
|
35
45
|
},
|
|
@@ -56,13 +66,5 @@
|
|
|
56
66
|
"bugs": {
|
|
57
67
|
"url": "https://github.com/domternal/domternal/issues"
|
|
58
68
|
},
|
|
59
|
-
"homepage": "https://domternal.dev"
|
|
60
|
-
|
|
61
|
-
"build": "tsup --clean && node scripts/fix-dts.mjs",
|
|
62
|
-
"dev": "tsup --watch",
|
|
63
|
-
"test": "vitest run",
|
|
64
|
-
"test:watch": "vitest",
|
|
65
|
-
"lint": "eslint src",
|
|
66
|
-
"typecheck": "tsc --noEmit"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
+
"homepage": "https://domternal.dev"
|
|
70
|
+
}
|
package/dist/CanChecker.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CanChecker - Dry-run command checker
|
|
3
|
-
*
|
|
4
|
-
* Provides API for checking if commands CAN be executed without actually executing them.
|
|
5
|
-
* Commands receive dispatch=undefined to indicate dry-run mode.
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* // Check single command
|
|
9
|
-
* if (editor.can().toggleBold()) {
|
|
10
|
-
* // Bold can be applied
|
|
11
|
-
* }
|
|
12
|
-
*
|
|
13
|
-
* // Check command chain
|
|
14
|
-
* if (editor.can().chain().toggleBold().toggleItalic().run()) {
|
|
15
|
-
* // Both commands can be executed
|
|
16
|
-
* }
|
|
17
|
-
*/
|
|
18
|
-
import type { EditorState } from '@domternal/pm/state';
|
|
19
|
-
import type { EditorView } from '@domternal/pm/view';
|
|
20
|
-
import type { CommandMap, CanCommands, CanChainedCommands, ChainedCommands } from './types/Commands.js';
|
|
21
|
-
/**
|
|
22
|
-
* Editor interface for CanChecker
|
|
23
|
-
*/
|
|
24
|
-
export interface CanCheckerEditor {
|
|
25
|
-
readonly view: EditorView;
|
|
26
|
-
readonly state: EditorState;
|
|
27
|
-
readonly isDestroyed: boolean;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Options for creating a CanChecker
|
|
31
|
-
*/
|
|
32
|
-
export interface CanCheckerOptions {
|
|
33
|
-
editor: CanCheckerEditor;
|
|
34
|
-
rawCommands: CommandMap;
|
|
35
|
-
/** Function to create a ChainBuilder for chain() within commands */
|
|
36
|
-
createChainBuilder: () => ChainedCommands;
|
|
37
|
-
/**
|
|
38
|
-
* Optional callback when an unknown command is accessed
|
|
39
|
-
* Useful for debugging - called with command name and context
|
|
40
|
-
*/
|
|
41
|
-
onUnknownCommand?: (name: string, context: 'single' | 'chain') => void;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Checks if commands can be executed (dry-run mode)
|
|
45
|
-
*
|
|
46
|
-
* Uses JavaScript Proxy to dynamically generate command methods.
|
|
47
|
-
* Each command is executed with dispatch=undefined.
|
|
48
|
-
*/
|
|
49
|
-
export declare class CanChecker {
|
|
50
|
-
private readonly editor;
|
|
51
|
-
private readonly rawCommands;
|
|
52
|
-
private readonly createChainBuilder;
|
|
53
|
-
private readonly onUnknownCommand;
|
|
54
|
-
constructor(options: CanCheckerOptions);
|
|
55
|
-
/**
|
|
56
|
-
* Builds CommandProps for dry-run checks
|
|
57
|
-
* dispatch is undefined to indicate dry-run mode
|
|
58
|
-
*/
|
|
59
|
-
private buildDryRunProps;
|
|
60
|
-
/**
|
|
61
|
-
* Builds SingleCommands for use within can() checks
|
|
62
|
-
*/
|
|
63
|
-
private buildSingleCommands;
|
|
64
|
-
/**
|
|
65
|
-
* Creates a Proxy that provides dynamic can() methods
|
|
66
|
-
* Each method returns boolean indicating if command can execute
|
|
67
|
-
*/
|
|
68
|
-
proxy(): CanCommands;
|
|
69
|
-
/**
|
|
70
|
-
* Creates a chain proxy for can().chain()
|
|
71
|
-
* Tracks if all commands in chain can execute
|
|
72
|
-
*/
|
|
73
|
-
chainProxy(): CanChainedCommands;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Creates a new CanChecker instance
|
|
77
|
-
*/
|
|
78
|
-
export declare function createCanChecker(options: CanCheckerOptions): CanCommands;
|
|
79
|
-
//# sourceMappingURL=CanChecker.d.ts.map
|
package/dist/CanChecker.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CanChecker.d.ts","sourceRoot":"","sources":["../src/CanChecker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAGV,UAAU,EACV,WAAW,EACX,kBAAkB,EAElB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAG7B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,EAAE,UAAU,CAAC;IACxB,oEAAoE;IACpE,kBAAkB,EAAE,MAAM,eAAe,CAAC;IAC1C;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,KAAK,IAAI,CAAC;CACxE;AAED;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAmB;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAwB;IAC3D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAoE;gBAEzF,OAAO,EAAE,iBAAiB;IAOtC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAiB3B;;;OAGG;IACH,KAAK,IAAI,WAAW;IA8BpB;;;OAGG;IACH,UAAU,IAAI,kBAAkB;CAwCjC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,CAGxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CanChecker.test.d.ts","sourceRoot":"","sources":["../src/CanChecker.test.ts"],"names":[],"mappings":""}
|
package/dist/ChainBuilder.d.ts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ChainBuilder - Chainable command builder
|
|
3
|
-
*
|
|
4
|
-
* Provides fluent API for chaining multiple commands with a shared transaction.
|
|
5
|
-
* Commands accumulate changes on the transaction, which is dispatched on run().
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* editor.chain()
|
|
9
|
-
* .focus()
|
|
10
|
-
* .insertText('Hello')
|
|
11
|
-
* .toggleBold()
|
|
12
|
-
* .run();
|
|
13
|
-
*/
|
|
14
|
-
import type { EditorState, Transaction } from '@domternal/pm/state';
|
|
15
|
-
import type { EditorView } from '@domternal/pm/view';
|
|
16
|
-
import type { CommandProps, CommandMap, ChainedCommands, ChainFailure } from './types/Commands.js';
|
|
17
|
-
/**
|
|
18
|
-
* Editor interface for ChainBuilder
|
|
19
|
-
*/
|
|
20
|
-
export interface ChainBuilderEditor {
|
|
21
|
-
readonly view: EditorView;
|
|
22
|
-
readonly state: EditorState;
|
|
23
|
-
readonly isDestroyed: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Options for creating a ChainBuilder
|
|
27
|
-
*/
|
|
28
|
-
export interface ChainBuilderOptions {
|
|
29
|
-
editor: ChainBuilderEditor;
|
|
30
|
-
rawCommands: CommandMap;
|
|
31
|
-
tr?: Transaction;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Builds chainable commands with shared transaction
|
|
35
|
-
*
|
|
36
|
-
* Uses JavaScript Proxy to dynamically generate command methods.
|
|
37
|
-
* Each command method returns `this` for fluent chaining.
|
|
38
|
-
*/
|
|
39
|
-
export declare class ChainBuilder {
|
|
40
|
-
private readonly editor;
|
|
41
|
-
private readonly rawCommands;
|
|
42
|
-
private readonly tr;
|
|
43
|
-
private shouldDispatch;
|
|
44
|
-
/** Cached proxy instance for performance (avoids creating new Proxy per command) */
|
|
45
|
-
private _cachedProxy;
|
|
46
|
-
/** Tracks the first command failure in the chain */
|
|
47
|
-
private _failure;
|
|
48
|
-
/** Current command index in the chain */
|
|
49
|
-
private _commandIndex;
|
|
50
|
-
/** Cached CommandProps for performance */
|
|
51
|
-
private _cachedProps;
|
|
52
|
-
/** Cached SingleCommands proxy for performance */
|
|
53
|
-
private _cachedSingleCommands;
|
|
54
|
-
/** Cached CanCommands proxy for performance */
|
|
55
|
-
private _cachedCanCommands;
|
|
56
|
-
constructor(options: ChainBuilderOptions);
|
|
57
|
-
/**
|
|
58
|
-
* Gets cached CommandProps or builds new one
|
|
59
|
-
* In chain mode, dispatch adds to shared transaction
|
|
60
|
-
*/
|
|
61
|
-
private buildCommandProps;
|
|
62
|
-
/**
|
|
63
|
-
* Gets cached SingleCommands proxy or builds new one
|
|
64
|
-
*/
|
|
65
|
-
private buildSingleCommands;
|
|
66
|
-
/**
|
|
67
|
-
* Gets cached CanCommands proxy or builds new one
|
|
68
|
-
*/
|
|
69
|
-
private buildCanCommands;
|
|
70
|
-
/**
|
|
71
|
-
* Builds CanChainedCommands for chained dry-run checks
|
|
72
|
-
*/
|
|
73
|
-
private buildCanChainCommands;
|
|
74
|
-
/**
|
|
75
|
-
* Execute a custom command within the chain
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* editor.chain()
|
|
79
|
-
* .focus()
|
|
80
|
-
* .command(({ tr }) => {
|
|
81
|
-
* tr.insertText('custom');
|
|
82
|
-
* return true;
|
|
83
|
-
* })
|
|
84
|
-
* .run();
|
|
85
|
-
*/
|
|
86
|
-
command(fn: (props: CommandProps) => boolean): this;
|
|
87
|
-
/**
|
|
88
|
-
* Get information about the first command that failed in the chain
|
|
89
|
-
*
|
|
90
|
-
* @returns ChainFailure object or null if no failure occurred
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* const chain = editor.chain().toggleBold().setHeading(1);
|
|
94
|
-
* if (!chain.run()) {
|
|
95
|
-
* console.log('Failed:', chain.getFailure());
|
|
96
|
-
* }
|
|
97
|
-
*/
|
|
98
|
-
getFailure(): ChainFailure | null;
|
|
99
|
-
/**
|
|
100
|
-
* Execute the command chain
|
|
101
|
-
* Dispatches the accumulated transaction
|
|
102
|
-
*
|
|
103
|
-
* @returns true if chain was executed successfully
|
|
104
|
-
*/
|
|
105
|
-
run(): boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Creates a Proxy that provides dynamic command methods
|
|
108
|
-
* Each method returns `this` for chaining
|
|
109
|
-
*
|
|
110
|
-
* Caches the proxy instance for performance - avoids creating
|
|
111
|
-
* new Proxy objects for each command in the chain.
|
|
112
|
-
*/
|
|
113
|
-
proxy(): ChainedCommands;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Creates a new ChainBuilder instance
|
|
117
|
-
*/
|
|
118
|
-
export declare function createChainBuilder(options: ChainBuilderOptions): ChainedCommands;
|
|
119
|
-
//# sourceMappingURL=ChainBuilder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChainBuilder.d.ts","sourceRoot":"","sources":["../src/ChainBuilder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,YAAY,EAEZ,UAAU,EACV,eAAe,EAGf,YAAY,EACb,MAAM,qBAAqB,CAAC;AAM7B;;GAEG;AACH,MAAM,WAAW,kBAAkB;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AAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,eAAe,CAGhF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChainBuilder.test.d.ts","sourceRoot":"","sources":["../src/ChainBuilder.test.ts"],"names":[],"mappings":""}
|
package/dist/CommandManager.d.ts
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { EditorView } from '@domternal/pm/view';
|
|
2
|
-
import type { CommandMap, SingleCommands, ChainedCommands, CanCommands } from './types/Commands.js';
|
|
3
|
-
export type { SetContentOptions, ClearContentOptions } from './commands/index.js';
|
|
4
|
-
/**
|
|
5
|
-
* Editor interface for CommandManager
|
|
6
|
-
* Forward declaration to avoid circular dependency
|
|
7
|
-
*/
|
|
8
|
-
export interface CommandManagerEditor {
|
|
9
|
-
readonly view: EditorView;
|
|
10
|
-
readonly state: CommandManagerEditor['view']['state'];
|
|
11
|
-
readonly isDestroyed: boolean;
|
|
12
|
-
emit(event: string, props?: unknown): void;
|
|
13
|
-
/** Extension manager for collecting extension commands */
|
|
14
|
-
readonly extensionManager: {
|
|
15
|
-
readonly commands: CommandMap;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Manages editor commands
|
|
20
|
-
*
|
|
21
|
-
* Provides:
|
|
22
|
-
* - editor.commands.* - Single commands that execute immediately
|
|
23
|
-
* - editor.chain().*.run() - Chainable commands with shared transaction
|
|
24
|
-
* - editor.can().* - Dry-run checks if commands can execute
|
|
25
|
-
*/
|
|
26
|
-
export declare class CommandManager {
|
|
27
|
-
private readonly editor;
|
|
28
|
-
/** Cached raw commands (built-in + extension) */
|
|
29
|
-
private _rawCommands;
|
|
30
|
-
/** Cached commands proxy to avoid allocation on every access */
|
|
31
|
-
private _cachedCommands;
|
|
32
|
-
/** Cached dispatch function to avoid allocation on every command */
|
|
33
|
-
private readonly _dispatch;
|
|
34
|
-
constructor(editor: CommandManagerEditor);
|
|
35
|
-
/**
|
|
36
|
-
* Gets all raw commands (built-in + extension commands)
|
|
37
|
-
* Cached after first access
|
|
38
|
-
*/
|
|
39
|
-
get rawCommands(): CommandMap;
|
|
40
|
-
/**
|
|
41
|
-
* Builds CommandProps for executing a command
|
|
42
|
-
*/
|
|
43
|
-
private buildCommandProps;
|
|
44
|
-
/**
|
|
45
|
-
* Single commands that execute immediately
|
|
46
|
-
* Uses Proxy to dynamically generate command methods (ID-1)
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* editor.commands.focus('end');
|
|
50
|
-
* editor.commands.insertText('Hello');
|
|
51
|
-
*/
|
|
52
|
-
get commands(): SingleCommands;
|
|
53
|
-
/**
|
|
54
|
-
* Creates a chainable command builder
|
|
55
|
-
*
|
|
56
|
-
* Commands accumulate on a shared transaction, dispatched on run()
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* editor.chain()
|
|
60
|
-
* .focus()
|
|
61
|
-
* .insertText('Hello')
|
|
62
|
-
* .run();
|
|
63
|
-
*/
|
|
64
|
-
chain(): ChainedCommands;
|
|
65
|
-
/**
|
|
66
|
-
* Creates a command availability checker (dry-run mode)
|
|
67
|
-
*
|
|
68
|
-
* Commands are executed with dispatch=undefined to check if they can run
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* if (editor.can().toggleBold()) {
|
|
72
|
-
* // Bold can be applied
|
|
73
|
-
* }
|
|
74
|
-
*
|
|
75
|
-
* if (editor.can().chain().toggleBold().toggleItalic().run()) {
|
|
76
|
-
* // Both can be applied
|
|
77
|
-
* }
|
|
78
|
-
*/
|
|
79
|
-
can(): CanCommands;
|
|
80
|
-
/**
|
|
81
|
-
* Clears cached commands
|
|
82
|
-
* Call this if extensions change dynamically
|
|
83
|
-
*/
|
|
84
|
-
clearCache(): void;
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=CommandManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandManager.d.ts","sour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,0 @@
|
|
|
1
|
-
{"version":3,"file":"CommandManager.test.d.ts","sourceRoot":"","sources":["../src/CommandManager.test.ts"],"names":[],"mappings":""}
|
package/dist/Editor.d.ts
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Editor - Main editor class wrapping ProseMirror
|
|
3
|
-
*
|
|
4
|
-
* Manages extensions, schema, commands, and the ProseMirror EditorView/State.
|
|
5
|
-
*/
|
|
6
|
-
import type { Plugin, PluginKey } from '@domternal/pm/state';
|
|
7
|
-
import { EditorState } from '@domternal/pm/state';
|
|
8
|
-
import { EditorView } from '@domternal/pm/view';
|
|
9
|
-
import type { Schema } from '@domternal/pm/model';
|
|
10
|
-
import { EventEmitter } from './EventEmitter.js';
|
|
11
|
-
import { ExtensionManager } from './ExtensionManager.js';
|
|
12
|
-
import { type InlineStyleOverrides } from './utils/inlineStyles.js';
|
|
13
|
-
import type { EditorOptions, EditorEvents, Content, JSONContent, FocusPosition, SingleCommands, ChainedCommands, CanCommands, ToolbarItem } from './types/index.js';
|
|
14
|
-
/**
|
|
15
|
-
* Main editor class
|
|
16
|
-
*
|
|
17
|
-
* Wraps ProseMirror's EditorView and EditorState with a cleaner API.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```ts
|
|
21
|
-
* import { Editor } from '@domternal/core';
|
|
22
|
-
* import { Schema } from '@domternal/pm/model';
|
|
23
|
-
*
|
|
24
|
-
* const schema = new Schema({
|
|
25
|
-
* nodes: { doc: { content: 'paragraph+' }, paragraph: { content: 'text*' }, text: {} }
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* const editor = new Editor({
|
|
29
|
-
* schema,
|
|
30
|
-
* element: document.getElementById('editor'),
|
|
31
|
-
* content: '<p>Hello world</p>',
|
|
32
|
-
* });
|
|
33
|
-
*
|
|
34
|
-
* // Get content
|
|
35
|
-
* const json = editor.getJSON();
|
|
36
|
-
* const html = editor.getHTML();
|
|
37
|
-
*
|
|
38
|
-
* // Set content
|
|
39
|
-
* editor.commands.setContent('<p>New content</p>');
|
|
40
|
-
*
|
|
41
|
-
* // Cleanup
|
|
42
|
-
* editor.destroy();
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
export declare class Editor extends EventEmitter<EditorEvents> {
|
|
46
|
-
/**
|
|
47
|
-
* Editor configuration options
|
|
48
|
-
*/
|
|
49
|
-
private options;
|
|
50
|
-
/**
|
|
51
|
-
* Manages extensions and schema
|
|
52
|
-
* @internal Exposed for CommandManager, not for public use
|
|
53
|
-
*/
|
|
54
|
-
private _extensionManager;
|
|
55
|
-
/**
|
|
56
|
-
* Gets the extension manager
|
|
57
|
-
* @internal For CommandManager use only
|
|
58
|
-
*/
|
|
59
|
-
get extensionManager(): ExtensionManager;
|
|
60
|
-
/**
|
|
61
|
-
* Manages commands
|
|
62
|
-
*/
|
|
63
|
-
private commandManager;
|
|
64
|
-
/**
|
|
65
|
-
* ProseMirror EditorView instance
|
|
66
|
-
*/
|
|
67
|
-
view: EditorView;
|
|
68
|
-
/**
|
|
69
|
-
* Whether the editor has been destroyed
|
|
70
|
-
*/
|
|
71
|
-
private _isDestroyed;
|
|
72
|
-
/**
|
|
73
|
-
* Timer for autofocus (cleared on destroy to prevent memory leaks)
|
|
74
|
-
*/
|
|
75
|
-
private _autofocusTimer;
|
|
76
|
-
/**
|
|
77
|
-
* Creates a new Editor instance
|
|
78
|
-
*
|
|
79
|
-
* @param options - Editor configuration
|
|
80
|
-
* @throws Error if running in SSR environment (no window)
|
|
81
|
-
* @throws Error if schema is not provided
|
|
82
|
-
*/
|
|
83
|
-
constructor(options: EditorOptions);
|
|
84
|
-
/**
|
|
85
|
-
* Gets the current EditorState
|
|
86
|
-
*/
|
|
87
|
-
get state(): EditorState;
|
|
88
|
-
/**
|
|
89
|
-
* Gets the ProseMirror schema
|
|
90
|
-
*/
|
|
91
|
-
get schema(): Schema;
|
|
92
|
-
/**
|
|
93
|
-
* Checks if the editor is editable
|
|
94
|
-
*/
|
|
95
|
-
get isEditable(): boolean;
|
|
96
|
-
/**
|
|
97
|
-
* Checks if the editor content is empty
|
|
98
|
-
*/
|
|
99
|
-
get isEmpty(): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Checks if the editor has focus
|
|
102
|
-
*/
|
|
103
|
-
get isFocused(): boolean;
|
|
104
|
-
/**
|
|
105
|
-
* Checks if the editor has been destroyed
|
|
106
|
-
*/
|
|
107
|
-
get isDestroyed(): boolean;
|
|
108
|
-
/**
|
|
109
|
-
* Gets single commands for immediate execution
|
|
110
|
-
* @example editor.commands.focus('end')
|
|
111
|
-
*/
|
|
112
|
-
get commands(): SingleCommands;
|
|
113
|
-
/**
|
|
114
|
-
* Creates a command chain for batched execution
|
|
115
|
-
* @example editor.chain().focus().insertText('Hello').run()
|
|
116
|
-
*/
|
|
117
|
-
chain(): ChainedCommands;
|
|
118
|
-
/**
|
|
119
|
-
* Checks if commands can be executed (dry-run)
|
|
120
|
-
* @example if (editor.can().toggleBold()) { ... }
|
|
121
|
-
*/
|
|
122
|
-
can(): CanCommands;
|
|
123
|
-
/**
|
|
124
|
-
* Gets extension storage
|
|
125
|
-
* Access via: editor.storage.extensionName.propertyName
|
|
126
|
-
*/
|
|
127
|
-
get storage(): Record<string, unknown>;
|
|
128
|
-
/**
|
|
129
|
-
* Gets toolbar items registered by all extensions.
|
|
130
|
-
* Used by framework toolbar components to auto-generate UI.
|
|
131
|
-
*/
|
|
132
|
-
get toolbarItems(): ToolbarItem[];
|
|
133
|
-
/**
|
|
134
|
-
* Checks if a node or mark is currently active
|
|
135
|
-
*
|
|
136
|
-
* For toolbar button states - returns true if:
|
|
137
|
-
* - For marks: the current selection has the mark applied
|
|
138
|
-
* - For nodes: the cursor is inside that node type
|
|
139
|
-
*
|
|
140
|
-
* @param nameOrAttributes - Extension name, or object with name and attributes
|
|
141
|
-
* @param attributes - Optional attributes to match (for node/mark specific states)
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* editor.isActive('bold') // → true if bold mark is active
|
|
145
|
-
* editor.isActive('heading', { level: 2 }) // → true if in h2
|
|
146
|
-
* editor.isActive({ name: 'textAlign', attributes: { align: 'center' } })
|
|
147
|
-
*/
|
|
148
|
-
isActive(nameOrAttributes: string | {
|
|
149
|
-
name: string;
|
|
150
|
-
attributes?: Record<string, unknown>;
|
|
151
|
-
}, attributes?: Record<string, unknown>): boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Gets attributes of the currently active node or mark
|
|
154
|
-
*
|
|
155
|
-
* Returns empty object if the node/mark is not found or not active.
|
|
156
|
-
*
|
|
157
|
-
* @param name - Extension name (node or mark)
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* editor.getAttributes('heading') // → { level: 2 }
|
|
161
|
-
* editor.getAttributes('link') // → { href: 'https://...', target: '_blank' }
|
|
162
|
-
*/
|
|
163
|
-
getAttributes(name: string): Record<string, unknown>;
|
|
164
|
-
/**
|
|
165
|
-
* Helper to match attributes
|
|
166
|
-
* Returns true if target contains all key/value pairs from source
|
|
167
|
-
*/
|
|
168
|
-
private matchAttributes;
|
|
169
|
-
/**
|
|
170
|
-
* Gets the document content as JSON
|
|
171
|
-
*/
|
|
172
|
-
getJSON(): JSONContent;
|
|
173
|
-
/**
|
|
174
|
-
* Gets the document content as HTML string
|
|
175
|
-
*
|
|
176
|
-
* @param options - Optional settings
|
|
177
|
-
* @param options.styled - When true (or an override object), applies inline CSS
|
|
178
|
-
* styles so the HTML renders correctly outside the editor (email, CMS, etc.)
|
|
179
|
-
*/
|
|
180
|
-
getHTML(options?: {
|
|
181
|
-
styled?: boolean | InlineStyleOverrides;
|
|
182
|
-
}): string;
|
|
183
|
-
/**
|
|
184
|
-
* Gets the document content as plain text
|
|
185
|
-
*
|
|
186
|
-
* @param options - Options for text extraction
|
|
187
|
-
* @param options.blockSeparator - String to insert between blocks (default: '\n\n')
|
|
188
|
-
*/
|
|
189
|
-
getText(options?: {
|
|
190
|
-
blockSeparator?: string;
|
|
191
|
-
}): string;
|
|
192
|
-
/**
|
|
193
|
-
* Executes a command with proper CommandProps
|
|
194
|
-
* @internal
|
|
195
|
-
*/
|
|
196
|
-
private runCommand;
|
|
197
|
-
/**
|
|
198
|
-
* Sets the editor content
|
|
199
|
-
*
|
|
200
|
-
* @param content - JSON or HTML content
|
|
201
|
-
* @param emitUpdate - Whether to emit update event (default: true)
|
|
202
|
-
* @returns true if content was set successfully, false if content was invalid
|
|
203
|
-
*/
|
|
204
|
-
setContent(content: Content, emitUpdate?: boolean): boolean;
|
|
205
|
-
/**
|
|
206
|
-
* Clears the editor content
|
|
207
|
-
*
|
|
208
|
-
* @param emitUpdate - Whether to emit update event (default: true)
|
|
209
|
-
* @returns true if content was cleared successfully
|
|
210
|
-
*/
|
|
211
|
-
clearContent(emitUpdate?: boolean): boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Sets whether the editor is editable
|
|
214
|
-
*
|
|
215
|
-
* @param editable - Whether the editor should be editable
|
|
216
|
-
*/
|
|
217
|
-
setEditable(editable: boolean): this;
|
|
218
|
-
/**
|
|
219
|
-
* Focuses the editor
|
|
220
|
-
*
|
|
221
|
-
* @param position - Where to place cursor (default: null = just focus)
|
|
222
|
-
*/
|
|
223
|
-
focus(position?: FocusPosition): this;
|
|
224
|
-
/**
|
|
225
|
-
* Removes focus from the editor
|
|
226
|
-
*/
|
|
227
|
-
blur(): this;
|
|
228
|
-
/**
|
|
229
|
-
* Registers a ProseMirror plugin dynamically at runtime.
|
|
230
|
-
* Used by framework wrappers (e.g. Angular BubbleMenu component) to add
|
|
231
|
-
* plugins after the editor is created.
|
|
232
|
-
*/
|
|
233
|
-
registerPlugin(plugin: Plugin): void;
|
|
234
|
-
/**
|
|
235
|
-
* Unregisters a ProseMirror plugin by its PluginKey.
|
|
236
|
-
* Uses PluginKey.get() to identify the plugin to remove.
|
|
237
|
-
*/
|
|
238
|
-
unregisterPlugin(key: PluginKey): void;
|
|
239
|
-
/**
|
|
240
|
-
* Destroys the editor and cleans up resources
|
|
241
|
-
*
|
|
242
|
-
* After calling destroy(), the editor instance should not be used.
|
|
243
|
-
*/
|
|
244
|
-
destroy(): void;
|
|
245
|
-
/**
|
|
246
|
-
* Builds a clipboardSerializer that applies a transform function to HTML on copy/cut.
|
|
247
|
-
*/
|
|
248
|
-
private buildClipboardSerializer;
|
|
249
|
-
/**
|
|
250
|
-
* Creates the editor instance
|
|
251
|
-
*/
|
|
252
|
-
private createEditor;
|
|
253
|
-
/**
|
|
254
|
-
* Handles ProseMirror transactions
|
|
255
|
-
*/
|
|
256
|
-
private dispatchTransaction;
|
|
257
|
-
/**
|
|
258
|
-
* Emit method - needed for CommandManager interface
|
|
259
|
-
*/
|
|
260
|
-
emit<E extends keyof EditorEvents>(event: E, ...args: EditorEvents[E] extends undefined ? [] : [EditorEvents[E]]): this;
|
|
261
|
-
}
|
|
262
|
-
//# sourceMappingURL=Editor.d.ts.map
|
package/dist/Editor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../src/Editor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAe,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAY,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAQlF,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,OAAO,EACP,WAAW,EACX,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,EAEX,WAAW,E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