@dxos/react-ui-thread 0.3.11-main.5c52a13
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/LICENSE +8 -0
- package/README.md +3 -0
- package/dist/lib/browser/index.mjs +246 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/types/src/Message/Message.d.ts +30 -0
- package/dist/types/src/Message/Message.d.ts.map +1 -0
- package/dist/types/src/Message/Message.stories.d.ts +28 -0
- package/dist/types/src/Message/Message.stories.d.ts.map +1 -0
- package/dist/types/src/Message/command-extension.d.ts +3 -0
- package/dist/types/src/Message/command-extension.d.ts.map +1 -0
- package/dist/types/src/Message/index.d.ts +2 -0
- package/dist/types/src/Message/index.d.ts.map +1 -0
- package/dist/types/src/Thread/Comments.stories.d.ts +61 -0
- package/dist/types/src/Thread/Comments.stories.d.ts.map +1 -0
- package/dist/types/src/Thread/Thread.d.ts +14 -0
- package/dist/types/src/Thread/Thread.d.ts.map +1 -0
- package/dist/types/src/Thread/Thread.stories.d.ts +29 -0
- package/dist/types/src/Thread/Thread.stories.d.ts.map +1 -0
- package/dist/types/src/Thread/index.d.ts +2 -0
- package/dist/types/src/Thread/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +6 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +19 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +19 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/package.json +51 -0
- package/src/Message/Message.stories.tsx +45 -0
- package/src/Message/Message.tsx +186 -0
- package/src/Message/command-extension.ts +40 -0
- package/src/Message/index.ts +5 -0
- package/src/Thread/Comments.stories.tsx +368 -0
- package/src/Thread/Thread.stories.tsx +77 -0
- package/src/Thread/Thread.tsx +82 -0
- package/src/Thread/index.ts +5 -0
- package/src/index.ts +10 -0
- package/src/translations.ts +24 -0
- package/src/types.ts +26 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
Copyright (c) 2022 DXOS
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
// packages/ui/react-ui-thread/src/translations.ts
|
|
2
|
+
var translationKey = "thread";
|
|
3
|
+
var translations_default = [
|
|
4
|
+
{
|
|
5
|
+
"en-US": {
|
|
6
|
+
[translationKey]: {
|
|
7
|
+
"plugin name": "Threads",
|
|
8
|
+
"thread title placeholder": "New thread",
|
|
9
|
+
"thread title label": "Title",
|
|
10
|
+
"delete thread label": "Delete",
|
|
11
|
+
"create thread label": "Create thread",
|
|
12
|
+
"message placeholder": "Enter message...",
|
|
13
|
+
"comment placeholder": "Enter comment...",
|
|
14
|
+
"settings standalone label": "Enable standalone thread creation",
|
|
15
|
+
"anonymous label": "Anonymous",
|
|
16
|
+
"enter to send message": "Enter to add \u23CE"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
// packages/ui/react-ui-thread/src/Thread/Thread.tsx
|
|
23
|
+
import { ArrowBendLeftDown, DotsThreeOutline } from "@phosphor-icons/react";
|
|
24
|
+
import React, { forwardRef } from "react";
|
|
25
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
26
|
+
import { hoverableControlItem, hoverableFocusedWithinControls, mx } from "@dxos/react-ui-theme";
|
|
27
|
+
var Thread = /* @__PURE__ */ forwardRef(({ current, children, classNames, ...props }, forwardedRef) => {
|
|
28
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
29
|
+
role: "group",
|
|
30
|
+
...current && {
|
|
31
|
+
"aria-current": typeof current === "string" ? current : "location"
|
|
32
|
+
},
|
|
33
|
+
...props,
|
|
34
|
+
className: mx("is-full place-self-start grid grid-cols-[3rem_1fr] bg-[var(--surface-bg)] border-[color:var(--surface-separator)] border-bs border-be plb-1.5 attention attention-within attention-current [--controls-opacity:0]", hoverableFocusedWithinControls, classNames),
|
|
35
|
+
ref: forwardedRef
|
|
36
|
+
}, children);
|
|
37
|
+
});
|
|
38
|
+
var ThreadHeading = /* @__PURE__ */ forwardRef(({ classNames, children, ...props }, forwardedRef) => {
|
|
39
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
40
|
+
role: "heading",
|
|
41
|
+
...props,
|
|
42
|
+
className: mx("col-span-2 grid grid-cols-subgrid fg-description font-medium", classNames),
|
|
43
|
+
ref: forwardedRef
|
|
44
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
45
|
+
role: "none",
|
|
46
|
+
className: "grid place-items-end pie-3.5 fg-separator"
|
|
47
|
+
}, /* @__PURE__ */ React.createElement(ArrowBendLeftDown, null)), /* @__PURE__ */ React.createElement("p", null, children));
|
|
48
|
+
});
|
|
49
|
+
var ThreadFooter = /* @__PURE__ */ forwardRef(({ activity, classNames, children, ...props }, forwardedRef) => {
|
|
50
|
+
const { t } = useTranslation(translationKey);
|
|
51
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
52
|
+
...props,
|
|
53
|
+
className: mx("col-start-2 grid grid-cols-[min-content_1fr_max-content] text-xs fg-description", classNames),
|
|
54
|
+
ref: forwardedRef
|
|
55
|
+
}, /* @__PURE__ */ React.createElement(DotsThreeOutline, {
|
|
56
|
+
weight: "fill",
|
|
57
|
+
"data-visible": activity ? "show" : "hide",
|
|
58
|
+
className: "is-6 bs-4 invisible data-[visible=show]:visible"
|
|
59
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
60
|
+
className: "truncate min-is-0",
|
|
61
|
+
"aria-live": "polite"
|
|
62
|
+
}, activity ? children : null), /* @__PURE__ */ React.createElement("span", {
|
|
63
|
+
className: mx("text-end pie-1", hoverableControlItem)
|
|
64
|
+
}, t("enter to send message")));
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// packages/ui/react-ui-thread/src/Message/Message.tsx
|
|
68
|
+
import { X } from "@phosphor-icons/react";
|
|
69
|
+
import { formatDistanceToNow } from "date-fns/formatDistanceToNow";
|
|
70
|
+
import React2, { forwardRef as forwardRef2 } from "react";
|
|
71
|
+
import { Avatar, Button, useJdenticonHref, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
72
|
+
import { TextEditor, keymap, listener } from "@dxos/react-ui-editor";
|
|
73
|
+
import { focusRing, hoverableControlItem as hoverableControlItem2, hoverableControls, hoverableFocusedWithinControls as hoverableFocusedWithinControls2, mx as mx2 } from "@dxos/react-ui-theme";
|
|
74
|
+
import { safeParseJson } from "@dxos/util";
|
|
75
|
+
|
|
76
|
+
// packages/ui/react-ui-thread/src/Message/command-extension.ts
|
|
77
|
+
import { StreamLanguage, HighlightStyle, syntaxHighlighting } from "@codemirror/language";
|
|
78
|
+
import { tags } from "@dxos/react-ui-editor";
|
|
79
|
+
import { tagRoot } from "@dxos/react-ui-theme";
|
|
80
|
+
var parser = StreamLanguage.define({
|
|
81
|
+
startState: () => ({
|
|
82
|
+
count: 0
|
|
83
|
+
}),
|
|
84
|
+
token: (stream, state) => {
|
|
85
|
+
state.count++;
|
|
86
|
+
if (stream.eatSpace()) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
if (state.count === 1 && stream.match(/^(\/\w+)/)) {
|
|
90
|
+
return "tagName";
|
|
91
|
+
}
|
|
92
|
+
stream.next();
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
var styles = HighlightStyle.define([
|
|
97
|
+
{
|
|
98
|
+
tag: tags.tagName,
|
|
99
|
+
class: tagRoot({})
|
|
100
|
+
}
|
|
101
|
+
]);
|
|
102
|
+
var command = [
|
|
103
|
+
parser,
|
|
104
|
+
syntaxHighlighting(styles)
|
|
105
|
+
];
|
|
106
|
+
|
|
107
|
+
// packages/ui/react-ui-thread/src/Message/Message.tsx
|
|
108
|
+
var avatarSize = 7;
|
|
109
|
+
var messageCell = "plb-1 min-is-0";
|
|
110
|
+
var MessageMeta = /* @__PURE__ */ forwardRef2(({ authorImgSrc, authorStatus, authorId, authorName, continues = true, children, classNames, ...rootProps }, forwardedRef) => {
|
|
111
|
+
const jdenticon = useJdenticonHref(authorId ?? "", avatarSize);
|
|
112
|
+
return /* @__PURE__ */ React2.createElement(Avatar.Root, {
|
|
113
|
+
status: authorStatus ?? "inactive",
|
|
114
|
+
size: avatarSize
|
|
115
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
116
|
+
role: "none",
|
|
117
|
+
...rootProps,
|
|
118
|
+
className: mx2("grid grid-cols-subgrid col-span-2", classNames),
|
|
119
|
+
ref: forwardedRef
|
|
120
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
121
|
+
role: "none",
|
|
122
|
+
className: "flex flex-col items-center gap-2 " + messageCell
|
|
123
|
+
}, /* @__PURE__ */ React2.createElement(Avatar.Frame, null, /* @__PURE__ */ React2.createElement(Avatar.Fallback, {
|
|
124
|
+
href: jdenticon
|
|
125
|
+
}), authorImgSrc && /* @__PURE__ */ React2.createElement(Avatar.Image, {
|
|
126
|
+
href: authorImgSrc
|
|
127
|
+
})), continues && /* @__PURE__ */ React2.createElement("div", {
|
|
128
|
+
role: "none",
|
|
129
|
+
className: "is-px grow surface-separator"
|
|
130
|
+
})), /* @__PURE__ */ React2.createElement("div", {
|
|
131
|
+
role: "none",
|
|
132
|
+
className: messageCell
|
|
133
|
+
}, children)));
|
|
134
|
+
});
|
|
135
|
+
var DefaultMessageBlock = ({ block, onBlockDelete }) => {
|
|
136
|
+
const contentWidth = onBlockDelete ? "col-span-2" : "col-span-3";
|
|
137
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
138
|
+
role: "none",
|
|
139
|
+
className: mx2("grid grid-cols-subgrid col-span-3", hoverableControls, hoverableFocusedWithinControls2)
|
|
140
|
+
}, block.data ? /* @__PURE__ */ React2.createElement("pre", {
|
|
141
|
+
className: mx2("font-mono max-is-full overflow-x-auto", contentWidth)
|
|
142
|
+
}, /* @__PURE__ */ React2.createElement("code", null, JSON.stringify(safeParseJson(block.data), void 0, 2))) : /* @__PURE__ */ React2.createElement("p", {
|
|
143
|
+
className: contentWidth
|
|
144
|
+
}, block.text ?? ""), onBlockDelete && /* @__PURE__ */ React2.createElement(Button, {
|
|
145
|
+
variant: "ghost",
|
|
146
|
+
classNames: [
|
|
147
|
+
"p-1 min-bs-0 mie-1 place-self-start transition-opacity",
|
|
148
|
+
hoverableControlItem2
|
|
149
|
+
],
|
|
150
|
+
onClick: onBlockDelete
|
|
151
|
+
}, /* @__PURE__ */ React2.createElement(X, null)));
|
|
152
|
+
};
|
|
153
|
+
var Message = (props) => {
|
|
154
|
+
const { t, dtLocale } = useTranslation2(translationKey);
|
|
155
|
+
const { authorName, onDelete, blocks, id, MessageBlockComponent = DefaultMessageBlock, ...metaProps } = props;
|
|
156
|
+
const firstBlock = blocks[0];
|
|
157
|
+
const dt = firstBlock.timestamp ? new Date(firstBlock.timestamp) : void 0;
|
|
158
|
+
return /* @__PURE__ */ React2.createElement(MessageMeta, {
|
|
159
|
+
...metaProps,
|
|
160
|
+
id,
|
|
161
|
+
continues: true
|
|
162
|
+
}, /* @__PURE__ */ React2.createElement("p", {
|
|
163
|
+
className: "grid grid-cols-[1fr_max-content] gap-2 pie-2"
|
|
164
|
+
}, /* @__PURE__ */ React2.createElement(Avatar.Label, {
|
|
165
|
+
classNames: [
|
|
166
|
+
"truncate font-semibold",
|
|
167
|
+
!authorName && "fg-description"
|
|
168
|
+
]
|
|
169
|
+
}, authorName ?? t("anonymous label")), /* @__PURE__ */ React2.createElement("time", {
|
|
170
|
+
className: "fg-description text-xs pbs-1",
|
|
171
|
+
dateTime: dt?.toISOString()
|
|
172
|
+
}, dt ? formatDistanceToNow(dt, {
|
|
173
|
+
locale: dtLocale,
|
|
174
|
+
addSuffix: true
|
|
175
|
+
}) : "")), /* @__PURE__ */ React2.createElement("div", {
|
|
176
|
+
role: "none",
|
|
177
|
+
className: "grid gap-y-1 grid-cols-[min-content_1fr_min-content]"
|
|
178
|
+
}, blocks.map((block, i) => /* @__PURE__ */ React2.createElement(MessageBlockComponent, {
|
|
179
|
+
key: i,
|
|
180
|
+
block,
|
|
181
|
+
onBlockDelete: onDelete && (() => onDelete(id, i))
|
|
182
|
+
}))));
|
|
183
|
+
};
|
|
184
|
+
var MessageTextbox = /* @__PURE__ */ forwardRef2(({ onSend, onClear, onEditorFocus, authorId, authorName, authorImgSrc, disabled, ...editorProps }, forwardedRef) => {
|
|
185
|
+
return /* @__PURE__ */ React2.createElement(MessageMeta, {
|
|
186
|
+
id: editorProps.model.id,
|
|
187
|
+
authorId,
|
|
188
|
+
authorName,
|
|
189
|
+
authorImgSrc,
|
|
190
|
+
authorStatus: "active",
|
|
191
|
+
continues: false
|
|
192
|
+
}, /* @__PURE__ */ React2.createElement(TextEditor, {
|
|
193
|
+
slots: {
|
|
194
|
+
root: {
|
|
195
|
+
className: mx2("plb-1 mie-1 rounded-sm", focusRing, disabled && "opacity-50")
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
readonly: disabled,
|
|
199
|
+
extensions: [
|
|
200
|
+
command,
|
|
201
|
+
keymap.of([
|
|
202
|
+
{
|
|
203
|
+
key: "Enter",
|
|
204
|
+
run: () => {
|
|
205
|
+
if (onSend) {
|
|
206
|
+
onSend();
|
|
207
|
+
return true;
|
|
208
|
+
} else {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
key: "Meta+Backspace",
|
|
215
|
+
run: () => {
|
|
216
|
+
if (onClear) {
|
|
217
|
+
onClear();
|
|
218
|
+
return true;
|
|
219
|
+
} else {
|
|
220
|
+
return false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
]),
|
|
225
|
+
listener({
|
|
226
|
+
onFocus: (focused) => {
|
|
227
|
+
if (focused) {
|
|
228
|
+
onEditorFocus?.();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
})
|
|
232
|
+
],
|
|
233
|
+
...editorProps,
|
|
234
|
+
ref: forwardedRef
|
|
235
|
+
}));
|
|
236
|
+
});
|
|
237
|
+
export {
|
|
238
|
+
Message,
|
|
239
|
+
MessageMeta,
|
|
240
|
+
MessageTextbox,
|
|
241
|
+
Thread,
|
|
242
|
+
ThreadFooter,
|
|
243
|
+
ThreadHeading,
|
|
244
|
+
translations_default as translations
|
|
245
|
+
};
|
|
246
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/translations.ts", "../../../src/Thread/Thread.tsx", "../../../src/Message/Message.tsx", "../../../src/Message/command-extension.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport const translationKey = 'thread';\n\nexport default [\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];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ArrowBendLeftDown, DotsThreeOutline } from '@phosphor-icons/react';\nimport React, { type ComponentProps, 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\nexport type ThreadProps = ThemedClassName<ComponentPropsWithRef<'div'>> &\n ThreadEntity & { current?: boolean | ComponentProps<'div'>['aria-current'] };\n\nexport const Thread = forwardRef<HTMLDivElement, ThreadProps>(\n ({ current, children, classNames, ...props }, forwardedRef) => {\n return (\n <div\n role='group'\n {...(current && { 'aria-current': typeof current === 'string' ? current : 'location' })}\n {...props}\n className={mx(\n 'is-full place-self-start grid grid-cols-[3rem_1fr] bg-[var(--surface-bg)] border-[color:var(--surface-separator)] border-bs border-be plb-1.5 attention attention-within attention-current [--controls-opacity:0]',\n hoverableFocusedWithinControls,\n classNames,\n )}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\nexport type ThreadHeadingProps = ThemedClassName<ComponentPropsWithRef<'div'>>;\n\nexport const ThreadHeading = forwardRef<HTMLDivElement, ThreadHeadingProps>(\n ({ classNames, children, ...props }, forwardedRef) => {\n return (\n <div\n role='heading'\n {...props}\n className={mx('col-span-2 grid grid-cols-subgrid fg-description font-medium', classNames)}\n ref={forwardedRef}\n >\n <div role='none' className='grid place-items-end pie-3.5 fg-separator'>\n <ArrowBendLeftDown />\n </div>\n <p>{children}</p>\n </div>\n );\n },\n);\n\nexport type ThreadFooterProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {\n activity?: boolean;\n};\n\nexport const ThreadFooter = forwardRef<HTMLDivElement, ThreadFooterProps>(\n ({ activity, classNames, children, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n return (\n <div\n {...props}\n className={mx('col-start-2 grid grid-cols-[min-content_1fr_max-content] text-xs fg-description', classNames)}\n ref={forwardedRef}\n >\n <DotsThreeOutline\n weight='fill'\n data-visible={activity ? 'show' : 'hide'}\n className='is-6 bs-4 invisible data-[visible=show]:visible'\n />\n <span className='truncate min-is-0' aria-live='polite'>\n {activity ? children : null}\n </span>\n <span className={mx('text-end pie-1', hoverableControlItem)}>{t('enter to send message')}</span>\n </div>\n );\n },\n);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { X } from '@phosphor-icons/react';\nimport { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\nimport React, { type ComponentPropsWithRef, type FC, forwardRef } from 'react';\n\nimport { Avatar, Button, type ThemedClassName, useJdenticonHref, useTranslation } from '@dxos/react-ui';\nimport { TextEditor, type TextEditorProps, keymap, type EditorView, listener } from '@dxos/react-ui-editor';\nimport {\n focusRing,\n hoverableControlItem,\n hoverableControls,\n hoverableFocusedWithinControls,\n mx,\n} from '@dxos/react-ui-theme';\nimport { safeParseJson } from '@dxos/util';\n\nimport { command } from './command-extension';\nimport { translationKey } from '../translations';\nimport { type MessageEntity, type MessageEntityBlock, type MessageMetadata } from '../types';\n\nconst avatarSize = 7;\n\nconst messageCell = 'plb-1 min-is-0';\n\nexport type MessageMetaProps = ThemedClassName<ComponentPropsWithRef<'div'>> &\n MessageMetadata &\n Partial<{ continues: boolean }>;\n\nexport const MessageMeta = forwardRef<HTMLDivElement, MessageMetaProps>(\n (\n { authorImgSrc, authorStatus, authorId, authorName, continues = true, children, classNames, ...rootProps },\n forwardedRef,\n ) => {\n const jdenticon = useJdenticonHref(authorId ?? '', avatarSize);\n\n return (\n <Avatar.Root status={authorStatus ?? 'inactive'} size={avatarSize}>\n <div\n role='none'\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 ' + messageCell}>\n <Avatar.Frame>\n <Avatar.Fallback href={jdenticon} />\n {authorImgSrc && <Avatar.Image href={authorImgSrc} />}\n </Avatar.Frame>\n {continues && <div role='none' className='is-px grow surface-separator' />}\n </div>\n <div role='none' className={messageCell}>\n {children}\n </div>\n </div>\n </Avatar.Root>\n );\n },\n);\n\nexport type MessageBlockProps<BlockValue> = {\n block: MessageEntityBlock<BlockValue>;\n onBlockDelete?: () => void;\n};\n\nconst DefaultMessageBlock = ({ block, onBlockDelete }: MessageBlockProps<{ data?: any; text?: string }>) => {\n const contentWidth = onBlockDelete ? 'col-span-2' : 'col-span-3';\n return (\n <div\n role='none'\n className={mx('grid grid-cols-subgrid col-span-3', hoverableControls, hoverableFocusedWithinControls)}\n >\n {block.data ? (\n <pre className={mx('font-mono max-is-full overflow-x-auto', contentWidth)}>\n <code>{JSON.stringify(safeParseJson(block.data), undefined, 2)}</code>\n </pre>\n ) : (\n <p className={contentWidth}>{block.text ?? ''}</p>\n )}\n {onBlockDelete && (\n <Button\n variant='ghost'\n classNames={['p-1 min-bs-0 mie-1 place-self-start transition-opacity', hoverableControlItem]}\n onClick={onBlockDelete}\n >\n <X />\n </Button>\n )}\n </div>\n );\n};\n\nexport type MessageProps<BlockValue> = MessageEntity<BlockValue> & {\n onDelete?: (messageId: string, blockIndex: number) => void;\n MessageBlockComponent?: FC<MessageBlockProps<BlockValue>>;\n};\n\nexport const Message = <BlockValue,>(props: MessageProps<BlockValue>) => {\n const { t, dtLocale } = useTranslation(translationKey);\n\n const { authorName, onDelete, blocks, id, MessageBlockComponent = DefaultMessageBlock, ...metaProps } = props;\n\n const firstBlock = blocks[0];\n const dt = firstBlock.timestamp ? new Date(firstBlock.timestamp) : undefined;\n\n return (\n <MessageMeta {...metaProps} id={id} continues>\n <p className='grid grid-cols-[1fr_max-content] gap-2 pie-2'>\n <Avatar.Label classNames={['truncate font-semibold', !authorName && 'fg-description']}>\n {authorName ?? t('anonymous label')}\n </Avatar.Label>\n <time className='fg-description text-xs pbs-1' dateTime={dt?.toISOString()}>\n {dt ? formatDistanceToNow(dt, { locale: dtLocale, addSuffix: true }) : ''}\n </time>\n </p>\n <div role='none' className='grid gap-y-1 grid-cols-[min-content_1fr_min-content]'>\n {blocks.map((block, i) => (\n <MessageBlockComponent key={i} block={block} onBlockDelete={onDelete && (() => onDelete(id, i))} />\n ))}\n </div>\n </MessageMeta>\n );\n};\n\nexport type MessageTextboxProps = {\n onSend?: () => void;\n onClear?: () => void;\n onEditorFocus?: () => void;\n disabled?: boolean;\n} & Omit<MessageMetadata, 'id' | 'authorStatus'> &\n TextEditorProps;\n\nexport const MessageTextbox = forwardRef<EditorView, MessageTextboxProps>(\n ({ onSend, onClear, onEditorFocus, authorId, authorName, authorImgSrc, disabled, ...editorProps }, forwardedRef) => {\n return (\n <MessageMeta\n {...{ id: editorProps.model.id, authorId, authorName, authorImgSrc }}\n authorStatus='active'\n continues={false}\n >\n <TextEditor\n slots={{ root: { className: mx('plb-1 mie-1 rounded-sm', focusRing, disabled && 'opacity-50') } }}\n readonly={disabled}\n extensions={[\n command,\n keymap.of([\n {\n key: 'Enter',\n run: () => {\n if (onSend) {\n onSend();\n return true;\n } else {\n return false;\n }\n },\n },\n {\n key: 'Meta+Backspace',\n run: () => {\n if (onClear) {\n onClear();\n return true;\n } else {\n return false;\n }\n },\n },\n ]),\n listener({\n onFocus: (focused) => {\n if (focused) {\n onEditorFocus?.();\n }\n },\n }),\n ]}\n {...editorProps}\n ref={forwardedRef}\n />\n </MessageMeta>\n );\n },\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { StreamLanguage, HighlightStyle, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\n\nimport { tags } from '@dxos/react-ui-editor';\nimport { tagRoot } from '@dxos/react-ui-theme';\n\n/**\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n if (state.count === 1 && stream.match(/^(\\/\\w+)/)) {\n return 'tagName';\n }\n stream.next();\n return null;\n },\n});\n\n/**\n * https://codemirror.net/examples/styling\n * https://lezer.codemirror.net/docs/ref/#highlight\n */\nconst styles = HighlightStyle.define([\n {\n tag: tags.tagName,\n class: tagRoot({}),\n },\n]);\n\nexport const command: Extension = [parser, syntaxHighlighting(styles)];\n"],
|
|
5
|
+
"mappings": ";AAIO,IAAMA,iBAAiB;AAE9B,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACA,cAAAA,GAAiB;QAChB,eAAe;QACf,4BAA4B;QAC5B,sBAAsB;QACtB,uBAAuB;QACvB,uBAAuB;QACvB,uBAAuB;QACvB,uBAAuB;QACvB,6BAA6B;QAC7B,mBAAmB;QACnB,yBAAyB;MAC3B;IACF;EACF;;;;AClBF,SAASC,mBAAmBC,wBAAwB;AACpD,OAAOC,SAA0DC,kBAAkB;AAEnF,SAA+BC,sBAAsB;AACrD,SAASC,sBAAsBC,gCAAgCC,UAAU;AAQlE,IAAMC,SAASC,2BACpB,CAAC,EAAEC,SAASC,UAAUC,YAAY,GAAGC,MAAAA,GAASC,iBAAAA;AAC5C,SACE,sBAAA,cAACC,OAAAA;IACCC,MAAK;IACJ,GAAIN,WAAW;MAAE,gBAAgB,OAAOA,YAAY,WAAWA,UAAU;IAAW;IACpF,GAAGG;IACJI,WAAWC,GACT,qNACAC,gCACAP,UAAAA;IAEFQ,KAAKN;KAEJH,QAAAA;AAGP,CAAA;AAKK,IAAMU,gBAAgBZ,2BAC3B,CAAC,EAAEG,YAAYD,UAAU,GAAGE,MAAAA,GAASC,iBAAAA;AACnC,SACE,sBAAA,cAACC,OAAAA;IACCC,MAAK;IACJ,GAAGH;IACJI,WAAWC,GAAG,gEAAgEN,UAAAA;IAC9EQ,KAAKN;KAEL,sBAAA,cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,sBAAA,cAACK,mBAAAA,IAAAA,CAAAA,GAEH,sBAAA,cAACC,KAAAA,MAAGZ,QAAAA,CAAAA;AAGV,CAAA;AAOK,IAAMa,eAAef,2BAC1B,CAAC,EAAEgB,UAAUb,YAAYD,UAAU,GAAGE,MAAAA,GAASC,iBAAAA;AAC7C,QAAM,EAAEY,EAAC,IAAKC,eAAeC,cAAAA;AAC7B,SACE,sBAAA,cAACb,OAAAA;IACE,GAAGF;IACJI,WAAWC,GAAG,mFAAmFN,UAAAA;IACjGQ,KAAKN;KAEL,sBAAA,cAACe,kBAAAA;IACCC,QAAO;IACPC,gBAAcN,WAAW,SAAS;IAClCR,WAAU;MAEZ,sBAAA,cAACe,QAAAA;IAAKf,WAAU;IAAoBgB,aAAU;KAC3CR,WAAWd,WAAW,IAAA,GAEzB,sBAAA,cAACqB,QAAAA;IAAKf,WAAWC,GAAG,kBAAkBgB,oBAAAA;KAAwBR,EAAE,uBAAA,CAAA,CAAA;AAGtE,CAAA;;;AC5EF,SAASS,SAAS;AAClB,SAASC,2BAA2B;AACpC,OAAOC,UAA8CC,cAAAA,mBAAkB;AAEvE,SAASC,QAAQC,QAA8BC,kBAAkBC,kBAAAA,uBAAsB;AACvF,SAASC,YAAkCC,QAAyBC,gBAAgB;AACpF,SACEC,WACAC,wBAAAA,uBACAC,mBACAC,kCAAAA,iCACAC,MAAAA,WACK;AACP,SAASC,qBAAqB;;;ACb9B,SAASC,gBAAgBC,gBAAgBC,0BAA0B;AAGnE,SAASC,YAAY;AACrB,SAASC,eAAe;AAKxB,IAAMC,SAASC,eAAeC,OAA0B;EACtDC,YAAY,OAAO;IAAEC,OAAO;EAAE;EAC9BC,OAAO,CAACC,QAAQC,UAAAA;AACdA,UAAMH;AACN,QAAIE,OAAOE,SAAQ,GAAI;AACrB,aAAO;IACT;AACA,QAAID,MAAMH,UAAU,KAAKE,OAAOG,MAAM,UAAA,GAAa;AACjD,aAAO;IACT;AACAH,WAAOI,KAAI;AACX,WAAO;EACT;AACF,CAAA;AAMA,IAAMC,SAASC,eAAeV,OAAO;EACnC;IACEW,KAAKC,KAAKC;IACVC,OAAOC,QAAQ,CAAC,CAAA;EAClB;CACD;AAEM,IAAMC,UAAqB;EAAClB;EAAQmB,mBAAmBR,MAAAA;;;;ADhB9D,IAAMS,aAAa;AAEnB,IAAMC,cAAc;AAMb,IAAMC,cAAcC,gBAAAA,YACzB,CACE,EAAEC,cAAcC,cAAcC,UAAUC,YAAYC,YAAY,MAAMC,UAAUC,YAAY,GAAGC,UAAAA,GAC/FC,iBAAAA;AAEA,QAAMC,YAAYC,iBAAiBR,YAAY,IAAIN,UAAAA;AAEnD,SACE,gBAAAe,OAAA,cAACC,OAAOC,MAAI;IAACC,QAAQb,gBAAgB;IAAYc,MAAMnB;KACrD,gBAAAe,OAAA,cAACK,OAAAA;IACCC,MAAK;IACJ,GAAGV;IACJW,WAAWC,IAAG,qCAAqCb,UAAAA;IACnDc,KAAKZ;KAEL,gBAAAG,OAAA,cAACK,OAAAA;IAAIC,MAAK;IAAOC,WAAW,sCAAsCrB;KAChE,gBAAAc,OAAA,cAACC,OAAOS,OAAK,MACX,gBAAAV,OAAA,cAACC,OAAOU,UAAQ;IAACC,MAAMd;MACtBT,gBAAgB,gBAAAW,OAAA,cAACC,OAAOY,OAAK;IAACD,MAAMvB;OAEtCI,aAAa,gBAAAO,OAAA,cAACK,OAAAA;IAAIC,MAAK;IAAOC,WAAU;OAE3C,gBAAAP,OAAA,cAACK,OAAAA;IAAIC,MAAK;IAAOC,WAAWrB;KACzBQ,QAAAA,CAAAA,CAAAA;AAKX,CAAA;AAQF,IAAMoB,sBAAsB,CAAC,EAAEC,OAAOC,cAAa,MAAoD;AACrG,QAAMC,eAAeD,gBAAgB,eAAe;AACpD,SACE,gBAAAhB,OAAA,cAACK,OAAAA;IACCC,MAAK;IACLC,WAAWC,IAAG,qCAAqCU,mBAAmBC,+BAAAA;KAErEJ,MAAMK,OACL,gBAAApB,OAAA,cAACqB,OAAAA;IAAId,WAAWC,IAAG,yCAAyCS,YAAAA;KAC1D,gBAAAjB,OAAA,cAACsB,QAAAA,MAAMC,KAAKC,UAAUC,cAAcV,MAAMK,IAAI,GAAGM,QAAW,CAAA,CAAA,CAAA,IAG9D,gBAAA1B,OAAA,cAAC2B,KAAAA;IAAEpB,WAAWU;KAAeF,MAAMa,QAAQ,EAAA,GAE5CZ,iBACC,gBAAAhB,OAAA,cAAC6B,QAAAA;IACCC,SAAQ;IACRnC,YAAY;MAAC;MAA0DoC;;IACvEC,SAAShB;KAET,gBAAAhB,OAAA,cAACiC,GAAAA,IAAAA,CAAAA,CAAAA;AAKX;AAOO,IAAMC,UAAU,CAAcC,UAAAA;AACnC,QAAM,EAAEC,GAAGC,SAAQ,IAAKC,gBAAeC,cAAAA;AAEvC,QAAM,EAAE/C,YAAYgD,UAAUC,QAAQC,IAAIC,wBAAwB7B,qBAAqB,GAAG8B,UAAAA,IAAcT;AAExG,QAAMU,aAAaJ,OAAO,CAAA;AAC1B,QAAMK,KAAKD,WAAWE,YAAY,IAAIC,KAAKH,WAAWE,SAAS,IAAIrB;AAEnE,SACE,gBAAA1B,OAAA,cAACb,aAAAA;IAAa,GAAGyD;IAAWF;IAAQjD,WAAAA;KAClC,gBAAAO,OAAA,cAAC2B,KAAAA;IAAEpB,WAAU;KACX,gBAAAP,OAAA,cAACC,OAAOgD,OAAK;IAACtD,YAAY;MAAC;MAA0B,CAACH,cAAc;;KACjEA,cAAc4C,EAAE,iBAAA,CAAA,GAEnB,gBAAApC,OAAA,cAACkD,QAAAA;IAAK3C,WAAU;IAA+B4C,UAAUL,IAAIM,YAAAA;KAC1DN,KAAKO,oBAAoBP,IAAI;IAAEQ,QAAQjB;IAAUkB,WAAW;EAAK,CAAA,IAAK,EAAA,CAAA,GAG3E,gBAAAvD,OAAA,cAACK,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACxBkC,OAAOe,IAAI,CAACzC,OAAO0C,MAClB,gBAAAzD,OAAA,cAAC2C,uBAAAA;IAAsBe,KAAKD;IAAG1C;IAAcC,eAAewB,aAAa,MAAMA,SAASE,IAAIe,CAAAA;;AAKtG;AAUO,IAAME,iBAAiBvE,gBAAAA,YAC5B,CAAC,EAAEwE,QAAQC,SAASC,eAAevE,UAAUC,YAAYH,cAAc0E,UAAU,GAAGC,YAAAA,GAAenE,iBAAAA;AACjG,SACE,gBAAAG,OAAA,cAACb,aAAAA;IACOuD,IAAIsB,YAAYC,MAAMvB;IAAInD;IAAUC;IAAYH;IACtDC,cAAa;IACbG,WAAW;KAEX,gBAAAO,OAAA,cAACkE,YAAAA;IACCC,OAAO;MAAEC,MAAM;QAAE7D,WAAWC,IAAG,0BAA0B6D,WAAWN,YAAY,YAAA;MAAc;IAAE;IAChGO,UAAUP;IACVQ,YAAY;MACVC;MACAC,OAAOC,GAAG;QACR;UACEhB,KAAK;UACLiB,KAAK,MAAA;AACH,gBAAIf,QAAQ;AACVA,qBAAAA;AACA,qBAAO;YACT,OAAO;AACL,qBAAO;YACT;UACF;QACF;QACA;UACEF,KAAK;UACLiB,KAAK,MAAA;AACH,gBAAId,SAAS;AACXA,sBAAAA;AACA,qBAAO;YACT,OAAO;AACL,qBAAO;YACT;UACF;QACF;OACD;MACDe,SAAS;QACPC,SAAS,CAACC,YAAAA;AACR,cAAIA,SAAS;AACXhB,4BAAAA;UACF;QACF;MACF,CAAA;;IAED,GAAGE;IACJvD,KAAKZ;;AAIb,CAAA;",
|
|
6
|
+
"names": ["translationKey", "ArrowBendLeftDown", "DotsThreeOutline", "React", "forwardRef", "useTranslation", "hoverableControlItem", "hoverableFocusedWithinControls", "mx", "Thread", "forwardRef", "current", "children", "classNames", "props", "forwardedRef", "div", "role", "className", "mx", "hoverableFocusedWithinControls", "ref", "ThreadHeading", "ArrowBendLeftDown", "p", "ThreadFooter", "activity", "t", "useTranslation", "translationKey", "DotsThreeOutline", "weight", "data-visible", "span", "aria-live", "hoverableControlItem", "X", "formatDistanceToNow", "React", "forwardRef", "Avatar", "Button", "useJdenticonHref", "useTranslation", "TextEditor", "keymap", "listener", "focusRing", "hoverableControlItem", "hoverableControls", "hoverableFocusedWithinControls", "mx", "safeParseJson", "StreamLanguage", "HighlightStyle", "syntaxHighlighting", "tags", "tagRoot", "parser", "StreamLanguage", "define", "startState", "count", "token", "stream", "state", "eatSpace", "match", "next", "styles", "HighlightStyle", "tag", "tags", "tagName", "class", "tagRoot", "command", "syntaxHighlighting", "avatarSize", "messageCell", "MessageMeta", "forwardRef", "authorImgSrc", "authorStatus", "authorId", "authorName", "continues", "children", "classNames", "rootProps", "forwardedRef", "jdenticon", "useJdenticonHref", "React", "Avatar", "Root", "status", "size", "div", "role", "className", "mx", "ref", "Frame", "Fallback", "href", "Image", "DefaultMessageBlock", "block", "onBlockDelete", "contentWidth", "hoverableControls", "hoverableFocusedWithinControls", "data", "pre", "code", "JSON", "stringify", "safeParseJson", "undefined", "p", "text", "Button", "variant", "hoverableControlItem", "onClick", "X", "Message", "props", "t", "dtLocale", "useTranslation", "translationKey", "onDelete", "blocks", "id", "MessageBlockComponent", "metaProps", "firstBlock", "dt", "timestamp", "Date", "Label", "time", "dateTime", "toISOString", "formatDistanceToNow", "locale", "addSuffix", "map", "i", "key", "MessageTextbox", "onSend", "onClear", "onEditorFocus", "disabled", "editorProps", "model", "TextEditor", "slots", "root", "focusRing", "readonly", "extensions", "command", "keymap", "of", "run", "listener", "onFocus", "focused"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"inputs":{"packages/ui/react-ui-thread/src/translations.ts":{"bytes":2281,"imports":[],"format":"esm"},"packages/ui/react-ui-thread/src/Thread/Thread.tsx":{"bytes":8591,"imports":[{"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":"packages/ui/react-ui-thread/src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"packages/ui/react-ui-thread/src/Thread/index.ts":{"bytes":472,"imports":[{"path":"packages/ui/react-ui-thread/src/Thread/Thread.tsx","kind":"import-statement","original":"./Thread"}],"format":"esm"},"packages/ui/react-ui-thread/src/Message/command-extension.ts":{"bytes":3654,"imports":[{"path":"@codemirror/language","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}],"format":"esm"},"packages/ui/react-ui-thread/src/Message/Message.tsx":{"bytes":19784,"imports":[{"path":"@phosphor-icons/react","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":"packages/ui/react-ui-thread/src/Message/command-extension.ts","kind":"import-statement","original":"./command-extension"},{"path":"packages/ui/react-ui-thread/src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"packages/ui/react-ui-thread/src/Message/index.ts":{"bytes":474,"imports":[{"path":"packages/ui/react-ui-thread/src/Message/Message.tsx","kind":"import-statement","original":"./Message"}],"format":"esm"},"packages/ui/react-ui-thread/src/types.ts":{"bytes":1067,"imports":[],"format":"esm"},"packages/ui/react-ui-thread/src/index.ts":{"bytes":877,"imports":[{"path":"packages/ui/react-ui-thread/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/ui/react-ui-thread/src/Thread/index.ts","kind":"import-statement","original":"./Thread"},{"path":"packages/ui/react-ui-thread/src/Message/index.ts","kind":"import-statement","original":"./Message"},{"path":"packages/ui/react-ui-thread/src/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"}},"outputs":{"packages/ui/react-ui-thread/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":18149},"packages/ui/react-ui-thread/dist/lib/browser/index.mjs":{"imports":[{"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":"@phosphor-icons/react","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":"@codemirror/language","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}],"exports":["Message","MessageMeta","MessageTextbox","Thread","ThreadFooter","ThreadHeading","translations"],"entryPoint":"packages/ui/react-ui-thread/src/index.ts","inputs":{"packages/ui/react-ui-thread/src/translations.ts":{"bytesInOutput":609},"packages/ui/react-ui-thread/src/Thread/Thread.tsx":{"bytesInOutput":2292},"packages/ui/react-ui-thread/src/Thread/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-thread/src/index.ts":{"bytesInOutput":0},"packages/ui/react-ui-thread/src/Message/Message.tsx":{"bytesInOutput":5260},"packages/ui/react-ui-thread/src/Message/command-extension.ts":{"bytesInOutput":651},"packages/ui/react-ui-thread/src/Message/index.ts":{"bytesInOutput":0}},"bytes":9267}}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithRef, type FC } from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import { type TextEditorProps, type EditorView } from '@dxos/react-ui-editor';
|
|
4
|
+
import { type MessageEntity, type MessageEntityBlock, type MessageMetadata } from '../types';
|
|
5
|
+
export type MessageMetaProps = ThemedClassName<ComponentPropsWithRef<'div'>> & MessageMetadata & Partial<{
|
|
6
|
+
continues: boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const MessageMeta: React.ForwardRefExoticComponent<Pick<MessageMetaProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classNames" | "continues" | keyof MessageMetadata> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export type MessageBlockProps<BlockValue> = {
|
|
10
|
+
block: MessageEntityBlock<BlockValue>;
|
|
11
|
+
onBlockDelete?: () => void;
|
|
12
|
+
};
|
|
13
|
+
export type MessageProps<BlockValue> = MessageEntity<BlockValue> & {
|
|
14
|
+
onDelete?: (messageId: string, blockIndex: number) => void;
|
|
15
|
+
MessageBlockComponent?: FC<MessageBlockProps<BlockValue>>;
|
|
16
|
+
};
|
|
17
|
+
export declare const Message: <BlockValue>(props: MessageProps<BlockValue>) => JSX.Element;
|
|
18
|
+
export type MessageTextboxProps = {
|
|
19
|
+
onSend?: () => void;
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
onEditorFocus?: () => void;
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
} & Omit<MessageMetadata, 'id' | 'authorStatus'> & TextEditorProps;
|
|
24
|
+
export declare const MessageTextbox: React.ForwardRefExoticComponent<{
|
|
25
|
+
onSend?: (() => void) | undefined;
|
|
26
|
+
onClear?: (() => void) | undefined;
|
|
27
|
+
onEditorFocus?: (() => void) | undefined;
|
|
28
|
+
disabled?: boolean | undefined;
|
|
29
|
+
} & Omit<MessageMetadata, "id" | "authorStatus"> & TextEditorProps & React.RefAttributes<EditorView>>;
|
|
30
|
+
//# sourceMappingURL=Message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/Message/Message.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EAAE,KAAK,qBAAqB,EAAE,KAAK,EAAE,EAAc,MAAM,OAAO,CAAC;AAE/E,OAAO,EAAkB,KAAK,eAAe,EAAoC,MAAM,gBAAgB,CAAC;AACxG,OAAO,EAAc,KAAK,eAAe,EAAU,KAAK,UAAU,EAAY,MAAM,uBAAuB,CAAC;AAY5G,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAM7F,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAC1E,eAAe,GACf,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAElC,eAAO,MAAM,WAAW,qnJA6BvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,UAAU,IAAI;IAC1C,KAAK,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B,CAAC;AA6BF,MAAM,MAAM,YAAY,CAAC,UAAU,IAAI,aAAa,CAAC,UAAU,CAAC,GAAG;IACjE,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,qBAAqB,CAAC,EAAE,EAAE,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;CAC3D,CAAC;AAEF,eAAO,MAAM,OAAO,8DAyBnB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,cAAc,CAAC,GAC9C,eAAe,CAAC;AAElB,eAAO,MAAM,cAAc;oBAPV,IAAI;qBACH,IAAI;2BACE,IAAI;;qGAwD3B,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import '@dxosTheme';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: <BlockValue>(props: import("./Message").MessageProps<BlockValue>) => JSX.Element;
|
|
5
|
+
render: () => JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
translations: {
|
|
9
|
+
'en-US': {
|
|
10
|
+
thread: {
|
|
11
|
+
'plugin name': string;
|
|
12
|
+
'thread title placeholder': string;
|
|
13
|
+
'thread title label': string;
|
|
14
|
+
'delete thread label': string;
|
|
15
|
+
'create thread label': string;
|
|
16
|
+
'message placeholder': string;
|
|
17
|
+
'comment placeholder': string;
|
|
18
|
+
'settings standalone label': string;
|
|
19
|
+
'anonymous label': string;
|
|
20
|
+
'enter to send message': string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
27
|
+
export declare const Default: {};
|
|
28
|
+
//# sourceMappingURL=Message.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.stories.d.ts","sourceRoot":"","sources":["../../../../src/Message/Message.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAgCpB,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-extension.d.ts","sourceRoot":"","sources":["../../../../src/Message/command-extension.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAkCnD,eAAO,MAAM,OAAO,EAAE,SAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Message/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import '@dxosTheme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TextObject } from '@dxos/echo-schema';
|
|
4
|
+
import { type Range } from '@dxos/react-ui-editor';
|
|
5
|
+
import { type MessageEntity } from '../types';
|
|
6
|
+
type StoryCommentThread = {
|
|
7
|
+
id: string;
|
|
8
|
+
cursor?: string;
|
|
9
|
+
range?: Range;
|
|
10
|
+
yPos?: number;
|
|
11
|
+
messages: MessageEntity<{
|
|
12
|
+
text: TextObject;
|
|
13
|
+
}>[];
|
|
14
|
+
};
|
|
15
|
+
type StoryProps = {
|
|
16
|
+
text?: string;
|
|
17
|
+
autoCreate?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: {
|
|
20
|
+
title: string;
|
|
21
|
+
component: React.FC<{
|
|
22
|
+
thread: StoryCommentThread;
|
|
23
|
+
selected: boolean;
|
|
24
|
+
onSelect: () => void;
|
|
25
|
+
onResolve: () => void;
|
|
26
|
+
}>;
|
|
27
|
+
decorators: import("@storybook/react").Decorator[];
|
|
28
|
+
render: (args: StoryProps) => JSX.Element;
|
|
29
|
+
parameters: {
|
|
30
|
+
translations: {
|
|
31
|
+
'en-US': {
|
|
32
|
+
thread: {
|
|
33
|
+
'plugin name': string;
|
|
34
|
+
'thread title placeholder': string;
|
|
35
|
+
'thread title label': string;
|
|
36
|
+
'delete thread label': string;
|
|
37
|
+
'create thread label': string;
|
|
38
|
+
'message placeholder': string;
|
|
39
|
+
'comment placeholder': string;
|
|
40
|
+
'settings standalone label': string;
|
|
41
|
+
'anonymous label': string;
|
|
42
|
+
'enter to send message': string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}[];
|
|
46
|
+
layout: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export default _default;
|
|
50
|
+
export declare const Default: {
|
|
51
|
+
args: {
|
|
52
|
+
text: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export declare const Testing: {
|
|
56
|
+
args: {
|
|
57
|
+
text: string;
|
|
58
|
+
autoCreate: boolean;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=Comments.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,KAAwD,MAAM,OAAO,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,OAAO,EAOL,KAAK,KAAK,EAIX,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAgE9C,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,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,EAAE,CAAC;CACjD,CAAC;AAiHF,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;;;;;;;;;;mBA8He,UAAU;;;;;;;;;;;;;;;;;;;;;AAJ3B,wBAME;AAWF,eAAO,MAAM,OAAO;;;;CAInB,CAAC;AAEF,eAAO,MAAM,OAAO;;;;;CAKnB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { type ComponentProps, type ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
import type { ThreadEntity } from '../types';
|
|
4
|
+
export type ThreadProps = ThemedClassName<ComponentPropsWithRef<'div'>> & ThreadEntity & {
|
|
5
|
+
current?: boolean | ComponentProps<'div'>['aria-current'];
|
|
6
|
+
};
|
|
7
|
+
export declare const Thread: React.ForwardRefExoticComponent<Pick<ThreadProps, "current" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classNames" | keyof ThreadEntity> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export type ThreadHeadingProps = ThemedClassName<ComponentPropsWithRef<'div'>>;
|
|
9
|
+
export declare const ThreadHeading: React.ForwardRefExoticComponent<Pick<ThreadHeadingProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classNames"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export type ThreadFooterProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {
|
|
11
|
+
activity?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const ThreadFooter: React.ForwardRefExoticComponent<Pick<ThreadFooterProps, "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classNames" | "activity"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
//# sourceMappingURL=Thread.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,KAAK,qBAAqB,EAAc,MAAM,OAAO,CAAC;AAE3F,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAItE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GACrE,YAAY,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;CAAE,CAAC;AAE/E,eAAO,MAAM,MAAM,knJAkBlB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;AAE/E,eAAO,MAAM,aAAa,wlJAgBzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAAG;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,YAAY,omJAqBxB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import '@dxosTheme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<Pick<import("./Thread").ThreadProps, "current" | "slot" | "style" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "classNames" | keyof import("../types").ThreadEntity> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
render: () => JSX.Element;
|
|
7
|
+
decorators: import("@storybook/react").Decorator[];
|
|
8
|
+
parameters: {
|
|
9
|
+
translations: {
|
|
10
|
+
'en-US': {
|
|
11
|
+
thread: {
|
|
12
|
+
'plugin name': string;
|
|
13
|
+
'thread title placeholder': string;
|
|
14
|
+
'thread title label': string;
|
|
15
|
+
'delete thread label': string;
|
|
16
|
+
'create thread label': string;
|
|
17
|
+
'message placeholder': string;
|
|
18
|
+
'comment placeholder': string;
|
|
19
|
+
'settings standalone label': string;
|
|
20
|
+
'anonymous label': string;
|
|
21
|
+
'enter to send message': string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default _default;
|
|
28
|
+
export declare const Default: {};
|
|
29
|
+
//# sourceMappingURL=Thread.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Thread.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAEpB,OAAO,KAAmB,MAAM,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AA8DxC,wBAME;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Thread/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC"}
|