@dxos/react-ui-editor 0.4.10-main.ccba876 → 0.4.10-main.ccc38f6
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 +29 -29
- package/src/components/TextEditor/TextEditor.stories.tsx +2 -3
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -3
- package/src/extensions/automerge/automerge.stories.tsx +6 -6
|
@@ -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;AAalG,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAsFH,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;
|
|
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;AAK/B,OAAO,EAAU,WAAW,EAA2C,MAAM,mBAAmB,CAAC;AAkBjG,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.ccc38f6",
|
|
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,23 +39,23 @@
|
|
|
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/automerge": "0.4.10-main.
|
|
44
|
-
"@dxos/context": "0.4.10-main.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-ui": "0.4.10-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
42
|
+
"@dxos/async": "0.4.10-main.ccc38f6",
|
|
43
|
+
"@dxos/automerge": "0.4.10-main.ccc38f6",
|
|
44
|
+
"@dxos/context": "0.4.10-main.ccc38f6",
|
|
45
|
+
"@dxos/debug": "0.4.10-main.ccc38f6",
|
|
46
|
+
"@dxos/invariant": "0.4.10-main.ccc38f6",
|
|
47
|
+
"@dxos/display-name": "0.4.10-main.ccc38f6",
|
|
48
|
+
"@dxos/echo-schema": "0.4.10-main.ccc38f6",
|
|
49
|
+
"@dxos/log": "0.4.10-main.ccc38f6",
|
|
50
|
+
"@dxos/react-async": "0.4.10-main.ccc38f6",
|
|
51
|
+
"@dxos/protocols": "0.4.10-main.ccc38f6",
|
|
52
|
+
"@dxos/react-ui": "0.4.10-main.ccc38f6",
|
|
53
|
+
"@dxos/react-ui-theme": "0.4.10-main.ccc38f6",
|
|
54
|
+
"@dxos/util": "0.4.10-main.ccc38f6"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@automerge/automerge-repo-network-broadcastchannel": "^1.1.4",
|
|
58
|
-
"@phosphor-icons/react": "^2.
|
|
58
|
+
"@phosphor-icons/react": "^2.1.5",
|
|
59
59
|
"@preact/signals-react": "^1.3.8",
|
|
60
60
|
"@testing-library/dom": "^8.17.1",
|
|
61
61
|
"@testing-library/react": "^13.4.0",
|
|
@@ -67,32 +67,32 @@
|
|
|
67
67
|
"@types/react": "^18.0.21",
|
|
68
68
|
"@types/react-dom": "^18.0.6",
|
|
69
69
|
"@types/react-test-renderer": "^17.0.2",
|
|
70
|
-
"@vitest/browser": "^1.
|
|
71
|
-
"@vitest/ui": "^1.
|
|
70
|
+
"@vitest/browser": "^1.5.0",
|
|
71
|
+
"@vitest/ui": "^1.5.0",
|
|
72
72
|
"happy-dom": "^13.3.1",
|
|
73
73
|
"jsdom": "^20.0.1",
|
|
74
74
|
"react": "^18.2.0",
|
|
75
75
|
"react-dom": "^18.2.0",
|
|
76
76
|
"react-test-renderer": "^18.2.0",
|
|
77
|
-
"vite": "^5.
|
|
77
|
+
"vite": "^5.2.9",
|
|
78
78
|
"vite-plugin-top-level-await": "^1.4.1",
|
|
79
79
|
"vite-plugin-wasm": "^3.3.0",
|
|
80
|
-
"vitest": "^1.
|
|
81
|
-
"@
|
|
82
|
-
"@
|
|
83
|
-
"@dxos/echo-
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/keyboard": "0.4.10-main.
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/react-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
80
|
+
"vitest": "^1.5.0",
|
|
81
|
+
"@dxos/config": "0.4.10-main.ccc38f6",
|
|
82
|
+
"@braneframe/types": "0.4.10-main.ccc38f6",
|
|
83
|
+
"@dxos/echo-signals": "0.4.10-main.ccc38f6",
|
|
84
|
+
"@dxos/echo-typegen": "0.4.10-main.ccc38f6",
|
|
85
|
+
"@dxos/keyboard": "0.4.10-main.ccc38f6",
|
|
86
|
+
"@dxos/react-ui": "0.4.10-main.ccc38f6",
|
|
87
|
+
"@dxos/react-client": "0.4.10-main.ccc38f6",
|
|
88
|
+
"@dxos/random": "0.4.10-main.ccc38f6",
|
|
89
|
+
"@dxos/storybook-utils": "0.4.10-main.ccc38f6"
|
|
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.ccc38f6"
|
|
96
96
|
},
|
|
97
97
|
"publishConfig": {
|
|
98
98
|
"access": "public"
|
|
@@ -11,8 +11,7 @@ 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
|
|
15
|
-
import { createDocAccessor } from '@dxos/echo-schema';
|
|
14
|
+
import { createDocAccessor, create, createEchoObject } from '@dxos/echo-schema';
|
|
16
15
|
import { keySymbols, parseShortcut } from '@dxos/keyboard';
|
|
17
16
|
import { PublicKey } from '@dxos/keys';
|
|
18
17
|
import { log } from '@dxos/log';
|
|
@@ -253,7 +252,7 @@ const Story = ({
|
|
|
253
252
|
placeholder = 'New document.',
|
|
254
253
|
...props
|
|
255
254
|
}: StoryProps) => {
|
|
256
|
-
const [object] = useState(
|
|
255
|
+
const [object] = useState(createEchoObject(create(TextV0Type, { content: text ?? '' })));
|
|
257
256
|
|
|
258
257
|
const viewRef = useRef<EditorView>(null);
|
|
259
258
|
useComments(viewRef.current, id, comments);
|
|
@@ -7,8 +7,7 @@ import '@dxosTheme';
|
|
|
7
7
|
import React, { type FC, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
import { TextV0Type } from '@braneframe/types';
|
|
10
|
-
import
|
|
11
|
-
import { createDocAccessor } from '@dxos/echo-schema';
|
|
10
|
+
import { createDocAccessor, create } from '@dxos/echo-schema';
|
|
12
11
|
import { PublicKey } from '@dxos/keys';
|
|
13
12
|
import { faker } from '@dxos/random';
|
|
14
13
|
import { Tooltip, useThemeContext } from '@dxos/react-ui';
|
|
@@ -37,7 +36,7 @@ faker.seed(101);
|
|
|
37
36
|
|
|
38
37
|
const Story: FC<{ content: string }> = ({ content }) => {
|
|
39
38
|
const { themeMode } = useThemeContext();
|
|
40
|
-
const [text] = useState(
|
|
39
|
+
const [text] = useState(create(TextV0Type, { content }));
|
|
41
40
|
const [formattingState, formattingObserver] = useFormattingState();
|
|
42
41
|
const { parentRef, view } = useTextEditor(() => {
|
|
43
42
|
return {
|
|
@@ -8,9 +8,9 @@ import { BroadcastChannelNetworkAdapter } from '@automerge/automerge-repo-networ
|
|
|
8
8
|
import '@preact/signals-react';
|
|
9
9
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
|
+
import { TextV0Type } from '@braneframe/types';
|
|
11
12
|
import { Repo } from '@dxos/automerge/automerge-repo';
|
|
12
|
-
import { Filter, DocAccessor,
|
|
13
|
-
import * as E from '@dxos/echo-schema';
|
|
13
|
+
import { Filter, DocAccessor, create, createDocAccessor, type Expando } from '@dxos/echo-schema';
|
|
14
14
|
import { type PublicKey } from '@dxos/keys';
|
|
15
15
|
import { useSpace } from '@dxos/react-client/echo';
|
|
16
16
|
import { ClientRepeater } from '@dxos/react-client/testing';
|
|
@@ -98,9 +98,9 @@ const EchoStory = ({ spaceKey }: { spaceKey: PublicKey }) => {
|
|
|
98
98
|
// const identity = useIdentity();
|
|
99
99
|
const space = useSpace(spaceKey);
|
|
100
100
|
const source = useMemo<DocAccessor | undefined>(() => {
|
|
101
|
-
const { objects = [] } = space?.db.query<
|
|
101
|
+
const { objects = [] } = space?.db.query<Expando>(Filter.from({ type: 'test' })) ?? {};
|
|
102
102
|
if (objects.length) {
|
|
103
|
-
return
|
|
103
|
+
return createDocAccessor(objects[0].content, ['content']);
|
|
104
104
|
}
|
|
105
105
|
}, [space]);
|
|
106
106
|
|
|
@@ -125,9 +125,9 @@ export const WithEcho = {
|
|
|
125
125
|
createSpace
|
|
126
126
|
onCreateSpace={async (space) => {
|
|
127
127
|
space.db.add(
|
|
128
|
-
|
|
128
|
+
create({
|
|
129
129
|
type: 'test',
|
|
130
|
-
content:
|
|
130
|
+
content: create(TextV0Type, { content: initialContent }),
|
|
131
131
|
}),
|
|
132
132
|
);
|
|
133
133
|
}}
|