@dxos/react-ui-stack 0.6.14-main.f49f251 → 0.6.14-staging.4b6f9cf

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.
Files changed (94) hide show
  1. package/dist/lib/browser/index.mjs +494 -335
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/testing/index.mjs +4 -106
  5. package/dist/lib/browser/testing/index.mjs.map +4 -4
  6. package/dist/lib/node/index.cjs +478 -326
  7. package/dist/lib/node/index.cjs.map +4 -4
  8. package/dist/lib/node/meta.json +1 -1
  9. package/dist/lib/node/testing/index.cjs +5 -110
  10. package/dist/lib/node/testing/index.cjs.map +4 -4
  11. package/dist/lib/node-esm/index.mjs +494 -335
  12. package/dist/lib/node-esm/index.mjs.map +4 -4
  13. package/dist/lib/node-esm/meta.json +1 -1
  14. package/dist/lib/node-esm/testing/index.mjs +4 -106
  15. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  16. package/dist/types/src/components/LayoutControls.d.ts +19 -0
  17. package/dist/types/src/components/LayoutControls.d.ts.map +1 -0
  18. package/dist/types/src/components/MenuSignifier.d.ts +4 -0
  19. package/dist/types/src/components/MenuSignifier.d.ts.map +1 -0
  20. package/dist/types/src/components/Stack.d.ts +12 -12
  21. package/dist/types/src/components/Stack.d.ts.map +1 -1
  22. package/dist/types/src/components/Stack.stories.d.ts +6 -83
  23. package/dist/types/src/components/Stack.stories.d.ts.map +1 -1
  24. package/dist/types/src/components/StackContext.d.ts +19 -0
  25. package/dist/types/src/components/StackContext.d.ts.map +1 -0
  26. package/dist/types/src/components/StackItem.d.ts +41 -0
  27. package/dist/types/src/components/StackItem.d.ts.map +1 -0
  28. package/dist/types/src/components/StackItemContent.d.ts +9 -0
  29. package/dist/types/src/components/StackItemContent.d.ts.map +1 -0
  30. package/dist/types/src/components/StackItemHeading.d.ts +8 -0
  31. package/dist/types/src/components/StackItemHeading.d.ts.map +1 -0
  32. package/dist/types/src/components/StackItemResizeHandle.d.ts +3 -0
  33. package/dist/types/src/components/StackItemResizeHandle.d.ts.map +1 -0
  34. package/dist/types/src/components/StackItemSigil.d.ts +31 -0
  35. package/dist/types/src/components/StackItemSigil.d.ts.map +1 -0
  36. package/dist/types/src/components/index.d.ts +2 -1
  37. package/dist/types/src/components/index.d.ts.map +1 -1
  38. package/dist/types/src/testing/EditorContent.d.ts +2 -2
  39. package/dist/types/src/testing/EditorContent.d.ts.map +1 -1
  40. package/dist/types/src/testing/index.d.ts +0 -1
  41. package/dist/types/src/testing/index.d.ts.map +1 -1
  42. package/dist/types/src/testing/stack-manager.d.ts +0 -1
  43. package/dist/types/src/testing/stack-manager.d.ts.map +1 -1
  44. package/dist/types/src/translations.d.ts +8 -8
  45. package/package.json +23 -21
  46. package/src/components/LayoutControls.tsx +132 -0
  47. package/src/components/MenuSignifier.tsx +33 -0
  48. package/src/components/Stack.stories.tsx +109 -182
  49. package/src/components/Stack.tsx +61 -156
  50. package/src/components/StackContext.tsx +38 -0
  51. package/src/components/StackItem.tsx +173 -0
  52. package/src/components/StackItemContent.tsx +50 -0
  53. package/src/components/StackItemHeading.tsx +55 -0
  54. package/src/components/StackItemResizeHandle.tsx +115 -0
  55. package/src/components/StackItemSigil.tsx +170 -0
  56. package/src/components/index.ts +3 -2
  57. package/src/playwright/smoke.spec.ts +3 -3
  58. package/src/testing/EditorContent.tsx +4 -4
  59. package/src/testing/index.ts +2 -1
  60. package/src/testing/stack-manager.ts +3 -7
  61. package/src/translations.ts +8 -8
  62. package/dist/types/src/components/CaretDownUp.d.ts +0 -4
  63. package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
  64. package/dist/types/src/components/ContentTypes.stories.d.ts +0 -96
  65. package/dist/types/src/components/ContentTypes.stories.d.ts.map +0 -1
  66. package/dist/types/src/components/Deck.stories.d.ts +0 -19
  67. package/dist/types/src/components/Deck.stories.d.ts.map +0 -1
  68. package/dist/types/src/components/Section.d.ts +0 -53
  69. package/dist/types/src/components/Section.d.ts.map +0 -1
  70. package/dist/types/src/components/Section.stories.d.ts +0 -36
  71. package/dist/types/src/components/Section.stories.d.ts.map +0 -1
  72. package/dist/types/src/components/style-fragments.d.ts +0 -2
  73. package/dist/types/src/components/style-fragments.d.ts.map +0 -1
  74. package/dist/types/src/next/Stack.d.ts +0 -9
  75. package/dist/types/src/next/Stack.d.ts.map +0 -1
  76. package/dist/types/src/next/Stack.stories.d.ts +0 -8
  77. package/dist/types/src/next/Stack.stories.d.ts.map +0 -1
  78. package/dist/types/src/next/StackItem.d.ts +0 -14
  79. package/dist/types/src/next/StackItem.d.ts.map +0 -1
  80. package/dist/types/src/next/index.d.ts +0 -2
  81. package/dist/types/src/next/index.d.ts.map +0 -1
  82. package/dist/types/src/testing/TableContent.d.ts +0 -20
  83. package/dist/types/src/testing/TableContent.d.ts.map +0 -1
  84. package/src/components/CaretDownUp.tsx +0 -31
  85. package/src/components/ContentTypes.stories.tsx +0 -104
  86. package/src/components/Deck.stories.tsx +0 -362
  87. package/src/components/Section.stories.tsx +0 -50
  88. package/src/components/Section.tsx +0 -378
  89. package/src/components/style-fragments.ts +0 -5
  90. package/src/next/Stack.stories.tsx +0 -148
  91. package/src/next/Stack.tsx +0 -30
  92. package/src/next/StackItem.tsx +0 -78
  93. package/src/next/index.ts +0 -5
  94. package/src/testing/TableContent.tsx +0 -119
