@dxos/plugin-deck 0.7.5-main.9d2a38b → 0.7.5-main.e94eead
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-67VRUD5K.mjs → app-graph-builder-IYHAGFA3.mjs} +61 -31
- package/dist/lib/browser/app-graph-builder-IYHAGFA3.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs → check-app-scheme-S3EYUPMF.mjs} +3 -3
- package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs.map → check-app-scheme-S3EYUPMF.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-5VFDMW5M.mjs → chunk-22AQ5IVX.mjs} +2 -2
- package/dist/lib/browser/chunk-22AQ5IVX.mjs.map +7 -0
- package/dist/lib/browser/chunk-FT33W5CI.mjs +128 -0
- package/dist/lib/browser/chunk-FT33W5CI.mjs.map +7 -0
- package/dist/lib/browser/chunk-G2X3ZDCE.mjs +24 -0
- package/dist/lib/browser/chunk-G2X3ZDCE.mjs.map +7 -0
- package/dist/lib/browser/chunk-KANJBSIX.mjs +97 -0
- package/dist/lib/browser/chunk-KANJBSIX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JQJ5UWVB.mjs → chunk-N7TEPFVR.mjs} +3 -2
- package/dist/lib/browser/{chunk-JQJ5UWVB.mjs.map → chunk-N7TEPFVR.mjs.map} +3 -3
- package/dist/lib/browser/chunk-O4RFYYQ6.mjs +1114 -0
- package/dist/lib/browser/chunk-O4RFYYQ6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +45 -78
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-ZD67BRUI.mjs +488 -0
- package/dist/lib/browser/intent-resolver-ZD67BRUI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-UL7ZDRVZ.mjs → react-root-6ILKHD5J.mjs} +12 -17
- package/dist/lib/browser/react-root-6ILKHD5J.mjs.map +7 -0
- package/dist/lib/browser/react-surface-O75FKXAI.mjs +39 -0
- package/dist/lib/browser/react-surface-O75FKXAI.mjs.map +7 -0
- package/dist/lib/browser/{settings-FNWW6WIJ.mjs → settings-H35U6NHE.mjs} +6 -7
- package/dist/lib/browser/settings-H35U6NHE.mjs.map +7 -0
- package/dist/lib/browser/state-U4SHOPJW.mjs +129 -0
- package/dist/lib/browser/state-U4SHOPJW.mjs.map +7 -0
- package/dist/lib/browser/tools-64LXGLYR.mjs +59 -0
- package/dist/lib/browser/tools-64LXGLYR.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +16 -4
- package/dist/lib/browser/url-handler-MVHTKUYA.mjs +72 -0
- package/dist/lib/browser/url-handler-MVHTKUYA.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +137 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +188 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +79 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools.d.ts +10 -0
- package/dist/types/src/capabilities/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +1 -4
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -7
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +3 -3
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Plank.d.ts +8 -6
- package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts +2 -2
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankError.d.ts +6 -6
- package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +6 -5
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -1
- package/dist/types/src/components/LayoutSettings.d.ts +1 -2
- package/dist/types/src/components/LayoutSettings.d.ts.map +1 -1
- package/dist/types/src/components/fragments.d.ts +2 -0
- package/dist/types/src/components/fragments.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useNode.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +5 -19
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -3
- package/dist/types/src/types.d.ts +117 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +3 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -0
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -0
- package/dist/types/src/util/set-active.d.ts +9 -0
- package/dist/types/src/util/set-active.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/package.json +32 -31
- package/src/DeckPlugin.ts +23 -59
- package/src/capabilities/{layout/app-graph-builder.ts → app-graph-builder.ts} +40 -28
- package/src/capabilities/capabilities.ts +5 -7
- package/src/capabilities/{navigation/check-app-scheme.ts → check-app-scheme.ts} +2 -2
- package/src/capabilities/index.ts +12 -3
- package/src/capabilities/intent-resolver.ts +368 -0
- package/src/capabilities/{layout/react-root.tsx → react-root.tsx} +8 -14
- package/src/capabilities/react-surface.tsx +31 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
- package/src/capabilities/state.ts +108 -0
- package/src/capabilities/tools.ts +66 -0
- package/src/capabilities/url-handler.ts +65 -0
- package/src/components/DeckLayout/ActiveNode.tsx +2 -3
- package/src/components/DeckLayout/ComplementarySidebar.tsx +185 -77
- package/src/components/DeckLayout/ContentEmpty.tsx +7 -10
- package/src/components/DeckLayout/DeckLayout.tsx +141 -84
- package/src/components/DeckLayout/Fullscreen.tsx +2 -3
- package/src/components/DeckLayout/NodePlankHeading.tsx +57 -65
- package/src/components/DeckLayout/Plank.tsx +33 -41
- package/src/components/DeckLayout/PlankControls.tsx +12 -11
- package/src/components/DeckLayout/PlankError.tsx +6 -5
- package/src/components/DeckLayout/Sidebar.tsx +17 -20
- package/src/components/DeckLayout/SidebarButton.tsx +25 -31
- package/src/components/DeckLayout/StatusBar.tsx +5 -11
- package/src/components/DeckLayout/Toast.tsx +2 -2
- package/src/components/LayoutSettings.tsx +8 -8
- package/src/components/fragments.ts +8 -0
- package/src/components/index.ts +0 -2
- package/src/events.ts +1 -0
- package/src/hooks/useMainSize.ts +3 -3
- package/src/hooks/useNode.ts +3 -1
- package/src/layout.ts +43 -212
- package/src/meta.ts +1 -0
- package/src/translations.ts +8 -8
- package/src/types.ts +103 -4
- package/src/util/index.ts +3 -1
- package/src/util/layoutAppliesTopbar.ts +7 -0
- package/src/util/set-active.ts +47 -0
- package/src/util/useHoistStatusbar.ts +13 -8
- package/dist/lib/browser/app-graph-builder-67VRUD5K.mjs.map +0 -7
- package/dist/lib/browser/chunk-2M4PXYNB.mjs +0 -1052
- package/dist/lib/browser/chunk-2M4PXYNB.mjs.map +0 -7
- package/dist/lib/browser/chunk-2PJNBVCY.mjs +0 -39
- package/dist/lib/browser/chunk-2PJNBVCY.mjs.map +0 -7
- package/dist/lib/browser/chunk-4C2AFTET.mjs +0 -186
- package/dist/lib/browser/chunk-4C2AFTET.mjs.map +0 -7
- package/dist/lib/browser/chunk-5VFDMW5M.mjs.map +0 -7
- package/dist/lib/browser/chunk-KY5WXIXY.mjs +0 -44
- package/dist/lib/browser/chunk-KY5WXIXY.mjs.map +0 -7
- package/dist/lib/browser/deck-PLCSKPGL.mjs +0 -26
- package/dist/lib/browser/deck-PLCSKPGL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs +0 -152
- package/dist/lib/browser/intent-resolver-FVOQSTBX.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs +0 -249
- package/dist/lib/browser/intent-resolver-K7GW4A2I.mjs.map +0 -7
- package/dist/lib/browser/location-QHRBQBQN.mjs +0 -35
- package/dist/lib/browser/location-QHRBQBQN.mjs.map +0 -7
- package/dist/lib/browser/react-context-3BDW7W2N.mjs +0 -32
- package/dist/lib/browser/react-context-3BDW7W2N.mjs.map +0 -7
- package/dist/lib/browser/react-root-UL7ZDRVZ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-VPNOGGNN.mjs +0 -28
- package/dist/lib/browser/react-surface-VPNOGGNN.mjs.map +0 -7
- package/dist/lib/browser/settings-FNWW6WIJ.mjs.map +0 -7
- package/dist/lib/browser/state-7I5BD7SE.mjs +0 -34
- package/dist/lib/browser/state-7I5BD7SE.mjs.map +0 -7
- package/dist/lib/browser/url-handler-Z5B7LD3N.mjs +0 -76
- package/dist/lib/browser/url-handler-Z5B7LD3N.mjs.map +0 -7
- package/dist/types/src/capabilities/layout/app-graph-builder.d.ts +0 -181
- package/dist/types/src/capabilities/layout/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/layout/deck.d.ts +0 -4
- package/dist/types/src/capabilities/layout/deck.d.ts.map +0 -1
- package/dist/types/src/capabilities/layout/index.d.ts +0 -229
- package/dist/types/src/capabilities/layout/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/layout/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/layout/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/layout/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/layout/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/layout/state.d.ts +0 -42
- package/dist/types/src/capabilities/layout/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation/index.d.ts +0 -5
- package/dist/types/src/capabilities/navigation/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/navigation/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation/location.d.ts +0 -4
- package/dist/types/src/capabilities/navigation/location.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation/set-location.d.ts +0 -10
- package/dist/types/src/capabilities/navigation/set-location.d.ts.map +0 -1
- package/dist/types/src/capabilities/navigation/url-handler.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/components/DeckContext.d.ts +0 -11
- package/dist/types/src/components/DeckContext.d.ts.map +0 -1
- package/dist/types/src/components/LayoutContext.d.ts +0 -5
- package/dist/types/src/components/LayoutContext.d.ts.map +0 -1
- package/dist/types/src/layout.test.d.ts +0 -2
- package/dist/types/src/layout.test.d.ts.map +0 -1
- package/dist/types/src/util/layout-parts.d.ts +0 -7
- package/dist/types/src/util/layout-parts.d.ts.map +0 -1
- package/src/capabilities/layout/deck.ts +0 -25
- package/src/capabilities/layout/index.ts +0 -12
- package/src/capabilities/layout/intent-resolver.ts +0 -128
- package/src/capabilities/layout/react-context.tsx +0 -26
- package/src/capabilities/layout/state.ts +0 -32
- package/src/capabilities/navigation/index.ts +0 -10
- package/src/capabilities/navigation/intent-resolver.ts +0 -216
- package/src/capabilities/navigation/location.ts +0 -28
- package/src/capabilities/navigation/set-location.ts +0 -38
- package/src/capabilities/navigation/url-handler.ts +0 -67
- package/src/capabilities/settings/index.ts +0 -8
- package/src/capabilities/settings/react-surface.tsx +0 -23
- package/src/components/DeckContext.ts +0 -19
- package/src/components/LayoutContext.ts +0 -12
- package/src/layout.test.ts +0 -380
- package/src/util/layout-parts.ts +0 -12
- /package/dist/types/src/capabilities/{navigation/check-app-scheme.d.ts → check-app-scheme.d.ts} +0 -0
- /package/dist/types/src/capabilities/{layout/intent-resolver.d.ts → intent-resolver.d.ts} +0 -0
- /package/dist/types/src/capabilities/{layout/react-root.d.ts → react-root.d.ts} +0 -0
- /package/dist/types/src/capabilities/{settings/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +0 -0
- /package/dist/types/src/capabilities/{navigation/url-handler.d.ts → url-handler.d.ts} +0 -0
|
@@ -1,21 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeckCapabilities
|
|
3
|
+
} from "./chunk-22AQ5IVX.mjs";
|
|
1
4
|
import {
|
|
2
5
|
DECK_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N7TEPFVR.mjs";
|
|
4
7
|
|
|
5
|
-
// packages/plugins/plugin-deck/src/capabilities/
|
|
6
|
-
import { Capabilities, contributes, createIntent, LayoutAction
|
|
8
|
+
// packages/plugins/plugin-deck/src/capabilities/app-graph-builder.ts
|
|
9
|
+
import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
|
|
7
10
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
8
11
|
import { createExtension, ROOT_ID } from "@dxos/plugin-graph";
|
|
9
12
|
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
10
13
|
id: DECK_PLUGIN,
|
|
11
14
|
filter: (node) => node.id === ROOT_ID,
|
|
12
15
|
actions: () => {
|
|
16
|
+
const state = context.requestCapability(DeckCapabilities.MutableDeckState);
|
|
13
17
|
const _fullscreen = {
|
|
14
|
-
id: `${LayoutAction.
|
|
18
|
+
id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,
|
|
15
19
|
data: async () => {
|
|
16
20
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
17
21
|
await dispatch(createIntent(LayoutAction.SetLayoutMode, {
|
|
18
|
-
|
|
22
|
+
part: "mode",
|
|
23
|
+
options: {
|
|
24
|
+
mode: "fullscreen"
|
|
25
|
+
}
|
|
19
26
|
}));
|
|
20
27
|
},
|
|
21
28
|
properties: {
|
|
@@ -33,17 +40,19 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
33
40
|
}
|
|
34
41
|
};
|
|
35
42
|
const closeCurrent = {
|
|
36
|
-
id: `${
|
|
43
|
+
id: `${LayoutAction.Close._tag}/current`,
|
|
37
44
|
data: async () => {
|
|
38
45
|
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
39
46
|
const attended = attention.current.at(-1);
|
|
40
47
|
if (attended) {
|
|
41
48
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
42
|
-
await dispatch(createIntent(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
await dispatch(createIntent(LayoutAction.Close, {
|
|
50
|
+
part: "main",
|
|
51
|
+
subject: [
|
|
52
|
+
attended
|
|
53
|
+
],
|
|
54
|
+
options: {
|
|
55
|
+
state: false
|
|
47
56
|
}
|
|
48
57
|
}));
|
|
49
58
|
}
|
|
@@ -59,18 +68,17 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
59
68
|
}
|
|
60
69
|
};
|
|
61
70
|
const closeOthers = {
|
|
62
|
-
id: `${
|
|
71
|
+
id: `${LayoutAction.Close._tag}/others`,
|
|
63
72
|
data: async () => {
|
|
64
73
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
65
|
-
const location = context.requestCapability(Capabilities.Location);
|
|
66
74
|
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
67
75
|
const attended = attention.current.at(-1);
|
|
68
|
-
const ids =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
76
|
+
const ids = state.deck.active.filter((id) => id !== attended) ?? [];
|
|
77
|
+
await dispatch(createIntent(LayoutAction.Close, {
|
|
78
|
+
part: "main",
|
|
79
|
+
subject: ids,
|
|
80
|
+
options: {
|
|
81
|
+
state: false
|
|
74
82
|
}
|
|
75
83
|
}));
|
|
76
84
|
},
|
|
@@ -85,15 +93,14 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
85
93
|
}
|
|
86
94
|
};
|
|
87
95
|
const closeAll = {
|
|
88
|
-
id: `${
|
|
96
|
+
id: `${LayoutAction.Close._tag}/all`,
|
|
89
97
|
data: async () => {
|
|
90
98
|
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
])
|
|
99
|
+
await dispatch(createIntent(LayoutAction.Close, {
|
|
100
|
+
part: "main",
|
|
101
|
+
subject: state.deck.active,
|
|
102
|
+
options: {
|
|
103
|
+
state: false
|
|
97
104
|
}
|
|
98
105
|
}));
|
|
99
106
|
},
|
|
@@ -107,15 +114,38 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
107
114
|
icon: "ph--x-circle--regular"
|
|
108
115
|
}
|
|
109
116
|
};
|
|
110
|
-
const
|
|
111
|
-
|
|
117
|
+
const toggleSidebar = {
|
|
118
|
+
id: `${LayoutAction.UpdateSidebar._tag}/nav`,
|
|
119
|
+
data: async () => {
|
|
120
|
+
state.sidebarState = state.sidebarState === "expanded" ? "collapsed" : "expanded";
|
|
121
|
+
},
|
|
122
|
+
properties: {
|
|
123
|
+
label: [
|
|
124
|
+
state.sidebarState === "expanded" ? "collapse navigation sidebar label" : "open navigation sidebar label",
|
|
125
|
+
{
|
|
126
|
+
ns: DECK_PLUGIN
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
icon: "ph--sidebar--regular",
|
|
130
|
+
keyBinding: {
|
|
131
|
+
macos: "meta+b"
|
|
132
|
+
},
|
|
133
|
+
disposition: "pin-end",
|
|
134
|
+
position: "hoist",
|
|
135
|
+
l0Breakpoint: "lg"
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
return !state.deck.solo ? [
|
|
112
139
|
closeCurrent,
|
|
113
140
|
closeOthers,
|
|
114
|
-
closeAll
|
|
115
|
-
|
|
141
|
+
closeAll,
|
|
142
|
+
toggleSidebar
|
|
143
|
+
] : [
|
|
144
|
+
toggleSidebar
|
|
145
|
+
];
|
|
116
146
|
}
|
|
117
147
|
}));
|
|
118
148
|
export {
|
|
119
149
|
app_graph_builder_default as default
|
|
120
150
|
};
|
|
121
|
-
//# sourceMappingURL=app-graph-builder-
|
|
151
|
+
//# sourceMappingURL=app-graph-builder-IYHAGFA3.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n filter: (node): node is Node<null> => node.id === ROOT_ID,\n actions: () => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }));\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: [attended], options: { state: false } }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }));\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n state.sidebarState === 'expanded' ? 'collapse navigation sidebar label' : 'open navigation sidebar label',\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: 'meta+b',\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar];\n },\n }),\n );\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "filter", "node", "ROOT_ID", "actions", "state", "requestCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "disposition", "position", "l0Breakpoint", "solo"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DECK_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N7TEPFVR.mjs";
|
|
4
4
|
|
|
5
|
-
// packages/plugins/plugin-deck/src/capabilities/
|
|
5
|
+
// packages/plugins/plugin-deck/src/capabilities/check-app-scheme.ts
|
|
6
6
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
7
7
|
var isSocket = !!globalThis.__args;
|
|
8
8
|
var appScheme = "composer://";
|
|
@@ -30,4 +30,4 @@ var check_app_scheme_default = async (context) => {
|
|
|
30
30
|
export {
|
|
31
31
|
check_app_scheme_default as default
|
|
32
32
|
};
|
|
33
|
-
//# sourceMappingURL=check-app-scheme-
|
|
33
|
+
//# sourceMappingURL=check-app-scheme-S3EYUPMF.mjs.map
|
package/dist/lib/browser/{check-app-scheme-GEX6W2R5.mjs.map → check-app-scheme-S3EYUPMF.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '
|
|
3
|
+
"sources": ["../../../src/capabilities/check-app-scheme.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginsContext) => {\n const settingsStore = context.requestCapability(Capabilities.SettingsStore);\n const settings = settingsStore.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
|
|
5
5
|
"mappings": ";;;;;AAOA,SAASA,cAAcC,mBAAwC;AAK/D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,gBAAgBD,QAAQE,kBAAkBC,aAAaC,aAAa;AAC1E,QAAMC,WAAWJ,cAAcK,SAA4BC,WAAAA,GAAcC;AACzE,MAAI,CAACjC,YAAY8B,UAAUI,sBAAsB;AAC/C9B,mBAAeD,SAAAA;EACjB;AAEA,SAAOgC,YAAYP,aAAaQ,MAAM,IAAA;AACxC;",
|
|
6
6
|
"names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settingsStore", "requestCapability", "Capabilities", "SettingsStore", "settings", "getStore", "DECK_PLUGIN", "value", "enableNativeRedirect", "contributes", "Null"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DECK_PLUGIN
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N7TEPFVR.mjs";
|
|
4
4
|
|
|
5
5
|
// packages/plugins/plugin-deck/src/capabilities/capabilities.ts
|
|
6
6
|
import { defineCapability } from "@dxos/app-framework";
|
|
@@ -14,4 +14,4 @@ var DeckCapabilities;
|
|
|
14
14
|
export {
|
|
15
15
|
DeckCapabilities
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-22AQ5IVX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckState, type Panel } from '../types';\n\nexport namespace DeckCapabilities {\n export const DeckState = defineCapability<DeepReadonly<DeckState>>(`${DECK_PLUGIN}/capability/state`);\n export const MutableDeckState = defineCapability<DeckState>(`${DECK_PLUGIN}/capability/state`);\n export const ComplementaryPanel = defineCapability<Panel>(`${DECK_PLUGIN}/capability/complementary-panel`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAMhBC,mBAAAA;oBACFC,YAAYC,iBAA0C,GAAGC,WAAAA,mBAA8B;oBACvFC,mBAAmBF,iBAA4B,GAAGC,WAAAA,mBAA8B;oBAChFE,qBAAqBH,iBAAwB,GAAGC,WAAAA,iCAA4C;AAC3G,GAJiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["defineCapability", "DeckCapabilities", "DeckState", "defineCapability", "DECK_PLUGIN", "MutableDeckState", "ComplementaryPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DECK_PLUGIN
|
|
3
|
+
} from "./chunk-N7TEPFVR.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-deck/src/types.ts
|
|
6
|
+
import { LayoutAction } from "@dxos/app-framework";
|
|
7
|
+
import { S } from "@dxos/echo-schema";
|
|
8
|
+
var NewPlankPositions = [
|
|
9
|
+
"start",
|
|
10
|
+
"end"
|
|
11
|
+
];
|
|
12
|
+
var OverscrollOptions = [
|
|
13
|
+
"none",
|
|
14
|
+
"centering"
|
|
15
|
+
];
|
|
16
|
+
var DeckSettingsSchema = S.mutable(S.Struct({
|
|
17
|
+
showHints: S.Boolean,
|
|
18
|
+
enableNativeRedirect: S.Boolean,
|
|
19
|
+
enableIdeStyleStatusbar: S.Boolean,
|
|
20
|
+
newPlankPositioning: S.Literal(...NewPlankPositions),
|
|
21
|
+
overscroll: S.Literal(...OverscrollOptions)
|
|
22
|
+
}));
|
|
23
|
+
var LayoutMode = S.Union(S.Literal("deck"), S.Literal("solo"), S.Literal("fullscreen"));
|
|
24
|
+
var isLayoutMode = (value) => S.is(LayoutMode)(value);
|
|
25
|
+
var PlankSizing = S.Record({
|
|
26
|
+
key: S.String,
|
|
27
|
+
value: S.Number
|
|
28
|
+
});
|
|
29
|
+
var Deck = S.Struct({
|
|
30
|
+
initialized: S.Boolean.annotations({
|
|
31
|
+
description: "If false, the deck has not yet left solo mode and new planks should be solo'd."
|
|
32
|
+
}),
|
|
33
|
+
active: S.mutable(S.Array(S.String)),
|
|
34
|
+
inactive: S.mutable(S.Array(S.String)),
|
|
35
|
+
solo: S.optional(S.String),
|
|
36
|
+
fullscreen: S.Boolean,
|
|
37
|
+
plankSizing: S.mutable(PlankSizing)
|
|
38
|
+
});
|
|
39
|
+
var DeckState = S.mutable(S.Struct({
|
|
40
|
+
sidebarState: S.Literal("closed", "collapsed", "expanded"),
|
|
41
|
+
complementarySidebarState: S.Literal("closed", "collapsed", "expanded"),
|
|
42
|
+
complementarySidebarPanel: S.optional(S.String),
|
|
43
|
+
dialogOpen: S.Boolean,
|
|
44
|
+
/**
|
|
45
|
+
* Data to be passed to the dialog Surface.
|
|
46
|
+
*/
|
|
47
|
+
dialogContent: S.optional(S.Any),
|
|
48
|
+
dialogBlockAlign: S.optional(S.Literal("start", "center", "end")),
|
|
49
|
+
dialogType: S.optional(S.Literal("default", "alert")),
|
|
50
|
+
popoverOpen: S.Boolean,
|
|
51
|
+
popoverSide: S.optional(S.Literal("top", "right", "bottom", "left")),
|
|
52
|
+
/**
|
|
53
|
+
* Data to be passed to the popover Surface.
|
|
54
|
+
*/
|
|
55
|
+
popoverContent: S.optional(S.Any),
|
|
56
|
+
popoverAnchorId: S.optional(S.String),
|
|
57
|
+
toasts: S.mutable(S.Array(LayoutAction.Toast)),
|
|
58
|
+
currentUndoId: S.optional(S.String),
|
|
59
|
+
activeDeck: S.String,
|
|
60
|
+
previousDeck: S.String,
|
|
61
|
+
decks: S.mutable(S.Record({
|
|
62
|
+
key: S.String,
|
|
63
|
+
value: S.mutable(Deck)
|
|
64
|
+
})),
|
|
65
|
+
previousMode: S.mutable(S.Record({
|
|
66
|
+
key: S.String,
|
|
67
|
+
value: LayoutMode
|
|
68
|
+
})),
|
|
69
|
+
deck: S.mutable(Deck),
|
|
70
|
+
/**
|
|
71
|
+
* The identifier of a component to scroll into view when it is mounted.
|
|
72
|
+
*/
|
|
73
|
+
scrollIntoView: S.optional(S.String)
|
|
74
|
+
}));
|
|
75
|
+
var getMode = (deck) => {
|
|
76
|
+
if (deck.solo) {
|
|
77
|
+
return deck.fullscreen ? "fullscreen" : "solo";
|
|
78
|
+
}
|
|
79
|
+
return "deck";
|
|
80
|
+
};
|
|
81
|
+
var SLUG_PATH_SEPARATOR = "~";
|
|
82
|
+
var DECK_ACTION = `${DECK_PLUGIN}/action`;
|
|
83
|
+
var DeckAction;
|
|
84
|
+
(function(DeckAction2) {
|
|
85
|
+
const PartAdjustmentSchema = S.Union(S.Literal("close").annotations({
|
|
86
|
+
description: "Close the plank."
|
|
87
|
+
}), S.Literal("solo").annotations({
|
|
88
|
+
description: "Solo the plank."
|
|
89
|
+
}), S.Literal("increment-start").annotations({
|
|
90
|
+
description: "Move the plank towards the start of the deck."
|
|
91
|
+
}), S.Literal("increment-end").annotations({
|
|
92
|
+
description: "Move the plank towards the end of the deck."
|
|
93
|
+
}));
|
|
94
|
+
DeckAction2.Adjustment = S.mutable(S.Struct({
|
|
95
|
+
id: S.String,
|
|
96
|
+
type: PartAdjustmentSchema
|
|
97
|
+
}));
|
|
98
|
+
class Adjust extends S.TaggedClass()(`${DECK_ACTION}/adjust`, {
|
|
99
|
+
input: DeckAction2.Adjustment,
|
|
100
|
+
output: S.Void
|
|
101
|
+
}) {
|
|
102
|
+
}
|
|
103
|
+
DeckAction2.Adjust = Adjust;
|
|
104
|
+
class UpdatePlankSize extends S.TaggedClass()(`${DECK_ACTION}/update-plank-size`, {
|
|
105
|
+
input: S.Struct({
|
|
106
|
+
id: S.String,
|
|
107
|
+
size: S.Number
|
|
108
|
+
}),
|
|
109
|
+
output: S.Void
|
|
110
|
+
}) {
|
|
111
|
+
}
|
|
112
|
+
DeckAction2.UpdatePlankSize = UpdatePlankSize;
|
|
113
|
+
})(DeckAction || (DeckAction = {}));
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
NewPlankPositions,
|
|
117
|
+
OverscrollOptions,
|
|
118
|
+
DeckSettingsSchema,
|
|
119
|
+
isLayoutMode,
|
|
120
|
+
PlankSizing,
|
|
121
|
+
Deck,
|
|
122
|
+
DeckState,
|
|
123
|
+
getMode,
|
|
124
|
+
SLUG_PATH_SEPARATOR,
|
|
125
|
+
DECK_ACTION,
|
|
126
|
+
DeckAction
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=chunk-FT33W5CI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { LayoutAction } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type Node } from '@dxos/plugin-graph';\nimport { type Label } from '@dxos/react-ui';\nimport { type Position } from '@dxos/util';\n\nimport { DECK_PLUGIN } from './meta';\n\n// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.\nexport const NewPlankPositions = ['start', 'end'] as const;\nexport type NewPlankPositioning = (typeof NewPlankPositions)[number];\n\nexport const OverscrollOptions = ['none', 'centering'] as const;\nexport type Overscroll = (typeof OverscrollOptions)[number];\n\nexport type Panel = {\n id: string;\n label: Label;\n icon: string;\n position?: Position;\n /**\n * If true, the panel will now be wrapped in a scroll area.\n */\n fixed?: boolean;\n filter?: (node: Node) => boolean;\n};\n\nexport const DeckSettingsSchema = S.mutable(\n S.Struct({\n showHints: S.Boolean,\n enableNativeRedirect: S.Boolean,\n enableIdeStyleStatusbar: S.Boolean,\n newPlankPositioning: S.Literal(...NewPlankPositions),\n overscroll: S.Literal(...OverscrollOptions),\n }),\n);\n\nexport type DeckSettingsProps = S.Schema.Type<typeof DeckSettingsSchema>;\n\nconst LayoutMode = S.Union(S.Literal('deck'), S.Literal('solo'), S.Literal('fullscreen'));\nexport const isLayoutMode = (value: any): value is LayoutMode => S.is(LayoutMode)(value);\nexport type LayoutMode = S.Schema.Type<typeof LayoutMode>;\n\nexport const PlankSizing = S.Record({ key: S.String, value: S.Number });\nexport type PlankSizing = S.Schema.Type<typeof PlankSizing>;\n\nexport const Deck = S.Struct({\n initialized: S.Boolean.annotations({\n description: \"If false, the deck has not yet left solo mode and new planks should be solo'd.\",\n }),\n active: S.mutable(S.Array(S.String)),\n inactive: S.mutable(S.Array(S.String)),\n solo: S.optional(S.String),\n fullscreen: S.Boolean,\n plankSizing: S.mutable(PlankSizing),\n});\nexport type Deck = S.Schema.Type<typeof Deck>;\n\nexport const DeckState = S.mutable(\n S.Struct({\n sidebarState: S.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarState: S.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarPanel: S.optional(S.String),\n\n dialogOpen: S.Boolean,\n /**\n * Data to be passed to the dialog Surface.\n */\n dialogContent: S.optional(S.Any),\n dialogBlockAlign: S.optional(S.Literal('start', 'center', 'end')),\n dialogType: S.optional(S.Literal('default', 'alert')),\n\n popoverOpen: S.Boolean,\n popoverSide: S.optional(S.Literal('top', 'right', 'bottom', 'left')),\n /**\n * Data to be passed to the popover Surface.\n */\n popoverContent: S.optional(S.Any),\n popoverAnchorId: S.optional(S.String),\n\n toasts: S.mutable(S.Array(LayoutAction.Toast)),\n currentUndoId: S.optional(S.String),\n\n activeDeck: S.String,\n previousDeck: S.String,\n decks: S.mutable(S.Record({ key: S.String, value: S.mutable(Deck) })),\n previousMode: S.mutable(S.Record({ key: S.String, value: LayoutMode })),\n deck: S.mutable(Deck),\n\n /**\n * The identifier of a component to scroll into view when it is mounted.\n */\n scrollIntoView: S.optional(S.String),\n }),\n);\n\nexport type DeckState = S.Schema.Type<typeof DeckState>;\n\nexport const getMode = (deck: Deck): LayoutMode => {\n if (deck.solo) {\n return deck.fullscreen ? 'fullscreen' : 'solo';\n }\n\n return 'deck';\n};\n\n// NOTE: Chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const SLUG_PATH_SEPARATOR = '~';\n\nexport const DECK_ACTION = `${DECK_PLUGIN}/action`;\n\nexport namespace DeckAction {\n const PartAdjustmentSchema = S.Union(\n S.Literal('close').annotations({ description: 'Close the plank.' }),\n S.Literal('solo').annotations({ description: 'Solo the plank.' }),\n S.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n S.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n );\n export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;\n export const Adjustment = S.mutable(S.Struct({ id: S.String, type: PartAdjustmentSchema }));\n export type Adjustment = S.Schema.Type<typeof Adjustment>;\n\n /**\n * An atomic transaction to apply to the deck, describing which element to move to which location.\n */\n export class Adjust extends S.TaggedClass<Adjust>()(`${DECK_ACTION}/adjust`, {\n input: Adjustment,\n output: S.Void,\n }) {}\n\n export class UpdatePlankSize extends S.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {\n input: S.Struct({\n id: S.String,\n size: S.Number,\n }),\n output: S.Void,\n }) {}\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["LayoutAction", "S", "NewPlankPositions", "OverscrollOptions", "DeckSettingsSchema", "S", "mutable", "Struct", "showHints", "Boolean", "enableNativeRedirect", "enableIdeStyleStatusbar", "newPlankPositioning", "Literal", "overscroll", "LayoutMode", "Union", "isLayoutMode", "value", "is", "PlankSizing", "Record", "key", "String", "Number", "Deck", "initialized", "annotations", "description", "active", "Array", "inactive", "solo", "optional", "fullscreen", "plankSizing", "DeckState", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "dialogOpen", "dialogContent", "Any", "dialogBlockAlign", "dialogType", "popoverOpen", "popoverSide", "popoverContent", "popoverAnchorId", "toasts", "LayoutAction", "Toast", "currentUndoId", "activeDeck", "previousDeck", "decks", "previousMode", "deck", "scrollIntoView", "getMode", "SLUG_PATH_SEPARATOR", "DECK_ACTION", "DECK_PLUGIN", "DeckAction", "PartAdjustmentSchema", "Adjustment", "id", "type", "Adjust", "TaggedClass", "input", "output", "Void", "UpdatePlankSize", "size"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// packages/plugins/plugin-deck/src/capabilities/index.ts
|
|
2
|
+
import { lazy } from "@dxos/app-framework";
|
|
3
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-IYHAGFA3.mjs"));
|
|
4
|
+
var CheckAppScheme = lazy(() => import("./check-app-scheme-S3EYUPMF.mjs"));
|
|
5
|
+
var LayoutIntentResolver = lazy(() => import("./intent-resolver-ZD67BRUI.mjs"));
|
|
6
|
+
var ReactRoot = lazy(() => import("./react-root-6ILKHD5J.mjs"));
|
|
7
|
+
var ReactSurface = lazy(() => import("./react-surface-O75FKXAI.mjs"));
|
|
8
|
+
var DeckSettings = lazy(() => import("./settings-H35U6NHE.mjs"));
|
|
9
|
+
var DeckState = lazy(() => import("./state-U4SHOPJW.mjs"));
|
|
10
|
+
var Tools = lazy(() => import("./tools-64LXGLYR.mjs"));
|
|
11
|
+
var UrlHandler = lazy(() => import("./url-handler-MVHTKUYA.mjs"));
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
AppGraphBuilder,
|
|
15
|
+
CheckAppScheme,
|
|
16
|
+
LayoutIntentResolver,
|
|
17
|
+
ReactRoot,
|
|
18
|
+
ReactSurface,
|
|
19
|
+
DeckSettings,
|
|
20
|
+
DeckState,
|
|
21
|
+
Tools,
|
|
22
|
+
UrlHandler
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-G2X3ZDCE.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const CheckAppScheme = lazy(() => import('./check-app-scheme'));\nexport const LayoutIntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const DeckSettings = lazy(() => import('./settings'));\nexport const DeckState = lazy(() => import('./state'));\nexport const Tools = lazy(() => import('./tools'));\nexport const UrlHandler = lazy(() => import('./url-handler'));\n\nexport * from './capabilities';\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,iCAAA,CAAA;AACzC,IAAME,uBAAuBF,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC/C,IAAMG,YAAYH,KAAK,MAAM,OAAO,2BAAA,CAAA;AACpC,IAAMI,eAAeJ,KAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAMK,eAAeL,KAAK,MAAM,OAAO,yBAAA,CAAA;AACvC,IAAMM,YAAYN,KAAK,MAAM,OAAO,sBAAA,CAAA;AACpC,IAAMO,QAAQP,KAAK,MAAM,OAAO,sBAAA,CAAA;AAChC,IAAMQ,aAAaR,KAAK,MAAM,OAAO,4BAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "AppGraphBuilder", "lazy", "CheckAppScheme", "LayoutIntentResolver", "ReactRoot", "ReactSurface", "DeckSettings", "DeckState", "Tools", "UrlHandler"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DECK_PLUGIN
|
|
3
|
+
} from "./chunk-N7TEPFVR.mjs";
|
|
4
|
+
|
|
5
|
+
// packages/plugins/plugin-deck/src/util/set-active.ts
|
|
6
|
+
import { batch } from "@preact/signals-core";
|
|
7
|
+
var setActive = ({ next, state, attention }) => {
|
|
8
|
+
return batch(() => {
|
|
9
|
+
const active = state.deck.solo ? [
|
|
10
|
+
state.deck.solo
|
|
11
|
+
] : state.deck.active;
|
|
12
|
+
const removed = active.filter((id) => !next.includes(id));
|
|
13
|
+
const closed = Array.from(/* @__PURE__ */ new Set([
|
|
14
|
+
...state.deck.inactive.filter((id) => !next.includes(id)),
|
|
15
|
+
...removed
|
|
16
|
+
]));
|
|
17
|
+
state.deck.inactive = closed;
|
|
18
|
+
if (state.deck.solo || !state.deck.initialized) {
|
|
19
|
+
state.deck.solo = next[0];
|
|
20
|
+
} else {
|
|
21
|
+
state.deck.active = next;
|
|
22
|
+
}
|
|
23
|
+
if (state.deck.fullscreen && !state.deck.solo) {
|
|
24
|
+
state.deck.fullscreen = false;
|
|
25
|
+
}
|
|
26
|
+
if (attention) {
|
|
27
|
+
const attended = attention.current;
|
|
28
|
+
const [attendedId] = Array.from(attended);
|
|
29
|
+
const isAttendedAvailable = !!attendedId && next.includes(attendedId);
|
|
30
|
+
if (!isAttendedAvailable) {
|
|
31
|
+
const attendedIndex = active.indexOf(attendedId);
|
|
32
|
+
const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;
|
|
33
|
+
return next[index];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// packages/plugins/plugin-deck/src/util/overscroll.ts
|
|
40
|
+
var calculateOverscroll = (planksCount) => {
|
|
41
|
+
if (!planksCount) {
|
|
42
|
+
return {
|
|
43
|
+
paddingInlineStart: 0,
|
|
44
|
+
paddingInlineEnd: 0
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
if (planksCount === 1) {
|
|
48
|
+
const overscrollPadding = "max(0px, calc(((100dvw - var(--dx-main-sidebarWidth) - var(--dx-main-complementaryWidth) - (var(--dx-main-contentFirstWidth) + 1px)) / 2)))";
|
|
49
|
+
return {
|
|
50
|
+
paddingInlineStart: overscrollPadding,
|
|
51
|
+
paddingInlineEnd: overscrollPadding
|
|
52
|
+
};
|
|
53
|
+
} else {
|
|
54
|
+
return {
|
|
55
|
+
paddingInlineStart: "max(0px, calc(((100dvw - (var(--dx-main-contentFirstWidth) + 1px)) / 2) - var(--dx-main-sidebarWidth)))",
|
|
56
|
+
paddingInlineEnd: "max(0px, calc(((100dvw - (var(--dx-main-contentLastWidth) + 1px)) / 2) - var(--dx-main-complementaryWidth)))"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// packages/plugins/plugin-deck/src/util/useBreakpoints.ts
|
|
62
|
+
import { useMediaQuery } from "@dxos/react-ui";
|
|
63
|
+
var useBreakpoints = () => {
|
|
64
|
+
const [isNotMobile] = useMediaQuery("md");
|
|
65
|
+
const [isDesktop] = useMediaQuery("lg");
|
|
66
|
+
return isDesktop ? "desktop" : isNotMobile ? "tablet" : "mobile";
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// packages/plugins/plugin-deck/src/util/layoutAppliesTopbar.ts
|
|
70
|
+
var layoutAppliesTopbar = (breakpoint) => {
|
|
71
|
+
return document.body.getAttribute("data-platform") === "win" && breakpoint === "desktop";
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
// packages/plugins/plugin-deck/src/util/useHoistStatusbar.ts
|
|
75
|
+
import { useMemo } from "react";
|
|
76
|
+
import { Capabilities, useCapability } from "@dxos/app-framework";
|
|
77
|
+
import { useThemeContext } from "@dxos/react-ui";
|
|
78
|
+
var useHoistStatusbar = (breakpoint) => {
|
|
79
|
+
const enableIdeStyleStatusbar = useCapability(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value.enableIdeStyleStatusbar;
|
|
80
|
+
const { safeAreaPadding } = useThemeContext();
|
|
81
|
+
return useMemo(() => {
|
|
82
|
+
return breakpoint === "desktop" && enableIdeStyleStatusbar && safeAreaPadding?.bottom === 0;
|
|
83
|
+
}, [
|
|
84
|
+
enableIdeStyleStatusbar,
|
|
85
|
+
breakpoint,
|
|
86
|
+
safeAreaPadding?.bottom
|
|
87
|
+
]);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export {
|
|
91
|
+
calculateOverscroll,
|
|
92
|
+
setActive,
|
|
93
|
+
useBreakpoints,
|
|
94
|
+
layoutAppliesTopbar,
|
|
95
|
+
useHoistStatusbar
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=chunk-KANJBSIX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/util/set-active.ts", "../../../src/util/overscroll.ts", "../../../src/util/useBreakpoints.ts", "../../../src/util/layoutAppliesTopbar.ts", "../../../src/util/useHoistStatusbar.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { batch } from '@preact/signals-core';\n\nimport { type AttentionManager } from '@dxos/plugin-attention';\n\nimport { type DeckState } from '../types';\n\nexport type SetActiveOptions = {\n next: string[];\n state: DeckState;\n attention?: AttentionManager;\n};\n\nexport const setActive = ({ next, state, attention }: SetActiveOptions) => {\n return batch(() => {\n const active = state.deck.solo ? [state.deck.solo] : state.deck.active;\n const removed = active.filter((id) => !next.includes(id));\n const closed = Array.from(new Set([...state.deck.inactive.filter((id) => !next.includes(id)), ...removed]));\n\n state.deck.inactive = closed;\n\n if (state.deck.solo || !state.deck.initialized) {\n state.deck.solo = next[0];\n } else {\n state.deck.active = next;\n }\n\n if (state.deck.fullscreen && !state.deck.solo) {\n state.deck.fullscreen = false;\n }\n\n if (attention) {\n const attended = attention.current;\n const [attendedId] = Array.from(attended);\n const isAttendedAvailable = !!attendedId && next.includes(attendedId);\n if (!isAttendedAvailable) {\n const attendedIndex = active.indexOf(attendedId);\n // If outside of bounds, focus on the first/last plank, otherwise focus on the new plank in the same position.\n const index = attendedIndex === -1 ? 0 : attendedIndex >= next.length ? next.length - 1 : attendedIndex;\n return next[index];\n }\n }\n });\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type { CSSProperties } from 'react';\n\n/**\n * ┌────────────────────────────────────────────────────────────────────────────────────────────────────┐\n * | Overscroll Padding Calculation for Centering Planks on Screen. │\n * ├────────────────────────────────────────────────────────────────────────────────────────────────────┤\n * │ NOTE(Zan): I found the way you calculate the overscroll padding to center a plank on the screen │\n * │ at the edges of the scroll context a bit confusing, so I've diagrammed it here. │\n * │ │\n * │ Multiple Planks: │\n * │ ─────────────── │\n * | Use the following overscroll padding calculation centering the boundary planks on the SCREEN. │\n * │ │\n * │ Left Padding: Right Padding: │\n * │ ┌───┬────┬──────────────────┬──────┐ ┌──────┬──────────────────┬────┬───┐ │\n * │ │ │████│ Ideal │ │ │ │ Ideal │████│ │ │\n * │ │ S │█PL█│ first │ │ │ │ last │█PR█│ C │ │\n * │ │ │████│ plank │ │ │ │ plank │████│ │ │\n * │ └───┴────┴──────────────────┴──────┘ └──────┴──────────────────┴────┴───┘ │\n * │ <--------- screen width -----------> <---------- screen width ----------> │\n * │ │\n * │ PL = ((screen width - Plank Width) / 2) - S │\n * │ PR = ((screen width - Plank Width) / 2) - C │\n * │ │\n * │ S = Sidebar width C = Complementary sidebar width │\n * │ PL = Padding Left PR = Padding Right │\n * │ │\n * │ Single Plank: │\n * │ ───────────── │\n * │ For a single plank we use the following overscroll padding calculation to center the plank in │\n * │ the content area: │\n * │ │\n * │ ┌───┬───────────────────────┬───┬───────────────────────┬───┐ │\n * │ │ │███████████████████████│ │███████████████████████│ │ │\n * │ │ S │█████ Left Padding ████│ P │████ Right Padding ████│ C │ │\n * │ │ │███████████████████████│ │███████████████████████│ │ │\n * │ └───┴───────────────────────┴───┴───────────────────────┴───┘ │\n * │ <------------------------ screen width ---------------------> │\n * │ │\n * │ Left/Right Padding Width = (screen width - S - P - C) / 2 │\n * │ │\n * │ S = Sidebar width (may be 0) │\n * │ P = Plank width (centered) │\n * │ C = Complementary sidebar width (may be 0) │\n * └────────────────────────────────────────────────────────────────────────────────────────────────────┘\n */\nexport const calculateOverscroll = (\n planksCount: number,\n): Pick<CSSProperties, 'paddingInlineStart' | 'paddingInlineEnd'> | undefined => {\n if (!planksCount) {\n return { paddingInlineStart: 0, paddingInlineEnd: 0 };\n }\n if (planksCount === 1) {\n const overscrollPadding =\n 'max(0px, calc(((100dvw - var(--dx-main-sidebarWidth) - var(--dx-main-complementaryWidth) - (var(--dx-main-contentFirstWidth) + 1px)) / 2)))';\n return { paddingInlineStart: overscrollPadding, paddingInlineEnd: overscrollPadding };\n } else {\n return {\n paddingInlineStart:\n 'max(0px, calc(((100dvw - (var(--dx-main-contentFirstWidth) + 1px)) / 2) - var(--dx-main-sidebarWidth)))',\n paddingInlineEnd:\n 'max(0px, calc(((100dvw - (var(--dx-main-contentLastWidth) + 1px)) / 2) - var(--dx-main-complementaryWidth)))',\n };\n }\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMediaQuery } from '@dxos/react-ui';\n\nexport const useBreakpoints = () => {\n const [isNotMobile] = useMediaQuery('md');\n const [isDesktop] = useMediaQuery('lg');\n return isDesktop ? 'desktop' : isNotMobile ? 'tablet' : 'mobile';\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport const layoutAppliesTopbar = (breakpoint: string) => {\n return document.body.getAttribute('data-platform') === 'win' && breakpoint === 'desktop';\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { Capabilities, useCapability } from '@dxos/app-framework';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { DECK_PLUGIN } from '../meta';\nimport type { DeckSettingsProps } from '../types';\n\nexport const useHoistStatusbar = (breakpoint: string) => {\n const enableIdeStyleStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!\n .value.enableIdeStyleStatusbar;\n const { safeAreaPadding } = useThemeContext();\n return useMemo(() => {\n return breakpoint === 'desktop' && enableIdeStyleStatusbar && safeAreaPadding?.bottom === 0;\n }, [enableIdeStyleStatusbar, breakpoint, safeAreaPadding?.bottom]);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,aAAa;AAYf,IAAMC,YAAY,CAAC,EAAEC,MAAMC,OAAOC,UAAS,MAAoB;AACpE,SAAOC,MAAM,MAAA;AACX,UAAMC,SAASH,MAAMI,KAAKC,OAAO;MAACL,MAAMI,KAAKC;QAAQL,MAAMI,KAAKD;AAChE,UAAMG,UAAUH,OAAOI,OAAO,CAACC,OAAO,CAACT,KAAKU,SAASD,EAAAA,CAAAA;AACrD,UAAME,SAASC,MAAMC,KAAK,oBAAIC,IAAI;SAAIb,MAAMI,KAAKU,SAASP,OAAO,CAACC,OAAO,CAACT,KAAKU,SAASD,EAAAA,CAAAA;SAASF;KAAQ,CAAA;AAEzGN,UAAMI,KAAKU,WAAWJ;AAEtB,QAAIV,MAAMI,KAAKC,QAAQ,CAACL,MAAMI,KAAKW,aAAa;AAC9Cf,YAAMI,KAAKC,OAAON,KAAK,CAAA;IACzB,OAAO;AACLC,YAAMI,KAAKD,SAASJ;IACtB;AAEA,QAAIC,MAAMI,KAAKY,cAAc,CAAChB,MAAMI,KAAKC,MAAM;AAC7CL,YAAMI,KAAKY,aAAa;IAC1B;AAEA,QAAIf,WAAW;AACb,YAAMgB,WAAWhB,UAAUiB;AAC3B,YAAM,CAACC,UAAAA,IAAcR,MAAMC,KAAKK,QAAAA;AAChC,YAAMG,sBAAsB,CAAC,CAACD,cAAcpB,KAAKU,SAASU,UAAAA;AAC1D,UAAI,CAACC,qBAAqB;AACxB,cAAMC,gBAAgBlB,OAAOmB,QAAQH,UAAAA;AAErC,cAAMI,QAAQF,kBAAkB,KAAK,IAAIA,iBAAiBtB,KAAKyB,SAASzB,KAAKyB,SAAS,IAAIH;AAC1F,eAAOtB,KAAKwB,KAAAA;MACd;IACF;EACF,CAAA;AACF;;;ACIO,IAAME,sBAAsB,CACjCC,gBAAAA;AAEA,MAAI,CAACA,aAAa;AAChB,WAAO;MAAEC,oBAAoB;MAAGC,kBAAkB;IAAE;EACtD;AACA,MAAIF,gBAAgB,GAAG;AACrB,UAAMG,oBACJ;AACF,WAAO;MAAEF,oBAAoBE;MAAmBD,kBAAkBC;IAAkB;EACtF,OAAO;AACL,WAAO;MACLF,oBACE;MACFC,kBACE;IACJ;EACF;AACF;;;AChEA,SAASE,qBAAqB;AAEvB,IAAMC,iBAAiB,MAAA;AAC5B,QAAM,CAACC,WAAAA,IAAeC,cAAc,IAAA;AACpC,QAAM,CAACC,SAAAA,IAAaD,cAAc,IAAA;AAClC,SAAOC,YAAY,YAAYF,cAAc,WAAW;AAC1D;;;ACNO,IAAMG,sBAAsB,CAACC,eAAAA;AAClC,SAAOC,SAASC,KAAKC,aAAa,eAAA,MAAqB,SAASH,eAAe;AACjF;;;ACFA,SAASI,eAAe;AAExB,SAASC,cAAcC,qBAAqB;AAC5C,SAASC,uBAAuB;AAKzB,IAAMC,oBAAoB,CAACC,eAAAA;AAChC,QAAMC,0BAA0BC,cAAcC,aAAaC,aAAa,EAAEC,SAA4BC,WAAAA,EACnGC,MAAMN;AACT,QAAM,EAAEO,gBAAe,IAAKC,gBAAAA;AAC5B,SAAOC,QAAQ,MAAA;AACb,WAAOV,eAAe,aAAaC,2BAA2BO,iBAAiBG,WAAW;EAC5F,GAAG;IAACV;IAAyBD;IAAYQ,iBAAiBG;GAAO;AACnE;",
|
|
6
|
+
"names": ["batch", "setActive", "next", "state", "attention", "batch", "active", "deck", "solo", "removed", "filter", "id", "includes", "closed", "Array", "from", "Set", "inactive", "initialized", "fullscreen", "attended", "current", "attendedId", "isAttendedAvailable", "attendedIndex", "indexOf", "index", "length", "calculateOverscroll", "planksCount", "paddingInlineStart", "paddingInlineEnd", "overscrollPadding", "useMediaQuery", "useBreakpoints", "isNotMobile", "useMediaQuery", "isDesktop", "layoutAppliesTopbar", "breakpoint", "document", "body", "getAttribute", "useMemo", "Capabilities", "useCapability", "useThemeContext", "useHoistStatusbar", "breakpoint", "enableIdeStyleStatusbar", "useCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "safeAreaPadding", "useThemeContext", "useMemo", "bottom"]
|
|
7
|
+
}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
var DECK_PLUGIN = "dxos.org/plugin/deck";
|
|
3
3
|
var meta = {
|
|
4
4
|
id: DECK_PLUGIN,
|
|
5
|
-
name: "Deck"
|
|
5
|
+
name: "Deck",
|
|
6
|
+
icon: "ph--columns--regular"
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
export {
|
|
9
10
|
DECK_PLUGIN,
|
|
10
11
|
meta
|
|
11
12
|
};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-N7TEPFVR.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const DECK_PLUGIN = 'dxos.org/plugin/deck' as const;\n\nexport const meta = {\n id: DECK_PLUGIN,\n name: 'Deck',\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";AAMO,IAAMA,cAAc;AAEpB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;AACR;",
|
|
6
|
-
"names": ["DECK_PLUGIN", "meta", "id", "name"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const DECK_PLUGIN = 'dxos.org/plugin/deck' as const;\n\nexport const meta = {\n id: DECK_PLUGIN,\n name: 'Deck',\n icon: 'ph--columns--regular',\n} satisfies PluginMeta;\n"],
|
|
5
|
+
"mappings": ";AAMO,IAAMA,cAAc;AAEpB,IAAMC,OAAO;EAClBC,IAAIF;EACJG,MAAM;EACNC,MAAM;AACR;",
|
|
6
|
+
"names": ["DECK_PLUGIN", "meta", "id", "name", "icon"]
|
|
7
7
|
}
|