@dxos/react-ui-editor 0.3.10-main.6ba804d → 0.3.10-main.74608f1
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 +126 -37
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/TextEditor/MarkdownEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/comments.d.ts +10 -6
- package/dist/types/src/components/TextEditor/extensions/comments.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/demo.d.ts +10 -0
- package/dist/types/src/components/TextEditor/extensions/demo.d.ts.map +1 -0
- package/dist/types/src/components/TextEditor/extensions/index.d.ts +1 -0
- package/dist/types/src/components/TextEditor/extensions/index.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/listener.d.ts +4 -2
- package/dist/types/src/components/TextEditor/extensions/listener.d.ts.map +1 -1
- package/dist/types/src/components/TextEditor/extensions/markdown/bundle.d.ts.map +1 -1
- package/dist/types/src/hooks/automerge/PatchSemaphore.d.ts +3 -0
- package/dist/types/src/hooks/automerge/PatchSemaphore.d.ts.map +1 -1
- package/dist/types/src/hooks/automerge/automerge.stories.d.ts +8 -1
- package/dist/types/src/hooks/automerge/automerge.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/automerge/index.d.ts +1 -1
- package/dist/types/src/hooks/automerge/index.d.ts.map +1 -1
- package/dist/types/src/hooks/automerge/plugin.d.ts.map +1 -1
- package/dist/types/src/hooks/automerge/translation/automerge-to-codemirror.d.ts +5 -0
- package/dist/types/src/hooks/automerge/translation/automerge-to-codemirror.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/translation/codemirror-to-automerge.d.ts +6 -0
- package/dist/types/src/hooks/automerge/translation/codemirror-to-automerge.d.ts.map +1 -0
- package/dist/types/src/hooks/automerge/translation/index.d.ts +3 -0
- package/dist/types/src/hooks/automerge/translation/index.d.ts.map +1 -0
- package/package.json +20 -19
- package/src/components/TextEditor/MarkdownEditor.stories.tsx +4 -2
- package/src/components/TextEditor/TextEditor.tsx +18 -4
- package/src/components/TextEditor/extensions/comments.ts +48 -31
- package/src/components/TextEditor/extensions/demo.ts +66 -0
- package/src/components/TextEditor/extensions/index.ts +1 -0
- package/src/components/TextEditor/extensions/listener.ts +2 -2
- package/src/components/TextEditor/extensions/markdown/bundle.ts +9 -6
- package/src/hooks/automerge/PatchSemaphore.ts +12 -9
- package/src/hooks/automerge/automerge.stories.tsx +3 -2
- package/src/hooks/automerge/index.ts +1 -1
- package/src/hooks/automerge/plugin.ts +1 -0
- package/src/hooks/automerge/{amToCodemirror.ts → translation/automerge-to-codemirror.ts} +10 -2
- package/src/hooks/automerge/{codeMirrorToAm.ts → translation/codemirror-to-automerge.ts} +7 -4
- package/src/hooks/automerge/translation/index.ts +6 -0
- package/dist/types/src/hooks/automerge/amToCodemirror.d.ts +0 -6
- package/dist/types/src/hooks/automerge/amToCodemirror.d.ts.map +0 -1
- package/dist/types/src/hooks/automerge/codeMirrorToAm.d.ts +0 -7
- package/dist/types/src/hooks/automerge/codeMirrorToAm.d.ts.map +0 -1
|
@@ -4,17 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Extension } from '@codemirror/state';
|
|
6
6
|
import {
|
|
7
|
-
|
|
7
|
+
keymap,
|
|
8
8
|
type DecorationSet,
|
|
9
|
+
type Rect,
|
|
10
|
+
type ViewUpdate,
|
|
11
|
+
Decoration,
|
|
9
12
|
EditorView,
|
|
10
|
-
keymap,
|
|
11
13
|
MatchDecorator,
|
|
12
|
-
type Rect,
|
|
13
14
|
ViewPlugin,
|
|
14
|
-
type ViewUpdate,
|
|
15
15
|
WidgetType,
|
|
16
16
|
} from '@codemirror/view';
|
|
17
17
|
|
|
18
|
+
import { debounce } from '@dxos/async';
|
|
18
19
|
import { invariant } from '@dxos/invariant';
|
|
19
20
|
|
|
20
21
|
// 1. TODO(burdon): Make atomic (for tasklist also).
|
|
@@ -44,10 +45,10 @@ class BookmarkWidget extends WidgetType {
|
|
|
44
45
|
return this._id === other._id;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
// TODO(burdon): Click to select.
|
|
48
48
|
override toDOM() {
|
|
49
49
|
const span = document.createElement('span');
|
|
50
50
|
span.className = 'cm-bookmark';
|
|
51
|
+
// TODO(burdon): Call out to react?
|
|
51
52
|
// https://emojifinder.com/comment
|
|
52
53
|
span.textContent = '💬';
|
|
53
54
|
return span;
|
|
@@ -62,18 +63,28 @@ const styles = EditorView.baseTheme({
|
|
|
62
63
|
padding: '4px',
|
|
63
64
|
backgroundColor: 'yellow',
|
|
64
65
|
},
|
|
66
|
+
'& .cm-bookmark-selected': {
|
|
67
|
+
backgroundColor: 'orange',
|
|
68
|
+
},
|
|
65
69
|
});
|
|
66
70
|
|
|
71
|
+
type CommentsInfo = {
|
|
72
|
+
active?: string;
|
|
73
|
+
items: { id: string; pos: number; location: Rect | null }[];
|
|
74
|
+
};
|
|
75
|
+
|
|
67
76
|
export type CommentsOptions = {
|
|
68
77
|
key?: string;
|
|
69
78
|
onCreate?: () => string | void;
|
|
70
|
-
onUpdate?: (info:
|
|
79
|
+
onUpdate?: (info: CommentsInfo) => void;
|
|
71
80
|
};
|
|
72
81
|
|
|
73
82
|
// https://www.markdownguide.org/extended-syntax/#footnotes
|
|
74
83
|
// TODO(burdon): Record span in automerge model?
|
|
75
84
|
// TODO(burdon): Extended markdown: https://www.markdownguide.org/extended-syntax
|
|
76
85
|
export const comments = (options: CommentsOptions = {}): Extension => {
|
|
86
|
+
let active: string | undefined;
|
|
87
|
+
|
|
77
88
|
const bookmarkMatcher = new MatchDecorator({
|
|
78
89
|
regexp: /\[\^(\w+)\]/g,
|
|
79
90
|
decoration: (match, view, pos) => {
|
|
@@ -105,10 +116,14 @@ export const comments = (options: CommentsOptions = {}): Extension => {
|
|
|
105
116
|
},
|
|
106
117
|
);
|
|
107
118
|
|
|
119
|
+
const doUpdate = debounce((data: CommentsInfo) => {
|
|
120
|
+
options.onUpdate?.(data);
|
|
121
|
+
}, 200);
|
|
122
|
+
|
|
108
123
|
return [
|
|
109
124
|
keymap.of([
|
|
110
125
|
{
|
|
111
|
-
key: options?.key ?? '
|
|
126
|
+
key: options?.key ?? 'shift-meta-c',
|
|
112
127
|
run: (view) => {
|
|
113
128
|
// Insert footnote.
|
|
114
129
|
const id = options.onCreate?.();
|
|
@@ -132,39 +147,41 @@ export const comments = (options: CommentsOptions = {}): Extension => {
|
|
|
132
147
|
|
|
133
148
|
// Monitor cursor movement.
|
|
134
149
|
EditorView.updateListener.of((update) => {
|
|
150
|
+
active = undefined;
|
|
151
|
+
if (!options.onUpdate) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
135
155
|
const view = update.view;
|
|
136
156
|
const pos = view.state.selection.main.head;
|
|
137
157
|
|
|
138
158
|
const decorations: { from: number; to: number; value: Decoration }[] = [];
|
|
139
159
|
const rangeSet = view.plugin(bookmarks)?.bookmarks;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
let closest = Infinity;
|
|
161
|
+
// TODO(burdon): Always shows entire document?
|
|
162
|
+
const { from, to } = view.visibleRanges?.[0] ?? { from: 0, to: view.state.doc.length };
|
|
163
|
+
rangeSet?.between(from, to, (from, to, value) => {
|
|
164
|
+
decorations.push({ from, to, value });
|
|
165
|
+
const d = Math.min(Math.abs(pos - from), Math.abs(pos - to));
|
|
166
|
+
if (d < closest) {
|
|
167
|
+
// TODO(burdon): Update class of selected.
|
|
168
|
+
active = value.spec.id;
|
|
169
|
+
closest = d;
|
|
143
170
|
}
|
|
144
171
|
});
|
|
145
172
|
|
|
146
173
|
if (decorations.length) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
value: {
|
|
159
|
-
spec: { id },
|
|
160
|
-
},
|
|
161
|
-
}) => id,
|
|
162
|
-
),
|
|
163
|
-
active: id,
|
|
164
|
-
pos,
|
|
165
|
-
location,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
174
|
+
doUpdate({
|
|
175
|
+
active,
|
|
176
|
+
items: decorations.map(
|
|
177
|
+
({
|
|
178
|
+
from,
|
|
179
|
+
value: {
|
|
180
|
+
spec: { id },
|
|
181
|
+
},
|
|
182
|
+
}) => ({ id: id as string, pos: from, location: view.coordsAtPos(from) }),
|
|
183
|
+
),
|
|
184
|
+
});
|
|
168
185
|
}
|
|
169
186
|
}),
|
|
170
187
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { keymap } from '@codemirror/view';
|
|
6
|
+
|
|
7
|
+
export type DemoOptions = {
|
|
8
|
+
delay?: number;
|
|
9
|
+
items?: string[];
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const defaultItems = ['hello world!', 'this is a test.', 'this is [DXOS](https://dxos.org)'];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Demo script.
|
|
16
|
+
* Configurable plugin that let's user cycle through pre-configured input script.
|
|
17
|
+
*/
|
|
18
|
+
export const demo = ({ delay = 75, items = defaultItems }: DemoOptions = {}) => {
|
|
19
|
+
let t: any;
|
|
20
|
+
let idx = 0;
|
|
21
|
+
|
|
22
|
+
return [
|
|
23
|
+
keymap.of([
|
|
24
|
+
{
|
|
25
|
+
// Reset.
|
|
26
|
+
key: "alt-meta-'",
|
|
27
|
+
run: (view) => {
|
|
28
|
+
clearTimeout(t);
|
|
29
|
+
idx = 0;
|
|
30
|
+
return true;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
// Next prompt.
|
|
35
|
+
// TODO(burdon): Press 1-9 to select prompt?
|
|
36
|
+
key: "shift-meta-'",
|
|
37
|
+
run: (view) => {
|
|
38
|
+
clearTimeout(t);
|
|
39
|
+
// TODO(burdon): Add space if needed.
|
|
40
|
+
const text = items[idx++];
|
|
41
|
+
if (idx === items?.length) {
|
|
42
|
+
idx = 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let i = 0;
|
|
46
|
+
const insert = (d = 0) => {
|
|
47
|
+
t = setTimeout(() => {
|
|
48
|
+
const pos = view.state.selection.main.head;
|
|
49
|
+
view.dispatch({
|
|
50
|
+
changes: { from: pos, insert: text[i++] },
|
|
51
|
+
selection: { anchor: pos + 1 },
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (i < text.length) {
|
|
55
|
+
insert(Math.random() * delay * (text[i] === ' ' ? 2 : 1));
|
|
56
|
+
}
|
|
57
|
+
}, d);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
insert();
|
|
61
|
+
return true;
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
]),
|
|
65
|
+
];
|
|
66
|
+
};
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import { StateField } from '@codemirror/state';
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type ListenerOptions = { onChange: (text: string) => void };
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Based on https://github.com/codemirror/dev/issues/44#issuecomment-789093799
|
|
11
11
|
*/
|
|
12
12
|
// TODO(burdon): Expose options.
|
|
13
|
-
export const listener = (onChange:
|
|
13
|
+
export const listener = ({ onChange }: ListenerOptions) =>
|
|
14
14
|
StateField.define({
|
|
15
15
|
create: () => null,
|
|
16
16
|
update: (_value, transaction) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { closeBrackets, closeBracketsKeymap } from '@codemirror/autocomplete';
|
|
6
|
-
import { defaultKeymap, history, indentWithTab } from '@codemirror/commands';
|
|
6
|
+
import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';
|
|
7
7
|
import { markdownLanguage, markdown } from '@codemirror/lang-markdown';
|
|
8
8
|
import { bracketMatching, defaultHighlightStyle, indentOnInput, syntaxHighlighting } from '@codemirror/language';
|
|
9
9
|
import { languages } from '@codemirror/language-data';
|
|
@@ -54,14 +54,17 @@ export const markdownBundle = ({ themeMode, placeholder: _placeholder }: Markdow
|
|
|
54
54
|
indentOnInput(),
|
|
55
55
|
rectangularSelection(),
|
|
56
56
|
|
|
57
|
-
//
|
|
57
|
+
// https://codemirror.net/docs/ref/#view.keymap
|
|
58
58
|
keymap.of([
|
|
59
|
-
|
|
59
|
+
// https://codemirror.net/docs/ref/#commands.defaultKeymap
|
|
60
60
|
...defaultKeymap,
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
//
|
|
61
|
+
// https://codemirror.net/docs/ref/#commands.historyKeymap
|
|
62
|
+
...historyKeymap,
|
|
63
|
+
// https://codemirror.net/docs/ref/#autocomplete.closeBracketsKeymap
|
|
64
|
+
...closeBracketsKeymap,
|
|
65
|
+
// https://codemirror.net/docs/ref/#search.searchKeymap
|
|
64
66
|
...searchKeymap,
|
|
67
|
+
// https://codemirror.net/docs/ref/#commands.indentWithTab
|
|
65
68
|
indentWithTab,
|
|
66
69
|
]),
|
|
67
70
|
|
|
@@ -2,20 +2,24 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// TODO(burdon): Additional copyright?
|
|
6
|
+
|
|
5
7
|
import { type EditorView } from '@codemirror/view';
|
|
6
8
|
|
|
7
9
|
import { next as automerge } from '@dxos/automerge/automerge';
|
|
8
10
|
|
|
9
|
-
import amToCodemirror from './amToCodemirror';
|
|
10
|
-
import codeMirrorToAm from './codeMirrorToAm';
|
|
11
11
|
import { type IDocHandle } from './handle';
|
|
12
12
|
import { type Field, isReconcileTx, getPath, reconcileAnnotationType, updateHeads, getLastHeads } from './plugin';
|
|
13
|
+
import { automergeToCodemirror, codemirrorToAutomerge } from './translation';
|
|
13
14
|
|
|
14
15
|
type Doc<T> = automerge.Doc<T>;
|
|
15
16
|
type Heads = automerge.Heads;
|
|
16
17
|
|
|
17
18
|
type ChangeFn = (atHeads: Heads, change: (doc: Doc<unknown>) => void) => Heads | undefined;
|
|
18
19
|
|
|
20
|
+
/**
|
|
21
|
+
* TODO(burdon): Comment.
|
|
22
|
+
*/
|
|
19
23
|
export class PatchSemaphore {
|
|
20
24
|
_field!: Field;
|
|
21
25
|
_inReconcile = false;
|
|
@@ -39,7 +43,7 @@ export class PatchSemaphore {
|
|
|
39
43
|
|
|
40
44
|
const transactions = view.state.field(this._field).unreconciledTransactions.filter((tx) => !isReconcileTx(tx));
|
|
41
45
|
|
|
42
|
-
// First undo all the unreconciled transactions
|
|
46
|
+
// First undo all the unreconciled transactions.
|
|
43
47
|
const toInvert = transactions.slice().reverse();
|
|
44
48
|
for (const tx of toInvert) {
|
|
45
49
|
const inverted = tx.changes.invert(tx.startState.doc);
|
|
@@ -50,19 +54,18 @@ export class PatchSemaphore {
|
|
|
50
54
|
});
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
//
|
|
54
|
-
let newHeads =
|
|
57
|
+
// Apply the unreconciled transactions to the document.
|
|
58
|
+
let newHeads = codemirrorToAutomerge(this._field, handle, transactions, view.state);
|
|
55
59
|
|
|
56
|
-
// NOTE: null and undefined each come from automerge and repo respectively
|
|
60
|
+
// NOTE: null and undefined each come from automerge and repo respectively.
|
|
57
61
|
if (newHeads === null || newHeads === undefined) {
|
|
58
62
|
// TODO: @alexjg this is the call that's resetting the editor state on click
|
|
59
63
|
newHeads = automerge.getHeads(handle.docSync()!);
|
|
60
64
|
}
|
|
61
65
|
|
|
62
|
-
//
|
|
63
|
-
// and apply that to the codemirror doc
|
|
66
|
+
// Now get the diff between the updated state of the document and the heads and apply that to the codemirror doc.
|
|
64
67
|
const diff = automerge.equals(oldHeads, newHeads) ? [] : automerge.diff(handle.docSync()!, oldHeads, newHeads);
|
|
65
|
-
|
|
68
|
+
automergeToCodemirror(view, selection, path, diff);
|
|
66
69
|
|
|
67
70
|
view.dispatch({
|
|
68
71
|
effects: updateHeads(newHeads),
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// TODO(burdon): Additional copyright?
|
|
6
|
+
|
|
5
7
|
import { ChangeSet, type ChangeSpec, type EditorSelection, type EditorState } from '@codemirror/state';
|
|
6
8
|
import { type EditorView } from '@codemirror/view';
|
|
7
9
|
|
|
@@ -14,9 +16,14 @@ import {
|
|
|
14
16
|
type SpliceTextPatch,
|
|
15
17
|
} from '@dxos/automerge/automerge';
|
|
16
18
|
|
|
17
|
-
import { reconcileAnnotationType } from '
|
|
19
|
+
import { reconcileAnnotationType } from '../plugin';
|
|
18
20
|
|
|
19
|
-
export
|
|
21
|
+
export const automergeToCodemirror = (
|
|
22
|
+
view: EditorView,
|
|
23
|
+
selection: EditorSelection,
|
|
24
|
+
target: Prop[],
|
|
25
|
+
patches: Patch[],
|
|
26
|
+
) => {
|
|
20
27
|
for (const patch of patches) {
|
|
21
28
|
const changeSpec = handlePatch(patch, target, view.state);
|
|
22
29
|
if (changeSpec != null) {
|
|
@@ -28,6 +35,7 @@ export default (view: EditorView, selection: EditorSelection, target: Prop[], pa
|
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
37
|
}
|
|
38
|
+
|
|
31
39
|
view.dispatch({
|
|
32
40
|
selection,
|
|
33
41
|
annotations: reconcileAnnotationType.of({}),
|
|
@@ -2,14 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// TODO(burdon): Additional copyright?
|
|
6
|
+
|
|
5
7
|
import { type EditorState, type Text, type Transaction } from '@codemirror/state';
|
|
6
8
|
|
|
7
9
|
import { next as am, type Heads } from '@dxos/automerge/automerge';
|
|
8
10
|
|
|
9
|
-
import { type IDocHandle } from '
|
|
10
|
-
import { type Field } from '
|
|
11
|
+
import { type IDocHandle } from '../handle';
|
|
12
|
+
import { type Field } from '../plugin';
|
|
11
13
|
|
|
12
|
-
export
|
|
14
|
+
export const codemirrorToAutomerge = (
|
|
13
15
|
field: Field,
|
|
14
16
|
handle: IDocHandle,
|
|
15
17
|
transactions: Transaction[],
|
|
@@ -18,7 +20,7 @@ export default (
|
|
|
18
20
|
const { lastHeads, path } = state.field(field);
|
|
19
21
|
|
|
20
22
|
// We don't want to call `automerge.updateAt` if there are no changes.
|
|
21
|
-
// Otherwise later on `automerge.diff` will return empty patches that result in a no-op but still mess up the selection.
|
|
23
|
+
// Otherwise, later on `automerge.diff` will return empty patches that result in a no-op but still mess up the selection.
|
|
22
24
|
let hasChanges = false;
|
|
23
25
|
for (const tr of transactions) {
|
|
24
26
|
tr.changes.iterChanges(() => {
|
|
@@ -37,5 +39,6 @@ export default (
|
|
|
37
39
|
});
|
|
38
40
|
}
|
|
39
41
|
});
|
|
42
|
+
|
|
40
43
|
return newHeads ?? undefined;
|
|
41
44
|
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { type EditorSelection } from '@codemirror/state';
|
|
2
|
-
import { type EditorView } from '@codemirror/view';
|
|
3
|
-
import { type Patch, type Prop } from '@dxos/automerge/automerge';
|
|
4
|
-
declare const _default: (view: EditorView, selection: EditorSelection, target: Prop[], patches: Patch[]) => void;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=amToCodemirror.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"amToCodemirror.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/amToCodemirror.ts"],"names":[],"mappings":"AAIA,OAAO,EAA8B,KAAK,eAAe,EAAoB,MAAM,mBAAmB,CAAC;AACvG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,IAAI,EAGV,MAAM,2BAA2B,CAAC;+BAIb,UAAU,aAAa,eAAe,UAAU,IAAI,EAAE,WAAW,KAAK,EAAE;AAA9F,wBAgBE"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type EditorState, type Transaction } from '@codemirror/state';
|
|
2
|
-
import { type Heads } from '@dxos/automerge/automerge';
|
|
3
|
-
import { type IDocHandle } from './handle';
|
|
4
|
-
import { type Field } from './plugin';
|
|
5
|
-
declare const _default: (field: Field, handle: IDocHandle, transactions: Transaction[], state: EditorState) => Heads | undefined;
|
|
6
|
-
export default _default;
|
|
7
|
-
//# sourceMappingURL=codeMirrorToAm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codeMirrorToAm.d.ts","sourceRoot":"","sources":["../../../../../src/hooks/automerge/codeMirrorToAm.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAa,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,EAAc,KAAK,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;+CAI5B,UAAU,gBACJ,WAAW,EAAE,SACpB,WAAW,KACjB,KAAK,GAAG,SAAS;AALpB,wBA6BE"}
|