@dxos/plugin-deck 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b
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-CI6ZFMNL.mjs +147 -0
- package/dist/lib/browser/app-graph-builder-CI6ZFMNL.mjs.map +7 -0
- package/dist/lib/browser/check-app-scheme-S3EYUPMF.mjs +33 -0
- package/dist/lib/browser/check-app-scheme-S3EYUPMF.mjs.map +7 -0
- package/dist/lib/browser/chunk-M2L53AIH.mjs +126 -0
- package/dist/lib/browser/chunk-M2L53AIH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVOGPULO.mjs → chunk-N7TEPFVR.mjs} +5 -4
- package/dist/lib/browser/chunk-N7TEPFVR.mjs.map +7 -0
- package/dist/lib/browser/chunk-NYZJCVAU.mjs +22 -0
- package/dist/lib/browser/chunk-NYZJCVAU.mjs.map +7 -0
- package/dist/lib/browser/chunk-WXNLVMK2.mjs +1119 -0
- package/dist/lib/browser/chunk-WXNLVMK2.mjs.map +7 -0
- package/dist/lib/browser/chunk-YQ2GWTDU.mjs +17 -0
- package/dist/lib/browser/chunk-YQ2GWTDU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +90 -1775
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs +494 -0
- package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-ECDQZYQT.mjs +46 -0
- package/dist/lib/browser/react-root-ECDQZYQT.mjs.map +7 -0
- package/dist/lib/browser/react-surface-4WIQZW2S.mjs +38 -0
- package/dist/lib/browser/react-surface-4WIQZW2S.mjs.map +7 -0
- package/dist/lib/browser/settings-WACNLCPB.mjs +28 -0
- package/dist/lib/browser/settings-WACNLCPB.mjs.map +7 -0
- package/dist/lib/browser/state-VPOYUKK6.mjs +117 -0
- package/dist/lib/browser/state-VPOYUKK6.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +16 -4
- package/dist/lib/browser/url-handler-HLF42IHP.mjs +70 -0
- package/dist/lib/browser/url-handler-HLF42IHP.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +1 -5
- 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 +142 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts +4 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +189 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +7 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/set-active.d.ts +9 -0
- package/dist/types/src/capabilities/set-active.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +76 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts +4 -0
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts +6 -0
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.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/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 +4 -3
- package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts +1 -5
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +8 -0
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -2
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -0
- package/dist/types/src/components/fragments.d.ts +4 -0
- package/dist/types/src/components/fragments.d.ts.map +1 -0
- 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 +4 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.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 +4 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +117 -20
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +3 -2
- 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/useBreakpoints.d.ts +2 -0
- package/dist/types/src/util/useBreakpoints.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts +2 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -36
- package/src/DeckPlugin.ts +77 -0
- package/src/capabilities/app-graph-builder.ts +109 -0
- package/src/capabilities/capabilities.ts +18 -0
- package/src/capabilities/check-app-scheme.ts +44 -0
- package/src/capabilities/index.ts +16 -0
- package/src/capabilities/intent-resolver.ts +350 -0
- package/src/capabilities/react-root.tsx +48 -0
- package/src/capabilities/react-surface.tsx +31 -0
- package/src/capabilities/set-active.ts +43 -0
- package/src/capabilities/settings.ts +21 -0
- package/src/capabilities/state.ts +102 -0
- package/src/capabilities/url-handler.ts +63 -0
- package/src/components/DeckLayout/ActiveNode.tsx +2 -3
- package/src/components/DeckLayout/Banner.tsx +37 -0
- package/src/components/DeckLayout/ComplementarySidebar.tsx +128 -55
- package/src/components/DeckLayout/ContentEmpty.tsx +9 -4
- package/src/components/DeckLayout/DeckLayout.tsx +113 -76
- package/src/components/DeckLayout/Fullscreen.tsx +2 -3
- package/src/components/DeckLayout/NodePlankHeading.tsx +64 -77
- package/src/components/DeckLayout/Plank.tsx +34 -43
- package/src/components/DeckLayout/PlankControls.tsx +11 -10
- package/src/components/DeckLayout/PlankError.tsx +6 -5
- package/src/components/DeckLayout/Sidebar.tsx +19 -9
- package/src/components/DeckLayout/SidebarButton.tsx +68 -0
- package/src/components/DeckLayout/StatusBar.tsx +6 -12
- package/src/components/DeckLayout/Toast.tsx +2 -2
- package/src/components/DeckLayout/Topbar.tsx +11 -0
- package/src/components/LayoutSettings.tsx +8 -8
- package/src/components/fragments.ts +14 -0
- package/src/components/index.ts +0 -2
- package/src/events.ts +11 -0
- package/src/hooks/useMainSize.ts +3 -3
- package/src/index.ts +3 -4
- package/src/layout.ts +43 -212
- package/src/meta.ts +3 -2
- package/src/translations.ts +8 -6
- package/src/types.ts +95 -34
- package/src/util/index.ts +3 -2
- package/src/util/layoutAppliesTopbar.ts +7 -0
- package/src/util/useBreakpoints.ts +11 -0
- package/src/util/useHoistStatusbar.ts +24 -0
- package/dist/lib/browser/chunk-GVOGPULO.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZC3K6C2W.mjs +0 -37
- package/dist/lib/browser/chunk-ZC3K6C2W.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/components/DeckContext.d.ts +0 -8
- 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/check-app-scheme.d.ts +0 -2
- package/dist/types/src/util/check-app-scheme.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/DeckPlugin.tsx +0 -623
- package/src/components/DeckContext.ts +0 -14
- package/src/components/LayoutContext.ts +0 -12
- package/src/layout.test.ts +0 -380
- package/src/util/check-app-scheme.ts +0 -21
- package/src/util/layout-parts.ts +0 -12
|
@@ -1,1135 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
AppGraphBuilder,
|
|
3
|
+
CheckAppScheme,
|
|
4
|
+
DeckSettings,
|
|
5
|
+
DeckState,
|
|
6
|
+
LayoutIntentResolver,
|
|
7
|
+
ReactRoot,
|
|
8
|
+
ReactSurface,
|
|
9
|
+
UrlHandler
|
|
10
|
+
} from "./chunk-NYZJCVAU.mjs";
|
|
11
|
+
import {
|
|
12
|
+
DeckCapabilities
|
|
13
|
+
} from "./chunk-YQ2GWTDU.mjs";
|
|
7
14
|
import {
|
|
8
15
|
DECK_PLUGIN,
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
16
|
+
meta
|
|
17
|
+
} from "./chunk-N7TEPFVR.mjs";
|
|
18
|
+
|
|
19
|
+
// packages/plugins/plugin-deck/src/events.ts
|
|
20
|
+
import { Events } from "@dxos/app-framework";
|
|
21
|
+
var DeckEvents;
|
|
22
|
+
(function(DeckEvents2) {
|
|
23
|
+
DeckEvents2.StateReady = Events.createStateEvent(`${DECK_PLUGIN}/state-ready`);
|
|
24
|
+
})(DeckEvents || (DeckEvents = {}));
|
|
11
25
|
|
|
12
|
-
// packages/plugins/plugin-deck/src/DeckPlugin.
|
|
13
|
-
import { batch } from "@preact/signals-core";
|
|
14
|
-
import { pipe } from "effect";
|
|
26
|
+
// packages/plugins/plugin-deck/src/DeckPlugin.ts
|
|
15
27
|
import { setAutoFreeze } from "immer";
|
|
16
|
-
import
|
|
17
|
-
import { chain, createIntent as createIntent4, createResolver, createSurface, filterPlugins, IntentAction, LayoutAction as LayoutAction3, NavigationAction as NavigationAction3, openIds, parseGraphPlugin, parseIntentPlugin, resolvePlugin, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR4, Toast as ToastSchema } from "@dxos/app-framework";
|
|
18
|
-
import { getTypename, S } from "@dxos/echo-schema";
|
|
19
|
-
import { scheduledEffect } from "@dxos/echo-signals/core";
|
|
20
|
-
import { invariant } from "@dxos/invariant";
|
|
21
|
-
import { create, isReactiveObject } from "@dxos/live-object";
|
|
22
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
23
|
-
import { log } from "@dxos/log";
|
|
24
|
-
import { parseAttentionPlugin } from "@dxos/plugin-attention";
|
|
25
|
-
import { createExtension, ROOT_ID } from "@dxos/plugin-graph";
|
|
26
|
-
import { ObservabilityAction } from "@dxos/plugin-observability/types";
|
|
28
|
+
import { allOf, Capabilities, contributes, defineModule, definePlugin, Events as Events2, oneOf } from "@dxos/app-framework";
|
|
27
29
|
import { translations as stackTranslations } from "@dxos/react-ui-stack";
|
|
28
30
|
|
|
29
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/constants.ts
|
|
30
|
-
var NAV_ID = "NavTree";
|
|
31
|
-
var SURFACE_PREFIX = "surface:";
|
|
32
|
-
|
|
33
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
34
|
-
import { Sidebar as MenuIcon } from "@phosphor-icons/react";
|
|
35
|
-
import { untracked } from "@preact/signals-core";
|
|
36
|
-
import React14, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo5, useRef as useRef2, Fragment as Fragment2 } from "react";
|
|
37
|
-
import { Surface as Surface9, firstIdInPart, usePlugin } from "@dxos/app-framework";
|
|
38
|
-
import { AlertDialog, Button as Button3, Dialog as NaturalDialog, Main as Main3, Popover as Popover2, useOnTransition, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
39
|
-
import { Stack, StackContext as StackContext2, DEFAULT_HORIZONTAL_SIZE } from "@dxos/react-ui-stack";
|
|
40
|
-
import { getSize, mainPaddingTransitions as mainPaddingTransitions2 } from "@dxos/react-ui-theme";
|
|
41
|
-
|
|
42
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/ActiveNode.tsx
|
|
43
|
-
import React from "react";
|
|
44
|
-
import { Surface } from "@dxos/app-framework";
|
|
45
|
-
import { useGraph } from "@dxos/plugin-graph";
|
|
46
|
-
import { useAttended } from "@dxos/react-ui-attention";
|
|
47
|
-
|
|
48
|
-
// packages/plugins/plugin-deck/src/hooks/useNode.ts
|
|
49
|
-
import { useEffect, useState } from "react";
|
|
50
|
-
var useNode = (graph, id, timeout) => {
|
|
51
|
-
const [nodeState, setNodeState] = useState(id ? graph.findNode(id, false) : void 0);
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
if (!id && nodeState) {
|
|
54
|
-
setNodeState(void 0);
|
|
55
|
-
}
|
|
56
|
-
if (nodeState?.id === id || !id) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const frame = requestAnimationFrame(async () => {
|
|
60
|
-
try {
|
|
61
|
-
const node = await graph.waitForNode(id, timeout);
|
|
62
|
-
if (node) {
|
|
63
|
-
setNodeState(node);
|
|
64
|
-
}
|
|
65
|
-
} catch {
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
return () => cancelAnimationFrame(frame);
|
|
69
|
-
}, [
|
|
70
|
-
graph,
|
|
71
|
-
id,
|
|
72
|
-
timeout,
|
|
73
|
-
nodeState?.id
|
|
74
|
-
]);
|
|
75
|
-
return nodeState;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// packages/plugins/plugin-deck/src/hooks/useNodeActionExpander.ts
|
|
79
|
-
import { useEffect as useEffect2 } from "react";
|
|
80
|
-
import { ACTION_GROUP_TYPE, ACTION_TYPE, getGraph } from "@dxos/plugin-graph";
|
|
81
|
-
var expandNodeActions = async (node) => {
|
|
82
|
-
const graph = getGraph(node);
|
|
83
|
-
await graph.expand(node, "outbound", ACTION_GROUP_TYPE);
|
|
84
|
-
await graph.expand(node, "outbound", ACTION_TYPE);
|
|
85
|
-
};
|
|
86
|
-
var useNodeActionExpander = (node) => {
|
|
87
|
-
useEffect2(() => {
|
|
88
|
-
if (node) {
|
|
89
|
-
const frame = requestAnimationFrame(() => {
|
|
90
|
-
void expandNodeActions(node);
|
|
91
|
-
});
|
|
92
|
-
return () => cancelAnimationFrame(frame);
|
|
93
|
-
}
|
|
94
|
-
}, [
|
|
95
|
-
node
|
|
96
|
-
]);
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// packages/plugins/plugin-deck/src/hooks/useMainSize.ts
|
|
100
|
-
import { useMainContext } from "@dxos/react-ui";
|
|
101
|
-
var useMainSize = () => {
|
|
102
|
-
const { navigationSidebarOpen, complementarySidebarOpen } = useMainContext("DeckPluginPlank");
|
|
103
|
-
return {
|
|
104
|
-
"data-sidebar-inline-start-state": navigationSidebarOpen ? "open" : "closed",
|
|
105
|
-
"data-sidebar-inline-end-state": complementarySidebarOpen ? "open" : "closed"
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/ActiveNode.tsx
|
|
110
|
-
var ActiveNode = () => {
|
|
111
|
-
const [id] = useAttended();
|
|
112
|
-
const { graph } = useGraph();
|
|
113
|
-
const activeNode = useNode(graph, id);
|
|
114
|
-
useNodeActionExpander(activeNode);
|
|
115
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
116
|
-
role: "none",
|
|
117
|
-
className: "sr-only"
|
|
118
|
-
}, /* @__PURE__ */ React.createElement(Surface, {
|
|
119
|
-
role: "document-title",
|
|
120
|
-
data: {
|
|
121
|
-
subject: activeNode
|
|
122
|
-
},
|
|
123
|
-
limit: 1
|
|
124
|
-
}));
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
128
|
-
import React6, { useMemo as useMemo2 } from "react";
|
|
129
|
-
import { createIntent as createIntent2, NavigationAction as NavigationAction2, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR2, Surface as Surface3, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
130
|
-
import { useGraph as useGraph3 } from "@dxos/plugin-graph";
|
|
131
|
-
import { Main, ScrollArea } from "@dxos/react-ui";
|
|
132
|
-
import { useAttended as useAttended2 } from "@dxos/react-ui-attention";
|
|
133
|
-
import { railGridHorizontal, StackContext } from "@dxos/react-ui-stack";
|
|
134
|
-
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
135
|
-
|
|
136
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/NodePlankHeading.tsx
|
|
137
|
-
import React3, { Fragment, memo, useEffect as useEffect3, useMemo } from "react";
|
|
138
|
-
import { createIntent, LayoutAction, NavigationAction, SLUG_PATH_SEPARATOR, Surface as Surface2, useIntentDispatcher } from "@dxos/app-framework";
|
|
139
|
-
import { useGraph as useGraph2 } from "@dxos/plugin-graph";
|
|
140
|
-
import { Icon as Icon2, Popover, toLocalizedString, useMediaQuery, useTranslation as useTranslation2, IconButton } from "@dxos/react-ui";
|
|
141
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
142
|
-
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
143
|
-
|
|
144
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/PlankControls.tsx
|
|
145
|
-
import React2, { forwardRef } from "react";
|
|
146
|
-
import { Button, ButtonGroup, Icon, Tooltip, useTranslation } from "@dxos/react-ui";
|
|
147
|
-
var PlankControl = ({ icon, label, ...props }) => {
|
|
148
|
-
return /* @__PURE__ */ React2.createElement(Tooltip.Root, null, /* @__PURE__ */ React2.createElement(Tooltip.Trigger, {
|
|
149
|
-
asChild: true
|
|
150
|
-
}, /* @__PURE__ */ React2.createElement(Button, {
|
|
151
|
-
variant: "ghost",
|
|
152
|
-
...props
|
|
153
|
-
}, /* @__PURE__ */ React2.createElement("span", {
|
|
154
|
-
className: "sr-only"
|
|
155
|
-
}, label), /* @__PURE__ */ React2.createElement(Icon, {
|
|
156
|
-
icon,
|
|
157
|
-
size: 4
|
|
158
|
-
}))), /* @__PURE__ */ React2.createElement(Tooltip.Portal, null, /* @__PURE__ */ React2.createElement(Tooltip.Content, {
|
|
159
|
-
side: "bottom"
|
|
160
|
-
}, label)));
|
|
161
|
-
};
|
|
162
|
-
var PlankControls = /* @__PURE__ */ forwardRef(({ onClick, variant = "default", capabilities: can, isSolo, pin, close = false, children, ...props }, forwardedRef) => {
|
|
163
|
-
const { t } = useTranslation(DECK_PLUGIN);
|
|
164
|
-
const buttonClassNames = variant === "hide-disabled" ? "disabled:hidden !pli-2 !plb-3" : "!pli-2 !plb-3";
|
|
165
|
-
return /* @__PURE__ */ React2.createElement(ButtonGroup, {
|
|
166
|
-
...props,
|
|
167
|
-
ref: forwardedRef
|
|
168
|
-
}, pin && !isSolo && [
|
|
169
|
-
"both",
|
|
170
|
-
"start"
|
|
171
|
-
].includes(pin) && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
172
|
-
label: t("pin start label"),
|
|
173
|
-
variant: "ghost",
|
|
174
|
-
classNames: buttonClassNames,
|
|
175
|
-
onClick: () => onClick?.("pin-start"),
|
|
176
|
-
icon: "ph--caret-line-left--regular"
|
|
177
|
-
}), can.solo && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
178
|
-
label: isSolo ? t("show deck plank label") : t("show solo plank label"),
|
|
179
|
-
classNames: buttonClassNames,
|
|
180
|
-
onClick: () => onClick?.("solo"),
|
|
181
|
-
icon: isSolo ? "ph--arrow-u-down-left--regular" : "ph--arrows-out--regular"
|
|
182
|
-
}), !isSolo && can.solo && /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
183
|
-
label: t("increment start label"),
|
|
184
|
-
disabled: !can.incrementStart,
|
|
185
|
-
classNames: buttonClassNames,
|
|
186
|
-
onClick: () => onClick?.("increment-start"),
|
|
187
|
-
icon: "ph--caret-left--regular"
|
|
188
|
-
}), /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
189
|
-
label: t("increment end label"),
|
|
190
|
-
disabled: !can.incrementEnd,
|
|
191
|
-
classNames: buttonClassNames,
|
|
192
|
-
onClick: () => onClick?.("increment-end"),
|
|
193
|
-
icon: "ph--caret-right--regular"
|
|
194
|
-
})), pin && !isSolo && [
|
|
195
|
-
"both",
|
|
196
|
-
"end"
|
|
197
|
-
].includes(pin) && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
198
|
-
label: t("pin end label"),
|
|
199
|
-
classNames: buttonClassNames,
|
|
200
|
-
onClick: () => onClick?.("pin-end"),
|
|
201
|
-
icon: "ph--caret-line-right--regular"
|
|
202
|
-
}), close && !isSolo && /* @__PURE__ */ React2.createElement(PlankControl, {
|
|
203
|
-
label: t(`${typeof close === "string" ? "minify" : "close"} label`),
|
|
204
|
-
classNames: buttonClassNames,
|
|
205
|
-
onClick: () => onClick?.("close"),
|
|
206
|
-
"data-testid": "plankHeading.close",
|
|
207
|
-
icon: close === "minify-start" ? "ph--caret-line-left--regular" : close === "minify-end" ? "ph--caret-line-right--regular" : "ph--x--regular"
|
|
208
|
-
}), children);
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
// packages/plugins/plugin-deck/src/components/LayoutContext.ts
|
|
212
|
-
import { createContext, useContext } from "react";
|
|
213
|
-
import { raise } from "@dxos/debug";
|
|
214
|
-
var LayoutContext = createContext(null);
|
|
215
|
-
var useLayout = () => useContext(LayoutContext) ?? raise(new Error("Missing LayoutContext"));
|
|
216
|
-
|
|
217
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/NodePlankHeading.tsx
|
|
218
|
-
var NodePlankHeading = /* @__PURE__ */ memo(({ coordinate, node, canIncrementStart, canIncrementEnd, popoverAnchorId, pending, actions = [] }) => {
|
|
219
|
-
const layoutContext = useLayout();
|
|
220
|
-
const { t } = useTranslation2(DECK_PLUGIN);
|
|
221
|
-
const { graph } = useGraph2();
|
|
222
|
-
const icon = node?.properties?.icon ?? "ph--placeholder--regular";
|
|
223
|
-
const label = pending ? t("pending heading") : toLocalizedString(node?.properties?.label ?? [
|
|
224
|
-
"plank heading fallback label",
|
|
225
|
-
{
|
|
226
|
-
ns: DECK_PLUGIN
|
|
227
|
-
}
|
|
228
|
-
], t);
|
|
229
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
230
|
-
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${DECK_PLUGIN}/${node.id}` ? Popover.Anchor : Fragment;
|
|
231
|
-
const [isNotMobile] = useMediaQuery("md");
|
|
232
|
-
useEffect3(() => {
|
|
233
|
-
const frame = requestAnimationFrame(() => {
|
|
234
|
-
node && graph.actions(node);
|
|
235
|
-
});
|
|
236
|
-
return () => cancelAnimationFrame(frame);
|
|
237
|
-
}, [
|
|
238
|
-
node
|
|
239
|
-
]);
|
|
240
|
-
const layoutPart = coordinate.part;
|
|
241
|
-
const attendableId = coordinate.entryId.split(SLUG_PATH_SEPARATOR).at(0);
|
|
242
|
-
const capabilities = useMemo(() => ({
|
|
243
|
-
solo: (layoutPart === "solo" || layoutPart === "main") && isNotMobile,
|
|
244
|
-
incrementStart: canIncrementStart,
|
|
245
|
-
incrementEnd: canIncrementEnd
|
|
246
|
-
}), [
|
|
247
|
-
isNotMobile,
|
|
248
|
-
layoutPart,
|
|
249
|
-
canIncrementStart,
|
|
250
|
-
canIncrementEnd
|
|
251
|
-
]);
|
|
252
|
-
return /* @__PURE__ */ React3.createElement(StackItem.Heading, {
|
|
253
|
-
classNames: "pie-1 border-be border-separator"
|
|
254
|
-
}, /* @__PURE__ */ React3.createElement(ActionRoot, null, node ? /* @__PURE__ */ React3.createElement(StackItem.Sigil, {
|
|
255
|
-
icon,
|
|
256
|
-
related: layoutPart === "complementary",
|
|
257
|
-
attendableId,
|
|
258
|
-
triggerLabel: t("actions menu label"),
|
|
259
|
-
actions: [
|
|
260
|
-
actions,
|
|
261
|
-
graph.actions(node)
|
|
262
|
-
].filter((a) => a.length > 0),
|
|
263
|
-
onAction: (action) => typeof action.data === "function" && action.data?.({
|
|
264
|
-
node: action,
|
|
265
|
-
caller: DECK_PLUGIN
|
|
266
|
-
})
|
|
267
|
-
}, /* @__PURE__ */ React3.createElement(Surface2, {
|
|
268
|
-
role: "menu-footer",
|
|
269
|
-
data: {
|
|
270
|
-
subject: node.data
|
|
271
|
-
}
|
|
272
|
-
})) : /* @__PURE__ */ React3.createElement(StackItem.SigilButton, null, /* @__PURE__ */ React3.createElement("span", {
|
|
273
|
-
className: "sr-only"
|
|
274
|
-
}, label), /* @__PURE__ */ React3.createElement(Icon2, {
|
|
275
|
-
icon,
|
|
276
|
-
size: 5
|
|
277
|
-
}))), /* @__PURE__ */ React3.createElement(TextTooltip, {
|
|
278
|
-
text: label,
|
|
279
|
-
onlyWhenTruncating: true
|
|
280
|
-
}, /* @__PURE__ */ React3.createElement(StackItem.HeadingLabel, {
|
|
281
|
-
attendableId,
|
|
282
|
-
related: layoutPart === "complementary",
|
|
283
|
-
...pending && {
|
|
284
|
-
classNames: "text-description"
|
|
285
|
-
}
|
|
286
|
-
}, label)), node && layoutPart !== "complementary" && // TODO(Zan): What are we doing with layout coordinate here?
|
|
287
|
-
/* @__PURE__ */ React3.createElement(Surface2, {
|
|
288
|
-
role: "navbar-end",
|
|
289
|
-
data: {
|
|
290
|
-
subject: node.data
|
|
291
|
-
}
|
|
292
|
-
}), /* @__PURE__ */ React3.createElement(PlankControls, {
|
|
293
|
-
capabilities,
|
|
294
|
-
isSolo: layoutPart === "solo",
|
|
295
|
-
classNames: "mx-1",
|
|
296
|
-
onClick: (eventType) => {
|
|
297
|
-
if (!layoutPart) {
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (eventType === "solo") {
|
|
301
|
-
return dispatch(createIntent(NavigationAction.Adjust, {
|
|
302
|
-
type: eventType,
|
|
303
|
-
layoutCoordinate: {
|
|
304
|
-
part: "main",
|
|
305
|
-
entryId: coordinate.entryId
|
|
306
|
-
}
|
|
307
|
-
}));
|
|
308
|
-
} else if (eventType === "close") {
|
|
309
|
-
if (layoutPart === "complementary") {
|
|
310
|
-
return dispatch(createIntent(LayoutAction.SetLayout, {
|
|
311
|
-
element: "complementary",
|
|
312
|
-
state: false
|
|
313
|
-
}));
|
|
314
|
-
} else {
|
|
315
|
-
return dispatch(createIntent(NavigationAction.Close, {
|
|
316
|
-
activeParts: {
|
|
317
|
-
[layoutPart]: [
|
|
318
|
-
coordinate.entryId
|
|
319
|
-
]
|
|
320
|
-
}
|
|
321
|
-
}));
|
|
322
|
-
}
|
|
323
|
-
} else {
|
|
324
|
-
return dispatch(createIntent(NavigationAction.Adjust, {
|
|
325
|
-
type: eventType,
|
|
326
|
-
layoutCoordinate: coordinate
|
|
327
|
-
}));
|
|
328
|
-
}
|
|
329
|
-
},
|
|
330
|
-
close: layoutPart === "complementary" ? "minify-end" : true
|
|
331
|
-
}, layoutPart !== "complementary" && /* @__PURE__ */ React3.createElement(IconButton, {
|
|
332
|
-
iconOnly: true,
|
|
333
|
-
onClick: () => layoutContext.complementarySidebarOpen = !layoutContext.complementarySidebarOpen,
|
|
334
|
-
variant: "ghost",
|
|
335
|
-
label: t("open complementary sidebar label"),
|
|
336
|
-
classNames: "!pli-2 !plb-3 [&>svg]:-scale-x-100",
|
|
337
|
-
icon: "ph--sidebar-simple--regular",
|
|
338
|
-
size: 4
|
|
339
|
-
})));
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/PlankError.tsx
|
|
343
|
-
import React5, { useEffect as useEffect4, useState as useState2 } from "react";
|
|
344
|
-
import { useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
345
|
-
import { descriptionText, mx } from "@dxos/react-ui-theme";
|
|
346
|
-
|
|
347
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/PlankLoading.tsx
|
|
348
|
-
import React4 from "react";
|
|
349
|
-
var PlankLoading = () => {
|
|
350
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
351
|
-
role: "none",
|
|
352
|
-
className: "grid place-items-center attention-surface"
|
|
353
|
-
});
|
|
354
|
-
};
|
|
355
|
-
|
|
356
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/PlankError.tsx
|
|
357
|
-
var PlankContentError = ({ error }) => {
|
|
358
|
-
const { t } = useTranslation3(DECK_PLUGIN);
|
|
359
|
-
const errorString = error?.toString() ?? "";
|
|
360
|
-
return /* @__PURE__ */ React5.createElement("div", {
|
|
361
|
-
role: "none",
|
|
362
|
-
className: "overflow-auto p-8 attention-surface grid place-items-center"
|
|
363
|
-
}, /* @__PURE__ */ React5.createElement("p", {
|
|
364
|
-
role: "alert",
|
|
365
|
-
className: mx(descriptionText, "break-words border border-dashed border-separator rounded-lg p-8", errorString.length < 256 && "text-lg")
|
|
366
|
-
}, error ? errorString : t("error fallback message")));
|
|
367
|
-
};
|
|
368
|
-
var PlankError = ({ layoutCoordinate, node, error }) => {
|
|
369
|
-
const [timedOut, setTimedOut] = useState2(false);
|
|
370
|
-
useEffect4(() => {
|
|
371
|
-
setTimeout(() => setTimedOut(true), 5e3);
|
|
372
|
-
}, []);
|
|
373
|
-
return /* @__PURE__ */ React5.createElement(React5.Fragment, null, /* @__PURE__ */ React5.createElement(NodePlankHeading, {
|
|
374
|
-
coordinate: layoutCoordinate,
|
|
375
|
-
node,
|
|
376
|
-
pending: !timedOut
|
|
377
|
-
}), timedOut ? /* @__PURE__ */ React5.createElement(PlankContentError, {
|
|
378
|
-
error
|
|
379
|
-
}) : /* @__PURE__ */ React5.createElement(PlankLoading, null));
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
383
|
-
var ComplementarySidebar = ({ panels, current }) => {
|
|
384
|
-
const { popoverAnchorId } = useLayout();
|
|
385
|
-
const attended = useAttended2();
|
|
386
|
-
const panel = (panels.find((p) => p.id === current) ?? panels[0])?.id;
|
|
387
|
-
const id = attended[0] ? `${attended[0]}${SLUG_PATH_SEPARATOR2}${panel}` : void 0;
|
|
388
|
-
const { graph } = useGraph3();
|
|
389
|
-
const node = useNode(graph, id);
|
|
390
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
391
|
-
useNodeActionExpander(node);
|
|
392
|
-
const actions = useMemo2(() => panels.map(({ id: id2, label, icon }) => ({
|
|
393
|
-
id: `complementary-${id2}`,
|
|
394
|
-
data: () => {
|
|
395
|
-
void dispatch(createIntent2(NavigationAction2.Open, {
|
|
396
|
-
activeParts: {
|
|
397
|
-
complementary: id2
|
|
398
|
-
}
|
|
399
|
-
}));
|
|
400
|
-
},
|
|
401
|
-
properties: {
|
|
402
|
-
label,
|
|
403
|
-
icon,
|
|
404
|
-
menuItemType: "toggle",
|
|
405
|
-
isChecked: panel === id2
|
|
406
|
-
}
|
|
407
|
-
})), [
|
|
408
|
-
panel
|
|
409
|
-
]);
|
|
410
|
-
const coordinate = useMemo2(() => ({
|
|
411
|
-
entryId: id ?? "unknown",
|
|
412
|
-
part: "complementary"
|
|
413
|
-
}), [
|
|
414
|
-
id
|
|
415
|
-
]);
|
|
416
|
-
return /* @__PURE__ */ React6.createElement(Main.ComplementarySidebar, null, /* @__PURE__ */ React6.createElement(StackContext.Provider, {
|
|
417
|
-
value: {
|
|
418
|
-
size: "contain",
|
|
419
|
-
orientation: "horizontal",
|
|
420
|
-
rail: true
|
|
421
|
-
}
|
|
422
|
-
}, /* @__PURE__ */ React6.createElement("div", {
|
|
423
|
-
role: "none",
|
|
424
|
-
className: mx2(railGridHorizontal, "grid grid-cols-[100%] bs-full")
|
|
425
|
-
}, /* @__PURE__ */ React6.createElement(NodePlankHeading, {
|
|
426
|
-
coordinate,
|
|
427
|
-
node,
|
|
428
|
-
popoverAnchorId,
|
|
429
|
-
actions
|
|
430
|
-
}), /* @__PURE__ */ React6.createElement(ScrollArea.Root, null, /* @__PURE__ */ React6.createElement(ScrollArea.Viewport, null, node && /* @__PURE__ */ React6.createElement(Surface3, {
|
|
431
|
-
key: id,
|
|
432
|
-
role: `complementary--${panel}`,
|
|
433
|
-
limit: 1,
|
|
434
|
-
data: {
|
|
435
|
-
id,
|
|
436
|
-
subject: node.properties.object ?? node.properties.space,
|
|
437
|
-
popoverAnchorId
|
|
438
|
-
},
|
|
439
|
-
fallback: PlankContentError,
|
|
440
|
-
placeholder: /* @__PURE__ */ React6.createElement(PlankLoading, null)
|
|
441
|
-
}), /* @__PURE__ */ React6.createElement(ScrollArea.Scrollbar, {
|
|
442
|
-
orientation: "vertical"
|
|
443
|
-
}, /* @__PURE__ */ React6.createElement(ScrollArea.Thumb, null)))))));
|
|
444
|
-
};
|
|
445
|
-
|
|
446
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/ContentEmpty.tsx
|
|
447
|
-
import React7 from "react";
|
|
448
|
-
import { Surface as Surface4 } from "@dxos/app-framework";
|
|
449
|
-
var ContentEmpty = () => {
|
|
450
|
-
return /* @__PURE__ */ React7.createElement("div", {
|
|
451
|
-
role: "none",
|
|
452
|
-
className: "min-bs-screen is-dvw sm:is-full flex items-center justify-center p-8",
|
|
453
|
-
"data-testid": "layoutPlugin.firstRunMessage"
|
|
454
|
-
}, /* @__PURE__ */ React7.createElement("div", {
|
|
455
|
-
role: "none",
|
|
456
|
-
className: "grid place-items-center grid-rows-[min-content_min-content]"
|
|
457
|
-
}, /* @__PURE__ */ React7.createElement(Surface4, {
|
|
458
|
-
role: "keyshortcuts"
|
|
459
|
-
})));
|
|
460
|
-
};
|
|
461
|
-
|
|
462
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Fullscreen.tsx
|
|
463
|
-
import React9 from "react";
|
|
464
|
-
import { Surface as Surface5 } from "@dxos/app-framework";
|
|
465
|
-
import { useGraph as useGraph4 } from "@dxos/plugin-graph";
|
|
466
|
-
import { fixedInsetFlexLayout } from "@dxos/react-ui-theme";
|
|
467
|
-
|
|
468
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Fallback.tsx
|
|
469
|
-
import React8 from "react";
|
|
470
|
-
import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
471
|
-
import { errorText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
472
|
-
var Fallback = () => {
|
|
473
|
-
const { t } = useTranslation4(DECK_PLUGIN);
|
|
474
|
-
return /* @__PURE__ */ React8.createElement("div", {
|
|
475
|
-
role: "none",
|
|
476
|
-
className: "min-bs-screen is-full flex items-center justify-center p-8"
|
|
477
|
-
}, /* @__PURE__ */ React8.createElement("p", {
|
|
478
|
-
role: "alert",
|
|
479
|
-
className: mx3(errorText, "border border-error-400/50 rounded-lg flex items-center justify-center p-8 font-normal text-lg")
|
|
480
|
-
}, t("plugin error message")));
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Fullscreen.tsx
|
|
484
|
-
var Fullscreen = ({ id }) => {
|
|
485
|
-
const { graph } = useGraph4();
|
|
486
|
-
const fullScreenNode = useNode(graph, id);
|
|
487
|
-
return /* @__PURE__ */ React9.createElement("div", {
|
|
488
|
-
role: "none",
|
|
489
|
-
className: fixedInsetFlexLayout
|
|
490
|
-
}, /* @__PURE__ */ React9.createElement(Surface5, {
|
|
491
|
-
role: "main",
|
|
492
|
-
limit: 1,
|
|
493
|
-
fallback: Fallback,
|
|
494
|
-
data: {
|
|
495
|
-
subject: fullScreenNode?.data,
|
|
496
|
-
component: id?.startsWith(SURFACE_PREFIX) ? id.slice(SURFACE_PREFIX.length) : void 0
|
|
497
|
-
}
|
|
498
|
-
}));
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
502
|
-
import React10, { memo as memo2, useCallback, useLayoutEffect, useMemo as useMemo3, useRef } from "react";
|
|
503
|
-
import { Surface as Surface6, useIntentDispatcher as useIntentDispatcher3, indexInPart, partLength, LayoutAction as LayoutAction2, createIntent as createIntent3 } from "@dxos/app-framework";
|
|
504
|
-
import { debounce } from "@dxos/async";
|
|
505
|
-
import { useGraph as useGraph5 } from "@dxos/plugin-graph";
|
|
506
|
-
import { useAttendableAttributes } from "@dxos/react-ui-attention";
|
|
507
|
-
import { StackItem as StackItem2, railGridHorizontal as railGridHorizontal2 } from "@dxos/react-ui-stack";
|
|
508
|
-
import { mainIntrinsicSize, mx as mx4 } from "@dxos/react-ui-theme";
|
|
509
|
-
|
|
510
|
-
// packages/plugins/plugin-deck/src/components/DeckContext.ts
|
|
511
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
512
|
-
import { raise as raise2 } from "@dxos/debug";
|
|
513
|
-
var DeckContext = createContext2(null);
|
|
514
|
-
var useDeckContext = () => useContext2(DeckContext) ?? raise2(new Error("Missing DeckContext"));
|
|
515
|
-
|
|
516
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
517
|
-
var UNKNOWN_ID = "unknown_id";
|
|
518
|
-
var Plank = /* @__PURE__ */ memo2(({ entry, layoutParts, part, layoutMode, order }) => {
|
|
519
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
520
|
-
const coordinate = useMemo3(() => ({
|
|
521
|
-
part,
|
|
522
|
-
entryId: entry?.id ?? UNKNOWN_ID
|
|
523
|
-
}), [
|
|
524
|
-
entry?.id,
|
|
525
|
-
part
|
|
526
|
-
]);
|
|
527
|
-
const { popoverAnchorId, scrollIntoView } = useLayout();
|
|
528
|
-
const { plankSizing } = useDeckContext();
|
|
529
|
-
const { graph } = useGraph5();
|
|
530
|
-
const node = useNode(graph, entry?.id);
|
|
531
|
-
const rootElement = useRef(null);
|
|
532
|
-
const canResize = layoutMode === "deck";
|
|
533
|
-
const Root = part === "solo" ? "article" : StackItem2.Root;
|
|
534
|
-
const attendableAttrs = useAttendableAttributes(coordinate.entryId);
|
|
535
|
-
const index = indexInPart(layoutParts, coordinate);
|
|
536
|
-
const length = partLength(layoutParts, part);
|
|
537
|
-
const canIncrementStart = part === "main" && index !== void 0 && index > 0 && length !== void 0 && length > 1;
|
|
538
|
-
const canIncrementEnd = part === "main" && index !== void 0 && index < length - 1 && length !== void 0;
|
|
539
|
-
const size = plankSizing?.[coordinate.entryId];
|
|
540
|
-
const setSize = useCallback(debounce((nextSize) => {
|
|
541
|
-
return dispatch(createIntent3(DeckAction.UpdatePlankSize, {
|
|
542
|
-
id: coordinate.entryId,
|
|
543
|
-
size: nextSize
|
|
544
|
-
}));
|
|
545
|
-
}, 200), [
|
|
546
|
-
dispatch,
|
|
547
|
-
coordinate.entryId
|
|
548
|
-
]);
|
|
549
|
-
const handleKeyDown = useCallback((event) => {
|
|
550
|
-
if (event.target === event.currentTarget && event.key === "Escape") {
|
|
551
|
-
rootElement.current?.closest("main")?.focus();
|
|
552
|
-
}
|
|
553
|
-
}, []);
|
|
554
|
-
useLayoutEffect(() => {
|
|
555
|
-
if (scrollIntoView === coordinate.entryId) {
|
|
556
|
-
const focusable = rootElement.current?.querySelector("button") || rootElement.current;
|
|
557
|
-
focusable?.focus({
|
|
558
|
-
preventScroll: true
|
|
559
|
-
});
|
|
560
|
-
layoutMode === "deck" && focusable?.scrollIntoView({
|
|
561
|
-
behavior: "smooth",
|
|
562
|
-
inline: "center"
|
|
563
|
-
});
|
|
564
|
-
void dispatch(createIntent3(LayoutAction2.ScrollIntoView, {
|
|
565
|
-
id: void 0
|
|
566
|
-
}));
|
|
567
|
-
}
|
|
568
|
-
}, [
|
|
569
|
-
coordinate.entryId,
|
|
570
|
-
scrollIntoView,
|
|
571
|
-
layoutMode
|
|
572
|
-
]);
|
|
573
|
-
const isSolo = layoutMode === "solo" && part === "solo";
|
|
574
|
-
const isAttendable = isSolo || layoutMode === "deck" && part === "main";
|
|
575
|
-
const sizeAttrs = useMainSize();
|
|
576
|
-
const data = useMemo3(() => node && {
|
|
577
|
-
subject: node.data,
|
|
578
|
-
path: entry?.path,
|
|
579
|
-
coordinate,
|
|
580
|
-
popoverAnchorId
|
|
581
|
-
}, [
|
|
582
|
-
node,
|
|
583
|
-
node?.data,
|
|
584
|
-
entry?.path,
|
|
585
|
-
coordinate,
|
|
586
|
-
popoverAnchorId
|
|
587
|
-
]);
|
|
588
|
-
const placeholder = useMemo3(() => /* @__PURE__ */ React10.createElement(PlankLoading, null), []);
|
|
589
|
-
const className = mx4("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal2, isSolo ? "grid absolute inset-0" : "!border-separator border-li");
|
|
590
|
-
return /* @__PURE__ */ React10.createElement(Root, {
|
|
591
|
-
ref: rootElement,
|
|
592
|
-
"data-testid": "deck.plank",
|
|
593
|
-
tabIndex: 0,
|
|
594
|
-
...part === "solo" ? {
|
|
595
|
-
...sizeAttrs,
|
|
596
|
-
className
|
|
597
|
-
} : {
|
|
598
|
-
item: {
|
|
599
|
-
id: entry?.id ?? "never"
|
|
600
|
-
},
|
|
601
|
-
size,
|
|
602
|
-
onSizeChange: setSize,
|
|
603
|
-
classNames: className,
|
|
604
|
-
order,
|
|
605
|
-
role: "article"
|
|
606
|
-
},
|
|
607
|
-
...isAttendable ? attendableAttrs : {},
|
|
608
|
-
onKeyDown: handleKeyDown
|
|
609
|
-
}, node ? /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(NodePlankHeading, {
|
|
610
|
-
coordinate,
|
|
611
|
-
node,
|
|
612
|
-
canIncrementStart,
|
|
613
|
-
canIncrementEnd,
|
|
614
|
-
popoverAnchorId
|
|
615
|
-
}), /* @__PURE__ */ React10.createElement(Surface6, {
|
|
616
|
-
key: node.id,
|
|
617
|
-
role: "article",
|
|
618
|
-
data,
|
|
619
|
-
limit: 1,
|
|
620
|
-
fallback: PlankContentError,
|
|
621
|
-
placeholder
|
|
622
|
-
})) : /* @__PURE__ */ React10.createElement(PlankError, {
|
|
623
|
-
layoutCoordinate: coordinate
|
|
624
|
-
}), canResize && /* @__PURE__ */ React10.createElement(StackItem2.ResizeHandle, null));
|
|
625
|
-
});
|
|
626
|
-
|
|
627
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Sidebar.tsx
|
|
628
|
-
import React11, { useMemo as useMemo4 } from "react";
|
|
629
|
-
import { Surface as Surface7 } from "@dxos/app-framework";
|
|
630
|
-
import { Main as Main2 } from "@dxos/react-ui";
|
|
631
|
-
var Sidebar = ({ layoutParts }) => {
|
|
632
|
-
const { popoverAnchorId } = useLayout();
|
|
633
|
-
const navigationData = useMemo4(() => ({
|
|
634
|
-
popoverAnchorId
|
|
635
|
-
}), [
|
|
636
|
-
popoverAnchorId
|
|
637
|
-
]);
|
|
638
|
-
return /* @__PURE__ */ React11.createElement(Main2.NavigationSidebar, null, /* @__PURE__ */ React11.createElement(Surface7, {
|
|
639
|
-
role: "navigation",
|
|
640
|
-
data: navigationData,
|
|
641
|
-
limit: 1
|
|
642
|
-
}));
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/StatusBar.tsx
|
|
646
|
-
import React12 from "react";
|
|
647
|
-
import { Surface as Surface8 } from "@dxos/app-framework";
|
|
648
|
-
import { mainPadding, mainPaddingTransitions, mx as mx5 } from "@dxos/react-ui-theme";
|
|
649
|
-
var StatusBar = ({ showHints }) => {
|
|
650
|
-
const sizeAttrs = useMainSize();
|
|
651
|
-
return /* @__PURE__ */ React12.createElement("div", {
|
|
652
|
-
role: "none",
|
|
653
|
-
...sizeAttrs,
|
|
654
|
-
className: mx5("fixed flex justify-between block-end-0 inset-inline-0 items-center border-bs border-separator z-[2]", mainPadding, mainPaddingTransitions)
|
|
655
|
-
}, /* @__PURE__ */ React12.createElement("div", {
|
|
656
|
-
role: "none"
|
|
657
|
-
}, showHints && /* @__PURE__ */ React12.createElement(Surface8, {
|
|
658
|
-
role: "hints",
|
|
659
|
-
limit: 1
|
|
660
|
-
})), /* @__PURE__ */ React12.createElement(Surface8, {
|
|
661
|
-
role: "status-bar",
|
|
662
|
-
limit: 1
|
|
663
|
-
}));
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/Toast.tsx
|
|
667
|
-
import React13 from "react";
|
|
668
|
-
import { Button as Button2, Icon as Icon3, Toast as NaturalToast, toLocalizedString as toLocalizedString2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
669
|
-
var Toast = ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange }) => {
|
|
670
|
-
const { t } = useTranslation5(DECK_PLUGIN);
|
|
671
|
-
return /* @__PURE__ */ React13.createElement(NaturalToast.Root, {
|
|
672
|
-
"data-testid": id,
|
|
673
|
-
defaultOpen: true,
|
|
674
|
-
duration,
|
|
675
|
-
onOpenChange
|
|
676
|
-
}, /* @__PURE__ */ React13.createElement(NaturalToast.Body, null, /* @__PURE__ */ React13.createElement(NaturalToast.Title, {
|
|
677
|
-
classNames: "items-center"
|
|
678
|
-
}, icon && /* @__PURE__ */ React13.createElement(Icon3, {
|
|
679
|
-
icon,
|
|
680
|
-
size: 5,
|
|
681
|
-
classNames: "inline mr-1"
|
|
682
|
-
}), title && /* @__PURE__ */ React13.createElement("span", null, toLocalizedString2(title, t))), description && /* @__PURE__ */ React13.createElement(NaturalToast.Description, null, description && toLocalizedString2(description, t))), /* @__PURE__ */ React13.createElement(NaturalToast.Actions, null, onAction && actionAlt && actionLabel && /* @__PURE__ */ React13.createElement(NaturalToast.Action, {
|
|
683
|
-
altText: toLocalizedString2(actionAlt, t),
|
|
684
|
-
asChild: true
|
|
685
|
-
}, /* @__PURE__ */ React13.createElement(Button2, {
|
|
686
|
-
"data-testid": "toast.action",
|
|
687
|
-
variant: "primary",
|
|
688
|
-
onClick: () => onAction?.()
|
|
689
|
-
}, toLocalizedString2(actionLabel, t))), closeLabel && /* @__PURE__ */ React13.createElement(NaturalToast.Close, {
|
|
690
|
-
asChild: true
|
|
691
|
-
}, /* @__PURE__ */ React13.createElement(Button2, {
|
|
692
|
-
"data-testid": "toast.close"
|
|
693
|
-
}, toLocalizedString2(closeLabel, t)))));
|
|
694
|
-
};
|
|
695
|
-
|
|
696
|
-
// packages/plugins/plugin-deck/src/util/check-app-scheme.ts
|
|
697
|
-
var checkAppScheme = (url) => {
|
|
698
|
-
const iframe = document.createElement("iframe");
|
|
699
|
-
iframe.style.display = "none";
|
|
700
|
-
document.body.appendChild(iframe);
|
|
701
|
-
iframe.src = url + window.location.pathname.replace(/^\/+/, "") + window.location.search;
|
|
702
|
-
const timer = setTimeout(() => {
|
|
703
|
-
document.body.removeChild(iframe);
|
|
704
|
-
}, 3e3);
|
|
705
|
-
window.addEventListener("pagehide", (event) => {
|
|
706
|
-
clearTimeout(timer);
|
|
707
|
-
document.body.removeChild(iframe);
|
|
708
|
-
});
|
|
709
|
-
};
|
|
710
|
-
|
|
711
|
-
// packages/plugins/plugin-deck/src/util/layout-parts.ts
|
|
712
|
-
var getEffectivePart = (partName, layoutMode) => layoutMode === "solo" && partName === "main" ? "solo" : partName;
|
|
713
|
-
|
|
714
|
-
// packages/plugins/plugin-deck/src/util/overscroll.ts
|
|
715
|
-
var calculateOverscroll = (planksCount) => {
|
|
716
|
-
if (!planksCount) {
|
|
717
|
-
return {
|
|
718
|
-
paddingInlineStart: 0,
|
|
719
|
-
paddingInlineEnd: 0
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
if (planksCount === 1) {
|
|
723
|
-
const overscrollPadding = "max(0px, calc(((100dvw - var(--dx-main-sidebarWidth) - var(--dx-main-complementaryWidth) - (var(--dx-main-contentFirstWidth) + 1px)) / 2)))";
|
|
724
|
-
return {
|
|
725
|
-
paddingInlineStart: overscrollPadding,
|
|
726
|
-
paddingInlineEnd: overscrollPadding
|
|
727
|
-
};
|
|
728
|
-
} else {
|
|
729
|
-
return {
|
|
730
|
-
paddingInlineStart: "max(0px, calc(((100dvw - (var(--dx-main-contentFirstWidth) + 1px)) / 2) - var(--dx-main-sidebarWidth)))",
|
|
731
|
-
paddingInlineEnd: "max(0px, calc(((100dvw - (var(--dx-main-contentLastWidth) + 1px)) / 2) - var(--dx-main-complementaryWidth)))"
|
|
732
|
-
};
|
|
733
|
-
}
|
|
734
|
-
};
|
|
735
|
-
|
|
736
|
-
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
737
|
-
var PlankSeparator = ({ index }) => index > 0 ? /* @__PURE__ */ React14.createElement("span", {
|
|
738
|
-
role: "separator",
|
|
739
|
-
className: "row-span-2 bg-deck is-4",
|
|
740
|
-
style: {
|
|
741
|
-
gridColumn: index * 2
|
|
742
|
-
}
|
|
743
|
-
}) : null;
|
|
744
|
-
var DeckLayout = ({ layoutParts, toasts, overscroll, showHints, panels, onDismissToast }) => {
|
|
745
|
-
const context = useLayout();
|
|
746
|
-
const { layoutMode, sidebarOpen, complementarySidebarOpen, dialogOpen, dialogContent, dialogBlockAlign, dialogType, popoverOpen, popoverContent, popoverAnchorId } = context;
|
|
747
|
-
const { t } = useTranslation6(DECK_PLUGIN);
|
|
748
|
-
const { plankSizing } = useDeckContext();
|
|
749
|
-
const attentionPlugin = usePlugin("dxos.org/plugin/attention");
|
|
750
|
-
const fullScreenSlug = useMemo5(() => firstIdInPart(layoutParts, "fullScreen"), [
|
|
751
|
-
layoutParts
|
|
752
|
-
]);
|
|
753
|
-
const scrollLeftRef = useRef2();
|
|
754
|
-
const deckRef = useRef2(null);
|
|
755
|
-
const isSoloModeLoaded = layoutMode === "solo" && Boolean(layoutParts.solo?.[0]);
|
|
756
|
-
useEffect5(() => {
|
|
757
|
-
const attended = untracked(() => attentionPlugin?.provides.attention.attended ?? []);
|
|
758
|
-
const firstId = isSoloModeLoaded ? firstIdInPart(layoutParts, "solo") : firstIdInPart(layoutParts, "main");
|
|
759
|
-
if (attended.length === 0 && firstId) {
|
|
760
|
-
document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
761
|
-
}
|
|
762
|
-
}, []);
|
|
763
|
-
const handleResize = useCallback2(() => {
|
|
764
|
-
scrollLeftRef.current = null;
|
|
765
|
-
}, []);
|
|
766
|
-
useEffect5(() => {
|
|
767
|
-
window.addEventListener("resize", handleResize);
|
|
768
|
-
return () => window.removeEventListener("resize", handleResize);
|
|
769
|
-
}, [
|
|
770
|
-
handleResize
|
|
771
|
-
]);
|
|
772
|
-
const restoreScroll = useCallback2(() => {
|
|
773
|
-
if (deckRef.current && scrollLeftRef.current != null) {
|
|
774
|
-
deckRef.current.scrollLeft = scrollLeftRef.current;
|
|
775
|
-
}
|
|
776
|
-
}, []);
|
|
777
|
-
useOnTransition(layoutMode, (mode) => mode !== "deck", "deck", restoreScroll);
|
|
778
|
-
const handleScroll = useCallback2((event) => {
|
|
779
|
-
if (layoutMode === "deck" && event.currentTarget === event.target) {
|
|
780
|
-
scrollLeftRef.current = event.target.scrollLeft;
|
|
781
|
-
}
|
|
782
|
-
}, [
|
|
783
|
-
layoutMode
|
|
784
|
-
]);
|
|
785
|
-
const isEmpty = (layoutParts.main?.length ?? 0) === 0 && (layoutParts.solo?.length ?? 0) === 0;
|
|
786
|
-
const padding = useMemo5(() => {
|
|
787
|
-
if (layoutMode === "deck" && overscroll === "centering") {
|
|
788
|
-
return calculateOverscroll(layoutParts.main?.length ?? 0);
|
|
789
|
-
}
|
|
790
|
-
return {};
|
|
791
|
-
}, [
|
|
792
|
-
layoutMode,
|
|
793
|
-
overscroll,
|
|
794
|
-
layoutParts.main
|
|
795
|
-
]);
|
|
796
|
-
const Dialog = dialogType === "alert" ? AlertDialog : NaturalDialog;
|
|
797
|
-
return /* @__PURE__ */ React14.createElement(Popover2.Root, {
|
|
798
|
-
modal: true,
|
|
799
|
-
open: !!(popoverAnchorId && popoverOpen),
|
|
800
|
-
onOpenChange: (nextOpen) => {
|
|
801
|
-
if (nextOpen && popoverAnchorId) {
|
|
802
|
-
context.popoverOpen = true;
|
|
803
|
-
} else {
|
|
804
|
-
context.popoverOpen = false;
|
|
805
|
-
context.popoverAnchorId = void 0;
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
}, /* @__PURE__ */ React14.createElement(ActiveNode, null), layoutMode === "fullscreen" && /* @__PURE__ */ React14.createElement(Fullscreen, {
|
|
809
|
-
id: fullScreenSlug
|
|
810
|
-
}), layoutMode !== "fullscreen" && /* @__PURE__ */ React14.createElement(Main3.Root, {
|
|
811
|
-
navigationSidebarOpen: context.sidebarOpen,
|
|
812
|
-
onNavigationSidebarOpenChange: (next) => context.sidebarOpen = next,
|
|
813
|
-
complementarySidebarOpen: context.complementarySidebarOpen,
|
|
814
|
-
onComplementarySidebarOpenChange: (next) => context.complementarySidebarOpen = next
|
|
815
|
-
}, /* @__PURE__ */ React14.createElement(Main3.Notch, {
|
|
816
|
-
classNames: "z-[21]"
|
|
817
|
-
}, /* @__PURE__ */ React14.createElement(Surface9, {
|
|
818
|
-
role: "notch-start"
|
|
819
|
-
}), /* @__PURE__ */ React14.createElement(Button3, {
|
|
820
|
-
onClick: () => context.sidebarOpen = !context.sidebarOpen,
|
|
821
|
-
variant: "ghost",
|
|
822
|
-
classNames: "p-1"
|
|
823
|
-
}, /* @__PURE__ */ React14.createElement("span", {
|
|
824
|
-
className: "sr-only"
|
|
825
|
-
}, t("open navigation sidebar label")), /* @__PURE__ */ React14.createElement(MenuIcon, {
|
|
826
|
-
weight: "light",
|
|
827
|
-
className: getSize(5)
|
|
828
|
-
})), /* @__PURE__ */ React14.createElement(Surface9, {
|
|
829
|
-
role: "notch-end"
|
|
830
|
-
})), /* @__PURE__ */ React14.createElement(Sidebar, {
|
|
831
|
-
layoutParts
|
|
832
|
-
}), /* @__PURE__ */ React14.createElement(ComplementarySidebar, {
|
|
833
|
-
panels,
|
|
834
|
-
current: layoutParts.complementary?.[0].id
|
|
835
|
-
}), /* @__PURE__ */ React14.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
|
|
836
|
-
handlesFocus: true
|
|
837
|
-
}, /* @__PURE__ */ React14.createElement(ContentEmpty, null)), !isEmpty && /* @__PURE__ */ React14.createElement(Main3.Content, {
|
|
838
|
-
bounce: true,
|
|
839
|
-
classNames: "grid block-end-[--statusbar-size]",
|
|
840
|
-
handlesFocus: true,
|
|
841
|
-
style: {
|
|
842
|
-
"--dx-main-sidebarWidth": sidebarOpen ? "var(--nav-sidebar-size)" : "0px",
|
|
843
|
-
"--dx-main-complementaryWidth": complementarySidebarOpen ? "var(--complementary-sidebar-size)" : "0px",
|
|
844
|
-
"--dx-main-contentFirstWidth": `${plankSizing[layoutParts.main?.[0]?.id ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
845
|
-
"--dx-main-contentLastWidth": `${plankSizing[layoutParts.main?.[(layoutParts.main?.length ?? 1) - 1]?.id ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
|
|
846
|
-
}
|
|
847
|
-
}, /* @__PURE__ */ React14.createElement("div", {
|
|
848
|
-
role: "none",
|
|
849
|
-
className: !isSoloModeLoaded ? "relative bg-deck overflow-hidden" : "sr-only",
|
|
850
|
-
...isSoloModeLoaded && {
|
|
851
|
-
inert: ""
|
|
852
|
-
}
|
|
853
|
-
}, /* @__PURE__ */ React14.createElement(Stack, {
|
|
854
|
-
orientation: "horizontal",
|
|
855
|
-
size: "contain",
|
|
856
|
-
classNames: [
|
|
857
|
-
"absolute inset-block-0 -inset-inline-px",
|
|
858
|
-
mainPaddingTransitions2
|
|
859
|
-
],
|
|
860
|
-
onScroll: handleScroll,
|
|
861
|
-
itemsCount: 2 * (layoutParts.main?.length ?? 0) - 1,
|
|
862
|
-
style: padding,
|
|
863
|
-
ref: deckRef
|
|
864
|
-
}, layoutParts.main?.map((layoutEntry, index) => /* @__PURE__ */ React14.createElement(Fragment2, {
|
|
865
|
-
key: layoutEntry.id
|
|
866
|
-
}, /* @__PURE__ */ React14.createElement(PlankSeparator, {
|
|
867
|
-
index
|
|
868
|
-
}), /* @__PURE__ */ React14.createElement(Plank, {
|
|
869
|
-
entry: layoutEntry,
|
|
870
|
-
layoutParts,
|
|
871
|
-
part: "main",
|
|
872
|
-
layoutMode,
|
|
873
|
-
order: index * 2 + 1
|
|
874
|
-
}))))), /* @__PURE__ */ React14.createElement("div", {
|
|
875
|
-
role: "none",
|
|
876
|
-
className: isSoloModeLoaded ? "relative bg-deck overflow-hidden" : "sr-only",
|
|
877
|
-
...!isSoloModeLoaded && {
|
|
878
|
-
inert: ""
|
|
879
|
-
}
|
|
880
|
-
}, /* @__PURE__ */ React14.createElement(StackContext2.Provider, {
|
|
881
|
-
value: {
|
|
882
|
-
size: "contain",
|
|
883
|
-
orientation: "horizontal",
|
|
884
|
-
rail: true
|
|
885
|
-
}
|
|
886
|
-
}, /* @__PURE__ */ React14.createElement(Plank, {
|
|
887
|
-
entry: layoutParts.solo?.[0],
|
|
888
|
-
layoutParts,
|
|
889
|
-
part: "solo",
|
|
890
|
-
layoutMode
|
|
891
|
-
})))), /* @__PURE__ */ React14.createElement(StatusBar, {
|
|
892
|
-
showHints
|
|
893
|
-
})), /* @__PURE__ */ React14.createElement(Popover2.Portal, null, /* @__PURE__ */ React14.createElement(Popover2.Content, {
|
|
894
|
-
onEscapeKeyDown: () => {
|
|
895
|
-
context.popoverOpen = false;
|
|
896
|
-
context.popoverAnchorId = void 0;
|
|
897
|
-
}
|
|
898
|
-
}, /* @__PURE__ */ React14.createElement(Popover2.Viewport, null, /* @__PURE__ */ React14.createElement(Surface9, {
|
|
899
|
-
role: "popover",
|
|
900
|
-
data: popoverContent,
|
|
901
|
-
limit: 1
|
|
902
|
-
})), /* @__PURE__ */ React14.createElement(Popover2.Arrow, null))), /* @__PURE__ */ React14.createElement(Dialog.Root, {
|
|
903
|
-
open: dialogOpen,
|
|
904
|
-
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
905
|
-
}, /* @__PURE__ */ React14.createElement(Dialog.Overlay, {
|
|
906
|
-
blockAlign: dialogBlockAlign
|
|
907
|
-
}, /* @__PURE__ */ React14.createElement(Surface9, {
|
|
908
|
-
role: "dialog",
|
|
909
|
-
data: dialogContent,
|
|
910
|
-
limit: 1
|
|
911
|
-
}))), toasts?.map((toast) => /* @__PURE__ */ React14.createElement(Toast, {
|
|
912
|
-
...toast,
|
|
913
|
-
key: toast.id,
|
|
914
|
-
onOpenChange: (open) => {
|
|
915
|
-
if (!open) {
|
|
916
|
-
onDismissToast(toast.id);
|
|
917
|
-
}
|
|
918
|
-
return open;
|
|
919
|
-
}
|
|
920
|
-
})));
|
|
921
|
-
};
|
|
922
|
-
|
|
923
|
-
// packages/plugins/plugin-deck/src/components/LayoutSettings.tsx
|
|
924
|
-
import React15 from "react";
|
|
925
|
-
import { Input, Select, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
926
|
-
import { DeprecatedFormInput } from "@dxos/react-ui-form";
|
|
927
|
-
var isSocket = !!globalThis.__args;
|
|
928
|
-
var LayoutSettings = ({ settings }) => {
|
|
929
|
-
const { t } = useTranslation7(DECK_PLUGIN);
|
|
930
|
-
return /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(DeprecatedFormInput, {
|
|
931
|
-
label: t("select new plank positioning label")
|
|
932
|
-
}, /* @__PURE__ */ React15.createElement(Select.Root, {
|
|
933
|
-
value: settings.newPlankPositioning ?? "start",
|
|
934
|
-
onValueChange: (value) => settings.newPlankPositioning = value
|
|
935
|
-
}, /* @__PURE__ */ React15.createElement(Select.TriggerButton, {
|
|
936
|
-
placeholder: t("select new plank positioning placeholder")
|
|
937
|
-
}), /* @__PURE__ */ React15.createElement(Select.Portal, null, /* @__PURE__ */ React15.createElement(Select.Content, null, /* @__PURE__ */ React15.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React15.createElement(Select.Option, {
|
|
938
|
-
key: position,
|
|
939
|
-
value: position
|
|
940
|
-
}, t(`settings new plank position ${position} label`)))))))), /* @__PURE__ */ React15.createElement(DeprecatedFormInput, {
|
|
941
|
-
label: t("settings overscroll label")
|
|
942
|
-
}, /* @__PURE__ */ React15.createElement(Select.Root, {
|
|
943
|
-
value: settings.overscroll ?? "none",
|
|
944
|
-
onValueChange: (value) => settings.overscroll = value
|
|
945
|
-
}, /* @__PURE__ */ React15.createElement(Select.TriggerButton, {
|
|
946
|
-
placeholder: t("select overscroll placeholder")
|
|
947
|
-
}), /* @__PURE__ */ React15.createElement(Select.Portal, null, /* @__PURE__ */ React15.createElement(Select.Content, null, /* @__PURE__ */ React15.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React15.createElement(Select.Option, {
|
|
948
|
-
key: option,
|
|
949
|
-
value: option
|
|
950
|
-
}, t(`settings overscroll ${option} label`)))))))), /* @__PURE__ */ React15.createElement(DeprecatedFormInput, {
|
|
951
|
-
label: t("settings show hints label")
|
|
952
|
-
}, /* @__PURE__ */ React15.createElement(Input.Switch, {
|
|
953
|
-
checked: settings.showHints,
|
|
954
|
-
onCheckedChange: (checked) => settings.showHints = checked
|
|
955
|
-
})), !isSocket && /* @__PURE__ */ React15.createElement(DeprecatedFormInput, {
|
|
956
|
-
label: t("settings native redirect label")
|
|
957
|
-
}, /* @__PURE__ */ React15.createElement(Input.Switch, {
|
|
958
|
-
checked: settings.enableNativeRedirect,
|
|
959
|
-
onCheckedChange: (checked) => settings.enableNativeRedirect = checked
|
|
960
|
-
})), /* @__PURE__ */ React15.createElement(DeprecatedFormInput, {
|
|
961
|
-
label: t("settings custom slots")
|
|
962
|
-
}, /* @__PURE__ */ React15.createElement(Input.Switch, {
|
|
963
|
-
checked: settings.customSlots,
|
|
964
|
-
onCheckedChange: (checked) => settings.customSlots = checked
|
|
965
|
-
})), /* @__PURE__ */ React15.createElement(DeprecatedFormInput, {
|
|
966
|
-
label: t("settings flat deck")
|
|
967
|
-
}, /* @__PURE__ */ React15.createElement(Input.Switch, {
|
|
968
|
-
checked: settings.flatDeck,
|
|
969
|
-
onCheckedChange: (checked) => settings.flatDeck = checked
|
|
970
|
-
})));
|
|
971
|
-
};
|
|
972
|
-
|
|
973
|
-
// packages/plugins/plugin-deck/src/layout.ts
|
|
974
|
-
import { produce } from "immer";
|
|
975
|
-
import { SLUG_ENTRY_SEPARATOR, SLUG_KEY_VALUE_SEPARATOR, SLUG_LIST_SEPARATOR, SLUG_PATH_SEPARATOR as SLUG_PATH_SEPARATOR3 } from "@dxos/app-framework";
|
|
976
|
-
var partsThatSupportIncrement = [
|
|
977
|
-
"main"
|
|
978
|
-
];
|
|
979
|
-
var openEntry = (layout, part, entry, options) => {
|
|
980
|
-
return produce(layout, (draft) => {
|
|
981
|
-
const layoutPart = draft[part];
|
|
982
|
-
if (!layoutPart) {
|
|
983
|
-
draft[part] = [
|
|
984
|
-
entry
|
|
985
|
-
];
|
|
986
|
-
return;
|
|
987
|
-
}
|
|
988
|
-
if (part === "main") {
|
|
989
|
-
if (layoutPart.find((e) => e.id === entry.id)) {
|
|
990
|
-
return;
|
|
991
|
-
}
|
|
992
|
-
const plankPositioning = options?.positioning ?? "start";
|
|
993
|
-
const pivotId = options?.pivotId;
|
|
994
|
-
if (pivotId) {
|
|
995
|
-
const pivotIndex = layoutPart.findIndex((e) => e.id === pivotId);
|
|
996
|
-
if (pivotIndex !== -1) {
|
|
997
|
-
if (plankPositioning === "start") {
|
|
998
|
-
layoutPart.splice(pivotIndex, 0, entry);
|
|
999
|
-
} else {
|
|
1000
|
-
layoutPart.splice(pivotIndex + 1, 0, entry);
|
|
1001
|
-
}
|
|
1002
|
-
return;
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
if (plankPositioning === "start") {
|
|
1006
|
-
layoutPart.unshift(entry);
|
|
1007
|
-
} else {
|
|
1008
|
-
layoutPart.push(entry);
|
|
1009
|
-
}
|
|
1010
|
-
} else {
|
|
1011
|
-
draft[part] = [
|
|
1012
|
-
entry
|
|
1013
|
-
];
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
};
|
|
1017
|
-
var closeEntry = (layout, layoutCoordinate) => {
|
|
1018
|
-
return produce(layout, (draft) => {
|
|
1019
|
-
const { part, entryId: slugId } = layoutCoordinate;
|
|
1020
|
-
const layoutPart = draft[part];
|
|
1021
|
-
if (!layoutPart) {
|
|
1022
|
-
return;
|
|
1023
|
-
}
|
|
1024
|
-
const index = layoutPart.findIndex((entry) => entry.id === slugId);
|
|
1025
|
-
if (index === -1) {
|
|
1026
|
-
return;
|
|
1027
|
-
}
|
|
1028
|
-
if (layoutPart.length === 1) {
|
|
1029
|
-
delete draft[part];
|
|
1030
|
-
} else {
|
|
1031
|
-
layoutPart.splice(index, 1);
|
|
1032
|
-
}
|
|
1033
|
-
});
|
|
1034
|
-
};
|
|
1035
|
-
var incrementPlank = (layout, adjustment) => {
|
|
1036
|
-
return produce(layout, (draft) => {
|
|
1037
|
-
const { layoutCoordinate, type } = adjustment;
|
|
1038
|
-
const { part, entryId } = layoutCoordinate;
|
|
1039
|
-
if (partsThatSupportIncrement.includes(part) === false) {
|
|
1040
|
-
return;
|
|
1041
|
-
}
|
|
1042
|
-
const layoutPart = draft[part];
|
|
1043
|
-
if (!layoutPart) {
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1046
|
-
const index = layoutPart.findIndex((entry) => entry.id === entryId);
|
|
1047
|
-
if (index === -1 || type === "increment-start" && index === 0 || type === "increment-end" && index === layoutPart.length - 1) {
|
|
1048
|
-
return;
|
|
1049
|
-
}
|
|
1050
|
-
if (type === "increment-start") {
|
|
1051
|
-
[layoutPart[index - 1], layoutPart[index]] = [
|
|
1052
|
-
layoutPart[index],
|
|
1053
|
-
layoutPart[index - 1]
|
|
1054
|
-
];
|
|
1055
|
-
} else if (type === "increment-end") {
|
|
1056
|
-
[layoutPart[index], layoutPart[index + 1]] = [
|
|
1057
|
-
layoutPart[index + 1],
|
|
1058
|
-
layoutPart[index]
|
|
1059
|
-
];
|
|
1060
|
-
}
|
|
1061
|
-
});
|
|
1062
|
-
};
|
|
1063
|
-
var removePart = (layout, part) => {
|
|
1064
|
-
return produce(layout, (draft) => {
|
|
1065
|
-
delete draft[part];
|
|
1066
|
-
});
|
|
1067
|
-
};
|
|
1068
|
-
var mergeLayoutParts = (...layoutParts) => {
|
|
1069
|
-
return layoutParts.reduce((merged, current) => produce(merged, (draft) => {
|
|
1070
|
-
Object.entries(current).forEach(([part, entries]) => {
|
|
1071
|
-
const typedPart = part;
|
|
1072
|
-
if (!draft[typedPart]) {
|
|
1073
|
-
draft[typedPart] = [];
|
|
1074
|
-
}
|
|
1075
|
-
const partEntries = draft[typedPart];
|
|
1076
|
-
entries.forEach((entry) => {
|
|
1077
|
-
const existingIndex = partEntries.findIndex((e) => e.id === entry.id);
|
|
1078
|
-
if (existingIndex !== -1) {
|
|
1079
|
-
partEntries[existingIndex] = entry;
|
|
1080
|
-
} else {
|
|
1081
|
-
partEntries.push(entry);
|
|
1082
|
-
}
|
|
1083
|
-
});
|
|
1084
|
-
});
|
|
1085
|
-
}), {});
|
|
1086
|
-
};
|
|
1087
|
-
var parseLayoutEntry = (itemString) => {
|
|
1088
|
-
const [id, path] = itemString.split(SLUG_PATH_SEPARATOR3);
|
|
1089
|
-
const entry = {
|
|
1090
|
-
id
|
|
1091
|
-
};
|
|
1092
|
-
if (path) {
|
|
1093
|
-
entry.path = path;
|
|
1094
|
-
}
|
|
1095
|
-
return entry;
|
|
1096
|
-
};
|
|
1097
|
-
var uriToSoloPart = (uri) => {
|
|
1098
|
-
const parts = uri.split("/");
|
|
1099
|
-
const slug = parts[parts.length - 1];
|
|
1100
|
-
if (slug.length > 0) {
|
|
1101
|
-
return {
|
|
1102
|
-
solo: [
|
|
1103
|
-
parseLayoutEntry(slug)
|
|
1104
|
-
]
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
return void 0;
|
|
1108
|
-
};
|
|
1109
|
-
var soloPartToUri = (layout) => {
|
|
1110
|
-
const soloPart = layout?.solo;
|
|
1111
|
-
if (!soloPart || soloPart.length === 0) {
|
|
1112
|
-
return "";
|
|
1113
|
-
}
|
|
1114
|
-
const entry = soloPart[0];
|
|
1115
|
-
return `${entry.id}${entry.path ? SLUG_PATH_SEPARATOR3 + entry.path : ""}`;
|
|
1116
|
-
};
|
|
1117
|
-
|
|
1118
31
|
// packages/plugins/plugin-deck/src/translations.ts
|
|
1119
32
|
var translations_default = [
|
|
1120
33
|
{
|
|
1121
34
|
"en-US": {
|
|
1122
35
|
[DECK_PLUGIN]: {
|
|
36
|
+
"plugin name": "Deck",
|
|
1123
37
|
"main header label": "Main header",
|
|
1124
|
-
"open navigation sidebar label": "Open
|
|
1125
|
-
"
|
|
38
|
+
"open navigation sidebar label": "Open sidebar",
|
|
39
|
+
"collapse navigation sidebar label": "Minimize sidebar",
|
|
40
|
+
"open complementary sidebar label": "Open context sidebar",
|
|
41
|
+
"close complementary sidebar label": "Minimize context sidebar",
|
|
1126
42
|
"plugin error message": "Content failed to render.",
|
|
1127
43
|
"content fallback message": "Unsupported",
|
|
1128
44
|
"content fallback description": "No plugin had a response for the address you navigated\xA0to. Double-check the URL, and ensure you\u2019ve enabled a plugin that supports the\xA0object.",
|
|
1129
45
|
"toggle fullscreen label": "Toggle fullscreen",
|
|
1130
46
|
"settings show hints label": "Show hints",
|
|
1131
47
|
"settings native redirect label": "Enable native url redirect (experimental)",
|
|
1132
|
-
"settings custom slots": "Theme option (experimental)",
|
|
1133
48
|
"settings new plank position start label": "Start",
|
|
1134
49
|
"settings new plank position end label": "End",
|
|
1135
50
|
"select new plank positioning placeholder": "Select new plank positioning",
|
|
@@ -1141,7 +56,7 @@ var translations_default = [
|
|
|
1141
56
|
"error fallback message": "Unable to open this item",
|
|
1142
57
|
"plank heading fallback label": "Untitled",
|
|
1143
58
|
"actions menu label": "Options",
|
|
1144
|
-
"settings deck label": "Disable
|
|
59
|
+
"settings deck label": "Disable deck",
|
|
1145
60
|
"reload required message": "Reload required.",
|
|
1146
61
|
"pending heading": "Loading\u2026",
|
|
1147
62
|
"insert plank label": "Open",
|
|
@@ -1154,11 +69,11 @@ var translations_default = [
|
|
|
1154
69
|
"show solo plank label": "Maximize",
|
|
1155
70
|
"close label": "Close",
|
|
1156
71
|
"minify label": "Minify",
|
|
1157
|
-
"settings overscroll label": "Plank
|
|
72
|
+
"settings overscroll label": "Plank overscrolling",
|
|
1158
73
|
"select overscroll placeholder": "Select plank overscrolling behavior",
|
|
1159
74
|
"settings overscroll centering label": "Centering",
|
|
1160
75
|
"settings overscroll none label": "None",
|
|
1161
|
-
"settings
|
|
76
|
+
"settings enable ide-style statusbar label": "IDE-style statusbar",
|
|
1162
77
|
"close current label": "Close current plank",
|
|
1163
78
|
"close others label": "Close other planks",
|
|
1164
79
|
"close all label": "Close all planks"
|
|
@@ -1167,667 +82,67 @@ var translations_default = [
|
|
|
1167
82
|
}
|
|
1168
83
|
];
|
|
1169
84
|
|
|
1170
|
-
// packages/plugins/plugin-deck/src/DeckPlugin.
|
|
1171
|
-
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-deck/src/DeckPlugin.tsx";
|
|
1172
|
-
var isSocket2 = !!globalThis.__args;
|
|
1173
|
-
var appScheme = "composer://";
|
|
85
|
+
// packages/plugins/plugin-deck/src/DeckPlugin.ts
|
|
1174
86
|
setAutoFreeze(false);
|
|
1175
|
-
var DeckPlugin = (
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
}
|
|
1230
|
-
case "dialog": {
|
|
1231
|
-
layout.values.dialogOpen = state ?? Boolean(component);
|
|
1232
|
-
layout.values.dialogContent = component ? {
|
|
1233
|
-
component,
|
|
1234
|
-
subject
|
|
1235
|
-
} : null;
|
|
1236
|
-
layout.values.dialogBlockAlign = dialogBlockAlign ?? "center";
|
|
1237
|
-
layout.values.dialogType = dialogType;
|
|
1238
|
-
break;
|
|
1239
|
-
}
|
|
1240
|
-
case "popover": {
|
|
1241
|
-
layout.values.popoverOpen = state ?? Boolean(component);
|
|
1242
|
-
layout.values.popoverContent = component ? {
|
|
1243
|
-
component,
|
|
1244
|
-
subject
|
|
1245
|
-
} : null;
|
|
1246
|
-
layout.values.popoverAnchorId = anchorId;
|
|
1247
|
-
break;
|
|
1248
|
-
}
|
|
1249
|
-
case "toast": {
|
|
1250
|
-
if (S.is(ToastSchema)(subject)) {
|
|
1251
|
-
layout.values.toasts = [
|
|
1252
|
-
...layout.values.toasts,
|
|
1253
|
-
subject
|
|
1254
|
-
];
|
|
1255
|
-
}
|
|
1256
|
-
break;
|
|
1257
|
-
}
|
|
1258
|
-
}
|
|
1259
|
-
};
|
|
1260
|
-
const handleSetLocation = (next) => {
|
|
1261
|
-
const part = layout.values.layoutMode === "solo" ? "solo" : "main";
|
|
1262
|
-
const ids = openIds(next, [
|
|
1263
|
-
part
|
|
1264
|
-
]);
|
|
1265
|
-
const current = openIds(location.values.active, [
|
|
1266
|
-
part
|
|
1267
|
-
]);
|
|
1268
|
-
const removed = current.filter((id) => !ids.includes(id));
|
|
1269
|
-
const closed = Array.from(/* @__PURE__ */ new Set([
|
|
1270
|
-
...location.values.closed.filter((id) => !ids.includes(id)),
|
|
1271
|
-
...removed
|
|
1272
|
-
]));
|
|
1273
|
-
location.values.closed = closed;
|
|
1274
|
-
location.values.active = next;
|
|
1275
|
-
if (attentionPlugin) {
|
|
1276
|
-
const attended = attentionPlugin.provides.attention.attended;
|
|
1277
|
-
const [attendedId] = Array.from(attended);
|
|
1278
|
-
const isAttendedAvailable = !!attendedId && ids.includes(attendedId);
|
|
1279
|
-
if (!isAttendedAvailable) {
|
|
1280
|
-
const currentIds = location.values.active[part]?.map(({ id }) => id) ?? [];
|
|
1281
|
-
const attendedIndex = currentIds.indexOf(attendedId);
|
|
1282
|
-
const index = attendedIndex === -1 ? 0 : attendedIndex >= ids.length ? ids.length - 1 : attendedIndex;
|
|
1283
|
-
return next[part]?.[index].id;
|
|
1284
|
-
}
|
|
1285
|
-
}
|
|
1286
|
-
};
|
|
1287
|
-
return {
|
|
1288
|
-
meta: meta_default,
|
|
1289
|
-
ready: async ({ plugins }) => {
|
|
1290
|
-
attentionPlugin = resolvePlugin(plugins, parseAttentionPlugin);
|
|
1291
|
-
intentPlugin = resolvePlugin(plugins, parseIntentPlugin);
|
|
1292
|
-
const dispatch = intentPlugin?.provides.intent.dispatchPromise;
|
|
1293
|
-
layout.prop({
|
|
1294
|
-
key: "layoutMode",
|
|
1295
|
-
type: LocalStorageStore.enum()
|
|
1296
|
-
}).prop({
|
|
1297
|
-
key: "sidebarOpen",
|
|
1298
|
-
type: LocalStorageStore.bool()
|
|
1299
|
-
}).prop({
|
|
1300
|
-
key: "complementarySidebarOpen",
|
|
1301
|
-
type: LocalStorageStore.bool()
|
|
1302
|
-
});
|
|
1303
|
-
deck.prop({
|
|
1304
|
-
key: "plankSizing",
|
|
1305
|
-
type: LocalStorageStore.json()
|
|
1306
|
-
});
|
|
1307
|
-
location.prop({
|
|
1308
|
-
key: "active",
|
|
1309
|
-
type: LocalStorageStore.json()
|
|
1310
|
-
}).prop({
|
|
1311
|
-
key: "closed",
|
|
1312
|
-
type: LocalStorageStore.json()
|
|
1313
|
-
});
|
|
1314
|
-
panels.push(...filterPlugins(plugins, parsePanelPlugin).flatMap((plugin) => plugin.provides.complementary.panels));
|
|
1315
|
-
settings.prop({
|
|
1316
|
-
key: "showHints",
|
|
1317
|
-
type: LocalStorageStore.bool()
|
|
1318
|
-
}).prop({
|
|
1319
|
-
key: "customSlots",
|
|
1320
|
-
type: LocalStorageStore.bool()
|
|
1321
|
-
}).prop({
|
|
1322
|
-
key: "flatDeck",
|
|
1323
|
-
type: LocalStorageStore.bool()
|
|
1324
|
-
}).prop({
|
|
1325
|
-
key: "enableNativeRedirect",
|
|
1326
|
-
type: LocalStorageStore.bool()
|
|
1327
|
-
}).prop({
|
|
1328
|
-
key: "disableDeck",
|
|
1329
|
-
type: LocalStorageStore.bool()
|
|
1330
|
-
}).prop({
|
|
1331
|
-
key: "newPlankPositioning",
|
|
1332
|
-
type: LocalStorageStore.enum()
|
|
1333
|
-
}).prop({
|
|
1334
|
-
key: "overscroll",
|
|
1335
|
-
type: LocalStorageStore.enum()
|
|
1336
|
-
});
|
|
1337
|
-
if (!isSocket2 && settings.values.enableNativeRedirect) {
|
|
1338
|
-
checkAppScheme(appScheme);
|
|
1339
|
-
}
|
|
1340
|
-
handleNavigation = async () => {
|
|
1341
|
-
const pathname = window.location.pathname;
|
|
1342
|
-
if (pathname === "/reset") {
|
|
1343
|
-
handleSetLocation({
|
|
1344
|
-
sidebar: [
|
|
1345
|
-
{
|
|
1346
|
-
id: NAV_ID
|
|
1347
|
-
}
|
|
1348
|
-
]
|
|
1349
|
-
});
|
|
1350
|
-
location.values.closed = [];
|
|
1351
|
-
layout.values.layoutMode = "solo";
|
|
1352
|
-
window.location.pathname = "/";
|
|
1353
|
-
return;
|
|
1354
|
-
}
|
|
1355
|
-
const startingLayout = removePart(location.values.active, "solo");
|
|
1356
|
-
const layoutFromUri = uriToSoloPart(pathname);
|
|
1357
|
-
if (!layoutFromUri) {
|
|
1358
|
-
const toAttend2 = handleSetLocation(startingLayout);
|
|
1359
|
-
layout.values.layoutMode = "deck";
|
|
1360
|
-
await dispatch?.(createIntent4(LayoutAction3.ScrollIntoView, {
|
|
1361
|
-
id: toAttend2
|
|
1362
|
-
}));
|
|
1363
|
-
return;
|
|
1364
|
-
}
|
|
1365
|
-
const toAttend = handleSetLocation(mergeLayoutParts(layoutFromUri, startingLayout));
|
|
1366
|
-
layout.values.layoutMode = "solo";
|
|
1367
|
-
await dispatch?.(createIntent4(LayoutAction3.ScrollIntoView, {
|
|
1368
|
-
id: toAttend
|
|
1369
|
-
}));
|
|
1370
|
-
};
|
|
1371
|
-
await handleNavigation();
|
|
1372
|
-
window.addEventListener("popstate", handleNavigation);
|
|
1373
|
-
unsubscriptionCallbacks.push(scheduledEffect(() => ({
|
|
1374
|
-
selectedPath: soloPartToUri(location.values.active)
|
|
1375
|
-
}), ({ selectedPath }) => {
|
|
1376
|
-
history.pushState(null, "", `/${selectedPath}${window.location.search}`);
|
|
1377
|
-
}));
|
|
1378
|
-
layoutModeHistory.values.push(`${layout.values.layoutMode}`);
|
|
1379
|
-
},
|
|
1380
|
-
unload: async () => {
|
|
1381
|
-
layout.close();
|
|
1382
|
-
location.close();
|
|
1383
|
-
unsubscriptionCallbacks.forEach((unsubscribe) => unsubscribe?.());
|
|
1384
|
-
window.removeEventListener("popstate", handleNavigation);
|
|
1385
|
-
},
|
|
1386
|
-
provides: {
|
|
1387
|
-
settings: settings.values,
|
|
1388
|
-
layout: layout.values,
|
|
1389
|
-
location: location.values,
|
|
1390
|
-
translations: [
|
|
1391
|
-
...translations_default,
|
|
1392
|
-
...stackTranslations
|
|
1393
|
-
],
|
|
1394
|
-
graph: {
|
|
1395
|
-
builder: (plugins) => {
|
|
1396
|
-
const dispatch = resolvePlugin(plugins, parseIntentPlugin)?.provides.intent.dispatchPromise;
|
|
1397
|
-
const attention = resolvePlugin(plugins, parseAttentionPlugin)?.provides.attention;
|
|
1398
|
-
invariant(dispatch, "Intent plugin is required for deck plugin.", {
|
|
1399
|
-
F: __dxlog_file,
|
|
1400
|
-
L: 295,
|
|
1401
|
-
S: void 0,
|
|
1402
|
-
A: [
|
|
1403
|
-
"dispatch",
|
|
1404
|
-
"'Intent plugin is required for deck plugin.'"
|
|
1405
|
-
]
|
|
1406
|
-
});
|
|
1407
|
-
invariant(attention, "Attention plugin is required for deck plugin.", {
|
|
1408
|
-
F: __dxlog_file,
|
|
1409
|
-
L: 296,
|
|
1410
|
-
S: void 0,
|
|
1411
|
-
A: [
|
|
1412
|
-
"attention",
|
|
1413
|
-
"'Attention plugin is required for deck plugin.'"
|
|
1414
|
-
]
|
|
1415
|
-
});
|
|
1416
|
-
return createExtension({
|
|
1417
|
-
id: DECK_PLUGIN,
|
|
1418
|
-
filter: (node) => node.id === ROOT_ID,
|
|
1419
|
-
actions: () => {
|
|
1420
|
-
const _fullscreen = {
|
|
1421
|
-
id: `${LayoutAction3.SetLayoutMode._tag}/fullscreen`,
|
|
1422
|
-
data: async () => {
|
|
1423
|
-
await dispatch(createIntent4(LayoutAction3.SetLayoutMode, {
|
|
1424
|
-
layoutMode: "fullscreen"
|
|
1425
|
-
}));
|
|
1426
|
-
},
|
|
1427
|
-
properties: {
|
|
1428
|
-
label: [
|
|
1429
|
-
"toggle fullscreen label",
|
|
1430
|
-
{
|
|
1431
|
-
ns: DECK_PLUGIN
|
|
1432
|
-
}
|
|
1433
|
-
],
|
|
1434
|
-
icon: "ph--arrows-out--regular",
|
|
1435
|
-
keyBinding: {
|
|
1436
|
-
macos: "ctrl+meta+f",
|
|
1437
|
-
windows: "shift+ctrl+f"
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
};
|
|
1441
|
-
const closeCurrent = {
|
|
1442
|
-
id: `${NavigationAction3.Close._tag}/current`,
|
|
1443
|
-
data: async () => {
|
|
1444
|
-
const attended = attention.attended.at(-1);
|
|
1445
|
-
if (attended) {
|
|
1446
|
-
await dispatch(createIntent4(NavigationAction3.Close, {
|
|
1447
|
-
activeParts: {
|
|
1448
|
-
main: [
|
|
1449
|
-
attended
|
|
1450
|
-
]
|
|
1451
|
-
}
|
|
1452
|
-
}));
|
|
1453
|
-
}
|
|
1454
|
-
},
|
|
1455
|
-
properties: {
|
|
1456
|
-
label: [
|
|
1457
|
-
"close current label",
|
|
1458
|
-
{
|
|
1459
|
-
ns: DECK_PLUGIN
|
|
1460
|
-
}
|
|
1461
|
-
],
|
|
1462
|
-
icon: "ph--x--regular"
|
|
1463
|
-
}
|
|
1464
|
-
};
|
|
1465
|
-
const closeOthers = {
|
|
1466
|
-
id: `${NavigationAction3.Close._tag}/others`,
|
|
1467
|
-
data: async () => {
|
|
1468
|
-
const attended = attention.attended.at(-1);
|
|
1469
|
-
const ids = openIds(location.values.active, [
|
|
1470
|
-
"main"
|
|
1471
|
-
]).filter((id) => id !== attended);
|
|
1472
|
-
await dispatch(createIntent4(NavigationAction3.Close, {
|
|
1473
|
-
activeParts: {
|
|
1474
|
-
main: ids
|
|
1475
|
-
}
|
|
1476
|
-
}));
|
|
1477
|
-
},
|
|
1478
|
-
properties: {
|
|
1479
|
-
label: [
|
|
1480
|
-
"close others label",
|
|
1481
|
-
{
|
|
1482
|
-
ns: DECK_PLUGIN
|
|
1483
|
-
}
|
|
1484
|
-
],
|
|
1485
|
-
icon: "ph--x-square--regular"
|
|
1486
|
-
}
|
|
1487
|
-
};
|
|
1488
|
-
const closeAll = {
|
|
1489
|
-
id: `${NavigationAction3.Close._tag}/all`,
|
|
1490
|
-
data: async () => {
|
|
1491
|
-
await dispatch(createIntent4(NavigationAction3.Close, {
|
|
1492
|
-
activeParts: {
|
|
1493
|
-
main: openIds(location.values.active, [
|
|
1494
|
-
"main"
|
|
1495
|
-
])
|
|
1496
|
-
}
|
|
1497
|
-
}));
|
|
1498
|
-
},
|
|
1499
|
-
properties: {
|
|
1500
|
-
label: [
|
|
1501
|
-
"close all label",
|
|
1502
|
-
{
|
|
1503
|
-
ns: DECK_PLUGIN
|
|
1504
|
-
}
|
|
1505
|
-
],
|
|
1506
|
-
icon: "ph--x-circle--regular"
|
|
1507
|
-
}
|
|
1508
|
-
};
|
|
1509
|
-
return layout.values.layoutMode === "deck" ? [
|
|
1510
|
-
closeCurrent,
|
|
1511
|
-
closeOthers,
|
|
1512
|
-
closeAll
|
|
1513
|
-
] : [];
|
|
1514
|
-
}
|
|
1515
|
-
});
|
|
1516
|
-
}
|
|
1517
|
-
},
|
|
1518
|
-
context: (props) => /* @__PURE__ */ React16.createElement(LayoutContext.Provider, {
|
|
1519
|
-
value: layout.values
|
|
1520
|
-
}, /* @__PURE__ */ React16.createElement(DeckContext.Provider, {
|
|
1521
|
-
value: deck.values
|
|
1522
|
-
}, props.children)),
|
|
1523
|
-
root: () => {
|
|
1524
|
-
return /* @__PURE__ */ React16.createElement(DeckLayout, {
|
|
1525
|
-
layoutParts: location.values.active,
|
|
1526
|
-
showHints: settings.values.showHints,
|
|
1527
|
-
overscroll: settings.values.overscroll,
|
|
1528
|
-
toasts: layout.values.toasts,
|
|
1529
|
-
panels,
|
|
1530
|
-
onDismissToast: (id) => {
|
|
1531
|
-
const index = layout.values.toasts.findIndex((toast) => toast.id === id);
|
|
1532
|
-
if (index !== -1) {
|
|
1533
|
-
setTimeout(() => {
|
|
1534
|
-
if (layout.values.toasts[index].id === currentUndoId) {
|
|
1535
|
-
currentUndoId = void 0;
|
|
1536
|
-
}
|
|
1537
|
-
layout.values.toasts.splice(index, 1);
|
|
1538
|
-
}, 1e3);
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
});
|
|
1542
|
-
},
|
|
1543
|
-
surface: {
|
|
1544
|
-
definitions: () => createSurface({
|
|
1545
|
-
id: DECK_PLUGIN,
|
|
1546
|
-
role: "settings",
|
|
1547
|
-
filter: (data) => data.subject === DECK_PLUGIN,
|
|
1548
|
-
component: () => /* @__PURE__ */ React16.createElement(LayoutSettings, {
|
|
1549
|
-
settings: settings.values
|
|
1550
|
-
})
|
|
1551
|
-
})
|
|
1552
|
-
},
|
|
1553
|
-
intent: {
|
|
1554
|
-
resolvers: ({ plugins }) => {
|
|
1555
|
-
const graph = resolvePlugin(plugins, parseGraphPlugin)?.provides.graph;
|
|
1556
|
-
return [
|
|
1557
|
-
createResolver(DeckAction.UpdatePlankSize, (data) => {
|
|
1558
|
-
deck.values.plankSizing[data.id] = data.size;
|
|
1559
|
-
}),
|
|
1560
|
-
createResolver(IntentAction.ShowUndo, (data) => {
|
|
1561
|
-
if (currentUndoId) {
|
|
1562
|
-
layout.values.toasts = layout.values.toasts.filter((toast) => toast.id !== currentUndoId);
|
|
1563
|
-
}
|
|
1564
|
-
currentUndoId = `${IntentAction.ShowUndo._tag}-${Date.now()}`;
|
|
1565
|
-
layout.values.toasts = [
|
|
1566
|
-
...layout.values.toasts,
|
|
1567
|
-
{
|
|
1568
|
-
id: currentUndoId,
|
|
1569
|
-
title: data.message ?? [
|
|
1570
|
-
"undo available label",
|
|
1571
|
-
{
|
|
1572
|
-
ns: DECK_PLUGIN
|
|
1573
|
-
}
|
|
1574
|
-
],
|
|
1575
|
-
duration: 1e4,
|
|
1576
|
-
actionLabel: [
|
|
1577
|
-
"undo action label",
|
|
1578
|
-
{
|
|
1579
|
-
ns: DECK_PLUGIN
|
|
1580
|
-
}
|
|
1581
|
-
],
|
|
1582
|
-
actionAlt: [
|
|
1583
|
-
"undo action alt",
|
|
1584
|
-
{
|
|
1585
|
-
ns: DECK_PLUGIN
|
|
1586
|
-
}
|
|
1587
|
-
],
|
|
1588
|
-
closeLabel: [
|
|
1589
|
-
"undo close label",
|
|
1590
|
-
{
|
|
1591
|
-
ns: DECK_PLUGIN
|
|
1592
|
-
}
|
|
1593
|
-
],
|
|
1594
|
-
onAction: () => intentPlugin?.provides.intent.undoPromise?.()
|
|
1595
|
-
}
|
|
1596
|
-
];
|
|
1597
|
-
}),
|
|
1598
|
-
createResolver(LayoutAction3.SetLayout, handleSetLayout),
|
|
1599
|
-
createResolver(LayoutAction3.SetLayoutMode, (data) => {
|
|
1600
|
-
const setMode = (mode) => {
|
|
1601
|
-
const main = openIds(location.values.active, [
|
|
1602
|
-
"main"
|
|
1603
|
-
]);
|
|
1604
|
-
const solo = openIds(location.values.active, [
|
|
1605
|
-
"solo"
|
|
1606
|
-
]);
|
|
1607
|
-
const current = layout.values.layoutMode === "solo" ? solo : main;
|
|
1608
|
-
const next = mode === "solo" ? solo : [
|
|
1609
|
-
...main,
|
|
1610
|
-
...solo
|
|
1611
|
-
];
|
|
1612
|
-
const removed = current.filter((id) => !next.includes(id));
|
|
1613
|
-
const closed = Array.from(/* @__PURE__ */ new Set([
|
|
1614
|
-
...location.values.closed.filter((id) => !next.includes(id)),
|
|
1615
|
-
...removed
|
|
1616
|
-
]));
|
|
1617
|
-
location.values.closed = closed;
|
|
1618
|
-
layout.values.layoutMode = mode;
|
|
1619
|
-
};
|
|
1620
|
-
return batch(() => {
|
|
1621
|
-
if ("layoutMode" in data) {
|
|
1622
|
-
layoutModeHistory.values.push(layout.values.layoutMode);
|
|
1623
|
-
setMode(data.layoutMode);
|
|
1624
|
-
} else if (data.revert) {
|
|
1625
|
-
setMode(layoutModeHistory.values.pop() ?? "solo");
|
|
1626
|
-
} else {
|
|
1627
|
-
log.warn("Invalid layout mode", data, {
|
|
1628
|
-
F: __dxlog_file,
|
|
1629
|
-
L: 460,
|
|
1630
|
-
S: void 0,
|
|
1631
|
-
C: (f, a) => f(...a)
|
|
1632
|
-
});
|
|
1633
|
-
}
|
|
1634
|
-
});
|
|
1635
|
-
}),
|
|
1636
|
-
createResolver(LayoutAction3.ScrollIntoView, ({ id }) => {
|
|
1637
|
-
layout.values.scrollIntoView = id;
|
|
1638
|
-
}),
|
|
1639
|
-
// TODO(wittjosiah): Factor out navgiation from deck plugin.
|
|
1640
|
-
createResolver(NavigationAction3.Open, (data) => {
|
|
1641
|
-
const previouslyOpenIds = new Set(openIds(location.values.active));
|
|
1642
|
-
const layoutMode = layout.values.layoutMode;
|
|
1643
|
-
const toAttend = batch(() => {
|
|
1644
|
-
const processLayoutEntry = (partName, entryString, currentLayout) => {
|
|
1645
|
-
const toggle = false;
|
|
1646
|
-
const [id, path] = entryString.split(SLUG_PATH_SEPARATOR4);
|
|
1647
|
-
const layoutEntry = {
|
|
1648
|
-
id,
|
|
1649
|
-
...path ? {
|
|
1650
|
-
path
|
|
1651
|
-
} : {}
|
|
1652
|
-
};
|
|
1653
|
-
const effectivePart = getEffectivePart(partName, layoutMode);
|
|
1654
|
-
if (toggle && layoutMode === "deck" && effectivePart === "main" && currentLayout[effectivePart]?.some((entry) => entry.id === id) && !data?.noToggle) {
|
|
1655
|
-
return closeEntry(currentLayout, {
|
|
1656
|
-
part: effectivePart,
|
|
1657
|
-
entryId: id
|
|
1658
|
-
});
|
|
1659
|
-
} else {
|
|
1660
|
-
return openEntry(currentLayout, effectivePart, layoutEntry, {
|
|
1661
|
-
positioning: settings.values.newPlankPositioning
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
};
|
|
1665
|
-
let newLayout = location.values.active;
|
|
1666
|
-
Object.entries(data.activeParts).forEach(([partName, layoutEntries]) => {
|
|
1667
|
-
if (Array.isArray(layoutEntries)) {
|
|
1668
|
-
layoutEntries.forEach((activePartEntry) => {
|
|
1669
|
-
newLayout = processLayoutEntry(partName, activePartEntry, newLayout);
|
|
1670
|
-
});
|
|
1671
|
-
} else if (typeof layoutEntries === "string") {
|
|
1672
|
-
newLayout = processLayoutEntry(partName, layoutEntries, newLayout);
|
|
1673
|
-
}
|
|
1674
|
-
});
|
|
1675
|
-
return handleSetLocation(newLayout);
|
|
1676
|
-
});
|
|
1677
|
-
const ids = openIds(location.values.active);
|
|
1678
|
-
const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
|
|
1679
|
-
return {
|
|
1680
|
-
data: {
|
|
1681
|
-
open: ids
|
|
1682
|
-
},
|
|
1683
|
-
intents: [
|
|
1684
|
-
createIntent4(LayoutAction3.ScrollIntoView, {
|
|
1685
|
-
id: newlyOpen[0] ?? toAttend
|
|
1686
|
-
}),
|
|
1687
|
-
...toAttend ? [
|
|
1688
|
-
createIntent4(NavigationAction3.Expose, {
|
|
1689
|
-
id: toAttend
|
|
1690
|
-
})
|
|
1691
|
-
] : [],
|
|
1692
|
-
...observability ? newlyOpen.map((id) => {
|
|
1693
|
-
const active = graph?.findNode(id)?.data;
|
|
1694
|
-
const typename = isReactiveObject(active) ? getTypename(active) : void 0;
|
|
1695
|
-
return createIntent4(ObservabilityAction.SendEvent, {
|
|
1696
|
-
name: "navigation.activate",
|
|
1697
|
-
properties: {
|
|
1698
|
-
id,
|
|
1699
|
-
typename
|
|
1700
|
-
}
|
|
1701
|
-
});
|
|
1702
|
-
}) : []
|
|
1703
|
-
]
|
|
1704
|
-
};
|
|
1705
|
-
}),
|
|
1706
|
-
createResolver(NavigationAction3.AddToActive, (data) => {
|
|
1707
|
-
const layoutEntry = {
|
|
1708
|
-
id: data.id
|
|
1709
|
-
};
|
|
1710
|
-
const effectivePart = getEffectivePart(data.part, layout.values.layoutMode);
|
|
1711
|
-
handleSetLocation(openEntry(location.values.active, effectivePart, layoutEntry, {
|
|
1712
|
-
positioning: data.positioning ?? settings.values.newPlankPositioning,
|
|
1713
|
-
pivotId: data.pivotId
|
|
1714
|
-
}));
|
|
1715
|
-
const intents = [];
|
|
1716
|
-
if (data.scrollIntoView && layout.values.layoutMode === "deck") {
|
|
1717
|
-
intents.push(createIntent4(LayoutAction3.ScrollIntoView, {
|
|
1718
|
-
id: data.id
|
|
1719
|
-
}));
|
|
1720
|
-
}
|
|
1721
|
-
return {
|
|
1722
|
-
intents
|
|
1723
|
-
};
|
|
1724
|
-
}),
|
|
1725
|
-
createResolver(NavigationAction3.Close, (data) => {
|
|
1726
|
-
let newLayout = location.values.active;
|
|
1727
|
-
const layoutMode = layout.values.layoutMode;
|
|
1728
|
-
const intentParts = data.activeParts;
|
|
1729
|
-
Object.keys(intentParts).forEach((partName) => {
|
|
1730
|
-
const effectivePart = getEffectivePart(partName, layoutMode);
|
|
1731
|
-
const ids = intentParts[partName];
|
|
1732
|
-
if (Array.isArray(ids)) {
|
|
1733
|
-
ids.forEach((id) => {
|
|
1734
|
-
newLayout = closeEntry(newLayout, {
|
|
1735
|
-
part: effectivePart,
|
|
1736
|
-
entryId: id
|
|
1737
|
-
});
|
|
1738
|
-
});
|
|
1739
|
-
} else {
|
|
1740
|
-
newLayout = closeEntry(newLayout, {
|
|
1741
|
-
part: effectivePart,
|
|
1742
|
-
entryId: ids
|
|
1743
|
-
});
|
|
1744
|
-
}
|
|
1745
|
-
});
|
|
1746
|
-
const toAttend = handleSetLocation(newLayout);
|
|
1747
|
-
return {
|
|
1748
|
-
intents: [
|
|
1749
|
-
createIntent4(LayoutAction3.ScrollIntoView, {
|
|
1750
|
-
id: toAttend
|
|
1751
|
-
})
|
|
1752
|
-
]
|
|
1753
|
-
};
|
|
1754
|
-
}),
|
|
1755
|
-
createResolver(NavigationAction3.Set, (data) => {
|
|
1756
|
-
return batch(() => {
|
|
1757
|
-
const toAttend = handleSetLocation(data.activeParts);
|
|
1758
|
-
return {
|
|
1759
|
-
intents: [
|
|
1760
|
-
createIntent4(LayoutAction3.ScrollIntoView, {
|
|
1761
|
-
id: toAttend
|
|
1762
|
-
})
|
|
1763
|
-
]
|
|
1764
|
-
};
|
|
1765
|
-
});
|
|
1766
|
-
}),
|
|
1767
|
-
createResolver(NavigationAction3.Adjust, (adjustment) => {
|
|
1768
|
-
return batch(() => {
|
|
1769
|
-
if (adjustment.type === "increment-end" || adjustment.type === "increment-start") {
|
|
1770
|
-
handleSetLocation(incrementPlank(location.values.active, {
|
|
1771
|
-
type: adjustment.type,
|
|
1772
|
-
layoutCoordinate: adjustment.layoutCoordinate
|
|
1773
|
-
}));
|
|
1774
|
-
}
|
|
1775
|
-
if (adjustment.type === "solo") {
|
|
1776
|
-
const entryId = adjustment.layoutCoordinate.entryId;
|
|
1777
|
-
if (layout.values.layoutMode !== "solo") {
|
|
1778
|
-
return {
|
|
1779
|
-
intents: [
|
|
1780
|
-
// NOTE: The order of these is important.
|
|
1781
|
-
pipe(createIntent4(NavigationAction3.Open, {
|
|
1782
|
-
activeParts: {
|
|
1783
|
-
solo: [
|
|
1784
|
-
entryId
|
|
1785
|
-
]
|
|
1786
|
-
}
|
|
1787
|
-
}), chain(LayoutAction3.SetLayoutMode, {
|
|
1788
|
-
layoutMode: "solo"
|
|
1789
|
-
}))
|
|
1790
|
-
]
|
|
1791
|
-
};
|
|
1792
|
-
} else {
|
|
1793
|
-
return {
|
|
1794
|
-
intents: [
|
|
1795
|
-
// NOTE: The order of these is important.
|
|
1796
|
-
pipe(createIntent4(LayoutAction3.SetLayoutMode, {
|
|
1797
|
-
layoutMode: "deck"
|
|
1798
|
-
}), chain(NavigationAction3.Close, {
|
|
1799
|
-
activeParts: {
|
|
1800
|
-
solo: [
|
|
1801
|
-
entryId
|
|
1802
|
-
]
|
|
1803
|
-
}
|
|
1804
|
-
}), chain(NavigationAction3.Open, {
|
|
1805
|
-
activeParts: {
|
|
1806
|
-
main: [
|
|
1807
|
-
entryId
|
|
1808
|
-
]
|
|
1809
|
-
},
|
|
1810
|
-
noToggle: true
|
|
1811
|
-
}), chain(LayoutAction3.ScrollIntoView, {
|
|
1812
|
-
id: entryId
|
|
1813
|
-
}))
|
|
1814
|
-
]
|
|
1815
|
-
};
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
});
|
|
1819
|
-
})
|
|
1820
|
-
];
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
};
|
|
1825
|
-
};
|
|
1826
|
-
|
|
1827
|
-
// packages/plugins/plugin-deck/src/index.ts
|
|
1828
|
-
var src_default = DeckPlugin;
|
|
87
|
+
var DeckPlugin = () => definePlugin(meta, [
|
|
88
|
+
defineModule({
|
|
89
|
+
id: `${meta.id}/module/check-app-scheme`,
|
|
90
|
+
activatesOn: Events2.SettingsReady,
|
|
91
|
+
activate: CheckAppScheme
|
|
92
|
+
}),
|
|
93
|
+
defineModule({
|
|
94
|
+
id: `${meta.id}/module/settings`,
|
|
95
|
+
activatesOn: Events2.SetupSettings,
|
|
96
|
+
activate: DeckSettings
|
|
97
|
+
}),
|
|
98
|
+
defineModule({
|
|
99
|
+
id: `${meta.id}/module/layout`,
|
|
100
|
+
activatesOn: oneOf(Events2.Startup, Events2.SetupAppGraph),
|
|
101
|
+
activatesAfter: [
|
|
102
|
+
Events2.LayoutReady,
|
|
103
|
+
DeckEvents.StateReady
|
|
104
|
+
],
|
|
105
|
+
activate: DeckState
|
|
106
|
+
}),
|
|
107
|
+
defineModule({
|
|
108
|
+
id: `${meta.id}/module/translations`,
|
|
109
|
+
activatesOn: Events2.SetupTranslations,
|
|
110
|
+
activate: () => contributes(Capabilities.Translations, [
|
|
111
|
+
...translations_default,
|
|
112
|
+
...stackTranslations
|
|
113
|
+
])
|
|
114
|
+
}),
|
|
115
|
+
defineModule({
|
|
116
|
+
id: `${meta.id}/module/react-root`,
|
|
117
|
+
activatesOn: Events2.Startup,
|
|
118
|
+
activate: ReactRoot
|
|
119
|
+
}),
|
|
120
|
+
defineModule({
|
|
121
|
+
id: `${meta.id}/module/react-surface`,
|
|
122
|
+
activatesOn: Events2.SetupSurfaces,
|
|
123
|
+
activate: ReactSurface
|
|
124
|
+
}),
|
|
125
|
+
defineModule({
|
|
126
|
+
id: `${meta.id}/module/layout-intent-resolver`,
|
|
127
|
+
activatesOn: Events2.SetupIntents,
|
|
128
|
+
activate: LayoutIntentResolver
|
|
129
|
+
}),
|
|
130
|
+
defineModule({
|
|
131
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
132
|
+
activatesOn: Events2.SetupAppGraph,
|
|
133
|
+
activate: AppGraphBuilder
|
|
134
|
+
}),
|
|
135
|
+
defineModule({
|
|
136
|
+
id: `${meta.id}/module/url`,
|
|
137
|
+
activatesOn: allOf(Events2.DispatcherReady, DeckEvents.StateReady),
|
|
138
|
+
activate: UrlHandler
|
|
139
|
+
})
|
|
140
|
+
]);
|
|
1829
141
|
export {
|
|
142
|
+
DECK_PLUGIN,
|
|
143
|
+
DeckCapabilities,
|
|
144
|
+
DeckEvents,
|
|
1830
145
|
DeckPlugin,
|
|
1831
|
-
|
|
146
|
+
meta
|
|
1832
147
|
};
|
|
1833
148
|
//# sourceMappingURL=index.mjs.map
|