@dxos/react-ui-thread 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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 +8 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/Message/Message.d.ts.map +1 -1
- package/dist/types/src/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/Thread/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/Thread/Thread.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -16
- package/src/Message/Message.stories.tsx +3 -2
- package/src/Message/Message.tsx +1 -1
- package/src/Thread/Comments.stories.tsx +5 -5
- package/src/Thread/Thread.stories.tsx +3 -2
- package/src/Thread/Thread.tsx +5 -6
- package/src/index.ts +1 -1
- package/src/testing.tsx +2 -3
- package/dist/lib/node-esm/index.mjs +0 -268
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-thread",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fd6878d",
|
|
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",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs"
|
|
15
16
|
}
|
|
@@ -26,32 +27,30 @@
|
|
|
26
27
|
"@preact-signals/safe-react": "^0.9.0",
|
|
27
28
|
"@radix-ui/react-primitive": "2.0.2",
|
|
28
29
|
"date-fns": "^3.3.1",
|
|
29
|
-
"@dxos/react-ui-editor": "0.8.4-main.
|
|
30
|
-
"@dxos/util": "0.8.4-main.
|
|
30
|
+
"@dxos/react-ui-editor": "0.8.4-main.fd6878d",
|
|
31
|
+
"@dxos/util": "0.8.4-main.fd6878d"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
33
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
34
34
|
"@types/react": "~18.2.0",
|
|
35
35
|
"@types/react-dom": "~18.2.0",
|
|
36
36
|
"react": "~18.2.0",
|
|
37
37
|
"react-dom": "~18.2.0",
|
|
38
38
|
"vite": "5.4.7",
|
|
39
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
40
|
-
"@dxos/echo-schema": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
46
|
-
"@dxos/react-ui
|
|
47
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
39
|
+
"@dxos/echo-db": "0.8.4-main.fd6878d",
|
|
40
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
41
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
42
|
+
"@dxos/keys": "0.8.4-main.fd6878d",
|
|
43
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
44
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
45
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
46
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
47
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@phosphor-icons/react": "^2.1.5",
|
|
51
50
|
"react": "~18.2.0",
|
|
52
51
|
"react-dom": "~18.2.0",
|
|
53
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
54
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
52
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
55
54
|
},
|
|
56
55
|
"publishConfig": {
|
|
57
56
|
"access": "public"
|
|
@@ -10,11 +10,12 @@ import { PublicKey } from '@dxos/keys';
|
|
|
10
10
|
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/react-ui-theme';
|
|
11
11
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { type MessageEntity, MessageStoryText } from '../testing';
|
|
14
14
|
import { Thread } from '../Thread';
|
|
15
|
-
import { MessageStoryText, type MessageEntity } from '../testing';
|
|
16
15
|
import { translations } from '../translations';
|
|
17
16
|
|
|
17
|
+
import { MessageRoot } from './Message';
|
|
18
|
+
|
|
18
19
|
const DefaultStory = () => {
|
|
19
20
|
const [identityKey] = useState(PublicKey.random());
|
|
20
21
|
const [message] = useState<MessageEntity>({
|
package/src/Message/Message.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';
|
|
6
|
-
import React, { type ComponentPropsWithRef,
|
|
6
|
+
import React, { type ComponentPropsWithRef, type ComponentPropsWithoutRef, forwardRef } from 'react';
|
|
7
7
|
|
|
8
8
|
// TODO(burdon): Remove dep.
|
|
9
9
|
import { Avatar, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { Check, Trash } from '@phosphor-icons/react';
|
|
8
7
|
import React, { type FC, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import { createDocAccessor, createObject } from '@dxos/echo-db';
|
|
@@ -13,7 +12,7 @@ import { PublicKey } from '@dxos/keys';
|
|
|
13
12
|
import { live } from '@dxos/live-object';
|
|
14
13
|
import { log } from '@dxos/log';
|
|
15
14
|
import { faker } from '@dxos/random';
|
|
16
|
-
import { Button, useThemeContext } from '@dxos/react-ui';
|
|
15
|
+
import { Button, Icon, useThemeContext } from '@dxos/react-ui';
|
|
17
16
|
import {
|
|
18
17
|
type Comment,
|
|
19
18
|
type CommentsOptions,
|
|
@@ -30,11 +29,12 @@ import {
|
|
|
30
29
|
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/react-ui-theme';
|
|
31
30
|
import { withTheme } from '@dxos/storybook-utils';
|
|
32
31
|
|
|
33
|
-
import { Thread } from './Thread';
|
|
34
32
|
import { MessageBody, MessageHeading, MessageRoot, MessageTextbox } from '../Message';
|
|
35
33
|
import { type MessageEntity } from '../testing';
|
|
36
34
|
import { translations } from '../translations';
|
|
37
35
|
|
|
36
|
+
import { Thread } from './Thread';
|
|
37
|
+
|
|
38
38
|
faker.seed(101);
|
|
39
39
|
|
|
40
40
|
const authorId = PublicKey.random().toHex();
|
|
@@ -162,7 +162,7 @@ const StoryThread: FC<{
|
|
|
162
162
|
<span>id:{thread.id.slice(0, 4)}</span>
|
|
163
163
|
<span>y:{thread.yPos}</span>
|
|
164
164
|
<span className='grow' />
|
|
165
|
-
{!thread.cursor && <
|
|
165
|
+
{!thread.cursor && <Icon icon='ph--trash--regular' />}
|
|
166
166
|
</div>
|
|
167
167
|
|
|
168
168
|
<Thread.Header>
|
|
@@ -187,7 +187,7 @@ const StoryThread: FC<{
|
|
|
187
187
|
/>
|
|
188
188
|
<Thread.Status />
|
|
189
189
|
<Button variant='ghost' classNames='px-1' title='Resolve' onClick={onResolve}>
|
|
190
|
-
<
|
|
190
|
+
<Icon icon='ph--check--regular' />
|
|
191
191
|
</Button>
|
|
192
192
|
</div>
|
|
193
193
|
</Thread.Root>
|
|
@@ -12,11 +12,12 @@ import { createBasicExtensions, createThemeExtensions } from '@dxos/react-ui-edi
|
|
|
12
12
|
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/react-ui-theme';
|
|
13
13
|
import { type Meta, withLayout, withTheme } from '@dxos/storybook-utils';
|
|
14
14
|
|
|
15
|
-
import { Thread } from './Thread';
|
|
16
15
|
import { MessageRoot, MessageTextbox } from '../Message';
|
|
17
|
-
import {
|
|
16
|
+
import { type MessageEntity, MessageStoryText } from '../testing';
|
|
18
17
|
import { translations } from '../translations';
|
|
19
18
|
|
|
19
|
+
import { Thread } from './Thread';
|
|
20
|
+
|
|
20
21
|
faker.seed(1);
|
|
21
22
|
|
|
22
23
|
const DefaultStory = () => {
|
package/src/Thread/Thread.tsx
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { CaretDoubleRight, Spinner } from '@phosphor-icons/react';
|
|
6
5
|
import React, { type ComponentPropsWithRef, forwardRef } from 'react';
|
|
7
6
|
|
|
8
|
-
import { type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
7
|
+
import { Icon, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
8
|
import { hoverableControlItem, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
10
9
|
|
|
11
10
|
import { translationKey } from '../translations';
|
|
@@ -53,7 +52,7 @@ const ThreadHeader = forwardRef<HTMLParagraphElement, ThreadHeaderProps>(
|
|
|
53
52
|
return (
|
|
54
53
|
<>
|
|
55
54
|
<div role='none' className='flex items-center justify-center text-description'>
|
|
56
|
-
<
|
|
55
|
+
<Icon icon='ph--caret-double-right--regular' />
|
|
57
56
|
</div>
|
|
58
57
|
<div role='none' className='flex items-center overflow-hidden'>
|
|
59
58
|
<p
|
|
@@ -94,10 +93,10 @@ const ThreadStatus = forwardRef<HTMLDivElement, ThreadStatusProps>(
|
|
|
94
93
|
)}
|
|
95
94
|
ref={forwardedRef}
|
|
96
95
|
>
|
|
97
|
-
<
|
|
98
|
-
|
|
96
|
+
<Icon
|
|
97
|
+
icon='ph--spinner--bold'
|
|
98
|
+
classNames='is-6 bs-4 invisible data-[visible=show]:visible animate-spin-slow'
|
|
99
99
|
data-visible={activity ? 'show' : 'hide'}
|
|
100
|
-
className='is-6 bs-4 invisible data-[visible=show]:visible animate-spin-slow'
|
|
101
100
|
/>
|
|
102
101
|
<span className='truncate min-is-0' aria-live='polite'>
|
|
103
102
|
{activity ? children : null}
|
package/src/index.ts
CHANGED
package/src/testing.tsx
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { X } from '@phosphor-icons/react';
|
|
6
5
|
import React from 'react';
|
|
7
6
|
|
|
8
|
-
import { Button } from '@dxos/react-ui';
|
|
7
|
+
import { Button, Icon } from '@dxos/react-ui';
|
|
9
8
|
import { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';
|
|
10
9
|
|
|
11
10
|
import { MessageBody, MessageHeading } from './Message';
|
|
@@ -31,7 +30,7 @@ export const MessageStoryText = ({ text, onDelete, authorName, timestamp }: Mess
|
|
|
31
30
|
classNames={['p-1.5 min-bs-0 mie-1 items-start transition-opacity', hoverableControlItem]}
|
|
32
31
|
onClick={() => onDelete()}
|
|
33
32
|
>
|
|
34
|
-
<
|
|
33
|
+
<Icon icon='ph--x--regular' />
|
|
35
34
|
</Button>
|
|
36
35
|
)}
|
|
37
36
|
</MessageHeading>
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/translations.ts
|
|
4
|
-
var translationKey = "react-ui-thread";
|
|
5
|
-
var translations = [
|
|
6
|
-
{
|
|
7
|
-
"en-US": {
|
|
8
|
-
[translationKey]: {
|
|
9
|
-
"plugin name": "Threads",
|
|
10
|
-
"thread title placeholder": "New thread",
|
|
11
|
-
"thread title label": "Title",
|
|
12
|
-
"delete thread label": "Delete",
|
|
13
|
-
"create thread label": "Create thread",
|
|
14
|
-
"message placeholder": "Enter message...",
|
|
15
|
-
"comment placeholder": "Enter comment...",
|
|
16
|
-
"settings standalone label": "Enable standalone thread creation",
|
|
17
|
-
"anonymous label": "Anonymous",
|
|
18
|
-
"enter to send message": "Enter to add \u23CE"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
];
|
|
23
|
-
|
|
24
|
-
// src/Thread/Thread.tsx
|
|
25
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
26
|
-
import { CaretDoubleRight, Spinner } from "@phosphor-icons/react";
|
|
27
|
-
import React, { forwardRef } from "react";
|
|
28
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
29
|
-
import { hoverableControlItem, hoverableFocusedWithinControls, mx } from "@dxos/react-ui-theme";
|
|
30
|
-
var threadLayout = "is-full place-self-start grid grid-cols-[var(--rail-size)_1fr]";
|
|
31
|
-
var ThreadRoot = /* @__PURE__ */ forwardRef(({ current, children, classNames, ...props }, forwardedRef) => {
|
|
32
|
-
var _effect = _useSignals();
|
|
33
|
-
try {
|
|
34
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
35
|
-
role: "group",
|
|
36
|
-
"data-testid": "thread",
|
|
37
|
-
...current && {
|
|
38
|
-
"aria-current": typeof current === "string" ? current : "location"
|
|
39
|
-
},
|
|
40
|
-
...props,
|
|
41
|
-
className: mx(threadLayout, hoverableFocusedWithinControls, "bg-[var(--surface-bg)] current-related attention-surface [--controls-opacity:0]", classNames),
|
|
42
|
-
ref: forwardedRef
|
|
43
|
-
}, children);
|
|
44
|
-
} finally {
|
|
45
|
-
_effect.f();
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
var ThreadHeader = /* @__PURE__ */ forwardRef(({ classNames, children, detached, ...props }, forwardedRef) => {
|
|
49
|
-
var _effect = _useSignals();
|
|
50
|
-
try {
|
|
51
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", {
|
|
52
|
-
role: "none",
|
|
53
|
-
className: "flex items-center justify-center text-description"
|
|
54
|
-
}, /* @__PURE__ */ React.createElement(CaretDoubleRight, null)), /* @__PURE__ */ React.createElement("div", {
|
|
55
|
-
role: "none",
|
|
56
|
-
className: "flex items-center overflow-hidden"
|
|
57
|
-
}, /* @__PURE__ */ React.createElement("p", {
|
|
58
|
-
role: "heading",
|
|
59
|
-
"data-testid": "thread.heading",
|
|
60
|
-
...props,
|
|
61
|
-
className: mx("mie-2 text-description font-medium truncate italic", detached && "line-through decoration-1"),
|
|
62
|
-
ref: forwardedRef
|
|
63
|
-
}, children)));
|
|
64
|
-
} finally {
|
|
65
|
-
_effect.f();
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
var ThreadStatus = /* @__PURE__ */ forwardRef(({ activity, classNames, children, ...props }, forwardedRef) => {
|
|
69
|
-
var _effect = _useSignals();
|
|
70
|
-
try {
|
|
71
|
-
const { t } = useTranslation(translationKey);
|
|
72
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
73
|
-
...props,
|
|
74
|
-
className: mx("col-start-2 grid grid-cols-[min-content_1fr_max-content] pb-2 pie-2 text-xs text-description", classNames),
|
|
75
|
-
ref: forwardedRef
|
|
76
|
-
}, /* @__PURE__ */ React.createElement(Spinner, {
|
|
77
|
-
weight: "bold",
|
|
78
|
-
"data-visible": activity ? "show" : "hide",
|
|
79
|
-
className: "is-6 bs-4 invisible data-[visible=show]:visible animate-spin-slow"
|
|
80
|
-
}), /* @__PURE__ */ React.createElement("span", {
|
|
81
|
-
className: "truncate min-is-0",
|
|
82
|
-
"aria-live": "polite"
|
|
83
|
-
}, activity ? children : null), /* @__PURE__ */ React.createElement("span", {
|
|
84
|
-
className: mx("text-end", hoverableControlItem)
|
|
85
|
-
}, t("enter to send message")));
|
|
86
|
-
} finally {
|
|
87
|
-
_effect.f();
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
var Thread = {
|
|
91
|
-
Root: ThreadRoot,
|
|
92
|
-
Header: ThreadHeader,
|
|
93
|
-
Status: ThreadStatus
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// src/Message/Message.tsx
|
|
97
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
98
|
-
import { formatDistanceToNow } from "date-fns/formatDistanceToNow";
|
|
99
|
-
import React2, { forwardRef as forwardRef2 } from "react";
|
|
100
|
-
import { Avatar, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
101
|
-
import { keymap, listener, useTextEditor } from "@dxos/react-ui-editor";
|
|
102
|
-
import { focusRing, mx as mx2 } from "@dxos/react-ui-theme";
|
|
103
|
-
import { hexToEmoji, hexToHue, isNotFalsy } from "@dxos/util";
|
|
104
|
-
var avatarSize = 7;
|
|
105
|
-
var MessageRoot = /* @__PURE__ */ forwardRef2(({ authorImgSrc, authorId, authorName, authorAvatarProps, continues = true, children, classNames, ...rootProps }, forwardedRef) => {
|
|
106
|
-
var _effect = _useSignals2();
|
|
107
|
-
try {
|
|
108
|
-
return (
|
|
109
|
-
// Must wrap the message since Avatar.Label may be used in the content.
|
|
110
|
-
/* @__PURE__ */ React2.createElement(Avatar.Root, null, /* @__PURE__ */ React2.createElement("div", {
|
|
111
|
-
role: "none",
|
|
112
|
-
"data-testid": "thread.message",
|
|
113
|
-
...rootProps,
|
|
114
|
-
className: mx2("grid grid-cols-subgrid col-span-2", classNames),
|
|
115
|
-
ref: forwardedRef
|
|
116
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
117
|
-
role: "none",
|
|
118
|
-
className: "flex flex-col items-center gap-2 pbs-2"
|
|
119
|
-
}, /* @__PURE__ */ React2.createElement(Avatar.Content, {
|
|
120
|
-
size: avatarSize,
|
|
121
|
-
hue: authorAvatarProps?.hue || hexToHue(authorId ?? "0"),
|
|
122
|
-
fallback: authorAvatarProps?.emoji || hexToEmoji(authorId ?? "0"),
|
|
123
|
-
...authorImgSrc && {
|
|
124
|
-
imgSrc: authorImgSrc
|
|
125
|
-
}
|
|
126
|
-
}), continues && /* @__PURE__ */ React2.createElement("div", {
|
|
127
|
-
role: "none",
|
|
128
|
-
className: "is-px grow bg-separator"
|
|
129
|
-
})), /* @__PURE__ */ React2.createElement("div", {
|
|
130
|
-
role: "none",
|
|
131
|
-
className: "plb-1 min-is-0"
|
|
132
|
-
}, children)))
|
|
133
|
-
);
|
|
134
|
-
} finally {
|
|
135
|
-
_effect.f();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
var MessageHeading = ({ children, classNames, timestamp, authorName, ...props }) => {
|
|
139
|
-
var _effect = _useSignals2();
|
|
140
|
-
try {
|
|
141
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
142
|
-
role: "none",
|
|
143
|
-
...props,
|
|
144
|
-
className: mx2("flex gap-2 items-start", classNames)
|
|
145
|
-
}, /* @__PURE__ */ React2.createElement("p", {
|
|
146
|
-
className: "grow"
|
|
147
|
-
}, /* @__PURE__ */ React2.createElement(MessageAuthorName, {
|
|
148
|
-
authorName
|
|
149
|
-
}), timestamp && /* @__PURE__ */ React2.createElement(MessageTime, {
|
|
150
|
-
timestamp
|
|
151
|
-
})), children);
|
|
152
|
-
} finally {
|
|
153
|
-
_effect.f();
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
var MessageAuthorName = ({ authorName }) => {
|
|
157
|
-
var _effect = _useSignals2();
|
|
158
|
-
try {
|
|
159
|
-
const { t } = useTranslation2(translationKey);
|
|
160
|
-
return /* @__PURE__ */ React2.createElement(Avatar.Label, {
|
|
161
|
-
classNames: "block truncate text-sm text-subdued"
|
|
162
|
-
}, authorName ?? t("anonymous label"));
|
|
163
|
-
} finally {
|
|
164
|
-
_effect.f();
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
var MessageTime = ({ timestamp }) => {
|
|
168
|
-
var _effect = _useSignals2();
|
|
169
|
-
try {
|
|
170
|
-
const { dtLocale } = useTranslation2(translationKey);
|
|
171
|
-
const dt = timestamp ? new Date(timestamp) : void 0;
|
|
172
|
-
return /* @__PURE__ */ React2.createElement("time", {
|
|
173
|
-
className: "block text-subdued text-xs pbe-0.5",
|
|
174
|
-
dateTime: dt?.toISOString()
|
|
175
|
-
}, dt ? formatDistanceToNow(dt, {
|
|
176
|
-
locale: dtLocale,
|
|
177
|
-
addSuffix: true
|
|
178
|
-
}) : "");
|
|
179
|
-
} finally {
|
|
180
|
-
_effect.f();
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
var MessageBody = ({ children, ...props }) => {
|
|
184
|
-
var _effect = _useSignals2();
|
|
185
|
-
try {
|
|
186
|
-
return /* @__PURE__ */ React2.createElement("p", props, children);
|
|
187
|
-
} finally {
|
|
188
|
-
_effect.f();
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
var keyBindings = ({ onSend, onClear }) => [
|
|
192
|
-
{
|
|
193
|
-
key: "Enter",
|
|
194
|
-
run: () => {
|
|
195
|
-
if (onSend) {
|
|
196
|
-
onSend();
|
|
197
|
-
return true;
|
|
198
|
-
} else {
|
|
199
|
-
return false;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
// TODO(burdon): Other key bindings.
|
|
205
|
-
key: "Meta+Backspace",
|
|
206
|
-
run: () => {
|
|
207
|
-
if (onClear) {
|
|
208
|
-
onClear();
|
|
209
|
-
return true;
|
|
210
|
-
} else {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
];
|
|
216
|
-
var MessageTextbox = ({ id, authorId, authorName, authorImgSrc, authorAvatarProps, disabled, extensions, onSend, onClear, onEditorFocus, ...editorProps }) => {
|
|
217
|
-
var _effect = _useSignals2();
|
|
218
|
-
try {
|
|
219
|
-
const { parentRef, focusAttributes } = useTextEditor(() => ({
|
|
220
|
-
id,
|
|
221
|
-
extensions: [
|
|
222
|
-
keymap.of(keyBindings({
|
|
223
|
-
onSend,
|
|
224
|
-
onClear
|
|
225
|
-
})),
|
|
226
|
-
listener({
|
|
227
|
-
onFocus: (focusing) => {
|
|
228
|
-
if (focusing) {
|
|
229
|
-
onEditorFocus?.();
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}),
|
|
233
|
-
extensions
|
|
234
|
-
].filter(isNotFalsy),
|
|
235
|
-
...editorProps
|
|
236
|
-
}), [
|
|
237
|
-
id,
|
|
238
|
-
extensions
|
|
239
|
-
]);
|
|
240
|
-
return /* @__PURE__ */ React2.createElement(MessageRoot, {
|
|
241
|
-
id,
|
|
242
|
-
authorId,
|
|
243
|
-
authorName,
|
|
244
|
-
authorImgSrc,
|
|
245
|
-
authorAvatarProps,
|
|
246
|
-
continues: false
|
|
247
|
-
}, /* @__PURE__ */ React2.createElement("div", {
|
|
248
|
-
role: "none",
|
|
249
|
-
ref: parentRef,
|
|
250
|
-
className: mx2("plb-0.5 mie-1 rounded-sm", focusRing, disabled && "opacity-50"),
|
|
251
|
-
...focusAttributes
|
|
252
|
-
}));
|
|
253
|
-
} finally {
|
|
254
|
-
_effect.f();
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
export {
|
|
258
|
-
MessageAuthorName,
|
|
259
|
-
MessageBody,
|
|
260
|
-
MessageHeading,
|
|
261
|
-
MessageRoot,
|
|
262
|
-
MessageTextbox,
|
|
263
|
-
MessageTime,
|
|
264
|
-
Thread,
|
|
265
|
-
threadLayout,
|
|
266
|
-
translations
|
|
267
|
-
};
|
|
268
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/translations.ts", "../../../src/Thread/Thread.tsx", "../../../src/Message/Message.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nexport const translationKey = 'react-ui-thread';\n\nexport const translations = [\n {\n 'en-US': {\n [translationKey]: {\n 'plugin name': 'Threads',\n 'thread title placeholder': 'New thread',\n 'thread title label': 'Title',\n 'delete thread label': 'Delete',\n 'create thread label': 'Create thread',\n 'message placeholder': 'Enter message...',\n 'comment placeholder': 'Enter comment...',\n 'settings standalone label': 'Enable standalone thread creation',\n 'anonymous label': 'Anonymous',\n 'enter to send message': 'Enter to add ⏎',\n },\n },\n },\n] as const satisfies Resource[];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CaretDoubleRight, Spinner } from '@phosphor-icons/react';\nimport React, { type ComponentPropsWithRef, forwardRef } from 'react';\n\nimport { type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { hoverableControlItem, hoverableFocusedWithinControls, mx } from '@dxos/react-ui-theme';\n\nimport { translationKey } from '../translations';\nimport type { ThreadEntity } from '../types';\n\n// TODO(burdon): Why is this exported?\nexport const threadLayout = 'is-full place-self-start grid grid-cols-[var(--rail-size)_1fr]';\n\n//\n// Root\n//\n\ntype ThreadRootProps = ThemedClassName<ComponentPropsWithRef<'div'>> & ThreadEntity & { current?: boolean };\n\nconst ThreadRoot = forwardRef<HTMLDivElement, ThreadRootProps>(\n ({ current, children, classNames, ...props }, forwardedRef) => {\n return (\n <div\n role='group'\n data-testid='thread'\n {...(current && { 'aria-current': typeof current === 'string' ? current : 'location' })}\n {...props}\n className={mx(\n threadLayout,\n hoverableFocusedWithinControls,\n 'bg-[var(--surface-bg)] current-related attention-surface [--controls-opacity:0]',\n classNames,\n )}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\n//\n// Heading\n//\n\ntype ThreadHeaderProps = ThemedClassName<ComponentPropsWithRef<'div'>> & { detached?: boolean };\n\nconst ThreadHeader = forwardRef<HTMLParagraphElement, ThreadHeaderProps>(\n ({ classNames, children, detached, ...props }, forwardedRef) => {\n return (\n <>\n <div role='none' className='flex items-center justify-center text-description'>\n <CaretDoubleRight />\n </div>\n <div role='none' className='flex items-center overflow-hidden'>\n <p\n role='heading'\n data-testid='thread.heading'\n {...props}\n className={mx(\n 'mie-2 text-description font-medium truncate italic',\n detached && 'line-through decoration-1',\n )}\n ref={forwardedRef}\n >\n {children}\n </p>\n </div>\n </>\n );\n },\n);\n\n//\n// Status\n//\n\ntype ThreadStatusProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {\n activity?: boolean;\n};\n\nconst ThreadStatus = forwardRef<HTMLDivElement, ThreadStatusProps>(\n ({ activity, classNames, children, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n return (\n <div\n {...props}\n className={mx(\n 'col-start-2 grid grid-cols-[min-content_1fr_max-content] pb-2 pie-2 text-xs text-description',\n classNames,\n )}\n ref={forwardedRef}\n >\n <Spinner\n weight='bold'\n data-visible={activity ? 'show' : 'hide'}\n className='is-6 bs-4 invisible data-[visible=show]:visible animate-spin-slow'\n />\n <span className='truncate min-is-0' aria-live='polite'>\n {activity ? children : null}\n </span>\n <span className={mx('text-end', hoverableControlItem)}>{t('enter to send message')}</span>\n </div>\n );\n },\n);\n\nexport const Thread = {\n Root: ThreadRoot,\n Header: ThreadHeader,\n Status: ThreadStatus,\n};\n\nexport type { ThreadRootProps, ThreadHeaderProps as ThreadHeadingProps, ThreadStatusProps };\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\nimport React, { type ComponentPropsWithRef, forwardRef, type ComponentPropsWithoutRef } from 'react';\n\n// TODO(burdon): Remove dep.\nimport { Avatar, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { type UseTextEditorProps, keymap, listener, useTextEditor } from '@dxos/react-ui-editor';\nimport { focusRing, mx } from '@dxos/react-ui-theme';\nimport { hexToEmoji, hexToHue, isNotFalsy } from '@dxos/util';\n\nimport { translationKey } from '../translations';\nimport { type MessageMetadata } from '../types';\n\nconst avatarSize = 7;\n\nexport type MessageRootProps = ThemedClassName<ComponentPropsWithRef<'div'>> &\n MessageMetadata &\n Partial<{ continues: boolean }>;\n\nexport const MessageRoot = forwardRef<HTMLDivElement, MessageRootProps>(\n (\n { authorImgSrc, authorId, authorName, authorAvatarProps, continues = true, children, classNames, ...rootProps },\n forwardedRef,\n ) => {\n return (\n // Must wrap the message since Avatar.Label may be used in the content.\n <Avatar.Root>\n <div\n role='none'\n data-testid='thread.message'\n {...rootProps}\n className={mx('grid grid-cols-subgrid col-span-2', classNames)}\n ref={forwardedRef}\n >\n <div role='none' className='flex flex-col items-center gap-2 pbs-2'>\n <Avatar.Content\n size={avatarSize}\n hue={authorAvatarProps?.hue || hexToHue(authorId ?? '0')}\n fallback={authorAvatarProps?.emoji || hexToEmoji(authorId ?? '0')}\n {...(authorImgSrc && { imgSrc: authorImgSrc })}\n />\n {continues && <div role='none' className='is-px grow bg-separator' />}\n </div>\n <div role='none' className='plb-1 min-is-0'>\n {children}\n </div>\n </div>\n </Avatar.Root>\n );\n },\n);\n\nexport type MessageHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> &\n Pick<MessageMetadata, 'authorName' | 'timestamp'>;\n\nexport const MessageHeading = ({ children, classNames, timestamp, authorName, ...props }: MessageHeadingProps) => {\n return (\n <div role='none' {...props} className={mx('flex gap-2 items-start', classNames)}>\n <p className='grow'>\n <MessageAuthorName authorName={authorName} />\n {timestamp && <MessageTime timestamp={timestamp} />}\n </p>\n {children}\n </div>\n );\n};\n\nexport type MessageAuthorNameProps = Pick<MessageMetadata, 'authorName'>;\n\nexport const MessageAuthorName = ({ authorName }: MessageAuthorNameProps) => {\n const { t } = useTranslation(translationKey);\n return (\n <Avatar.Label classNames='block truncate text-sm text-subdued'>{authorName ?? t('anonymous label')}</Avatar.Label>\n );\n};\n\nexport type MessageTimeProps = Pick<MessageMetadata, 'timestamp'>;\n\nexport const MessageTime = ({ timestamp }: MessageTimeProps) => {\n const { dtLocale } = useTranslation(translationKey);\n const dt = timestamp ? new Date(timestamp) : undefined;\n return (\n <time className='block text-subdued text-xs pbe-0.5' dateTime={dt?.toISOString()}>\n {dt ? formatDistanceToNow(dt, { locale: dtLocale, addSuffix: true }) : ''}\n </time>\n );\n};\n\nexport type MessageBodyProps = ComponentPropsWithoutRef<'p'>;\n\nexport const MessageBody = ({ children, ...props }: MessageBodyProps) => {\n return <p {...props}>{children}</p>;\n};\n\nexport type MessageTextboxProps = {\n disabled?: boolean;\n onSend?: () => void;\n onClear?: () => void;\n onEditorFocus?: () => void;\n} & MessageMetadata &\n UseTextEditorProps;\n\nconst keyBindings = ({ onSend, onClear }: Pick<MessageTextboxProps, 'onSend' | 'onClear'>) => [\n {\n key: 'Enter',\n run: () => {\n if (onSend) {\n onSend();\n return true;\n } else {\n return false;\n }\n },\n },\n {\n // TODO(burdon): Other key bindings.\n key: 'Meta+Backspace',\n run: () => {\n if (onClear) {\n onClear();\n return true;\n } else {\n return false;\n }\n },\n },\n];\n\nexport const MessageTextbox = ({\n id,\n authorId,\n authorName,\n authorImgSrc,\n authorAvatarProps,\n disabled,\n extensions,\n onSend,\n onClear,\n onEditorFocus,\n ...editorProps\n}: MessageTextboxProps) => {\n const { parentRef, focusAttributes } = useTextEditor(\n () => ({\n id,\n extensions: [\n keymap.of(keyBindings({ onSend, onClear })),\n listener({\n onFocus: (focusing) => {\n if (focusing) {\n onEditorFocus?.();\n }\n },\n }),\n extensions,\n ].filter(isNotFalsy),\n ...editorProps,\n }),\n [id, extensions],\n );\n\n return (\n <MessageRoot {...{ id, authorId, authorName, authorImgSrc, authorAvatarProps }} continues={false}>\n <div\n role='none'\n ref={parentRef}\n className={mx('plb-0.5 mie-1 rounded-sm', focusRing, disabled && 'opacity-50')}\n {...focusAttributes}\n />\n </MessageRoot>\n );\n};\n"],
|
|
5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MAAAA,MAAyB;;;AAClE,WAAO,gBAAAnB,OAAA,cAACoB,KAAMD,OAAQvB,QAAAA;;;;AACxB;AAUA,IAAM0C,cAAc,CAAC,EAAEC,QAAQC,QAAO,MAAwD;EAC5F;IACEC,KAAK;IACLC,KAAK,MAAA;AACH,UAAIH,QAAQ;AACVA,eAAAA;AACA,eAAO;MACT,OAAO;AACL,eAAO;MACT;IACF;EACF;EACA;;IAEEE,KAAK;IACLC,KAAK,MAAA;AACH,UAAIF,SAAS;AACXA,gBAAAA;AACA,eAAO;MACT,OAAO;AACL,eAAO;MACT;IACF;EACF;;AAGK,IAAMG,iBAAiB,CAAC,EAC7BC,IACApD,UACAC,YACAF,cACAG,mBACAmD,UACAC,YACAP,QACAC,SACAO,eACA,GAAGC,YAAAA,MACiB;;;AACpB,UAAM,EAAEC,WAAWC,gBAAe,IAAKC,cACrC,OAAO;MACLP;MACAE,YAAY;QACVM,OAAOC,GAAGf,YAAY;UAAEC;UAAQC;QAAQ,CAAA,CAAA;QACxCc,SAAS;UACPC,SAAS,CAACC,aAAAA;AACR,gBAAIA,UAAU;AACZT,8BAAAA;YACF;UACF;QACF,CAAA;QACAD;QACAW,OAAOC,UAAAA;MACT,GAAGV;IACL,IACA;MAACJ;MAAIE;KAAW;AAGlB,WACE,gBAAA9C,OAAA,cAACX,aAAAA;MAAkBuD;MAAIpD;MAAUC;MAAYF;MAAcG;MAAqBC,WAAW;OACzF,gBAAAK,OAAA,cAACG,OAAAA;MACCC,MAAK;MACLI,KAAKyC;MACL3C,WAAWC,IAAG,4BAA4BoD,WAAWd,YAAY,YAAA;MAChE,GAAGK;;;;;AAIZ;",
|
|
6
|
-
"names": ["translationKey", "translations", "CaretDoubleRight", "Spinner", "React", "forwardRef", "useTranslation", "hoverableControlItem", "hoverableFocusedWithinControls", "mx", "threadLayout", "ThreadRoot", "forwardRef", "current", "children", "classNames", "props", "forwardedRef", "div", "role", "data-testid", "className", "mx", "hoverableFocusedWithinControls", "ref", "ThreadHeader", "detached", "CaretDoubleRight", "p", "ThreadStatus", "activity", "t", "useTranslation", "translationKey", "Spinner", "weight", "data-visible", "span", "aria-live", "hoverableControlItem", "Thread", "Root", "Header", "Status", "formatDistanceToNow", "React", "forwardRef", "Avatar", "useTranslation", "keymap", "listener", "useTextEditor", "focusRing", "mx", "hexToEmoji", "hexToHue", "isNotFalsy", "avatarSize", "MessageRoot", "forwardRef", "authorImgSrc", "authorId", "authorName", "authorAvatarProps", "continues", "children", "classNames", "rootProps", "forwardedRef", "React", "Avatar", "Root", "div", "role", "data-testid", "className", "mx", "ref", "Content", "size", "hue", "hexToHue", "fallback", "emoji", "hexToEmoji", "imgSrc", "MessageHeading", "timestamp", "props", "p", "MessageAuthorName", "MessageTime", "t", "useTranslation", "translationKey", "Label", "dtLocale", "dt", "Date", "undefined", "time", "dateTime", "toISOString", "formatDistanceToNow", "locale", "addSuffix", "MessageBody", "keyBindings", "onSend", "onClear", "key", "run", "MessageTextbox", "id", "disabled", "extensions", "onEditorFocus", "editorProps", "parentRef", "focusAttributes", "useTextEditor", "keymap", "of", "listener", "onFocus", "focusing", "filter", "isNotFalsy", "focusRing"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"src/translations.ts":{"bytes":2466,"imports":[],"format":"esm"},"src/Thread/Thread.tsx":{"bytes":10462,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"src/Thread/index.ts":{"bytes":459,"imports":[{"path":"src/Thread/Thread.tsx","kind":"import-statement","original":"./Thread"}],"format":"esm"},"src/Message/Message.tsx":{"bytes":17557,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"src/Message/index.ts":{"bytes":461,"imports":[{"path":"src/Message/Message.tsx","kind":"import-statement","original":"./Message"}],"format":"esm"},"src/types.ts":{"bytes":898,"imports":[],"format":"esm"},"src/index.ts":{"bytes":876,"imports":[{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/Thread/index.ts","kind":"import-statement","original":"./Thread"},{"path":"src/Message/index.ts","kind":"import-statement","original":"./Message"},{"path":"src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":15392},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["MessageAuthorName","MessageBody","MessageHeading","MessageRoot","MessageTextbox","MessageTime","Thread","threadLayout","translations"],"entryPoint":"src/index.ts","inputs":{"src/translations.ts":{"bytesInOutput":610},"src/Thread/Thread.tsx":{"bytesInOutput":2965},"src/Thread/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0},"src/Message/Message.tsx":{"bytesInOutput":4934},"src/Message/index.ts":{"bytesInOutput":0}},"bytes":8869}}}
|