@dxos/react-ui-editor 0.4.10-main.e2d2318 → 0.4.10-main.e9f9c10
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/types/src/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
- package/dist/types/src/extensions/automerge/automerge.stories.d.ts.map +1 -1
- package/package.json +24 -24
- package/src/components/TextEditor/TextEditor.stories.tsx +3 -2
- package/src/components/Toolbar/Toolbar.stories.tsx +3 -2
- package/src/extensions/automerge/automerge.stories.tsx +6 -12
|
@@ -1 +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,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAA6E,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextEditor.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/TextEditor/TextEditor.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,KAA6E,MAAM,OAAO,CAAC;AAclG,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAyBL,KAAK,OAAO,EAGb,MAAM,kBAAkB,CAAC;AA0L1B,KAAK,UAAU,GAAG;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,YAAY,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CtD,wBAME;AAeF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAEpB,CAAC;AAEF,eAAO,MAAM,YAAY;;CAExB,CAAC;AASF,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAIF,eAAO,MAAM,SAAS;;CAUrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;CAE/B,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,eAAO,MAAM,IAAI;;CAEhB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAIjB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAEjB,CAAC;AAEF,eAAO,MAAM,YAAY;;CAYxB,CAAC;AAEF,eAAO,MAAM,OAAO;;CAWnB,CAAC;AAmDF,eAAO,MAAM,OAAO;;CAOnB,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAiCpB,CAAC;AAEF,eAAO,MAAM,GAAG;;CAOf,CAAC;AAEF,eAAO,MAAM,WAAW;;CAEvB,CAAC;AAEF,eAAO,MAAM,GAAG;;CAaf,CAAC;AAIF,eAAO,MAAM,QAAQ;;CAgBpB,CAAC;AAEF,eAAO,MAAM,UAAU;;CAOtB,CAAC;AAEF,eAAO,MAAM,KAAK;;CAqBjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Toolbar.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Toolbar/Toolbar.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAuFH,GAAG;;AALpB,wBAME;AAYF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,uBAAuB,CAAC;AAI/B,OAAO,
|
|
1
|
+
{"version":3,"file":"automerge.stories.d.ts","sourceRoot":"","sources":["../../../../../src/extensions/automerge/automerge.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,uBAAuB,CAAC;AAI/B,OAAO,EAAU,WAAW,EAA2B,MAAM,mBAAmB,CAAC;AAmBjF,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDF,wBAME;AAoBF,eAAO,MAAM,OAAO,IAAK,CAAC;AAI1B,eAAO,MAAM,QAAQ;;;CAmBpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-editor",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.e9f9c10",
|
|
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",
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"lodash.sortby": "^4.7.0",
|
|
40
40
|
"react-dropzone": "^14.2.3",
|
|
41
41
|
"style-mod": "^4.1.0",
|
|
42
|
-
"@dxos/async": "0.4.10-main.
|
|
43
|
-
"@dxos/context": "0.4.10-main.
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/log": "0.4.10-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-async": "0.4.10-main.
|
|
52
|
-
"@dxos/react-ui-theme": "0.4.10-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
42
|
+
"@dxos/async": "0.4.10-main.e9f9c10",
|
|
43
|
+
"@dxos/context": "0.4.10-main.e9f9c10",
|
|
44
|
+
"@dxos/automerge": "0.4.10-main.e9f9c10",
|
|
45
|
+
"@dxos/debug": "0.4.10-main.e9f9c10",
|
|
46
|
+
"@dxos/echo-schema": "0.4.10-main.e9f9c10",
|
|
47
|
+
"@dxos/invariant": "0.4.10-main.e9f9c10",
|
|
48
|
+
"@dxos/log": "0.4.10-main.e9f9c10",
|
|
49
|
+
"@dxos/display-name": "0.4.10-main.e9f9c10",
|
|
50
|
+
"@dxos/protocols": "0.4.10-main.e9f9c10",
|
|
51
|
+
"@dxos/react-async": "0.4.10-main.e9f9c10",
|
|
52
|
+
"@dxos/react-ui-theme": "0.4.10-main.e9f9c10",
|
|
53
|
+
"@dxos/util": "0.4.10-main.e9f9c10",
|
|
54
|
+
"@dxos/react-ui": "0.4.10-main.e9f9c10"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@automerge/automerge-repo-network-broadcastchannel": "^1.1.4",
|
|
@@ -78,21 +78,21 @@
|
|
|
78
78
|
"vite-plugin-top-level-await": "^1.4.1",
|
|
79
79
|
"vite-plugin-wasm": "^3.3.0",
|
|
80
80
|
"vitest": "^1.3.1",
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@dxos/echo-signals": "0.4.10-main.
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/react-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
81
|
+
"@braneframe/types": "0.4.10-main.e9f9c10",
|
|
82
|
+
"@dxos/config": "0.4.10-main.e9f9c10",
|
|
83
|
+
"@dxos/echo-signals": "0.4.10-main.e9f9c10",
|
|
84
|
+
"@dxos/keyboard": "0.4.10-main.e9f9c10",
|
|
85
|
+
"@dxos/random": "0.4.10-main.e9f9c10",
|
|
86
|
+
"@dxos/echo-typegen": "0.4.10-main.e9f9c10",
|
|
87
|
+
"@dxos/react-ui": "0.4.10-main.e9f9c10",
|
|
88
|
+
"@dxos/storybook-utils": "0.4.10-main.e9f9c10",
|
|
89
|
+
"@dxos/react-client": "0.4.10-main.e9f9c10"
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@phosphor-icons/react": "^2.0.5",
|
|
93
93
|
"react": "^18.2.0",
|
|
94
94
|
"react-dom": "^18.2.0",
|
|
95
|
-
"@dxos/react-client": "0.4.10-main.
|
|
95
|
+
"@dxos/react-client": "0.4.10-main.e9f9c10"
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
@@ -11,7 +11,8 @@ import React, { type FC, type KeyboardEvent, StrictMode, useMemo, useRef, useSta
|
|
|
11
11
|
import { createRoot } from 'react-dom/client';
|
|
12
12
|
|
|
13
13
|
import { TextV0Type } from '@braneframe/types';
|
|
14
|
-
import
|
|
14
|
+
import * as E from '@dxos/echo-schema';
|
|
15
|
+
import { createDocAccessor } from '@dxos/echo-schema';
|
|
15
16
|
import { keySymbols, parseShortcut } from '@dxos/keyboard';
|
|
16
17
|
import { PublicKey } from '@dxos/keys';
|
|
17
18
|
import { log } from '@dxos/log';
|
|
@@ -252,7 +253,7 @@ const Story = ({
|
|
|
252
253
|
placeholder = 'New document.',
|
|
253
254
|
...props
|
|
254
255
|
}: StoryProps) => {
|
|
255
|
-
const [object] = useState(
|
|
256
|
+
const [object] = useState(E.object(TextV0Type, { content: text ?? '' }));
|
|
256
257
|
|
|
257
258
|
const viewRef = useRef<EditorView>(null);
|
|
258
259
|
useComments(viewRef.current, id, comments);
|
|
@@ -7,7 +7,8 @@ import '@dxosTheme';
|
|
|
7
7
|
import React, { type FC, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { TextV0Type } from '@braneframe/types';
|
|
10
|
-
import
|
|
10
|
+
import * as E from '@dxos/echo-schema';
|
|
11
|
+
import { createDocAccessor } from '@dxos/echo-schema';
|
|
11
12
|
import { PublicKey } from '@dxos/keys';
|
|
12
13
|
import { faker } from '@dxos/random';
|
|
13
14
|
import { Tooltip, useThemeContext } from '@dxos/react-ui';
|
|
@@ -36,7 +37,7 @@ faker.seed(101);
|
|
|
36
37
|
|
|
37
38
|
const Story: FC<{ content: string }> = ({ content }) => {
|
|
38
39
|
const { themeMode } = useThemeContext();
|
|
39
|
-
const [text] = useState(
|
|
40
|
+
const [text] = useState(E.object(TextV0Type, { content }));
|
|
40
41
|
const [formattingState, formattingObserver] = useFormattingState();
|
|
41
42
|
const { parentRef, view } = useTextEditor(() => {
|
|
42
43
|
return {
|
|
@@ -9,14 +9,8 @@ import '@preact/signals-react';
|
|
|
9
9
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
11
|
import { Repo } from '@dxos/automerge/automerge-repo';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
DocAccessor,
|
|
15
|
-
TextCompatibilitySchema,
|
|
16
|
-
create,
|
|
17
|
-
createDocAccessor,
|
|
18
|
-
type Expando,
|
|
19
|
-
} from '@dxos/echo-schema';
|
|
12
|
+
import { Filter, DocAccessor, TextCompatibilitySchema } from '@dxos/echo-schema';
|
|
13
|
+
import * as E from '@dxos/echo-schema';
|
|
20
14
|
import { type PublicKey } from '@dxos/keys';
|
|
21
15
|
import { useSpace } from '@dxos/react-client/echo';
|
|
22
16
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
@@ -104,9 +98,9 @@ const EchoStory = ({ spaceKey }: { spaceKey: PublicKey }) => {
|
|
|
104
98
|
// const identity = useIdentity();
|
|
105
99
|
const space = useSpace(spaceKey);
|
|
106
100
|
const source = useMemo<DocAccessor | undefined>(() => {
|
|
107
|
-
const { objects = [] } = space?.db.query<Expando>(Filter.from({ type: 'test' })) ?? {};
|
|
101
|
+
const { objects = [] } = space?.db.query<E.Expando>(Filter.from({ type: 'test' })) ?? {};
|
|
108
102
|
if (objects.length) {
|
|
109
|
-
return createDocAccessor(objects[0].content, ['content']);
|
|
103
|
+
return E.createDocAccessor(objects[0].content, ['content']);
|
|
110
104
|
}
|
|
111
105
|
}, [space]);
|
|
112
106
|
|
|
@@ -131,9 +125,9 @@ export const WithEcho = {
|
|
|
131
125
|
createSpace
|
|
132
126
|
onCreateSpace={async (space) => {
|
|
133
127
|
space.db.add(
|
|
134
|
-
|
|
128
|
+
E.object({
|
|
135
129
|
type: 'test',
|
|
136
|
-
content:
|
|
130
|
+
content: E.object(TextCompatibilitySchema, { content: initialContent }),
|
|
137
131
|
}),
|
|
138
132
|
);
|
|
139
133
|
}}
|