@jvs-milkdown/plugin-collab 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020-present Mirone
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @jvs-milkdown/plugin-collab
2
+
3
+ Collaborative editing support for [milkdown](https://milkdown.dev/).
4
+
5
+ # Official Documentation
6
+
7
+ Documentation can be found on the [Milkdown website](https://milkdown.dev/).
8
+
9
+ # License
10
+
11
+ Milkdown is open sourced software licensed under [MIT license](https://github.com/Milkdown/milkdown/blob/main/LICENSE).
@@ -0,0 +1,46 @@
1
+ import type { DefaultValue } from '@jvs-milkdown/core';
2
+ import type { Ctx } from '@jvs-milkdown/ctx';
3
+ import type { Node } from '@jvs-milkdown/prose/model';
4
+ import type { DecorationAttrs } from '@jvs-milkdown/prose/view';
5
+ import type { Awareness } from 'y-protocols/awareness';
6
+ import type { Doc, PermanentUserData, XmlFragment } from 'yjs';
7
+ import { PluginKey } from '@jvs-milkdown/prose/state';
8
+ export interface ColorDef {
9
+ light: string;
10
+ dark: string;
11
+ }
12
+ export interface YSyncOpts {
13
+ colors?: Array<ColorDef>;
14
+ colorMapping?: Map<string, ColorDef>;
15
+ permanentUserData?: PermanentUserData | null;
16
+ }
17
+ export interface yCursorOpts {
18
+ cursorBuilder?: (arg: any) => HTMLElement;
19
+ selectionBuilder?: (arg: any) => DecorationAttrs;
20
+ getSelection?: (arg: any) => any;
21
+ }
22
+ export interface yUndoOpts {
23
+ protectedNodes?: Set<string>;
24
+ trackedOrigins?: any[];
25
+ undoManager?: any;
26
+ }
27
+ export interface CollabServiceOptions {
28
+ yCursorStateField?: string;
29
+ ySyncOpts?: YSyncOpts;
30
+ yCursorOpts?: yCursorOpts;
31
+ yUndoOpts?: yUndoOpts;
32
+ }
33
+ export declare const CollabKeymapPluginKey: PluginKey<any>;
34
+ export declare class CollabService {
35
+ #private;
36
+ bindCtx(ctx: Ctx): this;
37
+ bindDoc(doc: Doc): this;
38
+ bindXmlFragment(xmlFragment: XmlFragment): this;
39
+ setOptions(options: CollabServiceOptions): this;
40
+ mergeOptions(options: Partial<CollabServiceOptions>): this;
41
+ setAwareness(awareness: Awareness): this;
42
+ applyTemplate(template: DefaultValue, condition?: (yDocNode: Node, templateNode: Node) => boolean): this;
43
+ connect(): this | undefined;
44
+ disconnect(): this;
45
+ }
46
+ //# sourceMappingURL=collab-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collab-service.d.ts","sourceRoot":"","sources":["../src/collab-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAW9D,OAAO,EAAU,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAgB7D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAGD,MAAM,WAAW,SAAS;IACxB,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;IACxB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC7C;AAGD,MAAM,WAAW,WAAW;IAC1B,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,WAAW,CAAA;IACzC,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,eAAe,CAAA;IAChD,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,GAAG,CAAA;CACjC;AAGD,MAAM,WAAW,SAAS;IACxB,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC5B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAA;IACtB,WAAW,CAAC,EAAE,GAAG,CAAA;CAClB;AAGD,MAAM,WAAW,oBAAoB;IAEnC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAG1B,SAAS,CAAC,EAAE,SAAS,CAAA;IAGrB,WAAW,CAAC,EAAE,WAAW,CAAA;IAGzB,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAGD,eAAO,MAAM,qBAAqB,gBAA0C,CAAA;AAW5E,qBAAa,aAAa;;IAkExB,OAAO,CAAC,GAAG,EAAE,GAAG;IAMhB,OAAO,CAAC,GAAG,EAAE,GAAG;IAMhB,eAAe,CAAC,WAAW,EAAE,WAAW;IAMxC,UAAU,CAAC,OAAO,EAAE,oBAAoB;IAQxC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAMnD,YAAY,CAAC,SAAS,EAAE,SAAS;IAMjC,aAAa,CACX,QAAQ,EAAE,YAAY,EACtB,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,KAAK,OAAO;IA2B7D,OAAO;IAeP,UAAU;CAeX"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { MilkdownPlugin } from '@jvs-milkdown/ctx';
2
+ import { CollabService } from './collab-service';
3
+ export declare const collabServiceCtx: import("@jvs-milkdown/ctx").SliceType<CollabService, "collabServiceCtx">;
4
+ export declare const CollabReady: import("@jvs-milkdown/ctx").TimerType;
5
+ export declare const collab: MilkdownPlugin;
6
+ export * from './collab-service';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAKvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAGhD,eAAO,MAAM,gBAAgB,0EAG5B,CAAA;AAGD,eAAO,MAAM,WAAW,uCAA6B,CAAA;AAGrD,eAAO,MAAM,MAAM,EAAE,cAWpB,CAAA;AAMD,cAAc,kBAAkB,CAAA"}
package/lib/index.js ADDED
@@ -0,0 +1,138 @@
1
+ import { EditorViewReady, editorViewCtx, getDoc, parserCtx, prosePluginsCtx, schemaCtx } from "@jvs-milkdown/core";
2
+ import { createSlice, createTimer } from "@jvs-milkdown/ctx";
3
+ import { ctxNotBind, missingYjsDoc } from "@jvs-milkdown/exception";
4
+ import { keydownHandler } from "@jvs-milkdown/prose/keymap";
5
+ import { Plugin, PluginKey } from "@jvs-milkdown/prose/state";
6
+ import { prosemirrorToYDoc, redo, undo, yCursorPlugin, yCursorPluginKey, ySyncPlugin, ySyncPluginKey, yUndoPlugin, yUndoPluginKey, yXmlFragmentToProseMirrorRootNode } from "y-prosemirror";
7
+ import { applyUpdate, encodeStateAsUpdate } from "yjs";
8
+ //#region src/collab-service.ts
9
+ var CollabKeymapPluginKey = new PluginKey("MILKDOWN_COLLAB_KEYMAP");
10
+ var collabPluginKeys = [
11
+ CollabKeymapPluginKey,
12
+ ySyncPluginKey,
13
+ yCursorPluginKey,
14
+ yUndoPluginKey
15
+ ];
16
+ var CollabService = class {
17
+ #options = {};
18
+ #xmlFragment = null;
19
+ #awareness = null;
20
+ #ctx = null;
21
+ #connected = false;
22
+ #valueToNode(value) {
23
+ if (!this.#ctx) throw ctxNotBind();
24
+ const schema = this.#ctx.get(schemaCtx);
25
+ return getDoc(value, this.#ctx.get(parserCtx), schema);
26
+ }
27
+ #createPlugins() {
28
+ if (!this.#xmlFragment) throw missingYjsDoc();
29
+ const { ySyncOpts, yUndoOpts } = this.#options;
30
+ const plugins = [
31
+ ySyncPlugin(this.#xmlFragment, ySyncOpts),
32
+ yUndoPlugin(yUndoOpts),
33
+ new Plugin({
34
+ key: CollabKeymapPluginKey,
35
+ props: { handleKeyDown: keydownHandler({
36
+ "Mod-z": undo,
37
+ "Mod-y": redo,
38
+ "Mod-Shift-z": redo
39
+ }) }
40
+ })
41
+ ];
42
+ if (this.#awareness) {
43
+ const { yCursorOpts, yCursorStateField } = this.#options;
44
+ plugins.push(yCursorPlugin(this.#awareness, yCursorOpts, yCursorStateField));
45
+ }
46
+ return plugins;
47
+ }
48
+ #flushEditor(plugins) {
49
+ if (!this.#ctx) throw ctxNotBind();
50
+ this.#ctx.set(prosePluginsCtx, plugins);
51
+ const view = this.#ctx.get(editorViewCtx);
52
+ const newState = view.state.reconfigure({ plugins });
53
+ view.updateState(newState);
54
+ }
55
+ bindCtx(ctx) {
56
+ this.#ctx = ctx;
57
+ return this;
58
+ }
59
+ bindDoc(doc) {
60
+ this.#xmlFragment = doc.getXmlFragment("prosemirror");
61
+ return this;
62
+ }
63
+ bindXmlFragment(xmlFragment) {
64
+ this.#xmlFragment = xmlFragment;
65
+ return this;
66
+ }
67
+ setOptions(options) {
68
+ this.#options = options;
69
+ return this;
70
+ }
71
+ mergeOptions(options) {
72
+ Object.assign(this.#options, options);
73
+ return this;
74
+ }
75
+ setAwareness(awareness) {
76
+ this.#awareness = awareness;
77
+ return this;
78
+ }
79
+ applyTemplate(template, condition) {
80
+ if (!this.#ctx) throw ctxNotBind();
81
+ if (!this.#xmlFragment) throw missingYjsDoc();
82
+ const conditionFn = condition || ((yDocNode) => yDocNode.textContent.length === 0);
83
+ const node = this.#valueToNode(template);
84
+ const schema = this.#ctx.get(schemaCtx);
85
+ const yDocNode = yXmlFragmentToProseMirrorRootNode(this.#xmlFragment, schema);
86
+ if (node && conditionFn(yDocNode, node)) {
87
+ const fragment = this.#xmlFragment;
88
+ fragment.delete(0, fragment.length);
89
+ const templateDoc = prosemirrorToYDoc(node);
90
+ const template = encodeStateAsUpdate(templateDoc);
91
+ if (fragment.doc) applyUpdate(fragment.doc, template);
92
+ templateDoc.destroy();
93
+ }
94
+ return this;
95
+ }
96
+ connect() {
97
+ if (!this.#ctx) throw ctxNotBind();
98
+ if (this.#connected) return;
99
+ const prosePlugins = this.#ctx.get(prosePluginsCtx);
100
+ const collabPlugins = this.#createPlugins();
101
+ const plugins = prosePlugins.concat(collabPlugins);
102
+ this.#flushEditor(plugins);
103
+ this.#connected = true;
104
+ return this;
105
+ }
106
+ disconnect() {
107
+ if (!this.#ctx) throw ctxNotBind();
108
+ if (!this.#connected) return this;
109
+ const plugins = this.#ctx.get(prosePluginsCtx).filter((plugin) => !plugin.spec.key || !collabPluginKeys.includes(plugin.spec.key));
110
+ this.#flushEditor(plugins);
111
+ this.#connected = false;
112
+ return this;
113
+ }
114
+ };
115
+ //#endregion
116
+ //#region src/index.ts
117
+ var collabServiceCtx = createSlice(new CollabService(), "collabServiceCtx");
118
+ var CollabReady = createTimer("CollabReady");
119
+ var collab = (ctx) => {
120
+ const collabService = new CollabService();
121
+ ctx.inject(collabServiceCtx, collabService).record(CollabReady);
122
+ return async () => {
123
+ await ctx.wait(EditorViewReady);
124
+ collabService.bindCtx(ctx);
125
+ ctx.done(CollabReady);
126
+ return () => {
127
+ ctx.remove(collabServiceCtx).clearTimer(CollabReady);
128
+ };
129
+ };
130
+ };
131
+ collab.meta = {
132
+ package: "@jvs-milkdown/plugin-collab",
133
+ displayName: "Collab"
134
+ };
135
+ //#endregion
136
+ export { CollabKeymapPluginKey, CollabReady, CollabService, collab, collabServiceCtx };
137
+
138
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["#ctx","#xmlFragment","#options","#awareness","#valueToNode","#connected","#createPlugins","#flushEditor"],"sources":["../src/collab-service.ts","../src/index.ts"],"sourcesContent":["import type { DefaultValue } from '@jvs-milkdown/core'\nimport type { Ctx } from '@jvs-milkdown/ctx'\nimport type { Node } from '@jvs-milkdown/prose/model'\nimport type { DecorationAttrs } from '@jvs-milkdown/prose/view'\nimport type { Awareness } from 'y-protocols/awareness'\nimport type { Doc, PermanentUserData, XmlFragment } from 'yjs'\n\nimport {\n editorViewCtx,\n getDoc,\n parserCtx,\n prosePluginsCtx,\n schemaCtx,\n} from '@jvs-milkdown/core'\nimport { ctxNotBind, missingYjsDoc } from '@jvs-milkdown/exception'\nimport { keydownHandler } from '@jvs-milkdown/prose/keymap'\nimport { Plugin, PluginKey } from '@jvs-milkdown/prose/state'\nimport {\n prosemirrorToYDoc,\n redo,\n undo,\n yCursorPlugin,\n yCursorPluginKey,\n yXmlFragmentToProseMirrorRootNode,\n ySyncPlugin,\n ySyncPluginKey,\n yUndoPlugin,\n yUndoPluginKey,\n} from 'y-prosemirror'\nimport { applyUpdate, encodeStateAsUpdate } from 'yjs'\n\n/// @internal\nexport interface ColorDef {\n light: string\n dark: string\n}\n\n/// @internal\nexport interface YSyncOpts {\n colors?: Array<ColorDef>\n colorMapping?: Map<string, ColorDef>\n permanentUserData?: PermanentUserData | null\n}\n\n/// @internal\nexport interface yCursorOpts {\n cursorBuilder?: (arg: any) => HTMLElement\n selectionBuilder?: (arg: any) => DecorationAttrs\n getSelection?: (arg: any) => any\n}\n\n/// @internal\nexport interface yUndoOpts {\n protectedNodes?: Set<string>\n trackedOrigins?: any[]\n undoManager?: any\n}\n\n/// Options for the collab service.\nexport interface CollabServiceOptions {\n /// The field name of the yCursor plugin.\n yCursorStateField?: string\n\n /// Options for the ySync plugin.\n ySyncOpts?: YSyncOpts\n\n /// Options for the yCursor plugin.\n yCursorOpts?: yCursorOpts\n\n /// Options for the yUndo plugin.\n yUndoOpts?: yUndoOpts\n}\n\n/// @internal\nexport const CollabKeymapPluginKey = new PluginKey('MILKDOWN_COLLAB_KEYMAP')\n\nconst collabPluginKeys = [\n CollabKeymapPluginKey,\n ySyncPluginKey,\n yCursorPluginKey,\n yUndoPluginKey,\n]\n\n/// The collab service is used to manage the collaboration plugins.\n/// It is used to provide the collaboration plugins to the editor.\nexport class CollabService {\n /// @internal\n #options: CollabServiceOptions = {}\n /// @internal\n #xmlFragment: XmlFragment | null = null\n /// @internal\n #awareness: Awareness | null = null\n /// @internal\n #ctx: Ctx | null = null\n /// @internal\n #connected = false\n\n /// @internal\n #valueToNode(value: DefaultValue): Node | undefined {\n if (!this.#ctx) throw ctxNotBind()\n\n const schema = this.#ctx.get(schemaCtx)\n const parser = this.#ctx.get(parserCtx)\n\n const doc = getDoc(value, parser, schema)\n return doc\n }\n\n /// @internal\n #createPlugins(): Plugin[] {\n if (!this.#xmlFragment) throw missingYjsDoc()\n const { ySyncOpts, yUndoOpts } = this.#options\n const plugins = [\n ySyncPlugin(this.#xmlFragment, ySyncOpts),\n yUndoPlugin(yUndoOpts),\n new Plugin({\n key: CollabKeymapPluginKey,\n props: {\n handleKeyDown: keydownHandler({\n 'Mod-z': undo,\n 'Mod-y': redo,\n 'Mod-Shift-z': redo,\n }),\n },\n }),\n ]\n if (this.#awareness) {\n const { yCursorOpts, yCursorStateField } = this.#options\n plugins.push(\n yCursorPlugin(\n this.#awareness,\n yCursorOpts as Required<yCursorOpts>,\n yCursorStateField\n )\n )\n }\n\n return plugins\n }\n\n /// @internal\n #flushEditor(plugins: Plugin[]) {\n if (!this.#ctx) throw ctxNotBind()\n this.#ctx.set(prosePluginsCtx, plugins)\n\n const view = this.#ctx.get(editorViewCtx)\n const newState = view.state.reconfigure({ plugins })\n view.updateState(newState)\n }\n\n /// Bind the context to the service.\n bindCtx(ctx: Ctx) {\n this.#ctx = ctx\n return this\n }\n\n /// Bind the document to the service.\n bindDoc(doc: Doc) {\n this.#xmlFragment = doc.getXmlFragment('prosemirror')\n return this\n }\n\n /// Bind the Yjs XmlFragment to the service.\n bindXmlFragment(xmlFragment: XmlFragment) {\n this.#xmlFragment = xmlFragment\n return this\n }\n\n /// Set the options of the service.\n setOptions(options: CollabServiceOptions) {\n this.#options = options\n return this\n }\n\n /// Merge some options to the service.\n /// The options will be merged to the existing options.\n /// THe options should be partial of the `CollabServiceOptions`.\n mergeOptions(options: Partial<CollabServiceOptions>) {\n Object.assign(this.#options, options)\n return this\n }\n\n /// Set the awareness of the service.\n setAwareness(awareness: Awareness) {\n this.#awareness = awareness\n return this\n }\n\n /// Apply the template to the document.\n applyTemplate(\n template: DefaultValue,\n condition?: (yDocNode: Node, templateNode: Node) => boolean\n ) {\n if (!this.#ctx) throw ctxNotBind()\n if (!this.#xmlFragment) throw missingYjsDoc()\n const conditionFn =\n condition || ((yDocNode) => yDocNode.textContent.length === 0)\n\n const node = this.#valueToNode(template)\n const schema = this.#ctx.get(schemaCtx)\n const yDocNode = yXmlFragmentToProseMirrorRootNode(\n this.#xmlFragment,\n schema\n )\n\n if (node && conditionFn(yDocNode, node)) {\n const fragment = this.#xmlFragment\n fragment.delete(0, fragment.length)\n const templateDoc = prosemirrorToYDoc(node)\n const template = encodeStateAsUpdate(templateDoc)\n if (fragment.doc) applyUpdate(fragment.doc, template)\n templateDoc.destroy()\n }\n\n return this\n }\n\n /// Connect the service.\n connect() {\n if (!this.#ctx) throw ctxNotBind()\n if (this.#connected) return\n\n const prosePlugins = this.#ctx.get(prosePluginsCtx)\n const collabPlugins = this.#createPlugins()\n const plugins = prosePlugins.concat(collabPlugins)\n\n this.#flushEditor(plugins)\n this.#connected = true\n\n return this\n }\n\n /// Disconnect the service.\n disconnect() {\n if (!this.#ctx) throw ctxNotBind()\n if (!this.#connected) return this\n\n const prosePlugins = this.#ctx.get(prosePluginsCtx)\n const plugins = prosePlugins.filter(\n (plugin) =>\n !plugin.spec.key || !collabPluginKeys.includes(plugin.spec.key)\n )\n\n this.#flushEditor(plugins)\n this.#connected = false\n\n return this\n }\n}\n","import type { MilkdownPlugin } from '@jvs-milkdown/ctx'\n\nimport { EditorViewReady } from '@jvs-milkdown/core'\nimport { createSlice, createTimer } from '@jvs-milkdown/ctx'\n\nimport { CollabService } from './collab-service'\n\n/// A slice that contains the collab service.\nexport const collabServiceCtx = createSlice(\n new CollabService(),\n 'collabServiceCtx'\n)\n\n/// The timer that indicates the collab plugin is ready.\nexport const CollabReady = createTimer('CollabReady')\n\n/// The collab plugin.\nexport const collab: MilkdownPlugin = (ctx) => {\n const collabService = new CollabService()\n ctx.inject(collabServiceCtx, collabService).record(CollabReady)\n return async () => {\n await ctx.wait(EditorViewReady)\n collabService.bindCtx(ctx)\n ctx.done(CollabReady)\n return () => {\n ctx.remove(collabServiceCtx).clearTimer(CollabReady)\n }\n }\n}\ncollab.meta = {\n package: '@jvs-milkdown/plugin-collab',\n displayName: 'Collab',\n}\n\nexport * from './collab-service'\n"],"mappings":";;;;;;;;AA0EA,IAAa,wBAAwB,IAAI,UAAU,yBAAyB;AAE5E,IAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACD;AAID,IAAa,gBAAb,MAA2B;CAEzB,WAAiC,EAAE;CAEnC,eAAmC;CAEnC,aAA+B;CAE/B,OAAmB;CAEnB,aAAa;CAGb,aAAa,OAAuC;AAClD,MAAI,CAAC,MAAA,IAAW,OAAM,YAAY;EAElC,MAAM,SAAS,MAAA,IAAU,IAAI,UAAU;AAIvC,SADY,OAAO,OAFJ,MAAA,IAAU,IAAI,UAAU,EAEL,OAAO;;CAK3C,iBAA2B;AACzB,MAAI,CAAC,MAAA,YAAmB,OAAM,eAAe;EAC7C,MAAM,EAAE,WAAW,cAAc,MAAA;EACjC,MAAM,UAAU;GACd,YAAY,MAAA,aAAmB,UAAU;GACzC,YAAY,UAAU;GACtB,IAAI,OAAO;IACT,KAAK;IACL,OAAO,EACL,eAAe,eAAe;KAC5B,SAAS;KACT,SAAS;KACT,eAAe;KAChB,CAAC,EACH;IACF,CAAC;GACH;AACD,MAAI,MAAA,WAAiB;GACnB,MAAM,EAAE,aAAa,sBAAsB,MAAA;AAC3C,WAAQ,KACN,cACE,MAAA,WACA,aACA,kBACD,CACF;;AAGH,SAAO;;CAIT,aAAa,SAAmB;AAC9B,MAAI,CAAC,MAAA,IAAW,OAAM,YAAY;AAClC,QAAA,IAAU,IAAI,iBAAiB,QAAQ;EAEvC,MAAM,OAAO,MAAA,IAAU,IAAI,cAAc;EACzC,MAAM,WAAW,KAAK,MAAM,YAAY,EAAE,SAAS,CAAC;AACpD,OAAK,YAAY,SAAS;;CAI5B,QAAQ,KAAU;AAChB,QAAA,MAAY;AACZ,SAAO;;CAIT,QAAQ,KAAU;AAChB,QAAA,cAAoB,IAAI,eAAe,cAAc;AACrD,SAAO;;CAIT,gBAAgB,aAA0B;AACxC,QAAA,cAAoB;AACpB,SAAO;;CAIT,WAAW,SAA+B;AACxC,QAAA,UAAgB;AAChB,SAAO;;CAMT,aAAa,SAAwC;AACnD,SAAO,OAAO,MAAA,SAAe,QAAQ;AACrC,SAAO;;CAIT,aAAa,WAAsB;AACjC,QAAA,YAAkB;AAClB,SAAO;;CAIT,cACE,UACA,WACA;AACA,MAAI,CAAC,MAAA,IAAW,OAAM,YAAY;AAClC,MAAI,CAAC,MAAA,YAAmB,OAAM,eAAe;EAC7C,MAAM,cACJ,eAAe,aAAa,SAAS,YAAY,WAAW;EAE9D,MAAM,OAAO,MAAA,YAAkB,SAAS;EACxC,MAAM,SAAS,MAAA,IAAU,IAAI,UAAU;EACvC,MAAM,WAAW,kCACf,MAAA,aACA,OACD;AAED,MAAI,QAAQ,YAAY,UAAU,KAAK,EAAE;GACvC,MAAM,WAAW,MAAA;AACjB,YAAS,OAAO,GAAG,SAAS,OAAO;GACnC,MAAM,cAAc,kBAAkB,KAAK;GAC3C,MAAM,WAAW,oBAAoB,YAAY;AACjD,OAAI,SAAS,IAAK,aAAY,SAAS,KAAK,SAAS;AACrD,eAAY,SAAS;;AAGvB,SAAO;;CAIT,UAAU;AACR,MAAI,CAAC,MAAA,IAAW,OAAM,YAAY;AAClC,MAAI,MAAA,UAAiB;EAErB,MAAM,eAAe,MAAA,IAAU,IAAI,gBAAgB;EACnD,MAAM,gBAAgB,MAAA,eAAqB;EAC3C,MAAM,UAAU,aAAa,OAAO,cAAc;AAElD,QAAA,YAAkB,QAAQ;AAC1B,QAAA,YAAkB;AAElB,SAAO;;CAIT,aAAa;AACX,MAAI,CAAC,MAAA,IAAW,OAAM,YAAY;AAClC,MAAI,CAAC,MAAA,UAAiB,QAAO;EAG7B,MAAM,UADe,MAAA,IAAU,IAAI,gBAAgB,CACtB,QAC1B,WACC,CAAC,OAAO,KAAK,OAAO,CAAC,iBAAiB,SAAS,OAAO,KAAK,IAAI,CAClE;AAED,QAAA,YAAkB,QAAQ;AAC1B,QAAA,YAAkB;AAElB,SAAO;;;;;AC9OX,IAAa,mBAAmB,YAC9B,IAAI,eAAe,EACnB,mBACD;AAGD,IAAa,cAAc,YAAY,cAAc;AAGrD,IAAa,UAA0B,QAAQ;CAC7C,MAAM,gBAAgB,IAAI,eAAe;AACzC,KAAI,OAAO,kBAAkB,cAAc,CAAC,OAAO,YAAY;AAC/D,QAAO,YAAY;AACjB,QAAM,IAAI,KAAK,gBAAgB;AAC/B,gBAAc,QAAQ,IAAI;AAC1B,MAAI,KAAK,YAAY;AACrB,eAAa;AACX,OAAI,OAAO,iBAAiB,CAAC,WAAW,YAAY;;;;AAI1D,OAAO,OAAO;CACZ,SAAS;CACT,aAAa;CACd"}
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../ctx/lib/context/slice.d.ts","../../../ctx/lib/context/container.d.ts","../../../ctx/lib/context/index.d.ts","../../../ctx/lib/inspector/meta.d.ts","../../../ctx/lib/timer/timer.d.ts","../../../ctx/lib/timer/clock.d.ts","../../../ctx/lib/timer/index.d.ts","../../../ctx/lib/inspector/inspector.d.ts","../../../ctx/lib/inspector/index.d.ts","../../../ctx/lib/plugin/ctx.d.ts","../../../ctx/lib/plugin/types.d.ts","../../../ctx/lib/plugin/index.d.ts","../../../ctx/lib/index.d.ts","../../../../node_modules/.pnpm/orderedmap@2.1.1/node_modules/orderedmap/dist/index.d.ts","../../../../node_modules/.pnpm/prosemirror-model@1.25.4/node_modules/prosemirror-model/dist/index.d.ts","../../../../node_modules/.pnpm/prosemirror-transform@1.11.0/node_modules/prosemirror-transform/dist/index.d.ts","../../../../node_modules/.pnpm/prosemirror-view@1.41.7/node_modules/prosemirror-view/dist/index.d.ts","../../../../node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.d.ts","../../../../node_modules/.pnpm/prosemirror-inputrules@1.5.1/node_modules/prosemirror-inputrules/dist/index.d.ts","../../../prose/lib/inputrules.d.ts","../../../prose/lib/state.d.ts","../../../prose/lib/view.d.ts","../../../prose/lib/model.d.ts","../../../../node_modules/.pnpm/@types+unist@3.0.3/node_modules/@types/unist/index.d.ts","../../../../node_modules/.pnpm/@types+mdast@4.0.4/node_modules/@types/mdast/index.d.ts","../../../../node_modules/.pnpm/micromark-util-types@2.0.2/node_modules/micromark-util-types/index.d.ts","../../../../node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/types.d.ts","../../../../node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/lib/index.d.ts","../../../../node_modules/.pnpm/mdast-util-from-markdown@2.0.3/node_modules/mdast-util-from-markdown/index.d.ts","../../../../node_modules/.pnpm/vfile-message@4.0.3/node_modules/vfile-message/lib/index.d.ts","../../../../node_modules/.pnpm/vfile-message@4.0.3/node_modules/vfile-message/index.d.ts","../../../../node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/lib/index.d.ts","../../../../node_modules/.pnpm/vfile@6.0.3/node_modules/vfile/index.d.ts","../../../../node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/callable-instance.d.ts","../../../../node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.d.ts","../../../../node_modules/.pnpm/trough@2.2.0/node_modules/trough/index.d.ts","../../../../node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.d.ts","../../../../node_modules/.pnpm/unified@11.0.5/node_modules/unified/index.d.ts","../../../../node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/lib/index.d.ts","../../../../node_modules/.pnpm/remark-parse@11.0.0/node_modules/remark-parse/index.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/types.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/index.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/blockquote.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/break.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/code.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/definition.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/emphasis.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/heading.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/html.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/image-reference.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/inline-code.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/link-reference.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/list-item.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/paragraph.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/root.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/strong.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/text.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/thematic-break.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/lib/handle/index.d.ts","../../../../node_modules/.pnpm/mdast-util-to-markdown@2.1.2/node_modules/mdast-util-to-markdown/index.d.ts","../../../../node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/lib/index.d.ts","../../../../node_modules/.pnpm/remark-stringify@11.0.0/node_modules/remark-stringify/index.d.ts","../../../../node_modules/.pnpm/remark@15.0.1/node_modules/remark/index.d.ts","../../../transformer/lib/utility/stack.d.ts","../../../transformer/lib/utility/index.d.ts","../../../transformer/lib/serializer/stack-element.d.ts","../../../transformer/lib/serializer/state.d.ts","../../../transformer/lib/serializer/types.d.ts","../../../transformer/lib/utility/types.d.ts","../../../transformer/lib/parser/stack-element.d.ts","../../../transformer/lib/parser/state.d.ts","../../../transformer/lib/parser/types.d.ts","../../../transformer/lib/parser/index.d.ts","../../../transformer/lib/serializer/index.d.ts","../../../transformer/lib/index.d.ts","../../../core/lib/internal-plugin/atoms.d.ts","../../../core/lib/internal-plugin/commands.d.ts","../../../core/lib/internal-plugin/config.d.ts","../../../core/lib/internal-plugin/editor-state.d.ts","../../../core/lib/internal-plugin/editor-view.d.ts","../../../core/lib/internal-plugin/init.d.ts","../../../core/lib/internal-plugin/parser.d.ts","../../../core/lib/internal-plugin/schema.d.ts","../../../core/lib/internal-plugin/serializer.d.ts","../../../core/lib/internal-plugin/keymap.d.ts","../../../core/lib/internal-plugin/paste-rule.d.ts","../../../core/lib/internal-plugin/index.d.ts","../../../core/lib/editor/editor.d.ts","../../../core/lib/editor/index.d.ts","../../../core/lib/index.d.ts","../../../../node_modules/.pnpm/lib0@0.2.117/node_modules/lib0/observable.d.ts","../../../../node_modules/.pnpm/lib0@0.2.117/node_modules/lib0/random.d.ts","../../../../node_modules/.pnpm/lib0@0.2.117/node_modules/lib0/encoding.d.ts","../../../../node_modules/.pnpm/lib0@0.2.117/node_modules/lib0/decoding.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/updateencoder.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/updatedecoder.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/deleteset.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/yevent.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/transaction.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/eventhandler.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/snapshot.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/abstracttype.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/id.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/abstractstruct.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/gc.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/structstore.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/undomanager.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/item.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/yarray.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/ytext.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/ymap.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/yxmltext.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/yxmlhook.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/yxmlevent.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/yxmlfragment.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/types/yxmlelement.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/doc.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/abstractconnector.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/encoding.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/isparentof.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/logging.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/permanentuserdata.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/relativeposition.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/skip.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/utils/updates.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentbinary.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentdeleted.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentdoc.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentembed.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentformat.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentjson.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentany.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contentstring.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/structs/contenttype.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/internals.d.ts","../../../../node_modules/.pnpm/yjs@13.6.30/node_modules/yjs/dist/src/index.d.ts","../../../../node_modules/.pnpm/y-protocols@1.0.7_yjs@13.6.30/node_modules/y-protocols/awareness.d.ts","../../../exception/lib/code.d.ts","../../../exception/lib/error.d.ts","../../../exception/lib/index.d.ts","../../../../node_modules/.pnpm/prosemirror-keymap@1.2.3/node_modules/prosemirror-keymap/dist/index.d.ts","../../../prose/lib/keymap.d.ts","../../../../node_modules/.pnpm/y-prosemirror@1.3.7_prosemi_6a838e4a69158a6223fb65f8af6057ae/node_modules/y-prosemirror/dist/src/plugins/cursor-plugin.d.ts","../../../../node_modules/.pnpm/lib0@0.2.117/node_modules/lib0/mutex.d.ts","../../../../node_modules/.pnpm/y-prosemirror@1.3.7_prosemi_6a838e4a69158a6223fb65f8af6057ae/node_modules/y-prosemirror/dist/src/plugins/sync-plugin.d.ts","../../../../node_modules/.pnpm/y-prosemirror@1.3.7_prosemi_6a838e4a69158a6223fb65f8af6057ae/node_modules/y-prosemirror/dist/src/plugins/undo-plugin.d.ts","../../../../node_modules/.pnpm/y-prosemirror@1.3.7_prosemi_6a838e4a69158a6223fb65f8af6057ae/node_modules/y-prosemirror/dist/src/plugins/keys.d.ts","../../../../node_modules/.pnpm/y-prosemirror@1.3.7_prosemi_6a838e4a69158a6223fb65f8af6057ae/node_modules/y-prosemirror/dist/src/lib.d.ts","../../../../node_modules/.pnpm/y-prosemirror@1.3.7_prosemi_6a838e4a69158a6223fb65f8af6057ae/node_modules/y-prosemirror/dist/src/y-prosemirror.d.ts","../src/collab-service.ts","../src/index.ts","../src/shim.d.ts"],"fileIdsList":[[82],[84,85,86,87],[83,84,85,87],[83,84,87],[99,100,120],[83,121],[83],[101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119],[82,83],[73,76],[75,76],[72],[73,74,75],[73],[73,74,76],[83,84,87,96,97,98,123],[83,87,91,96,98,123],[83,96,98,121,122,123],[83,91,96,98,121,123],[83,96,98,123],[93],[91,95],[82,91,92,94,96,98,123],[88],[89,90],[82,89,91],[73,197,206],[75,198],[76,207],[73,76,197,205],[76,197,206],[204,206,207,208,209],[152,197],[196],[156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195],[156,160,164],[156,157,160,167,169],[156,157,160,167,169,178],[156,157,160,163,167,169],[156,160,165,167],[156,157,158,160,163,164,165,167,168],[156,159,160,161,162,169,178],[157,159,160,163,169,178],[157,159,160,162,163,164,169,178],[157,162,163,173,176],[159,160,173,176,177],[157,163,169,173,174,175,177,178],[157,172],[157,171,177],[152,178],[156,157,160,164,166,167,169],[152,153,159,160,163,167,169,170,171,172,176,177],[155,156,157,160,166,167,169,178],[154,155,163],[163,169],[163],[158,160,164,172,178],[154,155,163,164,178],[156,157,158,160,169,178],[160,164,166,169],[156,158,159,163,164,165,167,169,178],[152,158,159,160,163,169,178],[155,164],[154,164],[156,157,158,166,169,185],[160,163,165,169],[71,148],[149],[148,150],[71,78,79,80,123,136,150],[71,79],[71],[71,79,81,136],[71,80],[137,138,139,140,141,142,143,144,145,146,147],[71,150],[71,136],[71,80,81],[71,81,136],[59],[59,60],[60],[61,65,67,70],[62,66],[61,62,65],[61,65,67,71],[68,69],[67,68],[63],[63,64],[64],[199],[200],[71,79,80,81,151,197,198,201,203,213],[71,151,211],[79,80,81,197,198],[77],[202],[76],[75],[126,134,135],[132,133],[81,126],[81,126,131,133],[81,130,132],[128,129],[126,136],[81,126,127,129],[81,128],[125,130],[81,96,98,123,124,129,133]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},"73cc073d7a102374d6b9bcdbde8072f3aa3c8f86767f562086b6a7a7df5f22c0","e66deb230968faf1a8f37ea6f217f319dd0dad7a39ead1bf5d4f54e2eb5ce4bd","13ee17bbdd42459d6450899cea1999aab64c723328e773c0be5e8a13b51b6259","f79062b892847b4e33d0b730bf9dcf66ac24fc3fe9df7bba4d0997c6bdf6cbde","20f3a5481b2c009533e9e6b864cbd4ae3c09ccfca0577918b3587cda295e7071","2797c77cc0da0836a37c8c1fe64942a999c73f811f5481d827ac7d8cb9ddedd3","5a40849c3a5d5a8c2aa754fc964830ea344c94bfeddd4b442bdeae899e2f5339","848836f528d4ac80a5b3212c719225a3ba09406d44fea755cb642299a68d7056","fae981646738728f2b882c14625b99c23c430400a21c081dc6888d9703bd6c68","45c8a077eb724bae4e1fc0d15f76618650e32e55c4582dc1f27153ecdeb66ca6","302c082712d8fe41be387cd34af45b163b5314c04ddeefe53b1cb57fe46d3221","0c1a84d7b974db1961c6e9ab71d5257dfa38d99fb6300f22de55750526c9daef","69bc40bb169ea922cab72dc2142f37e75b44095cf1e79ca1b2809164c284de57",{"version":"264f935450101e4b000eb351cf75c9d799ca20a278b260a9e5770303b5f2b6a3","impliedFormat":99},{"version":"f6f171b23ae6db93454343f1b788960f799c8f37043904874a752c0990c6fca6","impliedFormat":99},{"version":"089f9928e7ab1ca2c225e167a80ff1cb5ed0a71c98be7e81f040a51e2cc6bf5e","impliedFormat":99},{"version":"b11acc27c280988d7256bbd8ffe9f1cb5a0e5ed17cddf5335289ee0e81500369","affectsGlobalScope":true,"impliedFormat":99},{"version":"02ab5dbcaa58da1d58c46c7cdfa7f94792c5ccf0fc7c0622ef33755fe415366c","impliedFormat":99},{"version":"2a04530c2579ddcf996e1cf017caaba573e0ebf8a5b9e45d3bc25ba4489fb5a3","impliedFormat":99},"f41d91b2db1112fcc673a6862fe68cadcbdd0a66ed16b47ac74a0a6da8932bb4","e689cc8cd8a102d31c9d3a7b0db0028594202093c4aca25982b425e8ae744556","1b4ed9deaba72d4bc8495bf46db690dbf91040da0cb2401db10bad162732c0e2","478e59ac0830a0f6360236632d0d589fb0211183aa1ab82292fbca529c0cce35",{"version":"89121c1bf2990f5219bfd802a3e7fc557de447c62058d6af68d6b6348d64499a","impliedFormat":1},{"version":"d4a22007b481fe2a2e6bfd3a42c00cd62d41edb36d30fc4697df2692e9891fc8","impliedFormat":1},{"version":"a5dbd4c9941b614526619bad31047ddd5f504ec4cdad88d6117b549faef34dd3","impliedFormat":99},{"version":"d36518bd617ff673c7d9f372706f241932a43f27673187f2a8472e93c40041c6","impliedFormat":99},{"version":"f8eb2909590ec619643841ead2fc4b4b183fbd859848ef051295d35fef9d8469","impliedFormat":99},{"version":"fe784567dd721417e2c4c7c1d7306f4b8611a4f232f5b7ce734382cf34b417d2","impliedFormat":99},{"version":"2b37ba54ec067598bf912d56fcb81f6d8ad86a045c757e79440bdef97b52fe1b","impliedFormat":99},{"version":"1bc9dd465634109668661f998485a32da369755d9f32b5a55ed64a525566c94b","impliedFormat":99},{"version":"5702b3c2f5d248290ed99419d77ca1cc3e6c29db5847172377659c50e6303768","impliedFormat":99},{"version":"9764b2eb5b4fc0b8951468fb3dbd6cd922d7752343ef5fbf1a7cd3dfcd54a75e","impliedFormat":99},{"version":"1fc2d3fe8f31c52c802c4dee6c0157c5a1d1f6be44ece83c49174e316cf931ad","impliedFormat":99},{"version":"dc4aae103a0c812121d9db1f7a5ea98231801ed405bf577d1c9c46a893177e36","impliedFormat":99},{"version":"106d3f40907ba68d2ad8ce143a68358bad476e1cc4a5c710c11c7dbaac878308","impliedFormat":99},{"version":"42ad582d92b058b88570d5be95393cf0a6c09a29ba9aa44609465b41d39d2534","impliedFormat":99},{"version":"36e051a1e0d2f2a808dbb164d846be09b5d98e8b782b37922a3b75f57ee66698","impliedFormat":99},{"version":"4f7e6730a707b0d4971d96de3b562819ce304af770723707a58a578dd55a5e52","impliedFormat":99},{"version":"d1c1213e9176398b4d1d9aa543691181fd5ae23ae5415e80ede41f1ec1ccf72a","impliedFormat":99},{"version":"45d1e8fb4fd3e265b15f5a77866a8e21870eae4c69c473c33289a4b971e93704","impliedFormat":99},{"version":"cd40919f70c875ca07ecc5431cc740e366c008bcbe08ba14b8c78353fb4680df","impliedFormat":99},{"version":"ddfd9196f1f83997873bbe958ce99123f11b062f8309fc09d9c9667b2c284391","impliedFormat":99},{"version":"2999ba314a310f6a333199848166d008d088c6e36d090cbdcc69db67d8ae3154","impliedFormat":99},{"version":"62c1e573cd595d3204dfc02b96eba623020b181d2aa3ce6a33e030bc83bebb41","impliedFormat":99},{"version":"ca1616999d6ded0160fea978088a57df492b6c3f8c457a5879837a7e68d69033","impliedFormat":99},{"version":"835e3d95251bbc48918bb874768c13b8986b87ea60471ad8eceb6e38ddd8845e","impliedFormat":99},{"version":"de54e18f04dbcc892a4b4241b9e4c233cfce9be02ac5f43a631bbc25f479cd84","impliedFormat":99},{"version":"453fb9934e71eb8b52347e581b36c01d7751121a75a5cd1a96e3237e3fd9fc7e","impliedFormat":99},{"version":"bc1a1d0eba489e3eb5c2a4aa8cd986c700692b07a76a60b73a3c31e52c7ef983","impliedFormat":99},{"version":"4098e612efd242b5e203c5c0b9afbf7473209905ab2830598be5c7b3942643d0","impliedFormat":99},{"version":"28410cfb9a798bd7d0327fbf0afd4c4038799b1d6a3f86116dc972e31156b6d2","impliedFormat":99},{"version":"514ae9be6724e2164eb38f2a903ef56cf1d0e6ddb62d0d40f155f32d1317c116","impliedFormat":99},{"version":"970e5e94a9071fd5b5c41e2710c0ef7d73e7f7732911681592669e3f7bd06308","impliedFormat":99},{"version":"491fb8b0e0aef777cec1339cb8f5a1a599ed4973ee22a2f02812dd0f48bd78c1","impliedFormat":99},{"version":"6acf0b3018881977d2cfe4382ac3e3db7e103904c4b634be908f1ade06eb302d","impliedFormat":99},{"version":"2dbb2e03b4b7f6524ad5683e7b5aa2e6aef9c83cab1678afd8467fde6d5a3a92","impliedFormat":99},{"version":"135b12824cd5e495ea0a8f7e29aba52e1adb4581bb1e279fb179304ba60c0a44","impliedFormat":99},{"version":"e4c784392051f4bbb80304d3a909da18c98bc58b093456a09b3e3a1b7b10937f","impliedFormat":99},{"version":"2e87c3480512f057f2e7f44f6498b7e3677196e84e0884618fc9e8b6d6228bed","impliedFormat":99},{"version":"66984309d771b6b085e3369227077da237b40e798570f0a2ddbfea383db39812","impliedFormat":99},{"version":"e41be8943835ad083a4f8a558bd2a89b7fe39619ed99f1880187c75e231d033e","impliedFormat":99},{"version":"260558fff7344e4985cfc78472ae58cbc2487e406d23c1ddaf4d484618ce4cfd","impliedFormat":99},{"version":"e6274d956641c1cbd5a01a221a85a6671fd85104ed6b530f8d34ad3086804133","impliedFormat":99},{"version":"77516308358982bb05209e8c0ed6f321860e03393587d89f61055941e5bbcdd2","impliedFormat":99},{"version":"dc8652855a95ef9b9c12be8d2f5e6fc37b96aa2144f6c6f195cd1d2e07f721ee","impliedFormat":99},"e2cb25ca55e10ba874410188a53331a6b0b2bc13c0ee4d538bde50460a4e1b77","041afde4e1ac27e6fabdc2ca87882a3a766443fcfe1a1cfc3ed78bcc1c25b28a","c2049793874bbeafd60402bab915f3d285f4057e718dfdefe8a54ccc80c991dd","8a2b6f999a708119f4fa55fc58c5803ca9563340d0a54b9fe2a4fa14838f148c","2db5b1bbf946e20cef3c889cb7be46e3da384bdd1b4b53964253d97635718774","79e620484ae1a7011482631159563e4729f7f4d4c316b914125cb95f678ffbb9","6434c2976daf446cfd95935af4e0a0b6b369ce81af183579dab3ac6567dbbfd0","f50c1778b48a9275078ad81abaa5b4cb13a295b3889986f8e72fe61dd9cd8b86","6e935a5aec1b1f86cfa97fb93ec13c8759479712014d7dc4c13f140f7d409357","8cd4c86b90f9a96ba804585a4b6a998f484a860af3dfd12641ecb9eca109274b","8cd4c86b90f9a96ba804585a4b6a998f484a860af3dfd12641ecb9eca109274b","1b92de1f5b74cf4bda283aa7688c80781e9c7273f44a4ef2db084747a94be933","8c24aeb14985e8089f29e1fea075e95a7c8825077277079d5dc4130ceb6339de","ff041f34cc1936cb45f94de1924d396abd69b3d6e0cc887dfaa0b6ec176e27e1","6abd2f68e6651205f5d7763dcf7a5b5e5dc28b6194b097b467913d2cf19c1dd2","c04c352fc277c57e16519814a13e1b84e6c54c461b89ee63c8bff94ddf615555","e406a8398f12e8bb0d7661b9974a9ce78043a916cd2c652f7b82b7889e57f9e8","441c8ea68ff583cefd0f77d2a1699f6328d714ebfb9435ffedad5470392de2e7","cc60d13b9e2058908f082cca058357d2ebd83143b3dc4e3a01731e8a4b7ae2fe","5ca4d7a999b9fa8c7e2ef9746968eaeabb8e69a904cc62a3c18ac23b9664c8a8","bff722032fb479d76cdd167e0aa05e2e3ca9b728cff777e893aa694bad01e3a9","de54e6c6d074b3a521a47b0fbe17732a951a852ef704402daceabcd450134283","ad43cfeea2ffc4f26107e49ae92bed3fe01b0c2aa3e328e293d7b0dceb01300f","50e52950b1b92455f40c3fba61ee9a43e74bf9bdf6a25e01ad2e3a2226bbb2ec","cd2e2d6ffad8a1de80249fd4aa35f6c6f9160c18f69fbaf6507072eba208abda","3b8dd8f967501f6193f2d31f8a124e05186264f37f1b73d073cf39c6e123fe50","bc699cb86e1528d370a29ae99fe8f89e3a838bb620ad4071a4c9999a390c8361",{"version":"cf2bb69c10b7b96ae10deb9eb729b80eef4cc8bdf8185ce71699efe0c119523c","impliedFormat":99},{"version":"0ec0fc134f1eae55319405fd07e9047fbe1b95633cb4cf2b7372295f17a97c8a","impliedFormat":99},{"version":"b7ff5469bbc422ee71f99e0cf80df682705418cab9debec98a179b507279422b","impliedFormat":99},{"version":"4aaec46d87b61005f0636086f814ebe4b74ca9eb8c8717a715a1704a0fd7cc4f","impliedFormat":99},{"version":"213cc2bbed6c63f88c837b322be41aa398d8b2e5f9cbace643070bece31c624f","impliedFormat":99},{"version":"f3745a58f2bd7ed2c210e882e95b67d0707f97b9ed7b2431f68e5cccec0e20ba","impliedFormat":99},{"version":"2435893282189602e1c3c5ae3f08a0129508c4ab3db3895c436525bd238ef2b6","impliedFormat":99},{"version":"48da7dc25036f0b595b89ee6a96b8a14f2be5508025ec6728d24c57ca46cb862","impliedFormat":99},{"version":"eb7375e005b02971567356809faeeecf14becb300aa9ca483fcd6c9f8aa80d8c","impliedFormat":99},{"version":"e7c738913fab4ba4b00fcf1d1eb1ddf8989b64355da34250407340f4894a2384","impliedFormat":99},{"version":"c871756fb890365824f416826bb7bb363b06c4aa48f1a99263c4fb75ab690b2d","impliedFormat":99},{"version":"c393916098a0b9efbb4ff8ca4ec3eea4af49b9bfe29dfa95ee114e31027281b0","impliedFormat":99},{"version":"431eef47c55a88198c1cc62ea7c9c7537c3219c3fd652c554d3d5bb7a63658a1","impliedFormat":99},{"version":"5af472ea6bfd88682ec2b0861190274781bc3663cd9def4e6ea19449c4027822","impliedFormat":99},{"version":"16b311651dbd580d429938c993c41e1c610ef0b1e83c38229f3ad4d81a35cd39","impliedFormat":99},{"version":"cf2d902695f41deaf5a8f2438fd2ff0c2d56c3a3c0b9ea238881810952ee688f","impliedFormat":99},{"version":"e2144e03793b72e207844641a7ee30d138498d4f7df7f1f2dceab39725591620","impliedFormat":99},{"version":"064733c01462ae496e7b62ffce6a3cb21facb351c0375b151ed66da38de60d69","impliedFormat":99},{"version":"7740c53681ca94000f5cda0c7e6ed6e59ac8157ed36ffdf4da33ec3b5dcc7252","impliedFormat":99},{"version":"a8f20ac0e03797b0d295255ea127050369890396af453a68646b2e18f0e5dd8a","impliedFormat":99},{"version":"4f1d88b42e347f1868a0bd8db7563bc54017c5112a6edb01d5617c342995fdc7","impliedFormat":99},{"version":"f1add31820a8e538ced1fa56092ad68adb998e0e48cecbf4e69b0638391fe5c5","impliedFormat":99},{"version":"a11c0481bbb4d82204954b2d83865b29878713af71d71e72bfb28e5c2138bcaa","impliedFormat":99},{"version":"641d8f8dfc4bfe0dde269a852b6e5711a64dc19faa7c4780f06f3614fc94280a","impliedFormat":99},{"version":"46430bab437cb8c642d528c3d620d483f6b8fa573db004cdcb174ed092170cb9","impliedFormat":99},{"version":"75c4e0aa4e6dd5efaeb4471455cd730c1c21baacdc60bb6d13ae87fd40a55625","impliedFormat":99},{"version":"3d7e49aaf4991f94fe1971cbb39959281274c488d209eac04b9a719bbcb13184","impliedFormat":99},{"version":"8249670da9c5c37d7cdd03576170536f4c3c9cdcfe8cf21df0bbb07a45e5f748","impliedFormat":99},{"version":"d9b96d27372967e8f53b3f7b7cb6e875b8d128080abc4fa204a13f0d3f2b6506","impliedFormat":99},{"version":"d41b65a0fb48a14a7b52eaa45d9b65988af076e63704cba1dd1f72e961e0e2f5","impliedFormat":99},{"version":"92b40a9393f937e4bd7eed4b0161ad03296607bfdf26b0bb323cde18c51e0687","impliedFormat":99},{"version":"fdcbabde604d3123e01b2dc359fe3a0d64e6c1563b8c6a27ec0d626f528f7670","impliedFormat":99},{"version":"2ad0442c75921db414cc44cbb07b3225796096ad660da7aa26a36ec54ac370f9","impliedFormat":99},{"version":"59217222f06b2b24784160c8e2eaf0de94906912505101576a1dd744fd90cdcf","impliedFormat":99},{"version":"c60e185eaab239d465baec8e4a8c2f76fdff641431cb57d12c4e233d61be5474","impliedFormat":99},{"version":"d8b6dc94bc2761afdcff7a1e29359a383472bd8af2ce03485a2792026f15f458","impliedFormat":99},{"version":"1955442a305cd1622782ce89c898be431c66c39c36a253abb0543052f4917613","impliedFormat":99},{"version":"2251d1a89b3d8aac866bc79839c28681886d289d117404276ecf1d4fd5f5c19c","impliedFormat":99},{"version":"2a55511100028e4af650f52bdd7826fb187b9eee380b7ce9249a69f0713503fa","impliedFormat":99},{"version":"8bdf3edd4e55c0167be8af39a89763628fba6d8670777f720957f080c2ce9a50","impliedFormat":99},{"version":"992442834491efb053df22fb8148f8fd1303c198c97f5b50ebf1dd0f63ae5e8b","impliedFormat":99},{"version":"092274870bfdbb373ea502c23b8205d30e622fd10a7e5370d752a6d8de761110","impliedFormat":99},{"version":"e86a45fac2071035f07ade063ad32754edd13f45f3f3b143387ec01b8eb8aec9","impliedFormat":99},{"version":"9d6fcf45c88c41f81ac9a39df453089cad491812291c260f19d85df9fd6ad130","impliedFormat":99},{"version":"819ff6185962272453fe11af8d9f3da27f5d3761b21e196272db43ff54e4caa4","impliedFormat":99},{"version":"eabd2ac406cae917ac8e00029972e27b29329e153c4146b3779f4863bd980298","impliedFormat":99},{"version":"fe27faad99a5cadbc311b6249c496142979d89593f36044999b4f74aa19af129","impliedFormat":99},"16976e5481a0abbe56fa82010ecd47c152e76d9c7ecb5977d68a1b2c4a785c91","749f3bd08d4fc5cc1c95e3c3b07dede327898a51cf6fa7f156456c0d46aae680","7797184093e9b9f6203d001829de6f91d142497913c67a8d0c2a5b25de005a68",{"version":"c18f616b098332f45b312f3c1385de32e7b3dba6a3da8a778547dcd7ed264649","impliedFormat":99},"8218396f3bd9e5724bc2fb6592a1da7d2254fd1d4459f0117ef8d27084e15fd4",{"version":"14df8f3b1fd5b5cdc11bea5eadee07b107719aefd705a97c699465a31488f11a","impliedFormat":99},{"version":"af2b10bef3a184fa0d328174c16d7cf57cca0c3b2a90f5fc747f3fd1da778242","impliedFormat":99},{"version":"54da059a66903d893b19aba580f6867f1fecb0eb21bfd4247772efe1aa098a3a","impliedFormat":99},{"version":"cb7d65d835ddbbb3ebd28af23f1cbe63cbf0d59d3db2bcdcf837e5cb35fd4e37","impliedFormat":99},{"version":"6d114aaee9658ebb6fd05f921d75f7014e208ac61f32aecd1b0f233a6b022901","impliedFormat":99},{"version":"aebc9aea7d7c9be6dea7442ba0c28c3092937d6e0f8cab421a2452796e795d1a","impliedFormat":99},{"version":"456adef97f2428e2efbe0d4a9c18335320aef02f9f58e47b63bc6d12b92ca1d8","impliedFormat":99},{"version":"dab515527b0013870d9a7d3fa94bdb5110968853f1044f291208b1b512cd4917","signature":"bf6b33c00b2be4370a71d69863b5c01b0a5c7721ced6ed90f945abc1f436472f"},{"version":"a1a0b32a01d8ebb67ec3082be579b0bddd6046d6e47b31a65077f1b5344bf3c5","signature":"2838f00a56d5754e467a2f9eb84b0fe5c839d41195a405c863b48ff038b2ad67"},"37d1586d3dc0a8ed89b3364fd52cc13e5cea1212729aa7ef5d3f65040c0cb5ac"],"root":[[211,213]],"options":{"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"module":99,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitOverride":true,"noImplicitReturns":true,"noPropertyAccessFromIndexSignature":false,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":5,"tsBuildInfoFile":"./tsconfig.tsbuildinfo","useUnknownInCatchVariables":true,"verbatimModuleSyntax":true},"referencedMap":[[83,1],[87,2],[86,3],[85,4],[121,5],[101,6],[102,6],[103,6],[104,6],[105,6],[106,6],[107,7],[109,6],[108,6],[120,8],[110,6],[112,6],[111,6],[114,6],[113,6],[115,6],[116,6],[117,6],[118,6],[119,6],[100,6],[99,9],[77,10],[202,11],[73,12],[76,13],[74,14],[75,15],[98,16],[97,17],[123,18],[122,19],[124,20],[94,21],[96,22],[95,23],[89,24],[88,1],[91,25],[90,26],[209,27],[204,28],[208,29],[206,30],[207,31],[210,32],[198,33],[197,34],[196,35],[165,36],[193,37],[187,37],[188,37],[189,38],[190,37],[191,37],[192,37],[194,37],[195,39],[166,40],[169,41],[185,40],[163,42],[170,43],[172,43],[171,44],[177,45],[175,46],[176,47],[174,48],[173,49],[179,50],[158,51],[178,52],[180,53],[164,54],[181,55],[182,56],[183,57],[184,58],[162,59],[167,60],[160,61],[168,62],[157,63],[156,64],[186,65],[159,66],[149,67],[150,68],[151,69],[137,70],[138,71],[139,72],[140,73],[141,74],[148,75],[142,76],[146,71],[143,77],[147,78],[144,79],[145,77],[60,80],[61,81],[59,82],[71,83],[67,84],[66,85],[68,86],[70,87],[69,88],[64,89],[65,90],[63,91],[200,92],[201,93],[211,94],[212,95],[213,96],[78,97],[203,98],[81,14],[79,99],[80,100],[136,101],[134,102],[131,103],[132,104],[133,105],[135,106],[127,107],[128,108],[129,109],[126,110],[130,111]],"latestChangedDtsFile":"./index.d.ts","version":"6.0.2"}
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@jvs-milkdown/plugin-collab",
3
+ "version": "1.0.0",
4
+ "keywords": [
5
+ "Yjs",
6
+ "collaboration",
7
+ "milkdown",
8
+ "milkdown plugin",
9
+ "shared-editing"
10
+ ],
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/Milkdown/milkdown.git",
15
+ "directory": "packages/plugins/plugin-collab"
16
+ },
17
+ "files": [
18
+ "lib",
19
+ "src"
20
+ ],
21
+ "type": "module",
22
+ "sideEffects": false,
23
+ "main": "./lib/index.js",
24
+ "exports": {
25
+ ".": {
26
+ "import": "./lib/index.js",
27
+ "types": "./lib/index.d.ts"
28
+ }
29
+ },
30
+ "dependencies": {
31
+ "@jvs-milkdown/ctx": "1.0.0",
32
+ "@jvs-milkdown/core": "1.0.0",
33
+ "@jvs-milkdown/exception": "1.0.0",
34
+ "@jvs-milkdown/prose": "1.0.0"
35
+ },
36
+ "devDependencies": {
37
+ "y-prosemirror": "^1.2.15",
38
+ "y-protocols": "^1.0.6",
39
+ "yjs": "^13.6.23"
40
+ },
41
+ "peerDependencies": {
42
+ "y-prosemirror": "*",
43
+ "y-protocols": "*",
44
+ "yjs": "*"
45
+ },
46
+ "scripts": {
47
+ "build": "vite build"
48
+ },
49
+ "types": "./lib/index.d.ts"
50
+ }
@@ -0,0 +1,249 @@
1
+ import type { DefaultValue } from '@jvs-milkdown/core'
2
+ import type { Ctx } from '@jvs-milkdown/ctx'
3
+ import type { Node } from '@jvs-milkdown/prose/model'
4
+ import type { DecorationAttrs } from '@jvs-milkdown/prose/view'
5
+ import type { Awareness } from 'y-protocols/awareness'
6
+ import type { Doc, PermanentUserData, XmlFragment } from 'yjs'
7
+
8
+ import {
9
+ editorViewCtx,
10
+ getDoc,
11
+ parserCtx,
12
+ prosePluginsCtx,
13
+ schemaCtx,
14
+ } from '@jvs-milkdown/core'
15
+ import { ctxNotBind, missingYjsDoc } from '@jvs-milkdown/exception'
16
+ import { keydownHandler } from '@jvs-milkdown/prose/keymap'
17
+ import { Plugin, PluginKey } from '@jvs-milkdown/prose/state'
18
+ import {
19
+ prosemirrorToYDoc,
20
+ redo,
21
+ undo,
22
+ yCursorPlugin,
23
+ yCursorPluginKey,
24
+ yXmlFragmentToProseMirrorRootNode,
25
+ ySyncPlugin,
26
+ ySyncPluginKey,
27
+ yUndoPlugin,
28
+ yUndoPluginKey,
29
+ } from 'y-prosemirror'
30
+ import { applyUpdate, encodeStateAsUpdate } from 'yjs'
31
+
32
+ /// @internal
33
+ export interface ColorDef {
34
+ light: string
35
+ dark: string
36
+ }
37
+
38
+ /// @internal
39
+ export interface YSyncOpts {
40
+ colors?: Array<ColorDef>
41
+ colorMapping?: Map<string, ColorDef>
42
+ permanentUserData?: PermanentUserData | null
43
+ }
44
+
45
+ /// @internal
46
+ export interface yCursorOpts {
47
+ cursorBuilder?: (arg: any) => HTMLElement
48
+ selectionBuilder?: (arg: any) => DecorationAttrs
49
+ getSelection?: (arg: any) => any
50
+ }
51
+
52
+ /// @internal
53
+ export interface yUndoOpts {
54
+ protectedNodes?: Set<string>
55
+ trackedOrigins?: any[]
56
+ undoManager?: any
57
+ }
58
+
59
+ /// Options for the collab service.
60
+ export interface CollabServiceOptions {
61
+ /// The field name of the yCursor plugin.
62
+ yCursorStateField?: string
63
+
64
+ /// Options for the ySync plugin.
65
+ ySyncOpts?: YSyncOpts
66
+
67
+ /// Options for the yCursor plugin.
68
+ yCursorOpts?: yCursorOpts
69
+
70
+ /// Options for the yUndo plugin.
71
+ yUndoOpts?: yUndoOpts
72
+ }
73
+
74
+ /// @internal
75
+ export const CollabKeymapPluginKey = new PluginKey('MILKDOWN_COLLAB_KEYMAP')
76
+
77
+ const collabPluginKeys = [
78
+ CollabKeymapPluginKey,
79
+ ySyncPluginKey,
80
+ yCursorPluginKey,
81
+ yUndoPluginKey,
82
+ ]
83
+
84
+ /// The collab service is used to manage the collaboration plugins.
85
+ /// It is used to provide the collaboration plugins to the editor.
86
+ export class CollabService {
87
+ /// @internal
88
+ #options: CollabServiceOptions = {}
89
+ /// @internal
90
+ #xmlFragment: XmlFragment | null = null
91
+ /// @internal
92
+ #awareness: Awareness | null = null
93
+ /// @internal
94
+ #ctx: Ctx | null = null
95
+ /// @internal
96
+ #connected = false
97
+
98
+ /// @internal
99
+ #valueToNode(value: DefaultValue): Node | undefined {
100
+ if (!this.#ctx) throw ctxNotBind()
101
+
102
+ const schema = this.#ctx.get(schemaCtx)
103
+ const parser = this.#ctx.get(parserCtx)
104
+
105
+ const doc = getDoc(value, parser, schema)
106
+ return doc
107
+ }
108
+
109
+ /// @internal
110
+ #createPlugins(): Plugin[] {
111
+ if (!this.#xmlFragment) throw missingYjsDoc()
112
+ const { ySyncOpts, yUndoOpts } = this.#options
113
+ const plugins = [
114
+ ySyncPlugin(this.#xmlFragment, ySyncOpts),
115
+ yUndoPlugin(yUndoOpts),
116
+ new Plugin({
117
+ key: CollabKeymapPluginKey,
118
+ props: {
119
+ handleKeyDown: keydownHandler({
120
+ 'Mod-z': undo,
121
+ 'Mod-y': redo,
122
+ 'Mod-Shift-z': redo,
123
+ }),
124
+ },
125
+ }),
126
+ ]
127
+ if (this.#awareness) {
128
+ const { yCursorOpts, yCursorStateField } = this.#options
129
+ plugins.push(
130
+ yCursorPlugin(
131
+ this.#awareness,
132
+ yCursorOpts as Required<yCursorOpts>,
133
+ yCursorStateField
134
+ )
135
+ )
136
+ }
137
+
138
+ return plugins
139
+ }
140
+
141
+ /// @internal
142
+ #flushEditor(plugins: Plugin[]) {
143
+ if (!this.#ctx) throw ctxNotBind()
144
+ this.#ctx.set(prosePluginsCtx, plugins)
145
+
146
+ const view = this.#ctx.get(editorViewCtx)
147
+ const newState = view.state.reconfigure({ plugins })
148
+ view.updateState(newState)
149
+ }
150
+
151
+ /// Bind the context to the service.
152
+ bindCtx(ctx: Ctx) {
153
+ this.#ctx = ctx
154
+ return this
155
+ }
156
+
157
+ /// Bind the document to the service.
158
+ bindDoc(doc: Doc) {
159
+ this.#xmlFragment = doc.getXmlFragment('prosemirror')
160
+ return this
161
+ }
162
+
163
+ /// Bind the Yjs XmlFragment to the service.
164
+ bindXmlFragment(xmlFragment: XmlFragment) {
165
+ this.#xmlFragment = xmlFragment
166
+ return this
167
+ }
168
+
169
+ /// Set the options of the service.
170
+ setOptions(options: CollabServiceOptions) {
171
+ this.#options = options
172
+ return this
173
+ }
174
+
175
+ /// Merge some options to the service.
176
+ /// The options will be merged to the existing options.
177
+ /// THe options should be partial of the `CollabServiceOptions`.
178
+ mergeOptions(options: Partial<CollabServiceOptions>) {
179
+ Object.assign(this.#options, options)
180
+ return this
181
+ }
182
+
183
+ /// Set the awareness of the service.
184
+ setAwareness(awareness: Awareness) {
185
+ this.#awareness = awareness
186
+ return this
187
+ }
188
+
189
+ /// Apply the template to the document.
190
+ applyTemplate(
191
+ template: DefaultValue,
192
+ condition?: (yDocNode: Node, templateNode: Node) => boolean
193
+ ) {
194
+ if (!this.#ctx) throw ctxNotBind()
195
+ if (!this.#xmlFragment) throw missingYjsDoc()
196
+ const conditionFn =
197
+ condition || ((yDocNode) => yDocNode.textContent.length === 0)
198
+
199
+ const node = this.#valueToNode(template)
200
+ const schema = this.#ctx.get(schemaCtx)
201
+ const yDocNode = yXmlFragmentToProseMirrorRootNode(
202
+ this.#xmlFragment,
203
+ schema
204
+ )
205
+
206
+ if (node && conditionFn(yDocNode, node)) {
207
+ const fragment = this.#xmlFragment
208
+ fragment.delete(0, fragment.length)
209
+ const templateDoc = prosemirrorToYDoc(node)
210
+ const template = encodeStateAsUpdate(templateDoc)
211
+ if (fragment.doc) applyUpdate(fragment.doc, template)
212
+ templateDoc.destroy()
213
+ }
214
+
215
+ return this
216
+ }
217
+
218
+ /// Connect the service.
219
+ connect() {
220
+ if (!this.#ctx) throw ctxNotBind()
221
+ if (this.#connected) return
222
+
223
+ const prosePlugins = this.#ctx.get(prosePluginsCtx)
224
+ const collabPlugins = this.#createPlugins()
225
+ const plugins = prosePlugins.concat(collabPlugins)
226
+
227
+ this.#flushEditor(plugins)
228
+ this.#connected = true
229
+
230
+ return this
231
+ }
232
+
233
+ /// Disconnect the service.
234
+ disconnect() {
235
+ if (!this.#ctx) throw ctxNotBind()
236
+ if (!this.#connected) return this
237
+
238
+ const prosePlugins = this.#ctx.get(prosePluginsCtx)
239
+ const plugins = prosePlugins.filter(
240
+ (plugin) =>
241
+ !plugin.spec.key || !collabPluginKeys.includes(plugin.spec.key)
242
+ )
243
+
244
+ this.#flushEditor(plugins)
245
+ this.#connected = false
246
+
247
+ return this
248
+ }
249
+ }
package/src/index.ts ADDED
@@ -0,0 +1,35 @@
1
+ import type { MilkdownPlugin } from '@jvs-milkdown/ctx'
2
+
3
+ import { EditorViewReady } from '@jvs-milkdown/core'
4
+ import { createSlice, createTimer } from '@jvs-milkdown/ctx'
5
+
6
+ import { CollabService } from './collab-service'
7
+
8
+ /// A slice that contains the collab service.
9
+ export const collabServiceCtx = createSlice(
10
+ new CollabService(),
11
+ 'collabServiceCtx'
12
+ )
13
+
14
+ /// The timer that indicates the collab plugin is ready.
15
+ export const CollabReady = createTimer('CollabReady')
16
+
17
+ /// The collab plugin.
18
+ export const collab: MilkdownPlugin = (ctx) => {
19
+ const collabService = new CollabService()
20
+ ctx.inject(collabServiceCtx, collabService).record(CollabReady)
21
+ return async () => {
22
+ await ctx.wait(EditorViewReady)
23
+ collabService.bindCtx(ctx)
24
+ ctx.done(CollabReady)
25
+ return () => {
26
+ ctx.remove(collabServiceCtx).clearTimer(CollabReady)
27
+ }
28
+ }
29
+ }
30
+ collab.meta = {
31
+ package: '@jvs-milkdown/plugin-collab',
32
+ displayName: 'Collab',
33
+ }
34
+
35
+ export * from './collab-service'
package/src/shim.d.ts ADDED
@@ -0,0 +1,62 @@
1
+ declare module 'y-prosemirror' {
2
+ import type { Node, Schema } from '@jvs-milkdown/prose/model'
3
+ import type { Plugin, PluginKey } from '@jvs-milkdown/prose/state'
4
+ import type { DecorationAttrs } from '@jvs-milkdown/prose/view'
5
+ import type { Awareness } from 'y-protocols/awareness'
6
+ import type * as Y from 'yjs'
7
+
8
+ interface ColorDef {
9
+ light: string
10
+ dark: string
11
+ }
12
+ interface YSyncOpts {
13
+ colors?: Array<ColorDef>
14
+ colorMapping?: Map<string, ColorDef>
15
+ permanentUserData?: Y.PermanentUserData | null
16
+ /**
17
+ * Fired when the content from Yjs is initially rendered to ProseMirror
18
+ */
19
+ onFirstRender?: Function
20
+ }
21
+ export function prosemirrorToYDoc(doc: Node, xmlFragment?: string): Y.Doc
22
+ export function undo(state: any): boolean
23
+ export function redo(state: any): boolean
24
+ export function yUndoPlugin({
25
+ protectedNodes,
26
+ trackedOrigins,
27
+ undoManager,
28
+ }?: {
29
+ protectedNodes?: Set<string>
30
+ trackedOrigins?: any[]
31
+ undoManager?: any
32
+ }): Plugin<{
33
+ undoManager: any
34
+ prevSel: any
35
+ hasUndoOps: boolean
36
+ hasRedoOps: boolean
37
+ }>
38
+ export function yCursorPlugin(
39
+ awareness: Awareness,
40
+ {
41
+ cursorBuilder,
42
+ selectionBuilder,
43
+ getSelection,
44
+ }?: {
45
+ cursorBuilder?: (arg0: any) => HTMLElement
46
+ selectionBuilder?: (arg0: any) => DecorationAttrs
47
+ getSelection?: (arg0: any) => any
48
+ },
49
+ cursorStateField?: string
50
+ ): any
51
+ export const yCursorPluginKey: PluginKey<any>
52
+ export const ySyncPluginKey: PluginKey<any>
53
+ export const yUndoPluginKey: PluginKey<any>
54
+ export function yXmlFragmentToProseMirrorRootNode(
55
+ yXmlFragment: Y.XmlFragment,
56
+ schema: Schema
57
+ ): Node
58
+ export function ySyncPlugin(
59
+ yXmlFragment: Y.XmlFragment,
60
+ { colors, colorMapping, permanentUserData, onFirstRender }?: YSyncOpts
61
+ ): any
62
+ }