@dxos/react-ui-stack 0.6.14-staging.9e90729 → 0.6.14-staging.c117501
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 +494 -335
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +3 -6
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/index.cjs +478 -326
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +3 -6
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/index.mjs +494 -335
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +3 -6
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/components/LayoutControls.d.ts +19 -0
- package/dist/types/src/components/LayoutControls.d.ts.map +1 -0
- package/dist/types/src/components/MenuSignifier.d.ts +4 -0
- package/dist/types/src/components/MenuSignifier.d.ts.map +1 -0
- package/dist/types/src/components/Stack.d.ts +12 -12
- package/dist/types/src/components/Stack.d.ts.map +1 -1
- package/dist/types/src/components/Stack.stories.d.ts +6 -83
- package/dist/types/src/components/Stack.stories.d.ts.map +1 -1
- package/dist/types/src/components/StackContext.d.ts +19 -0
- package/dist/types/src/components/StackContext.d.ts.map +1 -0
- package/dist/types/src/components/StackItem.d.ts +41 -0
- package/dist/types/src/components/StackItem.d.ts.map +1 -0
- package/dist/types/src/components/StackItemContent.d.ts +9 -0
- package/dist/types/src/components/StackItemContent.d.ts.map +1 -0
- package/dist/types/src/components/StackItemHeading.d.ts +8 -0
- package/dist/types/src/components/StackItemHeading.d.ts.map +1 -0
- package/dist/types/src/components/StackItemResizeHandle.d.ts +3 -0
- package/dist/types/src/components/StackItemResizeHandle.d.ts.map +1 -0
- package/dist/types/src/components/StackItemSigil.d.ts +31 -0
- package/dist/types/src/components/StackItemSigil.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/testing/EditorContent.d.ts +2 -2
- package/dist/types/src/testing/EditorContent.d.ts.map +1 -1
- package/dist/types/src/testing/stack-manager.d.ts +0 -1
- package/dist/types/src/testing/stack-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -8
- package/package.json +19 -20
- package/src/components/LayoutControls.tsx +131 -0
- package/src/components/MenuSignifier.tsx +33 -0
- package/src/components/Stack.stories.tsx +109 -182
- package/src/components/Stack.tsx +61 -156
- package/src/components/StackContext.tsx +38 -0
- package/src/components/StackItem.tsx +173 -0
- package/src/components/StackItemContent.tsx +49 -0
- package/src/components/StackItemHeading.tsx +55 -0
- package/src/components/StackItemResizeHandle.tsx +115 -0
- package/src/components/StackItemSigil.tsx +170 -0
- package/src/components/index.ts +3 -2
- package/src/playwright/smoke.spec.ts +3 -3
- package/src/testing/EditorContent.tsx +4 -4
- package/src/testing/stack-manager.ts +3 -7
- package/src/translations.ts +8 -8
- package/dist/types/src/components/CaretDownUp.d.ts +0 -4
- package/dist/types/src/components/CaretDownUp.d.ts.map +0 -1
- package/dist/types/src/components/ContentTypes.stories.d.ts +0 -96
- package/dist/types/src/components/ContentTypes.stories.d.ts.map +0 -1
- package/dist/types/src/components/Deck.stories.d.ts +0 -19
- package/dist/types/src/components/Deck.stories.d.ts.map +0 -1
- package/dist/types/src/components/Section.d.ts +0 -53
- package/dist/types/src/components/Section.d.ts.map +0 -1
- package/dist/types/src/components/Section.stories.d.ts +0 -36
- package/dist/types/src/components/Section.stories.d.ts.map +0 -1
- package/dist/types/src/components/style-fragments.d.ts +0 -2
- package/dist/types/src/components/style-fragments.d.ts.map +0 -1
- package/dist/types/src/next/Stack.d.ts +0 -9
- package/dist/types/src/next/Stack.d.ts.map +0 -1
- package/dist/types/src/next/Stack.stories.d.ts +0 -8
- package/dist/types/src/next/Stack.stories.d.ts.map +0 -1
- package/dist/types/src/next/StackItem.d.ts +0 -14
- package/dist/types/src/next/StackItem.d.ts.map +0 -1
- package/dist/types/src/next/index.d.ts +0 -2
- package/dist/types/src/next/index.d.ts.map +0 -1
- package/dist/types/src/testing/TableContent.d.ts +0 -20
- package/dist/types/src/testing/TableContent.d.ts.map +0 -1
- package/src/components/CaretDownUp.tsx +0 -31
- package/src/components/ContentTypes.stories.tsx +0 -104
- package/src/components/Deck.stories.tsx +0 -362
- package/src/components/Section.stories.tsx +0 -50
- package/src/components/Section.tsx +0 -378
- package/src/components/style-fragments.ts +0 -5
- package/src/next/Stack.stories.tsx +0 -148
- package/src/next/Stack.tsx +0 -30
- package/src/next/StackItem.tsx +0 -78
- package/src/next/index.ts +0 -5
- package/src/testing/TableContent.tsx +0 -119
|
@@ -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,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAChC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAE/B,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,CAAC;AACnD,eAAO,MAAM,uBAAuB,KAA6B,CAAC;AAClE,eAAO,MAAM,qBAAqB,gBAAwC,CAAC;AAC3E,eAAO,MAAM,sBAAsB,KAAkD,CAAC;AAEtF,MAAM,MAAM,aAAa,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,eAAe,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,GAAG;IAC/E,IAAI,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/F,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACjD,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAC9B,CAAC;AAyGF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;CAQrB,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,yBAAyB,EACzB,oBAAoB,GACrB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { type ThemedClassName } from '@dxos/react-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,sBAwBvB,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 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,
|
|
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
|
|
2
|
+
import { type StackItemContentProps } from '../components';
|
|
3
3
|
export declare const EditorContent: ({ data: { content } }: {
|
|
4
|
-
data:
|
|
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,
|
|
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 +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,
|
|
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
|
-
'
|
|
6
|
-
'
|
|
7
|
-
'
|
|
8
|
-
'
|
|
9
|
-
'
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
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-staging.
|
|
3
|
+
"version": "0.6.14-staging.c117501",
|
|
4
4
|
"description": "A stack component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"@effect/schema": "^0.75.1",
|
|
42
42
|
"@fluentui/react-tabster": "^9.19.0",
|
|
43
43
|
"@radix-ui/primitive": "^1.0.0",
|
|
44
|
-
"@radix-ui/react-collapsible": "^1.0.2",
|
|
45
44
|
"@radix-ui/react-compose-refs": "^1.0.0",
|
|
46
45
|
"@radix-ui/react-context": "^1.0.0",
|
|
47
46
|
"@radix-ui/react-menu": "^2.0.6",
|
|
48
47
|
"@radix-ui/react-use-controllable-state": "^1.0.0",
|
|
49
48
|
"react-resize-detector": "^11.0.1",
|
|
50
|
-
"@dxos/echo-schema": "0.6.14-staging.
|
|
51
|
-
"@dxos/react-ui-attention": "0.6.14-staging.
|
|
52
|
-
"@dxos/react-ui-mosaic": "0.6.14-staging.
|
|
53
|
-
"@dxos/
|
|
49
|
+
"@dxos/echo-schema": "0.6.14-staging.c117501",
|
|
50
|
+
"@dxos/react-ui-attention": "0.6.14-staging.c117501",
|
|
51
|
+
"@dxos/react-ui-mosaic": "0.6.14-staging.c117501",
|
|
52
|
+
"@dxos/keyboard": "0.6.14-staging.c117501",
|
|
53
|
+
"@dxos/util": "0.6.14-staging.c117501"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -59,25 +59,24 @@
|
|
|
59
59
|
"react": "~18.2.0",
|
|
60
60
|
"react-dom": "~18.2.0",
|
|
61
61
|
"vite": "5.4.7",
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/react-ui
|
|
67
|
-
"@dxos/react-ui-
|
|
68
|
-
"@dxos/react-ui-theme": "0.6.14-staging.
|
|
69
|
-
"@dxos/storybook-utils": "0.6.14-staging.
|
|
70
|
-
"@dxos/test-utils": "0.6.14-staging.
|
|
71
|
-
"@dxos/util": "0.6.14-staging.9e90729"
|
|
62
|
+
"@dxos/app-graph": "0.6.14-staging.c117501",
|
|
63
|
+
"@dxos/client": "0.6.14-staging.c117501",
|
|
64
|
+
"@dxos/echo-schema": "0.6.14-staging.c117501",
|
|
65
|
+
"@dxos/random": "0.6.14-staging.c117501",
|
|
66
|
+
"@dxos/react-ui": "0.6.14-staging.c117501",
|
|
67
|
+
"@dxos/react-ui-editor": "0.6.14-staging.c117501",
|
|
68
|
+
"@dxos/react-ui-theme": "0.6.14-staging.c117501",
|
|
69
|
+
"@dxos/storybook-utils": "0.6.14-staging.c117501",
|
|
70
|
+
"@dxos/test-utils": "0.6.14-staging.c117501"
|
|
72
71
|
},
|
|
73
72
|
"peerDependencies": {
|
|
74
73
|
"@phosphor-icons/react": "^2.1.5",
|
|
75
74
|
"react": "~18.2.0",
|
|
76
75
|
"react-dom": "~18.2.0",
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/react-ui-theme": "0.6.14-staging.
|
|
76
|
+
"@dxos/random": "0.6.14-staging.c117501",
|
|
77
|
+
"@dxos/react-ui": "0.6.14-staging.c117501",
|
|
78
|
+
"@dxos/client": "0.6.14-staging.c117501",
|
|
79
|
+
"@dxos/react-ui-theme": "0.6.14-staging.c117501"
|
|
81
80
|
},
|
|
82
81
|
"publishConfig": {
|
|
83
82
|
"access": "public"
|
|
@@ -0,0 +1,131 @@
|
|
|
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 { translationKey } from '../translations';
|
|
18
|
+
|
|
19
|
+
export type LayoutControlEvent = 'solo' | 'close' | `${'pin' | 'increment'}-${'start' | 'end'}`;
|
|
20
|
+
export type LayoutControlHandler = (event: LayoutControlEvent) => void;
|
|
21
|
+
|
|
22
|
+
export type LayoutCapabilities = {
|
|
23
|
+
incrementStart?: boolean;
|
|
24
|
+
incrementEnd?: boolean;
|
|
25
|
+
solo?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export type LayoutControlsProps = Omit<ButtonGroupProps, 'onClick'> & {
|
|
29
|
+
onClick?: LayoutControlHandler;
|
|
30
|
+
variant?: 'hide-disabled' | 'default';
|
|
31
|
+
close?: boolean | 'minify-start' | 'minify-end';
|
|
32
|
+
capabilities: LayoutCapabilities;
|
|
33
|
+
isSolo?: boolean;
|
|
34
|
+
pin?: 'start' | 'end' | 'both';
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const LayoutControl = ({ icon, label, ...props }: Omit<ButtonProps, 'children'> & { label: string; icon: string }) => {
|
|
38
|
+
return (
|
|
39
|
+
<Tooltip.Root>
|
|
40
|
+
<Tooltip.Trigger asChild>
|
|
41
|
+
<Button variant='ghost' {...props}>
|
|
42
|
+
<span className='sr-only'>{label}</span>
|
|
43
|
+
<Icon icon={icon} />
|
|
44
|
+
</Button>
|
|
45
|
+
</Tooltip.Trigger>
|
|
46
|
+
<Tooltip.Portal>
|
|
47
|
+
<Tooltip.Content side='bottom' classNames='z-[70]'>
|
|
48
|
+
{label}
|
|
49
|
+
</Tooltip.Content>
|
|
50
|
+
</Tooltip.Portal>
|
|
51
|
+
</Tooltip.Root>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const LayoutControls = forwardRef<HTMLDivElement, LayoutControlsProps>(
|
|
56
|
+
(
|
|
57
|
+
{ onClick, variant = 'default', capabilities: can, isSolo, pin, close = false, children, ...props },
|
|
58
|
+
forwardedRef,
|
|
59
|
+
) => {
|
|
60
|
+
const { t } = useTranslation(translationKey);
|
|
61
|
+
const buttonClassNames = variant === 'hide-disabled' ? 'disabled:hidden !p-1' : '!p-1';
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<ButtonGroup {...props} ref={forwardedRef}>
|
|
65
|
+
{pin && !isSolo && ['both', 'start'].includes(pin) && (
|
|
66
|
+
<LayoutControl
|
|
67
|
+
label={t('pin start label')}
|
|
68
|
+
variant='ghost'
|
|
69
|
+
classNames={buttonClassNames}
|
|
70
|
+
onClick={() => onClick?.('pin-start')}
|
|
71
|
+
icon='ph--caret-line-left--regular'
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
|
|
75
|
+
{can.solo && (
|
|
76
|
+
<LayoutControl
|
|
77
|
+
label={t('solo layout label')}
|
|
78
|
+
classNames={buttonClassNames}
|
|
79
|
+
onClick={() => onClick?.('solo')}
|
|
80
|
+
icon={isSolo ? 'ph--arrows-in--regular' : 'ph--arrows-out--regular'}
|
|
81
|
+
/>
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
{!isSolo && can.solo && (
|
|
85
|
+
<>
|
|
86
|
+
<LayoutControl
|
|
87
|
+
label={t('increment start label')}
|
|
88
|
+
disabled={!can.incrementStart}
|
|
89
|
+
classNames={buttonClassNames}
|
|
90
|
+
onClick={() => onClick?.('increment-start')}
|
|
91
|
+
icon='ph--caret-left--regular'
|
|
92
|
+
/>
|
|
93
|
+
<LayoutControl
|
|
94
|
+
label={t('increment end label')}
|
|
95
|
+
disabled={!can.incrementEnd}
|
|
96
|
+
classNames={buttonClassNames}
|
|
97
|
+
onClick={() => onClick?.('increment-end')}
|
|
98
|
+
icon='ph--caret-right--regular'
|
|
99
|
+
/>
|
|
100
|
+
</>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{pin && !isSolo && ['both', 'end'].includes(pin) && (
|
|
104
|
+
<LayoutControl
|
|
105
|
+
label={t('pin end label')}
|
|
106
|
+
classNames={buttonClassNames}
|
|
107
|
+
onClick={() => onClick?.('pin-end')}
|
|
108
|
+
icon='ph--caret-line-right--regular'
|
|
109
|
+
/>
|
|
110
|
+
)}
|
|
111
|
+
|
|
112
|
+
{close && !isSolo && (
|
|
113
|
+
<LayoutControl
|
|
114
|
+
label={t(`${typeof close === 'string' ? 'minify' : 'close'} label`)}
|
|
115
|
+
classNames={buttonClassNames}
|
|
116
|
+
onClick={() => onClick?.('close')}
|
|
117
|
+
data-testid='layoutHeading.close'
|
|
118
|
+
icon={
|
|
119
|
+
close === 'minify-start'
|
|
120
|
+
? 'ph--caret-line-left--regular'
|
|
121
|
+
: close === 'minify-end'
|
|
122
|
+
? 'ph--caret-line-right--regular'
|
|
123
|
+
: 'ph--minus--regular'
|
|
124
|
+
}
|
|
125
|
+
/>
|
|
126
|
+
)}
|
|
127
|
+
{children}
|
|
128
|
+
</ButtonGroup>
|
|
129
|
+
);
|
|
130
|
+
},
|
|
131
|
+
);
|
|
@@ -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
|
+
);
|