@dxos/plugin-deck 0.7.5-main.ff8607b → 0.7.5-staging.b81e783
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 → app-graph-builder-IYHAGFA3.mjs} +6 -2
- package/dist/lib/browser/{app-graph-builder-CI6ZFMNL.mjs.map → app-graph-builder-IYHAGFA3.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-YQ2GWTDU.mjs → chunk-22AQ5IVX.mjs} +1 -1
- package/dist/lib/browser/{chunk-YQ2GWTDU.mjs.map → chunk-22AQ5IVX.mjs.map} +2 -2
- package/dist/lib/browser/chunk-AOAWF7JV.mjs +24 -0
- package/dist/lib/browser/{chunk-NYZJCVAU.mjs.map → chunk-AOAWF7JV.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-M2L53AIH.mjs → chunk-CYE6QZBQ.mjs} +4 -2
- package/dist/lib/browser/chunk-CYE6QZBQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WXNLVMK2.mjs → chunk-DIXE74SK.mjs} +95 -117
- package/dist/lib/browser/chunk-DIXE74SK.mjs.map +7 -0
- package/dist/lib/browser/chunk-KANJBSIX.mjs +97 -0
- package/dist/lib/browser/chunk-KANJBSIX.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +18 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-CSXFDKTC.mjs → intent-resolver-MWUADUNI.mjs} +42 -48
- package/dist/lib/browser/intent-resolver-MWUADUNI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-ECDQZYQT.mjs → react-root-XCWQYEOK.mjs} +7 -8
- package/dist/lib/browser/react-root-XCWQYEOK.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-4WIQZW2S.mjs → react-surface-IU3LLZDI.mjs} +6 -5
- package/dist/lib/browser/{react-surface-4WIQZW2S.mjs.map → react-surface-IU3LLZDI.mjs.map} +1 -1
- package/dist/lib/browser/{settings-WACNLCPB.mjs → settings-YONG3QB7.mjs} +2 -2
- package/dist/lib/browser/{state-VPOYUKK6.mjs → state-MZZL5S2D.mjs} +11 -4
- package/dist/lib/browser/state-MZZL5S2D.mjs.map +7 -0
- package/dist/lib/browser/tools-5LDJNU56.mjs +51 -0
- package/dist/lib/browser/tools-5LDJNU56.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-HLF42IHP.mjs → url-handler-BIEBKATX.mjs} +5 -5
- package/dist/lib/browser/{url-handler-HLF42IHP.mjs.map → url-handler-BIEBKATX.mjs.map} +3 -3
- 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/capabilities.d.ts +8 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -0
- 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 +4 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +10 -0
- package/dist/types/src/capabilities/tools.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +1 -4
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -4
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Plank.d.ts +1 -1
- package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankError.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +3 -4
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +1 -2
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -1
- package/dist/types/src/components/LayoutSettings.d.ts +1 -2
- package/dist/types/src/components/LayoutSettings.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +1 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/hooks/useNode.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +5 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -1
- package/package.json +31 -30
- package/src/DeckPlugin.ts +14 -4
- package/src/capabilities/app-graph-builder.ts +4 -0
- package/src/capabilities/capabilities.ts +3 -6
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +26 -8
- package/src/capabilities/react-root.tsx +1 -3
- package/src/capabilities/state.ts +6 -1
- package/src/capabilities/tools.ts +61 -0
- package/src/capabilities/url-handler.ts +3 -3
- package/src/components/DeckLayout/ComplementarySidebar.tsx +33 -23
- package/src/components/DeckLayout/DeckLayout.tsx +41 -26
- package/src/components/DeckLayout/Plank.tsx +4 -3
- package/src/components/DeckLayout/PlankControls.tsx +1 -1
- package/src/events.ts +1 -0
- package/src/hooks/useNode.ts +3 -1
- package/src/layout.ts +1 -1
- package/src/types.ts +10 -3
- package/src/util/index.ts +1 -0
- package/src/{capabilities → util}/set-active.ts +4 -0
- package/src/util/useHoistStatusbar.ts +4 -8
- package/dist/lib/browser/chunk-M2L53AIH.mjs.map +0 -7
- package/dist/lib/browser/chunk-NYZJCVAU.mjs +0 -22
- package/dist/lib/browser/chunk-WXNLVMK2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs.map +0 -7
- package/dist/lib/browser/react-root-ECDQZYQT.mjs.map +0 -7
- package/dist/lib/browser/state-VPOYUKK6.mjs.map +0 -7
- package/dist/types/src/capabilities/set-active.d.ts.map +0 -1
- /package/dist/lib/browser/{settings-WACNLCPB.mjs.map → settings-YONG3QB7.mjs.map} +0 -0
- /package/dist/types/src/{capabilities → util}/set-active.d.ts +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeckCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-22AQ5IVX.mjs";
|
|
4
4
|
import {
|
|
5
5
|
DECK_PLUGIN
|
|
6
6
|
} from "./chunk-N7TEPFVR.mjs";
|
|
@@ -127,7 +127,11 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
127
127
|
}
|
|
128
128
|
],
|
|
129
129
|
icon: "ph--sidebar--regular",
|
|
130
|
+
keyBinding: {
|
|
131
|
+
macos: "meta+b"
|
|
132
|
+
},
|
|
130
133
|
disposition: "pin-end",
|
|
134
|
+
position: "hoist",
|
|
131
135
|
l0Breakpoint: "lg"
|
|
132
136
|
}
|
|
133
137
|
};
|
|
@@ -144,4 +148,4 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
|
|
|
144
148
|
export {
|
|
145
149
|
app_graph_builder_default as default
|
|
146
150
|
};
|
|
147
|
-
//# sourceMappingURL=app-graph-builder-
|
|
151
|
+
//# sourceMappingURL=app-graph-builder-IYHAGFA3.mjs.map
|
package/dist/lib/browser/{app-graph-builder-CI6ZFMNL.mjs.map → app-graph-builder-IYHAGFA3.mjs.map}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n filter: (node): node is Node<null> => node.id === ROOT_ID,\n actions: () => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }));\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: [attended], options: { state: false } }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }));\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n state.sidebarState === 'expanded' ? 'collapse navigation sidebar label' : 'open navigation sidebar label',\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n disposition: 'pin-end',\n l0Breakpoint: 'lg',\n },\n };\n\n return !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar];\n },\n }),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,oBAAyC;AAC3F,SAASC,6BAA6B;AACtC,SAASC,iBAA4BC,eAAe;AAKpD,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAOI;EAClDC,SAAS,MAAA;AACP,UAAMC,QAAQX,QAAQY,kBAAkBC,iBAAiBC,gBAAgB;AAIzE,UAAMC,cAAc;MAClBV,IAAI,GAAGW,aAAaC,aAAaC,IAAI;MACrCC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKrB,QAAQY,kBAAkBV,aAAaoB,gBAAgB;AAC7F,cAAMD,SAASE,aAAaP,aAAaQ,eAAe;UAAEC,MAAM;UAAQC,SAAS;YAAEC,MAAM;UAAa;QAAE,CAAA,CAAA;MAC1G;MACAC,YAAY;QACVC,OAAO;UAAC;UAA2B;YAAEC,IAAIxB;UAAY;;QACrDyB,MAAM;QACNC,YAAY;UACVC,OAAO;UACPC,SAAS;QACX;MACF;IACF;AAEA,UAAMC,eAAe;MACnB9B,IAAI,GAAGW,aAAaoB,MAAMlB,IAAI;MAC9BC,MAAM,YAAA;AACJ,cAAMkB,YAAYrC,QAAQY,kBAAkB0B,sBAAsBC,SAAS;AAC3E,cAAMC,WAAWH,UAAUI,QAAQC,GAAG,EAAC;AACvC,YAAIF,UAAU;AACZ,gBA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B;UAAY;;QAC7CyB,MAAM;MACR;IACF;AAEA,UAAMkB,gBAAgB;MACpB5C,IAAI,GAAGW,aAAakC,cAAchC,IAAI;MACtCC,MAAM,YAAA;AACJR,cAAMwC,eAAexC,MAAMwC,iBAAiB,aAAa,cAAc;MACzE;MACAvB,YAAY;QACVC,OAAO;UACLlB,MAAMwC,iBAAiB,aAAa,sCAAsC;UAC1E;YAAErB,IAAIxB;UAAY;;QAEpByB,MAAM;
|
|
6
|
-
"names": ["Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "filter", "node", "ROOT_ID", "actions", "state", "requestCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "disposition", "l0Breakpoint", "solo"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginsContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n filter: (node): node is Node<null> => node.id === ROOT_ID,\n actions: () => {\n const state = context.requestCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }));\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: [attended], options: { state: false } }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n const attention = context.requestCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }));\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n state.sidebarState === 'expanded' ? 'collapse navigation sidebar label' : 'open navigation sidebar label',\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: 'meta+b',\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar];\n },\n }),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,oBAAyC;AAC3F,SAASC,6BAA6B;AACtC,SAASC,iBAA4BC,eAAe;AAKpD,IAAA,4BAAe,CAACC,YACdC,YACEC,aAAaC,iBACbC,gBAAgB;EACdC,IAAIC;EACJC,QAAQ,CAACC,SAA6BA,KAAKH,OAAOI;EAClDC,SAAS,MAAA;AACP,UAAMC,QAAQX,QAAQY,kBAAkBC,iBAAiBC,gBAAgB;AAIzE,UAAMC,cAAc;MAClBV,IAAI,GAAGW,aAAaC,aAAaC,IAAI;MACrCC,MAAM,YAAA;AACJ,cAAM,EAAEC,iBAAiBC,SAAQ,IAAKrB,QAAQY,kBAAkBV,aAAaoB,gBAAgB;AAC7F,cAAMD,SAASE,aAAaP,aAAaQ,eAAe;UAAEC,MAAM;UAAQC,SAAS;YAAEC,MAAM;UAAa;QAAE,CAAA,CAAA;MAC1G;MACAC,YAAY;QACVC,OAAO;UAAC;UAA2B;YAAEC,IAAIxB;UAAY;;QACrDyB,MAAM;QACNC,YAAY;UACVC,OAAO;UACPC,SAAS;QACX;MACF;IACF;AAEA,UAAMC,eAAe;MACnB9B,IAAI,GAAGW,aAAaoB,MAAMlB,IAAI;MAC9BC,MAAM,YAAA;AACJ,cAAMkB,YAAYrC,QAAQY,kBAAkB0B,sBAAsBC,SAAS;AAC3E,cAAMC,WAAWH,UAAUI,QAAQC,GAAG,EAAC;AACvC,YAAIF,UAA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AAEC,IAAIxB;UAAY;;QAC7CyB,MAAM;MACR;IACF;AAEA,UAAMkB,gBAAgB;MACpB5C,IAAI,GAAGW,aAAakC,cAAchC,IAAI;MACtCC,MAAM,YAAA;AACJR,cAAMwC,eAAexC,MAAMwC,iBAAiB,aAAa,cAAc;MACzE;MACAvB,YAAY;QACVC,OAAO;UACLlB,MAAMwC,iBAAiB,aAAa,sCAAsC;UAC1E;YAAErB,IAAIxB;UAAY;;QAEpByB,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;QACAmB,aAAa;QACbC,UAAU;QACVC,cAAc;MAChB;IACF;AAEA,WAAO,CAAC3C,MAAMmC,KAAKS,OAAO;MAACpB;MAAcS;MAAaI;MAAUC;QAAiB;MAACA;;EACpF;AACF,CAAA,CAAA;",
|
|
6
|
+
"names": ["Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "filter", "node", "ROOT_ID", "actions", "state", "requestCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "disposition", "position", "l0Breakpoint", "solo"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\nimport { type DeepReadonly } from '@dxos/util';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckState, type Panel } from '../types';\n\nexport namespace DeckCapabilities {\n export const DeckState = defineCapability<DeepReadonly<DeckState>>(`${DECK_PLUGIN}/capability/state`);\n export const MutableDeckState = defineCapability<DeckState>(`${DECK_PLUGIN}/capability/state`);\n export const ComplementaryPanel = defineCapability<Panel>(`${DECK_PLUGIN}/capability/complementary-panel`);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,wBAAwB;;UAMhBC,mBAAAA;oBACFC,YAAYC,iBAA0C,GAAGC,WAAAA,mBAA8B;oBACvFC,mBAAmBF,iBAA4B,GAAGC,WAAAA,mBAA8B;oBAChFE,qBAAqBH,iBAAwB,GAAGC,WAAAA,iCAA4C;AAC3G,GAJiBH,qBAAAA,mBAAAA,CAAAA,EAAAA;",
|
|
6
6
|
"names": ["defineCapability", "DeckCapabilities", "DeckState", "defineCapability", "DECK_PLUGIN", "MutableDeckState", "ComplementaryPanel"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// packages/plugins/plugin-deck/src/capabilities/index.ts
|
|
2
|
+
import { lazy } from "@dxos/app-framework";
|
|
3
|
+
var AppGraphBuilder = lazy(() => import("./app-graph-builder-IYHAGFA3.mjs"));
|
|
4
|
+
var CheckAppScheme = lazy(() => import("./check-app-scheme-S3EYUPMF.mjs"));
|
|
5
|
+
var LayoutIntentResolver = lazy(() => import("./intent-resolver-MWUADUNI.mjs"));
|
|
6
|
+
var ReactRoot = lazy(() => import("./react-root-XCWQYEOK.mjs"));
|
|
7
|
+
var ReactSurface = lazy(() => import("./react-surface-IU3LLZDI.mjs"));
|
|
8
|
+
var DeckSettings = lazy(() => import("./settings-YONG3QB7.mjs"));
|
|
9
|
+
var DeckState = lazy(() => import("./state-MZZL5S2D.mjs"));
|
|
10
|
+
var Tools = lazy(() => import("./tools-5LDJNU56.mjs"));
|
|
11
|
+
var UrlHandler = lazy(() => import("./url-handler-BIEBKATX.mjs"));
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
AppGraphBuilder,
|
|
15
|
+
CheckAppScheme,
|
|
16
|
+
LayoutIntentResolver,
|
|
17
|
+
ReactRoot,
|
|
18
|
+
ReactSurface,
|
|
19
|
+
DeckSettings,
|
|
20
|
+
DeckState,
|
|
21
|
+
Tools,
|
|
22
|
+
UrlHandler
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=chunk-AOAWF7JV.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/capabilities/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const CheckAppScheme = lazy(() => import('./check-app-scheme'));\nexport const LayoutIntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const DeckSettings = lazy(() => import('./settings'));\nexport const DeckState = lazy(() => import('./state'));\nexport const UrlHandler = lazy(() => import('./url-handler'));\n\nexport * from './capabilities';\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,iCAAA,CAAA;AACzC,IAAME,uBAAuBF,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC/C,IAAMG,YAAYH,KAAK,MAAM,OAAO,2BAAA,CAAA;AACpC,IAAMI,eAAeJ,KAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAMK,eAAeL,KAAK,MAAM,OAAO,yBAAA,CAAA;AACvC,IAAMM,YAAYN,KAAK,MAAM,OAAO,sBAAA,CAAA;AACpC,IAAMO,
|
|
6
|
-
"names": ["lazy", "AppGraphBuilder", "lazy", "CheckAppScheme", "LayoutIntentResolver", "ReactRoot", "ReactSurface", "DeckSettings", "DeckState", "UrlHandler"]
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const CheckAppScheme = lazy(() => import('./check-app-scheme'));\nexport const LayoutIntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactRoot = lazy(() => import('./react-root'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\nexport const DeckSettings = lazy(() => import('./settings'));\nexport const DeckState = lazy(() => import('./state'));\nexport const Tools = lazy(() => import('./tools'));\nexport const UrlHandler = lazy(() => import('./url-handler'));\n\nexport * from './capabilities';\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,iCAAA,CAAA;AACzC,IAAME,uBAAuBF,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC/C,IAAMG,YAAYH,KAAK,MAAM,OAAO,2BAAA,CAAA;AACpC,IAAMI,eAAeJ,KAAK,MAAM,OAAO,8BAAA,CAAA;AACvC,IAAMK,eAAeL,KAAK,MAAM,OAAO,yBAAA,CAAA;AACvC,IAAMM,YAAYN,KAAK,MAAM,OAAO,sBAAA,CAAA;AACpC,IAAMO,QAAQP,KAAK,MAAM,OAAO,sBAAA,CAAA;AAChC,IAAMQ,aAAaR,KAAK,MAAM,OAAO,4BAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "AppGraphBuilder", "lazy", "CheckAppScheme", "LayoutIntentResolver", "ReactRoot", "ReactSurface", "DeckSettings", "DeckState", "Tools", "UrlHandler"]
|
|
7
7
|
}
|
|
@@ -45,9 +45,10 @@ var DeckState = S.mutable(S.Struct({
|
|
|
45
45
|
* Data to be passed to the dialog Surface.
|
|
46
46
|
*/
|
|
47
47
|
dialogContent: S.optional(S.Any),
|
|
48
|
-
dialogBlockAlign: S.optional(S.Literal("start", "center")),
|
|
48
|
+
dialogBlockAlign: S.optional(S.Literal("start", "center", "end")),
|
|
49
49
|
dialogType: S.optional(S.Literal("default", "alert")),
|
|
50
50
|
popoverOpen: S.Boolean,
|
|
51
|
+
popoverSide: S.optional(S.Literal("top", "right", "bottom", "left")),
|
|
51
52
|
/**
|
|
52
53
|
* Data to be passed to the popover Surface.
|
|
53
54
|
*/
|
|
@@ -56,6 +57,7 @@ var DeckState = S.mutable(S.Struct({
|
|
|
56
57
|
toasts: S.mutable(S.Array(LayoutAction.Toast)),
|
|
57
58
|
currentUndoId: S.optional(S.String),
|
|
58
59
|
activeDeck: S.String,
|
|
60
|
+
previousDeck: S.String,
|
|
59
61
|
decks: S.mutable(S.Record({
|
|
60
62
|
key: S.String,
|
|
61
63
|
value: S.mutable(Deck)
|
|
@@ -123,4 +125,4 @@ export {
|
|
|
123
125
|
DECK_ACTION,
|
|
124
126
|
DeckAction
|
|
125
127
|
};
|
|
126
|
-
//# sourceMappingURL=chunk-
|
|
128
|
+
//# sourceMappingURL=chunk-CYE6QZBQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { LayoutAction } from '@dxos/app-framework';\nimport { S } from '@dxos/echo-schema';\nimport { type Node } from '@dxos/plugin-graph';\nimport { type Label } from '@dxos/react-ui';\n\nimport { DECK_PLUGIN } from './meta';\n\n// TODO(Zan): In the future we should consider adding new planks adjacent to the attended plank.\nexport const NewPlankPositions = ['start', 'end'] as const;\nexport type NewPlankPositioning = (typeof NewPlankPositions)[number];\n\nexport const OverscrollOptions = ['none', 'centering'] as const;\nexport type Overscroll = (typeof OverscrollOptions)[number];\n\nexport type Panel = {\n id: string;\n label: Label;\n icon: string;\n filter?: (node: Node) => boolean;\n};\n\nexport const DeckSettingsSchema = S.mutable(\n S.Struct({\n showHints: S.Boolean,\n enableNativeRedirect: S.Boolean,\n enableIdeStyleStatusbar: S.Boolean,\n newPlankPositioning: S.Literal(...NewPlankPositions),\n overscroll: S.Literal(...OverscrollOptions),\n }),\n);\n\nexport type DeckSettingsProps = S.Schema.Type<typeof DeckSettingsSchema>;\n\nconst LayoutMode = S.Union(S.Literal('deck'), S.Literal('solo'), S.Literal('fullscreen'));\nexport const isLayoutMode = (value: any): value is LayoutMode => S.is(LayoutMode)(value);\nexport type LayoutMode = S.Schema.Type<typeof LayoutMode>;\n\nexport const PlankSizing = S.Record({ key: S.String, value: S.Number });\nexport type PlankSizing = S.Schema.Type<typeof PlankSizing>;\n\nexport const Deck = S.Struct({\n initialized: S.Boolean.annotations({\n description: \"If false, the deck has not yet left solo mode and new planks should be solo'd.\",\n }),\n active: S.mutable(S.Array(S.String)),\n inactive: S.mutable(S.Array(S.String)),\n solo: S.optional(S.String),\n fullscreen: S.Boolean,\n plankSizing: S.mutable(PlankSizing),\n});\nexport type Deck = S.Schema.Type<typeof Deck>;\n\nexport const DeckState = S.mutable(\n S.Struct({\n sidebarState: S.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarState: S.Literal('closed', 'collapsed', 'expanded'),\n complementarySidebarPanel: S.optional(S.String),\n\n dialogOpen: S.Boolean,\n /**\n * Data to be passed to the dialog Surface.\n */\n dialogContent: S.optional(S.Any),\n dialogBlockAlign: S.optional(S.Literal('start', 'center', 'end')),\n dialogType: S.optional(S.Literal('default', 'alert')),\n\n popoverOpen: S.Boolean,\n popoverSide: S.optional(S.Literal('top', 'right', 'bottom', 'left')),\n /**\n * Data to be passed to the popover Surface.\n */\n popoverContent: S.optional(S.Any),\n popoverAnchorId: S.optional(S.String),\n\n toasts: S.mutable(S.Array(LayoutAction.Toast)),\n currentUndoId: S.optional(S.String),\n\n activeDeck: S.String,\n previousDeck: S.String,\n decks: S.mutable(S.Record({ key: S.String, value: S.mutable(Deck) })),\n previousMode: S.mutable(S.Record({ key: S.String, value: LayoutMode })),\n deck: S.mutable(Deck),\n\n /**\n * The identifier of a component to scroll into view when it is mounted.\n */\n scrollIntoView: S.optional(S.String),\n }),\n);\n\nexport type DeckState = S.Schema.Type<typeof DeckState>;\n\nexport const getMode = (deck: Deck): LayoutMode => {\n if (deck.solo) {\n return deck.fullscreen ? 'fullscreen' : 'solo';\n }\n\n return 'deck';\n};\n\n// NOTE: Chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html\nexport const SLUG_PATH_SEPARATOR = '~';\n\nexport const DECK_ACTION = `${DECK_PLUGIN}/action`;\n\nexport namespace DeckAction {\n const PartAdjustmentSchema = S.Union(\n S.Literal('close').annotations({ description: 'Close the plank.' }),\n S.Literal('solo').annotations({ description: 'Solo the plank.' }),\n S.Literal('increment-start').annotations({ description: 'Move the plank towards the start of the deck.' }),\n S.Literal('increment-end').annotations({ description: 'Move the plank towards the end of the deck.' }),\n );\n export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;\n export const Adjustment = S.mutable(S.Struct({ id: S.String, type: PartAdjustmentSchema }));\n export type Adjustment = S.Schema.Type<typeof Adjustment>;\n\n /**\n * An atomic transaction to apply to the deck, describing which element to move to which location.\n */\n export class Adjust extends S.TaggedClass<Adjust>()(`${DECK_ACTION}/adjust`, {\n input: Adjustment,\n output: S.Void,\n }) {}\n\n export class UpdatePlankSize extends S.TaggedClass<UpdatePlankSize>()(`${DECK_ACTION}/update-plank-size`, {\n input: S.Struct({\n id: S.String,\n size: S.Number,\n }),\n output: S.Void,\n }) {}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,SAASA,oBAAoB;AAC7B,SAASC,SAAS;AAOX,IAAMC,oBAAoB;EAAC;EAAS;;AAGpC,IAAMC,oBAAoB;EAAC;EAAQ;;AAUn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,EAAiBc,YAAY;IAAEC,aAAa;EAA8C,CAAA,CAAA;cAGzFqC,aAAa5D,EAAEC,QAAQD,EAAEE,OAAO;IAAE2D,IAAI7D,EAAEkB;IAAQ4C,MAAMH;EAAqB,CAAA,CAAA;EAMjF,MAAMI,eAAe/D,EAAEgE,YAAW,EAAW,GAAGR,WAAAA,WAAsB;IAC3ES,OAAKP,YAAEE;IACPM,QAAQlE,EAAEmE;EACZ,CAAA,EAAA;EAAI;AAJH,EAAAT,YACYK,SAAAA;EAKN,MAAMK,wBAAwBpE,EAAEgE,YAAW,EAAoB,GAAGR,WAAAA,sBAAiC;IACxGS,OAAOjE,EAAEE,OAAO;MACd2D,IAAI7D,EAAEkB;MACNmD,MAAMrE,EAAEmB;IACV,CAAA;IACA+C,QAAQlE,EAAEmE;EACZ,CAAA,EAAA;EAAI;cANSC,kBAAAA;AAOf,GA1BiBV,eAAAA,aAAAA,CAAAA,EAAAA;",
|
|
6
|
+
"names": ["LayoutAction", "S", "NewPlankPositions", "OverscrollOptions", "DeckSettingsSchema", "S", "mutable", "Struct", "showHints", "Boolean", "enableNativeRedirect", "enableIdeStyleStatusbar", "newPlankPositioning", "Literal", "overscroll", "LayoutMode", "Union", "isLayoutMode", "value", "is", "PlankSizing", "Record", "key", "String", "Number", "Deck", "initialized", "annotations", "description", "active", "Array", "inactive", "solo", "optional", "fullscreen", "plankSizing", "DeckState", "sidebarState", "complementarySidebarState", "complementarySidebarPanel", "dialogOpen", "dialogContent", "Any", "dialogBlockAlign", "dialogType", "popoverOpen", "popoverSide", "popoverContent", "popoverAnchorId", "toasts", "LayoutAction", "Toast", "currentUndoId", "activeDeck", "previousDeck", "decks", "previousMode", "deck", "scrollIntoView", "getMode", "SLUG_PATH_SEPARATOR", "DECK_ACTION", "DECK_PLUGIN", "DeckAction", "PartAdjustmentSchema", "Adjustment", "id", "type", "Adjust", "TaggedClass", "input", "output", "Void", "UpdatePlankSize", "size"]
|
|
7
|
+
}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
calculateOverscroll,
|
|
3
|
+
layoutAppliesTopbar,
|
|
4
|
+
useBreakpoints,
|
|
5
|
+
useHoistStatusbar
|
|
6
|
+
} from "./chunk-KANJBSIX.mjs";
|
|
1
7
|
import {
|
|
2
8
|
DeckCapabilities
|
|
3
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-22AQ5IVX.mjs";
|
|
4
10
|
import {
|
|
5
11
|
DeckAction,
|
|
6
12
|
NewPlankPositions,
|
|
7
13
|
OverscrollOptions,
|
|
8
14
|
SLUG_PATH_SEPARATOR,
|
|
9
15
|
getMode
|
|
10
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CYE6QZBQ.mjs";
|
|
11
17
|
import {
|
|
12
18
|
DECK_PLUGIN
|
|
13
19
|
} from "./chunk-N7TEPFVR.mjs";
|
|
@@ -94,10 +100,10 @@ var Banner = ({ variant, classNames }) => {
|
|
|
94
100
|
|
|
95
101
|
// packages/plugins/plugin-deck/src/components/DeckLayout/DeckLayout.tsx
|
|
96
102
|
import { untracked } from "@preact/signals-core";
|
|
97
|
-
import React17, { useCallback as useCallback4, useEffect as useEffect6, useMemo as
|
|
98
|
-
import { LayoutAction as LayoutAction4, createIntent as createIntent4, Surface as Surface10, useCapability as
|
|
103
|
+
import React17, { useCallback as useCallback4, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef2, Fragment as Fragment2, useState as useState4 } from "react";
|
|
104
|
+
import { LayoutAction as LayoutAction4, createIntent as createIntent4, Surface as Surface10, useCapability as useCapability5, useIntentDispatcher as useIntentDispatcher4, usePluginManager } from "@dxos/app-framework";
|
|
99
105
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
100
|
-
import { AlertDialog, Dialog as NaturalDialog, Main as Main3, Popover as Popover2, useOnTransition, useMediaQuery
|
|
106
|
+
import { AlertDialog, Dialog as NaturalDialog, Main as Main3, Popover as Popover2, useOnTransition, useMediaQuery } from "@dxos/react-ui";
|
|
101
107
|
import { Stack, StackContext, DEFAULT_HORIZONTAL_SIZE } from "@dxos/react-ui-stack";
|
|
102
108
|
import { mainPaddingTransitions } from "@dxos/react-ui-theme";
|
|
103
109
|
|
|
@@ -186,8 +192,8 @@ var ActiveNode = () => {
|
|
|
186
192
|
};
|
|
187
193
|
|
|
188
194
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
189
|
-
import React8, { useCallback as useCallback2, useEffect as useEffect5, useMemo as
|
|
190
|
-
import { createIntent as createIntent2, LayoutAction as LayoutAction2, Surface as Surface4, useAppGraph as useAppGraph3, useCapability as
|
|
195
|
+
import React8, { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo2, useState as useState3 } from "react";
|
|
196
|
+
import { createIntent as createIntent2, LayoutAction as LayoutAction2, Surface as Surface4, useAppGraph as useAppGraph3, useCapabilities, useCapability as useCapability2, useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
191
197
|
import { Main, useTranslation as useTranslation5, toLocalizedString as toLocalizedString2, IconButton as IconButton2, ScrollArea } from "@dxos/react-ui";
|
|
192
198
|
import { useAttended as useAttended2 } from "@dxos/react-ui-attention";
|
|
193
199
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
@@ -198,7 +204,7 @@ import { useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
|
198
204
|
import { descriptionText, mx as mx3 } from "@dxos/react-ui-theme";
|
|
199
205
|
|
|
200
206
|
// packages/plugins/plugin-deck/src/components/DeckLayout/NodePlankHeading.tsx
|
|
201
|
-
import React5, { Fragment, memo, useCallback, useEffect as useEffect3, useMemo
|
|
207
|
+
import React5, { Fragment, memo, useCallback, useEffect as useEffect3, useMemo } from "react";
|
|
202
208
|
import { createIntent, LayoutAction, Surface as Surface3, useAppGraph as useAppGraph2, useIntentDispatcher } from "@dxos/app-framework";
|
|
203
209
|
import { Icon as Icon2, Popover, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
204
210
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
@@ -217,7 +223,7 @@ var PlankControl = ({ icon, label, ...props }) => {
|
|
|
217
223
|
className: "sr-only"
|
|
218
224
|
}, label), /* @__PURE__ */ React4.createElement(Icon, {
|
|
219
225
|
icon,
|
|
220
|
-
size:
|
|
226
|
+
size: 5
|
|
221
227
|
}))), /* @__PURE__ */ React4.createElement(Tooltip.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip.Content, {
|
|
222
228
|
side: "bottom"
|
|
223
229
|
}, label)));
|
|
@@ -258,56 +264,6 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ onClick, variant = "default",
|
|
|
258
264
|
}), children);
|
|
259
265
|
});
|
|
260
266
|
|
|
261
|
-
// packages/plugins/plugin-deck/src/util/overscroll.ts
|
|
262
|
-
var calculateOverscroll = (planksCount) => {
|
|
263
|
-
if (!planksCount) {
|
|
264
|
-
return {
|
|
265
|
-
paddingInlineStart: 0,
|
|
266
|
-
paddingInlineEnd: 0
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
if (planksCount === 1) {
|
|
270
|
-
const overscrollPadding = "max(0px, calc(((100dvw - var(--dx-main-sidebarWidth) - var(--dx-main-complementaryWidth) - (var(--dx-main-contentFirstWidth) + 1px)) / 2)))";
|
|
271
|
-
return {
|
|
272
|
-
paddingInlineStart: overscrollPadding,
|
|
273
|
-
paddingInlineEnd: overscrollPadding
|
|
274
|
-
};
|
|
275
|
-
} else {
|
|
276
|
-
return {
|
|
277
|
-
paddingInlineStart: "max(0px, calc(((100dvw - (var(--dx-main-contentFirstWidth) + 1px)) / 2) - var(--dx-main-sidebarWidth)))",
|
|
278
|
-
paddingInlineEnd: "max(0px, calc(((100dvw - (var(--dx-main-contentLastWidth) + 1px)) / 2) - var(--dx-main-complementaryWidth)))"
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
// packages/plugins/plugin-deck/src/util/useBreakpoints.ts
|
|
284
|
-
import { useMediaQuery } from "@dxos/react-ui";
|
|
285
|
-
var useBreakpoints = () => {
|
|
286
|
-
const [isNotMobile] = useMediaQuery("md");
|
|
287
|
-
const [isDesktop] = useMediaQuery("lg");
|
|
288
|
-
return isDesktop ? "desktop" : isNotMobile ? "tablet" : "mobile";
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
// packages/plugins/plugin-deck/src/util/layoutAppliesTopbar.ts
|
|
292
|
-
var layoutAppliesTopbar = (breakpoint) => {
|
|
293
|
-
return document.body.getAttribute("data-platform") === "win" && breakpoint === "desktop";
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
// packages/plugins/plugin-deck/src/util/useHoistStatusbar.ts
|
|
297
|
-
import { useMemo } from "react";
|
|
298
|
-
import { Capabilities, useCapability as useCapability2 } from "@dxos/app-framework";
|
|
299
|
-
var useHoistStatusbar = (breakpoint) => {
|
|
300
|
-
const enableIdeStyleStatusbar = useCapability2(Capabilities.SettingsStore).getStore(DECK_PLUGIN).value.enableIdeStyleStatusbar;
|
|
301
|
-
return useMemo(() => {
|
|
302
|
-
return breakpoint === "desktop" && enableIdeStyleStatusbar && // NOTE(thure): this last predicate depends on a head script that measures `env(safe-area-bottom)` on resize;
|
|
303
|
-
// see that of composer-app for an example.
|
|
304
|
-
document.body.getAttribute("data-safe-area-bottom") === "0";
|
|
305
|
-
}, [
|
|
306
|
-
enableIdeStyleStatusbar,
|
|
307
|
-
breakpoint
|
|
308
|
-
]);
|
|
309
|
-
};
|
|
310
|
-
|
|
311
267
|
// packages/plugins/plugin-deck/src/components/fragments.ts
|
|
312
268
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
313
269
|
var soloInlinePadding = "pis-[calc(env(safe-area-inset-left)+.25rem)] pie-[calc(env(safe-area-inset-left)+.25rem)]";
|
|
@@ -338,7 +294,7 @@ var NodePlankHeading = /* @__PURE__ */ memo(({ id, part, node, canIncrementStart
|
|
|
338
294
|
node
|
|
339
295
|
]);
|
|
340
296
|
const attendableId = id.split(SLUG_PATH_SEPARATOR).at(0);
|
|
341
|
-
const capabilities =
|
|
297
|
+
const capabilities = useMemo(() => ({
|
|
342
298
|
solo: breakpoint !== "mobile" && (part === "solo" || part === "deck"),
|
|
343
299
|
incrementStart: canIncrementStart,
|
|
344
300
|
incrementEnd: canIncrementEnd
|
|
@@ -348,7 +304,7 @@ var NodePlankHeading = /* @__PURE__ */ memo(({ id, part, node, canIncrementStart
|
|
|
348
304
|
canIncrementStart,
|
|
349
305
|
canIncrementEnd
|
|
350
306
|
]);
|
|
351
|
-
const sigilActions =
|
|
307
|
+
const sigilActions = useMemo(() => node && [
|
|
352
308
|
actions,
|
|
353
309
|
graph.actions(node)
|
|
354
310
|
].filter((a) => a.length > 0), [
|
|
@@ -479,22 +435,24 @@ var PlankError = ({ id, part, node, error }) => {
|
|
|
479
435
|
};
|
|
480
436
|
|
|
481
437
|
// packages/plugins/plugin-deck/src/components/DeckLayout/ComplementarySidebar.tsx
|
|
482
|
-
var ComplementarySidebar = ({
|
|
483
|
-
const layout = useCapability3(DeckCapabilities.MutableDeckState);
|
|
484
|
-
const attended = useAttended2();
|
|
485
|
-
const panelIds = useMemo3(() => panels.map((p) => p.id), [
|
|
486
|
-
panels
|
|
487
|
-
]);
|
|
488
|
-
const activePanelId = panelIds.find((p) => p === current) ?? panels[0].id;
|
|
489
|
-
const activeEntryId = attended[0] ? `${attended[0]}${SLUG_PATH_SEPARATOR}${activePanelId}` : void 0;
|
|
490
|
-
const { graph } = useAppGraph3();
|
|
491
|
-
const node = useNode(graph, activeEntryId);
|
|
438
|
+
var ComplementarySidebar = ({ current }) => {
|
|
492
439
|
const { t } = useTranslation5(DECK_PLUGIN);
|
|
493
440
|
const { dispatchPromise: dispatch } = useIntentDispatcher2();
|
|
494
|
-
|
|
441
|
+
const layout = useCapability2(DeckCapabilities.MutableDeckState);
|
|
442
|
+
const attended = useAttended2();
|
|
443
|
+
const { graph } = useAppGraph3();
|
|
444
|
+
const node = useNode(graph, attended[0]);
|
|
495
445
|
const breakpoint = useBreakpoints();
|
|
496
446
|
const topbar = layoutAppliesTopbar(breakpoint);
|
|
497
447
|
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
448
|
+
const panels = useCapabilities(DeckCapabilities.ComplementaryPanel);
|
|
449
|
+
const availablePanels = panels.filter((panel) => {
|
|
450
|
+
if (!node || !panel.filter) {
|
|
451
|
+
return true;
|
|
452
|
+
}
|
|
453
|
+
return panel.filter(node);
|
|
454
|
+
});
|
|
455
|
+
const activePanelId = availablePanels.find((panel) => panel.id === current)?.id ?? availablePanels[0]?.id;
|
|
498
456
|
const [internalValue, setInternalValue] = useState3(activePanelId);
|
|
499
457
|
useEffect5(() => {
|
|
500
458
|
setInternalValue(activePanelId);
|
|
@@ -518,6 +476,15 @@ var ComplementarySidebar = ({ panels, current }) => {
|
|
|
518
476
|
activePanelId,
|
|
519
477
|
dispatch
|
|
520
478
|
]);
|
|
479
|
+
const data = useMemo2(() => node && {
|
|
480
|
+
id: node.id,
|
|
481
|
+
subject: node.data,
|
|
482
|
+
workspace: layout.activeDeck,
|
|
483
|
+
popoverAnchorId: layout.popoverAnchorId
|
|
484
|
+
}, [
|
|
485
|
+
node,
|
|
486
|
+
layout.popoverAnchorId
|
|
487
|
+
]);
|
|
521
488
|
return /* @__PURE__ */ React8.createElement(Main.ComplementarySidebar, {
|
|
522
489
|
classNames: [
|
|
523
490
|
topbar && "block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
@@ -531,10 +498,10 @@ var ComplementarySidebar = ({ panels, current }) => {
|
|
|
531
498
|
classNames: "contents"
|
|
532
499
|
}, /* @__PURE__ */ React8.createElement("div", {
|
|
533
500
|
role: "none",
|
|
534
|
-
className: "absolute z-[1] inset-block-0 inline-end-0 !is-[--r0-size] border-is border-separator grid grid-cols-1 grid-rows-[1fr_min-content] bg-baseSurface contain-layout app-drag"
|
|
501
|
+
className: "absolute z-[1] inset-block-0 inline-end-0 !is-[--r0-size] pbs-[env(safe-area-inset-top)] pbe-[env(safe-area-inset-bottom)] border-is border-separator grid grid-cols-1 grid-rows-[1fr_min-content] bg-baseSurface contain-layout app-drag"
|
|
535
502
|
}, /* @__PURE__ */ React8.createElement(Tabs.Tablist, {
|
|
536
503
|
classNames: "grid grid-cols-1 auto-rows-[--rail-action] p-1 gap-1 !overflow-y-auto"
|
|
537
|
-
},
|
|
504
|
+
}, availablePanels.map((panel) => /* @__PURE__ */ React8.createElement(Tabs.Tab, {
|
|
538
505
|
key: panel.id,
|
|
539
506
|
value: panel.id,
|
|
540
507
|
asChild: true
|
|
@@ -556,30 +523,25 @@ var ComplementarySidebar = ({ panels, current }) => {
|
|
|
556
523
|
})), /* @__PURE__ */ React8.createElement("div", {
|
|
557
524
|
role: "none",
|
|
558
525
|
className: "hidden lg:grid grid-cols-1 auto-rows-[--rail-action] p-1"
|
|
559
|
-
}, /* @__PURE__ */ React8.createElement(ToggleComplementarySidebarButton, null))),
|
|
526
|
+
}, /* @__PURE__ */ React8.createElement(ToggleComplementarySidebarButton, null))), availablePanels.map((panel) => /* @__PURE__ */ React8.createElement(Tabs.Tabpanel, {
|
|
560
527
|
key: panel.id,
|
|
561
528
|
value: panel.id,
|
|
562
|
-
classNames: 'absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content]',
|
|
529
|
+
classNames: 'absolute data-[state="inactive"]:-z-[1] inset-block-0 inline-start-0 is-[calc(100%-var(--r0-size))] lg:is-[--r1-size] grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content] pbs-[env(safe-area-inset-top)]',
|
|
563
530
|
...layout.complementarySidebarState !== "expanded" && {
|
|
564
531
|
inert: "true"
|
|
565
532
|
}
|
|
566
|
-
}, panel.id === activePanelId &&
|
|
533
|
+
}, panel.id === activePanelId && data && /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("h2", {
|
|
567
534
|
className: "flex items-center pli-2 border-separator border-be"
|
|
568
535
|
}, toLocalizedString2(panel.label, t)), /* @__PURE__ */ React8.createElement(ScrollArea.Root, null, /* @__PURE__ */ React8.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React8.createElement(Surface4, {
|
|
569
|
-
key: activeEntryId,
|
|
570
536
|
role: `complementary--${activePanelId}`,
|
|
571
|
-
data
|
|
572
|
-
id: activeEntryId,
|
|
573
|
-
subject: node.properties.object ?? node.properties.space,
|
|
574
|
-
popoverAnchorId: layout.popoverAnchorId
|
|
575
|
-
},
|
|
537
|
+
data,
|
|
576
538
|
fallback: PlankContentError,
|
|
577
539
|
placeholder: /* @__PURE__ */ React8.createElement(PlankLoading, null)
|
|
578
540
|
})), /* @__PURE__ */ React8.createElement(ScrollArea.Scrollbar, {
|
|
579
541
|
orientation: "vertical"
|
|
580
542
|
}, /* @__PURE__ */ React8.createElement(ScrollArea.Thumb, null))), !hoistStatusbar && /* @__PURE__ */ React8.createElement("div", {
|
|
581
543
|
role: "contentinfo",
|
|
582
|
-
className: "flex flex-wrap justify-center items-center border-bs border-separator
|
|
544
|
+
className: "flex flex-wrap justify-center items-center border-bs border-separator pbs-1 pbe-[max(env(safe-area-inset-bottom),0.25rem)]"
|
|
583
545
|
}, /* @__PURE__ */ React8.createElement(Surface4, {
|
|
584
546
|
role: "status-bar--r1-footer",
|
|
585
547
|
limit: 1
|
|
@@ -646,8 +608,8 @@ var Fullscreen = ({ id }) => {
|
|
|
646
608
|
};
|
|
647
609
|
|
|
648
610
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Plank.tsx
|
|
649
|
-
import React12, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as
|
|
650
|
-
import { createIntent as createIntent3, LayoutAction as LayoutAction3, Surface as Surface7, useCapability as
|
|
611
|
+
import React12, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo3, useRef } from "react";
|
|
612
|
+
import { createIntent as createIntent3, LayoutAction as LayoutAction3, Surface as Surface7, useCapability as useCapability3, useAppGraph as useAppGraph5, useIntentDispatcher as useIntentDispatcher3 } from "@dxos/app-framework";
|
|
651
613
|
import { debounce } from "@dxos/async";
|
|
652
614
|
import { useAttendableAttributes } from "@dxos/react-ui-attention";
|
|
653
615
|
import { StackItem as StackItem2, railGridHorizontal } from "@dxos/react-ui-stack";
|
|
@@ -655,7 +617,7 @@ import { mainIntrinsicSize, mx as mx5 } from "@dxos/react-ui-theme";
|
|
|
655
617
|
var UNKNOWN_ID = "unknown_id";
|
|
656
618
|
var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, part, path, order, active, layoutMode }) => {
|
|
657
619
|
const { dispatchPromise: dispatch } = useIntentDispatcher3();
|
|
658
|
-
const { deck, popoverAnchorId, scrollIntoView } =
|
|
620
|
+
const { deck, popoverAnchorId, scrollIntoView } = useCapability3(DeckCapabilities.DeckState);
|
|
659
621
|
const { graph } = useAppGraph5();
|
|
660
622
|
const node = useNode(graph, id);
|
|
661
623
|
const rootElement = useRef(null);
|
|
@@ -666,15 +628,16 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, part, path, order, active,
|
|
|
666
628
|
const length = active?.length ?? 1;
|
|
667
629
|
const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
|
|
668
630
|
const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
|
|
669
|
-
const
|
|
631
|
+
const key = id.split("+")[0];
|
|
632
|
+
const size = deck.plankSizing[key];
|
|
670
633
|
const setSize = useCallback3(debounce((nextSize) => {
|
|
671
634
|
return dispatch(createIntent3(DeckAction.UpdatePlankSize, {
|
|
672
|
-
id,
|
|
635
|
+
id: key,
|
|
673
636
|
size: nextSize
|
|
674
637
|
}));
|
|
675
638
|
}, 200), [
|
|
676
639
|
dispatch,
|
|
677
|
-
|
|
640
|
+
key
|
|
678
641
|
]);
|
|
679
642
|
const handleKeyDown = useCallback3((event) => {
|
|
680
643
|
if (event.target === event.currentTarget && event.key === "Escape") {
|
|
@@ -704,7 +667,7 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, part, path, order, active,
|
|
|
704
667
|
const isSolo = layoutMode === "solo" && part === "solo";
|
|
705
668
|
const isAttendable = isSolo || layoutMode === "deck" && part === "deck";
|
|
706
669
|
const sizeAttrs = useMainSize();
|
|
707
|
-
const data =
|
|
670
|
+
const data = useMemo3(() => node && {
|
|
708
671
|
subject: node.data,
|
|
709
672
|
path,
|
|
710
673
|
popoverAnchorId
|
|
@@ -714,7 +677,7 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, part, path, order, active,
|
|
|
714
677
|
path,
|
|
715
678
|
popoverAnchorId
|
|
716
679
|
]);
|
|
717
|
-
const placeholder =
|
|
680
|
+
const placeholder = useMemo3(() => /* @__PURE__ */ React12.createElement(PlankLoading, null), []);
|
|
718
681
|
const className = mx5("attention-surface relative", isSolo && mainIntrinsicSize, isSolo && railGridHorizontal, isSolo ? "grid absolute inset-0" : "!border-separator border-li");
|
|
719
682
|
return /* @__PURE__ */ React12.createElement(Root, {
|
|
720
683
|
ref: rootElement,
|
|
@@ -756,15 +719,15 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, part, path, order, active,
|
|
|
756
719
|
});
|
|
757
720
|
|
|
758
721
|
// packages/plugins/plugin-deck/src/components/DeckLayout/Sidebar.tsx
|
|
759
|
-
import React13, { useMemo as
|
|
760
|
-
import { Surface as Surface8, useCapability as
|
|
722
|
+
import React13, { useMemo as useMemo4 } from "react";
|
|
723
|
+
import { Surface as Surface8, useCapability as useCapability4 } from "@dxos/app-framework";
|
|
761
724
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
762
725
|
var Sidebar = () => {
|
|
763
|
-
const { popoverAnchorId, activeDeck: current } =
|
|
726
|
+
const { popoverAnchorId, activeDeck: current } = useCapability4(DeckCapabilities.DeckState);
|
|
764
727
|
const breakpoint = useBreakpoints();
|
|
765
728
|
const topbar = layoutAppliesTopbar(breakpoint);
|
|
766
729
|
const hoistStatusbar = useHoistStatusbar(breakpoint);
|
|
767
|
-
const navigationData =
|
|
730
|
+
const navigationData = useMemo4(() => ({
|
|
768
731
|
popoverAnchorId,
|
|
769
732
|
topbar,
|
|
770
733
|
hoistStatusbar,
|
|
@@ -853,9 +816,9 @@ var PlankSeparator = ({ index }) => index > 0 ? /* @__PURE__ */ React17.createEl
|
|
|
853
816
|
gridColumn: index * 2
|
|
854
817
|
}
|
|
855
818
|
}) : null;
|
|
856
|
-
var DeckLayout = ({ overscroll, showHints,
|
|
819
|
+
var DeckLayout = ({ overscroll, showHints, onDismissToast }) => {
|
|
857
820
|
const { dispatchPromise: dispatch } = useIntentDispatcher4();
|
|
858
|
-
const context =
|
|
821
|
+
const context = useCapability5(DeckCapabilities.MutableDeckState);
|
|
859
822
|
const { sidebarState, complementarySidebarState, complementarySidebarPanel, dialogOpen, dialogContent, dialogBlockAlign, dialogType, popoverOpen, popoverContent, popoverAnchorId, deck, toasts } = context;
|
|
860
823
|
const { active, fullscreen, solo, plankSizing } = deck;
|
|
861
824
|
const breakpoint = useBreakpoints();
|
|
@@ -864,6 +827,12 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
864
827
|
const pluginManager = usePluginManager();
|
|
865
828
|
const scrollLeftRef = useRef2();
|
|
866
829
|
const deckRef = useRef2(null);
|
|
830
|
+
const [delayedPopoverVisibility, setDelayedPopoverVisibility] = useState4(false);
|
|
831
|
+
useEffect6(() => {
|
|
832
|
+
popoverOpen ? setTimeout(() => setDelayedPopoverVisibility(true), 40) : setDelayedPopoverVisibility(false);
|
|
833
|
+
}, [
|
|
834
|
+
popoverOpen
|
|
835
|
+
]);
|
|
867
836
|
useEffect6(() => {
|
|
868
837
|
const attended = untracked(() => {
|
|
869
838
|
const attention = pluginManager.context.requestCapability(AttentionCapabilities.Attention);
|
|
@@ -874,7 +843,7 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
874
843
|
document.querySelector(`article[data-attendable-id="${firstId}"] button`)?.focus();
|
|
875
844
|
}
|
|
876
845
|
}, []);
|
|
877
|
-
const [isNotMobile] =
|
|
846
|
+
const [isNotMobile] = useMediaQuery("md", {
|
|
878
847
|
ssr: false
|
|
879
848
|
});
|
|
880
849
|
const shouldRevert = useRef2(false);
|
|
@@ -929,7 +898,7 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
929
898
|
solo
|
|
930
899
|
]);
|
|
931
900
|
const isEmpty = !solo && active.length === 0;
|
|
932
|
-
const padding =
|
|
901
|
+
const padding = useMemo5(() => {
|
|
933
902
|
if (!solo && overscroll === "centering") {
|
|
934
903
|
return calculateOverscroll(active.length);
|
|
935
904
|
}
|
|
@@ -939,7 +908,7 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
939
908
|
overscroll,
|
|
940
909
|
deck
|
|
941
910
|
]);
|
|
942
|
-
const mainPosition =
|
|
911
|
+
const mainPosition = useMemo5(() => [
|
|
943
912
|
"grid !block-start-[env(safe-area-inset-top)]",
|
|
944
913
|
topbar && "!block-start-[calc(env(safe-area-inset-top)+var(--rail-size))]",
|
|
945
914
|
hoistStatusbar && "lg:block-end-[--statusbar-size]"
|
|
@@ -948,17 +917,24 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
948
917
|
hoistStatusbar
|
|
949
918
|
]);
|
|
950
919
|
const Dialog = dialogType === "alert" ? AlertDialog : NaturalDialog;
|
|
920
|
+
const handlePopoverOpenChange = useCallback4((nextOpen) => {
|
|
921
|
+
if (nextOpen && popoverAnchorId) {
|
|
922
|
+
context.popoverOpen = true;
|
|
923
|
+
} else {
|
|
924
|
+
context.popoverOpen = false;
|
|
925
|
+
context.popoverAnchorId = void 0;
|
|
926
|
+
context.popoverSide = void 0;
|
|
927
|
+
}
|
|
928
|
+
}, [
|
|
929
|
+
context
|
|
930
|
+
]);
|
|
931
|
+
const handlePopoverClose = useCallback4(() => handlePopoverOpenChange(false), [
|
|
932
|
+
handlePopoverOpenChange
|
|
933
|
+
]);
|
|
951
934
|
return /* @__PURE__ */ React17.createElement(Popover2.Root, {
|
|
952
935
|
modal: true,
|
|
953
|
-
open: !!(popoverAnchorId &&
|
|
954
|
-
onOpenChange:
|
|
955
|
-
if (nextOpen && popoverAnchorId) {
|
|
956
|
-
context.popoverOpen = true;
|
|
957
|
-
} else {
|
|
958
|
-
context.popoverOpen = false;
|
|
959
|
-
context.popoverAnchorId = void 0;
|
|
960
|
-
}
|
|
961
|
-
}
|
|
936
|
+
open: !!(popoverAnchorId && delayedPopoverVisibility),
|
|
937
|
+
onOpenChange: handlePopoverOpenChange
|
|
962
938
|
}, /* @__PURE__ */ React17.createElement(ActiveNode, null), fullscreen && /* @__PURE__ */ React17.createElement(Fullscreen, {
|
|
963
939
|
id: solo
|
|
964
940
|
}), !fullscreen && /* @__PURE__ */ React17.createElement(Main3.Root, {
|
|
@@ -967,7 +943,6 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
967
943
|
complementarySidebarState: context.complementarySidebarState,
|
|
968
944
|
onComplementarySidebarStateChange: (next) => context.complementarySidebarState = next
|
|
969
945
|
}, /* @__PURE__ */ React17.createElement(Sidebar, null), /* @__PURE__ */ React17.createElement(ComplementarySidebar, {
|
|
970
|
-
panels,
|
|
971
946
|
current: complementarySidebarPanel
|
|
972
947
|
}), /* @__PURE__ */ React17.createElement(Main3.Overlay, null), isEmpty && /* @__PURE__ */ React17.createElement(Main3.Content, {
|
|
973
948
|
bounce: true,
|
|
@@ -1037,18 +1012,21 @@ var DeckLayout = ({ overscroll, showHints, panels, onDismissToast }) => {
|
|
|
1037
1012
|
})))), topbar && /* @__PURE__ */ React17.createElement(Topbar, null), hoistStatusbar && /* @__PURE__ */ React17.createElement(StatusBar, {
|
|
1038
1013
|
showHints
|
|
1039
1014
|
})), /* @__PURE__ */ React17.createElement(Popover2.Portal, null, /* @__PURE__ */ React17.createElement(Popover2.Content, {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
context.popoverAnchorId = void 0;
|
|
1043
|
-
}
|
|
1015
|
+
side: context.popoverSide,
|
|
1016
|
+
onEscapeKeyDown: handlePopoverClose
|
|
1044
1017
|
}, /* @__PURE__ */ React17.createElement(Popover2.Viewport, null, /* @__PURE__ */ React17.createElement(Surface10, {
|
|
1045
1018
|
role: "popover",
|
|
1046
1019
|
data: popoverContent,
|
|
1047
1020
|
limit: 1
|
|
1048
1021
|
})), /* @__PURE__ */ React17.createElement(Popover2.Arrow, null))), /* @__PURE__ */ React17.createElement(Dialog.Root, {
|
|
1022
|
+
modal: dialogBlockAlign !== "end",
|
|
1049
1023
|
open: dialogOpen,
|
|
1050
1024
|
onOpenChange: (nextOpen) => context.dialogOpen = nextOpen
|
|
1051
|
-
}, /* @__PURE__ */ React17.createElement(
|
|
1025
|
+
}, dialogBlockAlign === "end" ? /* @__PURE__ */ React17.createElement(Surface10, {
|
|
1026
|
+
role: "dialog",
|
|
1027
|
+
data: dialogContent,
|
|
1028
|
+
limit: 1
|
|
1029
|
+
}) : /* @__PURE__ */ React17.createElement(Dialog.Overlay, {
|
|
1052
1030
|
blockAlign: dialogBlockAlign
|
|
1053
1031
|
}, /* @__PURE__ */ React17.createElement(Surface10, {
|
|
1054
1032
|
role: "dialog",
|
|
@@ -1116,4 +1094,4 @@ export {
|
|
|
1116
1094
|
DeckLayout,
|
|
1117
1095
|
LayoutSettings
|
|
1118
1096
|
};
|
|
1119
|
-
//# sourceMappingURL=chunk-
|
|
1097
|
+
//# sourceMappingURL=chunk-DIXE74SK.mjs.map
|