@kerebron/extension-yjs 0.4.5 → 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.
Files changed (270) hide show
  1. package/README.md +50 -128
  2. package/esm/{extension-yjs/src/ExtensionYjs.d.ts → ExtensionYjs.d.ts} +2 -3
  3. package/esm/ExtensionYjs.d.ts.map +1 -0
  4. package/esm/{extension-yjs/src/ExtensionYjs.js → ExtensionYjs.js} +1 -2
  5. package/esm/convertUtils.d.ts.map +1 -0
  6. package/esm/keys.d.ts.map +1 -0
  7. package/esm/lib.d.ts.map +1 -0
  8. package/esm/{extension-yjs/src/userColors.d.ts → userColors.d.ts} +0 -1
  9. package/esm/userColors.d.ts.map +1 -0
  10. package/esm/{extension-yjs/src/userColors.js → userColors.js} +0 -1
  11. package/esm/utils.d.ts.map +1 -0
  12. package/esm/{extension-yjs/src/yPositionPlugin.d.ts → yPositionPlugin.d.ts} +1 -1
  13. package/esm/yPositionPlugin.d.ts.map +1 -0
  14. package/esm/{extension-yjs/src/yPositionPlugin.js → yPositionPlugin.js} +1 -1
  15. package/esm/ySyncPlugin.d.ts.map +1 -0
  16. package/esm/{extension-yjs/src/ySyncPlugin.js → ySyncPlugin.js} +1 -1
  17. package/esm/yUndoPlugin.d.ts.map +1 -0
  18. package/package.json +8 -10
  19. package/assets/collaboration-status.css +0 -172
  20. package/esm/_dnt.polyfills.d.ts +0 -101
  21. package/esm/_dnt.polyfills.d.ts.map +0 -1
  22. package/esm/_dnt.polyfills.js +0 -127
  23. package/esm/_dnt.shims.d.ts +0 -2
  24. package/esm/_dnt.shims.d.ts.map +0 -1
  25. package/esm/_dnt.shims.js +0 -57
  26. package/esm/editor/src/CoreEditor.d.ts +0 -40
  27. package/esm/editor/src/CoreEditor.d.ts.map +0 -1
  28. package/esm/editor/src/CoreEditor.js +0 -252
  29. package/esm/editor/src/DummyEditorView.d.ts +0 -60
  30. package/esm/editor/src/DummyEditorView.d.ts.map +0 -1
  31. package/esm/editor/src/DummyEditorView.js +0 -277
  32. package/esm/editor/src/Extension.d.ts +0 -31
  33. package/esm/editor/src/Extension.d.ts.map +0 -1
  34. package/esm/editor/src/Extension.js +0 -53
  35. package/esm/editor/src/ExtensionManager.d.ts +0 -32
  36. package/esm/editor/src/ExtensionManager.d.ts.map +0 -1
  37. package/esm/editor/src/ExtensionManager.js +0 -260
  38. package/esm/editor/src/Mark.d.ts +0 -23
  39. package/esm/editor/src/Mark.d.ts.map +0 -1
  40. package/esm/editor/src/Mark.js +0 -51
  41. package/esm/editor/src/Node.d.ts +0 -32
  42. package/esm/editor/src/Node.d.ts.map +0 -1
  43. package/esm/editor/src/Node.js +0 -60
  44. package/esm/editor/src/commands/CommandManager.d.ts +0 -23
  45. package/esm/editor/src/commands/CommandManager.d.ts.map +0 -1
  46. package/esm/editor/src/commands/CommandManager.js +0 -118
  47. package/esm/editor/src/commands/baseCommandFactories.d.ts +0 -3
  48. package/esm/editor/src/commands/baseCommandFactories.d.ts.map +0 -1
  49. package/esm/editor/src/commands/baseCommandFactories.js +0 -836
  50. package/esm/editor/src/commands/createChainableState.d.ts +0 -3
  51. package/esm/editor/src/commands/createChainableState.d.ts.map +0 -1
  52. package/esm/editor/src/commands/createChainableState.js +0 -29
  53. package/esm/editor/src/commands/keyCommandFactories.d.ts +0 -3
  54. package/esm/editor/src/commands/keyCommandFactories.d.ts.map +0 -1
  55. package/esm/editor/src/commands/keyCommandFactories.js +0 -10
  56. package/esm/editor/src/commands/mod.d.ts +0 -7
  57. package/esm/editor/src/commands/mod.d.ts.map +0 -1
  58. package/esm/editor/src/commands/mod.js +0 -76
  59. package/esm/editor/src/commands/replaceCommandFactories.d.ts +0 -3
  60. package/esm/editor/src/commands/replaceCommandFactories.d.ts.map +0 -1
  61. package/esm/editor/src/commands/replaceCommandFactories.js +0 -94
  62. package/esm/editor/src/commands/types.d.ts +0 -18
  63. package/esm/editor/src/commands/types.d.ts.map +0 -1
  64. package/esm/editor/src/commands/types.js +0 -1
  65. package/esm/editor/src/mod.d.ts +0 -9
  66. package/esm/editor/src/mod.d.ts.map +0 -1
  67. package/esm/editor/src/mod.js +0 -8
  68. package/esm/editor/src/nodeToTreeString.d.ts +0 -10
  69. package/esm/editor/src/nodeToTreeString.d.ts.map +0 -1
  70. package/esm/editor/src/nodeToTreeString.js +0 -74
  71. package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts +0 -6
  72. package/esm/editor/src/plugins/TrackSelecionPlugin.d.ts.map +0 -1
  73. package/esm/editor/src/plugins/TrackSelecionPlugin.js +0 -24
  74. package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts +0 -23
  75. package/esm/editor/src/plugins/input-rules/InputRulesPlugin.d.ts.map +0 -1
  76. package/esm/editor/src/plugins/input-rules/InputRulesPlugin.js +0 -163
  77. package/esm/editor/src/plugins/keymap/keymap.d.ts +0 -11
  78. package/esm/editor/src/plugins/keymap/keymap.d.ts.map +0 -1
  79. package/esm/editor/src/plugins/keymap/keymap.js +0 -125
  80. package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts +0 -4
  81. package/esm/editor/src/plugins/keymap/w3c-keyname.d.ts.map +0 -1
  82. package/esm/editor/src/plugins/keymap/w3c-keyname.js +0 -124
  83. package/esm/editor/src/types.d.ts +0 -52
  84. package/esm/editor/src/types.d.ts.map +0 -1
  85. package/esm/editor/src/types.js +0 -1
  86. package/esm/editor/src/ui.d.ts +0 -15
  87. package/esm/editor/src/ui.d.ts.map +0 -1
  88. package/esm/editor/src/ui.js +0 -16
  89. package/esm/editor/src/utilities/SmartOutput.d.ts +0 -41
  90. package/esm/editor/src/utilities/SmartOutput.d.ts.map +0 -1
  91. package/esm/editor/src/utilities/SmartOutput.js +0 -228
  92. package/esm/editor/src/utilities/createNodeFromContent.d.ts +0 -9
  93. package/esm/editor/src/utilities/createNodeFromContent.d.ts.map +0 -1
  94. package/esm/editor/src/utilities/createNodeFromContent.js +0 -32
  95. package/esm/editor/src/utilities/getHtmlAttributes.d.ts +0 -9
  96. package/esm/editor/src/utilities/getHtmlAttributes.d.ts.map +0 -1
  97. package/esm/editor/src/utilities/getHtmlAttributes.js +0 -47
  98. package/esm/editor/src/utilities/getShadowRoot.d.ts +0 -2
  99. package/esm/editor/src/utilities/getShadowRoot.d.ts.map +0 -1
  100. package/esm/editor/src/utilities/getShadowRoot.js +0 -16
  101. package/esm/editor/src/utilities/mod.d.ts +0 -6
  102. package/esm/editor/src/utilities/mod.d.ts.map +0 -1
  103. package/esm/editor/src/utilities/mod.js +0 -5
  104. package/esm/editor/src/utilities/toRawTextResult.d.ts +0 -3
  105. package/esm/editor/src/utilities/toRawTextResult.d.ts.map +0 -1
  106. package/esm/editor/src/utilities/toRawTextResult.js +0 -21
  107. package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts +0 -8
  108. package/esm/extension-autocomplete/src/AutocompletePlugin.d.ts.map +0 -1
  109. package/esm/extension-autocomplete/src/AutocompletePlugin.js +0 -232
  110. package/esm/extension-autocomplete/src/DefaultRenderer.d.ts +0 -17
  111. package/esm/extension-autocomplete/src/DefaultRenderer.d.ts.map +0 -1
  112. package/esm/extension-autocomplete/src/DefaultRenderer.js +0 -137
  113. package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts +0 -26
  114. package/esm/extension-autocomplete/src/ExtensionAutocomplete.d.ts.map +0 -1
  115. package/esm/extension-autocomplete/src/ExtensionAutocomplete.js +0 -30
  116. package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts +0 -11
  117. package/esm/extension-autocomplete/src/createDefaultMatcher.d.ts.map +0 -1
  118. package/esm/extension-autocomplete/src/createDefaultMatcher.js +0 -58
  119. package/esm/extension-autocomplete/src/createRegexMatcher.d.ts +0 -4
  120. package/esm/extension-autocomplete/src/createRegexMatcher.d.ts.map +0 -1
  121. package/esm/extension-autocomplete/src/createRegexMatcher.js +0 -50
  122. package/esm/extension-autocomplete/src/mod.d.ts +0 -3
  123. package/esm/extension-autocomplete/src/mod.d.ts.map +0 -1
  124. package/esm/extension-autocomplete/src/mod.js +0 -2
  125. package/esm/extension-autocomplete/src/types.d.ts +0 -60
  126. package/esm/extension-autocomplete/src/types.d.ts.map +0 -1
  127. package/esm/extension-autocomplete/src/types.js +0 -1
  128. package/esm/extension-basic-editor/src/ExtensionHtml.d.ts +0 -15
  129. package/esm/extension-basic-editor/src/ExtensionHtml.d.ts.map +0 -1
  130. package/esm/extension-basic-editor/src/ExtensionHtml.js +0 -108
  131. package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.d.ts +0 -24
  132. package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.d.ts.map +0 -1
  133. package/esm/extension-basic-editor/src/remote-selection/ExtensionRemoteSelection.js +0 -35
  134. package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.d.ts +0 -25
  135. package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.d.ts.map +0 -1
  136. package/esm/extension-basic-editor/src/remote-selection/remoteSelectionPlugin.js +0 -96
  137. package/esm/extension-lsp/src/DiagnosticPlugin.d.ts +0 -32
  138. package/esm/extension-lsp/src/DiagnosticPlugin.d.ts.map +0 -1
  139. package/esm/extension-lsp/src/DiagnosticPlugin.js +0 -131
  140. package/esm/extension-lsp/src/ExtensionLsp.d.ts +0 -25
  141. package/esm/extension-lsp/src/ExtensionLsp.d.ts.map +0 -1
  142. package/esm/extension-lsp/src/ExtensionLsp.js +0 -126
  143. package/esm/extension-lsp/src/LSPClient.d.ts +0 -56
  144. package/esm/extension-lsp/src/LSPClient.d.ts.map +0 -1
  145. package/esm/extension-lsp/src/LSPClient.js +0 -449
  146. package/esm/extension-lsp/src/LspStatus.d.ts +0 -34
  147. package/esm/extension-lsp/src/LspStatus.d.ts.map +0 -1
  148. package/esm/extension-lsp/src/LspStatus.js +0 -127
  149. package/esm/extension-lsp/src/computeIncrementalChanges.d.ts +0 -8
  150. package/esm/extension-lsp/src/computeIncrementalChanges.d.ts.map +0 -1
  151. package/esm/extension-lsp/src/computeIncrementalChanges.js +0 -82
  152. package/esm/extension-lsp/src/createLspAutocomplete.d.ts +0 -23
  153. package/esm/extension-lsp/src/createLspAutocomplete.d.ts.map +0 -1
  154. package/esm/extension-lsp/src/createLspAutocomplete.js +0 -68
  155. package/esm/extension-lsp/src/workspace.d.ts +0 -62
  156. package/esm/extension-lsp/src/workspace.d.ts.map +0 -1
  157. package/esm/extension-lsp/src/workspace.js +0 -168
  158. package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts +0 -36
  159. package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.d.ts.map +0 -1
  160. package/esm/extension-markdown/src/DocumentMarkdownInlineTokenizer.js +0 -240
  161. package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts +0 -26
  162. package/esm/extension-markdown/src/DocumentMarkdownTokenizer.d.ts.map +0 -1
  163. package/esm/extension-markdown/src/DocumentMarkdownTokenizer.js +0 -115
  164. package/esm/extension-markdown/src/ExtensionMarkdown.d.ts +0 -22
  165. package/esm/extension-markdown/src/ExtensionMarkdown.d.ts.map +0 -1
  166. package/esm/extension-markdown/src/ExtensionMarkdown.js +0 -48
  167. package/esm/extension-markdown/src/MarkdownParser.d.ts +0 -61
  168. package/esm/extension-markdown/src/MarkdownParser.d.ts.map +0 -1
  169. package/esm/extension-markdown/src/MarkdownParser.js +0 -249
  170. package/esm/extension-markdown/src/MarkdownSerializer.d.ts +0 -42
  171. package/esm/extension-markdown/src/MarkdownSerializer.d.ts.map +0 -1
  172. package/esm/extension-markdown/src/MarkdownSerializer.js +0 -325
  173. package/esm/extension-markdown/src/PositionMapper.d.ts +0 -15
  174. package/esm/extension-markdown/src/PositionMapper.d.ts.map +0 -1
  175. package/esm/extension-markdown/src/PositionMapper.js +0 -100
  176. package/esm/extension-markdown/src/TokenSource.d.ts +0 -11
  177. package/esm/extension-markdown/src/TokenSource.d.ts.map +0 -1
  178. package/esm/extension-markdown/src/TokenSource.js +0 -39
  179. package/esm/extension-markdown/src/mdToPmConverter.d.ts +0 -5
  180. package/esm/extension-markdown/src/mdToPmConverter.d.ts.map +0 -1
  181. package/esm/extension-markdown/src/mdToPmConverter.js +0 -111
  182. package/esm/extension-markdown/src/pmToMdConverter.d.ts +0 -16
  183. package/esm/extension-markdown/src/pmToMdConverter.d.ts.map +0 -1
  184. package/esm/extension-markdown/src/pmToMdConverter.js +0 -433
  185. package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts +0 -4
  186. package/esm/extension-markdown/src/token_handlers/basic_token_handlers.d.ts.map +0 -1
  187. package/esm/extension-markdown/src/token_handlers/basic_token_handlers.js +0 -151
  188. package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts +0 -3
  189. package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.d.ts.map +0 -1
  190. package/esm/extension-markdown/src/token_handlers/footnote_token_handlers.js +0 -34
  191. package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts +0 -6
  192. package/esm/extension-markdown/src/token_handlers/inline_token_handlers.d.ts.map +0 -1
  193. package/esm/extension-markdown/src/token_handlers/inline_token_handlers.js +0 -380
  194. package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts +0 -3
  195. package/esm/extension-markdown/src/token_handlers/lists_token_handlers.d.ts.map +0 -1
  196. package/esm/extension-markdown/src/token_handlers/lists_token_handlers.js +0 -323
  197. package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts +0 -9
  198. package/esm/extension-markdown/src/token_handlers/table_token_handlers.d.ts.map +0 -1
  199. package/esm/extension-markdown/src/token_handlers/table_token_handlers.js +0 -308
  200. package/esm/extension-markdown/src/treeSitterTokenizer.d.ts +0 -5
  201. package/esm/extension-markdown/src/treeSitterTokenizer.d.ts.map +0 -1
  202. package/esm/extension-markdown/src/treeSitterTokenizer.js +0 -769
  203. package/esm/extension-markdown/src/types.d.ts +0 -28
  204. package/esm/extension-markdown/src/types.d.ts.map +0 -1
  205. package/esm/extension-markdown/src/types.js +0 -131
  206. package/esm/extension-markdown/src/utils.d.ts +0 -8
  207. package/esm/extension-markdown/src/utils.d.ts.map +0 -1
  208. package/esm/extension-markdown/src/utils.js +0 -86
  209. package/esm/extension-menu/src/CustomMenuPlugin.d.ts +0 -65
  210. package/esm/extension-menu/src/CustomMenuPlugin.d.ts.map +0 -1
  211. package/esm/extension-menu/src/CustomMenuPlugin.js +0 -1186
  212. package/esm/extension-menu/src/ExtensionCustomMenu.d.ts +0 -14
  213. package/esm/extension-menu/src/ExtensionCustomMenu.d.ts.map +0 -1
  214. package/esm/extension-menu/src/ExtensionCustomMenu.js +0 -57
  215. package/esm/extension-menu/src/buildMenu.d.ts +0 -5
  216. package/esm/extension-menu/src/buildMenu.d.ts.map +0 -1
  217. package/esm/extension-menu/src/buildMenu.js +0 -331
  218. package/esm/extension-menu/src/icons.d.ts +0 -15
  219. package/esm/extension-menu/src/icons.d.ts.map +0 -1
  220. package/esm/extension-menu/src/icons.js +0 -123
  221. package/esm/extension-menu/src/menu.d.ts +0 -81
  222. package/esm/extension-menu/src/menu.d.ts.map +0 -1
  223. package/esm/extension-menu/src/menu.js +0 -350
  224. package/esm/extension-menu/src/mod.d.ts +0 -3
  225. package/esm/extension-menu/src/mod.d.ts.map +0 -1
  226. package/esm/extension-menu/src/mod.js +0 -2
  227. package/esm/extension-menu/src/prompt.d.ts +0 -36
  228. package/esm/extension-menu/src/prompt.d.ts.map +0 -1
  229. package/esm/extension-menu/src/prompt.js +0 -158
  230. package/esm/extension-yjs/src/CollaborationStatus.d.ts +0 -60
  231. package/esm/extension-yjs/src/CollaborationStatus.d.ts.map +0 -1
  232. package/esm/extension-yjs/src/CollaborationStatus.js +0 -287
  233. package/esm/extension-yjs/src/ExtensionYjs.d.ts.map +0 -1
  234. package/esm/extension-yjs/src/convertUtils.d.ts.map +0 -1
  235. package/esm/extension-yjs/src/keys.d.ts.map +0 -1
  236. package/esm/extension-yjs/src/lib.d.ts.map +0 -1
  237. package/esm/extension-yjs/src/userColors.d.ts.map +0 -1
  238. package/esm/extension-yjs/src/utils.d.ts.map +0 -1
  239. package/esm/extension-yjs/src/yPositionPlugin.d.ts.map +0 -1
  240. package/esm/extension-yjs/src/ySyncPlugin.d.ts.map +0 -1
  241. package/esm/extension-yjs/src/yUndoPlugin.d.ts.map +0 -1
  242. package/esm/tree-sitter-shim/src/main.d.ts +0 -15
  243. package/esm/tree-sitter-shim/src/main.d.ts.map +0 -1
  244. package/esm/tree-sitter-shim/src/main.js +0 -25
  245. package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts +0 -6
  246. package/esm/tree-sitter-shim/src/tree_sitter/node.d.ts.map +0 -1
  247. package/esm/tree-sitter-shim/src/tree_sitter/node.js +0 -1
  248. package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts +0 -7
  249. package/esm/tree-sitter-shim/src/tree_sitter/parser.d.ts.map +0 -1
  250. package/esm/tree-sitter-shim/src/tree_sitter/parser.js +0 -5
  251. package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts +0 -6
  252. package/esm/tree-sitter-shim/src/tree_sitter/tree.d.ts.map +0 -1
  253. package/esm/tree-sitter-shim/src/tree_sitter/tree.js +0 -1
  254. package/esm/wasm/src/mod.d.ts +0 -12
  255. package/esm/wasm/src/mod.d.ts.map +0 -1
  256. package/esm/wasm/src/mod.js +0 -48
  257. package/esm/wasm/wasm.d.ts +0 -138
  258. package/esm/wasm/wasm.d.ts.map +0 -1
  259. package/esm/wasm/wasm.js +0 -120
  260. /package/esm/{extension-yjs/src/convertUtils.d.ts → convertUtils.d.ts} +0 -0
  261. /package/esm/{extension-yjs/src/convertUtils.js → convertUtils.js} +0 -0
  262. /package/esm/{extension-yjs/src/keys.d.ts → keys.d.ts} +0 -0
  263. /package/esm/{extension-yjs/src/keys.js → keys.js} +0 -0
  264. /package/esm/{extension-yjs/src/lib.d.ts → lib.d.ts} +0 -0
  265. /package/esm/{extension-yjs/src/lib.js → lib.js} +0 -0
  266. /package/esm/{extension-yjs/src/utils.d.ts → utils.d.ts} +0 -0
  267. /package/esm/{extension-yjs/src/utils.js → utils.js} +0 -0
  268. /package/esm/{extension-yjs/src/ySyncPlugin.d.ts → ySyncPlugin.d.ts} +0 -0
  269. /package/esm/{extension-yjs/src/yUndoPlugin.d.ts → yUndoPlugin.d.ts} +0 -0
  270. /package/esm/{extension-yjs/src/yUndoPlugin.js → yUndoPlugin.js} +0 -0
