@dxos/plugin-deck 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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-DVEKLXB4.mjs} +3 -3
- package/dist/lib/browser/app-graph-builder-DVEKLXB4.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-57U62A3A.mjs → check-app-scheme-3BQJXWEY.mjs} +1 -1
- package/dist/lib/{node-esm/check-app-scheme-3YZIA73T.mjs.map → browser/check-app-scheme-3BQJXWEY.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-QBKDUEDV.mjs → chunk-6MQIYIPY.mjs} +185 -185
- package/dist/lib/browser/chunk-6MQIYIPY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-XL7EWOGI.mjs → chunk-F5BQOOEG.mjs} +6 -8
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7LJDT5OH.mjs → chunk-MX7WRVX3.mjs} +12 -12
- package/dist/lib/browser/{chunk-7LJDT5OH.mjs.map → chunk-MX7WRVX3.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-QO3VIMKQ.mjs → chunk-NRCPV6AV.mjs} +4 -3
- package/dist/lib/browser/{chunk-QO3VIMKQ.mjs.map → chunk-NRCPV6AV.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +14 -8
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-6YMAE4SF.mjs → intent-resolver-2SUIIV6N.mjs} +6 -6
- package/dist/lib/browser/intent-resolver-2SUIIV6N.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-UVN2LMU3.mjs → react-root-GVZANZX7.mjs} +5 -5
- package/dist/lib/browser/{react-root-UVN2LMU3.mjs.map → react-root-GVZANZX7.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-WOLHGHMN.mjs → react-surface-NXSSD2GW.mjs} +5 -5
- package/dist/lib/browser/{react-surface-WOLHGHMN.mjs.map → react-surface-NXSSD2GW.mjs.map} +1 -1
- package/dist/lib/browser/{settings-L5CR5GTJ.mjs → settings-LUPQPZ27.mjs} +2 -2
- package/dist/lib/browser/{settings-L5CR5GTJ.mjs.map → settings-LUPQPZ27.mjs.map} +1 -1
- package/dist/lib/browser/state-CRXR7X63.mjs +12 -0
- package/dist/lib/browser/toolkit-OBKFXX23.mjs +47 -0
- package/dist/lib/browser/toolkit-OBKFXX23.mjs.map +7 -0
- package/dist/lib/browser/{types.mjs → types/index.mjs} +3 -5
- package/dist/lib/browser/{url-handler-KZW7GBA2.mjs → url-handler-LROZYQ26.mjs} +3 -3
- package/dist/lib/browser/url-handler-LROZYQ26.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +5 -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.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.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 +1 -1
- package/dist/types/src/components/Plank/Plank.stories.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/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/{types.d.ts → types/schema.d.ts} +7 -8
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +39 -35
- package/src/DeckPlugin.ts +11 -5
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/check-app-scheme.ts +1 -1
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/intent-resolver.ts +11 -10
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/capabilities/settings.ts +1 -1
- package/src/capabilities/state.ts +4 -3
- package/src/capabilities/toolkit.ts +55 -0
- package/src/capabilities/tools.ts +9 -6
- package/src/capabilities/url-handler.ts +3 -2
- package/src/components/DeckLayout/Banner.tsx +1 -1
- package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
- package/src/components/DeckLayout/DeckLayout.tsx +11 -10
- package/src/components/DeckLayout/Popover.tsx +1 -1
- package/src/components/Plank/Plank.stories.tsx +5 -4
- package/src/components/Plank/Plank.tsx +7 -6
- package/src/components/Plank/PlankError.tsx +4 -6
- package/src/components/Plank/PlankHeading.tsx +6 -5
- package/src/components/Sidebar/ComplementarySidebar.tsx +4 -3
- package/src/components/Sidebar/SidebarButton.tsx +2 -2
- package/src/hooks/useDeckCompanions.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/types/index.ts +5 -0
- package/src/{types.ts → types/schema.ts} +4 -6
- 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-QBKDUEDV.mjs.map +0 -7
- package/dist/lib/browser/chunk-XL7EWOGI.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-6YMAE4SF.mjs.map +0 -7
- package/dist/lib/browser/state-ZTYWMORZ.mjs +0 -10
- package/dist/lib/browser/tools-2YYFHQAS.mjs +0 -88
- package/dist/lib/browser/tools-2YYFHQAS.mjs.map +0 -7
- package/dist/lib/browser/url-handler-KZW7GBA2.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-YCSX45KJ.mjs +0 -153
- package/dist/lib/node-esm/app-graph-builder-YCSX45KJ.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-3YZIA73T.mjs +0 -33
- package/dist/lib/node-esm/chunk-ANLUUC3J.mjs +0 -129
- package/dist/lib/node-esm/chunk-ANLUUC3J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F4YIQ5GG.mjs +0 -128
- package/dist/lib/node-esm/chunk-F4YIQ5GG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HHG6H2BX.mjs +0 -15
- package/dist/lib/node-esm/chunk-HHG6H2BX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KTPDAVNM.mjs +0 -17
- package/dist/lib/node-esm/chunk-KTPDAVNM.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NMSUKHE3.mjs +0 -1495
- package/dist/lib/node-esm/chunk-NMSUKHE3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QFKYT4JK.mjs +0 -163
- package/dist/lib/node-esm/chunk-QFKYT4JK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UJGQAMF7.mjs +0 -147
- package/dist/lib/node-esm/chunk-UJGQAMF7.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -169
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-URTWBGD7.mjs +0 -522
- package/dist/lib/node-esm/intent-resolver-URTWBGD7.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-root-GFX4GOJT.mjs +0 -44
- package/dist/lib/node-esm/react-root-GFX4GOJT.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-F6L5PLWK.mjs +0 -41
- package/dist/lib/node-esm/react-surface-F6L5PLWK.mjs.map +0 -7
- package/dist/lib/node-esm/settings-WE3TBMOC.mjs +0 -30
- package/dist/lib/node-esm/settings-WE3TBMOC.mjs.map +0 -7
- package/dist/lib/node-esm/state-DUK6WFDX.mjs +0 -11
- package/dist/lib/node-esm/state-DUK6WFDX.mjs.map +0 -7
- package/dist/lib/node-esm/tools-HH6NN7HB.mjs +0 -89
- package/dist/lib/node-esm/tools-HH6NN7HB.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -35
- package/dist/lib/node-esm/types.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-774BWWKI.mjs +0 -71
- package/dist/lib/node-esm/url-handler-774BWWKI.mjs.map +0 -7
- package/dist/types/src/types.d.ts.map +0 -1
- /package/dist/lib/browser/{state-ZTYWMORZ.mjs.map → state-CRXR7X63.mjs.map} +0 -0
- /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DeckAction
|
|
3
|
-
} from "./chunk-XL7EWOGI.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-Z5KITAZW.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/tools.ts
|
|
9
|
-
import { Schema } from "effect";
|
|
10
|
-
import { createTool, ToolResult } from "@dxos/ai";
|
|
11
|
-
import { contributes, createIntent, Capabilities, LayoutAction } from "@dxos/app-framework";
|
|
12
|
-
import { invariant } from "@dxos/invariant";
|
|
13
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/tools.ts";
|
|
14
|
-
var tools_default = () => contributes(Capabilities.Tools, [
|
|
15
|
-
createTool(meta.id, {
|
|
16
|
-
name: "show",
|
|
17
|
-
description: `
|
|
18
|
-
Show an item as a companion to an existing plank. This will make the item appear alongside the primary content.
|
|
19
|
-
When supplying IDs, they must be fully qualified like space:object.
|
|
20
|
-
`,
|
|
21
|
-
caption: "Showing item...",
|
|
22
|
-
// TODO(wittjosiah): Refactor Layout/Navigation/Deck actions so that they can be used directly.
|
|
23
|
-
schema: Schema.Struct({
|
|
24
|
-
id: Schema.String.annotations({
|
|
25
|
-
description: "The ID of the item to show."
|
|
26
|
-
})
|
|
27
|
-
}),
|
|
28
|
-
execute: async ({ id }, { extensions }) => {
|
|
29
|
-
invariant(extensions, void 0, {
|
|
30
|
-
F: __dxlog_file,
|
|
31
|
-
L: 45,
|
|
32
|
-
S: void 0,
|
|
33
|
-
A: [
|
|
34
|
-
"extensions",
|
|
35
|
-
""
|
|
36
|
-
]
|
|
37
|
-
});
|
|
38
|
-
const { pivotId, dispatch, part } = extensions;
|
|
39
|
-
invariant(pivotId, "No pivot ID", {
|
|
40
|
-
F: __dxlog_file,
|
|
41
|
-
L: 47,
|
|
42
|
-
S: void 0,
|
|
43
|
-
A: [
|
|
44
|
-
"pivotId",
|
|
45
|
-
"'No pivot ID'"
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
invariant(dispatch, "No intent dispatcher", {
|
|
49
|
-
F: __dxlog_file,
|
|
50
|
-
L: 48,
|
|
51
|
-
S: void 0,
|
|
52
|
-
A: [
|
|
53
|
-
"dispatch",
|
|
54
|
-
"'No intent dispatcher'"
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
if (part === "deck") {
|
|
58
|
-
const { data, error } = await dispatch(createIntent(DeckAction.ChangeCompanion, {
|
|
59
|
-
primary: pivotId,
|
|
60
|
-
companion: id
|
|
61
|
-
}));
|
|
62
|
-
if (error) {
|
|
63
|
-
return ToolResult.Error(error.message);
|
|
64
|
-
}
|
|
65
|
-
return ToolResult.Success(data);
|
|
66
|
-
} else {
|
|
67
|
-
const { data, error } = await dispatch(createIntent(LayoutAction.Open, {
|
|
68
|
-
subject: [
|
|
69
|
-
id
|
|
70
|
-
],
|
|
71
|
-
part: "main",
|
|
72
|
-
options: {
|
|
73
|
-
pivotId,
|
|
74
|
-
positioning: "end"
|
|
75
|
-
}
|
|
76
|
-
}));
|
|
77
|
-
if (error) {
|
|
78
|
-
return ToolResult.Error(error.message);
|
|
79
|
-
}
|
|
80
|
-
return ToolResult.Success(data);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
]);
|
|
85
|
-
export {
|
|
86
|
-
tools_default as default
|
|
87
|
-
};
|
|
88
|
-
//# sourceMappingURL=tools-2YYFHQAS.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/tools.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\n\nimport { createTool, ToolResult } from '@dxos/ai';\nimport {\n contributes,\n createIntent,\n Capabilities,\n LayoutAction,\n type PromiseIntentDispatcher,\n} from '@dxos/app-framework';\nimport { invariant } from '@dxos/invariant';\n\nimport { meta } from '../meta';\nimport { DeckAction } from '../types';\n\n// TODO(burdon): Factor out.\ndeclare global {\n interface ToolContextExtensions {\n dispatch?: PromiseIntentDispatcher;\n pivotId?: string;\n part?: 'deck' | 'dialog';\n }\n}\n\nexport default () =>\n contributes(Capabilities.Tools, [\n createTool(meta.id, {\n name: 'show',\n description: `\n Show an item as a companion to an existing plank. This will make the item appear alongside the primary content.\n When supplying IDs, they must be fully qualified like space:object.\n `,\n caption: 'Showing item...',\n // TODO(wittjosiah): Refactor Layout/Navigation/Deck actions so that they can be used directly.\n schema: Schema.Struct({\n id: Schema.String.annotations({\n description: 'The ID of the item to show.',\n }),\n }),\n execute: async ({ id }, { extensions }) => {\n invariant(extensions);\n const { pivotId, dispatch, part } = extensions;\n invariant(pivotId, 'No pivot ID');\n invariant(dispatch, 'No intent dispatcher');\n\n if (part === 'deck') {\n const { data, error } = await dispatch(\n createIntent(DeckAction.ChangeCompanion, {\n primary: pivotId,\n companion: id,\n }),\n );\n if (error) {\n return ToolResult.Error(error.message);\n }\n\n return ToolResult.Success(data);\n } else {\n const { data, error } = await dispatch(\n createIntent(LayoutAction.Open, {\n subject: [id],\n part: 'main',\n options: {\n pivotId,\n positioning: 'end',\n },\n }),\n );\n if (error) {\n return ToolResult.Error(error.message);\n }\n\n return ToolResult.Success(data);\n }\n },\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,cAAc;AAEvB,SAASC,YAAYC,kBAAkB;AACvC,SACEC,aACAC,cACAC,cACAC,oBAEK;AACP,SAASC,iBAAiB;;AAc1B,IAAA,gBAAe,MACbC,YAAYC,aAAaC,OAAO;EAC9BC,WAAWC,KAAKC,IAAI;IAClBC,MAAM;IACNC,aAAa;;;;IAIbC,SAAS;;IAETC,QAAQC,OAAOC,OAAO;MACpBN,IAAIK,OAAOE,OAAOC,YAAY;QAC5BN,aAAa;MACf,CAAA;IACF,CAAA;IACAO,SAAS,OAAO,EAAET,GAAE,GAAI,EAAEU,WAAU,MAAE;AACpCC,gBAAUD,YAAAA,QAAAA;;;;;;;;;AACV,YAAM,EAAEE,SAASC,UAAUC,KAAI,IAAKJ;AACpCC,gBAAUC,SAAS,eAAA;;;;;;;;;AACnBD,gBAAUE,UAAU,wBAAA;;;;;;;;;AAEpB,UAAIC,SAAS,QAAQ;AACnB,cAAM,EAAEC,MAAMC,MAAK,IAAK,MAAMH,SAC5BI,aAAaC,WAAWC,iBAAiB;UACvCC,SAASR;UACTS,WAAWrB;QACb,CAAA,CAAA;AAEF,YAAIgB,OAAO;AACT,iBAAOM,WAAWC,MAAMP,MAAMQ,OAAO;QACvC;AAEA,eAAOF,WAAWG,QAAQV,IAAAA;MAC5B,OAAO;AACL,cAAM,EAAEA,MAAMC,MAAK,IAAK,MAAMH,SAC5BI,aAAaS,aAAaC,MAAM;UAC9BC,SAAS;YAAC5B;;UACVc,MAAM;UACNe,SAAS;YACPjB;YACAkB,aAAa;UACf;QACF,CAAA,CAAA;AAEF,YAAId,OAAO;AACT,iBAAOM,WAAWC,MAAMP,MAAMQ,OAAO;QACvC;AAEA,eAAOF,WAAWG,QAAQV,IAAAA;MAC5B;IACF;EACF,CAAA;CACD;",
|
|
6
|
-
"names": ["Schema", "createTool", "ToolResult", "contributes", "createIntent", "Capabilities", "LayoutAction", "invariant", "contributes", "Capabilities", "Tools", "createTool", "meta", "id", "name", "description", "caption", "schema", "Schema", "Struct", "String", "annotations", "execute", "extensions", "invariant", "pivotId", "dispatch", "part", "data", "error", "createIntent", "DeckAction", "ChangeCompanion", "primary", "companion", "ToolResult", "Error", "message", "Success", "LayoutAction", "Open", "subject", "options", "positioning"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/url-handler.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { scheduledEffect } from '@dxos/echo-signals/core';\n\nimport { DeckCapabilities } from './capabilities';\nimport { defaultDeck } from '../types';\n\n// TODO(wittjosiah): Cleanup the url handling. May justify introducing routing capabilities.\nexport default async (context: PluginContext) => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const state = context.getCapability(DeckCapabilities.MutableDeckState);\n\n const handleNavigation = async () => {\n const pathname = window.location.pathname;\n if (pathname === '/reset') {\n state.activeDeck = 'default';\n state.decks = {\n default: { ...defaultDeck },\n };\n window.location.pathname = '/';\n return;\n }\n\n const [_, nextDeck, nextSolo] = pathname.split('/');\n if (nextDeck && nextDeck !== state.activeDeck) {\n await dispatch(createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: nextDeck }));\n }\n\n if (nextSolo && nextSolo !== state.deck.solo) {\n await dispatch(\n createIntent(LayoutAction.SetLayoutMode, { part: 'mode', subject: nextSolo, options: { mode: 'solo' } }),\n );\n } else if (!nextSolo && state.deck.solo) {\n await dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'deck' } }));\n }\n };\n\n await handleNavigation();\n window.addEventListener('popstate', handleNavigation);\n\n const unsubscribe = scheduledEffect(\n () => ({ solo: state.deck.solo, activeDeck: state.activeDeck }),\n ({ solo, activeDeck }) => {\n const path = solo ? `/${activeDeck}/${solo}` : `/${activeDeck}`;\n if (window.location.pathname !== path) {\n // TODO(thure): In some browsers, this only preserves the most recent state change, even though this is not `history.replace`…\n history.pushState(null, '', `${path}${window.location.search}`);\n }\n },\n );\n\n return contributes(Capabilities.Null, null, () => {\n window.removeEventListener('popstate', handleNavigation);\n unsubscribe();\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,oBAAwC;AAC1F,SAASC,uBAAuB;AAMhC,IAAA,sBAAe,OAAOC,YAAAA;AACpB,QAAM,EAAEC,iBAAiBC,SAAQ,IAAKF,QAAQG,cAAcC,aAAaC,gBAAgB;AACzF,QAAMC,QAAQN,QAAQG,cAAcI,iBAAiBC,gBAAgB;AAErE,QAAMC,mBAAmB,YAAA;AACvB,UAAMC,WAAWC,OAAOC,SAASF;AACjC,QAAIA,aAAa,UAAU;AACzBJ,YAAMO,aAAa;AACnBP,YAAMQ,QAAQ;QACZC,SAAS;UAAE,GAAGC;QAAY;MAC5B;AACAL,aAAOC,SAASF,WAAW;AAC3B;IACF;AAEA,UAAM,CAACO,GAAGC,UAAUC,QAAAA,IAAYT,SAASU,MAAM,GAAA;AAC/C,QAAIF,YAAYA,aAAaZ,MAAMO,YAAY;AAC7C,YAAMX,SAASmB,aAAaC,aAAaC,iBAAiB;QAAEC,MAAM;QAAaC,SAASP;MAAS,CAAA,CAAA;IACnG;AAEA,QAAIC,YAAYA,aAAab,MAAMoB,KAAKC,MAAM;AAC5C,YAAMzB,SACJmB,aAAaC,aAAaM,eAAe;QAAEJ,MAAM;QAAQC,SAASN;QAAUU,SAAS;UAAEC,MAAM;QAAO;MAAE,CAAA,CAAA;IAE1G,WAAW,CAACX,YAAYb,MAAMoB,KAAKC,MAAM;AACvC,YAAMzB,SAASmB,aAAaC,aAAaM,eAAe;QAAEJ,MAAM;QAAQK,SAAS;UAAEC,MAAM;QAAO;MAAE,CAAA,CAAA;IACpG;EACF;AAEA,QAAMrB,iBAAAA;AACNE,SAAOoB,iBAAiB,YAAYtB,gBAAAA;AAEpC,QAAMuB,cAAcC,gBAClB,OAAO;IAAEN,MAAMrB,MAAMoB,KAAKC;IAAMd,YAAYP,MAAMO;EAAW,IAC7D,CAAC,EAAEc,MAAMd,WAAU,MAAE;AACnB,UAAMqB,OAAOP,OAAO,IAAId,UAAAA,IAAcc,IAAAA,KAAS,IAAId,UAAAA;AACnD,QAAIF,OAAOC,SAASF,aAAawB,MAAM;AAErCC,cAAQC,UAAU,MAAM,IAAI,GAAGF,IAAAA,GAAOvB,OAAOC,SAASyB,MAAM,EAAE;IAChE;EACF,CAAA;AAGF,SAAOC,YAAYlC,aAAamC,MAAM,MAAM,MAAA;AAC1C5B,WAAO6B,oBAAoB,YAAY/B,gBAAAA;AACvCuB,gBAAAA;EACF,CAAA;AACF;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "LayoutAction", "scheduledEffect", "context", "dispatchPromise", "dispatch", "getCapability", "Capabilities", "IntentDispatcher", "state", "DeckCapabilities", "MutableDeckState", "handleNavigation", "pathname", "window", "location", "activeDeck", "decks", "default", "defaultDeck", "_", "nextDeck", "nextSolo", "split", "createIntent", "LayoutAction", "SwitchWorkspace", "part", "subject", "deck", "solo", "SetLayoutMode", "options", "mode", "addEventListener", "unsubscribe", "scheduledEffect", "path", "history", "pushState", "search", "contributes", "Null", "removeEventListener"]
|
|
7
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
DeckCapabilities
|
|
4
|
-
} from "./chunk-KTPDAVNM.mjs";
|
|
5
|
-
import {
|
|
6
|
-
DECK_PLUGIN
|
|
7
|
-
} from "./chunk-HHG6H2BX.mjs";
|
|
8
|
-
|
|
9
|
-
// src/capabilities/app-graph-builder.ts
|
|
10
|
-
import { Rx } from "@effect-rx/rx-react";
|
|
11
|
-
import { Option, pipe } from "effect";
|
|
12
|
-
import { Capabilities, contributes, createIntent, LayoutAction } from "@dxos/app-framework";
|
|
13
|
-
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
14
|
-
import { createExtension, ROOT_ID, rxFromSignal } from "@dxos/plugin-graph";
|
|
15
|
-
var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, createExtension({
|
|
16
|
-
id: DECK_PLUGIN,
|
|
17
|
-
actions: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.id === ROOT_ID ? Option.some(node2) : Option.none()), Option.map(() => {
|
|
18
|
-
const state = context.getCapability(DeckCapabilities.MutableDeckState);
|
|
19
|
-
const _fullscreen = {
|
|
20
|
-
id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,
|
|
21
|
-
data: async () => {
|
|
22
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
23
|
-
await dispatch(createIntent(LayoutAction.SetLayoutMode, {
|
|
24
|
-
part: "mode",
|
|
25
|
-
options: {
|
|
26
|
-
mode: "fullscreen"
|
|
27
|
-
}
|
|
28
|
-
}));
|
|
29
|
-
},
|
|
30
|
-
properties: {
|
|
31
|
-
label: [
|
|
32
|
-
"toggle fullscreen label",
|
|
33
|
-
{
|
|
34
|
-
ns: DECK_PLUGIN
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
icon: "ph--arrows-out--regular",
|
|
38
|
-
keyBinding: {
|
|
39
|
-
macos: "ctrl+meta+f",
|
|
40
|
-
windows: "shift+ctrl+f"
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
const closeCurrent = {
|
|
45
|
-
id: `${LayoutAction.Close._tag}/current`,
|
|
46
|
-
data: async () => {
|
|
47
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
48
|
-
const attended = attention.current.at(-1);
|
|
49
|
-
if (attended) {
|
|
50
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
51
|
-
await dispatch(createIntent(LayoutAction.Close, {
|
|
52
|
-
part: "main",
|
|
53
|
-
subject: [
|
|
54
|
-
attended
|
|
55
|
-
],
|
|
56
|
-
options: {
|
|
57
|
-
state: false
|
|
58
|
-
}
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
properties: {
|
|
63
|
-
label: [
|
|
64
|
-
"close current label",
|
|
65
|
-
{
|
|
66
|
-
ns: DECK_PLUGIN
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
icon: "ph--x--regular"
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const closeOthers = {
|
|
73
|
-
id: `${LayoutAction.Close._tag}/others`,
|
|
74
|
-
data: async () => {
|
|
75
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
76
|
-
const attention = context.getCapability(AttentionCapabilities.Attention);
|
|
77
|
-
const attended = attention.current.at(-1);
|
|
78
|
-
const ids = state.deck.active.filter((id) => id !== attended) ?? [];
|
|
79
|
-
await dispatch(createIntent(LayoutAction.Close, {
|
|
80
|
-
part: "main",
|
|
81
|
-
subject: ids,
|
|
82
|
-
options: {
|
|
83
|
-
state: false
|
|
84
|
-
}
|
|
85
|
-
}));
|
|
86
|
-
},
|
|
87
|
-
properties: {
|
|
88
|
-
label: [
|
|
89
|
-
"close others label",
|
|
90
|
-
{
|
|
91
|
-
ns: DECK_PLUGIN
|
|
92
|
-
}
|
|
93
|
-
],
|
|
94
|
-
icon: "ph--x-square--regular"
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
const closeAll = {
|
|
98
|
-
id: `${LayoutAction.Close._tag}/all`,
|
|
99
|
-
data: async () => {
|
|
100
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
101
|
-
await dispatch(createIntent(LayoutAction.Close, {
|
|
102
|
-
part: "main",
|
|
103
|
-
subject: state.deck.active,
|
|
104
|
-
options: {
|
|
105
|
-
state: false
|
|
106
|
-
}
|
|
107
|
-
}));
|
|
108
|
-
},
|
|
109
|
-
properties: {
|
|
110
|
-
label: [
|
|
111
|
-
"close all label",
|
|
112
|
-
{
|
|
113
|
-
ns: DECK_PLUGIN
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
icon: "ph--x-circle--regular"
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
const toggleSidebar = {
|
|
120
|
-
id: `${LayoutAction.UpdateSidebar._tag}/nav`,
|
|
121
|
-
data: async () => {
|
|
122
|
-
state.sidebarState = state.sidebarState === "expanded" ? "collapsed" : "expanded";
|
|
123
|
-
},
|
|
124
|
-
properties: {
|
|
125
|
-
label: [
|
|
126
|
-
get(rxFromSignal(() => state.sidebarState === "expanded" ? "collapse navigation sidebar label" : "open navigation sidebar label")),
|
|
127
|
-
{
|
|
128
|
-
ns: DECK_PLUGIN
|
|
129
|
-
}
|
|
130
|
-
],
|
|
131
|
-
icon: "ph--sidebar--regular",
|
|
132
|
-
keyBinding: {
|
|
133
|
-
macos: "meta+'"
|
|
134
|
-
},
|
|
135
|
-
disposition: "pin-end",
|
|
136
|
-
position: "hoist",
|
|
137
|
-
l0Breakpoint: "lg"
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
return get(rxFromSignal(() => !state.deck.solo ? [
|
|
141
|
-
closeCurrent,
|
|
142
|
-
closeOthers,
|
|
143
|
-
closeAll,
|
|
144
|
-
toggleSidebar
|
|
145
|
-
] : [
|
|
146
|
-
toggleSidebar
|
|
147
|
-
]));
|
|
148
|
-
}), Option.getOrElse(() => [])))
|
|
149
|
-
}));
|
|
150
|
-
export {
|
|
151
|
-
app_graph_builder_default as default
|
|
152
|
-
};
|
|
153
|
-
//# sourceMappingURL=app-graph-builder-YCSX45KJ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n 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: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.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: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.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: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.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: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n get(\n rxFromSignal(() =>\n state.sidebarState === 'expanded'\n ? 'collapse navigation sidebar label'\n : 'open navigation sidebar label',\n ),\n ),\n { ns: DECK_PLUGIN },\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] : [toggleSidebar],\n ),\n );\n }),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n );\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "rxFromSignal", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "state", "getCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "filter", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "rxFromSignal", "disposition", "position", "l0Breakpoint", "solo", "getOrElse"]
|
|
7
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
DECK_PLUGIN
|
|
4
|
-
} from "./chunk-HHG6H2BX.mjs";
|
|
5
|
-
|
|
6
|
-
// src/capabilities/check-app-scheme.ts
|
|
7
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
8
|
-
var isSocket = !!globalThis.__args;
|
|
9
|
-
var appScheme = "composer://";
|
|
10
|
-
var checkAppScheme = (url) => {
|
|
11
|
-
const iframe = document.createElement("iframe");
|
|
12
|
-
iframe.style.display = "none";
|
|
13
|
-
document.body.appendChild(iframe);
|
|
14
|
-
iframe.src = url + window.location.pathname.replace(/^\/+/, "") + window.location.search;
|
|
15
|
-
const timer = setTimeout(() => {
|
|
16
|
-
document.body.removeChild(iframe);
|
|
17
|
-
}, 3e3);
|
|
18
|
-
window.addEventListener("pagehide", (event) => {
|
|
19
|
-
clearTimeout(timer);
|
|
20
|
-
document.body.removeChild(iframe);
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
var check_app_scheme_default = async (context) => {
|
|
24
|
-
const settings = context.getCapability(Capabilities.SettingsStore).getStore(DECK_PLUGIN)?.value;
|
|
25
|
-
if (!isSocket && settings?.enableNativeRedirect) {
|
|
26
|
-
checkAppScheme(appScheme);
|
|
27
|
-
}
|
|
28
|
-
return contributes(Capabilities.Null, null);
|
|
29
|
-
};
|
|
30
|
-
export {
|
|
31
|
-
check_app_scheme_default as default
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=check-app-scheme-3YZIA73T.mjs.map
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
DeckCapabilities
|
|
4
|
-
} from "./chunk-KTPDAVNM.mjs";
|
|
5
|
-
import {
|
|
6
|
-
defaultDeck,
|
|
7
|
-
getMode
|
|
8
|
-
} from "./chunk-QFKYT4JK.mjs";
|
|
9
|
-
import {
|
|
10
|
-
DECK_PLUGIN
|
|
11
|
-
} from "./chunk-HHG6H2BX.mjs";
|
|
12
|
-
|
|
13
|
-
// src/capabilities/state.ts
|
|
14
|
-
import { Capabilities, contributes } from "@dxos/app-framework";
|
|
15
|
-
import { invariant } from "@dxos/invariant";
|
|
16
|
-
import { live } from "@dxos/live-object";
|
|
17
|
-
import { LocalStorageStore } from "@dxos/local-storage";
|
|
18
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/capabilities/state.ts";
|
|
19
|
-
var boolean = /true|false/;
|
|
20
|
-
var migrateSidebarStateDefaults = {
|
|
21
|
-
[`${DECK_PLUGIN}/complementary-sidebar-state`]: "expanded",
|
|
22
|
-
[`${DECK_PLUGIN}/sidebar-state`]: "collapsed"
|
|
23
|
-
};
|
|
24
|
-
var migrateSidebarState = () => {
|
|
25
|
-
Object.entries(migrateSidebarStateDefaults).forEach(([key, defaultValue]) => {
|
|
26
|
-
if (boolean.test(localStorage.getItem(key) ?? "never")) {
|
|
27
|
-
localStorage.setItem(key, defaultValue);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
var DeckStateFactory = () => {
|
|
32
|
-
migrateSidebarState();
|
|
33
|
-
const state = new LocalStorageStore(DECK_PLUGIN, {
|
|
34
|
-
sidebarState: "expanded",
|
|
35
|
-
complementarySidebarState: "collapsed",
|
|
36
|
-
complementarySidebarPanel: void 0,
|
|
37
|
-
dialogContent: null,
|
|
38
|
-
dialogOpen: false,
|
|
39
|
-
dialogBlockAlign: void 0,
|
|
40
|
-
dialogType: void 0,
|
|
41
|
-
popoverContent: null,
|
|
42
|
-
popoverAnchor: void 0,
|
|
43
|
-
popoverAnchorId: void 0,
|
|
44
|
-
popoverOpen: false,
|
|
45
|
-
toasts: [],
|
|
46
|
-
currentUndoId: void 0,
|
|
47
|
-
activeDeck: "default",
|
|
48
|
-
previousDeck: "default",
|
|
49
|
-
decks: {
|
|
50
|
-
default: {
|
|
51
|
-
...defaultDeck
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
get deck() {
|
|
55
|
-
const deck = this.decks[this.activeDeck];
|
|
56
|
-
invariant(deck, `Deck not found: ${this.activeDeck}`, {
|
|
57
|
-
F: __dxlog_file,
|
|
58
|
-
L: 56,
|
|
59
|
-
S: this,
|
|
60
|
-
A: [
|
|
61
|
-
"deck",
|
|
62
|
-
"`Deck not found: ${this.activeDeck}`"
|
|
63
|
-
]
|
|
64
|
-
});
|
|
65
|
-
return deck;
|
|
66
|
-
},
|
|
67
|
-
previousMode: {},
|
|
68
|
-
scrollIntoView: void 0
|
|
69
|
-
});
|
|
70
|
-
state.prop({
|
|
71
|
-
key: "sidebarState",
|
|
72
|
-
type: LocalStorageStore.enum()
|
|
73
|
-
}).prop({
|
|
74
|
-
key: "complementarySidebarState",
|
|
75
|
-
type: LocalStorageStore.enum()
|
|
76
|
-
}).prop({
|
|
77
|
-
key: "complementarySidebarPanel",
|
|
78
|
-
type: LocalStorageStore.string({
|
|
79
|
-
allowUndefined: true
|
|
80
|
-
})
|
|
81
|
-
}).prop({
|
|
82
|
-
key: "decks",
|
|
83
|
-
type: LocalStorageStore.json()
|
|
84
|
-
}).prop({
|
|
85
|
-
key: "activeDeck",
|
|
86
|
-
type: LocalStorageStore.string()
|
|
87
|
-
}).prop({
|
|
88
|
-
key: "previousDeck",
|
|
89
|
-
type: LocalStorageStore.string()
|
|
90
|
-
});
|
|
91
|
-
const layout = live({
|
|
92
|
-
get mode() {
|
|
93
|
-
return getMode(state.values.deck);
|
|
94
|
-
},
|
|
95
|
-
get dialogOpen() {
|
|
96
|
-
return state.values.dialogOpen;
|
|
97
|
-
},
|
|
98
|
-
get sidebarOpen() {
|
|
99
|
-
return state.values.sidebarState === "expanded";
|
|
100
|
-
},
|
|
101
|
-
get complementarySidebarOpen() {
|
|
102
|
-
return state.values.complementarySidebarState === "expanded";
|
|
103
|
-
},
|
|
104
|
-
get workspace() {
|
|
105
|
-
return state.values.activeDeck;
|
|
106
|
-
},
|
|
107
|
-
get active() {
|
|
108
|
-
return state.values.deck.solo ? [
|
|
109
|
-
state.values.deck.solo
|
|
110
|
-
] : state.values.deck.active;
|
|
111
|
-
},
|
|
112
|
-
get inactive() {
|
|
113
|
-
return state.values.deck.inactive;
|
|
114
|
-
},
|
|
115
|
-
get scrollIntoView() {
|
|
116
|
-
return state.values.scrollIntoView;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
return [
|
|
120
|
-
contributes(DeckCapabilities.DeckState, state.values, () => state.close()),
|
|
121
|
-
contributes(Capabilities.Layout, layout)
|
|
122
|
-
];
|
|
123
|
-
};
|
|
124
|
-
var state_default = DeckStateFactory;
|
|
125
|
-
|
|
126
|
-
export {
|
|
127
|
-
state_default
|
|
128
|
-
};
|
|
129
|
-
//# sourceMappingURL=chunk-ANLUUC3J.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
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 { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\nimport { getMode, type DeckPluginState, defaultDeck, type DeckState } from '../types';\n\nconst boolean = /true|false/;\n\n// TODO(thure, 18 Feb 2025): Remove after the next release.\n\nconst migrateSidebarStateDefaults = {\n [`${DECK_PLUGIN}/complementary-sidebar-state`]: 'expanded',\n [`${DECK_PLUGIN}/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\nconst DeckStateFactory = () => {\n migrateSidebarState();\n\n const state = new LocalStorageStore<DeckPluginState>(DECK_PLUGIN, {\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;;AAOlC,IAAMC,UAAU;AAIhB,IAAMC,8BAA8B;EAClC,CAAC,GAAGC,WAAAA,8BAAyC,GAAG;EAChD,CAAC,GAAGA,WAAAA,gBAA2B,GAAG;AACpC;AAEA,IAAMC,sBAAsB,MAAA;AAC1BC,SAAOC,QAAQJ,2BAAAA,EAA6BK,QAAQ,CAAC,CAACC,KAAKC,YAAAA,MAAa;AACtE,QAAIR,QAAQS,KAAKC,aAAaC,QAAQJ,GAAAA,KAAQ,OAAA,GAAU;AACtDG,mBAAaE,QAAQL,KAAKC,YAAAA;IAC5B;EACF,CAAA;AACF;AAEA,IAAMK,mBAAmB,MAAA;AACvBV,sBAAAA;AAEA,QAAMW,QAAQ,IAAIC,kBAAmCb,aAAa;IAChEc,cAAc;IACdC,2BAA2B;IAC3BC,2BAA2BC;IAC3BC,eAAe;IACfC,YAAY;IACZC,kBAAkBH;IAClBI,YAAYJ;IACZK,gBAAgB;IAChBC,eAAeN;IACfO,iBAAiBP;IACjBQ,aAAa;IACbC,QAAQ,CAAA;IACRC,eAAeV;IACfW,YAAY;IACZC,cAAc;IACdC,OAAO;MACLC,SAAS;QAAE,GAAGC;MAAY;IAC5B;IACA,IAAIC,OAAO;AACT,YAAMA,OAAO,KAAKH,MAAM,KAAKF,UAAU;AACvCM,gBAAUD,MAAM,mBAAmB,KAAKL,UAAU,IAAE;;;;;;;;;AACpD,aAAOK;IACT;IACAE,cAAc,CAAC;IACfC,gBAAgBnB;EAClB,CAAA;AAEAL,QACGyB,KAAK;IAAEhC,KAAK;IAAgBiC,MAAMzB,kBAAkB0B,KAAI;EAAiB,CAAA,EACzEF,KAAK;IAAEhC,KAAK;IAA6BiC,MAAMzB,kBAAkB0B,KAAI;EAAiB,CAAA,EACtFF,KAAK;IAAEhC,KAAK;IAA6BiC,MAAMzB,kBAAkB2B,OAAO;MAAEC,gBAAgB;IAAK,CAAA;EAAG,CAAA,EAClGJ,KAAK;IAAEhC,KAAK;IAASiC,MAAMzB,kBAAkB6B,KAAI;EAA8B,CAAA,EAC/EL,KAAK;IAAEhC,KAAK;IAAciC,MAAMzB,kBAAkB2B,OAAM;EAAG,CAAA,EAC3DH,KAAK;IAAEhC,KAAK;IAAgBiC,MAAMzB,kBAAkB2B,OAAM;EAAG,CAAA;AAEhE,QAAMG,SAASC,KAA0B;IACvC,IAAIC,OAAO;AACT,aAAOC,QAAQlC,MAAMmC,OAAOd,IAAI;IAClC;IACA,IAAId,aAAa;AACf,aAAOP,MAAMmC,OAAO5B;IACtB;IACA,IAAI6B,cAAc;AAChB,aAAOpC,MAAMmC,OAAOjC,iBAAiB;IACvC;IACA,IAAImC,2BAA2B;AAC7B,aAAOrC,MAAMmC,OAAOhC,8BAA8B;IACpD;IACA,IAAImC,YAAY;AACd,aAAOtC,MAAMmC,OAAOnB;IACtB;IACA,IAAIuB,SAAS;AACX,aAAOvC,MAAMmC,OAAOd,KAAKmB,OAAO;QAACxC,MAAMmC,OAAOd,KAAKmB;UAAQxC,MAAMmC,OAAOd,KAAKkB;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", "DECK_PLUGIN", "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
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
ATTENDABLE_PATH_SEPARATOR,
|
|
4
|
-
DECK_COMPANION_TYPE,
|
|
5
|
-
PLANK_COMPANION_TYPE
|
|
6
|
-
} from "./chunk-QFKYT4JK.mjs";
|
|
7
|
-
import {
|
|
8
|
-
DECK_PLUGIN
|
|
9
|
-
} from "./chunk-HHG6H2BX.mjs";
|
|
10
|
-
|
|
11
|
-
// src/hooks/useCompanions.ts
|
|
12
|
-
import { useMemo } from "react";
|
|
13
|
-
import { useAppGraph } from "@dxos/app-framework";
|
|
14
|
-
import { useConnections } from "@dxos/plugin-graph";
|
|
15
|
-
import { byPosition } from "@dxos/util";
|
|
16
|
-
var useCompanions = (id) => {
|
|
17
|
-
const { graph } = useAppGraph();
|
|
18
|
-
const nodes = useConnections(graph, id);
|
|
19
|
-
const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);
|
|
20
|
-
return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [
|
|
21
|
-
companions
|
|
22
|
-
]);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// src/hooks/useBreakpoints.ts
|
|
26
|
-
import { useMediaQuery } from "@dxos/react-ui";
|
|
27
|
-
var useBreakpoints = () => {
|
|
28
|
-
const [isNotMobile] = useMediaQuery("md");
|
|
29
|
-
const [isDesktop] = useMediaQuery("lg");
|
|
30
|
-
return isDesktop ? "desktop" : isNotMobile ? "tablet" : "mobile";
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// src/hooks/useDeckCompanions.ts
|
|
34
|
-
import { useAppGraph as useAppGraph2 } from "@dxos/app-framework";
|
|
35
|
-
import { ROOT_ID, useConnections as useConnections2 } from "@dxos/plugin-graph";
|
|
36
|
-
import { byPosition as byPosition2 } from "@dxos/util";
|
|
37
|
-
var getCompanionId = (id) => {
|
|
38
|
-
const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
|
|
39
|
-
return companionId ?? "never";
|
|
40
|
-
};
|
|
41
|
-
var useDeckCompanions = () => {
|
|
42
|
-
const { graph } = useAppGraph2();
|
|
43
|
-
const connections = useConnections2(graph, ROOT_ID);
|
|
44
|
-
const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE);
|
|
45
|
-
return companions.toSorted((a, b) => byPosition2(a.properties, b.properties));
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// src/hooks/useHoistStatusbar.ts
|
|
49
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
50
|
-
import { useMemo as useMemo2 } from "react";
|
|
51
|
-
import { Capabilities, useCapability } from "@dxos/app-framework";
|
|
52
|
-
import { useThemeContext } from "@dxos/react-ui";
|
|
53
|
-
var useHoistStatusbar = (breakpoint, layoutMode) => {
|
|
54
|
-
var _effect = _useSignals();
|
|
55
|
-
try {
|
|
56
|
-
const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value.enableStatusbar;
|
|
57
|
-
const { safeAreaPadding } = useThemeContext();
|
|
58
|
-
return useMemo2(() => {
|
|
59
|
-
return breakpoint === "desktop" && layoutMode !== "solo--fullscreen" && !!enableStatusbar && safeAreaPadding?.bottom === 0;
|
|
60
|
-
}, [
|
|
61
|
-
enableStatusbar,
|
|
62
|
-
breakpoint,
|
|
63
|
-
safeAreaPadding?.bottom,
|
|
64
|
-
layoutMode
|
|
65
|
-
]);
|
|
66
|
-
} finally {
|
|
67
|
-
_effect.f();
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
// src/hooks/useMainSize.ts
|
|
72
|
-
import { useMainContext } from "@dxos/react-ui";
|
|
73
|
-
var useMainSize = () => {
|
|
74
|
-
const { navigationSidebarState, complementarySidebarState } = useMainContext("DeckPluginPlank");
|
|
75
|
-
return {
|
|
76
|
-
"data-sidebar-inline-start-state": navigationSidebarState,
|
|
77
|
-
"data-sidebar-inline-end-state": complementarySidebarState
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
// src/hooks/useNodeActionExpander.ts
|
|
82
|
-
import { useEffect } from "react";
|
|
83
|
-
import { getGraph } from "@dxos/plugin-graph";
|
|
84
|
-
var useNodeActionExpander = (node) => {
|
|
85
|
-
useEffect(() => {
|
|
86
|
-
if (node) {
|
|
87
|
-
const frame = requestAnimationFrame(() => {
|
|
88
|
-
const graph = getGraph(node);
|
|
89
|
-
void graph.expand(node.id);
|
|
90
|
-
});
|
|
91
|
-
return () => cancelAnimationFrame(frame);
|
|
92
|
-
}
|
|
93
|
-
}, [
|
|
94
|
-
node
|
|
95
|
-
]);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// src/capabilities/index.ts
|
|
99
|
-
import { lazy } from "@dxos/app-framework";
|
|
100
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-YCSX45KJ.mjs"));
|
|
101
|
-
var CheckAppScheme = lazy(() => import("./check-app-scheme-3YZIA73T.mjs"));
|
|
102
|
-
var DeckSettings = lazy(() => import("./settings-WE3TBMOC.mjs"));
|
|
103
|
-
var DeckState = lazy(() => import("./state-DUK6WFDX.mjs"));
|
|
104
|
-
var LayoutIntentResolver = lazy(() => import("./intent-resolver-URTWBGD7.mjs"));
|
|
105
|
-
var ReactRoot = lazy(() => import("./react-root-GFX4GOJT.mjs"));
|
|
106
|
-
var ReactSurface = lazy(() => import("./react-surface-F6L5PLWK.mjs"));
|
|
107
|
-
var Tools = lazy(() => import("./tools-HH6NN7HB.mjs"));
|
|
108
|
-
var UrlHandler = lazy(() => import("./url-handler-774BWWKI.mjs"));
|
|
109
|
-
|
|
110
|
-
export {
|
|
111
|
-
useBreakpoints,
|
|
112
|
-
useCompanions,
|
|
113
|
-
getCompanionId,
|
|
114
|
-
useDeckCompanions,
|
|
115
|
-
useHoistStatusbar,
|
|
116
|
-
useMainSize,
|
|
117
|
-
useNodeActionExpander,
|
|
118
|
-
AppGraphBuilder,
|
|
119
|
-
CheckAppScheme,
|
|
120
|
-
DeckSettings,
|
|
121
|
-
DeckState,
|
|
122
|
-
LayoutIntentResolver,
|
|
123
|
-
ReactRoot,
|
|
124
|
-
ReactSurface,
|
|
125
|
-
Tools,
|
|
126
|
-
UrlHandler
|
|
127
|
-
};
|
|
128
|
-
//# sourceMappingURL=chunk-F4YIQ5GG.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useCompanions.ts", "../../../src/hooks/useBreakpoints.ts", "../../../src/hooks/useDeckCompanions.ts", "../../../src/hooks/useHoistStatusbar.ts", "../../../src/hooks/useMainSize.ts", "../../../src/hooks/useNodeActionExpander.ts", "../../../src/capabilities/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { useAppGraph } from '@dxos/app-framework';\nimport { useConnections } from '@dxos/plugin-graph';\nimport { byPosition } from '@dxos/util';\n\nimport { PLANK_COMPANION_TYPE } from '../types';\n\nexport const useCompanions = (id?: string) => {\n const { graph } = useAppGraph();\n const nodes = useConnections(graph, id);\n const companions = nodes.filter((node) => node.type === PLANK_COMPANION_TYPE);\n return useMemo(() => companions.toSorted((a, b) => byPosition(a.properties, b.properties)), [companions]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMediaQuery } from '@dxos/react-ui';\n\nexport const useBreakpoints = () => {\n const [isNotMobile] = useMediaQuery('md');\n const [isDesktop] = useMediaQuery('lg');\n return isDesktop ? 'desktop' : isNotMobile ? 'tablet' : 'mobile';\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Label, useAppGraph } from '@dxos/app-framework';\nimport { ROOT_ID, useConnections, type Node } from '@dxos/plugin-graph';\nimport { byPosition, type Position } from '@dxos/util';\n\nimport { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';\n\nexport const getCompanionId = (id: string) => {\n const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);\n return companionId ?? 'never';\n};\n\nexport type DeckCompanion = Node<\n any,\n {\n label: Label;\n icon: string;\n // TODO(burdon): Scroll area should be controlled by surface.\n /** If true, the panel will not be wrapped in a scroll area. */\n fixed?: boolean;\n position?: Position;\n }\n>;\n\nexport const useDeckCompanions = (): DeckCompanion[] => {\n const { graph } = useAppGraph();\n const connections = useConnections(graph, ROOT_ID);\n const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];\n return companions.toSorted((a, b) => byPosition(a.properties, b.properties));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useMemo } from 'react';\n\nimport { Capabilities, useCapability } from '@dxos/app-framework';\nimport { useThemeContext } from '@dxos/react-ui';\n\nimport { DECK_PLUGIN } from '../meta';\nimport type { DeckSettingsProps, LayoutMode } from '../types';\n\nexport const useHoistStatusbar = (breakpoint: string, layoutMode?: LayoutMode): boolean => {\n const enableStatusbar = useCapability(Capabilities.SettingsStore).getStore<DeckSettingsProps>(DECK_PLUGIN)!.value\n .enableStatusbar;\n const { safeAreaPadding } = useThemeContext();\n return useMemo(() => {\n return (\n breakpoint === 'desktop' &&\n layoutMode !== 'solo--fullscreen' &&\n !!enableStatusbar &&\n safeAreaPadding?.bottom === 0\n );\n }, [enableStatusbar, breakpoint, safeAreaPadding?.bottom, layoutMode]);\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useMainContext } from '@dxos/react-ui';\n\nexport const useMainSize = () => {\n const { navigationSidebarState, complementarySidebarState } = useMainContext('DeckPluginPlank');\n return {\n 'data-sidebar-inline-start-state': navigationSidebarState,\n 'data-sidebar-inline-end-state': complementarySidebarState,\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { getGraph, type Node } from '@dxos/plugin-graph';\n\nexport const useNodeActionExpander = (node?: Node) => {\n useEffect(() => {\n if (node) {\n const frame = requestAnimationFrame(() => {\n const graph = getGraph(node);\n void graph.expand(node.id);\n });\n return () => cancelAnimationFrame(frame);\n }\n }, [node]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const CheckAppScheme = lazy(() => import('./check-app-scheme'));\nexport const DeckSettings = lazy(() => import('./settings'));\nexport const DeckState = lazy(() => import('./state'));\nexport const LayoutIntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const Tools = lazy(() => import('./tools'));\nexport const UrlHandler = lazy(() => import('./url-handler'));\n\nexport * from './capabilities';\nexport * from './state';\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["useMemo", "useAppGraph", "useConnections", "byPosition", "useCompanions", "id", "graph", "useAppGraph", "nodes", "useConnections", "companions", "filter", "node", "type", "PLANK_COMPANION_TYPE", "useMemo", "toSorted", "a", "b", "byPosition", "properties", "useMediaQuery", "useBreakpoints", "isNotMobile", "useMediaQuery", "isDesktop", "useAppGraph", "ROOT_ID", "useConnections", "byPosition", "getCompanionId", "id", "_", "companionId", "split", "ATTENDABLE_PATH_SEPARATOR", "useDeckCompanions", "graph", "useAppGraph", "connections", "useConnections", "ROOT_ID", "companions", "filter", "node", "type", "DECK_COMPANION_TYPE", "toSorted", "a", "b", "byPosition", "properties", "useMemo", "Capabilities", "useCapability", "useThemeContext", "useHoistStatusbar", "breakpoint", "layoutMode", "enableStatusbar", "useCapability", "Capabilities", "SettingsStore", "getStore", "DECK_PLUGIN", "value", "safeAreaPadding", "useThemeContext", "useMemo", "bottom", "useMainContext", "useMainSize", "navigationSidebarState", "complementarySidebarState", "useMainContext", "useEffect", "getGraph", "useNodeActionExpander", "node", "useEffect", "frame", "requestAnimationFrame", "graph", "getGraph", "expand", "id", "cancelAnimationFrame", "lazy", "AppGraphBuilder", "lazy", "CheckAppScheme", "DeckSettings", "DeckState", "LayoutIntentResolver", "ReactRoot", "ReactSurface", "Tools", "UrlHandler"]
|
|
7
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/meta.ts
|
|
4
|
-
var DECK_PLUGIN = "dxos.org/plugin/deck";
|
|
5
|
-
var meta = {
|
|
6
|
-
id: DECK_PLUGIN,
|
|
7
|
-
name: "Layout",
|
|
8
|
-
icon: "ph--layout--regular"
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
DECK_PLUGIN,
|
|
13
|
-
meta
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=chunk-HHG6H2BX.mjs.map
|