@dxos/react-ui-thread 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-thread",
3
- "version": "0.8.4-main.69d29f4",
3
+ "version": "0.8.4-main.6fa680abb7",
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",
@@ -30,30 +30,30 @@
30
30
  "dependencies": {
31
31
  "@radix-ui/react-primitive": "2.0.2",
32
32
  "date-fns": "^3.3.1",
33
- "@dxos/react-ui-editor": "0.8.4-main.69d29f4",
34
- "@dxos/ui-editor": "0.8.4-main.69d29f4",
35
- "@dxos/util": "0.8.4-main.69d29f4"
33
+ "@dxos/react-ui-editor": "0.8.4-main.6fa680abb7",
34
+ "@dxos/ui-editor": "0.8.4-main.6fa680abb7",
35
+ "@dxos/util": "0.8.4-main.6fa680abb7"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/react": "~19.2.7",
39
39
  "@types/react-dom": "~19.2.3",
40
40
  "react": "~19.2.3",
41
41
  "react-dom": "~19.2.3",
42
- "vite": "7.1.9",
43
- "@dxos/echo": "0.8.4-main.69d29f4",
44
- "@dxos/echo-db": "0.8.4-main.69d29f4",
45
- "@dxos/react-ui": "0.8.4-main.69d29f4",
46
- "@dxos/keys": "0.8.4-main.69d29f4",
47
- "@dxos/log": "0.8.4-main.69d29f4",
48
- "@dxos/random": "0.8.4-main.69d29f4",
49
- "@dxos/storybook-utils": "0.8.4-main.69d29f4",
50
- "@dxos/ui-theme": "0.8.4-main.69d29f4"
42
+ "vite": "^7.1.11",
43
+ "@dxos/echo": "0.8.4-main.6fa680abb7",
44
+ "@dxos/echo-db": "0.8.4-main.6fa680abb7",
45
+ "@dxos/log": "0.8.4-main.6fa680abb7",
46
+ "@dxos/keys": "0.8.4-main.6fa680abb7",
47
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
48
+ "@dxos/random": "0.8.4-main.6fa680abb7",
49
+ "@dxos/storybook-utils": "0.8.4-main.6fa680abb7",
50
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": "~19.2.3",
54
54
  "react-dom": "~19.2.3",
55
- "@dxos/ui-theme": "0.8.4-main.69d29f4",
56
- "@dxos/react-ui": "0.8.4-main.69d29f4"
55
+ "@dxos/react-ui": "0.8.4-main.6fa680abb7",
56
+ "@dxos/ui-theme": "0.8.4-main.6fa680abb7"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"
@@ -6,7 +6,7 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
8
  import { PublicKey } from '@dxos/keys';
9
- import { withTheme } from '@dxos/react-ui/testing';
9
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
10
10
  import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
11
11
 
12
12
  import { type MessageEntity, MessageStoryText } from '../testing';
@@ -25,7 +25,7 @@ const DefaultStory = () => {
25
25
  });
26
26
 