@@ -1,287 +0,0 @@
1
- import "../../_dnt.polyfills.js";
2
- import { Plugin, PluginKey } from 'prosemirror-state';
3
- const CSS_PREFIX = 'kb-collab-status';
4
- /**
5
- * Plugin key for accessing collaboration status state
6
- */
7
- export const collaborationStatusPluginKey = new PluginKey('collaboration-status');
8
- /**
9
- * Creates a ProseMirror plugin that tracks collaboration status and user presence.
10
- * This plugin maintains state that can be accessed by other components.
11
- */
12
- export function collaborationStatusPlugin(awareness, options = {}) {
13
- return new Plugin({
14
- key: collaborationStatusPluginKey,
15
- state: {
16
- init() {
17
- return {
18
- status: 'connecting',
19
- users: getUsers(awareness),
20
- };
21
- },
22
- apply(tr, value) {
23
- const meta = tr.getMeta(collaborationStatusPluginKey);
24
- if (meta) {
25
- return { ...value, ...meta };
26
- }
27
- return value;
28
- },
29
- },
30
- view(editorView) {
31
- const updateUsers = () => {
32
- const users = getUsers(awareness);
33
- editorView.dispatch(editorView.state.tr.setMeta(collaborationStatusPluginKey, { users }));
34
- };
35
- awareness.on('change', updateUsers);
36
- return {
37
- destroy() {
38
- awareness.off('change', updateUsers);
39
- },
40
- };
41
- },
42
- });
43
- }
44
- function getUsers(awareness) {
45
- const users = [];
46
- awareness.getStates().forEach((state, clientId) => {
47
- if (state.user) {
48
- users.push({
49
- clientId,
50
- name: state.user.name || `User ${clientId}`,
51
- color: state.user.color || '#888888',
52
- colorLight: state.user.colorLight,
53
- });
54
- }
55
- });
56
- return users;
57
- }
58
- /**
59
- * A menu element that displays collaboration status, user count, and a dropdown of users.
60
- */
61
- export class CollaborationStatusElement {
62
- constructor(options) {
63
- Object.defineProperty(this, "awareness", {
64
- enumerable: true,
65
- configurable: true,
66
- writable: true,
67
- value: void 0
68
- });
69
- Object.defineProperty(this, "provider", {
70
- enumerable: true,
71
- configurable: true,
72
- writable: true,
73
- value: void 0
74
- });
75
- Object.defineProperty(this, "dom", {
76
- enumerable: true,
77
- configurable: true,
78
- writable: true,
79
- value: null
80
- });
81
- Object.defineProperty(this, "statusDot", {
82
- enumerable: true,
83
- configurable: true,
84
- writable: true,
85
- value: null
86
- });
87
- Object.defineProperty(this, "userCount", {
88
- enumerable: true,
89
- configurable: true,
90
- writable: true,
91
- value: null
92
- });
93
- Object.defineProperty(this, "dropdown", {
94
- enumerable: true,
95
- configurable: true,
96
- writable: true,
97
- value: null
98
- });
99
- Object.defineProperty(this, "userList", {
100
- enumerable: true,
101
- configurable: true,
102
- writable: true,
103
- value: null
104
- });
105
- Object.defineProperty(this, "isOpen", {
106
- enumerable: true,
107
- configurable: true,
108
- writable: true,
109
- value: false
110
- });
111
- Object.defineProperty(this, "status", {
112
- enumerable: true,
113
- configurable: true,
114
- writable: true,
115
- value: 'connecting'
116
- });
117
- this.awareness = options.awareness;
118
- this.provider = options.provider;
119
- }
120
- render(view) {
121
- // Create main container
122
- this.dom = document.createElement('div');
123
- this.dom.className = `${CSS_PREFIX}`;
124
- this.dom.setAttribute('role', 'button');
125
- this.dom.setAttribute('aria-haspopup', 'true');
126
- this.dom.setAttribute('aria-expanded', 'false');
127
- // Create status indicator button
128
- const button = document.createElement('button');
129
- button.type = 'button';
130
- button.className = `${CSS_PREFIX}__button`;
131
- button.title = 'Collaboration status';
132
- button.setAttribute('aria-label', 'Collaboration status');
133
- // Status dot
134
- this.statusDot = document.createElement('span');
135
- this.statusDot.className =
136
- `${CSS_PREFIX}__dot ${CSS_PREFIX}__dot--connecting`;
137
- button.appendChild(this.statusDot);
138
- // User count badge
139
- this.userCount = document.createElement('span');
140
- this.userCount.className = `${CSS_PREFIX}__count`;
141
- this.userCount.textContent = '0';
142
- button.appendChild(this.userCount);
143
- // Dropdown chevron
144
- const chevron = document.createElement('span');
145
- chevron.className = `${CSS_PREFIX}__chevron`;
146
- chevron.innerHTML =
147
- `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>`;
148
- button.appendChild(chevron);
149
- this.dom.appendChild(button);
150
- // Create dropdown
151
- this.dropdown = document.createElement('div');
152
- this.dropdown.className = `${CSS_PREFIX}__dropdown`;
153
- this.dropdown.style.display = 'none';
154
- // Dropdown header
155
- const header = document.createElement('div');
156
- header.className = `${CSS_PREFIX}__header`;
157
- header.textContent = 'Collaborators';
158
- this.dropdown.appendChild(header);
159
- // User list
160
- this.userList = document.createElement('div');
161
- this.userList.className = `${CSS_PREFIX}__users`;
162
- this.dropdown.appendChild(this.userList);
163
- this.dom.appendChild(this.dropdown);
164
- // Event handlers
165
- button.addEventListener('click', (e) => {
166
- e.preventDefault();
167
- e.stopPropagation();
168
- this.toggleDropdown();
169
- });
170
- // Close on outside click
171
- const closeHandler = (e) => {
172
- if (this.isOpen && this.dom && !this.dom.contains(e.target)) {
173
- this.closeDropdown();
174
- }
175
- };
176
- document.addEventListener('click', closeHandler);
177
- // Listen for awareness changes
178
- const awarenessChangeHandler = () => {
179
- this.updateUserList();
180
- };
181
- this.awareness.on('change', awarenessChangeHandler);
182
- // Listen for provider status changes
183
- if (this.provider && typeof this.provider.on === 'function') {
184
- this.provider.on('status', (event) => {
185
- this.setStatus(event.status);
186
- });
187
- }
188
- // Initial update
189
- this.updateUserList();
190
- const update = (_state) => {
191
- // Always visible
192
- return true;
193
- };
194
- return { dom: this.dom, update };
195
- }
196
- setStatus(status) {
197
- this.status = status;
198
- if (this.statusDot) {
199
- this.statusDot.className =
200
- `${CSS_PREFIX}__dot ${CSS_PREFIX}__dot--${status}`;
201
- }
202
- if (this.dom) {
203
- this.dom.setAttribute('data-status', status);
204
- const button = this.dom.querySelector('button');
205
- if (button) {
206
- const statusLabels = {
207
- connected: 'Connected',
208
- connecting: 'Connecting...',
209
- disconnected: 'Disconnected',
210
- };
211
- button.title = `${statusLabels[status]} - Click to see collaborators`;
212
- }
213
- }
214
- }
215
- updateUserList() {
216
- if (!this.userList || !this.userCount)
217
- return;
218
- const users = getUsers(this.awareness);
219
- const currentClientId = this.awareness.clientID;
220
- // Update count (including self)
221
- this.userCount.textContent = String(users.length);
222
- // Clear and rebuild user list
223
- this.userList.innerHTML = '';
224
- if (users.length === 0) {
225
- const emptyMessage = document.createElement('div');
226
- emptyMessage.className = `${CSS_PREFIX}__empty`;
227
- emptyMessage.textContent = 'No users connected';
228
- this.userList.appendChild(emptyMessage);
229
- return;
230
- }
231
- // Sort users: current user first, then alphabetically
232
- const sortedUsers = [...users].sort((a, b) => {
233
- if (a.clientId === currentClientId)
234
- return -1;
235
- if (b.clientId === currentClientId)
236
- return 1;
237
- return a.name.localeCompare(b.name);
238
- });
239
- sortedUsers.forEach((user) => {
240
- const userItem = document.createElement('div');
241
- userItem.className = `${CSS_PREFIX}__user`;
242
- // Color indicator
243
- const colorDot = document.createElement('span');
244
- colorDot.className = `${CSS_PREFIX}__user-color`;
245
- colorDot.style.backgroundColor = user.color;
246
- userItem.appendChild(colorDot);
247
- // User name
248
- const userName = document.createElement('span');
249
- userName.className = `${CSS_PREFIX}__user-name`;
250
- userName.textContent = user.name;
251
- userItem.appendChild(userName);
252
- // "You" badge for current user
253
- if (user.clientId === currentClientId) {
254
- const youBadge = document.createElement('span');
255
- youBadge.className = `${CSS_PREFIX}__you-badge`;
256
- youBadge.textContent = '(you)';
257
- userItem.appendChild(youBadge);
258
- }
259
- this.userList.appendChild(userItem);
260
- });
261
- }
262
- toggleDropdown() {
263
- if (this.isOpen) {
264
- this.closeDropdown();
265
- }
266
- else {
267
- this.openDropdown();
268
- }
269
- }
270
- openDropdown() {
271
- if (!this.dropdown || !this.dom)
272
- return;
273
- this.isOpen = true;
274
- this.dropdown.style.display = 'block';
275
- this.dom.setAttribute('aria-expanded', 'true');
276
- this.dom.classList.add(`${CSS_PREFIX}--open`);
277
- this.updateUserList(); // Refresh on open
278
- }
279
- closeDropdown() {
280
- if (!this.dropdown || !this.dom)
281
- return;
282
- this.isOpen = false;
283
- this.dropdown.style.display = 'none';
284
- this.dom.setAttribute('aria-expanded', 'false');
285
- this.dom.classList.remove(`${CSS_PREFIX}--open`);
286
- }
287
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExtensionYjs.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/ExtensionYjs.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kCAAkC,CAAC;AAM1C,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAAC;IAC5D,SAAS,EAAE,iBAAiB,CAAC,SAAS,CAAC;CACxC;AAED,qBAAa,YAAa,SAAQ,SAAS;IACzC,IAAI,SAAS;IAEJ,SAAS,WAAe;IACjC,QAAQ,WAAwB;IAGvB,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAOhD,oBAAoB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAOjD,qBAAqB,IAAI,MAAM,EAAE;CAY3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"convertUtils.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/convertUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,MAAM,EAAE,MAAM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AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,eAAe,CAErD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI9C;;GAEG;AACH,KAAK,kBAAkB,GAAG,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AA2BzD,eAAO,MAAM,OAAO,GAAI,MAAM,UAAU,EAAE,QAAG,EAAE,UAAK,SAYnD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC,GAC7C,KAAK,MAAM,EACX,MAAM,CAAC,CAAC,WAAW,EACnB,SAAS,kBAAkB,KAC1B,GA+FF,CAAC;AAaF,eAAO,MAAM,kCAAkC,GAC7C,MAAM,CAAC,CAAC,GAAG,EACX,cAAc,CAAC,CAAC,WAAW,EAC3B,QAAQ,GAAG,EACX,SAAS,kBAAkB,KAC1B,IAAI,GAAG,MA2DT,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"userColors.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/userColors.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,eAAO,MAAM,UAAU;;;GAStB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/utils.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,MAAM,GAAG,WAC0B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"yPositionPlugin.d.ts","sourceRoot":"","sources":["../../../src/extension-yjs/src/yPositionPlugin.ts"],"names":[],"mappings":"AACA,O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AO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,IAAI,GAAI,OAAO,WAAW,KAAG,OACmB,CAAC;AAE9D,eAAO,MAAM,IAAI,GAAI,OAAO,WAAW,KAAG,OACmB,CAAC;AAE9D,eAAO,MAAM,WAAW,EAAE,OAGT,CAAC;AAElB,eAAO,MAAM,WAAW,EAAE,OAGT,CAAC;AAElB,eAAO,MAAM,qBAAqB,aAAyB,CAAC;AAE5D,eAAO,MAAM,mBAAmB,GAC9B,MAAM,OAAO,KAAK,EAAE,IAAI,EACxB,gBAAgB,GAAG,CAAC,MAAM,CAAC,KAC1B,OAM8B,CAAC;AAElC,eAAO,MAAM,WAAW,GAAI,mDAIzB;IACD,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;CAC3C,gBAuEF,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * Compatibility shim for deno_tree_sitter -> web-tree-sitter
3
- * This provides the same createParser API that deno_tree_sitter exports
4
- */
5
- import Parser from 'web-tree-sitter';
6
- /**
7
- * Creates a tree-sitter parser from WASM binary data.
8
- * Compatible with deno_tree_sitter's createParser API.
9
- *
10
- * @param wasmBinary - The WASM binary data (Uint8Array or ArrayBuffer)
11
- * @returns A configured Parser instance with the language set
12
- */
13
- export declare function createParser(wasmBinary: Uint8Array | ArrayBuffer): Promise<Parser>;
14
- export { Parser };
15
- //# sourceMappingURL=main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/tree-sitter-shim/src/main.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,UAAU,GAAG,WAAW,GACnC,OAAO,CAAC,MAAM,CAAC,CAWjB;AAGD,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Compatibility shim for deno_tree_sitter -> web-tree-sitter
3
- * This provides the same createParser API that deno_tree_sitter exports
4
- */
5
- import Parser from 'web-tree-sitter';
6
- let initialized = false;
7
- /**
8
- * Creates a tree-sitter parser from WASM binary data.
9
- * Compatible with deno_tree_sitter's createParser API.
10
- *
11
- * @param wasmBinary - The WASM binary data (Uint8Array or ArrayBuffer)
12
- * @returns A configured Parser instance with the language set
13
- */
14
- export async function createParser(wasmBinary) {
15
- if (!initialized) {
16
- await Parser.init();
17
- initialized = true;
18
- }
19
- const parser = new Parser();
20
- const language = await Parser.Language.load(wasmBinary);
21
- parser.setLanguage(language);
22
- return parser;
23
- }
24
- // Re-export other items from main.js for compatibility
25
- export { Parser };
@@ -1,6 +0,0 @@
1
- /**
2
- * Compatibility shim for deno_tree_sitter Node type -> web-tree-sitter
3
- */
4
- import type Parser from 'web-tree-sitter';
5
- export type Node = Parser.SyntaxNode;
6
- //# sourceMappingURL=node.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../src/tree-sitter-shim/src/tree_sitter/node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- /**
2
- * Compatibility shim for deno_tree_sitter parser types -> web-tree-sitter
3
- */
4
- import Parser from 'web-tree-sitter';
5
- export { Parser };
6
- export type { Parser };
7
- //# sourceMappingURL=parser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/tree-sitter-shim/src/tree_sitter/parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB,YAAY,EAAE,MAAM,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Compatibility shim for deno_tree_sitter parser types -> web-tree-sitter
3
- */
4
- import Parser from 'web-tree-sitter';
5
- export { Parser };
@@ -1,6 +0,0 @@
1
- /**
2
- * Compatibility shim for deno_tree_sitter Tree type -> web-tree-sitter
3
- */
4
- import type Parser from 'web-tree-sitter';
5
- export type Tree = Parser.Tree;
6
- //# sourceMappingURL=tree.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../../../src/tree-sitter-shim/src/tree_sitter/tree.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import manifest from '../wasm.js';
2
- export declare function getLangsList(): string[];
3
- export declare function getLangTreeSitter(lang: string, cdnUrl?: string): {
4
- lang: string;
5
- repo: string;
6
- files: string[];
7
- queries: any;
8
- };
9
- export declare function fetchWasm(wasmUrl: string): Promise<Uint8Array>;
10
- export declare function fetchTextResource(url: string): Promise<string>;
11
- export { manifest };
12
- //# sourceMappingURL=mod.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/wasm/src/mod.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAIlC,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAMvC;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,SAAgC;;;;;EAuBvC;AAED,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAWpE;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAapE;AAED,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,48 +0,0 @@
1
- import * as dntShim from "../../_dnt.shims.js";
2
- import manifest from '../wasm.js';
3
- const __dirname = globalThis[Symbol.for("import-meta-ponyfill-esmodule")](import.meta).dirname;
4
- export function getLangsList() {
5
- return manifest
6
- .map((item) => item.repo.split('-').pop())
7
- .filter((item) => 'string' === typeof item);
8
- }
9
- export function getLangTreeSitter(lang, cdnUrl = 'http://localhost:8000/wasm/') {
10
- const langManifest = manifest.find((item) => item.repo.endsWith('-' + lang));
11
- if (!langManifest) {
12
- throw new Error('No grammar for: ' + lang);
13
- }
14
- if (!cdnUrl.endsWith('/')) {
15
- cdnUrl += '/';
16
- }
17
- const dir = langManifest.repo.split('/')[1];
18
- cdnUrl += dir + '/';
19
- const queries = Object.entries(langManifest.queries)
20
- .map((entry) => [entry[0], cdnUrl + entry[0]]);
21
- return {
22
- lang,
23
- repo: langManifest.repo,
24
- files: langManifest.files.map((file) => cdnUrl + file),
25
- queries: Object.fromEntries(queries),
26
- };
27
- }
28
- export async function fetchWasm(wasmUrl) {
29
- if ('Deno' in dntShim.dntGlobalThis) { // Test or server-side
30
- return globalThis.Deno.readFileSync(__dirname + '/../files' + wasmUrl);
31
- }
32
- const response = await fetch(wasmUrl);
33
- if (response.status >= 400) {
34
- throw new Error(`Error fetching ${response.status}`);
35
- }
36
- return new Uint8Array(await response.arrayBuffer());
37
- }
38
- export async function fetchTextResource(url) {
39
- if ('Deno' in dntShim.dntGlobalThis) {
40
- return new TextDecoder().decode(globalThis.Deno.readFileSync(__dirname + '/../files' + url));
41
- }
42
- const responseScm = await fetch(url);
43
- if (responseScm.status >= 400) {
44
- throw new Error(`Error fetching ${responseScm.status}`);
45
- }
46
- return await responseScm.text();
47
- }
48
- export { manifest };
@@ -1,138 +0,0 @@
1
- declare const _default: ({
2
- repo: string;
3
- version: string;
4
- files: string[];
5
- queries: {
6
- "highlights.scm": string;
7
- "injections.scm": string;
8
- "highlights-inline.scm": string;
9
- "injections-inline.scm": string;
10
- "highlights-dtd.scm"?: undefined;
11
- "tags.scm"?: undefined;
12
- "locals.scm"?: undefined;
13
- "highlights-jsx.scm"?: undefined;
14
- "highlights-params.scm"?: undefined;
15
- };
16
- } | {
17
- repo: string;
18
- version: string;
19
- files: string[];
20
- queries: {
21
- "highlights.scm": string;
22
- "injections.scm"?: undefined;
23
- "highlights-inline.scm"?: undefined;
24
- "injections-inline.scm"?: undefined;
25
- "highlights-dtd.scm"?: undefined;
26
- "tags.scm"?: undefined;
27
- "locals.scm"?: undefined;
28
- "highlights-jsx.scm"?: undefined;
29
- "highlights-params.scm"?: undefined;
30
- };
31
- } | {
32
- repo: string;
33
- version: string;
34
- files: string[];
35
- queries: {
36
- "highlights.scm": string;
37
- "highlights-dtd.scm": string;
38
- "injections.scm"?: undefined;
39
- "highlights-inline.scm"?: undefined;
40
- "injections-inline.scm"?: undefined;
41
- "tags.scm"?: undefined;
42
- "locals.scm"?: undefined;
43
- "highlights-jsx.scm"?: undefined;
44
- "highlights-params.scm"?: undefined;
45
- };
46
- } | {
47
- repo: string;
48
- version: string;
49
- files: string[];
50
- queries: {
51
- "highlights.scm": string;
52
- "injections.scm": string;
53
- "highlights-inline.scm"?: undefined;
54
- "injections-inline.scm"?: undefined;
55
- "highlights-dtd.scm"?: undefined;
56
- "tags.scm"?: undefined;
57
- "locals.scm"?: undefined;
58
- "highlights-jsx.scm"?: undefined;
59
- "highlights-params.scm"?: undefined;
60
- };
61
- } | {
62
- repo: string;
63
- version: string;
64
- files: string[];
65
- queries: {
66
- "highlights.scm": string;
67
- "injections.scm": string;
68
- "tags.scm": string;
69
- "highlights-inline.scm"?: undefined;
70
- "injections-inline.scm"?: undefined;
71
- "highlights-dtd.scm"?: undefined;
72
- "locals.scm"?: undefined;
73
- "highlights-jsx.scm"?: undefined;
74
- "highlights-params.scm"?: undefined;
75
- };
76
- } | {
77
- repo: string;
78
- version: string;
79
- files: string[];
80
- queries: {
81
- "highlights.scm": string;
82
- "locals.scm": string;
83
- "tags.scm": string;
84
- "injections.scm"?: undefined;
85
- "highlights-inline.scm"?: undefined;
86
- "injections-inline.scm"?: undefined;
87
- "highlights-dtd.scm"?: undefined;
88
- "highlights-jsx.scm"?: undefined;
89
- "highlights-params.scm"?: undefined;
90
- };
91
- } | {
92
- repo: string;
93
- version: string;
94
- files: string[];
95
- queries: {
96
- "highlights.scm": string;
97
- "tags.scm": string;
98
- "injections.scm"?: undefined;
99
- "highlights-inline.scm"?: undefined;
100
- "injections-inline.scm"?: undefined;
101
- "highlights-dtd.scm"?: undefined;
102
- "locals.scm"?: undefined;
103
- "highlights-jsx.scm"?: undefined;
104
- "highlights-params.scm"?: undefined;
105
- };
106
- } | {
107
- repo: string;
108
- version: string;
109
- files: string[];
110
- queries: {
111
- "highlights.scm": string;
112
- "highlights-jsx.scm": string;
113
- "highlights-params.scm": string;
114
- "injections.scm": string;
115
- "locals.scm": string;
116
- "tags.scm": string;
117
- "highlights-inline.scm"?: undefined;
118
- "injections-inline.scm"?: undefined;
119
- "highlights-dtd.scm"?: undefined;
120
- };
121
- } | {
122
- repo: string;
123
- files: string[];
124
- queries: {
125
- "highlights.scm": string;
126
- "injections.scm"?: undefined;
127
- "highlights-inline.scm"?: undefined;
128
- "injections-inline.scm"?: undefined;
129
- "highlights-dtd.scm"?: undefined;
130
- "tags.scm"?: undefined;
131
- "locals.scm"?: undefined;
132
- "highlights-jsx.scm"?: undefined;
133
- "highlights-params.scm"?: undefined;
134
- };
135
- version?: undefined;
136
- })[];
137
- export default _default;
138
- //# sourceMappingURL=wasm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wasm.d.ts","sourceRoot":"","sources":["../../src/wasm/wasm.js"],"names":[],"mappings":""}