@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.
- package/README.md +50 -128
- package/esm/{extension-yjs/src/ExtensionYjs.d.ts → ExtensionYjs.d.ts} +2 -3
- package/esm/ExtensionYjs.d.ts.map +1 -0
- package/esm/{extension-yjs/src/ExtensionYjs.js → ExtensionYjs.js} +1 -2
- package/esm/convertUtils.d.ts.map +1 -0
- package/esm/keys.d.ts.map +1 -0
- package/esm/lib.d.ts.map +1 -0
- package/esm/{extension-yjs/src/userColors.d.ts → userColors.d.ts} +0 -1
- package/esm/userColors.d.ts.map +1 -0
- package/esm/{extension-yjs/src/userColors.js → userColors.js} +0 -1
- package/esm/utils.d.ts.map +1 -0
- package/esm/{extension-yjs/src/yPositionPlugin.d.ts → yPositionPlugin.d.ts} +1 -1
- package/esm/yPositionPlugin.d.ts.map +1 -0
- package/esm/{extension-yjs/src/yPositionPlugin.js → yPositionPlugin.js} +1 -1
- package/esm/ySyncPlugin.d.ts.map +1 -0
- package/esm/{extension-yjs/src/ySyncPlugin.js → ySyncPlugin.js} +1 -1
- package/esm/yUndoPlugin.d.ts.map +1 -0
- package/package.json +8 -10
- package/assets/collaboration-status.css +0 -172
- 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/commands/types.js +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/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/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-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/LspStatus.d.ts +0 -34
- package/esm/extension-lsp/src/LspStatus.d.ts.map +0 -1
- package/esm/extension-lsp/src/LspStatus.js +0 -127
- 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/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/extension-menu/src/CustomMenuPlugin.d.ts +0 -65
- package/esm/extension-menu/src/CustomMenuPlugin.d.ts.map +0 -1
- package/esm/extension-menu/src/CustomMenuPlugin.js +0 -1186
- package/esm/extension-menu/src/ExtensionCustomMenu.d.ts +0 -14
- package/esm/extension-menu/src/ExtensionCustomMenu.d.ts.map +0 -1
- package/esm/extension-menu/src/ExtensionCustomMenu.js +0 -57
- package/esm/extension-menu/src/buildMenu.d.ts +0 -5
- package/esm/extension-menu/src/buildMenu.d.ts.map +0 -1
- package/esm/extension-menu/src/buildMenu.js +0 -331
- package/esm/extension-menu/src/icons.d.ts +0 -15
- package/esm/extension-menu/src/icons.d.ts.map +0 -1
- package/esm/extension-menu/src/icons.js +0 -123
- package/esm/extension-menu/src/menu.d.ts +0 -81
- package/esm/extension-menu/src/menu.d.ts.map +0 -1
- package/esm/extension-menu/src/menu.js +0 -350
- package/esm/extension-menu/src/mod.d.ts +0 -3
- package/esm/extension-menu/src/mod.d.ts.map +0 -1
- package/esm/extension-menu/src/mod.js +0 -2
- package/esm/extension-menu/src/prompt.d.ts +0 -36
- package/esm/extension-menu/src/prompt.d.ts.map +0 -1
- package/esm/extension-menu/src/prompt.js +0 -158
- package/esm/extension-yjs/src/CollaborationStatus.d.ts +0 -60
- package/esm/extension-yjs/src/CollaborationStatus.d.ts.map +0 -1
- package/esm/extension-yjs/src/CollaborationStatus.js +0 -287
- package/esm/extension-yjs/src/ExtensionYjs.d.ts.map +0 -1
- package/esm/extension-yjs/src/convertUtils.d.ts.map +0 -1
- package/esm/extension-yjs/src/keys.d.ts.map +0 -1
- package/esm/extension-yjs/src/lib.d.ts.map +0 -1
- package/esm/extension-yjs/src/userColors.d.ts.map +0 -1
- package/esm/extension-yjs/src/utils.d.ts.map +0 -1
- package/esm/extension-yjs/src/yPositionPlugin.d.ts.map +0 -1
- package/esm/extension-yjs/src/ySyncPlugin.d.ts.map +0 -1
- package/esm/extension-yjs/src/yUndoPlugin.d.ts.map +0 -1
- 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-yjs/src/convertUtils.d.ts → convertUtils.d.ts} +0 -0
- /package/esm/{extension-yjs/src/convertUtils.js → convertUtils.js} +0 -0
- /package/esm/{extension-yjs/src/keys.d.ts → keys.d.ts} +0 -0
- /package/esm/{extension-yjs/src/keys.js → keys.js} +0 -0
- /package/esm/{extension-yjs/src/lib.d.ts → lib.d.ts} +0 -0
- /package/esm/{extension-yjs/src/lib.js → lib.js} +0 -0
- /package/esm/{extension-yjs/src/utils.d.ts → utils.d.ts} +0 -0
- /package/esm/{extension-yjs/src/utils.js → utils.js} +0 -0
- /package/esm/{extension-yjs/src/ySyncPlugin.d.ts → ySyncPlugin.d.ts} +0 -0
- /package/esm/{extension-yjs/src/yUndoPlugin.d.ts → yUndoPlugin.d.ts} +0 -0
- /package/esm/{extension-yjs/src/yUndoPlugin.js → yUndoPlugin.js} +0 -0
package/README.md
CHANGED
|
@@ -1,160 +1,82 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Kerebron - Prosemirror based online editor kit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Watch a Demo
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
<a href="https://youtube.com/shorts/OdJjhAPj-wA?feature=share" target="_blank">
|
|
6
|
+
<img src="https://github.com/user-attachments/assets/b63ec84a-0ed2-4f98-920c-76f6d3215168" alt="Alt Text" width="200">
|
|
7
|
+
</a>
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
- **Awareness Protocol**: See other users' cursors and selections
|
|
9
|
-
- **Collaboration Status UI**: Built-in toolbar element showing connection status and active collaborators
|
|
10
|
-
- **User Colors**: Automatic color assignment for collaborators
|
|
9
|
+
## Playground Demo
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
[playground](https://demo.kerebron.com) - be nice.
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
import { ExtensionYjs } from '@kerebron/extension-yjs';
|
|
16
|
-
import { WebsocketProvider } from 'y-websocket';
|
|
17
|
-
import * as Y from 'yjs';
|
|
18
|
-
```
|
|
13
|
+
## Overview
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Basic Setup
|
|
23
|
-
|
|
24
|
-
```typescript
|
|
25
|
-
import { Editor } from '@kerebron/editor';
|
|
26
|
-
import { ExtensionYjs } from '@kerebron/extension-yjs';
|
|
27
|
-
import { ExtensionCustomMenu } from '@kerebron/extension-menu';
|
|
28
|
-
import { WebsocketProvider } from 'y-websocket';
|
|
29
|
-
import * as Y from 'yjs';
|
|
30
|
-
|
|
31
|
-
// Create Yjs document and provider
|
|
32
|
-
const ydoc = new Y.Doc();
|
|
33
|
-
const provider = new WebsocketProvider('ws://localhost:1234', 'my-room', ydoc);
|
|
34
|
-
|
|
35
|
-
// Set user info for awareness
|
|
36
|
-
provider.awareness.setLocalStateField('user', {
|
|
37
|
-
name: 'User Name',
|
|
38
|
-
color: '#ff0000',
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
// Create editor with YJS support
|
|
42
|
-
const editor = new Editor({
|
|
43
|
-
extensions: [
|
|
44
|
-
ExtensionCustomMenu(), // Automatically shows collaboration status
|
|
45
|
-
ExtensionYjs({
|
|
46
|
-
ydoc,
|
|
47
|
-
provider,
|
|
48
|
-
type: ydoc.getXmlFragment('prosemirror'),
|
|
49
|
-
}),
|
|
50
|
-
],
|
|
51
|
-
});
|
|
52
|
-
```
|
|
15
|
+
Using vanilla Prosemirror modules is often impossible because of
|
|
16
|
+
incompatibilities.
|
|
53
17
|
|
|
54
|
-
|
|
18
|
+
Kerebron forks several prosemirror projects into one monorepo in order to keep
|
|
19
|
+
them in sync.
|
|
55
20
|
|
|
56
|
-
|
|
21
|
+
Project is inspired on https://tiptap.dev/, but instead of building wrapper
|
|
22
|
+
around a wrapper it borrows concept of extension and command manager.
|
|
57
23
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **User List**: Dropdown showing all collaborators with their names
|
|
24
|
+
It has simplified tooling (deno), fewer dependencies and resulting in lower
|
|
25
|
+
number of output npm modules.
|
|
61
26
|
|
|
62
|
-
|
|
27
|
+
**Work in progress**
|
|
63
28
|
|
|
64
|
-
The collaboration status is added automatically when both extensions are present:
|
|
65
29
|
|
|
66
|
-
|
|
67
|
-
new Editor({
|
|
68
|
-
extensions: [
|
|
69
|
-
ExtensionCustomMenu(), // Auto-detects YJS
|
|
70
|
-
ExtensionYjs({ ydoc, provider, type }),
|
|
71
|
-
],
|
|
72
|
-
});
|
|
73
|
-
```
|
|
30
|
+
## Build
|
|
74
31
|
|
|
75
|
-
|
|
32
|
+
### Build static examples and `.wasm` files
|
|
76
33
|
|
|
77
|
-
|
|
34
|
+
```sh
|
|
35
|
+
deno task build
|
|
36
|
+
```
|
|
78
37
|
|
|
79
|
-
|
|
80
|
-
import { CollaborationStatusElement } from '@kerebron/extension-yjs/CollaborationStatus';
|
|
81
|
-
import '@kerebron/extension-yjs/assets/collaboration-status.css';
|
|
38
|
+
## Development
|
|
82
39
|
|
|
83
|
-
|
|
84
|
-
awareness: provider.awareness,
|
|
85
|
-
provider: provider,
|
|
86
|
-
});
|
|
40
|
+
To start example server:
|
|
87
41
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
ExtensionCustomMenu({
|
|
91
|
-
autoAddCollaborationStatus: false,
|
|
92
|
-
trailingElements: [collabStatus],
|
|
93
|
-
}),
|
|
94
|
-
ExtensionYjs({ ydoc, provider, type }),
|
|
95
|
-
],
|
|
96
|
-
});
|
|
42
|
+
```sh
|
|
43
|
+
deno task -f server-deno-hono start
|
|
97
44
|
```
|
|
98
45
|
|
|
99
|
-
|
|
46
|
+
## Examples
|
|
100
47
|
|
|
101
|
-
|
|
48
|
+
TODO
|
|
102
49
|
|
|
103
|
-
|
|
104
|
-
new Editor({
|
|
105
|
-
extensions: [
|
|
106
|
-
ExtensionCustomMenu({ autoAddCollaborationStatus: false }),
|
|
107
|
-
ExtensionYjs({ ydoc, provider, type }),
|
|
108
|
-
],
|
|
109
|
-
});
|
|
110
|
-
```
|
|
50
|
+
### NPM packages are generated using DNT
|
|
111
51
|
|
|
112
|
-
|
|
52
|
+
- https://deno.com/blog/publish-esm-cjs-module-dnt - the easiest way to publish
|
|
53
|
+
a hybrid npm module for ESM and CommonJS
|
|
54
|
+
- https://github.com/denoland/dnt
|
|
55
|
+
- https://gaubee.com/article/Publishing-Your-Deno-Project-as-a-Monorepo-using-dnt/
|
|
113
56
|
|
|
114
|
-
|
|
115
|
-
|--------|-------------|
|
|
116
|
-
| `@kerebron/extension-yjs` | Main extension class |
|
|
117
|
-
| `@kerebron/extension-yjs/userColors` | User color utilities |
|
|
118
|
-
| `@kerebron/extension-yjs/CollaborationStatus` | Collaboration status UI element |
|
|
119
|
-
| `@kerebron/extension-yjs/assets/collaboration-status.css` | Styles for collaboration status |
|
|
57
|
+
To generate npm packages
|
|
120
58
|
|
|
121
|
-
|
|
59
|
+
```sh
|
|
60
|
+
deno -A ./build/build_npm.ts
|
|
61
|
+
```
|
|
122
62
|
|
|
123
|
-
|
|
124
|
-
|--------|------|----------|-------------|
|
|
125
|
-
| `awareness` | `Awareness` | Yes | Yjs awareness instance |
|
|
126
|
-
| `provider` | `WebsocketProvider` | Yes | WebSocket provider for connection status |
|
|
63
|
+
## Run through docker
|
|
127
64
|
|
|
128
|
-
|
|
65
|
+
```sh
|
|
66
|
+
docker build . -t editor-test
|
|
67
|
+
docker run -it -p 8000:8000 -v $PWD:/usr/src/app editor-test
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Prerequisites
|
|
129
71
|
|
|
130
|
-
|
|
72
|
+
Install deno
|
|
131
73
|
|
|
132
|
-
```
|
|
133
|
-
|
|
74
|
+
```
|
|
75
|
+
npm install -g deno
|
|
134
76
|
```
|
|
135
77
|
|
|
136
|
-
|
|
78
|
+
Install rust
|
|
137
79
|
|
|
138
|
-
```html
|
|
139
|
-
<link rel="stylesheet" href="@kerebron/extension-yjs/assets/collaboration-status.css">
|
|
140
80
|
```
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
| Class | Description |
|
|
145
|
-
|-------|-------------|
|
|
146
|
-
| `.kb-collab-status` | Main container |
|
|
147
|
-
| `.kb-collab-status__trigger` | Button that shows status and count |
|
|
148
|
-
| `.kb-collab-status__dot` | Connection status indicator |
|
|
149
|
-
| `.kb-collab-status__dot--connected` | Green dot for connected state |
|
|
150
|
-
| `.kb-collab-status__dot--disconnected` | Red dot for disconnected state |
|
|
151
|
-
| `.kb-collab-status__count` | User count badge |
|
|
152
|
-
| `.kb-collab-status__dropdown` | User list dropdown |
|
|
153
|
-
| `.kb-collab-status__user` | Individual user item |
|
|
154
|
-
| `.kb-collab-status__user--self` | Current user indicator |
|
|
155
|
-
|
|
156
|
-
## Related
|
|
157
|
-
|
|
158
|
-
- [ExtensionCustomMenu](../extension-menu/README.md) - Toolbar with auto YJS integration
|
|
159
|
-
- [Yjs Documentation](https://docs.yjs.dev/)
|
|
160
|
-
- [y-websocket](https://github.com/yjs/y-websocket)
|
|
81
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
82
|
+
```
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import "../../_dnt.polyfills.js";
|
|
2
1
|
import type { Plugin } from 'prosemirror-state';
|
|
3
2
|
import * as awarenessProtocol from 'y-protocols/awareness';
|
|
4
|
-
import { Extension } from '
|
|
5
|
-
import type { CommandFactories, CommandShortcuts } from '
|
|
3
|
+
import { Extension } from '@kerebron/editor';
|
|
4
|
+
import type { CommandFactories, CommandShortcuts } from '@kerebron/editor/commands';
|
|
6
5
|
export interface YjsProvider {
|
|
7
6
|
on(eventName: string, callback: (event: any) => void): void;
|
|
8
7
|
awareness: awarenessProtocol.Awareness;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtensionYjs.d.ts","sourceRoot":"","sources":["../src/ExtensionYjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,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,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Extension } from '../../editor/src/mod.js';
|
|
1
|
+
import { Extension } from '@kerebron/editor';
|
|
3
2
|
import { ySyncPlugin } from './ySyncPlugin.js';
|
|
4
3
|
import { yPositionPlugin } from './yPositionPlugin.js';
|
|
5
4
|
import { redo, undo, yUndoPlugin } from './yUndoPlugin.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertUtils.d.ts","sourceRoot":"","sources":["../src/convertUtils.ts"],"names":[],"mappings":"AAAA,OAA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E,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,cAAc,gBAA0B,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,SAAS,CAAC,eAAe,CAErD,CAAC"}
|
package/esm/lib.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userColors.d.ts","sourceRoot":"","sources":["../src/userColors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;GAStB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,MAAM,GAAG,WAC0B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as awarenessProtocol from 'y-protocols/awareness';
|
|
2
2
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
-
import type { CoreEditor } from '
|
|
3
|
+
import type { CoreEditor } from '@kerebron/editor';
|
|
4
4
|
export declare const yPositionPluginKey: PluginKey<any>;
|
|
5
5
|
interface PositionPluginConfig {
|
|
6
6
|
getSelection?: (arg0: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yPositionPlugin.d.ts","sourceRoot":"","sources":["../src/yPositionPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAe,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAcnD,eAAO,MAAM,kBAAkB,gBAAgC,CAAC;AAYhE,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CACnC;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,GACtC,iBAAiB,MAAM,EACvB,cAAc,MAAM,EACpB,OAAO,GAAG,KACT,OAA2C,CAAC;AAE/C,eAAO,MAAM,eAAe,GAC1B,WAAW,iBAAiB,CAAC,SAAS,EACtC,QAAQ,UAAU,EAClB,oBAEG,oBAAyB,EAC5B,mBAAkB,MAAiB,gBAiLpC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Y from 'yjs';
|
|
2
2
|
import { Plugin, PluginKey } from 'prosemirror-state';
|
|
3
|
-
import { remoteSelectionPluginKey } from '
|
|
3
|
+
import { remoteSelectionPluginKey } from '@kerebron/extension-basic-editor/ExtensionRemoteSelection';
|
|
4
4
|
import { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, setMeta, } from './lib.js';
|
|
5
5
|
import { ySyncPluginKey } from './keys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,GAC5B,OAAO;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAC3B,QAAQ,MAAM,kBAQf,CAAC;AAwBF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAC1B,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAA;CAAE,EACnC,cAAc,CAAC,CAAC,WAAW,EAC3B,OAAO,IAAI,EACX,MAAM,eAAe,SA4JtB,CAAC"}
|
|
@@ -13,7 +13,7 @@ import * as environment from 'lib0/environment';
|
|
|
13
13
|
import * as dom from 'lib0/dom';
|
|
14
14
|
import * as eventloop from 'lib0/eventloop';
|
|
15
15
|
import * as map from 'lib0/map';
|
|
16
|
-
import { remoteSelectionPluginKey } from '
|
|
16
|
+
import { remoteSelectionPluginKey } from '@kerebron/extension-basic-editor/ExtensionRemoteSelection';
|
|
17
17
|
import { ySyncPluginKey, yUndoPluginKey } from './keys.js';
|
|
18
18
|
import * as utils from './utils.js';
|
|
19
19
|
import { absolutePositionToRelativePosition, relativePositionToAbsolutePosition, } from './lib.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yUndoPlugin.d.ts","sourceRoot":"","sources":["../src/yUndoPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAA2B,WAAW,EAAc,MAAM,KAAK,CAAC;AAEvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAGxD,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACxD,UAAU,EAAE,OAAO,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"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/extension-yjs",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"module": "./esm/
|
|
5
|
+
"module": "./esm/ExtensionYjs.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"import": "./esm/
|
|
8
|
+
"import": "./esm/ExtensionYjs.js"
|
|
9
9
|
},
|
|
10
10
|
"./userColors": {
|
|
11
|
-
"import": "./esm/
|
|
12
|
-
},
|
|
13
|
-
"./CollaborationStatus": {
|
|
14
|
-
"import": "./esm/extension-yjs/src/CollaborationStatus.js"
|
|
11
|
+
"import": "./esm/userColors.js"
|
|
15
12
|
}
|
|
16
13
|
},
|
|
17
14
|
"scripts": {},
|
|
18
15
|
"dependencies": {
|
|
16
|
+
"@kerebron/editor": "0.4.6",
|
|
17
|
+
"@kerebron/extension-basic-editor": "0.4.6",
|
|
18
|
+
"lib0": "0.2.109",
|
|
19
19
|
"prosemirror-model": "1.25.3",
|
|
20
20
|
"prosemirror-state": "1.4.3",
|
|
21
|
-
"prosemirror-transform": "1.10.4",
|
|
22
21
|
"prosemirror-view": "1.40.0",
|
|
23
|
-
"
|
|
24
|
-
"web-tree-sitter": "0.24.7",
|
|
22
|
+
"y-protocols": "1.0.6",
|
|
25
23
|
"yjs": "13.6.24"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
/* Collaboration Status Menu Element */
|
|
2
|
-
.kb-collab-status {
|
|
3
|
-
position: relative;
|
|
4
|
-
display: inline-flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.kb-collab-status__button {
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
gap: 0.35rem;
|
|
12
|
-
padding: 0.35rem 0.6rem;
|
|
13
|
-
border: 1px solid var(--kb-border, #444);
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
background: var(--kb-surface, #2a2a2a);
|
|
16
|
-
color: var(--kb-text, #e8e8e8);
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
font-size: 0.85rem;
|
|
19
|
-
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.kb-collab-status__button:hover {
|
|
23
|
-
background: var(--kb-bg, #1a1a1a);
|
|
24
|
-
border-color: var(--kb-accent, #7dd3fc);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.kb-collab-status--open .kb-collab-status__button {
|
|
28
|
-
border-color: var(--kb-accent, #7dd3fc);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Status dot indicator */
|
|
32
|
-
.kb-collab-status__dot {
|
|
33
|
-
width: 8px;
|
|
34
|
-
height: 8px;
|
|
35
|
-
border-radius: 50%;
|
|
36
|
-
flex-shrink: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.kb-collab-status__dot--connected {
|
|
40
|
-
background-color: #22c55e;
|
|
41
|
-
box-shadow: 0 0 4px rgba(34, 197, 94, 0.5);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.kb-collab-status__dot--connecting {
|
|
45
|
-
background-color: #eab308;
|
|
46
|
-
box-shadow: 0 0 4px rgba(234, 179, 8, 0.5);
|
|
47
|
-
animation: pulse 1.5s ease-in-out infinite;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.kb-collab-status__dot--disconnected {
|
|
51
|
-
background-color: #ef4444;
|
|
52
|
-
box-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@keyframes pulse {
|
|
56
|
-
0%, 100% {
|
|
57
|
-
opacity: 1;
|
|
58
|
-
}
|
|
59
|
-
50% {
|
|
60
|
-
opacity: 0.5;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* User count badge */
|
|
65
|
-
.kb-collab-status__count {
|
|
66
|
-
min-width: 1.2em;
|
|
67
|
-
padding: 0 0.25em;
|
|
68
|
-
font-weight: 600;
|
|
69
|
-
font-size: 0.8rem;
|
|
70
|
-
text-align: center;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* Dropdown chevron */
|
|
74
|
-
.kb-collab-status__chevron {
|
|
75
|
-
display: flex;
|
|
76
|
-
align-items: center;
|
|
77
|
-
transition: transform 0.15s ease;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.kb-collab-status__chevron svg {
|
|
81
|
-
width: 14px;
|
|
82
|
-
height: 14px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.kb-collab-status--open .kb-collab-status__chevron {
|
|
86
|
-
transform: rotate(180deg);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/* Dropdown panel */
|
|
90
|
-
.kb-collab-status__dropdown {
|
|
91
|
-
position: absolute;
|
|
92
|
-
top: calc(100% + 4px);
|
|
93
|
-
right: 0;
|
|
94
|
-
min-width: 180px;
|
|
95
|
-
max-width: 280px;
|
|
96
|
-
background: var(--kb-surface, #2a2a2a);
|
|
97
|
-
border: 1px solid var(--kb-border, #444);
|
|
98
|
-
border-radius: 6px;
|
|
99
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
100
|
-
z-index: 1000;
|
|
101
|
-
overflow: hidden;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.kb-collab-status__header {
|
|
105
|
-
padding: 0.6rem 0.8rem;
|
|
106
|
-
font-size: 0.75rem;
|
|
107
|
-
font-weight: 600;
|
|
108
|
-
text-transform: uppercase;
|
|
109
|
-
letter-spacing: 0.05em;
|
|
110
|
-
color: var(--kb-text-muted, #9a9a9a);
|
|
111
|
-
border-bottom: 1px solid var(--kb-border, #444);
|
|
112
|
-
background: var(--kb-bg, #1a1a1a);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.kb-collab-status__users {
|
|
116
|
-
max-height: 240px;
|
|
117
|
-
overflow-y: auto;
|
|
118
|
-
padding: 0.4rem 0;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.kb-collab-status__user {
|
|
122
|
-
display: flex;
|
|
123
|
-
align-items: center;
|
|
124
|
-
gap: 0.5rem;
|
|
125
|
-
padding: 0.5rem 0.8rem;
|
|
126
|
-
transition: background-color 0.1s ease;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.kb-collab-status__user:hover {
|
|
130
|
-
background: var(--kb-bg, #1a1a1a);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.kb-collab-status__user-color {
|
|
134
|
-
width: 10px;
|
|
135
|
-
height: 10px;
|
|
136
|
-
border-radius: 50%;
|
|
137
|
-
flex-shrink: 0;
|
|
138
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.kb-collab-status__user-name {
|
|
142
|
-
flex: 1;
|
|
143
|
-
font-size: 0.85rem;
|
|
144
|
-
color: var(--kb-text, #e8e8e8);
|
|
145
|
-
overflow: hidden;
|
|
146
|
-
text-overflow: ellipsis;
|
|
147
|
-
white-space: nowrap;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.kb-collab-status__you-badge {
|
|
151
|
-
font-size: 0.7rem;
|
|
152
|
-
color: var(--kb-text-muted, #9a9a9a);
|
|
153
|
-
font-style: italic;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.kb-collab-status__empty {
|
|
157
|
-
padding: 1rem 0.8rem;
|
|
158
|
-
text-align: center;
|
|
159
|
-
color: var(--kb-text-muted, #9a9a9a);
|
|
160
|
-
font-size: 0.85rem;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
/* Light mode overrides */
|
|
164
|
-
.light-mode .kb-collab-status__dropdown,
|
|
165
|
-
.app-container.light-mode .kb-collab-status__dropdown {
|
|
166
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
.light-mode .kb-collab-status__user-color,
|
|
170
|
-
.app-container.light-mode .kb-collab-status__user-color {
|
|
171
|
-
border-color: rgba(0, 0, 0, 0.2);
|
|
172
|
-
}
|
package/esm/_dnt.polyfills.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
-
* but instead of using npm to install additional dependencies,
|
|
4
|
-
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
-
*
|
|
6
|
-
* Note that this code might be imported multiple times
|
|
7
|
-
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
-
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
-
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
-
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
-
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
-
*/
|
|
13
|
-
import { createRequire } from "node:module";
|
|
14
|
-
import { type URL } from "node:url";
|
|
15
|
-
declare global {
|
|
16
|
-
interface ImportMeta {
|
|
17
|
-
/** A string representation of the fully qualified module URL. When the
|
|
18
|
-
* module is loaded locally, the value will be a file URL (e.g.
|
|
19
|
-
* `file:///path/module.ts`).
|
|
20
|
-
*
|
|
21
|
-
* You can also parse the string as a URL to determine more information about
|
|
22
|
-
* how the current module was loaded. For example to determine if a module was
|
|
23
|
-
* local or not:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* const url = new URL(import.meta.url);
|
|
27
|
-
* if (url.protocol === "file:") {
|
|
28
|
-
* console.log("this module was loaded locally");
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
url: string;
|
|
33
|
-
/**
|
|
34
|
-
* A function that returns resolved specifier as if it would be imported
|
|
35
|
-
* using `import(specifier)`.
|
|
36
|
-
*
|
|
37
|
-
* ```ts
|
|
38
|
-
* console.log(import.meta.resolve("./foo.js"));
|
|
39
|
-
* // file:///dev/foo.js
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @param specifier The module specifier to resolve relative to `parent`.
|
|
43
|
-
* @param parent The absolute parent module URL to resolve from.
|
|
44
|
-
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
45
|
-
*/
|
|
46
|
-
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
47
|
-
/** A flag that indicates if the current module is the main module that was
|
|
48
|
-
* called when starting the program under Deno.
|
|
49
|
-
*
|
|
50
|
-
* ```ts
|
|
51
|
-
* if (import.meta.main) {
|
|
52
|
-
* // this was loaded as the main module, maybe do some bootstrapping
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
main: boolean;
|
|
57
|
-
/** The absolute path of the current module.
|
|
58
|
-
*
|
|
59
|
-
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
60
|
-
*
|
|
61
|
-
* Example:
|
|
62
|
-
* ```
|
|
63
|
-
* // Unix
|
|
64
|
-
* console.log(import.meta.filename); // /home/alice/my_module.ts
|
|
65
|
-
*
|
|
66
|
-
* // Windows
|
|
67
|
-
* console.log(import.meta.filename); // C:\alice\my_module.ts
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
filename: string;
|
|
71
|
-
/** The absolute path of the directory containing the current module.
|
|
72
|
-
*
|
|
73
|
-
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
74
|
-
*
|
|
75
|
-
* * Example:
|
|
76
|
-
* ```
|
|
77
|
-
* // Unix
|
|
78
|
-
* console.log(import.meta.dirname); // /home/alice
|
|
79
|
-
*
|
|
80
|
-
* // Windows
|
|
81
|
-
* console.log(import.meta.dirname); // C:\alice
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
dirname: string;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
type NodeRequest = ReturnType<typeof createRequire>;
|
|
88
|
-
type NodeModule = NonNullable<NodeRequest["main"]>;
|
|
89
|
-
interface ImportMetaPonyfillCommonjs {
|
|
90
|
-
(require: NodeRequest, module: NodeModule): ImportMeta;
|
|
91
|
-
}
|
|
92
|
-
interface ImportMetaPonyfillEsmodule {
|
|
93
|
-
(importMeta: ImportMeta): ImportMeta;
|
|
94
|
-
}
|
|
95
|
-
interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
|
|
96
|
-
}
|
|
97
|
-
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
98
|
-
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
99
|
-
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
100
|
-
export {};
|
|
101
|
-
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.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