@@ -1,85 +1,8 @@
1
- import '@dxos-theme';
1
+ import { type Meta, type StoryObj } from '@storybook/react';
2
2
  import React from 'react';
3
- import { type MosaicOperation } from '@dxos/react-ui-mosaic';
4
- import { type StackSectionContent, type StackSectionItem } from './Section';
5
- import { type StackProps } from './Stack';
6
- declare const _default: {
7
- title: string;
8
- component: ({ id, type, SectionContent, items, separation, transform, onOver, onDrop, onAddSection, onDeleteSection, onNavigateToSection, onCollapseSection, ...props }: StackProps) => React.JSX.Element;
9
- decorators: import("@storybook/react/*").Decorator[];
10
- render: ({ debug, ...args }: DemoStackProps & {
11
- debug: boolean;
12
- }) => React.JSX.Element;
13
- };
14
- export default _default;
15
- export declare const Empty: {
16
- args: {
17
- SectionContent: ({ data }: {
18
- data: StackSectionContent & {
19
- title?: string;
20
- };
21
- }) => React.JSX.Element;
22
- count: number;
23
- };
24
- };
25
- export declare const Simple: {
26
- args: {
27
- SectionContent: ({ data }: {
28
- data: StackSectionContent & {
29
- title?: string;
30
- };
31
- }) => React.JSX.Element;
32
- types: string[];
33
- debug: boolean;
34
- };
35
- };
36
- export declare const Complex: {
37
- args: {
38
- SectionContent: ({ data, }: StackSectionItem & {
39
- data: StackSectionContent & {
40
- title?: string;
41
- body?: string;
42
- image?: string;
43
- };
44
- }) => React.JSX.Element;
45
- types: string[];
46
- debug: boolean;
47
- };
48
- };
49
- export declare const Transfer: {
50
- args: {
51
- SectionContent: ({ data }: {
52
- data: StackSectionContent & {
53
- title?: string;
54
- };
55
- }) => React.JSX.Element;
56
- types: string[];
57
- count: number;
58
- className: string;
59
- };
60
- render: ({ debug, ...args }: DemoStackProps & {
61
- debug: boolean;
62
- }) => React.JSX.Element;
63
- decorators: import("@storybook/react/*").Decorator[];
64
- };
65
- export declare const Copy: {
66
- args: {
67
- SectionContent: ({ data }: {
68
- data: StackSectionContent & {
69
- title?: string;
70
- };
71
- }) => React.JSX.Element;
72
- types: string[];
73
- className: string;
74
- };
75
- render: ({ debug, ...args }: DemoStackProps & {
76
- debug: boolean;
77
- }) => React.JSX.Element;
78
- decorators: import("@storybook/react/*").Decorator[];
79
- };
80
- export type DemoStackProps = StackProps & {
81
- types?: string[];
82
- count?: number;
83
- operation?: MosaicOperation;
84
- };
3
+ declare const StorybookStack: () => React.JSX.Element;
4
+ type Story = StoryObj<typeof StorybookStack>;
5
+ export declare const Default: Story;
6
+ declare const meta: Meta<typeof StorybookStack>;
7
+ export default meta;
85
8
  //# sourceMappingURL=Stack.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stack.stories.d.ts","sourceRoot":"","sources":["../../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AK,EAAE,OAAO,CAAA;KAAE;;CAcjE,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IACxC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,eAAe,CAAC;CAC7B,CAAC"}