27
27
  return (
28
- <div className='mli-auto is-96 overflow-y-auto'>
28
+ <div className='mx-auto w-96 overflow-y-auto'>
29
29
  <Thread.Root id='t1'>
30
30
  <MessageRoot {...message} classNames={[hoverableControls, hoverableFocusedWithinControls]}>
31
31
  <MessageStoryText {...message} onDelete={() => console.log('delete')} />
@@ -39,7 +39,7 @@ const meta = {
39
39
  title: 'ui/react-ui-thread/Message',
40
40
  component: MessageRoot as any,
41
41
  render: DefaultStory,
42
- decorators: [withTheme],
42
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
43
43
  parameters: {
44
44
  layout: 'fullscreen',
45
45
  translations,
@@ -16,9 +16,9 @@ import { type MessageMetadata } from '../types';
16
16
 
17
17
  const avatarSize = 7;
18
18
 
19
- export type MessageRootProps = ThemedClassName<ComponentPropsWithRef<'div'>> &
20
- MessageMetadata &
21
- Partial<{ continues: boolean }>;
19
+ export type MessageRootProps = ThemedClassName<
20
+ ComponentPropsWithRef<'div'> & MessageMetadata & Partial<{ continues: boolean }>
21
+ >;
22
22
 
23
23
  // TODO(burdon): Show authorName on tooltip.
24
24
  export const MessageRoot = forwardRef<HTMLDivElement, MessageRootProps>(
@@ -36,16 +36,16 @@ export const MessageRoot = forwardRef<HTMLDivElement, MessageRootProps>(
36
36
  className={mx('grid grid-cols-subgrid col-span-2', classNames)}
37
37
  ref={forwardedRef}
38
38
  >
39
- <div role='none' className='flex flex-col items-center gap-2 pbs-1'>
39
+ <div role='none' className='flex flex-col items-center gap-2 pt-1'>
40
40
  <Avatar.Content
41
41
  size={avatarSize}
42
42
  hue={authorAvatarProps?.hue || hexToHue(authorId ?? '0')}
43
43
  fallback={authorAvatarProps?.emoji || hexToEmoji(authorId ?? '0')}
44
44
  {...(authorImgSrc && { imgSrc: authorImgSrc })}
45
45
  />
46
- {continues && <div role='none' className='is-px grow bg-separator' />}
46
+ {continues && <div role='none' className='w-px grow bg-separator' />}
47
47
  </div>
48
- <div role='none' className='plb-1 min-is-0'>
48
+ <div role='none' className='py-1 min-w-0'>
49
49
  {children}
50
50
  </div>
51
51
  </div>
@@ -84,7 +84,7 @@ export const MessageTime = ({ timestamp }: MessageTimeProps) => {
84
84
  const { dtLocale } = useTranslation(translationKey);
85
85
  const dt = timestamp ? new Date(timestamp) : undefined;
86
86
  return (
87
- <time className='block text-subdued text-xs pbe-0.5' dateTime={dt?.toISOString()}>
87
+ <time className='block text-subdued text-xs pb-0.5' dateTime={dt?.toISOString()}>
88
88
  {dt ? formatDistanceToNow(dt, { locale: dtLocale, addSuffix: true }) : ''}
89
89
  </time>
90
90
  );
@@ -167,7 +167,7 @@ export const MessageTextbox = ({
167
167
  <div
168
168
  role='none'
169
169
  ref={parentRef}
170
- className={mx('plb-0.5 mie-1 rounded-sm', focusRing, disabled && 'opacity-50')}
170
+ className={mx('py-0.5 me-1 rounded-xs', focusRing, disabled && 'opacity-50')}
171
171
  {...focusAttributes}
172
172
  />
173
173
  </MessageRoot>
@@ -11,7 +11,7 @@ import { PublicKey } from '@dxos/keys';
11
11
  import { log } from '@dxos/log';
12
12
  import { faker } from '@dxos/random';
13
13
  import { Icon, IconButton, useThemeContext } from '@dxos/react-ui';
14
- import { withTheme } from '@dxos/react-ui/testing';
14
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
15
  import { useTextEditor } from '@dxos/react-ui-editor';
16
16
  import {
17
17
  type Comment,
@@ -208,7 +208,7 @@ const StoryThread: FC<{
208
208
  variant='ghost'
209
209
  icon='ph--check--regular'
210
210
  iconOnly
211
- classNames='pli-1'
211
+ classNames='px-1'
212
212
  label='Resolve'
213
213
  onClick={onResolve}
214
214
  />
@@ -217,12 +217,14 @@ const StoryThread: FC<{
217
217
  );
218
218
  };
219
219
 
220
- const Sidebar: FC<{
220
+ type SidebarProps = {
221
221
  threads: StoryCommentThread[];
222
222
  selected?: string;
223
223
  onSelect: (thread: string) => void;
224
224
  onResolve: (thread: string) => void;
225
- }> = ({ threads, selected, onSelect, onResolve }) => {
225
+ };
226
+
227
+ const Sidebar = ({ threads, selected, onSelect, onResolve }: SidebarProps) => {
226
228
  // Sort by y-position.
227
229
  const sortedThreads = useMemo(() => {
228
230
  const sorted = [...threads];
@@ -348,7 +350,7 @@ const DefaultStory = ({ text, autoCreate }: StoryProps) => {
348
350
 
349
351
  return (
350
352
  <main className='fixed inset-0 grid grid-cols-[1fr_24rem]'>
351
- <div role='none' className='max-bs-full overflow-y-auto p-4'>
353
+ <div role='none' className='max-h-full overflow-y-auto p-4'>
352
354
  <Editor
353
355
  initialValue={item.content}
354
356
  selected={selected}
@@ -360,7 +362,7 @@ const DefaultStory = ({ text, autoCreate }: StoryProps) => {
360
362
  />
361
363
  </div>
362
364
 
363
- <div role='none' className='max-bs-full overflow-y-auto p-4'>
365
+ <div role='none' className='max-h-full overflow-y-auto p-4'>
364
366
  <Sidebar
365
367
  threads={visibleThreads}
366
368
  selected={selected}
@@ -376,7 +378,7 @@ const meta = {
376
378
  title: 'ui/react-ui-thread/Comments',
377
379
  component: StoryThread as any,
378
380
  render: DefaultStory,
379
- decorators: [withTheme],
381
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
380
382
  parameters: {
381
383
  translations,
382
384
  layout: 'fullscreen',
@@ -7,7 +7,7 @@ import React, { useMemo, useRef, useState } from 'react';
7
7
 
8
8
  import { PublicKey } from '@dxos/keys';
9
9
  import { faker } from '@dxos/random';
10
- import { withTheme } from '@dxos/react-ui/testing';
10
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
11
  import { createBasicExtensions, createThemeExtensions } from '@dxos/ui-editor';
12
12
  import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
13
13
 
@@ -59,7 +59,7 @@ const DefaultStory = () => {
59
59
  };
60
60
 
61
61
  return (
62
- <div className='mli-auto is-96 overflow-y-auto'>
62
+ <div className='mx-auto w-96 overflow-y-auto'>
63
63
  <Thread.Root id='t1'>
64
64
  {messages.map((message) => (
65
65
  <MessageRoot key={message.id} classNames={[hoverableControls, hoverableFocusedWithinControls]} {...message}>
@@ -85,7 +85,7 @@ const meta = {
85
85
  title: 'ui/react-ui-thread/Thread',
86
86
  component: Thread.Root,
87
87
  render: DefaultStory,
88
- decorators: [withTheme],
88
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' })],
89
89
  parameters: {
90
90
  layout: 'fullscreen',
91
91
  translations,
@@ -10,8 +10,8 @@ import { hoverableControlItem, hoverableFocusedWithinControls, mx } from '@dxos/
10
10
  import { translationKey } from '../translations';
11
11
  import type { ThreadEntity } from '../types';
12
12
 
13
- // TODO(burdon): Why is this exported?
14
- export const threadLayout = 'is-full place-self-start grid grid-cols-[var(--rail-size)_1fr]';
13
+ // TODO(burdon): Avoid exporting fragments.
14
+ export const threadLayout = 'w-full place-self-start grid grid-cols-[var(--dx-rail-size)_1fr]';
15
15
 
16
16
  //
17
17
  // Root
@@ -30,7 +30,7 @@ const ThreadRoot = forwardRef<HTMLDivElement, ThreadRootProps>(
30
30
  className={mx(
31
31
  threadLayout,
32
32
  hoverableFocusedWithinControls,
33
- 'bg-[var(--surface-bg)] current-related attention-surface [--controls-opacity:0]',
33
+ 'bg-[var(--surface-bg)] current-related dx-attention-surface [--controls-opacity:0]',
34
34
  classNames,
35
35
  )}
36
36
  ref={forwardedRef}
@@ -59,10 +59,7 @@ const ThreadHeader = forwardRef<HTMLParagraphElement, ThreadHeaderProps>(
59
59
  role='heading'
60
60
  data-testid='thread.heading'
61
61
  {...props}
62
- className={mx(
63
- 'mie-2 text-description font-medium truncate italic',
64
- detached && 'line-through decoration-1',
65
- )}
62
+ className={mx('me-2 text-description font-medium truncate italic', detached && 'line-through decoration-1')}
66
63
  ref={forwardedRef}
67
64
  >
68
65
  {children}
@@ -88,17 +85,17 @@ const ThreadStatus = forwardRef<HTMLDivElement, ThreadStatusProps>(
88
85
  <div
89
86
  {...props}
90
87
  className={mx(
91
- 'col-start-2 grid grid-cols-[min-content_1fr_max-content] pb-2 pie-2 text-xs text-description',
88
+ 'col-start-2 grid grid-cols-[min-content_1fr_max-content] pb-2 pe-2 text-xs text-description',
92
89
  classNames,
93
90
  )}
94
91
  ref={forwardedRef}
95
92
  >
96
93
  <Icon
97
94
  icon='ph--spinner--bold'
98
- classNames='is-6 bs-4 invisible data-[visible=show]:visible animate-spin-slow'
95
+ classNames='w-6 h-4 invisible data-[visible=show]:visible animate-spin-slow'
99
96
  data-visible={activity ? 'show' : 'hide'}
100
97
  />
101
- <span className='truncate min-is-0' aria-live='polite'>
98
+ <span className='truncate min-w-0' aria-live='polite'>
102
99
  {activity ? children : null}
103
100
  </span>
104
101
  <span className={mx('text-end', hoverableControlItem)}>{t('enter to send message')}</span>
@@ -113,4 +110,4 @@ export const Thread = {
113
110
  Status: ThreadStatus,
114
111
  };
115
112
 
116
- export type { ThreadRootProps, ThreadHeaderProps as ThreadHeadingProps, ThreadStatusProps };
113
+ export type { ThreadRootProps, ThreadHeaderProps, ThreadStatusProps };
package/src/testing.tsx CHANGED
@@ -30,7 +30,7 @@ export const MessageStoryText = ({ text, onDelete, authorName, timestamp }: Mess
30
30
  iconOnly
31
31
  label='Delete'
32
32
  variant='ghost'
33
- classNames={['p-1.5 min-bs-0 mie-1 items-start transition-opacity', hoverableControlItem]}
33
+ classNames={['p-1.5 min-h-0 me-1 items-start transition-opacity', hoverableControlItem]}
34
34
  onClick={() => onDelete()}
35
35
  />
36
36
  )}
@@ -50,7 +50,7 @@ export const MessageStoryBlock = <PartValue,>({ part }: MessagePartProps<PartVal
50
50
  role='none'
51
51
  className={mx('grid grid-cols-subgrid col-span-3', hoverableControls, hoverableFocusedWithinControls)}
52
52
  >
53
- <pre className='font-mono max-is-full overflow-x-auto col-span-3'>
53
+ <pre className='font-mono max-w-full overflow-x-auto col-span-3'>
54
54
  <code>{JSON.stringify(part, undefined, 2)}</code>
55
55
  </pre>
56
56
  </div>