@dxos/plugin-deck 0.8.4-main.3f58842 → 0.8.4-main.548089c
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-JTFSDT2I.mjs → app-graph-builder-2DE73K5P.mjs} +17 -41
- package/dist/lib/browser/app-graph-builder-2DE73K5P.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs → check-app-scheme-HIEVFAAX.mjs} +6 -6
- package/dist/lib/browser/check-app-scheme-HIEVFAAX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JFTXENFN.mjs → chunk-27I7DJUG.mjs} +9 -9
- package/dist/lib/browser/chunk-27I7DJUG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-D7KTFCUV.mjs → chunk-2YHPKFFA.mjs} +551 -509
- package/dist/lib/browser/chunk-2YHPKFFA.mjs.map +7 -0
- package/dist/lib/browser/chunk-5KMJPIQC.mjs +16 -0
- package/dist/lib/browser/chunk-5KMJPIQC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-QDZO4AJ4.mjs → chunk-ABGD5GHY.mjs} +19 -18
- package/dist/lib/browser/chunk-ABGD5GHY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-F5BQOOEG.mjs → chunk-F3VCCHVL.mjs} +8 -6
- package/dist/lib/browser/chunk-F3VCCHVL.mjs.map +7 -0
- package/dist/lib/browser/chunk-UXLU6CMW.mjs +16 -0
- package/dist/lib/browser/chunk-UXLU6CMW.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +20 -14
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-P2OBK5HK.mjs → intent-resolver-Q3KETDSS.mjs} +21 -18
- package/dist/lib/browser/intent-resolver-Q3KETDSS.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-PO64J7ML.mjs → react-root-EXJMQNOO.mjs} +13 -12
- package/dist/lib/browser/react-root-EXJMQNOO.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-E45YOVF5.mjs → react-surface-D5R4UUKV.mjs} +13 -13
- package/dist/lib/browser/react-surface-D5R4UUKV.mjs.map +7 -0
- package/dist/lib/browser/{settings-6AJZPZPM.mjs → settings-SDPTOCCM.mjs} +7 -6
- package/dist/lib/browser/{settings-6AJZPZPM.mjs.map → settings-SDPTOCCM.mjs.map} +3 -3
- package/dist/lib/browser/state-QTVNH7N6.mjs +12 -0
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs +52 -0
- package/dist/lib/browser/toolkit-L5CFXJCF.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/browser/{url-handler-7L7M6IKH.mjs → url-handler-QEYGYE2H.mjs} +7 -7
- package/dist/lib/browser/url-handler-QEYGYE2H.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +1 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +9 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +5 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +25 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools.d.ts +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +74 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +86 -5
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -42
- package/src/DeckPlugin.ts +64 -59
- package/src/capabilities/app-graph-builder.ts +31 -29
- package/src/capabilities/capabilities.ts +3 -3
- package/src/capabilities/check-app-scheme.ts +3 -3
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/intent-resolver.ts +21 -17
- package/src/capabilities/react-root.tsx +6 -4
- package/src/capabilities/react-surface.tsx +5 -5
- package/src/capabilities/settings.ts +2 -1
- package/src/capabilities/state.ts +9 -5
- package/src/capabilities/toolkit.ts +66 -0
- package/src/capabilities/tools.ts +10 -7
- package/src/capabilities/url-handler.ts +3 -2
- package/src/components/DeckLayout/ActiveNode.tsx +1 -1
- package/src/components/DeckLayout/Banner.tsx +4 -4
- package/src/components/DeckLayout/ContentEmpty.tsx +2 -2
- package/src/components/DeckLayout/DeckLayout.stories.tsx +63 -0
- package/src/components/DeckLayout/DeckLayout.tsx +10 -279
- package/src/components/DeckLayout/DeckMain.tsx +281 -0
- package/src/components/DeckLayout/Dialog.tsx +1 -1
- package/src/components/DeckLayout/Fallback.tsx +2 -2
- package/src/components/DeckLayout/Popover.tsx +2 -11
- package/src/components/DeckLayout/StatusBar.tsx +1 -1
- package/src/components/DeckLayout/Toast.tsx +28 -3
- package/src/components/DeckSettings/DeckSettings.tsx +80 -65
- package/src/components/Plank/Plank.stories.tsx +9 -10
- package/src/components/Plank/Plank.tsx +75 -42
- package/src/components/Plank/PlankControls.tsx +6 -5
- package/src/components/Plank/PlankError.tsx +3 -2
- package/src/components/Plank/PlankHeading.tsx +14 -12
- package/src/components/Sidebar/ComplementarySidebar.tsx +11 -10
- package/src/components/Sidebar/Sidebar.tsx +3 -3
- package/src/components/Sidebar/SidebarButton.tsx +12 -11
- package/src/events.ts +2 -2
- package/src/hooks/useCompanions.ts +1 -1
- package/src/hooks/useDeckCompanions.ts +4 -3
- package/src/hooks/useHoistStatusbar.ts +6 -4
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/meta.ts +6 -3
- package/src/translations.ts +2 -0
- package/src/types/schema.ts +5 -3
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
- package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
- package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
- package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
- package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
- package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
- /package/dist/lib/browser/{state-MVDYX77Y.mjs.map → state-QTVNH7N6.mjs.map} +0 -0
|
@@ -1,45 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5KMJPIQC.mjs";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
} from "./chunk-
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-UXLU6CMW.mjs";
|
|
7
7
|
|
|
8
8
|
// src/capabilities/app-graph-builder.ts
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
9
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
10
|
+
import * as Function from "effect/Function";
|
|
11
|
+
import * as Option from "effect/Option";
|
|
12
|
+
import { Capabilities, LayoutAction, contributes, createIntent } from "@dxos/app-framework";
|
|
12
13
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
13
|
-
import {
|
|
14
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
15
|
-
id:
|
|
16
|
-
actions: (node) =>
|
|
14
|
+
import { ROOT_ID, createExtension, rxFromSignal } from "@dxos/plugin-graph";
|
|
15
|
+
var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
16
|
+
id: meta.id,
|
|
17
|
+
actions: (node) => Atom.make((get) => Function.pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
17
18
|
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
18
|
-
const _fullscreen = {
|
|
19
|
-
id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,
|
|
20
|
-
data: async () => {
|
|
21
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
22
|
-
await dispatch(createIntent(LayoutAction.SetLayoutMode, {
|
|
23
|
-
part: "mode",
|
|
24
|
-
options: {
|
|
25
|
-
mode: "fullscreen"
|
|
26
|
-
}
|
|
27
|
-
}));
|
|
28
|
-
},
|
|
29
|
-
properties: {
|
|
30
|
-
label: [
|
|
31
|
-
"toggle fullscreen label",
|
|
32
|
-
{
|
|
33
|
-
ns: DECK_PLUGIN
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
icon: "ph--arrows-out--regular",
|
|
37
|
-
keyBinding: {
|
|
38
|
-
macos: "ctrl+meta+f",
|
|
39
|
-
windows: "shift+ctrl+f"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
19
|
const closeCurrent = {
|
|
44
20
|
id: `${LayoutAction.Close._tag}/current`,
|
|
45
21
|
data: async () => {
|
|
@@ -62,7 +38,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
62
38
|
label: [
|
|
63
39
|
"close current label",
|
|
64
40
|
{
|
|
65
|
-
ns:
|
|
41
|
+
ns: meta.id
|
|
66
42
|
}
|
|
67
43
|
],
|
|
68
44
|
icon: "ph--x--regular"
|
|
@@ -87,7 +63,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
87
63
|
label: [
|
|
88
64
|
"close others label",
|
|
89
65
|
{
|
|
90
|
-
ns:
|
|
66
|
+
ns: meta.id
|
|
91
67
|
}
|
|
92
68
|
],
|
|
93
69
|
icon: "ph--x-square--regular"
|
|
@@ -109,7 +85,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
109
85
|
label: [
|
|
110
86
|
"close all label",
|
|
111
87
|
{
|
|
112
|
-
ns:
|
|
88
|
+
ns: meta.id
|
|
113
89
|
}
|
|
114
90
|
],
|
|
115
91
|
icon: "ph--x-circle--regular"
|
|
@@ -124,7 +100,7 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
124
100
|
label: [
|
|
125
101
|
get(rxFromSignal(() => state.sidebarState === "expanded" ? "collapse navigation sidebar label" : "open navigation sidebar label")),
|
|
126
102
|
{
|
|
127
|
-
ns:
|
|
103
|
+
ns: meta.id
|
|
128
104
|
}
|
|
129
105
|
],
|
|
130
106
|
icon: "ph--sidebar--regular",
|
|
@@ -145,8 +121,8 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
145
121
|
toggleSidebar
|
|
146
122
|
]));
|
|
147
123
|
}), Option.getOrElse(() => [])))
|
|
148
|
-
}));
|
|
124
|
+
})));
|
|
149
125
|
export {
|
|
150
126
|
app_graph_builder_default as default
|
|
151
127
|
};
|
|
152
|
-
//# sourceMappingURL=app-graph-builder-
|
|
128
|
+
//# sourceMappingURL=app-graph-builder-2DE73K5P.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Function from 'effect/Function';\nimport * as Option from 'effect/Option';\n\nimport { Capabilities, LayoutAction, type PluginContext, contributes, createIntent } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';\n\nimport { meta } from '../meta';\n\nimport { DeckCapabilities } from './capabilities';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: meta.id,\n actions: (node) =>\n Atom.make((get) =>\n Function.pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const state = context.getCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n // const _fullscreen = {\n // id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n // data: async () => {\n // const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n // await dispatch(\n // createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),\n // );\n // },\n // properties: {\n // label: ['toggle fullscreen label', { ns: meta.id }],\n // icon: 'ph--arrows-out--regular',\n // keyBinding: {\n // macos: 'ctrl+meta+f',\n // windows: 'shift+ctrl+f',\n // },\n // },\n // };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: [attended],\n options: { state: false },\n }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: meta.id }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }),\n );\n },\n properties: {\n label: ['close others label', { ns: meta.id }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: meta.id }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n get(\n rxFromSignal(() =>\n state.sidebarState === 'expanded'\n ? 'collapse navigation sidebar label'\n : 'open navigation sidebar label',\n ),\n ),\n { ns: meta.id },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: \"meta+'\",\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return get(\n rxFromSignal(() =>\n !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [togg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AO;MAACrC;MAAcsB;MAAaK;MAAUC;QAAiB;MAACA;KAAc,CAAA;EAG/F,CAAA,GACOU,iBAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
+
"names": ["Atom", "Function", "Option", "Capabilities", "LayoutAction", "contributes", "createIntent", "AttentionCapabilities", "ROOT_ID", "createExtension", "rxFromSignal", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "actions", "node", "Atom", "make", "get", "pipe", "flatMap", "ROOT_ID", "some", "none", "map", "state", "getCapability", "DeckCapabilities", "MutableDeckState", "closeCurrent", "LayoutAction", "Close", "_tag", "data", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "part", "subject", "options", "properties", "label", "ns", "icon", "closeOthers", "ids", "deck", "active", "filter", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "rxFromSignal", "keyBinding", "macos", "disposition", "position", "l0Breakpoint", "solo", "getOrElse"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-UXLU6CMW.mjs";
|
|
4
4
|
|
|
5
5
|
// src/capabilities/check-app-scheme.ts
|
|
6
6
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
@@ -19,14 +19,14 @@ var checkAppScheme = (url) => {
|
|
|
19
19
|
document.body.removeChild(iframe);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
var check_app_scheme_default = async (context) => {
|
|
23
|
-
const settings = context.getCapability(Capabilities.SettingsStore).getStore(
|
|
22
|
+
var check_app_scheme_default = (async (context) => {
|
|
23
|
+
const settings = context.getCapability(Capabilities.SettingsStore).getStore(meta.id)?.value;
|
|
24
24
|
if (!isSocket && settings?.enableNativeRedirect) {
|
|
25
25
|
checkAppScheme(appScheme);
|
|
26
26
|
}
|
|
27
27
|
return contributes(Capabilities.Null, null);
|
|
28
|
-
};
|
|
28
|
+
});
|
|
29
29
|
export {
|
|
30
30
|
check_app_scheme_default as default
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=check-app-scheme-
|
|
32
|
+
//# sourceMappingURL=check-app-scheme-HIEVFAAX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/check-app-scheme.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginContext) => {\n const settings = context.getCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(meta.id)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,cAAkCC,mBAAmB;AAK9D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,4BAAe,OAAOmB,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,aAAa,EAAEC,SAA4BC,KAAKC,EAAE,GAAGC;AACzG,MAAI,CAACjC,YAAY0B,UAAUQ,sBAAsB;AAC/C9B,mBAAeD,SAAAA;EACjB;AAEA,SAAOgC,YAAYP,aAAaQ,MAAM,IAAA;AACxC;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settings", "getCapability", "Capabilities", "SettingsStore", "getStore", "meta", "id", "value", "enableNativeRedirect", "contributes", "Null"]
|
|
7
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5KMJPIQC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defaultDeck,
|
|
6
6
|
getMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F3VCCHVL.mjs";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
meta
|
|
10
|
+
} from "./chunk-UXLU6CMW.mjs";
|
|
11
11
|
|
|
12
12
|
// src/capabilities/state.ts
|
|
13
13
|
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
@@ -17,8 +17,8 @@ import { LocalStorageStore } from "@dxos/local-storage";
|
|
|
17
17
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/state.ts";
|
|
18
18
|
var boolean = /true|false/;
|
|
19
19
|
var migrateSidebarStateDefaults = {
|
|
20
|
-
[`${
|
|
21
|
-
[`${
|
|
20
|
+
[`${meta.id}/complementary-sidebar-state`]: "expanded",
|
|
21
|
+
[`${meta.id}/sidebar-state`]: "collapsed"
|
|
22
22
|
};
|
|
23
23
|
var migrateSidebarState = () => {
|
|
24
24
|
Object.entries(migrateSidebarStateDefaults).forEach(([key, defaultValue]) => {
|
|
@@ -29,7 +29,7 @@ var migrateSidebarState = () => {
|
|
|
29
29
|
};
|
|
30
30
|
var DeckStateFactory = () => {
|
|
31
31
|
migrateSidebarState();
|
|
32
|
-
const state = new LocalStorageStore(
|
|
32
|
+
const state = new LocalStorageStore(meta.id, {
|
|
33
33
|
sidebarState: "expanded",
|
|
34
34
|
complementarySidebarState: "collapsed",
|
|
35
35
|
complementarySidebarPanel: void 0,
|
|
@@ -54,7 +54,7 @@ var DeckStateFactory = () => {
|
|
|
54
54
|
const deck = this.decks[this.activeDeck];
|
|
55
55
|
invariant(deck, `Deck not found: ${this.activeDeck}`, {
|
|
56
56
|
F: __dxlog_file,
|
|
57
|
-
L:
|
|
57
|
+
L: 60,
|
|
58
58
|
S: this,
|
|
59
59
|
A: [
|
|
60
60
|
"deck",
|
|
@@ -126,4 +126,4 @@ export {
|
|
|
126
126
|
DeckStateFactory,
|
|
127
127
|
state_default
|
|
128
128
|
};
|
|
129
|
-
//# sourceMappingURL=chunk-
|
|
129
|
+
//# sourceMappingURL=chunk-27I7DJUG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/state.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\nimport { live } from '@dxos/live-object';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type SidebarState } from '@dxos/react-ui';\n\nimport { meta } from '../meta';\nimport { type DeckPluginState, type DeckState, defaultDeck, getMode } from '../types';\n\nimport { DeckCapabilities } from './capabilities';\n\nconst boolean = /true|false/;\n\n// TODO(thure, 18 Feb 2025): Remove after the next release.\n\nconst migrateSidebarStateDefaults = {\n [`${meta.id}/complementary-sidebar-state`]: 'expanded',\n [`${meta.id}/sidebar-state`]: 'collapsed',\n};\n\nconst migrateSidebarState = () => {\n Object.entries(migrateSidebarStateDefaults).forEach(([key, defaultValue]) => {\n if (boolean.test(localStorage.getItem(key) ?? 'never')) {\n localStorage.setItem(key, defaultValue);\n }\n });\n};\n\n/**\n * @deprecated\n */\nexport const DeckStateFactory = () => {\n migrateSidebarState();\n\n const state = new LocalStorageStore<DeckPluginState>(meta.id, {\n sidebarState: 'expanded',\n complementarySidebarState: 'collapsed',\n complementarySidebarPanel: undefined,\n dialogContent: null,\n dialogOpen: false,\n dialogBlockAlign: undefined,\n dialogType: undefined,\n popoverContent: null,\n popoverAnchor: undefined,\n popoverAnchorId: undefined,\n popoverOpen: false,\n toasts: [],\n currentUndoId: undefined,\n activeDeck: 'default',\n previousDeck: 'default',\n decks: {\n default: { ...defaultDeck },\n },\n get deck() {\n const deck = this.decks[this.activeDeck];\n invariant(deck, `Deck not found: ${this.activeDeck}`);\n return deck;\n },\n previousMode: {},\n scrollIntoView: undefined,\n });\n\n state\n .prop({ key: 'sidebarState', type: LocalStorageStore.enum<SidebarState>() })\n .prop({ key: 'complementarySidebarState', type: LocalStorageStore.enum<SidebarState>() })\n .prop({ key: 'complementarySidebarPanel', type: LocalStorageStore.string({ allowUndefined: true }) })\n .prop({ key: 'decks', type: LocalStorageStore.json<Record<string, DeckState>>() })\n .prop({ key: 'activeDeck', type: LocalStorageStore.string() })\n .prop({ key: 'previousDeck', type: LocalStorageStore.string() });\n\n const layout = live<Capabilities.Layout>({\n get mode() {\n return getMode(state.values.deck);\n },\n get dialogOpen() {\n return state.values.dialogOpen;\n },\n get sidebarOpen() {\n return state.values.sidebarState === 'expanded';\n },\n get complementarySidebarOpen() {\n return state.values.complementarySidebarState === 'expanded';\n },\n get workspace() {\n return state.values.activeDeck;\n },\n get active() {\n return state.values.deck.solo ? [state.values.deck.solo] : state.values.deck.active;\n },\n get inactive() {\n return state.values.deck.inactive;\n },\n get scrollIntoView() {\n return state.values.scrollIntoView;\n },\n });\n\n return [\n contributes(DeckCapabilities.DeckState, state.values, () => state.close()),\n contributes(Capabilities.Layout, layout),\n ];\n};\n\nexport default DeckStateFactory;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,iBAAiB;AAC1B,SAASC,YAAY;AACrB,SAASC,yBAAyB;;AAQlC,IAAMC,UAAU;AAIhB,IAAMC,8BAA8B;EAClC,CAAC,GAAGC,KAAKC,EAAE,8BAA8B,GAAG;EAC5C,CAAC,GAAGD,KAAKC,EAAE,gBAAgB,GAAG;AAChC;AAEA,IAAMC,sBAAsB,MAAA;AAC1BC,SAAOC,QAAQL,2BAAAA,EAA6BM,QAAQ,CAAC,CAACC,KAAKC,YAAAA,MAAa;AACtE,QAAIT,QAAQU,KAAKC,aAAaC,QAAQJ,GAAAA,KAAQ,OAAA,GAAU;AACtDG,mBAAaE,QAAQL,KAAKC,YAAAA;IAC5B;EACF,CAAA;AACF;AAKO,IAAMK,mBAAmB,MAAA;AAC9BV,sBAAAA;AAEA,QAAMW,QAAQ,IAAIC,kBAAmCd,KAAKC,IAAI;IAC5Dc,cAAc;IACdC,2BAA2B;IAC3BC,2BAA2BC;IAC3BC,eAAe;IACfC,YAAY;IACZC,kBAAkBH;IAClBI,YAAYJ;IACZK,gBAAgB;IAChBC,eAAeN;IACfO,iBAAiBP;IACjBQ,aAAa;IACb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B;IAC/E;IACA,IAAIE,WAAW;AACb,aAAOzC,MAAMmC,OAAOd,KAAKoB;IAC3B;IACA,IAAIjB,iBAAiB;AACnB,aAAOxB,MAAMmC,OAAOX;IACtB;EACF,CAAA;AAEA,SAAO;IACLkB,YAAYC,iBAAiBC,WAAW5C,MAAMmC,QAAQ,MAAMnC,MAAM6C,MAAK,CAAA;IACvEH,YAAYI,aAAaC,QAAQhB,MAAAA;;AAErC;AAEA,IAAA,gBAAehC;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "invariant", "live", "LocalStorageStore", "boolean", "migrateSidebarStateDefaults", "meta", "id", "migrateSidebarState", "Object", "entries", "forEach", "key", "defaultValue", "test", "localStorage", "getItem", "setItem", "DeckStateFactory", "state", "LocalStorageStore", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "undefined", "dialogContent", "dialogOpen", "dialogBlockAlign", "dialogType", "popoverContent", "popoverAnchor", "popoverAnchorId", "popoverOpen", "toasts", "currentUndoId", "activeDeck", "previousDeck", "decks", "default", "defaultDeck", "deck", "invariant", "previousMode", "scrollIntoView", "prop", "type", "enum", "string", "allowUndefined", "json", "layout", "live", "mode", "getMode", "values", "sidebarOpen", "complementarySidebarOpen", "workspace", "active", "solo", "inactive", "contributes", "DeckCapabilities", "DeckState", "close", "Capabilities", "Layout"]
|
|
7
|
+
}
|