1
+ {"version":3,"file":"Stack.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Stack.stories.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAgC,MAAM,OAAO,CAAC;AAsBrD,QAAA,MAAM,cAAc,yBAwFnB,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7C,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAKrC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type Orientation, type Size } from './Stack';
2
+ import { type StackItemSize } from './StackItem';
3
+ export type StackContextValue = {
4
+ orientation: Orientation;
5
+ separators: boolean;
6
+ rail: boolean;
7
+ size: Size;
8
+ };
9
+ export declare const StackContext: import("react").Context<StackContextValue>;
10
+ export declare const useStack: () => StackContextValue;
11
+ type StackItemContextValue = {
12
+ selfDragHandleRef: (element: HTMLDivElement | null) => void;
13
+ size: StackItemSize;
14
+ setSize: (nextSize: StackItemSize, commit?: boolean) => void;
15
+ };
16
+ export declare const StackItemContext: import("react").Context<StackItemContextValue>;
17
+ export declare const useStackItem: () => StackItemContextValue;
18
+ export {};
19
+ //# sourceMappingURL=StackContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackContext.d.ts","sourceRoot":"","sources":["../../../../src/components/StackContext.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,eAAO,MAAM,YAAY,4CAKvB,CAAC;AAEH,eAAO,MAAM,QAAQ,yBAAiC,CAAC;AAEvD,KAAK,qBAAqB,GAAG;IAC3B,iBAAiB,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5D,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,eAAO,MAAM,gBAAgB,gDAI3B,CAAC;AAEH,eAAO,MAAM,YAAY,6BAAqC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
2
+ import React, { type ComponentPropsWithRef } from 'react';
3
+ import { type ThemedClassName } from '@dxos/react-ui';
4
+ import { type StackItemContentProps } from './StackItemContent';
5
+ import { type StackItemHeadingProps, type StackItemHeadingLabelProps } from './StackItemHeading';
6
+ import { type StackItemSigilProps, type StackItemSigilAction, type StackItemSigilButtonProps } from './StackItemSigil';
7
+ export type StackItemSize = number | 'min-content';
8
+ export declare const DEFAULT_HORIZONTAL_SIZE = 44;
9
+ export declare const DEFAULT_VERTICAL_SIZE = "min-content";
10
+ export declare const DEFAULT_EXTRINSIC_SIZE = 44;
11
+ export type StackItemData = {
12
+ id: string;
13
+ type: 'column' | 'card';
14
+ };
15
+ export type StackItemRootProps = ThemedClassName<ComponentPropsWithRef<'div'>> & {
16
+ item: Omit<StackItemData, 'type'>;
17
+ order?: number;
18
+ onRearrange?: (source: StackItemData, target: StackItemData, closestEdge: Edge | null) => void;
19
+ size?: StackItemSize;
20
+ onSizeChange?: (nextSize: StackItemSize) => void;
21
+ role?: 'article' | 'section';
22
+ };
23
+ export declare const StackItem: {
24
+ Root: React.ForwardRefExoticComponent<Omit<StackItemRootProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
25
+ Content: ({ children, toolbar, statusbar, contentSize, classNames, ...props }: StackItemContentProps) => React.JSX.Element;
26
+ Heading: ({ children, classNames, ...props }: StackItemHeadingProps) => React.JSX.Element;
27
+ HeadingLabel: React.ForwardRefExoticComponent<Omit<StackItemHeadingLabelProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
28
+ ResizeHandle: () => React.JSX.Element;
29
+ Sigil: React.ForwardRefExoticComponent<{
30
+ attendableId?: string;
31
+ triggerLabel: string;
32
+ actions?: StackItemSigilAction[][];
33
+ icon: string;
34
+ onAction?: (action: StackItemSigilAction) => void;
35
+ } & import("packages/ui/react-ui-attention/dist/types/src").Related & {
36
+ children?: React.ReactNode | undefined;
37
+ } & React.RefAttributes<HTMLButtonElement>>;
38
+ SigilButton: React.ForwardRefExoticComponent<Omit<StackItemSigilButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
39
+ };
40
+ export type { StackItemContentProps, StackItemHeadingProps, StackItemHeadingLabelProps, StackItemSigilProps, StackItemSigilButtonProps, StackItemSigilAction, };
41
+ //# sourceMappingURL=StackItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItem.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItem.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,IAAI,EAEV,MAAM,uDAAuD,CAAC;AAI/D,OAAO,KAAK,EAAE,EAAyC,KAAK,qBAAqB,EAAe,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAItD,OAAO,EAAoB,KAAK,qBAA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ui';
3
+ export type StackItemContentProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & {
4
+ toolbar?: boolean;
5
+ statusbar?: boolean;
6
+ contentSize?: 'cover' | 'intrinsic';
7
+ };
8
+ export declare const StackItemContent: ({ children, toolbar, statusbar, contentSize, classNames, ...props }: StackItemContentProps) => React.JSX.Element;
9
+ //# sourceMappingURL=StackItemContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemContent.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,GAAG;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,gBAAgB,wEAO1B,qBAAqB,sBAyBvB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import React, { type ComponentPropsWithoutRef, type ComponentPropsWithRef } from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ import { type AttendableId, type Related } from '@dxos/react-ui-attention';
4
+ export type StackItemHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'div'>>;
5
+ export declare const StackItemHeading: ({ children, classNames, ...props }: StackItemHeadingProps) => React.JSX.Element;
6
+ export type StackItemHeadingLabelProps = ThemedClassName<ComponentPropsWithRef<'h1'>> & AttendableId & Related;
7
+ export declare const StackItemHeadingLabel: React.ForwardRefExoticComponent<Omit<StackItemHeadingLabelProps, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
8
+ //# sourceMappingURL=StackItemHeading.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemHeading.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemHeading.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,wBAAwB,EAAE,KAAK,qBAAqB,EAAc,MAAM,OAAO,CAAC;AAErG,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAKzF,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAErF,eAAO,MAAM,gBAAgB,uCAAwC,qBAAqB,sBAoBzF,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,eAAe,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,GAAG,YAAY,GAAG,OAAO,CAAC;AAE/G,eAAO,MAAM,qBAAqB,oHAejC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const StackItemResizeHandle: () => React.JSX.Element;
3
+ //# sourceMappingURL=StackItemResizeHandle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemResizeHandle.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemResizeHandle.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAoBvD,eAAO,MAAM,qBAAqB,yBAoEjC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type ActionLike } from '@dxos/app-graph';
3
+ import { type ButtonProps } from '@dxos/react-ui';
4
+ import { type AttendableId, type Related } from '@dxos/react-ui-attention';
5
+ export type KeyBinding = {
6
+ windows?: string;
7
+ macos?: string;
8
+ ios?: string;
9
+ linux?: string;
10
+ unknown?: string;
11
+ };
12
+ export type StackItemSigilAction = Pick<ActionLike, 'id' | 'properties' | 'data'>;
13
+ export type StackItemSigilButtonProps = Omit<ButtonProps, 'variant'> & AttendableId & Related;
14
+ export declare const StackItemSigilButton: React.ForwardRefExoticComponent<Omit<StackItemSigilButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
15
+ export type StackItemSigilProps = PropsWithChildren<{
16
+ attendableId?: string;
17
+ triggerLabel: string;
18
+ actions?: StackItemSigilAction[][];
19
+ icon: string;
20
+ onAction?: (action: StackItemSigilAction) => void;
21
+ } & Related>;
22
+ export declare const StackItemSigil: React.ForwardRefExoticComponent<{
23
+ attendableId?: string;
24
+ triggerLabel: string;
25
+ actions?: StackItemSigilAction[][];
26
+ icon: string;
27
+ onAction?: (action: StackItemSigilAction) => void;
28
+ } & Related & {
29
+ children?: React.ReactNode | undefined;
30
+ } & React.RefAttributes<HTMLButtonElement>>;
31
+ //# sourceMappingURL=StackItemSigil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackItemSigil.d.ts","sourceRoot":"","sources":["../../../../src/components/StackItemSigil.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAY,KAAK,iBAAiB,EAAgC,MAAM,OAAO,CAAC;AAE9F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAEL,KAAK,WAAW,EAMjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,OAAO,EAAgB,MAAM,0BAA0B,CAAC;AAOzF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC;AAElF,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG,YAAY,GAAG,OAAO,CAAC;AAE9F,eAAO,MAAM,oBAAoB,kHAgBhC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CACjD;IACE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,oBAAoB,EAAE,EAAE,CAAC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACnD,GAAG,OAAO,CACZ,CAAC;AAEF,eAAO,MAAM,cAAc;mBARR,MAAM;kBACP,MAAM;cACV,oBAAoB,EAAE,EAAE;UAC5B,MAAM;eACD,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI;;;2CA6GpD,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './Stack';
2
- export { SectionToolbar, type SectionToolbarProps, sectionToolbarLayout, type StackSectionItem } from './Section';
2
+ export * from './StackItem';
3
+ export * from './LayoutControls';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,oBAAoB,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import type { StackSectionContent } from '../components/Section';
2
+ import { type StackItemContentProps } from '../components';
3
3
  export declare const EditorContent: ({ data: { content } }: {
4
- data: StackSectionContent & {
4
+ data: StackItemContentProps & {
5
5
  content?: string;
6
6
  };
7
7
  }) => React.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContent.d.ts","sourceRoot":"","sources":["../../../../src/testing/EditorContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,eAAO,MAAM,aAAa,0BAAgC;IAAE,IAAI,EAAE,mBAAmB,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,sBAmC7G,CAAC"}
1
+ {"version":3,"file":"EditorContent.d.ts","sourceRoot":"","sources":["../../../../src/testing/EditorContent.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAiBxC,OAAO,EAAa,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtE,eAAO,MAAM,aAAa,0BAAgC;IAAE,IAAI,EAAE,qBAAqB,GAAG;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,sBAmC/G,CAAC"}
@@ -1,3 +1,2 @@
1
- export * from './generator';
2
1
  export * from './stack-manager';
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAMA,cAAc,iBAAiB,CAAC"}
@@ -3,7 +3,6 @@ export declare class StackManager {
3
3
  readonly locator: Locator;
4
4
  private readonly _page;
5
5
  constructor(locator: Locator);
6
- empty(): Locator;
7
6
  sections(): Locator;
8
7
  order(): Promise<(string | null)[]>;
9
8
  section(index: number): SectionManager;
@@ -1 +1 @@
1
- {"version":3,"file":"stack-manager.d.ts","sourceRoot":"","sources":["../../../../src/testing/stack-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,YAAY;IAGX,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAIrC,KAAK;IAIL,QAAQ;IAIR,KAAK;IAIL,OAAO,CAAC,KAAK,EAAE,MAAM;CAGtB;AAED,qBAAa,cAAc;IAGb,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAI/B,EAAE;IAIF,MAAM;IAKN,UAAU;IAKV,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAmB;CAehF"}
1
+ {"version":3,"file":"stack-manager.d.ts","sourceRoot":"","sources":["../../../../src/testing/stack-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,YAAY;IAGX,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAIrC,QAAQ;IAIR,KAAK;IAIL,OAAO,CAAC,KAAK,EAAE,MAAM;CAGtB;AAED,qBAAa,cAAc;IAGb,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAI/B,EAAE;IAIF,MAAM;IAKN,UAAU;IAKV,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAmB;CAehF"}
@@ -2,14 +2,14 @@ export declare const translationKey = "stack";
2
2
  declare const _default: {
3
3
  'en-US': {
4
4
  stack: {
5
- 'empty stack message': string;
6
- 'remove section label': string;
7
- 'navigate to section label': string;
8
- 'untitled section title': string;
9
- 'add section before label': string;
10
- 'add section after label': string;
11
- 'expand label': string;
12
- 'collapse label': string;
5
+ 'resize label': string;
6
+ 'pin start label': string;
7
+ 'pin end label': string;
8
+ 'increment start label': string;
9
+ 'increment end label': string;
10
+ 'solo plank label': string;
11
+ 'close label': string;
12
+ 'minify label': string;
13
13
  };
14
14
  };
15
15
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-stack",
3
- "version": "0.6.14-main.f49f251",
3
+ "version": "0.6.14-staging.4b6f9cf",
4
4
  "description": "A stack component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -16,7 +16,10 @@
16
16
  "./testing": {
17
17
  "types": "./dist/types/src/testing/index.d.ts",
18
18
  "browser": "./dist/lib/browser/testing/index.mjs",
19
- "node": "./dist/lib/node-esm/testing/index.mjs"
19
+ "node": {
20
+ "require": "./dist/lib/node/testing/index.cjs",
21
+ "default": "./dist/lib/node-esm/testing/index.mjs"
22
+ }
20
23
  }
21
24
  },
22
25
  "types": "dist/types/src/index.d.ts",
@@ -38,16 +41,16 @@
38
41
  "@effect/schema": "^0.75.1",
39
42
  "@fluentui/react-tabster": "^9.19.0",
40
43
  "@radix-ui/primitive": "^1.0.0",
41
- "@radix-ui/react-collapsible": "^1.0.2",
42
44
  "@radix-ui/react-compose-refs": "^1.0.0",
43
45
  "@radix-ui/react-context": "^1.0.0",
44
46
  "@radix-ui/react-menu": "^2.0.6",
45
47
  "@radix-ui/react-use-controllable-state": "^1.0.0",
46
48
  "react-resize-detector": "^11.0.1",
47
- "@dxos/echo-schema": "0.6.14-main.f49f251",
48
- "@dxos/react-ui-attention": "0.6.14-main.f49f251",
49
- "@dxos/react-ui-mosaic": "0.6.14-main.f49f251",
50
- "@dxos/react-ui-deck": "0.6.14-main.f49f251"
49
+ "@dxos/echo-schema": "0.6.14-staging.4b6f9cf",
50
+ "@dxos/keyboard": "0.6.14-staging.4b6f9cf",
51
+ "@dxos/react-ui-attention": "0.6.14-staging.4b6f9cf",
52
+ "@dxos/react-ui-mosaic": "0.6.14-staging.4b6f9cf",
53
+ "@dxos/util": "0.6.14-staging.4b6f9cf"
51
54
  },
52
55
  "devDependencies": {
53
56
  "@phosphor-icons/react": "^2.1.5",
@@ -56,25 +59,24 @@
56
59
  "react": "~18.2.0",
57
60
  "react-dom": "~18.2.0",
58
61
  "vite": "5.4.7",
59
- "@dxos/echo-schema": "0.6.14-main.f49f251",
60
- "@dxos/random": "0.6.14-main.f49f251",
61
- "@dxos/client": "0.6.14-main.f49f251",
62
- "@dxos/react-ui": "0.6.14-main.f49f251",
63
- "@dxos/react-ui-editor": "0.6.14-main.f49f251",
64
- "@dxos/react-ui-theme": "0.6.14-main.f49f251",
65
- "@dxos/react-ui-table": "0.6.14-main.f49f251",
66
- "@dxos/storybook-utils": "0.6.14-main.f49f251",
67
- "@dxos/test-utils": "0.6.14-main.f49f251",
68
- "@dxos/util": "0.6.14-main.f49f251"
62
+ "@dxos/app-graph": "0.6.14-staging.4b6f9cf",
63
+ "@dxos/echo-schema": "0.6.14-staging.4b6f9cf",
64
+ "@dxos/random": "0.6.14-staging.4b6f9cf",
65
+ "@dxos/react-ui": "0.6.14-staging.4b6f9cf",
66
+ "@dxos/react-ui-editor": "0.6.14-staging.4b6f9cf",
67
+ "@dxos/client": "0.6.14-staging.4b6f9cf",
68
+ "@dxos/test-utils": "0.6.14-staging.4b6f9cf",
69
+ "@dxos/react-ui-theme": "0.6.14-staging.4b6f9cf",
70
+ "@dxos/storybook-utils": "0.6.14-staging.4b6f9cf"
69
71
  },
70
72
  "peerDependencies": {
71
73
  "@phosphor-icons/react": "^2.1.5",
72
74
  "react": "~18.2.0",
73
75
  "react-dom": "~18.2.0",
74
- "@dxos/random": "0.6.14-main.f49f251",
75
- "@dxos/react-ui": "0.6.14-main.f49f251",
76
- "@dxos/client": "0.6.14-main.f49f251",
77
- "@dxos/react-ui-theme": "0.6.14-main.f49f251"
76
+ "@dxos/client": "0.6.14-staging.4b6f9cf",
77
+ "@dxos/random": "0.6.14-staging.4b6f9cf",
78
+ "@dxos/react-ui-theme": "0.6.14-staging.4b6f9cf",
79
+ "@dxos/react-ui": "0.6.14-staging.4b6f9cf"
78
80
  },
79
81
  "publishConfig": {
80
82
  "access": "public"
@@ -0,0 +1,132 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React, { forwardRef } from 'react';
6
+
7
+ import {
8
+ Button,
9
+ ButtonGroup,
10
+ type ButtonGroupProps,
11
+ type ButtonProps,
12
+ Icon,
13
+ Tooltip,
14
+ useTranslation,
15
+ } from '@dxos/react-ui';
16
+
17
+ import { StackItem } from './StackItem';
18
+ import { translationKey } from '../translations';
19
+
20
+ export type LayoutControlEvent = 'solo' | 'close' | `${'pin' | 'increment'}-${'start' | 'end'}`;
21
+ export type LayoutControlHandler = (event: LayoutControlEvent) => void;
22
+
23
+ export type LayoutCapabilities = {
24
+ incrementStart?: boolean;
25
+ incrementEnd?: boolean;
26
+ solo?: boolean;
27
+ };
28
+
29
+ export type LayoutControlsProps = Omit<ButtonGroupProps, 'onClick'> & {
30
+ onClick?: LayoutControlHandler;
31
+ variant?: 'hide-disabled' | 'default';
32
+ close?: boolean | 'minify-start' | 'minify-end';
33
+ capabilities: LayoutCapabilities;
34
+ isSolo?: boolean;
35
+ pin?: 'start' | 'end' | 'both';
36
+ };
37
+
38
+ const LayoutControl = ({ icon, label, ...props }: Omit<ButtonProps, 'children'> & { label: string; icon: string }) => {
39
+ return (
40
+ <Tooltip.Root>
41
+ <Tooltip.Trigger asChild>
42
+ <Button variant='ghost' {...props}>
43
+ <span className='sr-only'>{label}</span>
44
+ <Icon icon={icon} />
45
+ </Button>
46
+ </Tooltip.Trigger>
47
+ <Tooltip.Portal>
48
+ <Tooltip.Content side='bottom' classNames='z-[70]'>
49
+ {label}
50
+ </Tooltip.Content>
51
+ </Tooltip.Portal>
52
+ </Tooltip.Root>
53
+ );
54
+ };
55
+
56
+ export const LayoutControls = forwardRef<HTMLDivElement, LayoutControlsProps>(
57
+ (
58
+ { onClick, variant = 'default', capabilities: can, isSolo, pin, close = false, children, ...props },
59
+ forwardedRef,
60
+ ) => {
61
+ const { t } = useTranslation(translationKey);
62
+ const buttonClassNames = variant === 'hide-disabled' ? 'disabled:hidden !p-1' : '!p-1';
63
+
64
+ return (
65
+ <ButtonGroup {...props} ref={forwardedRef}>
66
+ {pin && !isSolo && ['both', 'start'].includes(pin) && (
67
+ <LayoutControl
68
+ label={t('pin start label')}
69
+ variant='ghost'
70
+ classNames={buttonClassNames}
71
+ onClick={() => onClick?.('pin-start')}
72
+ icon='ph--caret-line-left--regular'
73
+ />
74
+ )}
75
+
76
+ {can.solo && (
77
+ <LayoutControl
78
+ label={t('solo layout label')}
79
+ classNames={buttonClassNames}
80
+ onClick={() => onClick?.('solo')}
81
+ icon={isSolo ? 'ph--arrows-in--regular' : 'ph--arrows-out--regular'}
82
+ />
83
+ )}
84
+
85
+ {!isSolo && can.solo && (
86
+ <>
87
+ <LayoutControl
88
+ label={t('increment start label')}
89
+ disabled={!can.incrementStart}
90
+ classNames={buttonClassNames}
91
+ onClick={() => onClick?.('increment-start')}
92
+ icon='ph--caret-left--regular'
93
+ />
94
+ <LayoutControl
95
+ label={t('increment end label')}
96
+ disabled={!can.incrementEnd}
97
+ classNames={buttonClassNames}
98
+ onClick={() => onClick?.('increment-end')}
99
+ icon='ph--caret-right--regular'
100
+ />
101
+ </>
102
+ )}
103
+
104
+ {pin && !isSolo && ['both', 'end'].includes(pin) && (
105
+ <LayoutControl
106
+ label={t('pin end label')}
107
+ classNames={buttonClassNames}
108
+ onClick={() => onClick?.('pin-end')}
109
+ icon='ph--caret-line-right--regular'
110
+ />
111
+ )}
112
+
113
+ {close && !isSolo && (
114
+ <LayoutControl
115
+ label={t(`${typeof close === 'string' ? 'minify' : 'close'} label`)}
116
+ classNames={buttonClassNames}
117
+ onClick={() => onClick?.('close')}
118
+ data-testid='layoutHeading.close'
119
+ icon={
120
+ close === 'minify-start'
121
+ ? 'ph--caret-line-left--regular'
122
+ : close === 'minify-end'
123
+ ? 'ph--caret-line-right--regular'
124
+ : 'ph--minus--regular'
125
+ }
126
+ />
127
+ )}
128
+ {children}
129
+ </ButtonGroup>
130
+ );
131
+ },
132
+ );
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ export const MenuSignifierHorizontal = () => (
8
+ <svg
9
+ className='absolute block-end-[7px]'
10
+ width={20}
11
+ height={2}
12
+ viewBox='0 0 20 2'
13
+ stroke='currentColor'
14
+ opacity={0.5}
15
+ >
16
+ <line
17
+ x1={0.5}
18
+ y1={0.75}
19
+ x2={19}
20
+ y2={0.75}
21
+ strokeWidth={1.25}
22
+ strokeLinecap='round'
23
+ strokeDasharray='6 20'
24
+ strokeDashoffset='-6.5'
25
+ />
26
+ </svg>
27
+ );
28
+
29
+ export const MenuSignifierVertical = () => (
30
+ <svg className='absolute inline-start-1' width={2} height={18} viewBox='0 0 2 18' stroke='currentColor'>
31
+ <line x1={1} y1={3} x2={1} y2={18} strokeWidth={1.5} strokeLinecap='round' strokeDasharray='0 6' />
32
+ </svg>
33
+ );