@dxos/react-ui-editor 0.3.9-main.b7e6a67 → 0.3.9-main.c414ce0
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/dist/lib/browser/index.mjs +973 -499
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/automerge/automerge-plugin/PatchSemaphore.d.ts +2 -2
- package/dist/types/src/automerge/automerge-plugin/PatchSemaphore.d.ts.map +1 -1
- package/dist/types/src/automerge/automerge-plugin/codeMirrorToAm.d.ts +2 -2
- package/dist/types/src/automerge/automerge-plugin/codeMirrorToAm.d.ts.map +1 -1
- package/dist/types/src/automerge/automerge-plugin/handle.d.ts +9 -0
- package/dist/types/src/automerge/automerge-plugin/handle.d.ts.map +1 -0
- package/dist/types/src/automerge/automerge-plugin/index.d.ts +2 -2
- package/dist/types/src/automerge/automerge-plugin/index.d.ts.map +1 -1
- package/dist/types/src/automerge/automerge-plugin/plugin.d.ts +6 -5
- package/dist/types/src/automerge/automerge-plugin/plugin.d.ts.map +1 -1
- package/dist/types/src/automerge/automerge.stories.d.ts +2 -1
- package/dist/types/src/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.d.ts +43 -0
- package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts +15 -0
- package/dist/types/src/components/TextEditor/TextEditor.stories.d.ts.map +1 -0
- package/dist/types/{stories/html/code-mirror.stories.d.ts → src/components/TextEditor/codemirror.stories.d.ts} +2 -2
- package/dist/types/src/components/TextEditor/codemirror.stories.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/basic/bundle.d.ts +8 -0
- package/dist/types/src/components/TextEditor/extensions/basic/bundle.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/basic/index.d.ts +3 -0
- package/dist/types/src/components/TextEditor/extensions/basic/index.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/basic/theme.d.ts +10 -0
- package/dist/types/src/components/TextEditor/extensions/basic/theme.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/change.d.ts +7 -0
- package/dist/types/src/components/TextEditor/extensions/change.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.d.ts +11 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.d.ts +8 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.d.ts +10 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/index.d.ts +4 -0
- package/dist/types/src/components/TextEditor/extensions/hyperlink/index.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/index.d.ts +5 -0
- package/dist/types/src/components/TextEditor/extensions/index.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/markdown/bundle.d.ts +8 -0
- package/dist/types/src/components/TextEditor/extensions/markdown/bundle.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/markdown/index.d.ts +3 -0
- package/dist/types/src/components/TextEditor/extensions/markdown/index.d.ts.map +1 -0
- package/dist/types/src/components/{Markdown/markdownTags.d.ts → TextEditor/extensions/markdown/tags.d.ts} +1 -1
- package/dist/types/src/components/TextEditor/extensions/markdown/tags.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/markdown/theme.d.ts +21 -0
- package/dist/types/src/components/TextEditor/extensions/markdown/theme.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/index.d.ts +4 -0
- package/dist/types/src/components/TextEditor/index.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/yjs.stories.d.ts +11 -0
- package/dist/types/src/components/TextEditor/yjs.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useCollaboration.d.ts +9 -0
- package/dist/types/src/hooks/useCollaboration.d.ts.map +1 -0
- package/dist/types/src/{model.d.ts → hooks/useTextModel.d.ts} +3 -15
- package/dist/types/src/hooks/useTextModel.d.ts.map +1 -0
- package/dist/types/src/hooks/yjs/cursors.d.ts.map +1 -0
- package/dist/types/src/hooks/yjs/index.d.ts.map +1 -0
- package/dist/types/src/hooks/yjs/space-provider.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/styles/tokens.d.ts +4 -0
- package/dist/types/src/styles/tokens.d.ts.map +1 -1
- package/dist/types/src/testing/replicator.d.ts +1 -1
- package/dist/types/src/testing/replicator.d.ts.map +1 -1
- package/package.json +34 -27
- package/src/automerge/automerge-plugin/PatchSemaphore.ts +5 -5
- package/src/automerge/automerge-plugin/codeMirrorToAm.ts +10 -7
- package/src/automerge/automerge-plugin/handle.ts +14 -0
- package/src/automerge/automerge-plugin/index.ts +2 -2
- package/src/automerge/automerge-plugin/plugin.ts +39 -10
- package/src/automerge/automerge.stories.tsx +32 -48
- package/src/components/TextEditor/TextEditor.stories.tsx +79 -0
- package/src/components/TextEditor/TextEditor.tsx +188 -0
- package/src/components/TextEditor/codemirror.stories.ts +114 -0
- package/src/components/TextEditor/extensions/basic/bundle.ts +26 -0
- package/src/components/TextEditor/extensions/basic/index.ts +6 -0
- package/src/components/TextEditor/extensions/basic/theme.ts +49 -0
- package/src/components/TextEditor/extensions/change.ts +22 -0
- package/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts +99 -0
- package/src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx +61 -0
- package/src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx +119 -0
- package/src/components/TextEditor/extensions/hyperlink/index.ts +7 -0
- package/src/components/TextEditor/extensions/index.ts +8 -0
- package/src/components/TextEditor/extensions/markdown/bundle.ts +99 -0
- package/src/components/TextEditor/extensions/markdown/index.ts +6 -0
- package/src/components/{Markdown/markdownTheme.ts → TextEditor/extensions/markdown/theme.ts} +42 -27
- package/src/components/TextEditor/index.ts +8 -0
- package/src/components/TextEditor/yjs.stories.tsx +55 -0
- package/src/components/index.ts +1 -3
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useCollaboration.ts +45 -0
- package/src/{model.ts → hooks/useTextModel.ts} +42 -17
- package/src/index.ts +3 -3
- package/src/styles/tokens.ts +6 -0
- package/src/testing/replicator.ts +1 -3
- package/dist/types/src/automerge/demo.d.ts +0 -25
- package/dist/types/src/automerge/demo.d.ts.map +0 -1
- package/dist/types/src/components/Editor/Editor.d.ts +0 -15
- package/dist/types/src/components/Editor/Editor.d.ts.map +0 -1
- package/dist/types/src/components/Editor/Editor.stories.d.ts +0 -28
- package/dist/types/src/components/Editor/Editor.stories.d.ts.map +0 -1
- package/dist/types/src/components/Editor/index.d.ts +0 -2
- package/dist/types/src/components/Editor/index.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/Markdown.d.ts +0 -19
- package/dist/types/src/components/Markdown/Markdown.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/Markdown.stories.d.ts +0 -19
- package/dist/types/src/components/Markdown/Markdown.stories.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/index.d.ts +0 -2
- package/dist/types/src/components/Markdown/index.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/markdownTags.d.ts.map +0 -1
- package/dist/types/src/components/Markdown/markdownTheme.d.ts +0 -107
- package/dist/types/src/components/Markdown/markdownTheme.d.ts.map +0 -1
- package/dist/types/src/components/RichText/RichText.d.ts +0 -20
- package/dist/types/src/components/RichText/RichText.d.ts.map +0 -1
- package/dist/types/src/components/RichText/RichText.stories.d.ts +0 -26
- package/dist/types/src/components/RichText/RichText.stories.d.ts.map +0 -1
- package/dist/types/src/components/RichText/index.d.ts +0 -2
- package/dist/types/src/components/RichText/index.d.ts.map +0 -1
- package/dist/types/src/model.d.ts.map +0 -1
- package/dist/types/src/yjs/cursors.d.ts.map +0 -1
- package/dist/types/src/yjs/index.d.ts.map +0 -1
- package/dist/types/src/yjs/space-provider.d.ts.map +0 -1
- package/dist/types/stories/html/code-mirror.stories.d.ts.map +0 -1
- package/src/automerge/demo.ts +0 -106
- package/src/components/Editor/Editor.stories.tsx +0 -80
- package/src/components/Editor/Editor.tsx +0 -33
- package/src/components/Editor/index.ts +0 -5
- package/src/components/Markdown/Markdown.stories.tsx +0 -56
- package/src/components/Markdown/Markdown.tsx +0 -206
- package/src/components/Markdown/index.ts +0 -5
- package/src/components/RichText/RichText.stories.tsx +0 -68
- package/src/components/RichText/RichText.tsx +0 -181
- package/src/components/RichText/index.ts +0 -5
- /package/dist/types/src/{yjs → hooks/yjs}/cursors.d.ts +0 -0
- /package/dist/types/src/{yjs → hooks/yjs}/index.d.ts +0 -0
- /package/dist/types/src/{yjs → hooks/yjs}/space-provider.d.ts +0 -0
- /package/src/components/{Markdown/markdownTags.ts → TextEditor/extensions/markdown/tags.ts} +0 -0
- /package/src/{yjs → hooks/yjs}/cursors.ts +0 -0
- /package/src/{yjs → hooks/yjs}/index.ts +0 -0
- /package/src/{yjs → hooks/yjs}/space-provider.ts +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { automergePlugin, type AutomergePlugin } from './plugin';
|
|
2
|
+
export { type IDocHandle } from './handle';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type EditorState, type Extension, StateEffect, StateField, type Transaction, type TransactionSpec } from '@codemirror/state';
|
|
2
|
-
import { type EditorView } from '@codemirror/view';
|
|
3
2
|
import * as automerge from '@dxos/automerge/automerge';
|
|
4
|
-
import { type
|
|
5
|
-
import { type
|
|
3
|
+
import { type Heads, type Prop } from '@dxos/automerge/automerge';
|
|
4
|
+
import { type IDocHandle } from './handle';
|
|
6
5
|
export type Value = {
|
|
7
6
|
lastHeads: Heads;
|
|
8
7
|
path: Prop[];
|
|
@@ -16,10 +15,12 @@ export declare const updateHeads: (newHeads: automerge.next.Heads) => StateEffec
|
|
|
16
15
|
export declare const getLastHeads: (state: EditorState, field: Field) => automerge.next.Heads;
|
|
17
16
|
export declare const getPath: (state: EditorState, field: Field) => Prop[];
|
|
18
17
|
export type Field = StateField<Value>;
|
|
19
|
-
export
|
|
18
|
+
export type AutomergePlugin = {
|
|
19
|
+
extension: Extension;
|
|
20
|
+
};
|
|
21
|
+
export declare const automergePlugin: (handle: IDocHandle, path: Prop[]) => AutomergePlugin;
|
|
20
22
|
export declare const reconcileAnnotationType: import("@codemirror/state").AnnotationType<unknown>;
|
|
21
23
|
export declare const isReconcileTx: (tr: Transaction) => boolean;
|
|
22
24
|
export declare const makeReconcile: (tr: TransactionSpec) => void;
|
|
23
|
-
export declare const reconcile: (handle: Peer, view: EditorView) => void;
|
|
24
25
|
export {};
|
|
25
26
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,WAAW,EACX,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../src/automerge/automerge-plugin/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEd,WAAW,EACX,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,SAAS,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,KAAK,CAAC;IACjB,IAAI,EAAE,IAAI,EAAE,CAAC;IACb,wBAAwB,EAAE,WAAW,EAAE,CAAC;CACzC,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,KAAK,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,UAAU,0DAAsC,CAAC;AAE9D,eAAO,MAAM,WAAW,sCAAsB,YAAY,WAAW,CAAgC,CAAC;AAEtG,eAAO,MAAM,YAAY,UAAW,WAAW,uCAAsD,CAAC;AAEtG,eAAO,MAAM,OAAO,UAAW,WAAW,mBAAiB,IAAI,EAA6B,CAAC;AAE7F,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAMtC,MAAM,MAAM,eAAe,GAAG;IAC5B,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,eAAe,WAAY,UAAU,QAAQ,IAAI,EAAE,KAAG,eA8DlE,CAAC;AAEF,eAAO,MAAM,uBAAuB,qDAA+B,CAAC;AAEpE,eAAO,MAAM,aAAa,OAAQ,WAAW,KAAG,OAAmD,CAAC;AAEpG,eAAO,MAAM,aAAa,OAAQ,eAAe,SAchD,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import '@preact/signals-react';
|
|
1
2
|
declare const _default: {
|
|
2
3
|
title: string;
|
|
3
4
|
};
|
|
4
5
|
export default _default;
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const AutomergeRepo: {
|
|
6
7
|
render: () => JSX.Element;
|
|
7
8
|
};
|
|
8
9
|
//# sourceMappingURL=automerge.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/automerge/automerge.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../src/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,uBAAuB,CAAC;;;;AA8E/B,wBAEE;AAEF,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EditorState, type Extension } from '@codemirror/state';
|
|
2
|
+
import { EditorView } from '@codemirror/view';
|
|
3
|
+
import React, { type ComponentProps } from 'react';
|
|
4
|
+
import { type EditorModel } from '../../hooks';
|
|
5
|
+
import type { ThemeStyles } from '../../styles';
|
|
6
|
+
export declare const EditorModes: readonly ["default", "vim"];
|
|
7
|
+
export type EditorMode = (typeof EditorModes)[number];
|
|
8
|
+
export type CursorInfo = {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
line: number;
|
|
12
|
+
lines: number;
|
|
13
|
+
after?: string;
|
|
14
|
+
};
|
|
15
|
+
export type TextEditorRef = {
|
|
16
|
+
editor: HTMLDivElement | null;
|
|
17
|
+
state?: EditorState;
|
|
18
|
+
view?: EditorView;
|
|
19
|
+
};
|
|
20
|
+
export type TextEditorSlots = {
|
|
21
|
+
root?: Omit<ComponentProps<'div'>, 'ref'>;
|
|
22
|
+
editor?: {
|
|
23
|
+
className?: string;
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
spellCheck?: boolean;
|
|
26
|
+
tabIndex?: number;
|
|
27
|
+
theme?: ThemeStyles;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type TextEditorProps = {
|
|
31
|
+
model: EditorModel;
|
|
32
|
+
extensions?: Extension[];
|
|
33
|
+
slots?: TextEditorSlots;
|
|
34
|
+
editorMode?: EditorMode;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Base text editor.
|
|
38
|
+
* NOTE: Rather than adding properties, try to create extensions that can be reused.
|
|
39
|
+
*/
|
|
40
|
+
export declare const BaseTextEditor: React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<TextEditorRef>>;
|
|
41
|
+
export declare const TextEditor: React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<TextEditorRef>>;
|
|
42
|
+
export declare const MarkdownEditor: React.ForwardRefExoticComponent<TextEditorProps & React.RefAttributes<TextEditorRef>>;
|
|
43
|
+
//# sourceMappingURL=TextEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextEditor.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAK9C,OAAO,KAAK,EAAE,EAOZ,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,KAAK,WAAW,EAAoB,MAAM,aAAa,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,WAAW,6BAA8B,CAAC;AACvD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,KAAK,CAAC,EAAE,WAAW,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,uFA2F1B,CAAC;AAEF,eAAO,MAAM,UAAU,uFAatB,CAAC;AAEF,eAAO,MAAM,cAAc,uFAa1B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import '@dxosTheme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("./TextEditor").TextEditorProps & React.RefAttributes<import("./TextEditor").TextEditorRef>>;
|
|
5
|
+
decorators: import("@storybook/react").Decorator[];
|
|
6
|
+
render: ({ automerge }: {
|
|
7
|
+
automerge?: boolean | undefined;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export declare const Default: {};
|
|
12
|
+
export declare const Automerge: {
|
|
13
|
+
render: () => JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=TextEditor.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,KAA+B,MAAM,OAAO,CAAC;;;;;;;;AA6DpD,wBAIE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,eAAO,MAAM,SAAS;;CAErB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type StoryObj } from '@storybook/html';
|
|
2
2
|
import { Client, type PublicKey } from '@dxos/react-client';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
title: string;
|
|
@@ -9,4 +9,4 @@ export declare const Default: StoryObj<{
|
|
|
9
9
|
client: Client;
|
|
10
10
|
spaceKey: PublicKey;
|
|
11
11
|
}>;
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=codemirror.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemirror.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/codemirror.stories.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAMhD,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;;;;AAS5D,wBAEE;AAqEF,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,CAoBjF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import type { ThemeMode } from '@dxos/react-ui';
|
|
3
|
+
export type BasicBundleOptions = {
|
|
4
|
+
themeMode?: ThemeMode;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const basicBundle: ({ themeMode, placeholder: _placeholder }: BasicBundleOptions) => Extension[];
|
|
8
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/basic/bundle.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,6CAA8C,kBAAkB,KAAG,SAAS,EAQlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/basic/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type StyleSpec } from 'style-mod';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal styles.
|
|
4
|
+
* NOTE: The '&' prefix denotes the CM editor root.
|
|
5
|
+
* https://codemirror.net/examples/styling
|
|
6
|
+
*/
|
|
7
|
+
export declare const basicTheme: {
|
|
8
|
+
[selector: string]: StyleSpec;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/basic/theme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAI3C;;;;GAIG;AAEH,eAAO,MAAM,UAAU,EAAE;IACvB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAgC/B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StateField } from '@codemirror/state';
|
|
2
|
+
/**
|
|
3
|
+
* Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799
|
|
4
|
+
* @param onChange
|
|
5
|
+
*/
|
|
6
|
+
export declare const onChangeExtension: (onChange: (text: string) => void) => StateField<null>;
|
|
7
|
+
//# sourceMappingURL=change.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/change.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C;;;GAGG;AAEH,eAAO,MAAM,iBAAiB,oBAAqB,MAAM,KAAK,IAAI,qBAU9D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RangeSet, StateField } from '@codemirror/state';
|
|
2
|
+
type HyperlinkDecorationConfig = {
|
|
3
|
+
link?: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Creates a state field to replace AST elements with a hyperlink widget.
|
|
7
|
+
* https://codemirror.net/docs/ref/#state.StateField
|
|
8
|
+
*/
|
|
9
|
+
export declare const hyperlinkDecoration: ({ link }?: HyperlinkDecorationConfig) => StateField<RangeSet<any>>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=hyperlinkDecoration.d.ts.map
|
package/dist/types/src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperlinkDecoration.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/hyperlink/hyperlinkDecoration.ts"],"names":[],"mappings":"AAMA,OAAO,EAAoB,KAAK,QAAQ,EAAmB,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AA6CnH,KAAK,yBAAyB,GAAG;IAC/B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,cAAc,yBAAyB,8BAMtE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type OnHyperlinkHover = (el: Element, url: string) => void;
|
|
2
|
+
/**
|
|
3
|
+
* https://codemirror.net/examples/tooltip
|
|
4
|
+
* https://codemirror.net/docs/ref/#view.hoverTooltip
|
|
5
|
+
* https://github.com/codemirror/view/blob/main/src/tooltip.ts
|
|
6
|
+
*/
|
|
7
|
+
export declare const createHyperlinkTooltip: (onHover: OnHyperlinkHover, regexp?: RegExp) => import("@codemirror/state").Extension;
|
|
8
|
+
//# sourceMappingURL=hyperlinkTooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperlinkTooltip.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/hyperlink/hyperlinkTooltip.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAElE;;;;GAIG;AAEH,eAAO,MAAM,sBAAsB,YAAa,gBAAgB,2DA0C5D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import { type DecorationSet, MatchDecorator, ViewPlugin, type ViewUpdate } from '@codemirror/view';
|
|
3
|
+
export declare function hyperLinkExtension(): ViewPlugin<{
|
|
4
|
+
readonly decorator: MatchDecorator;
|
|
5
|
+
decorations: DecorationSet;
|
|
6
|
+
update(update: ViewUpdate): void;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const hyperlinkStyle: Extension;
|
|
9
|
+
export declare const hyperlinkWidget: Extension;
|
|
10
|
+
//# sourceMappingURL=hyperlinkWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hyperlinkWidget.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/hyperlink/hyperlinkWidget.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAEL,KAAK,aAAa,EAElB,cAAc,EACd,UAAU,EACV,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAC;AAuD1B,wBAAgB,kBAAkB;wBAGR,cAAc;;mBAOnB,UAAU;GAwB9B;AAED,eAAO,MAAM,cAAc,WAYzB,CAAC;AAEH,eAAO,MAAM,eAAe,EAAE,SAAkD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/hyperlink/index.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/TextEditor/extensions/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Extension } from '@codemirror/state';
|
|
2
|
+
import type { ThemeMode } from '@dxos/react-ui';
|
|
3
|
+
export type MarkdownBundleOptions = {
|
|
4
|
+
themeMode?: ThemeMode;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const markdownBundle: ({ themeMode, placeholder: _placeholder }: MarkdownBundleOptions) => Extension[];
|
|
8
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/markdown/bundle.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgBhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAKhD,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,cAAc,6CAA8C,qBAAqB,KAAG,SAAS,EAuDzG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/markdown/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/markdown/tags.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYxB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,cAgBnC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HighlightStyle } from '@codemirror/language';
|
|
2
|
+
import { type ThemeStyles } from '../../../../styles';
|
|
3
|
+
export declare const chalky = "#e5c07b";
|
|
4
|
+
export declare const coral = "#e06c75";
|
|
5
|
+
export declare const cyan = "#56b6c2";
|
|
6
|
+
export declare const invalid = "#ffffff";
|
|
7
|
+
export declare const ivory = "#abb2bf";
|
|
8
|
+
export declare const stone = "#7d8799";
|
|
9
|
+
export declare const malibu = "#61afef";
|
|
10
|
+
export declare const sage = "#98c379";
|
|
11
|
+
export declare const whiskey = "#d19a66";
|
|
12
|
+
export declare const violet = "#c678dd";
|
|
13
|
+
export declare const highlightBackground = "#2c313a";
|
|
14
|
+
export declare const tooltipBackground = "#353a42";
|
|
15
|
+
/**
|
|
16
|
+
* NOTE: The '&' prefix denotes the CM editor root.
|
|
17
|
+
* https://codemirror.net/examples/styling
|
|
18
|
+
*/
|
|
19
|
+
export declare const markdownTheme: ThemeStyles;
|
|
20
|
+
export declare const markdownHighlightStyle: HighlightStyle;
|
|
21
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/TextEditor/extensions/markdown/theme.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,OAAO,EAAsD,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG1G,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,IAAI,YAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,KAAK,YAAY,CAAC;AAC/B,eAAO,MAAM,MAAM,YAAY,CAAC;AAChC,eAAO,MAAM,IAAI,YAAY,CAAC;AAC9B,eAAO,MAAM,OAAO,YAAY,CAAC;AACjC,eAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAK3C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,WAsJ3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,gBA6ElC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import '@dxosTheme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
component: React.ForwardRefExoticComponent<import("./TextEditor").TextEditorProps & React.RefAttributes<import("./TextEditor").TextEditorRef>>;
|
|
5
|
+
decorators: import("@storybook/react").Decorator[];
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const Default: {
|
|
9
|
+
render: () => JSX.Element;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=yjs.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yjs.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/yjs.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;AAWxC,wBAGE;AA+BF,eAAO,MAAM,OAAO;;CAGnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Extension } from '@codemirror/state';
|
|
2
|
+
import type { ThemeMode } from '@dxos/react-ui';
|
|
3
|
+
import type { EditorModel } from './useTextModel';
|
|
4
|
+
/**
|
|
5
|
+
* Replication and awareness (incl. remote selection).
|
|
6
|
+
* https://codemirror.net/docs/ref/#collab
|
|
7
|
+
*/
|
|
8
|
+
export declare const useCollaboration: (model: EditorModel, themeMode: ThemeMode) => Extension | undefined;
|
|
9
|
+
//# sourceMappingURL=useCollaboration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCollaboration.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCollaboration.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,UAAW,WAAW,aAAa,SAAS,KAAG,SAAS,GAAG,SAuBvF,CAAC"}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import { type EditorView } from '@codemirror/view';
|
|
2
|
-
import { type ComponentProps } from 'react';
|
|
3
1
|
import type * as awarenessProtocol from 'y-protocols/awareness';
|
|
4
|
-
import { type Space, type TextObject } from '@dxos/react-client/echo';
|
|
2
|
+
import { type DocAccessor, type Space, type TextObject } from '@dxos/react-client/echo';
|
|
5
3
|
import { type Identity } from '@dxos/react-client/halo';
|
|
6
4
|
import type { YText, YXmlFragment } from '@dxos/text-model';
|
|
7
|
-
export type EditorSlots = {
|
|
8
|
-
root?: Omit<ComponentProps<'div'>, 'ref'>;
|
|
9
|
-
editor?: {
|
|
10
|
-
className?: string;
|
|
11
|
-
placeholder?: string;
|
|
12
|
-
spellCheck?: boolean;
|
|
13
|
-
tabIndex?: number;
|
|
14
|
-
markdownTheme?: Parameters<typeof EditorView.theme>[0];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
5
|
type Awareness = awarenessProtocol.Awareness;
|
|
18
6
|
type Provider = {
|
|
19
7
|
awareness: Awareness;
|
|
20
8
|
};
|
|
21
9
|
export type EditorModel = {
|
|
22
10
|
id: string;
|
|
23
|
-
content: string | YText | YXmlFragment;
|
|
11
|
+
content: string | YText | YXmlFragment | DocAccessor;
|
|
24
12
|
provider?: Provider;
|
|
25
13
|
peer?: {
|
|
26
14
|
id: string;
|
|
@@ -34,4 +22,4 @@ export type UseTextModelOptions = {
|
|
|
34
22
|
};
|
|
35
23
|
export declare const useTextModel: ({ identity, space, text }: UseTextModelOptions) => EditorModel | undefined;
|
|
36
24
|
export {};
|
|
37
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=useTextModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTextModel.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useTextModel.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,KAAK,EACV,KAAK,UAAU,EAIhB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAK5D,KAAK,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;AAC7C,KAAK,QAAQ,GAAG;IAAE,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAGzC,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,KAAK,GAAG,YAAY,GAAG,WAAW,CAAC;IACrD,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB,CAAC;AAKF,eAAO,MAAM,YAAY,8BAA+B,mBAAmB,KAAG,WAAW,GAAG,SAoD3F,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursors.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/yjs/cursors.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,WAAW;;;CAAsD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/yjs/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space-provider.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/yjs/space-provider.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAG/B,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGrD,KAAK,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;AAO7C;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,UAAU,CAAC,GAAG,CAAC;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,GAAG,EAAE,GAAG,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,SAAS,CAAA;KAAE;IA+BlH,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,YAAY;IAoCpB,OAAO,CAAC,mBAAmB;CAG5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './components';
|
|
2
|
-
export * from './model';
|
|
3
1
|
export { TextKind } from '@dxos/protocols/proto/dxos/echo/model/text';
|
|
4
2
|
export { Doc, YText, YXmlFragment } from '@dxos/text-model';
|
|
3
|
+
export * from './components';
|
|
4
|
+
export * from './hooks';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE5D,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { StyleSpec } from 'style-mod';
|
|
1
2
|
import { type TailwindConfig } from '@dxos/react-ui-theme';
|
|
3
|
+
export type ThemeStyles = {
|
|
4
|
+
[selector: string]: StyleSpec;
|
|
5
|
+
};
|
|
2
6
|
export declare const tokens: TailwindConfig['theme'];
|
|
3
7
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/styles/tokens.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/styles/tokens.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,CAAC;AAGF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,OAAO,CAA4B,CAAC"}
|
|
@@ -3,7 +3,7 @@ import * as awarenessProtocol from 'y-protocols/awareness';
|
|
|
3
3
|
import { Doc } from 'yjs';
|
|
4
4
|
import { Event } from '@dxos/async';
|
|
5
5
|
import { TextKind } from '@dxos/protocols/proto/dxos/echo/model/text';
|
|
6
|
-
import { type EditorModel } from '../
|
|
6
|
+
import { type EditorModel } from '../hooks';
|
|
7
7
|
type Awareness = awarenessProtocol.Awareness;
|
|
8
8
|
/**
|
|
9
9
|
* Yjs awareness provider in-memory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replicator.d.ts","sourceRoot":"","sources":["../../../../src/testing/replicator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"replicator.d.ts","sourceRoot":"","sources":["../../../../src/testing/replicator.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,KAAK,iBAAiB,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAEtE,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzD,KAAK,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC;AAM7C;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,UAAU,CAAC,GAAG,CAAC;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoB;IAClD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAY;IACvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAM;gBAEf,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE;QAAE,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;QAAC,GAAG,EAAE,GAAG,CAAC;QAAC,SAAS,CAAC,EAAE,SAAS,CAAA;KAAE;IA+BtG,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,YAAY;IA0CpB,OAAO,CAAC,mBAAmB;CAG5B;AAED;;GAEG;AACH,qBAAa,UAAU;IAIT,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2B;IACnD,OAAO,CAAC,MAAM,CAAqB;gBAEN,KAAK,EAAE,QAAQ;IAE5C,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE;IAI7B,UAAU,OAAQ,MAAM,QAAO,GAAG,KAAe,WAAW,CAmB1D;CACH;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,WAAW,4BAA6B,kBAAkB,KAAG,WAGzE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-editor",
|
|
3
|
-
"version": "0.3.9-main.
|
|
3
|
+
"version": "0.3.9-main.c414ce0",
|
|
4
4
|
"description": "Document editing experience within a DXOS shell.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"src"
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@codemirror/autocomplete": "^6.11.
|
|
17
|
-
"@codemirror/commands": "^6.3.
|
|
18
|
-
"@codemirror/lang-markdown": "^6.2.
|
|
19
|
-
"@codemirror/language": "^6.9.
|
|
16
|
+
"@codemirror/autocomplete": "^6.11.1",
|
|
17
|
+
"@codemirror/commands": "^6.3.2",
|
|
18
|
+
"@codemirror/lang-markdown": "^6.2.3",
|
|
19
|
+
"@codemirror/language": "^6.9.3",
|
|
20
20
|
"@codemirror/language-data": "^6.3.1",
|
|
21
21
|
"@codemirror/lint": "^6.4.2",
|
|
22
|
-
"@codemirror/search": "^6.5.
|
|
23
|
-
"@codemirror/state": "^6.3.
|
|
22
|
+
"@codemirror/search": "^6.5.5",
|
|
23
|
+
"@codemirror/state": "^6.3.3",
|
|
24
24
|
"@codemirror/theme-one-dark": "^6.1.2",
|
|
25
|
-
"@codemirror/view": "^6.22.
|
|
25
|
+
"@codemirror/view": "^6.22.2",
|
|
26
26
|
"@fluentui/react-tabster": "^9.12.0",
|
|
27
27
|
"@lezer/common": "^1.1.1",
|
|
28
28
|
"@lezer/highlight": "^1.2.0",
|
|
@@ -37,44 +37,51 @@
|
|
|
37
37
|
"@tiptap/pm": "2.0.0-beta.220",
|
|
38
38
|
"@tiptap/react": "2.0.0-beta.220",
|
|
39
39
|
"@tiptap/starter-kit": "2.0.0-beta.220",
|
|
40
|
-
"codemirror": "
|
|
40
|
+
"codemirror": "6.0.1",
|
|
41
41
|
"lib0": "^0.2.65",
|
|
42
|
+
"lodash.defaultsdeep": "^4.6.1",
|
|
42
43
|
"lodash.get": "^4.4.2",
|
|
43
44
|
"prosemirror-model": "^1.19.0",
|
|
44
45
|
"prosemirror-state": "^1.4.2",
|
|
45
46
|
"prosemirror-view": "^1.30.1",
|
|
47
|
+
"style-mod": "^4.1.0",
|
|
46
48
|
"y-codemirror.next": "^0.3.2",
|
|
47
49
|
"y-prosemirror": "~1.0.20",
|
|
48
50
|
"y-protocols": "^1.0.5",
|
|
49
|
-
"yjs": "^13.6.
|
|
50
|
-
"@dxos/display-name": "0.3.9-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
51
|
+
"yjs": "^13.6.10",
|
|
52
|
+
"@dxos/display-name": "0.3.9-main.c414ce0",
|
|
53
|
+
"@dxos/automerge": "0.3.9-main.c414ce0",
|
|
54
|
+
"@dxos/debug": "0.3.9-main.c414ce0",
|
|
55
|
+
"@dxos/echo-schema": "0.3.9-main.c414ce0",
|
|
56
|
+
"@dxos/invariant": "0.3.9-main.c414ce0",
|
|
57
|
+
"@dxos/log": "0.3.9-main.c414ce0",
|
|
58
|
+
"@dxos/protocols": "0.3.9-main.c414ce0",
|
|
59
|
+
"@dxos/react-ui-theme": "0.3.9-main.c414ce0",
|
|
60
|
+
"@dxos/react-async": "0.3.9-main.c414ce0",
|
|
61
|
+
"@dxos/react-ui": "0.3.9-main.c414ce0",
|
|
62
|
+
"@dxos/text-model": "0.3.9-main.c414ce0",
|
|
63
|
+
"@dxos/util": "0.3.9-main.c414ce0"
|
|
59
64
|
},
|
|
60
65
|
"devDependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
66
|
+
"@automerge/automerge-repo-network-broadcastchannel": "^1.0.19",
|
|
67
|
+
"@phosphor-icons/react": "^2.0.5",
|
|
68
|
+
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
63
69
|
"@types/lodash.get": "^4.4.7",
|
|
64
70
|
"@types/react": "^18.0.21",
|
|
65
71
|
"@types/react-dom": "^18.0.6",
|
|
66
72
|
"react": "^18.2.0",
|
|
67
73
|
"react-dom": "^18.2.0",
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-
|
|
72
|
-
"@dxos/
|
|
74
|
+
"@dxos/config": "0.3.9-main.c414ce0",
|
|
75
|
+
"@dxos/react-client": "0.3.9-main.c414ce0",
|
|
76
|
+
"@dxos/echo-typegen": "0.3.9-main.c414ce0",
|
|
77
|
+
"@dxos/react-ui": "0.3.9-main.c414ce0",
|
|
78
|
+
"@dxos/storybook-utils": "0.3.9-main.c414ce0"
|
|
73
79
|
},
|
|
74
80
|
"peerDependencies": {
|
|
81
|
+
"@phosphor-icons/react": "^2.0.5",
|
|
75
82
|
"react": "^18.2.0",
|
|
76
83
|
"react-dom": "^18.2.0",
|
|
77
|
-
"@dxos/react-client": "0.3.9-main.
|
|
84
|
+
"@dxos/react-client": "0.3.9-main.c414ce0"
|
|
78
85
|
},
|
|
79
86
|
"publishConfig": {
|
|
80
87
|
"access": "public"
|