@dxos/react-ui-thread 0.4.10-main.70991fc → 0.4.10-main.71cec10

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAwD,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAM5D,OAAO,EAML,KAAK,KAAK,EAMX,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAqE9C,KAAK,kBAAkB,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,CAAC;QAAE,OAAO,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC,EAAE,CAAC;CACrD,CAAC;AA6IF,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;;;;;;;;;;mBA+He,UAAU;;;;;;;;;;;;;;;;;;;;;AAJ3B,wBAME;AAWF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
1
+ {"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,KAAwD,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO5D,OAAO,EAML,KAAK,KAAK,EAMX,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAoE9C,KAAK,kBAAkB,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,aAAa,CAAC;QAAE,OAAO,CAAC,EAAE,UAAU,CAAA;KAAE,CAAC,EAAE,CAAC;CACrD,CAAC;AA6IF,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;;;;;;;;;;mBA+He,UAAU;;;;;;;;;;;;;;;;;;;;;AAJ3B,wBAME;AAWF,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-thread",
3
- "version": "0.4.10-main.70991fc",
3
+ "version": "0.4.10-main.71cec10",
4
4
  "description": "A set of components to use with threads, including comments and messages.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -18,26 +18,27 @@
18
18
  "dependencies": {
19
19
  "@radix-ui/react-primitive": "^1.0.2",
20
20
  "date-fns": "^3.3.1",
21
- "@dxos/react-ui-mosaic": "0.4.10-main.70991fc",
22
- "@dxos/react-ui-theme": "0.4.10-main.70991fc",
23
- "@dxos/react-ui": "0.4.10-main.70991fc",
24
- "@dxos/util": "0.4.10-main.70991fc",
25
- "@dxos/react-ui-editor": "0.4.10-main.70991fc"
21
+ "@dxos/react-ui": "0.4.10-main.71cec10",
22
+ "@dxos/react-ui-mosaic": "0.4.10-main.71cec10",
23
+ "@dxos/react-ui-theme": "0.4.10-main.71cec10",
24
+ "@dxos/util": "0.4.10-main.71cec10",
25
+ "@dxos/react-ui-editor": "0.4.10-main.71cec10"
26
26
  },
27
27
  "devDependencies": {
28
- "@phosphor-icons/react": "^2.0.5",
28
+ "@phosphor-icons/react": "^2.1.5",
29
29
  "@types/react": "^18.0.21",
30
30
  "@types/react-dom": "^18.0.6",
31
31
  "react": "^18.2.0",
32
32
  "react-dom": "^18.2.0",
33
- "vite": "^5.1.7",
33
+ "vite": "^5.2.9",
34
34
  "vite-plugin-turbosnap": "^1.0.2",
35
- "@braneframe/types": "0.4.10-main.70991fc",
36
- "@dxos/log": "0.4.10-main.70991fc",
37
- "@dxos/keys": "0.4.10-main.70991fc",
38
- "@dxos/random": "0.4.10-main.70991fc",
39
- "@dxos/echo-schema": "0.4.10-main.70991fc",
40
- "@dxos/storybook-utils": "0.4.10-main.70991fc"
35
+ "@braneframe/types": "0.4.10-main.71cec10",
36
+ "@dxos/echo-db": "0.4.10-main.71cec10",
37
+ "@dxos/echo-schema": "0.4.10-main.71cec10",
38
+ "@dxos/keys": "0.4.10-main.71cec10",
39
+ "@dxos/log": "0.4.10-main.71cec10",
40
+ "@dxos/random": "0.4.10-main.71cec10",
41
+ "@dxos/storybook-utils": "0.4.10-main.71cec10"
41
42
  },
42
43
  "peerDependencies": {
43
44
  "@phosphor-icons/react": "^2.0.5",
@@ -8,7 +8,8 @@ import { Check, Trash } from '@phosphor-icons/react';
8
8
  import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
9
9
 
10
10
  import { MessageType, TextV0Type } from '@braneframe/types';
11
- import * as E from '@dxos/echo-schema';
11
+ import { createDocAccessor, createEchoObject } from '@dxos/echo-db';
12
+ import { create } from '@dxos/echo-schema';
12
13
  import { PublicKey } from '@dxos/keys';
13
14
  import { log } from '@dxos/log';
14
15
  import { faker } from '@dxos/random';
@@ -63,17 +64,16 @@ const Editor: FC<{
63
64
  const [selected, setSelected] = useState<string>();
64
65
 
65
66
  const { themeMode } = useThemeContext();
66
- const doc = item.content;
67
- const accessor = E.getRawDoc(item, ['content']);
68
67
  const { parentRef, view } = useTextEditor(
69
68
  () => ({
70
69
  id,
71
- doc,
70
+ doc: item.content,
72
71
  extensions: [
73
72
  createBasicExtensions(),
74
73
  createThemeExtensions({ themeMode }),
75
- automerge(accessor),
74
+ automerge(createDocAccessor(item, ['content'])),
76
75
  comments({
76
+ id,
77
77
  onCreate: onCreateComment,
78
78
  onDelete: onDeleteComment,
79
79
  onUpdate: onUpdateComment,
@@ -81,7 +81,7 @@ const Editor: FC<{
81
81
  }),
82
82
  ],
83
83
  }),
84
- [doc, accessor, themeMode],
84
+ [id, item, themeMode],
85
85
  );
86
86
  useComments(view, id, commentRanges);
87
87
  useEffect(() => {
@@ -111,7 +111,7 @@ type StoryCommentThread = {
111
111
  const StoryMessageBlock = (props: MessageBlockProps<{ content?: TextV0Type }>) => {
112
112
  const { themeMode } = useThemeContext();
113
113
  const doc = props.block.content?.content;
114
- const accessor = E.getRawDoc(props.block.content!, ['content']);
114
+ const accessor = createDocAccessor(props.block.content!, ['content']);
115
115
  const { parentRef } = useTextEditor(
116
116
  () => ({
117
117
  doc,
@@ -162,12 +162,12 @@ const StoryThread: FC<{
162
162
 
163
163
  const handleCreateMessage = () => {
164
164
  if (messageRef.current?.length) {
165
- const message = E.object(MessageType, {
165
+ const message = create(MessageType, {
166
166
  from: { identityKey: authorId },
167
167
  blocks: [
168
168
  {
169
169
  timestamp: new Date().toISOString(),
170
- content: E.object(TextV0Type, { content: messageRef.current }),
170
+ content: create(TextV0Type, { content: messageRef.current }),
171
171
  },
172
172
  ],
173
173
  });
@@ -253,7 +253,7 @@ type StoryProps = {
253
253
  };
254
254
 
255
255
  const Story = ({ text, autoCreate }: StoryProps) => {
256
- const [item] = useState(E.object(TextV0Type, { content: text ?? '' }));
256
+ const [item] = useState(createEchoObject(create(TextV0Type, { content: text ?? '' })));
257
257
  const [threads, setThreads] = useState<StoryCommentThread[]>([]);
258
258
  const [selected, setSelected] = useState<string>();
259
259
 
@@ -279,7 +279,7 @@ const Story = ({ text, autoCreate }: StoryProps) => {
279
279
  blocks: [
280
280
  {
281
281
  timestamp: new Date().toISOString(),
282
- content: E.object(TextV0Type, { content: faker.lorem.sentence() }),
282
+ content: create(TextV0Type, { content: faker.lorem.sentence() }),
283
283
  },
284
284
  ],
285
285
  }),