@dxos/plugin-deck 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446
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-R7COZ4A6.mjs → app-graph-builder-VYZ4IWI3.mjs} +15 -16
- package/dist/lib/browser/app-graph-builder-VYZ4IWI3.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-7AXGR6UT.mjs → check-app-scheme-SEYECDHI.mjs} +3 -2
- package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +7 -0
- package/dist/lib/browser/chunk-6ZSOFCPP.mjs +117 -0
- package/dist/lib/browser/chunk-6ZSOFCPP.mjs.map +7 -0
- package/dist/lib/browser/chunk-B4LOJUWW.mjs +24 -0
- package/dist/lib/browser/chunk-B4LOJUWW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KIGMELV2.mjs → chunk-FJBMNSUC.mjs} +336 -366
- package/dist/lib/browser/chunk-FJBMNSUC.mjs.map +7 -0
- package/dist/lib/browser/chunk-FLOVGNYB.mjs +81 -0
- package/dist/lib/browser/chunk-FLOVGNYB.mjs.map +7 -0
- package/dist/lib/browser/chunk-RJNCG4ND.mjs +154 -0
- package/dist/lib/browser/chunk-RJNCG4ND.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +5 -6
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-MAKOS57L.mjs → intent-resolver-UDYKO2QW.mjs} +89 -130
- package/dist/lib/browser/intent-resolver-UDYKO2QW.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-DGQVIHXP.mjs → react-root-XLXN2VEW.mjs} +6 -6
- package/dist/lib/browser/{react-surface-PXBXIOPU.mjs → react-surface-WNGMZL7I.mjs} +6 -6
- package/dist/lib/browser/{settings-UBWJF7J7.mjs → settings-HMDGSBGO.mjs} +6 -6
- package/dist/lib/browser/settings-HMDGSBGO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OF5RIATN.mjs → state-7TN26M42.mjs} +7 -10
- package/dist/lib/browser/state-7TN26M42.mjs.map +7 -0
- package/dist/lib/browser/{tools-IVPIPTVA.mjs → tools-SC6QEN7R.mjs} +7 -7
- package/dist/lib/browser/tools-SC6QEN7R.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/browser/{url-handler-JSYGSVSB.mjs → url-handler-ODG4B6NX.mjs} +4 -4
- package/dist/lib/browser/url-handler-ODG4B6NX.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +179 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +6 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +2 -2
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +182 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +6 -7
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +2 -2
- 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/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +5 -0
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +5 -18
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +3 -3
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +2 -3
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +2 -3
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts +1 -2
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -5
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +104 -106
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +4 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +1 -2
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -1
- package/dist/types/src/util/overscroll.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/src/util/useBreakpoints.d.ts.map +1 -0
- package/dist/types/src/util/useCompanions.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts +2 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -36
- package/src/capabilities/app-graph-builder.ts +92 -120
- package/src/capabilities/check-app-scheme.ts +7 -3
- package/src/capabilities/index.ts +2 -3
- package/src/capabilities/intent-resolver.ts +133 -175
- package/src/capabilities/settings.ts +4 -4
- package/src/capabilities/state.ts +4 -7
- package/src/capabilities/tools.ts +3 -4
- package/src/capabilities/url-handler.ts +4 -4
- package/src/components/DeckLayout/ContentEmpty.tsx +4 -9
- package/src/components/DeckLayout/DeckLayout.tsx +188 -123
- package/src/components/DeckLayout/Fullscreen.tsx +31 -0
- package/src/components/Plank/Plank.stories.tsx +8 -20
- package/src/components/Plank/Plank.tsx +68 -104
- package/src/components/Plank/PlankControls.tsx +57 -53
- package/src/components/Plank/PlankError.tsx +6 -2
- package/src/components/Plank/PlankHeading.tsx +12 -29
- package/src/components/Sidebar/ComplementarySidebar.tsx +54 -33
- package/src/components/Sidebar/Sidebar.tsx +4 -7
- package/src/components/Sidebar/SidebarButton.tsx +7 -30
- package/src/components/fragments.ts +1 -1
- package/src/hooks/index.ts +1 -5
- package/src/hooks/useNodeActionExpander.ts +8 -3
- package/src/index.ts +1 -1
- package/src/translations.ts +0 -2
- package/src/types.ts +71 -75
- package/src/util/index.ts +4 -1
- package/src/util/layoutAppliesTopbar.ts +2 -8
- package/src/{hooks → util}/useCompanions.ts +3 -3
- package/src/{hooks → util}/useHoistStatusbar.ts +4 -9
- package/dist/lib/browser/app-graph-builder-R7COZ4A6.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-7AXGR6UT.mjs.map +0 -7
- package/dist/lib/browser/chunk-3O2UZVBA.mjs +0 -121
- package/dist/lib/browser/chunk-3O2UZVBA.mjs.map +0 -7
- package/dist/lib/browser/chunk-JAYQ5BTF.mjs +0 -157
- package/dist/lib/browser/chunk-JAYQ5BTF.mjs.map +0 -7
- package/dist/lib/browser/chunk-KIGMELV2.mjs.map +0 -7
- package/dist/lib/browser/chunk-OF5RIATN.mjs.map +0 -7
- package/dist/lib/browser/chunk-TRFYUEBA.mjs +0 -145
- package/dist/lib/browser/chunk-TRFYUEBA.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-MAKOS57L.mjs.map +0 -7
- package/dist/lib/browser/settings-UBWJF7J7.mjs.map +0 -7
- package/dist/lib/browser/state-4WFB4SDO.mjs +0 -10
- package/dist/lib/browser/state-4WFB4SDO.mjs.map +0 -7
- package/dist/lib/browser/tools-IVPIPTVA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-JSYGSVSB.mjs.map +0 -7
- package/dist/types/src/components/DeckLayout/Dialog.d.ts +0 -3
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts +0 -5
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +0 -1
- package/dist/types/src/hooks/useBreakpoints.d.ts.map +0 -1
- package/dist/types/src/hooks/useCompanions.d.ts.map +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -13
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +0 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +0 -3
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +0 -1
- package/src/components/DeckLayout/Dialog.tsx +0 -36
- package/src/components/DeckLayout/Popover.tsx +0 -104
- package/src/hooks/useDeckCompanions.ts +0 -33
- /package/dist/lib/browser/{react-root-DGQVIHXP.mjs.map → react-root-XLXN2VEW.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-PXBXIOPU.mjs.map → react-surface-WNGMZL7I.mjs.map} +0 -0
- /package/dist/types/src/{hooks → util}/useBreakpoints.d.ts +0 -0
- /package/dist/types/src/{hooks → util}/useCompanions.d.ts +0 -0
- /package/src/{hooks → util}/useBreakpoints.ts +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/settings.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { live } from '@dxos/live-object';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { DeckSettingsSchema, type DeckSettingsProps } from '../types';\n\nexport default () => {\n const settings = live<DeckSettingsProps>({\n showHints: false,\n enableDeck: false,\n enableStatusbar: false,\n enableNativeRedirect: false,\n newPlankPositioning: 'start',\n overscroll: 'none',\n });\n\n return contributes(Capabilities.Settings, {\n schema: DeckSettingsSchema,\n prefix: DECK_PLUGIN,\n value: settings,\n });\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,YAAY;AAKrB,IAAA,mBAAe,MAAA;AACb,QAAMC,WAAWC,KAAwB;IACvCC,WAAW;IACXC,YAAY;IACZC,iBAAiB;IACjBC,sBAAsB;IACtBC,qBAAqB;IACrBC,YAAY;EACd,CAAA;AAEA,SAAOC,YAAYC,aAAaC,UAAU;IACxCC,QAAQC;IACRC,QAAQC;IACRC,OAAOf;EACT,CAAA;AACF;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "live", "settings", "live", "showHints", "enableDeck", "enableStatusbar", "enableNativeRedirect", "newPlankPositioning", "overscroll", "contributes", "Capabilities", "Settings", "schema", "DeckSettingsSchema", "prefix", "DECK_PLUGIN", "value"]
|
|
7
|
-
}
|
|
@@ -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 {\n contributes,\n createIntent,\n Capabilities,\n LayoutAction,\n type PromiseIntentDispatcher,\n} from '@dxos/app-framework';\nimport { defineTool, ToolResult } from '@dxos/artifact';\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 defineTool(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?.pivotId, 'No pivot ID');\n invariant(extensions?.dispatch, 'No intent dispatcher');\n\n if (extensions.part === 'deck') {\n const { data, error } = await extensions.dispatch(\n createIntent(DeckAction.ChangeCompanion, {\n primary: extensions.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 extensions.dispatch(\n createIntent(LayoutAction.Open, {\n subject: [id],\n part: 'main',\n options: {\n pivotId: extensions.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,SACEC,aACAC,cACAC,cACAC,oBAEK;AACP,SAASC,YAAYC,kBAAkB;AACvC,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,YAAYE,SAAS,eAAA;;;;;;;;;AAC/BD,gBAAUD,YAAYG,UAAU,wBAAA;;;;;;;;;AAEhC,UAAIH,WAAWI,SAAS,QAAQ;AAC9B,cAAM,EAAEC,MAAMC,MAAK,IAAK,MAAMN,WAAWG,SACvCI,aAAaC,WAAWC,iBAAiB;UACvCC,SAASV,WAAWE;UACpBS,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,MAAMN,WAAWG,SACvCI,aAAaS,aAAaC,MAAM;UAC9BC,SAAS;YAAC5B;;UACVc,MAAM;UACNe,SAAS;YACPjB,SAASF,WAAWE;YACpBkB,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", "contributes", "createIntent", "Capabilities", "LayoutAction", "defineTool", "ToolResult", "invariant", "contributes", "Capabilities", "Tools", "defineTool", "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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Dialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,eAAO,MAAM,MAAM,yBAuBlB,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React, { type PropsWithChildren } from 'react';
|
|
2
|
-
export type DeckPopoverRootProps = PropsWithChildren<{}>;
|
|
3
|
-
export declare const PopoverRoot: ({ children }: DeckPopoverRootProps) => React.JSX.Element;
|
|
4
|
-
export declare const PopoverContent: () => React.JSX.Element;
|
|
5
|
-
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Popover.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAqD,MAAM,OAAO,CAAC;AAOzG,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAUzD,eAAO,MAAM,WAAW,GAAI,cAAc,oBAAoB,sBA+B7D,CAAC;AAEF,eAAO,MAAM,cAAc,yBAgD1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useBreakpoints.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,uCAI1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCompanions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useCompanions.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,aAAa,GAAI,KAAK,MAAM;;;;;;IAKxC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { type Label } from '@dxos/app-framework';
|
|
2
|
-
import { type Node } from '@dxos/plugin-graph';
|
|
3
|
-
import { type Position } from '@dxos/util';
|
|
4
|
-
export declare const getCompanionId: (id: string) => string;
|
|
5
|
-
export type DeckCompanion = Node<any, {
|
|
6
|
-
label: Label;
|
|
7
|
-
icon: string;
|
|
8
|
-
/** If true, the panel will not be wrapped in a scroll area. */
|
|
9
|
-
fixed?: boolean;
|
|
10
|
-
position?: Position;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const useDeckCompanions: () => DeckCompanion[];
|
|
13
|
-
//# sourceMappingURL=useDeckCompanions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDeckCompanions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDeckCompanions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAA2B,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAIvD,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,WAGxC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,GAAG,EACH;IACE,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IAEb,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CACF,CAAC;AAEF,eAAO,MAAM,iBAAiB,QAAO,aAAa,EAKjD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHoistStatusbar.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useHoistStatusbar.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAqB,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9D,eAAO,MAAM,iBAAiB,GAAI,YAAY,MAAM,EAAE,aAAa,UAAU,KAAG,OAY/E,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Surface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { AlertDialog, Dialog as NaturalDialog } from '@dxos/react-ui';
|
|
9
|
-
|
|
10
|
-
import { DeckCapabilities } from '../../capabilities';
|
|
11
|
-
import { PlankContentError } from '../Plank';
|
|
12
|
-
|
|
13
|
-
export const Dialog = () => {
|
|
14
|
-
const context = useCapability(DeckCapabilities.MutableDeckState);
|
|
15
|
-
const { dialogType, dialogBlockAlign, dialogContent, dialogOpen } = context;
|
|
16
|
-
const Root = dialogType === 'alert' ? AlertDialog.Root : NaturalDialog.Root;
|
|
17
|
-
const Overlay = dialogType === 'alert' ? AlertDialog.Overlay : NaturalDialog.Overlay;
|
|
18
|
-
|
|
19
|
-
// TODO(thure): End block alignment affecting `modal` and whether the surface renders in an overlay is tailored to the needs of the ambient chat dialog. As the feature matures, consider separating concerns.
|
|
20
|
-
return (
|
|
21
|
-
<Root
|
|
22
|
-
modal={dialogBlockAlign !== 'end'}
|
|
23
|
-
open={dialogOpen}
|
|
24
|
-
onOpenChange={(nextOpen) => (context.dialogOpen = nextOpen)}
|
|
25
|
-
>
|
|
26
|
-
{dialogBlockAlign === 'end' ? (
|
|
27
|
-
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
28
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={PlankContentError} placeholder={<div />} />
|
|
29
|
-
) : (
|
|
30
|
-
<Overlay blockAlign={dialogBlockAlign}>
|
|
31
|
-
<Surface role='dialog' data={dialogContent} limit={1} fallback={PlankContentError} />
|
|
32
|
-
</Overlay>
|
|
33
|
-
)}
|
|
34
|
-
</Root>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { createContext } from '@radix-ui/react-context';
|
|
6
|
-
import React, { type PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
|
-
|
|
8
|
-
import { Surface, useCapability } from '@dxos/app-framework';
|
|
9
|
-
import { Popover, type PopoverContentInteractOutsideEvent } from '@dxos/react-ui';
|
|
10
|
-
|
|
11
|
-
import { DeckCapabilities } from '../../capabilities';
|
|
12
|
-
|
|
13
|
-
export type DeckPopoverRootProps = PropsWithChildren<{}>;
|
|
14
|
-
|
|
15
|
-
const DEBOUNCE_DELAY = 40;
|
|
16
|
-
|
|
17
|
-
type DeckPopoverContextValue = {
|
|
18
|
-
setOpen: (open: boolean) => void;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');
|
|
22
|
-
|
|
23
|
-
export const PopoverRoot = ({ children }: DeckPopoverRootProps) => {
|
|
24
|
-
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
25
|
-
const virtualRef = useRef<HTMLButtonElement | null>(null);
|
|
26
|
-
const [virtualIter, setVirtualIter] = useState(0);
|
|
27
|
-
const [open, setOpen] = useState(false);
|
|
28
|
-
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
29
|
-
|
|
30
|
-
// TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering
|
|
31
|
-
// the anchor further down the tree or measuring the virtual trigger’s client rect.
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
setOpen(false);
|
|
34
|
-
if (layout.popoverOpen) {
|
|
35
|
-
if (debounceRef.current) {
|
|
36
|
-
clearTimeout(debounceRef.current);
|
|
37
|
-
}
|
|
38
|
-
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
39
|
-
virtualRef.current = layout.popoverAnchor ?? null;
|
|
40
|
-
setVirtualIter((iter) => iter + 1);
|
|
41
|
-
}
|
|
42
|
-
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
43
|
-
}
|
|
44
|
-
}, [layout.popoverOpen, layout.popoverAnchorId, layout.popoverAnchor, layout.popoverContent]);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<DeckPopoverProvider setOpen={setOpen}>
|
|
48
|
-
<Popover.Root modal={false} open={open}>
|
|
49
|
-
{layout.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}
|
|
50
|
-
{children}
|
|
51
|
-
</Popover.Root>
|
|
52
|
-
</DeckPopoverProvider>
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const PopoverContent = () => {
|
|
57
|
-
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
58
|
-
const { setOpen } = useDeckPopoverContext('PopoverContent');
|
|
59
|
-
|
|
60
|
-
const handleClose = useCallback(
|
|
61
|
-
(event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {
|
|
62
|
-
if (
|
|
63
|
-
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
64
|
-
event.type === 'dismissableLayer.focusOutside' &&
|
|
65
|
-
(event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')
|
|
66
|
-
) {
|
|
67
|
-
event.preventDefault();
|
|
68
|
-
} else {
|
|
69
|
-
setOpen(false);
|
|
70
|
-
layout.popoverOpen = false;
|
|
71
|
-
layout.popoverAnchor = undefined;
|
|
72
|
-
layout.popoverAnchorId = undefined;
|
|
73
|
-
layout.popoverSide = undefined;
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
[setOpen],
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const collisionBoundaries: HTMLElement[] = useMemo(() => {
|
|
80
|
-
const closest = layout.popoverAnchor?.closest('[data-popover-collision-boundary]') as
|
|
81
|
-
| HTMLElement
|
|
82
|
-
| null
|
|
83
|
-
| undefined;
|
|
84
|
-
return closest ? [closest] : [];
|
|
85
|
-
}, [layout.popoverAnchor]);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<Popover.Portal>
|
|
89
|
-
<Popover.Content
|
|
90
|
-
side={layout.popoverSide}
|
|
91
|
-
onInteractOutside={handleClose}
|
|
92
|
-
onEscapeKeyDown={handleClose}
|
|
93
|
-
collisionBoundary={collisionBoundaries}
|
|
94
|
-
sticky='always'
|
|
95
|
-
hideWhenDetached
|
|
96
|
-
>
|
|
97
|
-
<Popover.Viewport>
|
|
98
|
-
<Surface role='popover' data={layout.popoverContent} limit={1} />
|
|
99
|
-
</Popover.Viewport>
|
|
100
|
-
<Popover.Arrow />
|
|
101
|
-
</Popover.Content>
|
|
102
|
-
</Popover.Portal>
|
|
103
|
-
);
|
|
104
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Label, useAppGraph } from '@dxos/app-framework';
|
|
6
|
-
import { ROOT_ID, useConnections, type Node } from '@dxos/plugin-graph';
|
|
7
|
-
import { byPosition, type Position } from '@dxos/util';
|
|
8
|
-
|
|
9
|
-
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';
|
|
10
|
-
|
|
11
|
-
export const getCompanionId = (id: string) => {
|
|
12
|
-
const [_, companionId] = id.split(ATTENDABLE_PATH_SEPARATOR);
|
|
13
|
-
return companionId ?? 'never';
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export type DeckCompanion = Node<
|
|
17
|
-
any,
|
|
18
|
-
{
|
|
19
|
-
label: Label;
|
|
20
|
-
icon: string;
|
|
21
|
-
// TODO(burdon): Scroll area should be controlled by surface.
|
|
22
|
-
/** If true, the panel will not be wrapped in a scroll area. */
|
|
23
|
-
fixed?: boolean;
|
|
24
|
-
position?: Position;
|
|
25
|
-
}
|
|
26
|
-
>;
|
|
27
|
-
|
|
28
|
-
export const useDeckCompanions = (): DeckCompanion[] => {
|
|
29
|
-
const { graph } = useAppGraph();
|
|
30
|
-
const connections = useConnections(graph, ROOT_ID);
|
|
31
|
-
const companions = connections.filter((node) => node.type === DECK_COMPANION_TYPE) as DeckCompanion[];
|
|
32
|
-
return companions.toSorted((a, b) => byPosition(a.properties, b.properties));
|
|
33
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|