@kerebron/extension-codemirror 0.4.4 → 0.4.6
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/esm/{extension-codemirror/src/ExtensionCodeMirror.d.ts → ExtensionCodeMirror.d.ts} +1 -2
- package/esm/ExtensionCodeMirror.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/ExtensionCodeMirror.js → ExtensionCodeMirror.js} +2 -3
- package/esm/{extension-codemirror/src/NodeCodeMirror.d.ts → NodeCodeMirror.d.ts} +3 -3
- package/esm/NodeCodeMirror.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/NodeCodeMirror.js → NodeCodeMirror.js} +2 -2
- package/esm/{extension-codemirror/src/codeMirrorBlockNodeView.d.ts → codeMirrorBlockNodeView.d.ts} +1 -1
- package/esm/codeMirrorBlockNodeView.d.ts.map +1 -0
- package/esm/defaults.d.ts.map +1 -0
- package/esm/languageLoaders.d.ts.map +1 -0
- package/esm/languages.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/lsp → lsp}/LSPExtension.d.ts +2 -2
- package/esm/lsp/LSPExtension.d.ts.map +1 -0
- package/esm/lsp/completion.d.ts.map +1 -0
- package/esm/lsp/hover.d.ts.map +1 -0
- package/esm/lsp/index.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/lsp → lsp}/plugin.d.ts +3 -3
- package/esm/lsp/plugin.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/lsp → lsp}/plugin.js +2 -2
- package/esm/lsp/pos.d.ts.map +1 -0
- package/esm/lsp/text.d.ts.map +1 -0
- package/esm/lsp/theme.d.ts.map +1 -0
- package/esm/remote-selections.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/remote-sync.d.ts → remote-sync.d.ts} +1 -1
- package/esm/remote-sync.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/types.d.ts → types.d.ts} +1 -1
- package/esm/types.d.ts.map +1 -0
- package/esm/{extension-codemirror/src/utils.d.ts → utils.d.ts} +1 -1
- package/esm/utils.d.ts.map +1 -0
- package/package.json +30 -6
- package/esm/_dnt.polyfills.d.ts +0 -101
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -127
- package/esm/_dnt.shims.d.ts +0 -2
- package/esm/_dnt.shims.d.ts.map +0 -1
- package/esm/_dnt.shims.js +0 -57
- package/esm/editor/src/CoreEditor.d.ts +0 -40
- package/esm/editor/src/CoreEditor.d.ts.map +0 -1
- package/esm/editor/src/CoreEditor.js +0 -252
- package/esm/editor/src/DummyEditorView.d.ts +0 -60
- package/esm/editor/src/DummyEditorView.d.ts.map +0 -1
- package/esm/editor/src/DummyEditorView.js +0 -277
- package/esm/editor/src/Extension.d.ts +0 -31
- package/esm/editor/src/Extension.d.ts.map +0 -1
- package/esm/editor/src/Extension.js +0 -53
- package/esm/editor/src/ExtensionManager.d.ts +0 -32
- package/esm/editor/src/ExtensionManager.d.ts.map +0 -1
- package/esm/editor/src/ExtensionManager.js +0 -260
- package/esm/editor/src/Mark.d.ts +0 -23
- package/esm/editor/src/Mark.d.ts.map +0 -1
- package/esm/editor/src/Mark.js +0 -51
- package/esm/editor/src/Node.d.ts +0 -32
- package/esm/editor/src/Node.d.ts.map +0 -1
- package/esm/editor/src/Node.js +0 -60
- package/esm/editor/src/commands/CommandManager.d.ts +0 -23
- package/esm/editor/src/commands/CommandManager.d.ts.map +0 -1
- package/esm/editor/src/commands/CommandManager.js +0 -118
- package/esm/editor/src/commands/baseCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/baseCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/baseCommandFactories.js +0 -836
- package/esm/editor/src/commands/createChainableState.d.ts +0 -3
- package/esm/editor/src/commands/createChainableState.d.ts.map +0 -1
- package/esm/editor/src/commands/createChainableState.js +0 -29
- package/esm/editor/src/commands/keyCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/keyCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/keyCommandFactories.js +0 -10
- package/esm/editor/src/commands/mod.d.ts +0 -7
- package/esm/editor/src/commands/mod.d.ts.map +0 -1
- package/esm/editor/src/commands/mod.js +0 -76
- package/esm/editor/src/commands/replaceCommandFactories.d.ts +0 -3
- package/esm/editor/src/commands/replaceCommandFactories.d.ts.map +0 -1
- package/esm/editor/src/commands/replaceCommandFactories.js +0 -94
- package/esm/editor/src/commands/types.d.ts +0 -18
- package/esm/editor/src/commands/types.d.ts.map +0 -1
- package/esm/editor/src/mod.d.ts +0 -9
- package/esm/editor/src/mod.d.ts.map +0 -1
- package/esm/editor/src/mod.js +0 -8
- package/esm/editor/src/nodeToTreeString.d.ts +0 -10
- package/esm/editor/src/nodeToTreeString.d.ts.map +0 -1
- package/esm/editor/src/nodeToTreeString.js +0 -74
- package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts +0 -6
- package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts.map +0 -1
- package/esm/editor/src/plugins/TrackSelecionPlugin.js +0 -24
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts +0 -23
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +0 -163
- package/esm/editor/src/plugins/input-rules/mod.d.ts +0 -3
- package/esm/editor/src/plugins/input-rules/mod.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/mod.js +0 -2
- package/esm/editor/src/plugins/input-rules/rulebuilders.d.ts +0 -5
- package/esm/editor/src/plugins/input-rules/rulebuilders.d.ts.map +0 -1
- package/esm/editor/src/plugins/input-rules/rulebuilders.js +0 -50
- package/esm/editor/src/plugins/keymap/keymap.d.ts +0 -11
- package/esm/editor/src/plugins/keymap/keymap.d.ts.map +0 -1
- package/esm/editor/src/plugins/keymap/keymap.js +0 -125
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +0 -4
- package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +0 -1
- package/esm/editor/src/plugins/keymap/w3c-keyname.js +0 -124
- package/esm/editor/src/types.d.ts +0 -52
- package/esm/editor/src/types.d.ts.map +0 -1
- package/esm/editor/src/types.js +0 -1
- package/esm/editor/src/ui.d.ts +0 -15
- package/esm/editor/src/ui.d.ts.map +0 -1
- package/esm/editor/src/ui.js +0 -16
- package/esm/editor/src/utilities/SmartOutput.d.ts +0 -41
- package/esm/editor/src/utilities/SmartOutput.d.ts.map +0 -1
- package/esm/editor/src/utilities/SmartOutput.js +0 -228
- package/esm/editor/src/utilities/createNodeFromContent.d.ts +0 -9
- package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +0 -1
- package/esm/editor/src/utilities/createNodeFromContent.js +0 -32
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts +0 -9
- package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +0 -1
- package/esm/editor/src/utilities/getHtmlAttributes.js +0 -47
- package/esm/editor/src/utilities/getShadowRoot.d.ts +0 -2
- package/esm/editor/src/utilities/getShadowRoot.d.ts.map +0 -1
- package/esm/editor/src/utilities/getShadowRoot.js +0 -16
- package/esm/editor/src/utilities/mod.d.ts +0 -6
- package/esm/editor/src/utilities/mod.d.ts.map +0 -1
- package/esm/editor/src/utilities/mod.js +0 -5
- package/esm/editor/src/utilities/toRawTextResult.d.ts +0 -3
- package/esm/editor/src/utilities/toRawTextResult.d.ts.map +0 -1
- package/esm/editor/src/utilities/toRawTextResult.js +0 -21
- package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts +0 -8
- package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/AutocompletePlugin.js +0 -232
- package/esm/extension-autocomplete/src/DefaultRenderer.d.ts +0 -17
- package/esm/extension-autocomplete/src/DefaultRenderer.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/DefaultRenderer.js +0 -137
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts +0 -26
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/ExtensionAutocomplete.js +0 -30
- package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts +0 -11
- package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/createDefaultMatcher.js +0 -58
- package/esm/extension-autocomplete/src/createRegexMatcher.d.ts +0 -4
- package/esm/extension-autocomplete/src/createRegexMatcher.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/createRegexMatcher.js +0 -50
- package/esm/extension-autocomplete/src/mod.d.ts +0 -3
- package/esm/extension-autocomplete/src/mod.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/mod.js +0 -2
- package/esm/extension-autocomplete/src/types.d.ts +0 -60
- package/esm/extension-autocomplete/src/types.d.ts.map +0 -1
- package/esm/extension-autocomplete/src/types.js +0 -1
- package/esm/extension-basic-editor/src/ExtensionHtml.d.ts +0 -15
- package/esm/extension-basic-editor/src/ExtensionHtml.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/ExtensionHtml.js +0 -108
- package/esm/extension-basic-editor/src/NodeCodeBlock.d.ts +0 -9
- package/esm/extension-basic-editor/src/NodeCodeBlock.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/NodeCodeBlock.js +0 -58
- package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.d.ts +0 -24
- package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.js +0 -35
- package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.d.ts +0 -25
- package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.d.ts.map +0 -1
- package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.js +0 -96
- package/esm/extension-codemirror/src/ExtensionCodeMirror.d.ts.map +0 -1
- package/esm/extension-codemirror/src/NodeCodeMirror.d.ts.map +0 -1
- package/esm/extension-codemirror/src/codeMirrorBlockNodeView.d.ts.map +0 -1
- package/esm/extension-codemirror/src/defaults.d.ts.map +0 -1
- package/esm/extension-codemirror/src/languageLoaders.d.ts.map +0 -1
- package/esm/extension-codemirror/src/languages.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/LSPExtension.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/completion.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/hover.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/index.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/plugin.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/pos.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/text.d.ts.map +0 -1
- package/esm/extension-codemirror/src/lsp/theme.d.ts.map +0 -1
- package/esm/extension-codemirror/src/remote-selections.d.ts.map +0 -1
- package/esm/extension-codemirror/src/remote-sync.d.ts.map +0 -1
- package/esm/extension-codemirror/src/types.d.ts.map +0 -1
- package/esm/extension-codemirror/src/types.js +0 -1
- package/esm/extension-codemirror/src/utils.d.ts.map +0 -1
- package/esm/extension-lsp/src/DiagnosticPlugin.d.ts +0 -32
- package/esm/extension-lsp/src/DiagnosticPlugin.d.ts.map +0 -1
- package/esm/extension-lsp/src/DiagnosticPlugin.js +0 -131
- package/esm/extension-lsp/src/ExtensionLsp.d.ts +0 -25
- package/esm/extension-lsp/src/ExtensionLsp.d.ts.map +0 -1
- package/esm/extension-lsp/src/ExtensionLsp.js +0 -126
- package/esm/extension-lsp/src/LSPClient.d.ts +0 -56
- package/esm/extension-lsp/src/LSPClient.d.ts.map +0 -1
- package/esm/extension-lsp/src/LSPClient.js +0 -449
- package/esm/extension-lsp/src/computeIncrementalChanges.d.ts +0 -8
- package/esm/extension-lsp/src/computeIncrementalChanges.d.ts.map +0 -1
- package/esm/extension-lsp/src/computeIncrementalChanges.js +0 -82
- package/esm/extension-lsp/src/createLspAutocomplete.d.ts +0 -23
- package/esm/extension-lsp/src/createLspAutocomplete.d.ts.map +0 -1
- package/esm/extension-lsp/src/createLspAutocomplete.js +0 -68
- package/esm/extension-lsp/src/mod.d.ts +0 -4
- package/esm/extension-lsp/src/mod.d.ts.map +0 -1
- package/esm/extension-lsp/src/mod.js +0 -3
- package/esm/extension-lsp/src/workspace.d.ts +0 -62
- package/esm/extension-lsp/src/workspace.d.ts.map +0 -1
- package/esm/extension-lsp/src/workspace.js +0 -168
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts +0 -36
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.js +0 -240
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts +0 -26
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/DocumentMarkdownTokenizer.js +0 -115
- package/esm/extension-markdown/src/ExtensionMarkdown.d.ts +0 -22
- package/esm/extension-markdown/src/ExtensionMarkdown.d.ts.map +0 -1
- package/esm/extension-markdown/src/ExtensionMarkdown.js +0 -48
- package/esm/extension-markdown/src/MarkdownParser.d.ts +0 -61
- package/esm/extension-markdown/src/MarkdownParser.d.ts.map +0 -1
- package/esm/extension-markdown/src/MarkdownParser.js +0 -249
- package/esm/extension-markdown/src/MarkdownSerializer.d.ts +0 -42
- package/esm/extension-markdown/src/MarkdownSerializer.d.ts.map +0 -1
- package/esm/extension-markdown/src/MarkdownSerializer.js +0 -325
- package/esm/extension-markdown/src/PositionMapper.d.ts +0 -15
- package/esm/extension-markdown/src/PositionMapper.d.ts.map +0 -1
- package/esm/extension-markdown/src/PositionMapper.js +0 -100
- package/esm/extension-markdown/src/TokenSource.d.ts +0 -11
- package/esm/extension-markdown/src/TokenSource.d.ts.map +0 -1
- package/esm/extension-markdown/src/TokenSource.js +0 -39
- package/esm/extension-markdown/src/mdToPmConverter.d.ts +0 -5
- package/esm/extension-markdown/src/mdToPmConverter.d.ts.map +0 -1
- package/esm/extension-markdown/src/mdToPmConverter.js +0 -111
- package/esm/extension-markdown/src/pmToMdConverter.d.ts +0 -16
- package/esm/extension-markdown/src/pmToMdConverter.d.ts.map +0 -1
- package/esm/extension-markdown/src/pmToMdConverter.js +0 -433
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts +0 -4
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/basic_token_handlers.js +0 -151
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts +0 -3
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.js +0 -34
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts +0 -6
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/inline_token_handlers.js +0 -380
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts +0 -3
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/lists_token_handlers.js +0 -323
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts +0 -9
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts.map +0 -1
- package/esm/extension-markdown/src/token_handlers/table_token_handlers.js +0 -308
- package/esm/extension-markdown/src/treeSitterTokenizer.d.ts +0 -5
- package/esm/extension-markdown/src/treeSitterTokenizer.d.ts.map +0 -1
- package/esm/extension-markdown/src/treeSitterTokenizer.js +0 -769
- package/esm/extension-markdown/src/types.d.ts +0 -28
- package/esm/extension-markdown/src/types.d.ts.map +0 -1
- package/esm/extension-markdown/src/types.js +0 -131
- package/esm/extension-markdown/src/utils.d.ts +0 -8
- package/esm/extension-markdown/src/utils.d.ts.map +0 -1
- package/esm/extension-markdown/src/utils.js +0 -86
- package/esm/tree-sitter-shim/src/main.d.ts +0 -15
- package/esm/tree-sitter-shim/src/main.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/main.js +0 -25
- package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts +0 -6
- package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/node.js +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts +0 -7
- package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/parser.js +0 -5
- package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts +0 -6
- package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts.map +0 -1
- package/esm/tree-sitter-shim/src/tree_sitter/tree.js +0 -1
- package/esm/wasm/src/mod.d.ts +0 -12
- package/esm/wasm/src/mod.d.ts.map +0 -1
- package/esm/wasm/src/mod.js +0 -48
- package/esm/wasm/wasm.d.ts +0 -138
- package/esm/wasm/wasm.d.ts.map +0 -1
- package/esm/wasm/wasm.js +0 -120
- /package/esm/{extension-codemirror/src/codeMirrorBlockNodeView.js → codeMirrorBlockNodeView.js} +0 -0
- /package/esm/{extension-codemirror/src/defaults.d.ts → defaults.d.ts} +0 -0
- /package/esm/{extension-codemirror/src/defaults.js → defaults.js} +0 -0
- /package/esm/{extension-codemirror/src/languageLoaders.d.ts → languageLoaders.d.ts} +0 -0
- /package/esm/{extension-codemirror/src/languageLoaders.js → languageLoaders.js} +0 -0
- /package/esm/{extension-codemirror/src/languages.d.ts → languages.d.ts} +0 -0
- /package/esm/{extension-codemirror/src/languages.js → languages.js} +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/LSPExtension.js +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/completion.d.ts +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/completion.js +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/hover.d.ts +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/hover.js +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/index.d.ts +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/index.js +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/pos.d.ts +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/pos.js +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/text.d.ts +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/text.js +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/theme.d.ts +0 -0
- /package/esm/{extension-codemirror/src/lsp → lsp}/theme.js +0 -0
- /package/esm/{extension-codemirror/src/remote-selections.d.ts → remote-selections.d.ts} +0 -0
- /package/esm/{extension-codemirror/src/remote-selections.js → remote-selections.js} +0 -0
- /package/esm/{extension-codemirror/src/remote-sync.js → remote-sync.js} +0 -0
- /package/esm/{editor/src/commands/types.js → types.js} +0 -0
- /package/esm/{extension-codemirror/src/utils.js → utils.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultRenderer.d.ts","sourceRoot":"","sources":["../../../src/extension-autocomplete/src/DefaultRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EAChB,MAAM,YAAY,CAAC;AAIpB,qBAAa,eAAe,CAAC,IAAI,CAAE,SAAQ,WACzC,YAAW,oBAAoB;IAMnB,OAAO,CAAC,MAAM;IAL1B,OAAO,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAM;IACxB,GAAG,EAAE,MAAM,CAAM;gBAEG,MAAM,EAAE,UAAU;IAKtC,OAAO,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC;IAiBpC,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC;IAMrC,MAAM;IASN,SAAS,CAAC,KAAK,EAAE,sBAAsB;IA0CvC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM;IAatC,YAAY,CAAC,KAAK,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC;CAyB3C"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
const CSS_PREFIX = 'kb-autocomplete';
|
|
2
|
-
export class DefaultRenderer extends EventTarget {
|
|
3
|
-
constructor(editor) {
|
|
4
|
-
super();
|
|
5
|
-
Object.defineProperty(this, "editor", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: editor
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "command", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: void 0
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "wrapper", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: void 0
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "items", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: []
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(this, "pos", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true,
|
|
32
|
-
writable: true,
|
|
33
|
-
value: -1
|
|
34
|
-
});
|
|
35
|
-
this.command = () => { };
|
|
36
|
-
}
|
|
37
|
-
onStart(props) {
|
|
38
|
-
this.command = props.command;
|
|
39
|
-
if (this.wrapper) {
|
|
40
|
-
this.wrapper.parentElement?.removeChild(this.wrapper);
|
|
41
|
-
}
|
|
42
|
-
const root = ('root' in this.editor.view)
|
|
43
|
-
? this.editor.view.root
|
|
44
|
-
: document || document;
|
|
45
|
-
this.wrapper = document.createElement('ul');
|
|
46
|
-
this.wrapper.classList.add(CSS_PREFIX + '__wrapper');
|
|
47
|
-
(root.body || root).appendChild(this.wrapper);
|
|
48
|
-
this.items.splice(0, this.items.length, ...props.items);
|
|
49
|
-
this.recreateList(props);
|
|
50
|
-
}
|
|
51
|
-
onUpdate(props) {
|
|
52
|
-
this.command = props.command;
|
|
53
|
-
this.items.splice(0, this.items.length, ...props.items);
|
|
54
|
-
this.recreateList(props);
|
|
55
|
-
}
|
|
56
|
-
onExit() {
|
|
57
|
-
if (this.wrapper) {
|
|
58
|
-
this.wrapper.parentNode?.removeChild(this.wrapper);
|
|
59
|
-
this.wrapper = undefined;
|
|
60
|
-
}
|
|
61
|
-
this.dispatchEvent(new Event('close'));
|
|
62
|
-
this.pos = -1;
|
|
63
|
-
}
|
|
64
|
-
onKeyDown(props) {
|
|
65
|
-
if (!this.wrapper) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
if (this.items.length === 0) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
if (props.event.key === 'Escape') {
|
|
72
|
-
if (this.wrapper) {
|
|
73
|
-
this.wrapper.parentNode?.removeChild(this.wrapper);
|
|
74
|
-
this.wrapper = undefined;
|
|
75
|
-
return true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
if (props.event.key === 'ArrowUp') {
|
|
79
|
-
if (this.pos > -1) {
|
|
80
|
-
this.pos = this.pos - 1;
|
|
81
|
-
this.recreateList();
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
}
|
|
85
|
-
if (props.event.key === 'ArrowDown') {
|
|
86
|
-
if (this.pos < this.items.length - 1) {
|
|
87
|
-
this.pos++;
|
|
88
|
-
this.recreateList();
|
|
89
|
-
}
|
|
90
|
-
return true;
|
|
91
|
-
}
|
|
92
|
-
if (props.event.key === 'Enter') {
|
|
93
|
-
if (this.pos > -1 && this.pos < this.items.length) {
|
|
94
|
-
this.command(this.items[this.pos]);
|
|
95
|
-
this.items.splice(0, this.items.length);
|
|
96
|
-
this.onExit();
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
createListItem(item, cnt) {
|
|
103
|
-
const li = document.createElement('li');
|
|
104
|
-
if (cnt === this.pos) {
|
|
105
|
-
li.classList.add('active');
|
|
106
|
-
}
|
|
107
|
-
li.innerText = '' + item; // TODO item to string and item formatting
|
|
108
|
-
li.style.cursor = 'pointer';
|
|
109
|
-
li.addEventListener('click', () => {
|
|
110
|
-
this.command(item);
|
|
111
|
-
});
|
|
112
|
-
return li;
|
|
113
|
-
}
|
|
114
|
-
recreateList(props) {
|
|
115
|
-
if (!this.wrapper) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
this.wrapper.innerHTML = '';
|
|
119
|
-
for (let cnt = 0; cnt < this.items.length; cnt++) {
|
|
120
|
-
const item = this.items[cnt];
|
|
121
|
-
this.wrapper.appendChild(this.createListItem(item, cnt));
|
|
122
|
-
}
|
|
123
|
-
if (this.items.length === 0) {
|
|
124
|
-
this.wrapper.style.display = 'none';
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
this.wrapper.style.display = '';
|
|
128
|
-
}
|
|
129
|
-
const rect = props?.clientRect?.();
|
|
130
|
-
if (rect?.height) {
|
|
131
|
-
const left = rect.left;
|
|
132
|
-
const bottom = rect.bottom;
|
|
133
|
-
this.wrapper.style.left = left + 'px';
|
|
134
|
-
this.wrapper.style.top = bottom + 'px';
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { EditorState, Plugin } from 'prosemirror-state';
|
|
2
|
-
import { Extension, type TextRange } from '../../editor/src/mod.js';
|
|
3
|
-
import { AutocompletePlugin } from './AutocompletePlugin.js';
|
|
4
|
-
import { AutocompleteMatcher, AutocompleteRenderer } from './types.js';
|
|
5
|
-
export interface AutocompleteProps {
|
|
6
|
-
state: EditorState;
|
|
7
|
-
range: TextRange;
|
|
8
|
-
isActive?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export interface AutocompleteConfig<I = any, TSelected = any> {
|
|
11
|
-
getItems: (query: string, props: AutocompleteProps) => I[] | Promise<I[]>;
|
|
12
|
-
onSelect?: (selected: TSelected, range: TextRange) => void;
|
|
13
|
-
allow?: (props: AutocompleteProps) => boolean;
|
|
14
|
-
matchers?: AutocompleteMatcher[];
|
|
15
|
-
renderer?: AutocompleteRenderer<I, TSelected>;
|
|
16
|
-
decorationTag?: string;
|
|
17
|
-
decorationClass?: string;
|
|
18
|
-
}
|
|
19
|
-
export declare class ExtensionAutocomplete extends Extension {
|
|
20
|
-
protected config: AutocompleteConfig;
|
|
21
|
-
name: string;
|
|
22
|
-
plugin: AutocompletePlugin<unknown, unknown>;
|
|
23
|
-
constructor(config: AutocompleteConfig);
|
|
24
|
-
getProseMirrorPlugins(): Plugin[];
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=ExtensionAutocomplete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionAutocomplete.d.ts","sourceRoot":"","sources":["../../../src/extension-autocomplete/src/ExtensionAutocomplete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG7D,OAAO,EAAmB,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAErF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,WAAW,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,GAAG,GAAG,EAAE,SAAS,GAAG,GAAG;IAC1D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,KAAK,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IAE1E,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAC3D,KAAK,CAAC,EAAE,CACN,KAAK,EAAE,iBAAiB,KACrB,OAAO,CAAC;IAEb,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;IAE9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,qBAAa,qBAAsB,SAAQ,SAAS;cAK7B,MAAM,EAAE,kBAAkB;IAJ/C,IAAI,SAAkB;IACtB,MAAM,EAAG,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBAGzB,MAAM,EAAE,kBAAkB;IAKtC,qBAAqB,IAAI,MAAM,EAAE;CAK3C"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Extension } from '../../editor/src/mod.js';
|
|
2
|
-
import { AutocompletePlugin } from './AutocompletePlugin.js';
|
|
3
|
-
export class ExtensionAutocomplete extends Extension {
|
|
4
|
-
constructor(config) {
|
|
5
|
-
super(config);
|
|
6
|
-
Object.defineProperty(this, "config", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: config
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(this, "name", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: 'autocomplete'
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(this, "plugin", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true,
|
|
22
|
-
value: void 0
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
getProseMirrorPlugins() {
|
|
26
|
-
return [
|
|
27
|
-
new AutocompletePlugin(this.config, this.editor),
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { AutocompleteMatcher } from './types.js';
|
|
2
|
-
export declare function escapeForRegEx(string: string): string;
|
|
3
|
-
export interface MatcherConfig {
|
|
4
|
-
char?: string;
|
|
5
|
-
allowSpaces?: boolean;
|
|
6
|
-
allowToIncludeChar?: boolean;
|
|
7
|
-
allowedPrefixes?: string[] | null;
|
|
8
|
-
startOfLine?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare function createDefaultMatcher(config?: MatcherConfig): AutocompleteMatcher;
|
|
11
|
-
//# sourceMappingURL=createDefaultMatcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createDefaultMatcher.d.ts","sourceRoot":"","sources":["../../../src/extension-autocomplete/src/createDefaultMatcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,YAAY,CAAC;AAGlE,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,oBAAoB,CAClC,MAAM,GAAE,aAAkB,GACzB,mBAAmB,CA4ErB"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// source: https://stackoverflow.com/a/6969486
|
|
2
|
-
export function escapeForRegEx(string) {
|
|
3
|
-
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
4
|
-
}
|
|
5
|
-
export function createDefaultMatcher(config = {}) {
|
|
6
|
-
const char = config.char || '@';
|
|
7
|
-
const allowToIncludeChar = config.allowToIncludeChar || false;
|
|
8
|
-
const allowedPrefixes = config.allowedPrefixes || [' '];
|
|
9
|
-
const startOfLine = config.startOfLine || false;
|
|
10
|
-
return ($position) => {
|
|
11
|
-
const allowSpaces = config.allowSpaces && !allowToIncludeChar;
|
|
12
|
-
const escapedChar = escapeForRegEx(char);
|
|
13
|
-
const suffix = new RegExp(`\\s${escapedChar}$`);
|
|
14
|
-
const prefix = startOfLine ? '^' : '';
|
|
15
|
-
const finalEscapedChar = allowToIncludeChar ? '' : escapedChar;
|
|
16
|
-
const regexp = allowSpaces
|
|
17
|
-
? new RegExp(`${prefix}${escapedChar}.*?(?=\\s${finalEscapedChar}|$)`, 'gm')
|
|
18
|
-
: new RegExp(`${prefix}(?:^)?${escapedChar}[^\\s${finalEscapedChar}]*`, 'gm');
|
|
19
|
-
const text = $position.nodeBefore?.isText && $position.nodeBefore.text;
|
|
20
|
-
if (!text) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
const textFrom = $position.pos - text.length;
|
|
24
|
-
const match = Array.from(text.matchAll(regexp)).pop();
|
|
25
|
-
if (!match || match.input === undefined || match.index === undefined) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
// JavaScript doesn't have lookbehinds. This hacks a check that first character
|
|
29
|
-
// is a space or the start of the line
|
|
30
|
-
const matchPrefix = match.input.slice(Math.max(0, match.index - 1), match.index);
|
|
31
|
-
const matchPrefixIsAllowed = new RegExp(`^[${allowedPrefixes?.join('')}\0]?$`)
|
|
32
|
-
.test(matchPrefix);
|
|
33
|
-
if (allowedPrefixes !== null && !matchPrefixIsAllowed) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
// The absolute position of the match in the document
|
|
37
|
-
const from = textFrom + match.index;
|
|
38
|
-
let to = from + match[0].length;
|
|
39
|
-
// Edge case handling; if spaces are allowed and we're directly in between
|
|
40
|
-
// two triggers
|
|
41
|
-
if (allowSpaces && suffix.test(text.slice(to - 1, to + 1))) {
|
|
42
|
-
match[0] += ' ';
|
|
43
|
-
to += 1;
|
|
44
|
-
}
|
|
45
|
-
// If the $position is located within the matched substring, return that range
|
|
46
|
-
if (from < $position.pos && to >= $position.pos) {
|
|
47
|
-
return {
|
|
48
|
-
range: {
|
|
49
|
-
from,
|
|
50
|
-
to,
|
|
51
|
-
},
|
|
52
|
-
query: match[0],
|
|
53
|
-
text: match[0],
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createRegexMatcher.d.ts","sourceRoot":"","sources":["../../../src/extension-autocomplete/src/createRegexMatcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAmB,MAAM,YAAY,CAAC;AAElE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,UASxD;AAqBD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EAAE,GAChB,mBAAmB,CAmCrB"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
export function ensureAnchor(expr, start) {
|
|
2
|
-
let { source } = expr;
|
|
3
|
-
let addStart = start && source[0] != '^', addEnd = source[source.length - 1] != '$';
|
|
4
|
-
if (!addStart && !addEnd)
|
|
5
|
-
return expr;
|
|
6
|
-
return new RegExp(`${addStart ? '^' : ''}(?:${source})${addEnd ? '$' : ''}`, expr.flags ?? (expr.ignoreCase ? 'i' : ''));
|
|
7
|
-
}
|
|
8
|
-
function matchBefore($position, expr) {
|
|
9
|
-
const text = $position.nodeBefore?.isText && $position.nodeBefore.text;
|
|
10
|
-
if (!text) {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
const textFrom = $position.pos - text.length;
|
|
14
|
-
const start = Math.max(textFrom, $position.pos - 250);
|
|
15
|
-
const str = text.slice();
|
|
16
|
-
const found = str.search(ensureAnchor(expr, false));
|
|
17
|
-
return found < 0
|
|
18
|
-
? null
|
|
19
|
-
: { from: start + found, to: $position.pos, text: str.slice(found) };
|
|
20
|
-
}
|
|
21
|
-
export function createRegexMatcher(regexes) {
|
|
22
|
-
return ($position) => {
|
|
23
|
-
const text = $position.nodeBefore?.isText && $position.nodeBefore.text;
|
|
24
|
-
if (!text) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const textFrom = $position.pos - text.length;
|
|
28
|
-
const matches = regexes.map((regex) => matchBefore($position, regex))
|
|
29
|
-
.filter((m) => !!m);
|
|
30
|
-
if (matches.length === 0) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
matches.sort((a, b) => b.text.length - a.text.length);
|
|
34
|
-
let from = matches[0].from;
|
|
35
|
-
let matchedText = matches[0].text;
|
|
36
|
-
let to = matches[0].to;
|
|
37
|
-
while (matchedText.match(/^\s/)) {
|
|
38
|
-
matchedText = matchedText.substring(1);
|
|
39
|
-
from++;
|
|
40
|
-
}
|
|
41
|
-
return {
|
|
42
|
-
range: {
|
|
43
|
-
from,
|
|
44
|
-
to,
|
|
45
|
-
},
|
|
46
|
-
query: matchedText,
|
|
47
|
-
text: matchedText,
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/extension-autocomplete/src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ResolvedPos } from 'prosemirror-model';
|
|
2
|
-
import type { TextRange } from '../../editor/src/mod.js';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
export type SuggestionMatch = {
|
|
5
|
-
range: TextRange;
|
|
6
|
-
query: string;
|
|
7
|
-
text: string;
|
|
8
|
-
} | null;
|
|
9
|
-
export type AutocompleteMatcher = (pos: ResolvedPos) => SuggestionMatch;
|
|
10
|
-
export interface SuggestionKeyDownProps {
|
|
11
|
-
view: EditorView;
|
|
12
|
-
event: KeyboardEvent;
|
|
13
|
-
range: TextRange;
|
|
14
|
-
}
|
|
15
|
-
export interface AutocompleteRenderer<I = any, TSelected = any> {
|
|
16
|
-
onBeforeStart?: (props: SuggestionProps<I, TSelected>) => void;
|
|
17
|
-
onStart?: (props: SuggestionProps<I, TSelected>) => void;
|
|
18
|
-
onBeforeUpdate?: (props: SuggestionProps<I, TSelected>) => void;
|
|
19
|
-
onUpdate?: (props: SuggestionProps<I, TSelected>) => void;
|
|
20
|
-
onExit?: (props: SuggestionProps<I, TSelected>) => void;
|
|
21
|
-
onKeyDown?: (props: SuggestionKeyDownProps) => boolean;
|
|
22
|
-
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
23
|
-
removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;
|
|
24
|
-
}
|
|
25
|
-
export interface SuggestionProps<I = any, TSelected = any> {
|
|
26
|
-
/**
|
|
27
|
-
* The range of the suggestion.
|
|
28
|
-
*/
|
|
29
|
-
range: TextRange;
|
|
30
|
-
/**
|
|
31
|
-
* The current suggestion query.
|
|
32
|
-
*/
|
|
33
|
-
query: string;
|
|
34
|
-
/**
|
|
35
|
-
* The current suggestion text.
|
|
36
|
-
*/
|
|
37
|
-
text: string;
|
|
38
|
-
/**
|
|
39
|
-
* The suggestion items array.
|
|
40
|
-
*/
|
|
41
|
-
items: I[];
|
|
42
|
-
/**
|
|
43
|
-
* A function that is called when a suggestion is selected.
|
|
44
|
-
* @param props The props object.
|
|
45
|
-
* @returns void
|
|
46
|
-
*/
|
|
47
|
-
command: (props: TSelected) => void;
|
|
48
|
-
/**
|
|
49
|
-
* The decoration node HTML element
|
|
50
|
-
* @default null
|
|
51
|
-
*/
|
|
52
|
-
decorationNode: Element | null;
|
|
53
|
-
/**
|
|
54
|
-
* The function that returns the client rect
|
|
55
|
-
* @default null
|
|
56
|
-
* @example () => new DOMRect(0, 0, 0, 0)
|
|
57
|
-
*/
|
|
58
|
-
clientRect?: (() => DOMRect | null) | null;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/extension-autocomplete/src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,IAAI,CAAC;AAET,MAAM,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,eAAe,CAAC;AAExE,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAAE,SAAS,GAAG,GAAG;IAC5D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,IAAI,CAAC;IACxD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,OAAO,CAAC;IAEvD,gBAAgB,CACd,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,EAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,uBAAuB,GAC1C,IAAI,CAAC;IACR,mBAAmB,CACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,kCAAkC,GAAG,IAAI,EACnD,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,GACvC,IAAI,CAAC;CACT;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,SAAS,GAAG,GAAG;IACvD;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,CAAC;IAEX;;;;OAIG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IAEpC;;;OAGG;IACH,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;CAC5C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Fragment, Node, type ParseOptions, Schema } from 'prosemirror-model';
|
|
2
|
-
import { type Converter, type CoreEditor, Extension } from '../../editor/src/mod.js';
|
|
3
|
-
export type CreateNodeFromContentOptions = {
|
|
4
|
-
parseOptions?: ParseOptions;
|
|
5
|
-
errorOnInvalidContent?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
|
|
8
|
-
export declare function elementFromString(value: string): HTMLElement;
|
|
9
|
-
export declare function createNodeFromHTML(content: string, schema: Schema, options?: CreateNodeFromContentOptions): Node;
|
|
10
|
-
export declare function createFragmentFromHTML(content: string, schema: Schema, options?: CreateNodeFromContentOptions): Fragment;
|
|
11
|
-
export declare class ExtensionHtml extends Extension {
|
|
12
|
-
name: string;
|
|
13
|
-
getConverters(editor: CoreEditor, schema: Schema): Record<string, Converter>;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=ExtensionHtml.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionHtml.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/ExtensionHtml.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,QAAQ,EACR,IAAI,EACJ,KAAK,YAAY,EACjB,MAAM,EACP,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAErF,MAAM,MAAM,4BAA4B,GAAG;IACzC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAaR;AAqBD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,CAQ5D;AA+BD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,IAAI,CAgBN;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,4BAA4B,GACrC,QAAQ,CAiBV;AAED,qBAAa,aAAc,SAAQ,SAAS;IAC1C,IAAI,SAAU;IAEL,aAAa,CACpB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC;CAe7B"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { DOMParser, DOMSerializer, Schema, } from 'prosemirror-model';
|
|
2
|
-
import { Extension } from '../../editor/src/mod.js';
|
|
3
|
-
export function getHTMLFromFragment(fragment, schema) {
|
|
4
|
-
const document = globalThis.document;
|
|
5
|
-
const documentFragment = DOMSerializer.fromSchema(schema).serializeFragment(fragment, { document });
|
|
6
|
-
const temporaryDocument = document.implementation.createHTMLDocument();
|
|
7
|
-
const container = temporaryDocument.createElement('div');
|
|
8
|
-
container.appendChild(documentFragment);
|
|
9
|
-
return container.innerHTML;
|
|
10
|
-
}
|
|
11
|
-
const removeWhitespaces = (node) => {
|
|
12
|
-
const children = node.childNodes;
|
|
13
|
-
for (let i = children.length - 1; i >= 0; i -= 1) {
|
|
14
|
-
const child = children[i];
|
|
15
|
-
if (child.nodeType === 3 && child.nodeValue &&
|
|
16
|
-
/^(\n\s\s|\n)$/.test(child.nodeValue)) {
|
|
17
|
-
node.removeChild(child);
|
|
18
|
-
}
|
|
19
|
-
else if (child.nodeType === 1) {
|
|
20
|
-
removeWhitespaces(child);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return node;
|
|
24
|
-
};
|
|
25
|
-
export function elementFromString(value) {
|
|
26
|
-
// add a wrapper to preserve leading and trailing whitespace
|
|
27
|
-
const wrappedValue = `<body>${value}</body>`;
|
|
28
|
-
const html = new globalThis.DOMParser().parseFromString(wrappedValue, 'text/html').body;
|
|
29
|
-
return removeWhitespaces(html);
|
|
30
|
-
}
|
|
31
|
-
function prepareContentCheckSchema(schema) {
|
|
32
|
-
const contentCheckSchema = new Schema({
|
|
33
|
-
topNode: schema.spec.topNode,
|
|
34
|
-
marks: schema.spec.marks,
|
|
35
|
-
// Prosemirror's schemas are executed such that: the last to execute, matches last
|
|
36
|
-
// This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
|
|
37
|
-
nodes: schema.spec.nodes.append({
|
|
38
|
-
__unknown__catch__all__node: {
|
|
39
|
-
content: 'inline*',
|
|
40
|
-
group: 'block',
|
|
41
|
-
parseDOM: [
|
|
42
|
-
{
|
|
43
|
-
tag: '*',
|
|
44
|
-
getAttrs: (e) => {
|
|
45
|
-
// Try to stringify the element for a more helpful error message
|
|
46
|
-
const invalidContent = typeof e === 'string' ? e : e.outerHTML;
|
|
47
|
-
throw new Error('Invalid HTML content', {
|
|
48
|
-
cause: new Error(`Invalid element found: ${invalidContent}`),
|
|
49
|
-
});
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
},
|
|
54
|
-
}),
|
|
55
|
-
});
|
|
56
|
-
return contentCheckSchema;
|
|
57
|
-
}
|
|
58
|
-
export function createNodeFromHTML(content, schema, options) {
|
|
59
|
-
options = {
|
|
60
|
-
parseOptions: {},
|
|
61
|
-
...options,
|
|
62
|
-
};
|
|
63
|
-
if (options.errorOnInvalidContent) {
|
|
64
|
-
const contentCheckSchema = prepareContentCheckSchema(schema);
|
|
65
|
-
DOMParser.fromSchema(contentCheckSchema).parse(elementFromString(content), options.parseOptions);
|
|
66
|
-
}
|
|
67
|
-
const parser = DOMParser.fromSchema(schema);
|
|
68
|
-
return parser.parse(elementFromString(content), options.parseOptions);
|
|
69
|
-
}
|
|
70
|
-
export function createFragmentFromHTML(content, schema, options) {
|
|
71
|
-
options = {
|
|
72
|
-
parseOptions: {},
|
|
73
|
-
...options,
|
|
74
|
-
};
|
|
75
|
-
if (options.errorOnInvalidContent) {
|
|
76
|
-
const contentCheckSchema = prepareContentCheckSchema(schema);
|
|
77
|
-
DOMParser.fromSchema(contentCheckSchema).parseSlice(elementFromString(content), options.parseOptions);
|
|
78
|
-
}
|
|
79
|
-
const parser = DOMParser.fromSchema(schema);
|
|
80
|
-
return parser.parseSlice(elementFromString(content), options.parseOptions)
|
|
81
|
-
.content;
|
|
82
|
-
}
|
|
83
|
-
export class ExtensionHtml extends Extension {
|
|
84
|
-
constructor() {
|
|
85
|
-
super(...arguments);
|
|
86
|
-
Object.defineProperty(this, "name", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
configurable: true,
|
|
89
|
-
writable: true,
|
|
90
|
-
value: 'html'
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
getConverters(editor, schema) {
|
|
94
|
-
const config = this.config;
|
|
95
|
-
return {
|
|
96
|
-
'text/html': {
|
|
97
|
-
fromDoc: async (document) => {
|
|
98
|
-
const html = getHTMLFromFragment(document.content, editor.schema);
|
|
99
|
-
return new TextEncoder().encode(html);
|
|
100
|
-
},
|
|
101
|
-
toDoc: async (buffer) => {
|
|
102
|
-
const html = new TextDecoder().decode(buffer);
|
|
103
|
-
return createNodeFromHTML(html, editor.schema);
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { NodeSpec, NodeType } from 'prosemirror-model';
|
|
2
|
-
import { Node } from '../../editor/src/mod.js';
|
|
3
|
-
import { type InputRule } from '../../editor/src/plugins/input-rules/mod.js';
|
|
4
|
-
export declare class NodeCodeBlock extends Node {
|
|
5
|
-
name: string;
|
|
6
|
-
getNodeSpec(): NodeSpec;
|
|
7
|
-
getInputRules(type: NodeType): InputRule[];
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=NodeCodeBlock.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NodeCodeBlock.d.ts","sourceRoot":"","sources":["../../../src/extension-basic-editor/src/NodeCodeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,6CAA6C,CAAC;AAErD,qBAAa,aAAc,SAAQ,IAAI;IAC5B,IAAI,SAAgB;IAEpB,WAAW,IAAI,QAAQ;IA0CvB,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,EAAE;CAOpD"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Node } from '../../editor/src/mod.js';
|
|
2
|
-
import { textblockTypeInputRule, } from '../../editor/src/plugins/input-rules/mod.js';
|
|
3
|
-
export class NodeCodeBlock extends Node {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments);
|
|
6
|
-
Object.defineProperty(this, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'code_block'
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
getNodeSpec() {
|
|
14
|
-
// const langs = this.config.languageWhitelist || LANGS;
|
|
15
|
-
return {
|
|
16
|
-
content: 'text*',
|
|
17
|
-
marks: '',
|
|
18
|
-
group: 'block',
|
|
19
|
-
code: true,
|
|
20
|
-
defining: true,
|
|
21
|
-
parseDOM: [
|
|
22
|
-
{
|
|
23
|
-
tag: 'pre',
|
|
24
|
-
preserveWhitespace: 'full',
|
|
25
|
-
getAttrs(dom) {
|
|
26
|
-
let lang = dom.getAttribute('lang');
|
|
27
|
-
// if (!lang) {
|
|
28
|
-
// for (const className of dom.classList) {
|
|
29
|
-
// if (
|
|
30
|
-
// className.startsWith('lang-') &&
|
|
31
|
-
// langs.indexOf(className.substring('lang-'.length)) > -1
|
|
32
|
-
// ) {
|
|
33
|
-
// lang = className.substring('lang-'.length);
|
|
34
|
-
// break;
|
|
35
|
-
// }
|
|
36
|
-
// }
|
|
37
|
-
// }
|
|
38
|
-
return {
|
|
39
|
-
lang,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
attrs: { lang: { default: null } },
|
|
45
|
-
toDOM(node) {
|
|
46
|
-
const { lang } = node.attrs;
|
|
47
|
-
return ['pre', { lang }, ['code', 0]];
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
getInputRules(type) {
|
|
52
|
-
/// Given a code block node type, returns an input rule that turns a
|
|
53
|
-
/// textblock starting with three backticks into a code block.
|
|
54
|
-
return [
|
|
55
|
-
textblockTypeInputRule(/^```$/, type),
|
|
56
|
-
];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Plugin } from 'prosemirror-state';
|
|
2
|
-
import { Extension } from '../../../editor/src/mod.js';
|
|
3
|
-
type Color = string;
|
|
4
|
-
export interface SelectionState {
|
|
5
|
-
clientId: number;
|
|
6
|
-
user: {
|
|
7
|
-
name: string;
|
|
8
|
-
color: Color;
|
|
9
|
-
colorLight: Color;
|
|
10
|
-
};
|
|
11
|
-
cursor?: {
|
|
12
|
-
anchor: number;
|
|
13
|
-
head: number;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export { remoteSelectionPluginKey } from './remoteSelectionPlugin.js';
|
|
17
|
-
export declare class ExtensionRemoteSelection extends Extension {
|
|
18
|
-
name: string;
|
|
19
|
-
private remoteStates;
|
|
20
|
-
getProseMirrorPlugins(): Plugin[];
|
|
21
|
-
getRemoteStates(): SelectionState[];
|
|
22
|
-
setRemoteStates(states: SelectionState[]): void;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=ExtensionRemoteSelection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExtensionRemoteSelection.d.ts","sourceRoot":"","sources":["../../../../src/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAmB,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAIxE,KAAK,KAAK,GAAG,MAAM,CAAC;AAEpB,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,KAAK,CAAC;QACb,UAAU,EAAE,KAAK,CAAC;KACnB,CAAC;IACF,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,qBAAa,wBAAyB,SAAQ,SAAS;IAC5C,IAAI,SAAsB;IAEnC,OAAO,CAAC,YAAY,CAAwB;IAEnC,qBAAqB,IAAI,MAAM,EAAE;IAM1C,eAAe,IAAI,cAAc,EAAE;IAInC,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE;CAOzC"}
|