@dxos/react-ui-thread 0.8.3 → 0.8.4-main.1068cf700f
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 +143 -185
- 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 +21 -19
- package/dist/types/src/Message/Message.stories.d.ts.map +1 -1
- package/dist/types/src/Thread/Comments.stories.d.ts +21 -38
- package/dist/types/src/Thread/Comments.stories.d.ts.map +1 -1
- package/dist/types/src/Thread/Thread.d.ts +10 -7
- package/dist/types/src/Thread/Thread.d.ts.map +1 -1
- package/dist/types/src/Thread/Thread.stories.d.ts +21 -19
- package/dist/types/src/Thread/Thread.stories.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +1 -2
- package/dist/types/src/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +15 -16
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -25
- package/src/Message/Message.stories.tsx +24 -17
- package/src/Message/Message.tsx +9 -8
- package/src/Thread/Comments.stories.tsx +86 -56
- package/src/Thread/Thread.stories.tsx +28 -19
- package/src/Thread/Thread.tsx +36 -17
- package/src/index.ts +2 -2
- package/src/testing.tsx +8 -12
- package/src/translations.ts +5 -3
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
import '@
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { type Range } from '@dxos/react-ui-editor';
|
|
4
|
-
import { type MessageEntity } from '../testing';
|
|
5
|
-
type StoryCommentThread = {
|
|
6
|
-
id: string;
|
|
7
|
-
cursor?: string;
|
|
8
|
-
range?: Range;
|
|
9
|
-
yPos?: number;
|
|
10
|
-
messages: MessageEntity[];
|
|
11
|
-
};
|
|
12
3
|
type StoryProps = {
|
|
13
4
|
text?: string;
|
|
14
5
|
autoCreate?: boolean;
|
|
15
6
|
};
|
|
16
|
-
declare const
|
|
7
|
+
declare const meta: {
|
|
17
8
|
title: string;
|
|
18
|
-
component:
|
|
19
|
-
|
|
20
|
-
selected: boolean;
|
|
21
|
-
onSelect: () => void;
|
|
22
|
-
onResolve: () => void;
|
|
23
|
-
}>;
|
|
9
|
+
component: any;
|
|
10
|
+
render: ({ text, autoCreate }: StoryProps) => React.JSX.Element;
|
|
24
11
|
decorators: import("@storybook/react").Decorator[];
|
|
25
|
-
render: (args: StoryProps) => React.JSX.Element;
|
|
26
12
|
parameters: {
|
|
27
|
-
translations: {
|
|
28
|
-
'en-US': {
|
|
29
|
-
thread: {
|
|
30
|
-
'plugin name':
|
|
31
|
-
'thread title placeholder':
|
|
32
|
-
'thread title label':
|
|
33
|
-
'delete thread label':
|
|
34
|
-
'create thread label':
|
|
35
|
-
'message placeholder':
|
|
36
|
-
'comment placeholder':
|
|
37
|
-
'settings standalone label':
|
|
38
|
-
'anonymous label':
|
|
39
|
-
'enter to send message':
|
|
13
|
+
translations: [{
|
|
14
|
+
readonly 'en-US': {
|
|
15
|
+
readonly "@dxos/react-ui-thread": {
|
|
16
|
+
readonly 'plugin name': "Threads";
|
|
17
|
+
readonly 'thread title placeholder': "New thread";
|
|
18
|
+
readonly 'thread title label': "Title";
|
|
19
|
+
readonly 'delete thread label': "Delete";
|
|
20
|
+
readonly 'create thread label': "Create thread";
|
|
21
|
+
readonly 'message placeholder': "Enter message...";
|
|
22
|
+
readonly 'comment placeholder': "Enter comment...";
|
|
23
|
+
readonly 'settings standalone label': "Enable standalone thread creation";
|
|
24
|
+
readonly 'anonymous label': "Anonymous";
|
|
25
|
+
readonly 'enter to send message': "Enter to add ⏎";
|
|
40
26
|
};
|
|
41
27
|
};
|
|
42
|
-
}
|
|
28
|
+
}];
|
|
43
29
|
layout: string;
|
|
44
30
|
};
|
|
45
31
|
};
|
|
46
|
-
export default
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
text: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
32
|
+
export default meta;
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
34
|
+
export declare const Default: Story;
|
|
52
35
|
//# sourceMappingURL=Comments.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Comments.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Comments.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAwD,MAAM,OAAO,CAAC;AAyP7E,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAuHF,QAAA,MAAM,IAAI;;eAEkB,GAAG;mCAvHa,UAAU;;;;;;;;;;;;;;;;;;;;;CA8HjB,CAAC;AAEtC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAInC,eAAO,MAAM,OAAO,EAAE,KASrB,CAAC"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import React, { type ComponentPropsWithRef } from 'react';
|
|
2
2
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
3
3
|
import type { ThreadEntity } from '../types';
|
|
4
|
-
export
|
|
4
|
+
export declare const threadLayout = "is-full place-self-start grid grid-cols-[var(--rail-size)_1fr]";
|
|
5
|
+
type ThreadRootProps = ThemedClassName<ComponentPropsWithRef<'div'>> & ThreadEntity & {
|
|
5
6
|
current?: boolean;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
export declare const Thread: React.ForwardRefExoticComponent<Omit<ThreadProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
export type ThreadHeadingProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {
|
|
8
|
+
type ThreadHeaderProps = ComponentPropsWithRef<'div'> & {
|
|
10
9
|
detached?: boolean;
|
|
11
10
|
};
|
|
12
|
-
|
|
13
|
-
export type ThreadFooterProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {
|
|
11
|
+
type ThreadStatusProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {
|
|
14
12
|
activity?: boolean;
|
|
15
13
|
};
|
|
16
|
-
export declare const
|
|
14
|
+
export declare const Thread: {
|
|
15
|
+
Root: React.ForwardRefExoticComponent<Omit<ThreadRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
Header: React.ForwardRefExoticComponent<Omit<ThreadHeaderProps, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
17
|
+
Status: React.ForwardRefExoticComponent<Omit<ThreadStatusProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
};
|
|
19
|
+
export type { ThreadRootProps, ThreadHeaderProps as ThreadHeadingProps, ThreadStatusProps };
|
|
17
20
|
//# sourceMappingURL=Thread.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,qBAAqB,EAAc,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAQ,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAI5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,eAAO,MAAM,YAAY,mEAAmE,CAAC;AAM7F,KAAK,eAAe,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAAG,YAAY,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AA4B5G,KAAK,iBAAiB,GAAG,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAgC/E,KAAK,iBAAiB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAAG;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA4BF,eAAO,MAAM,MAAM;;;;CAIlB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
|
-
import '@
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
declare const
|
|
3
|
+
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<Omit<import("./Thread").
|
|
5
|
+
component: React.ForwardRefExoticComponent<Omit<import("./Thread").ThreadRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
render: () => React.JSX.Element;
|
|
7
7
|
decorators: import("@storybook/react").Decorator[];
|
|
8
8
|
parameters: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
'
|
|
14
|
-
'thread title
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
9
|
+
layout: string;
|
|
10
|
+
translations: [{
|
|
11
|
+
readonly 'en-US': {
|
|
12
|
+
readonly "@dxos/react-ui-thread": {
|
|
13
|
+
readonly 'plugin name': "Threads";
|
|
14
|
+
readonly 'thread title placeholder': "New thread";
|
|
15
|
+
readonly 'thread title label': "Title";
|
|
16
|
+
readonly 'delete thread label': "Delete";
|
|
17
|
+
readonly 'create thread label': "Create thread";
|
|
18
|
+
readonly 'message placeholder': "Enter message...";
|
|
19
|
+
readonly 'comment placeholder': "Enter comment...";
|
|
20
|
+
readonly 'settings standalone label': "Enable standalone thread creation";
|
|
21
|
+
readonly 'anonymous label': "Anonymous";
|
|
22
|
+
readonly 'enter to send message': "Enter to add ⏎";
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
|
-
}
|
|
25
|
+
}];
|
|
25
26
|
};
|
|
26
27
|
};
|
|
27
|
-
export default
|
|
28
|
-
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
export declare const Default: Story;
|
|
29
31
|
//# sourceMappingURL=Thread.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Thread.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"Thread.stories.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAoC,MAAM,OAAO,CAAC;AA8EzD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAS0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import translations from './translations';
|
|
1
|
+
import { translations } from './translations';
|
|
2
2
|
export * from './Thread';
|
|
3
3
|
export * from './Message';
|
|
4
|
-
export * from './types';
|
|
4
|
+
export type * from './types';
|
|
5
5
|
export { translations };
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { type MessageMetadata } from './types';
|
|
3
3
|
export type MessageEntity<PartValue = any> = MessageMetadata & {
|
|
4
4
|
text: string;
|
|
@@ -13,5 +13,4 @@ export type MessagePartProps<PartValue> = {
|
|
|
13
13
|
part: PartValue;
|
|
14
14
|
};
|
|
15
15
|
export declare const MessageStoryBlock: <PartValue>({ part }: MessagePartProps<PartValue>) => React.JSX.Element;
|
|
16
|
-
export declare const ThreadStoryContainer: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
17
16
|
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,aAAa,CAAC,SAAS,GAAG,GAAG,IAAI,eAAe,GAAG;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,2CAA2C,gBAAgB,sBAkB3F,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,SAAS,IAAI;IACxC,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,SAAS,EAAG,UAAU,gBAAgB,CAAC,SAAS,CAAC,sBAWlF,CAAC"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
export declare const translationKey = "thread";
|
|
2
|
-
declare const
|
|
3
|
-
'en-US': {
|
|
4
|
-
thread: {
|
|
5
|
-
'plugin name':
|
|
6
|
-
'thread title placeholder':
|
|
7
|
-
'thread title label':
|
|
8
|
-
'delete thread label':
|
|
9
|
-
'create thread label':
|
|
10
|
-
'message placeholder':
|
|
11
|
-
'comment placeholder':
|
|
12
|
-
'settings standalone label':
|
|
13
|
-
'anonymous label':
|
|
14
|
-
'enter to send message':
|
|
1
|
+
export declare const translationKey = "@dxos/react-ui-thread";
|
|
2
|
+
export declare const translations: [{
|
|
3
|
+
readonly 'en-US': {
|
|
4
|
+
readonly "@dxos/react-ui-thread": {
|
|
5
|
+
readonly 'plugin name': "Threads";
|
|
6
|
+
readonly 'thread title placeholder': "New thread";
|
|
7
|
+
readonly 'thread title label': "Title";
|
|
8
|
+
readonly 'delete thread label': "Delete";
|
|
9
|
+
readonly 'create thread label': "Create thread";
|
|
10
|
+
readonly 'message placeholder': "Enter message...";
|
|
11
|
+
readonly 'comment placeholder': "Enter comment...";
|
|
12
|
+
readonly 'settings standalone label': "Enable standalone thread creation";
|
|
13
|
+
readonly 'anonymous label': "Anonymous";
|
|
14
|
+
readonly 'enter to send message': "Enter to add ⏎";
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
}
|
|
18
|
-
export default _default;
|
|
17
|
+
}];
|
|
19
18
|
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,0BAA0B,CAAC;AAEtD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;EAiBM,CAAC"}
|