@dxos/plugin-deck 0.8.1-staging.5be625a → 0.8.1-staging.9eaf14f
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/{app-graph-builder-K4KVSHNT.mjs → app-graph-builder-VYZ4IWI3.mjs} +3 -3
- package/dist/lib/browser/{check-app-scheme-6SS6I3RN.mjs → check-app-scheme-SEYECDHI.mjs} +2 -2
- package/dist/lib/browser/{chunk-RZLH5F56.mjs → chunk-6ZSOFCPP.mjs} +26 -6
- package/dist/lib/browser/chunk-6ZSOFCPP.mjs.map +7 -0
- package/dist/lib/browser/chunk-B4LOJUWW.mjs +24 -0
- package/dist/lib/browser/{chunk-MWUT66KV.mjs → chunk-FJBMNSUC.mjs} +547 -493
- package/dist/lib/browser/chunk-FJBMNSUC.mjs.map +7 -0
- package/dist/lib/browser/chunk-FLOVGNYB.mjs +81 -0
- package/dist/lib/browser/chunk-FLOVGNYB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2WTHB3TG.mjs → chunk-NSATFAEE.mjs} +3 -3
- package/dist/lib/browser/{chunk-2WTHB3TG.mjs.map → chunk-NSATFAEE.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-7X43JKZG.mjs → chunk-RJNCG4ND.mjs} +41 -45
- package/dist/lib/browser/chunk-RJNCG4ND.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WCNPMAR4.mjs → chunk-XMCG42ID.mjs} +2 -3
- package/dist/lib/browser/chunk-XMCG42ID.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +12 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-MEBOMCYI.mjs → intent-resolver-UDYKO2QW.mjs} +39 -78
- package/dist/lib/browser/intent-resolver-UDYKO2QW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-USUAHDML.mjs → react-root-XLXN2VEW.mjs} +8 -10
- package/dist/lib/browser/react-root-XLXN2VEW.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-TQG4YYES.mjs → react-surface-WNGMZL7I.mjs} +11 -10
- package/dist/lib/browser/react-surface-WNGMZL7I.mjs.map +7 -0
- package/dist/lib/browser/{settings-DYS3FFMN.mjs → settings-HMDGSBGO.mjs} +5 -4
- package/dist/lib/browser/settings-HMDGSBGO.mjs.map +7 -0
- package/dist/lib/browser/{state-DRRCGMU2.mjs → state-7TN26M42.mjs} +4 -4
- package/dist/lib/browser/{state-DRRCGMU2.mjs.map → state-7TN26M42.mjs.map} +2 -2
- package/dist/lib/browser/{tools-NDEUSO4R.mjs → tools-SC6QEN7R.mjs} +3 -3
- package/dist/lib/browser/types.mjs +12 -12
- package/dist/lib/browser/{url-handler-4BCN7AYC.mjs → url-handler-ODG4B6NX.mjs} +4 -4
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +10 -12
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -5
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +1 -4
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/index.d.ts +1 -0
- package/dist/types/src/components/DeckLayout/index.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +6 -0
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -0
- package/dist/types/src/components/DeckSettings/index.d.ts +2 -0
- package/dist/types/src/components/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/Plank/Plank.d.ts +14 -0
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -0
- package/dist/types/src/components/Plank/Plank.stories.d.ts +8 -0
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -0
- package/dist/types/src/components/{DeckLayout → Plank}/PlankControls.d.ts +2 -0
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -0
- package/dist/types/src/components/{DeckLayout → Plank}/PlankError.d.ts +2 -2
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -0
- package/dist/types/src/components/{DeckLayout/NodePlankHeading.d.ts → Plank/PlankHeading.d.ts} +7 -6
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -0
- package/dist/types/src/components/Plank/PlankLoading.d.ts.map +1 -0
- package/dist/types/src/components/Plank/index.d.ts +6 -0
- package/dist/types/src/components/Plank/index.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/components/Sidebar/index.d.ts +4 -0
- package/dist/types/src/components/Sidebar/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +0 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +7 -1
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +31 -60
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts +2 -2
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/useCompanions.d.ts +8 -0
- package/dist/types/src/util/useCompanions.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/package.json +28 -29
- package/src/DeckPlugin.ts +0 -1
- package/src/capabilities/capabilities.ts +3 -4
- package/src/capabilities/intent-resolver.ts +35 -7
- package/src/capabilities/react-root.tsx +1 -9
- package/src/capabilities/react-surface.tsx +3 -4
- package/src/capabilities/settings.ts +7 -2
- package/src/capabilities/state.ts +3 -3
- package/src/components/DeckLayout/ActiveNode.tsx +2 -1
- package/src/components/DeckLayout/Banner.tsx +5 -3
- package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
- package/src/components/DeckLayout/DeckLayout.tsx +27 -16
- package/src/components/DeckLayout/Fullscreen.tsx +1 -1
- package/src/components/DeckLayout/Toast.tsx +1 -1
- package/src/components/DeckLayout/index.ts +2 -0
- package/src/components/{LayoutSettings.tsx → DeckSettings/DeckSettings.tsx} +15 -10
- package/src/components/DeckSettings/index.ts +5 -0
- package/src/components/Plank/Plank.stories.tsx +43 -0
- package/src/components/{DeckLayout → Plank}/Plank.tsx +46 -37
- package/src/components/{DeckLayout → Plank}/PlankControls.tsx +40 -25
- package/src/components/{DeckLayout → Plank}/PlankError.tsx +3 -3
- package/src/components/{DeckLayout/NodePlankHeading.tsx → Plank/PlankHeading.tsx} +98 -59
- package/src/components/Plank/index.ts +9 -0
- package/src/components/{DeckLayout → Sidebar}/ComplementarySidebar.tsx +65 -81
- package/src/components/Sidebar/index.ts +7 -0
- package/src/components/index.ts +1 -1
- package/src/events.ts +0 -1
- package/src/hooks/index.ts +0 -1
- package/src/index.ts +1 -0
- package/src/layout.ts +19 -2
- package/src/meta.ts +2 -2
- package/src/translations.ts +3 -0
- package/src/types.ts +59 -86
- package/src/util/index.ts +1 -0
- package/src/util/set-active.ts +2 -2
- package/src/util/useCompanions.ts +18 -0
- package/src/util/useHoistStatusbar.ts +2 -2
- package/dist/lib/browser/chunk-7X43JKZG.mjs.map +0 -7
- package/dist/lib/browser/chunk-MWUT66KV.mjs.map +0 -7
- package/dist/lib/browser/chunk-NSNAYFAX.mjs +0 -24
- package/dist/lib/browser/chunk-RZLH5F56.mjs.map +0 -7
- package/dist/lib/browser/chunk-WCNPMAR4.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MEBOMCYI.mjs.map +0 -7
- package/dist/lib/browser/react-root-USUAHDML.mjs.map +0 -7
- package/dist/lib/browser/react-surface-TQG4YYES.mjs.map +0 -7
- package/dist/lib/browser/settings-DYS3FFMN.mjs.map +0 -7
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Plank.d.ts +0 -13
- package/dist/types/src/components/DeckLayout/Plank.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +0 -1
- package/dist/types/src/components/LayoutSettings.d.ts +0 -6
- package/dist/types/src/components/LayoutSettings.d.ts.map +0 -1
- package/dist/types/src/hooks/useNode.d.ts +0 -11
- package/dist/types/src/hooks/useNode.d.ts.map +0 -1
- package/src/hooks/useNode.ts +0 -46
- /package/dist/lib/browser/{app-graph-builder-K4KVSHNT.mjs.map → app-graph-builder-VYZ4IWI3.mjs.map} +0 -0
- /package/dist/lib/browser/{check-app-scheme-6SS6I3RN.mjs.map → check-app-scheme-SEYECDHI.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-NSNAYFAX.mjs.map → chunk-B4LOJUWW.mjs.map} +0 -0
- /package/dist/lib/browser/{tools-NDEUSO4R.mjs.map → tools-SC6QEN7R.mjs.map} +0 -0
- /package/dist/lib/browser/{url-handler-4BCN7AYC.mjs.map → url-handler-ODG4B6NX.mjs.map} +0 -0
- /package/dist/types/src/components/{DeckLayout → Plank}/PlankLoading.d.ts +0 -0
- /package/dist/types/src/components/{DeckLayout → Sidebar}/ComplementarySidebar.d.ts +0 -0
- /package/dist/types/src/components/{DeckLayout → Sidebar}/Sidebar.d.ts +0 -0
- /package/dist/types/src/components/{DeckLayout → Sidebar}/SidebarButton.d.ts +0 -0
- /package/src/components/{DeckLayout → Plank}/PlankLoading.tsx +0 -0
- /package/src/components/{DeckLayout → Sidebar}/Sidebar.tsx +0 -0
- /package/src/components/{DeckLayout → Sidebar}/SidebarButton.tsx +0 -0
|
@@ -1,39 +1,27 @@
|
|
|
1
1
|
import { S } from '@dxos/echo-schema';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
3
|
+
export declare const PLANK_COMPANION_TYPE = "dxos.org/plugin/deck/plank-companion";
|
|
4
|
+
export declare const DECK_COMPANION_TYPE = "dxos.org/plugin/deck/deck-companion";
|
|
5
5
|
export declare const NewPlankPositions: readonly ["start", "end"];
|
|
6
6
|
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
7
7
|
export declare const OverscrollOptions: readonly ["none", "centering"];
|
|
8
8
|
export type Overscroll = (typeof OverscrollOptions)[number];
|
|
9
9
|
export type Part = 'solo' | 'deck' | 'complementary';
|
|
10
10
|
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
11
|
-
export type Panel = {
|
|
12
|
-
id: string;
|
|
13
|
-
label: Label;
|
|
14
|
-
icon: string;
|
|
15
|
-
position?: Position;
|
|
16
|
-
/**
|
|
17
|
-
* If true, the panel will now be wrapped in a scroll area.
|
|
18
|
-
*/
|
|
19
|
-
fixed?: boolean;
|
|
20
|
-
filter?: (node: Node) => boolean;
|
|
21
|
-
};
|
|
22
11
|
export declare const DeckSettingsSchema: S.mutable<S.Struct<{
|
|
23
|
-
showHints: typeof S.Boolean
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
showHints: S.optional<typeof S.Boolean>;
|
|
13
|
+
enableDeck: S.optional<typeof S.Boolean>;
|
|
14
|
+
enableNativeRedirect: S.optional<typeof S.Boolean>;
|
|
15
|
+
enableStatusbar: S.optional<typeof S.Boolean>;
|
|
16
|
+
newPlankPositioning: S.optional<S.Literal<["start", "end"]>>;
|
|
17
|
+
overscroll: S.optional<S.Literal<["none", "centering"]>>;
|
|
28
18
|
}>>;
|
|
29
19
|
export type DeckSettingsProps = S.Schema.Type<typeof DeckSettingsSchema>;
|
|
30
|
-
declare const LayoutMode: S.Union<[S.Literal<["deck"]>, S.Literal<["solo"]>, S.Literal<["fullscreen"]>]>;
|
|
31
|
-
export declare const isLayoutMode: (value: any) => value is LayoutMode;
|
|
32
|
-
export type LayoutMode = S.Schema.Type<typeof LayoutMode>;
|
|
33
20
|
export declare const PlankSizing: S.Record$<typeof S.String, typeof S.Number>;
|
|
34
21
|
export type PlankSizing = S.Schema.Type<typeof PlankSizing>;
|
|
35
|
-
export declare const
|
|
36
|
-
|
|
22
|
+
export declare const DeckState: S.Struct<{
|
|
23
|
+
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
24
|
+
initialized: typeof S.Boolean;
|
|
37
25
|
active: S.mutable<S.Array$<typeof S.String>>;
|
|
38
26
|
activeCompanions: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.String>>>;
|
|
39
27
|
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
@@ -42,35 +30,24 @@ export declare const Deck: S.Struct<{
|
|
|
42
30
|
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
43
31
|
companionFrameSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
44
32
|
}>;
|
|
45
|
-
export type
|
|
46
|
-
export declare const defaultDeck:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
solo: undefined;
|
|
53
|
-
plankSizing: {};
|
|
54
|
-
companionFrameSizing: {};
|
|
55
|
-
};
|
|
56
|
-
export declare const surfaceVariantSeparator = "--";
|
|
57
|
-
export declare const surfaceVariant: (id: string) => string;
|
|
58
|
-
export declare const DeckState: S.mutable<S.Struct<{
|
|
33
|
+
export type DeckState = S.Schema.Type<typeof DeckState>;
|
|
34
|
+
export declare const defaultDeck: DeckState;
|
|
35
|
+
declare const LayoutMode: S.Literal<["deck", "solo", "fullscreen"]>;
|
|
36
|
+
export type LayoutMode = S.Schema.Type<typeof LayoutMode>;
|
|
37
|
+
export declare const isLayoutMode: (value: any) => value is LayoutMode;
|
|
38
|
+
export declare const getMode: (deck: DeckState) => LayoutMode;
|
|
39
|
+
export declare const DeckPluginState: S.mutable<S.Struct<{
|
|
59
40
|
sidebarState: S.Literal<["closed", "collapsed", "expanded"]>;
|
|
60
41
|
complementarySidebarState: S.Literal<["closed", "collapsed", "expanded"]>;
|
|
61
42
|
complementarySidebarPanel: S.optional<typeof S.String>;
|
|
62
43
|
dialogOpen: typeof S.Boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Data to be passed to the dialog Surface.
|
|
65
|
-
*/
|
|
44
|
+
/** Data to be passed to the dialog Surface. */
|
|
66
45
|
dialogContent: S.optional<typeof S.Any>;
|
|
67
46
|
dialogBlockAlign: S.optional<S.Literal<["start", "center", "end"]>>;
|
|
68
47
|
dialogType: S.optional<S.Literal<["default", "alert"]>>;
|
|
69
48
|
popoverOpen: typeof S.Boolean;
|
|
70
49
|
popoverSide: S.optional<S.Literal<["top", "right", "bottom", "left"]>>;
|
|
71
|
-
/**
|
|
72
|
-
* Data to be passed to the popover Surface.
|
|
73
|
-
*/
|
|
50
|
+
/** Data to be passed to the popover Surface. */
|
|
74
51
|
popoverContent: S.optional<typeof S.Any>;
|
|
75
52
|
popoverAnchorId: S.optional<typeof S.String>;
|
|
76
53
|
toasts: S.mutable<S.Array$<S.Struct<{
|
|
@@ -103,7 +80,8 @@ export declare const DeckState: S.mutable<S.Struct<{
|
|
|
103
80
|
activeDeck: typeof S.String;
|
|
104
81
|
previousDeck: typeof S.String;
|
|
105
82
|
decks: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
106
|
-
|
|
83
|
+
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
84
|
+
initialized: typeof S.Boolean;
|
|
107
85
|
active: S.mutable<S.Array$<typeof S.String>>;
|
|
108
86
|
activeCompanions: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.String>>>;
|
|
109
87
|
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
@@ -112,9 +90,10 @@ export declare const DeckState: S.mutable<S.Struct<{
|
|
|
112
90
|
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
113
91
|
companionFrameSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
114
92
|
}>>>>;
|
|
115
|
-
previousMode: S.mutable<S.Record$<typeof S.String, S.
|
|
93
|
+
previousMode: S.mutable<S.Record$<typeof S.String, S.Literal<["deck", "solo", "fullscreen"]>>>;
|
|
116
94
|
deck: S.mutable<S.Struct<{
|
|
117
|
-
|
|
95
|
+
/** If false, the deck has not yet left solo mode and new planks should be soloed. */
|
|
96
|
+
initialized: typeof S.Boolean;
|
|
118
97
|
active: S.mutable<S.Array$<typeof S.String>>;
|
|
119
98
|
activeCompanions: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.String>>>;
|
|
120
99
|
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
@@ -123,21 +102,17 @@ export declare const DeckState: S.mutable<S.Struct<{
|
|
|
123
102
|
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
124
103
|
companionFrameSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
125
104
|
}>>;
|
|
126
|
-
/**
|
|
127
|
-
* The identifier of a component to scroll into view when it is mounted.
|
|
128
|
-
*/
|
|
105
|
+
/** The identifier of a component to scroll into view when it is mounted. */
|
|
129
106
|
scrollIntoView: S.optional<typeof S.String>;
|
|
130
107
|
}>>;
|
|
131
|
-
export type
|
|
132
|
-
export declare const getMode: (deck: Deck) => LayoutMode;
|
|
133
|
-
export declare const SLUG_PATH_SEPARATOR = "~";
|
|
108
|
+
export type DeckPluginState = S.Schema.Type<typeof DeckPluginState>;
|
|
134
109
|
export declare const DECK_ACTION: string;
|
|
135
110
|
export declare namespace DeckAction {
|
|
136
|
-
const PartAdjustmentSchema: S.Union<[S.Literal<["close"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
111
|
+
const PartAdjustmentSchema: S.Union<[S.Literal<["close"]>, S.Literal<["companion"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
137
112
|
export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;
|
|
138
113
|
export const Adjustment: S.mutable<S.Struct<{
|
|
139
114
|
id: typeof S.String;
|
|
140
|
-
type: S.Union<[S.Literal<["close"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
115
|
+
type: S.Union<[S.Literal<["close"]>, S.Literal<["companion"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
141
116
|
}>>;
|
|
142
117
|
export type Adjustment = S.Schema.Type<typeof Adjustment>;
|
|
143
118
|
const Adjust_base: S.TaggedClass<Adjust, `${string}/adjust`, {
|
|
@@ -145,13 +120,10 @@ export declare namespace DeckAction {
|
|
|
145
120
|
} & {
|
|
146
121
|
input: S.mutable<S.Struct<{
|
|
147
122
|
id: typeof S.String;
|
|
148
|
-
type: S.Union<[S.Literal<["close"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
123
|
+
type: S.Union<[S.Literal<["close"]>, S.Literal<["companion"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
149
124
|
}>>;
|
|
150
125
|
output: typeof S.Void;
|
|
151
126
|
}>;
|
|
152
|
-
/**
|
|
153
|
-
* An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
154
|
-
*/
|
|
155
127
|
export class Adjust extends Adjust_base {
|
|
156
128
|
}
|
|
157
129
|
const UpdatePlankSize_base: S.TaggedClass<UpdatePlankSize, `${string}/update-plank-size`, {
|
|
@@ -178,5 +150,4 @@ export declare namespace DeckAction {
|
|
|
178
150
|
}
|
|
179
151
|
export {};
|
|
180
152
|
}
|
|
181
|
-
export {};
|
|
182
153
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type AttentionManager } from '@dxos/plugin-attention';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DeckPluginState } from '../types';
|
|
3
3
|
export type SetActiveOptions = {
|
|
4
4
|
next: string[];
|
|
5
|
-
state:
|
|
5
|
+
state: DeckPluginState;
|
|
6
6
|
attention?: AttentionManager;
|
|
7
7
|
};
|
|
8
8
|
export declare const setActive: ({ next, state, attention }: SetActiveOptions) => string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-active.d.ts","sourceRoot":"","sources":["../../../../src/util/set-active.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"set-active.d.ts","sourceRoot":"","sources":["../../../../src/util/set-active.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,eAAe,CAAC;IACvB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,SAAS,+BAAgC,gBAAgB,uBA8BrE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCompanions.d.ts","sourceRoot":"","sources":["../../../../src/util/useCompanions.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,QAAS,MAAM;;;;;;IAKxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoistStatusbar.d.ts","sourceRoot":"","sources":["../../../../src/util/useHoistStatusbar.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,iBAAiB,eAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"useHoistStatusbar.d.ts","sourceRoot":"","sources":["../../../../src/util/useHoistStatusbar.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,iBAAiB,eAAgB,MAAM,KAAG,OAOtD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-deck",
|
|
3
|
-
"version": "0.8.1-staging.
|
|
3
|
+
"version": "0.8.1-staging.9eaf14f",
|
|
4
4
|
"description": "DXOS Surface plugin for the main application layout.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -35,29 +35,28 @@
|
|
|
35
35
|
"@preact/signals-core": "^1.6.0",
|
|
36
36
|
"effect": "3.13.3",
|
|
37
37
|
"immer": "^10.1.1",
|
|
38
|
-
"@dxos/app-framework": "0.8.1-staging.
|
|
39
|
-
"@dxos/artifact": "0.8.1-staging.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/keyboard": "0.8.1-staging.
|
|
46
|
-
"@dxos/live-object": "0.8.1-staging.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-client": "0.8.1-staging.
|
|
55
|
-
"@dxos/react-ui-
|
|
56
|
-
"@dxos/react-ui-
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/react-ui-
|
|
59
|
-
"@dxos/util": "0.8.1-staging.
|
|
60
|
-
"@dxos/react-ui-stack": "0.8.1-staging.5be625a"
|
|
38
|
+
"@dxos/app-framework": "0.8.1-staging.9eaf14f",
|
|
39
|
+
"@dxos/artifact": "0.8.1-staging.9eaf14f",
|
|
40
|
+
"@dxos/async": "0.8.1-staging.9eaf14f",
|
|
41
|
+
"@dxos/echo-schema": "0.8.1-staging.9eaf14f",
|
|
42
|
+
"@dxos/debug": "0.8.1-staging.9eaf14f",
|
|
43
|
+
"@dxos/echo-signals": "0.8.1-staging.9eaf14f",
|
|
44
|
+
"@dxos/invariant": "0.8.1-staging.9eaf14f",
|
|
45
|
+
"@dxos/keyboard": "0.8.1-staging.9eaf14f",
|
|
46
|
+
"@dxos/live-object": "0.8.1-staging.9eaf14f",
|
|
47
|
+
"@dxos/log": "0.8.1-staging.9eaf14f",
|
|
48
|
+
"@dxos/plugin-attention": "0.8.1-staging.9eaf14f",
|
|
49
|
+
"@dxos/plugin-graph": "0.8.1-staging.9eaf14f",
|
|
50
|
+
"@dxos/local-storage": "0.8.1-staging.9eaf14f",
|
|
51
|
+
"@dxos/plugin-observability": "0.8.1-staging.9eaf14f",
|
|
52
|
+
"@dxos/plugin-theme": "0.8.1-staging.9eaf14f",
|
|
53
|
+
"@dxos/react-ui-attention": "0.8.1-staging.9eaf14f",
|
|
54
|
+
"@dxos/react-client": "0.8.1-staging.9eaf14f",
|
|
55
|
+
"@dxos/react-ui-form": "0.8.1-staging.9eaf14f",
|
|
56
|
+
"@dxos/react-ui-tabs": "0.8.1-staging.9eaf14f",
|
|
57
|
+
"@dxos/react-ui-stack": "0.8.1-staging.9eaf14f",
|
|
58
|
+
"@dxos/react-ui-text-tooltip": "0.8.1-staging.9eaf14f",
|
|
59
|
+
"@dxos/util": "0.8.1-staging.9eaf14f"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -66,16 +65,16 @@
|
|
|
66
65
|
"react": "~18.2.0",
|
|
67
66
|
"react-dom": "~18.2.0",
|
|
68
67
|
"vite": "5.4.7",
|
|
69
|
-
"@dxos/react-ui": "0.8.1-staging.
|
|
70
|
-
"@dxos/react-ui
|
|
71
|
-
"@dxos/storybook-utils": "0.8.1-staging.
|
|
68
|
+
"@dxos/react-ui-theme": "0.8.1-staging.9eaf14f",
|
|
69
|
+
"@dxos/react-ui": "0.8.1-staging.9eaf14f",
|
|
70
|
+
"@dxos/storybook-utils": "0.8.1-staging.9eaf14f"
|
|
72
71
|
},
|
|
73
72
|
"peerDependencies": {
|
|
74
73
|
"@phosphor-icons/react": "^2.0.5",
|
|
75
74
|
"react": "~18.2.0",
|
|
76
75
|
"react-dom": "~18.2.0",
|
|
77
|
-
"@dxos/react-ui": "0.8.1-staging.
|
|
78
|
-
"@dxos/react-ui-theme": "0.8.1-staging.
|
|
76
|
+
"@dxos/react-ui": "0.8.1-staging.9eaf14f",
|
|
77
|
+
"@dxos/react-ui-theme": "0.8.1-staging.9eaf14f"
|
|
79
78
|
},
|
|
80
79
|
"publishConfig": {
|
|
81
80
|
"access": "public"
|
package/src/DeckPlugin.ts
CHANGED
|
@@ -6,10 +6,9 @@ import { defineCapability } from '@dxos/app-framework';
|
|
|
6
6
|
import { type DeepReadonly } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import { DECK_PLUGIN } from '../meta';
|
|
9
|
-
import { type
|
|
9
|
+
import { type DeckPluginState } from '../types';
|
|
10
10
|
|
|
11
11
|
export namespace DeckCapabilities {
|
|
12
|
-
export const DeckState = defineCapability<DeepReadonly<
|
|
13
|
-
export const MutableDeckState = defineCapability<
|
|
14
|
-
export const ComplementaryPanel = defineCapability<Panel>(`${DECK_PLUGIN}/capability/complementary-panel`);
|
|
12
|
+
export const DeckState = defineCapability<DeepReadonly<DeckPluginState>>(`${DECK_PLUGIN}/capability/state`);
|
|
13
|
+
export const MutableDeckState = defineCapability<DeckPluginState>(`${DECK_PLUGIN}/capability/state`);
|
|
15
14
|
}
|
|
@@ -20,13 +20,22 @@ import { invariant } from '@dxos/invariant';
|
|
|
20
20
|
import { isReactiveObject } from '@dxos/live-object';
|
|
21
21
|
import { log } from '@dxos/log';
|
|
22
22
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
23
|
+
import { type Node } from '@dxos/plugin-graph';
|
|
23
24
|
import { ObservabilityAction } from '@dxos/plugin-observability/types';
|
|
24
|
-
import { isNonNullable } from '@dxos/util';
|
|
25
|
+
import { byPosition, isNonNullable } from '@dxos/util';
|
|
25
26
|
|
|
26
27
|
import { DeckCapabilities } from './capabilities';
|
|
27
|
-
import { closeEntry, incrementPlank, openEntry } from '../layout';
|
|
28
|
+
import { closeEntry, createEntryId, incrementPlank, openEntry } from '../layout';
|
|
28
29
|
import { DECK_PLUGIN } from '../meta';
|
|
29
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
DeckAction,
|
|
32
|
+
type LayoutMode,
|
|
33
|
+
type DeckSettingsProps,
|
|
34
|
+
isLayoutMode,
|
|
35
|
+
getMode,
|
|
36
|
+
defaultDeck,
|
|
37
|
+
PLANK_COMPANION_TYPE,
|
|
38
|
+
} from '../types';
|
|
30
39
|
import { setActive } from '../util';
|
|
31
40
|
|
|
32
41
|
export default (context: PluginsContext) =>
|
|
@@ -240,13 +249,14 @@ export default (context: PluginsContext) =>
|
|
|
240
249
|
const previouslyOpenIds = new Set<string>(state.deck.solo ? [state.deck.solo] : state.deck.active);
|
|
241
250
|
batch(() => {
|
|
242
251
|
const next = state.deck.solo
|
|
243
|
-
? (subject as string[])
|
|
252
|
+
? (subject as string[]).map((id) => createEntryId(id, options?.variant))
|
|
244
253
|
: subject.reduce(
|
|
245
254
|
(acc, entryId) =>
|
|
246
255
|
openEntry(acc, entryId, {
|
|
247
256
|
key: options?.key,
|
|
248
257
|
positioning: options?.positioning ?? settings?.newPlankPositioning,
|
|
249
258
|
pivotId: options?.pivotId,
|
|
259
|
+
variant: options?.variant,
|
|
250
260
|
}),
|
|
251
261
|
state.deck.active,
|
|
252
262
|
);
|
|
@@ -263,13 +273,13 @@ export default (context: PluginsContext) =>
|
|
|
263
273
|
? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: newlyOpen[0] ?? subject[0] })]
|
|
264
274
|
: []),
|
|
265
275
|
createIntent(LayoutAction.Expose, { part: 'navigation', subject: newlyOpen[0] ?? subject[0] }),
|
|
266
|
-
...newlyOpen.map((
|
|
267
|
-
const active = graph?.findNode(
|
|
276
|
+
...newlyOpen.map((subjectId) => {
|
|
277
|
+
const active = graph?.findNode(subjectId)?.data;
|
|
268
278
|
const typename = isReactiveObject(active) ? getTypename(active) : undefined;
|
|
269
279
|
return createIntent(ObservabilityAction.SendEvent, {
|
|
270
280
|
name: 'navigation.activate',
|
|
271
281
|
properties: {
|
|
272
|
-
|
|
282
|
+
subjectId,
|
|
273
283
|
typename,
|
|
274
284
|
},
|
|
275
285
|
});
|
|
@@ -352,6 +362,7 @@ export default (context: PluginsContext) =>
|
|
|
352
362
|
resolve: (adjustment) => {
|
|
353
363
|
const state = context.requestCapability(DeckCapabilities.MutableDeckState);
|
|
354
364
|
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
365
|
+
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
355
366
|
|
|
356
367
|
return batch(() => {
|
|
357
368
|
if (adjustment.type === 'increment-end' || adjustment.type === 'increment-start') {
|
|
@@ -362,6 +373,23 @@ export default (context: PluginsContext) =>
|
|
|
362
373
|
});
|
|
363
374
|
}
|
|
364
375
|
|
|
376
|
+
if (adjustment.type === 'companion') {
|
|
377
|
+
const node = graph.findNode(adjustment.id);
|
|
378
|
+
const [companion] = node
|
|
379
|
+
? graph
|
|
380
|
+
.nodes(node, { filter: (n): n is Node<any> => n.type === PLANK_COMPANION_TYPE })
|
|
381
|
+
.toSorted((a, b) => byPosition(a.properties, b.properties))
|
|
382
|
+
: [];
|
|
383
|
+
if (companion) {
|
|
384
|
+
return {
|
|
385
|
+
intents: [
|
|
386
|
+
// TODO(wittjosiah): This should remember the previously selected companion.
|
|
387
|
+
createIntent(DeckAction.ChangeCompanion, { primary: adjustment.id, companion: companion.id }),
|
|
388
|
+
],
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
365
393
|
if (adjustment.type === 'solo') {
|
|
366
394
|
const entryId = adjustment.id;
|
|
367
395
|
if (!state.deck.solo) {
|
|
@@ -9,14 +9,12 @@ import { Capabilities, contributes, useCapability } from '@dxos/app-framework';
|
|
|
9
9
|
import { DeckCapabilities } from './capabilities';
|
|
10
10
|
import { DeckLayout } from '../components';
|
|
11
11
|
import { DECK_PLUGIN } from '../meta';
|
|
12
|
-
import { type DeckSettingsProps } from '../types';
|
|
13
12
|
|
|
14
13
|
export default () =>
|
|
15
14
|
contributes(Capabilities.ReactRoot, {
|
|
16
15
|
id: DECK_PLUGIN,
|
|
17
16
|
root: () => {
|
|
18
17
|
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
19
|
-
const settings = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value;
|
|
20
18
|
|
|
21
19
|
const handleDismissToast = useCallback(
|
|
22
20
|
(id: string) => {
|
|
@@ -35,12 +33,6 @@ export default () =>
|
|
|
35
33
|
[layout.toasts],
|
|
36
34
|
);
|
|
37
35
|
|
|
38
|
-
return
|
|
39
|
-
<DeckLayout
|
|
40
|
-
showHints={settings.showHints}
|
|
41
|
-
overscroll={settings.overscroll}
|
|
42
|
-
onDismissToast={handleDismissToast}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
36
|
+
return <DeckLayout onDismissToast={handleDismissToast} />;
|
|
45
37
|
},
|
|
46
38
|
});
|
|
@@ -7,19 +7,18 @@ import React from 'react';
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
8
|
import { SettingsStore } from '@dxos/local-storage';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import { Banner } from '../components/DeckLayout/Banner';
|
|
10
|
+
import { DeckSettings, Banner } from '../components';
|
|
12
11
|
import { DECK_PLUGIN } from '../meta';
|
|
13
12
|
import { type DeckSettingsProps } from '../types';
|
|
14
13
|
|
|
15
14
|
export default () =>
|
|
16
15
|
contributes(Capabilities.ReactSurface, [
|
|
17
16
|
createSurface({
|
|
18
|
-
id: `${DECK_PLUGIN}/settings`,
|
|
17
|
+
id: `${DECK_PLUGIN}/plugin-settings`,
|
|
19
18
|
role: 'article',
|
|
20
19
|
filter: (data): data is { subject: SettingsStore<DeckSettingsProps> } =>
|
|
21
20
|
data.subject instanceof SettingsStore && data.subject.prefix === DECK_PLUGIN,
|
|
22
|
-
component: ({ data: { subject } }) => <
|
|
21
|
+
component: ({ data: { subject } }) => <DeckSettings settings={subject.value} />,
|
|
23
22
|
}),
|
|
24
23
|
createSurface({
|
|
25
24
|
id: `${DECK_PLUGIN}/banner`,
|
|
@@ -11,11 +11,16 @@ import { DeckSettingsSchema, type DeckSettingsProps } from '../types';
|
|
|
11
11
|
export default () => {
|
|
12
12
|
const settings = create<DeckSettingsProps>({
|
|
13
13
|
showHints: false,
|
|
14
|
+
enableDeck: true,
|
|
14
15
|
enableNativeRedirect: false,
|
|
15
|
-
enableStatusbar:
|
|
16
|
+
enableStatusbar: false,
|
|
16
17
|
newPlankPositioning: 'start',
|
|
17
18
|
overscroll: 'none',
|
|
18
19
|
});
|
|
19
20
|
|
|
20
|
-
return contributes(Capabilities.Settings, {
|
|
21
|
+
return contributes(Capabilities.Settings, {
|
|
22
|
+
schema: DeckSettingsSchema,
|
|
23
|
+
prefix: DECK_PLUGIN,
|
|
24
|
+
value: settings,
|
|
25
|
+
});
|
|
21
26
|
};
|
|
@@ -10,7 +10,7 @@ import { type SidebarState } from '@dxos/react-ui';
|
|
|
10
10
|
|
|
11
11
|
import { DeckCapabilities } from './capabilities';
|
|
12
12
|
import { DECK_PLUGIN } from '../meta';
|
|
13
|
-
import { getMode, type
|
|
13
|
+
import { getMode, type DeckState, type DeckPluginState, defaultDeck } from '../types';
|
|
14
14
|
|
|
15
15
|
const boolean = /true|false/;
|
|
16
16
|
|
|
@@ -32,7 +32,7 @@ const migrateSidebarState = () => {
|
|
|
32
32
|
export default () => {
|
|
33
33
|
migrateSidebarState();
|
|
34
34
|
|
|
35
|
-
const state = new LocalStorageStore<
|
|
35
|
+
const state = new LocalStorageStore<DeckPluginState>(DECK_PLUGIN, {
|
|
36
36
|
sidebarState: 'expanded',
|
|
37
37
|
complementarySidebarState: 'collapsed',
|
|
38
38
|
complementarySidebarPanel: undefined,
|
|
@@ -63,7 +63,7 @@ export default () => {
|
|
|
63
63
|
.prop({ key: 'sidebarState', type: LocalStorageStore.enum<SidebarState>() })
|
|
64
64
|
.prop({ key: 'complementarySidebarState', type: LocalStorageStore.enum<SidebarState>() })
|
|
65
65
|
.prop({ key: 'complementarySidebarPanel', type: LocalStorageStore.string({ allowUndefined: true }) })
|
|
66
|
-
.prop({ key: 'decks', type: LocalStorageStore.json<Record<string,
|
|
66
|
+
.prop({ key: 'decks', type: LocalStorageStore.json<Record<string, DeckState>>() })
|
|
67
67
|
.prop({ key: 'activeDeck', type: LocalStorageStore.string() })
|
|
68
68
|
.prop({ key: 'previousDeck', type: LocalStorageStore.string() });
|
|
69
69
|
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Surface, useAppGraph } from '@dxos/app-framework';
|
|
8
|
+
import { useNode } from '@dxos/plugin-graph';
|
|
8
9
|
import { useAttended } from '@dxos/react-ui-attention';
|
|
9
10
|
|
|
10
|
-
import {
|
|
11
|
+
import { useNodeActionExpander } from '../../hooks';
|
|
11
12
|
|
|
12
13
|
// TODO(burdon): Factor out to effect in plugin set document title.
|
|
13
14
|
export const ActiveNode = () => {
|
|
@@ -5,12 +5,14 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
|
-
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { useTranslation, type ThemedClassName } from '@dxos/react-ui';
|
|
9
9
|
import { mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { DECK_PLUGIN } from '../../meta';
|
|
12
|
+
import { CloseSidebarButton, ToggleSidebarButton } from '../Sidebar';
|
|
12
13
|
|
|
13
14
|
export const Banner = ({ variant, classNames }: ThemedClassName<{ variant?: 'topbar' | 'sidebar' }>) => {
|
|
15
|
+
const { t } = useTranslation(DECK_PLUGIN);
|
|
14
16
|
return (
|
|
15
17
|
<header
|
|
16
18
|
className={mx(
|
|
@@ -21,7 +23,7 @@ export const Banner = ({ variant, classNames }: ThemedClassName<{ variant?: 'top
|
|
|
21
23
|
)}
|
|
22
24
|
>
|
|
23
25
|
{variant === 'sidebar' ? <CloseSidebarButton /> : <ToggleSidebarButton />}
|
|
24
|
-
<span className='self-center grow mis-1'>
|
|
26
|
+
<span className='self-center grow mis-1'>{t('current app name', { ns: 'appkit' })}</span>
|
|
25
27
|
{variant === 'topbar' && (
|
|
26
28
|
<div role='none' className='absolute inset-0 pointer-events-none'>
|
|
27
29
|
<div role='none' className='grid bs-full pointer-fine:p-1 max-is-md mli-auto pointer-events-auto'>
|
|
@@ -6,8 +6,8 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Surface } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
import { ToggleSidebarButton } from './SidebarButton';
|
|
10
9
|
import { layoutAppliesTopbar, useBreakpoints } from '../../util';
|
|
10
|
+
import { ToggleSidebarButton } from '../Sidebar';
|
|
11
11
|
import { fixedSidebarToggleStyles } from '../fragments';
|
|
12
12
|
|
|
13
13
|
export const ContentEmpty = () => {
|