@dxos/plugin-deck 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7
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/Banner-HXRXEUOZ.mjs +14 -0
- package/dist/lib/browser/Banner-HXRXEUOZ.mjs.map +7 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs +96 -0
- package/dist/lib/browser/DeckSettings-HSSQKFNE.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-DTVCULQ4.mjs → app-graph-builder-MP6INIM2.mjs} +16 -13
- package/dist/lib/browser/app-graph-builder-MP6INIM2.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-JSRXXIYF.mjs → check-app-scheme-AUNCD2Y6.mjs} +9 -8
- package/dist/lib/browser/check-app-scheme-AUNCD2Y6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ATFPDN6J.mjs → chunk-3P2FJVXC.mjs} +35 -49
- package/dist/lib/browser/chunk-3P2FJVXC.mjs.map +7 -0
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs +74 -0
- package/dist/lib/browser/chunk-BJDEG7YZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-EREEXCHO.mjs → chunk-ITNJS5QX.mjs} +214 -276
- package/dist/lib/browser/chunk-ITNJS5QX.mjs.map +7 -0
- package/dist/lib/browser/chunk-L3RYMAV7.mjs +16 -0
- package/dist/lib/browser/chunk-L3RYMAV7.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UNG4CLLP.mjs → chunk-TAHLKBDO.mjs} +46 -20
- package/dist/lib/browser/chunk-TAHLKBDO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +39 -35
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{operation-resolver-CDYBLZJ4.mjs → operation-resolver-2TEGT4PG.mjs} +166 -122
- package/dist/lib/browser/operation-resolver-2TEGT4PG.mjs.map +7 -0
- package/dist/lib/browser/{react-root-LYNEKGHM.mjs → react-root-AS4IOYDG.mjs} +8 -7
- package/dist/lib/browser/react-root-AS4IOYDG.mjs.map +7 -0
- package/dist/lib/browser/react-surface-FH7TC6WW.mjs +44 -0
- package/dist/lib/browser/react-surface-FH7TC6WW.mjs.map +7 -0
- package/dist/lib/browser/{settings-OMHVGZ6V.mjs → settings-PTMGCSJH.mjs} +8 -5
- package/dist/lib/browser/settings-PTMGCSJH.mjs.map +7 -0
- package/dist/lib/browser/{state-OC3BSB6E.mjs → state-MA4SQ7BE.mjs} +11 -8
- package/dist/lib/browser/state-MA4SQ7BE.mjs.map +7 -0
- package/dist/lib/browser/{toolkit-R53LD3EA.mjs → toolkit-6B34QFU3.mjs} +10 -8
- package/dist/lib/browser/toolkit-6B34QFU3.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -5
- package/dist/lib/browser/{url-handler-53TE6JZO.mjs → url-handler-FEUFPQIP.mjs} +22 -17
- package/dist/lib/browser/url-handler-FEUFPQIP.mjs.map +7 -0
- package/dist/lib/node-esm/Banner-RN7XXOXY.mjs +15 -0
- package/dist/lib/node-esm/Banner-RN7XXOXY.mjs.map +7 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs +97 -0
- package/dist/lib/node-esm/DeckSettings-DJRFLKQS.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-473BNZDJ.mjs → app-graph-builder-ACHG5HY7.mjs} +16 -13
- package/dist/lib/node-esm/app-graph-builder-ACHG5HY7.mjs.map +7 -0
- package/dist/lib/node-esm/{check-app-scheme-IVYRHKRH.mjs → check-app-scheme-WN76GWVC.mjs} +9 -8
- package/dist/lib/node-esm/check-app-scheme-WN76GWVC.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs +76 -0
- package/dist/lib/node-esm/chunk-DGTRKKWZ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-SKEVPQ7E.mjs → chunk-EMU4VIPH.mjs} +46 -20
- package/dist/lib/node-esm/chunk-EMU4VIPH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-XAKTY3EB.mjs → chunk-GZJAQ5IP.mjs} +34 -49
- package/dist/lib/node-esm/chunk-GZJAQ5IP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-V6VEXRD4.mjs → chunk-MBCCNIWY.mjs} +213 -275
- package/dist/lib/node-esm/chunk-MBCCNIWY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs +18 -0
- package/dist/lib/node-esm/chunk-XCNF4COU.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +39 -35
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{operation-resolver-WUOE33ID.mjs → operation-resolver-GCMCCI7A.mjs} +166 -122
- package/dist/lib/node-esm/operation-resolver-GCMCCI7A.mjs.map +7 -0
- package/dist/lib/node-esm/{react-root-L7H43AS3.mjs → react-root-7DTDLAF4.mjs} +8 -7
- package/dist/lib/node-esm/react-root-7DTDLAF4.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-77DKVMDV.mjs → react-surface-U6Z2K324.mjs} +18 -16
- package/dist/lib/node-esm/react-surface-U6Z2K324.mjs.map +7 -0
- package/dist/lib/node-esm/{settings-2HB6FKIK.mjs → settings-LPPFLXNJ.mjs} +8 -5
- package/dist/lib/node-esm/settings-LPPFLXNJ.mjs.map +7 -0
- package/dist/lib/node-esm/{state-JRQ45ACJ.mjs → state-KNRU3GDC.mjs} +11 -8
- package/dist/lib/node-esm/state-KNRU3GDC.mjs.map +7 -0
- package/dist/lib/node-esm/{toolkit-JLPZNNKB.mjs → toolkit-SOWYKJY3.mjs} +10 -8
- package/dist/lib/node-esm/toolkit-SOWYKJY3.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -5
- package/dist/lib/node-esm/{url-handler-QGF2R24T.mjs → url-handler-4LEB7UWF.mjs} +22 -17
- package/dist/lib/node-esm/url-handler-4LEB7UWF.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +1 -1
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts +1 -1
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +4 -3
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- package/dist/types/src/capabilities/state/index.d.ts +6 -6
- package/dist/types/src/capabilities/state/state.d.ts +7 -7
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts +1 -1
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +4 -3
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools/tools.d.ts +1 -1
- package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +1 -1
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +1 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +3 -3
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +2 -2
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +3 -2
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +5 -3
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/fragments.d.ts +4 -1
- package/dist/types/src/components/fragments.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/Banner/Banner.d.ts +2 -0
- package/dist/types/src/containers/Banner/Banner.d.ts.map +1 -0
- package/dist/types/src/containers/Banner/index.d.ts +3 -0
- package/dist/types/src/containers/Banner/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/containers/DeckSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DeckSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +4 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts +0 -1
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/hooks/useSelectedCompanion.d.ts +13 -0
- package/dist/types/src/hooks/useSelectedCompanion.d.ts.map +1 -0
- package/dist/types/src/layout.d.ts +1 -7
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +6 -6
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +18 -16
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -43
- package/src/DeckPlugin.ts +12 -11
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +11 -10
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +12 -8
- package/src/capabilities/operation-resolver/operation-resolver.ts +110 -107
- package/src/capabilities/react-root/react-root.tsx +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +11 -10
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/capabilities/state/state.ts +6 -5
- package/src/capabilities/toolkit/toolkit.ts +7 -6
- package/src/capabilities/tools/tools.ts +0 -1
- package/src/capabilities/url-handler/url-handler.ts +16 -13
- package/src/components/DeckLayout/ActiveNode.tsx +3 -2
- package/src/components/DeckLayout/Banner.tsx +8 -8
- package/src/components/DeckLayout/ContentEmpty.tsx +3 -3
- package/src/components/DeckLayout/DeckLayout.stories.tsx +8 -6
- package/src/components/DeckLayout/DeckMain.tsx +28 -27
- package/src/components/DeckLayout/Dialog.tsx +10 -4
- package/src/components/DeckLayout/Fallback.tsx +2 -6
- package/src/components/DeckLayout/Popover.tsx +34 -8
- package/src/components/DeckLayout/StatusBar.tsx +4 -4
- package/src/components/DeckLayout/Toast.tsx +3 -3
- package/src/components/Plank/Plank.stories.tsx +7 -5
- package/src/components/Plank/Plank.tsx +32 -24
- package/src/components/Plank/PlankControls.tsx +6 -8
- package/src/components/Plank/PlankError.tsx +29 -15
- package/src/components/Plank/PlankHeading.tsx +20 -23
- package/src/components/Plank/PlankLoading.tsx +1 -1
- package/src/components/Sidebar/ComplementarySidebar.tsx +46 -49
- package/src/components/Sidebar/Sidebar.tsx +4 -4
- package/src/components/Sidebar/SidebarButton.tsx +12 -12
- package/src/components/fragments.ts +9 -4
- package/src/components/index.ts +0 -1
- package/src/containers/Banner/Banner.tsx +5 -0
- package/src/containers/Banner/index.ts +7 -0
- package/src/{components → containers}/DeckSettings/DeckSettings.tsx +23 -23
- package/src/containers/DeckSettings/index.ts +7 -0
- package/src/containers/index.ts +8 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCompanions.ts +2 -2
- package/src/hooks/useDeckCompanions.ts +3 -8
- package/src/hooks/useDeckState.ts +3 -3
- package/src/hooks/useHoistStatusbar.ts +1 -1
- package/src/hooks/useMainSize.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/hooks/useSelectedCompanion.ts +32 -0
- package/src/layout.ts +1 -14
- package/src/meta.ts +1 -1
- package/src/translations.ts +1 -0
- package/src/types/capabilities.ts +5 -5
- package/src/types/events.ts +5 -4
- package/src/types/schema.ts +22 -21
- package/src/util/overscroll.ts +3 -3
- package/dist/lib/browser/app-graph-builder-DTVCULQ4.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-JSRXXIYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ATFPDN6J.mjs.map +0 -7
- package/dist/lib/browser/chunk-EREEXCHO.mjs.map +0 -7
- package/dist/lib/browser/chunk-NHABISX2.mjs +0 -152
- package/dist/lib/browser/chunk-NHABISX2.mjs.map +0 -7
- package/dist/lib/browser/chunk-UNG4CLLP.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-CDYBLZJ4.mjs.map +0 -7
- package/dist/lib/browser/react-root-LYNEKGHM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RPKD7XUR.mjs +0 -42
- package/dist/lib/browser/react-surface-RPKD7XUR.mjs.map +0 -7
- package/dist/lib/browser/settings-OMHVGZ6V.mjs.map +0 -7
- package/dist/lib/browser/state-OC3BSB6E.mjs.map +0 -7
- package/dist/lib/browser/toolkit-R53LD3EA.mjs.map +0 -7
- package/dist/lib/browser/url-handler-53TE6JZO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-473BNZDJ.mjs.map +0 -7
- package/dist/lib/node-esm/check-app-scheme-IVYRHKRH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +0 -154
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SKEVPQ7E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V6VEXRD4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XAKTY3EB.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-WUOE33ID.mjs.map +0 -7
- package/dist/lib/node-esm/react-root-L7H43AS3.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-77DKVMDV.mjs.map +0 -7
- package/dist/lib/node-esm/settings-2HB6FKIK.mjs.map +0 -7
- package/dist/lib/node-esm/state-JRQ45ACJ.mjs.map +0 -7
- package/dist/lib/node-esm/toolkit-JLPZNNKB.mjs.map +0 -7
- package/dist/lib/node-esm/url-handler-QGF2R24T.mjs.map +0 -7
- package/dist/types/src/components/DeckSettings/index.d.ts +0 -2
- package/dist/types/src/components/DeckSettings/index.d.ts.map +0 -1
- package/src/components/DeckSettings/index.ts +0 -5
- /package/dist/types/src/{components → containers}/DeckSettings/DeckSettings.d.ts +0 -0
|
@@ -1,63 +1,64 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
getCompanionId,
|
|
4
3
|
useBreakpoints,
|
|
5
4
|
useCompanions,
|
|
6
5
|
useDeckCompanions,
|
|
7
6
|
useDeckState,
|
|
8
7
|
useHoistStatusbar,
|
|
9
8
|
useMainSize,
|
|
10
|
-
useNodeActionExpander
|
|
11
|
-
|
|
9
|
+
useNodeActionExpander,
|
|
10
|
+
useSelectedCompanion
|
|
11
|
+
} from "./chunk-EMU4VIPH.mjs";
|
|
12
12
|
import {
|
|
13
13
|
calculateOverscroll,
|
|
14
|
-
layoutAppliesTopbar
|
|
15
|
-
|
|
16
|
-
} from "./chunk-ADPMWKLL.mjs";
|
|
14
|
+
layoutAppliesTopbar
|
|
15
|
+
} from "./chunk-DGTRKKWZ.mjs";
|
|
17
16
|
import {
|
|
18
17
|
DeckCapabilities,
|
|
19
18
|
DeckOperation,
|
|
20
|
-
NewPlankPositions,
|
|
21
|
-
OverscrollOptions,
|
|
22
19
|
PLANK_COMPANION_TYPE,
|
|
23
|
-
getMode
|
|
20
|
+
getMode
|
|
21
|
+
} from "./chunk-GZJAQ5IP.mjs";
|
|
22
|
+
import {
|
|
24
23
|
meta
|
|
25
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XCNF4COU.mjs";
|
|
26
25
|
|
|
27
26
|
// src/components/DeckLayout/Banner.tsx
|
|
28
27
|
import React9 from "react";
|
|
29
|
-
import { Surface as Surface5 } from "@dxos/app-framework/
|
|
28
|
+
import { Surface as Surface5 } from "@dxos/app-framework/ui";
|
|
30
29
|
import { useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
31
30
|
import { mx as mx5, osTranslations } from "@dxos/ui-theme";
|
|
32
31
|
|
|
33
32
|
// src/components/Sidebar/ComplementarySidebar.tsx
|
|
34
33
|
import React7, { Fragment as Fragment2, useCallback as useCallback5, useEffect as useEffect3, useMemo as useMemo3, useState as useState2 } from "react";
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import { IconButton as IconButton4, Main, toLocalizedString as toLocalizedString2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
34
|
+
import { Surface as Surface3, useOperationInvoker as useOperationInvoker5 } from "@dxos/app-framework/ui";
|
|
35
|
+
import { LayoutOperation as LayoutOperation4, getCompanionVariant as getCompanionVariant4 } from "@dxos/app-toolkit";
|
|
36
|
+
import { IconButton as IconButton4, Main, ScrollArea, toLocalizedString as toLocalizedString2, useTranslation as useTranslation5 } from "@dxos/react-ui";
|
|
38
37
|
import { Tabs } from "@dxos/react-ui-tabs";
|
|
39
38
|
import { mx as mx4 } from "@dxos/ui-theme";
|
|
40
39
|
|
|
41
40
|
// src/components/Plank/Plank.tsx
|
|
42
41
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
43
42
|
import React5, { memo as memo2, useCallback as useCallback3, useLayoutEffect, useMemo as useMemo2, useRef } from "react";
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
43
|
+
import { Surface as Surface2, useOperationInvoker as useOperationInvoker3 } from "@dxos/app-framework/ui";
|
|
44
|
+
import { LayoutOperation as LayoutOperation2, getCompanionVariant as getCompanionVariant2 } from "@dxos/app-toolkit";
|
|
45
|
+
import { useAppGraph as useAppGraph2 } from "@dxos/app-toolkit/ui";
|
|
46
46
|
import { debounce } from "@dxos/async";
|
|
47
47
|
import { useNode } from "@dxos/plugin-graph";
|
|
48
|
-
import {
|
|
48
|
+
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
49
49
|
import { StackItem as StackItem2, railGridHorizontal } from "@dxos/react-ui-stack";
|
|
50
50
|
import { mainIntrinsicSize, mx as mx3 } from "@dxos/ui-theme";
|
|
51
51
|
|
|
52
52
|
// src/components/Plank/PlankError.tsx
|
|
53
53
|
import React4, { useEffect as useEffect2, useState } from "react";
|
|
54
|
-
import { useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
54
|
+
import { ErrorFallback, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
55
55
|
import { descriptionMessage, mx as mx2 } from "@dxos/ui-theme";
|
|
56
56
|
|
|
57
57
|
// src/components/Plank/PlankHeading.tsx
|
|
58
58
|
import React2, { Fragment, memo, useCallback as useCallback2, useEffect, useMemo } from "react";
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
59
|
+
import { Surface, useOperationInvoker as useOperationInvoker2 } from "@dxos/app-framework/ui";
|
|
60
|
+
import { LayoutOperation, getCompanionVariant } from "@dxos/app-toolkit";
|
|
61
|
+
import { useAppGraph } from "@dxos/app-toolkit/ui";
|
|
61
62
|
import { Graph, useActionRunner } from "@dxos/plugin-graph";
|
|
62
63
|
import { Icon, IconButton as IconButton2, Popover, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
63
64
|
import { StackItem } from "@dxos/react-ui-stack";
|
|
@@ -66,17 +67,15 @@ import { hoverableControls, hoverableFocusedWithinControls } from "@dxos/ui-them
|
|
|
66
67
|
|
|
67
68
|
// src/components/fragments.ts
|
|
68
69
|
import { mx } from "@dxos/ui-theme";
|
|
69
|
-
var soloInlinePadding = "
|
|
70
|
-
var sidebarToggleStyles = "
|
|
71
|
-
var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "
|
|
72
|
-
var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "
|
|
70
|
+
var soloInlinePadding = "ps-[calc(env(safe-area-inset-left)+.25rem)] pe-[calc(env(safe-area-inset-right)+.25rem)]";
|
|
71
|
+
var sidebarToggleStyles = "h-(--dx-rail-item) w-(--dx-rail-item) absolute bottom-2 z-[1] !bg-deck-surface lg:hidden";
|
|
72
|
+
var fixedSidebarToggleStyles = mx(sidebarToggleStyles, "left-2");
|
|
73
|
+
var fixedComplementarySidebarToggleStyles = mx(sidebarToggleStyles, "right-2");
|
|
73
74
|
|
|
74
75
|
// src/components/Plank/PlankControls.tsx
|
|
75
76
|
import React, { forwardRef, useCallback } from "react";
|
|
76
|
-
import { useOperationInvoker } from "@dxos/app-framework/
|
|
77
|
-
import { invariant } from "@dxos/invariant";
|
|
77
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
78
78
|
import { ButtonGroup, IconButton, useTranslation } from "@dxos/react-ui";
|
|
79
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-deck/src/components/Plank/PlankControls.tsx";
|
|
80
79
|
var PlankControl = ({ icon, label: label3, ...props }) => {
|
|
81
80
|
return /* @__PURE__ */ React.createElement(IconButton, {
|
|
82
81
|
label: label3,
|
|
@@ -87,31 +86,20 @@ var PlankControl = ({ icon, label: label3, ...props }) => {
|
|
|
87
86
|
...props
|
|
88
87
|
});
|
|
89
88
|
};
|
|
90
|
-
var plankControlSpacing = "
|
|
89
|
+
var plankControlSpacing = "px-2";
|
|
91
90
|
var PlankCompanionControls = /* @__PURE__ */ forwardRef(({ primary }, forwardedRef) => {
|
|
92
91
|
const { t } = useTranslation(meta.id);
|
|
93
92
|
const { invokePromise } = useOperationInvoker();
|
|
94
93
|
const handleCloseCompanion = useCallback(() => {
|
|
95
|
-
invariant(primary, void 0, {
|
|
96
|
-
F: __dxlog_file,
|
|
97
|
-
L: 49,
|
|
98
|
-
S: void 0,
|
|
99
|
-
A: [
|
|
100
|
-
"primary",
|
|
101
|
-
""
|
|
102
|
-
]
|
|
103
|
-
});
|
|
104
94
|
return invokePromise(DeckOperation.ChangeCompanion, {
|
|
105
|
-
primary,
|
|
106
95
|
companion: null
|
|
107
96
|
});
|
|
108
97
|
}, [
|
|
109
|
-
invokePromise
|
|
110
|
-
primary
|
|
98
|
+
invokePromise
|
|
111
99
|
]);
|
|
112
100
|
return /* @__PURE__ */ React.createElement("div", {
|
|
113
101
|
ref: forwardedRef,
|
|
114
|
-
className: "contents app-no-drag"
|
|
102
|
+
className: "contents dx-app-no-drag"
|
|
115
103
|
}, /* @__PURE__ */ React.createElement(PlankControl, {
|
|
116
104
|
label: t("close companion label"),
|
|
117
105
|
variant: "ghost",
|
|
@@ -127,7 +115,7 @@ var PlankControls = /* @__PURE__ */ forwardRef(({ children, classNames, variant
|
|
|
127
115
|
return /* @__PURE__ */ React.createElement(ButtonGroup, {
|
|
128
116
|
...props,
|
|
129
117
|
classNames: [
|
|
130
|
-
"app-no-drag
|
|
118
|
+
"dx-app-no-drag opacity-100!",
|
|
131
119
|
classNames
|
|
132
120
|
],
|
|
133
121
|
ref: forwardedRef
|
|
@@ -192,7 +180,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
192
180
|
useEffect(() => {
|
|
193
181
|
const frame = requestAnimationFrame(() => {
|
|
194
182
|
if (node) {
|
|
195
|
-
void Graph.expand(graph, node.id);
|
|
183
|
+
void Graph.expand(graph, node.id, "child");
|
|
196
184
|
}
|
|
197
185
|
});
|
|
198
186
|
return () => cancelAnimationFrame(frame);
|
|
@@ -216,7 +204,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
216
204
|
isCompanionNode,
|
|
217
205
|
deckEnabled
|
|
218
206
|
]);
|
|
219
|
-
const
|
|
207
|
+
const variant = isCompanionNode ? getCompanionVariant(id) : void 0;
|
|
220
208
|
const sigilActions = useMemo(() => {
|
|
221
209
|
if (!node) {
|
|
222
210
|
return void 0;
|
|
@@ -225,11 +213,11 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
225
213
|
} else {
|
|
226
214
|
return [
|
|
227
215
|
actions,
|
|
228
|
-
Graph.getActions(graph, node.id).filter((
|
|
216
|
+
Graph.getActions(graph, node.id).filter((action) => [
|
|
229
217
|
"list-item",
|
|
230
218
|
"list-item-primary",
|
|
231
219
|
"heading-list-item"
|
|
232
|
-
].includes(
|
|
220
|
+
].includes(action.properties.disposition))
|
|
233
221
|
].filter((a) => a.length > 0);
|
|
234
222
|
}
|
|
235
223
|
}, [
|
|
@@ -257,11 +245,11 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
257
245
|
});
|
|
258
246
|
} else if (eventType === "close") {
|
|
259
247
|
if (part === "complementary") {
|
|
260
|
-
return invokeSync(
|
|
248
|
+
return invokeSync(LayoutOperation.UpdateComplementary, {
|
|
261
249
|
state: "collapsed"
|
|
262
250
|
});
|
|
263
251
|
} else {
|
|
264
|
-
return invokeSync(
|
|
252
|
+
return invokeSync(LayoutOperation.Close, {
|
|
265
253
|
subject: [
|
|
266
254
|
id
|
|
267
255
|
]
|
|
@@ -279,29 +267,27 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
279
267
|
id,
|
|
280
268
|
part
|
|
281
269
|
]);
|
|
282
|
-
const ActionRoot = node && popoverAnchorId ===
|
|
270
|
+
const ActionRoot = node && popoverAnchorId === `${meta.id}:${node.id}` ? Popover.Anchor : Fragment;
|
|
283
271
|
const handleTabClick = useCallback2((event) => {
|
|
284
272
|
const target = event.target.closest("[data-id]");
|
|
285
273
|
const tabId = target?.dataset?.id;
|
|
286
|
-
if (
|
|
274
|
+
if (tabId) {
|
|
287
275
|
void invokePromise(DeckOperation.ChangeCompanion, {
|
|
288
|
-
primary: primaryId,
|
|
289
276
|
companion: tabId
|
|
290
277
|
});
|
|
291
278
|
}
|
|
292
279
|
}, [
|
|
293
|
-
primaryId,
|
|
294
280
|
invokePromise
|
|
295
281
|
]);
|
|
296
282
|
return /* @__PURE__ */ React2.createElement(StackItem.Heading, {
|
|
297
283
|
classNames: [
|
|
298
|
-
"
|
|
299
|
-
part === "solo" ? soloInlinePadding : "
|
|
284
|
+
"py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse",
|
|
285
|
+
part === "solo" ? soloInlinePadding : "px-1",
|
|
300
286
|
...layoutMode === "solo--fullscreen" ? [
|
|
301
287
|
hoverableControls,
|
|
302
288
|
hoverableFocusedWithinControls,
|
|
303
|
-
"*:transition-opacity *:opacity-
|
|
304
|
-
"hover-hover:hover:bg-
|
|
289
|
+
"*:transition-opacity *:opacity-(--controls-opacity) bg-transparent border-transparent transition-[background-color,border-color]",
|
|
290
|
+
"hover-hover:hover:bg-header-surface focus-within:bg-header-surface hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator"
|
|
305
291
|
] : []
|
|
306
292
|
],
|
|
307
293
|
"data-plank-heading": true
|
|
@@ -309,7 +295,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
309
295
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
310
296
|
/* @__PURE__ */ React2.createElement("div", {
|
|
311
297
|
role: "none",
|
|
312
|
-
className: "flex-1 min-
|
|
298
|
+
className: "flex-1 min-w-0 overflow-x-auto scrollbar-none flex gap-1"
|
|
313
299
|
}, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
314
300
|
key: id2,
|
|
315
301
|
"data-id": id2,
|
|
@@ -326,7 +312,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
326
312
|
triggerLabel: t("actions menu label"),
|
|
327
313
|
actions: sigilActions,
|
|
328
314
|
onAction: handleAction
|
|
329
|
-
}, /* @__PURE__ */ React2.createElement(Surface, {
|
|
315
|
+
}, /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
330
316
|
role: "menu-footer",
|
|
331
317
|
data: {
|
|
332
318
|
subject: node.data
|
|
@@ -344,7 +330,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
344
330
|
...pending && {
|
|
345
331
|
classNames: "text-description"
|
|
346
332
|
}
|
|
347
|
-
}, label3))), node && part !== "complementary" && /* @__PURE__ */ React2.createElement(Surface, {
|
|
333
|
+
}, label3))), node && part !== "complementary" && /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
348
334
|
role: "navbar-end",
|
|
349
335
|
data: {
|
|
350
336
|
subject: node.data
|
|
@@ -364,45 +350,55 @@ import React3 from "react";
|
|
|
364
350
|
var PlankLoading = () => {
|
|
365
351
|
return /* @__PURE__ */ React3.createElement("div", {
|
|
366
352
|
role: "none",
|
|
367
|
-
className: "grid place-items-center attention-surface"
|
|
353
|
+
className: "grid place-items-center dx-attention-surface"
|
|
368
354
|
});
|
|
369
355
|
};
|
|
370
356
|
|
|
371
357
|
// src/components/Plank/PlankError.tsx
|
|
372
|
-
var PlankContentError = ({ error }) => {
|
|
373
|
-
const { t } = useTranslation3(meta.id);
|
|
374
|
-
const errorString = error?.toString() ?? "";
|
|
375
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
376
|
-
role: "none",
|
|
377
|
-
className: "overflow-y-auto p-8 attention-surface grid place-items-center"
|
|
378
|
-
}, /* @__PURE__ */ React4.createElement("p", {
|
|
379
|
-
role: "alert",
|
|
380
|
-
className: mx2(descriptionMessage, "break-all rounded-md p-4")
|
|
381
|
-
}, error ? errorString : t("error fallback message")));
|
|
382
|
-
};
|
|
383
358
|
var PlankError = ({ id, part, node, error }) => {
|
|
384
359
|
const [timedOut, setTimedOut] = useState(false);
|
|
385
360
|
useEffect2(() => {
|
|
386
|
-
setTimeout(() => setTimedOut(true), 5e3);
|
|
361
|
+
const timer = setTimeout(() => setTimedOut(true), 5e3);
|
|
362
|
+
return () => clearTimeout(timer);
|
|
387
363
|
}, []);
|
|
388
364
|
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(PlankHeading, {
|
|
389
365
|
id,
|
|
390
366
|
part,
|
|
391
367
|
node,
|
|
392
368
|
pending: !timedOut
|
|
393
|
-
}), timedOut ? /* @__PURE__ */ React4.createElement(
|
|
369
|
+
}), timedOut ? /* @__PURE__ */ React4.createElement(PlankErrorFallback, {
|
|
394
370
|
error
|
|
395
371
|
}) : /* @__PURE__ */ React4.createElement(PlankLoading, null));
|
|
396
372
|
};
|
|
373
|
+
var PlankErrorFallback = ({ error }) => {
|
|
374
|
+
const { t } = useTranslation3(meta.id);
|
|
375
|
+
if (process.env.NODE_ENV === "development") {
|
|
376
|
+
return /* @__PURE__ */ React4.createElement(ErrorFallback, {
|
|
377
|
+
title: "Plank Error",
|
|
378
|
+
error
|
|
379
|
+
});
|
|
380
|
+
} else {
|
|
381
|
+
const errorString = error?.toString() ?? "";
|
|
382
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
383
|
+
role: "alert",
|
|
384
|
+
"data-testid": "plank-content-error",
|
|
385
|
+
className: "dx-attention-surface overflow-y-auto p-8 grid place-items-center"
|
|
386
|
+
}, /* @__PURE__ */ React4.createElement("p", {
|
|
387
|
+
className: mx2(descriptionMessage, "break-all rounded-md p-4")
|
|
388
|
+
}, error ? errorString : t("error fallback message")));
|
|
389
|
+
}
|
|
390
|
+
};
|
|
397
391
|
|
|
398
392
|
// src/components/Plank/Plank.tsx
|
|
399
393
|
var UNKNOWN_ID = "unknown_id";
|
|
400
|
-
var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID,
|
|
394
|
+
var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionVariant, ...props }) => {
|
|
401
395
|
const { graph } = useAppGraph2();
|
|
402
396
|
const node = useNode(graph, id);
|
|
403
397
|
const companions = useCompanions(id);
|
|
404
|
-
const
|
|
405
|
-
const
|
|
398
|
+
const { companionId } = useSelectedCompanion(companions, companionVariant);
|
|
399
|
+
const resolvedCompanionId = companionVariant ? companionId : void 0;
|
|
400
|
+
const currentCompanion = companions.find(({ id: id2 }) => id2 === resolvedCompanionId);
|
|
401
|
+
const hasCompanion = !!(resolvedCompanionId && currentCompanion);
|
|
406
402
|
return /* @__PURE__ */ React5.createElement(PlankContainer, {
|
|
407
403
|
solo: props.part === "solo",
|
|
408
404
|
companion: hasCompanion,
|
|
@@ -417,7 +413,7 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) =
|
|
|
417
413
|
part: "solo-primary"
|
|
418
414
|
} : {}
|
|
419
415
|
}), hasCompanion && /* @__PURE__ */ React5.createElement(PlankComponent, {
|
|
420
|
-
id:
|
|
416
|
+
id: resolvedCompanionId,
|
|
421
417
|
node: currentCompanion,
|
|
422
418
|
primary: node,
|
|
423
419
|
companions,
|
|
@@ -438,7 +434,7 @@ var PlankContainer = ({ children, solo, companion, encapsulate }) => {
|
|
|
438
434
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
439
435
|
role: "none",
|
|
440
436
|
"data-popover-collision-boundary": true,
|
|
441
|
-
className: mx3("absolute inset-
|
|
437
|
+
className: mx3("absolute inset-(--main-spacing) grid", encapsulate && "border border-separator rounded-sm overflow-hidden", companion && "grid-cols-[6fr_4fr]", railGridHorizontal, mainIntrinsicSize),
|
|
442
438
|
...sizeAttrs
|
|
443
439
|
}, children);
|
|
444
440
|
};
|
|
@@ -454,8 +450,8 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
454
450
|
const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
|
|
455
451
|
const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
|
|
456
452
|
const rootElement = useRef(null);
|
|
457
|
-
const
|
|
458
|
-
const sizeKey =
|
|
453
|
+
const variant = node?.type === PLANK_COMPANION_TYPE ? getCompanionVariant2(id) : void 0;
|
|
454
|
+
const sizeKey = id.split("+")[0];
|
|
459
455
|
const size = deck.plankSizing[sizeKey];
|
|
460
456
|
const handleSizeChange = useCallback3(debounce((nextSize) => {
|
|
461
457
|
return invokePromise(DeckOperation.UpdatePlankSize, {
|
|
@@ -484,7 +480,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
484
480
|
behavior: "smooth",
|
|
485
481
|
inline: "center"
|
|
486
482
|
});
|
|
487
|
-
void invokePromise(
|
|
483
|
+
void invokePromise(LayoutOperation2.ScrollIntoView, {
|
|
488
484
|
subject: void 0
|
|
489
485
|
});
|
|
490
486
|
}
|
|
@@ -517,7 +513,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
517
513
|
const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
|
|
518
514
|
const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
|
|
519
515
|
const fullscreen = layoutMode === "solo--fullscreen";
|
|
520
|
-
const className = mx3("attention-surface relative dx-focus-ring-inset-over-all density-coarse", isSolo && "absolute inset-0", isSolo && mainIntrinsicSize, railGridHorizontal, part.startsWith("solo") && "grid", part.startsWith("solo-") && "grid-rows-subgrid row-span-2 min-
|
|
516
|
+
const className = mx3("dx-attention-surface relative dx-focus-ring-inset-over-all dx-density-coarse", isSolo && "absolute inset-0", isSolo && mainIntrinsicSize, railGridHorizontal, part.startsWith("solo") && "grid", part.startsWith("solo-") && "grid-rows-subgrid row-span-2 min-w-0", fullscreen && "grid-rows-1", part === "deck" && (companioned === "companion" ? "border-separator! border-e" : "border-separator! border-x"), part === "solo-companion" && "border-separator! border-s", settings?.encapsulatedPlanks && !part.startsWith("solo") && "mx-(--main-spacing) border-separator! border rounded-sm overflow-hidden");
|
|
521
517
|
return /* @__PURE__ */ React5.createElement(Root, {
|
|
522
518
|
ref: rootElement,
|
|
523
519
|
"data-testid": "deck.plank",
|
|
@@ -550,12 +546,12 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
550
546
|
primaryId: primary?.id,
|
|
551
547
|
companioned,
|
|
552
548
|
companions
|
|
553
|
-
}), /* @__PURE__ */ React5.createElement(Surface2, {
|
|
549
|
+
}), /* @__PURE__ */ React5.createElement(Surface2.Surface, {
|
|
554
550
|
key: node.id,
|
|
555
551
|
role: "article",
|
|
556
552
|
data,
|
|
557
553
|
limit: 1,
|
|
558
|
-
fallback:
|
|
554
|
+
fallback: PlankErrorFallback,
|
|
559
555
|
placeholder
|
|
560
556
|
})) : /* @__PURE__ */ React5.createElement(PlankError, {
|
|
561
557
|
id,
|
|
@@ -565,16 +561,16 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
565
561
|
|
|
566
562
|
// src/components/Sidebar/SidebarButton.tsx
|
|
567
563
|
import React6, { useCallback as useCallback4 } from "react";
|
|
568
|
-
import {
|
|
569
|
-
import {
|
|
564
|
+
import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
|
|
565
|
+
import { LayoutOperation as LayoutOperation3, getCompanionVariant as getCompanionVariant3 } from "@dxos/app-toolkit";
|
|
570
566
|
import { IconButton as IconButton3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
571
567
|
var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
|
|
572
|
-
const {
|
|
568
|
+
const { updateState } = useDeckState();
|
|
573
569
|
const { t } = useTranslation4(meta.id);
|
|
574
570
|
const handleClick = useCallback4(() => {
|
|
575
|
-
updateState((
|
|
576
|
-
...
|
|
577
|
-
sidebarState:
|
|
571
|
+
updateState((state) => ({
|
|
572
|
+
...state,
|
|
573
|
+
sidebarState: state.sidebarState === "expanded" ? "collapsed" : "expanded"
|
|
578
574
|
}));
|
|
579
575
|
}, [
|
|
580
576
|
updateState
|
|
@@ -593,8 +589,8 @@ var CloseSidebarButton = () => {
|
|
|
593
589
|
const { updateState } = useDeckState();
|
|
594
590
|
const { t } = useTranslation4(meta.id);
|
|
595
591
|
const handleClick = useCallback4(() => {
|
|
596
|
-
updateState((
|
|
597
|
-
...
|
|
592
|
+
updateState((state) => ({
|
|
593
|
+
...state,
|
|
598
594
|
sidebarState: "collapsed"
|
|
599
595
|
}));
|
|
600
596
|
}, [
|
|
@@ -607,7 +603,7 @@ var CloseSidebarButton = () => {
|
|
|
607
603
|
size: 4,
|
|
608
604
|
label: t("close navigation sidebar label"),
|
|
609
605
|
onClick: handleClick,
|
|
610
|
-
classNames: "rounded-none
|
|
606
|
+
classNames: "rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]"
|
|
611
607
|
});
|
|
612
608
|
};
|
|
613
609
|
var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
@@ -617,13 +613,13 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
617
613
|
const companions = useDeckCompanions();
|
|
618
614
|
const handleClick = useCallback4(() => {
|
|
619
615
|
const nextState = state.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
|
|
620
|
-
updateState((
|
|
621
|
-
...
|
|
616
|
+
updateState((state2) => ({
|
|
617
|
+
...state2,
|
|
622
618
|
complementarySidebarState: nextState
|
|
623
619
|
}));
|
|
624
|
-
const subject = state.complementarySidebarPanel ?? (companions[0] &&
|
|
620
|
+
const subject = state.complementarySidebarPanel ?? (companions[0] && getCompanionVariant3(companions[0].id));
|
|
625
621
|
if (nextState === "expanded" && !current && subject) {
|
|
626
|
-
invokeSync(
|
|
622
|
+
invokeSync(LayoutOperation3.UpdateComplementary, {
|
|
627
623
|
subject
|
|
628
624
|
});
|
|
629
625
|
}
|
|
@@ -665,8 +661,8 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
665
661
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
666
662
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
667
663
|
const companions = useDeckCompanions();
|
|
668
|
-
const activeCompanion = companions.find((companion) =>
|
|
669
|
-
const activeId = activeCompanion &&
|
|
664
|
+
const activeCompanion = companions.find((companion) => getCompanionVariant4(companion.id) === current);
|
|
665
|
+
const activeId = activeCompanion && getCompanionVariant4(activeCompanion.id);
|
|
670
666
|
const [internalValue, setInternalValue] = useState2(activeId);
|
|
671
667
|
useEffect3(() => {
|
|
672
668
|
setInternalValue(activeId);
|
|
@@ -676,17 +672,17 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
676
672
|
const handleTabClick = useCallback5((event) => {
|
|
677
673
|
const nextValue = event.currentTarget.getAttribute("data-value");
|
|
678
674
|
if (nextValue === activeId) {
|
|
679
|
-
updateState((
|
|
680
|
-
...
|
|
681
|
-
complementarySidebarState:
|
|
675
|
+
updateState((state2) => ({
|
|
676
|
+
...state2,
|
|
677
|
+
complementarySidebarState: state2.complementarySidebarState === "expanded" ? "collapsed" : "expanded"
|
|
682
678
|
}));
|
|
683
679
|
} else {
|
|
684
680
|
setInternalValue(nextValue);
|
|
685
|
-
updateState((
|
|
686
|
-
...
|
|
681
|
+
updateState((state2) => ({
|
|
682
|
+
...state2,
|
|
687
683
|
complementarySidebarState: "expanded"
|
|
688
684
|
}));
|
|
689
|
-
invokeSync(
|
|
685
|
+
invokeSync(LayoutOperation4.UpdateComplementary, {
|
|
690
686
|
subject: nextValue
|
|
691
687
|
});
|
|
692
688
|
}
|
|
@@ -705,7 +701,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
705
701
|
]);
|
|
706
702
|
useEffect3(() => {
|
|
707
703
|
if (!activeId) {
|
|
708
|
-
invokeSync(
|
|
704
|
+
invokeSync(LayoutOperation4.UpdateComplementary, {
|
|
709
705
|
state: "collapsed"
|
|
710
706
|
});
|
|
711
707
|
}
|
|
@@ -716,8 +712,8 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
716
712
|
return /* @__PURE__ */ React7.createElement(Main.ComplementarySidebar, {
|
|
717
713
|
label,
|
|
718
714
|
classNames: [
|
|
719
|
-
topbar && "
|
|
720
|
-
hoistStatusbar && "
|
|
715
|
+
topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
|
|
716
|
+
hoistStatusbar && "bottom-(--dx-statusbar-size)"
|
|
721
717
|
]
|
|
722
718
|
}, /* @__PURE__ */ React7.createElement(Tabs.Root, {
|
|
723
719
|
orientation: "vertical",
|
|
@@ -726,37 +722,37 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
726
722
|
classNames: "contents"
|
|
727
723
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
728
724
|
role: "none",
|
|
729
|
-
className: mx4("absolute z-[1] inset-
|
|
725
|
+
className: mx4("absolute z-[1] inset-y-0 end-0 !w-(--dx-r0-size)", "py-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] border-s border-subdued-separator", "grid grid-cols-1 grid-rows-[1fr_min-content] bg-toolbar-surface dx-contain-layout dx-app-drag")
|
|
730
726
|
}, /* @__PURE__ */ React7.createElement(Tabs.Tablist, {
|
|
731
|
-
classNames: "grid grid-cols-1 auto-rows-
|
|
727
|
+
classNames: "grid grid-cols-1 auto-rows-(--dx-rail-action) p-1 gap-1 overflow-y-auto!"
|
|
732
728
|
}, companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tab, {
|
|
733
|
-
key:
|
|
734
|
-
value:
|
|
729
|
+
key: getCompanionVariant4(companion.id),
|
|
730
|
+
value: getCompanionVariant4(companion.id),
|
|
735
731
|
asChild: true
|
|
736
732
|
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
737
733
|
label: toLocalizedString2(companion.properties.label, t),
|
|
738
734
|
icon: companion.properties.icon,
|
|
739
735
|
iconOnly: true,
|
|
740
736
|
tooltipSide: "left",
|
|
741
|
-
"data-value":
|
|
742
|
-
variant: activeId ===
|
|
737
|
+
"data-value": getCompanionVariant4(companion.id),
|
|
738
|
+
variant: activeId === getCompanionVariant4(companion.id) ? state.complementarySidebarState === "expanded" ? "primary" : "default" : "ghost",
|
|
743
739
|
onClick: handleTabClick
|
|
744
740
|
})))), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
|
|
745
741
|
role: "none",
|
|
746
|
-
className: "grid grid-cols-1 auto-rows-
|
|
747
|
-
}, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
742
|
+
className: "grid grid-cols-1 auto-rows-(--dx-rail-item) p-1 overflow-y-auto"
|
|
743
|
+
}, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
|
|
748
744
|
role: "status-bar--r0-footer",
|
|
749
745
|
limit: 1
|
|
750
746
|
})), /* @__PURE__ */ React7.createElement("div", {
|
|
751
747
|
role: "none",
|
|
752
|
-
className: "hidden lg:grid grid-cols-1 auto-rows-
|
|
748
|
+
className: "hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1"
|
|
753
749
|
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
754
|
-
key:
|
|
755
|
-
value:
|
|
750
|
+
key: getCompanionVariant4(companion.id),
|
|
751
|
+
value: getCompanionVariant4(companion.id),
|
|
756
752
|
classNames: [
|
|
757
753
|
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
758
|
-
"inset-
|
|
759
|
-
"grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content]
|
|
754
|
+
"inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)",
|
|
755
|
+
"grid grid-cols-1 grid-rows-[var(--dx-rail-size)_1fr_min-content] py-[env(safe-area-inset-top)]"
|
|
760
756
|
],
|
|
761
757
|
...state.complementarySidebarState !== "expanded" && {
|
|
762
758
|
inert: true
|
|
@@ -770,46 +766,48 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
770
766
|
};
|
|
771
767
|
var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
|
|
772
768
|
const { t } = useTranslation5(meta.id);
|
|
773
|
-
if (
|
|
769
|
+
if (getCompanionVariant4(companion.id) !== activeId && !data) {
|
|
774
770
|
return null;
|
|
775
771
|
}
|
|
776
|
-
const Wrapper = companion.properties.fixed ? Fragment2 :
|
|
772
|
+
const Wrapper = companion.properties.fixed ? Fragment2 : ScrollAreaWrapper;
|
|
777
773
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("div", {
|
|
778
774
|
role: "none",
|
|
779
|
-
className: "flex items-center p-1 gap-1 border-
|
|
775
|
+
className: "flex items-center p-1 gap-1 border-b border-subdued-separator"
|
|
780
776
|
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
781
777
|
label: toLocalizedString2(companion.properties.label, t),
|
|
782
778
|
icon: companion.properties.icon,
|
|
783
779
|
iconOnly: true,
|
|
784
780
|
tooltipSide: "left",
|
|
785
|
-
"data-value":
|
|
786
|
-
classNames: "
|
|
781
|
+
"data-value": getCompanionVariant4(companion.id),
|
|
782
|
+
classNames: "h-10 w-10",
|
|
787
783
|
variant: "default"
|
|
788
784
|
}), /* @__PURE__ */ React7.createElement("div", {
|
|
789
785
|
role: "none",
|
|
790
|
-
className: "
|
|
791
|
-
}, toLocalizedString2(companion.properties.label, t))), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
792
|
-
role: `deck-companion--${
|
|
786
|
+
className: "px-1"
|
|
787
|
+
}, toLocalizedString2(companion.properties.label, t))), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
|
|
788
|
+
role: `deck-companion--${getCompanionVariant4(companion.id)}`,
|
|
793
789
|
data,
|
|
794
|
-
fallback:
|
|
790
|
+
fallback: PlankErrorFallback,
|
|
795
791
|
placeholder: /* @__PURE__ */ React7.createElement(PlankLoading, null)
|
|
796
792
|
})), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
|
|
797
793
|
role: "contentinfo",
|
|
798
|
-
className: "flex flex-wrap justify-center items-center border-
|
|
799
|
-
}, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
794
|
+
className: "flex flex-wrap justify-center items-center border-y border-subdued-separator pt-1 pb-[max(env(safe-area-inset-bottom),0.25rem)]"
|
|
795
|
+
}, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
|
|
800
796
|
role: "status-bar--r1-footer",
|
|
801
797
|
limit: 1
|
|
802
798
|
})));
|
|
803
799
|
};
|
|
804
|
-
var
|
|
805
|
-
return /* @__PURE__ */ React7.createElement(
|
|
806
|
-
|
|
807
|
-
|
|
800
|
+
var ScrollAreaWrapper = ({ children }) => {
|
|
801
|
+
return /* @__PURE__ */ React7.createElement(ScrollArea.Root, {
|
|
802
|
+
thin: true,
|
|
803
|
+
orientation: "vertical",
|
|
804
|
+
classNames: "grow"
|
|
805
|
+
}, /* @__PURE__ */ React7.createElement(ScrollArea.Viewport, null, children));
|
|
808
806
|
};
|
|
809
807
|
|
|
810
808
|
// src/components/Sidebar/Sidebar.tsx
|
|
811
809
|
import React8, { useMemo as useMemo4 } from "react";
|
|
812
|
-
import { Surface as Surface4 } from "@dxos/app-framework/
|
|
810
|
+
import { Surface as Surface4 } from "@dxos/app-framework/ui";
|
|
813
811
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
814
812
|
var label2 = [
|
|
815
813
|
"sidebar title",
|
|
@@ -839,10 +837,10 @@ var Sidebar = () => {
|
|
|
839
837
|
label: label2,
|
|
840
838
|
classNames: [
|
|
841
839
|
"grid",
|
|
842
|
-
topbar && "
|
|
843
|
-
hoistStatusbar && "
|
|
840
|
+
topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
|
|
841
|
+
hoistStatusbar && "bottom-(--dx-statusbar-size)"
|
|
844
842
|
]
|
|
845
|
-
}, /* @__PURE__ */ React8.createElement(Surface4, {
|
|
843
|
+
}, /* @__PURE__ */ React8.createElement(Surface4.Surface, {
|
|
846
844
|
role: "navigation",
|
|
847
845
|
data: navigationData,
|
|
848
846
|
limit: 1
|
|
@@ -853,9 +851,9 @@ var Sidebar = () => {
|
|
|
853
851
|
var Banner = ({ variant, classNames }) => {
|
|
854
852
|
const { t } = useTranslation6(meta.id);
|
|
855
853
|
return /* @__PURE__ */ React9.createElement("header", {
|
|
856
|
-
className: mx5("flex items-stretch relative
|
|
854
|
+
className: mx5("flex items-stretch relative py-1 ps-1 pe-2", variant === "topbar" && "fixed inset-x-0 top-[env(safe-area-inset-top)] h-(--dx-rail-size) border-b border-separator", classNames)
|
|
857
855
|
}, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
|
|
858
|
-
className: "self-center grow
|
|
856
|
+
className: "self-center grow ms-1"
|
|
859
857
|
}, t("current app name", {
|
|
860
858
|
ns: osTranslations
|
|
861
859
|
})), variant === "topbar" && /* @__PURE__ */ React9.createElement("div", {
|
|
@@ -863,17 +861,17 @@ var Banner = ({ variant, classNames }) => {
|
|
|
863
861
|
className: "absolute inset-0 pointer-events-none"
|
|
864
862
|
}, /* @__PURE__ */ React9.createElement("div", {
|
|
865
863
|
role: "none",
|
|
866
|
-
className: "grid
|
|
867
|
-
}, /* @__PURE__ */ React9.createElement(Surface5, {
|
|
864
|
+
className: "grid h-full pointer-fine:p-1 max-w-md mx-auto pointer-events-auto"
|
|
865
|
+
}, /* @__PURE__ */ React9.createElement(Surface5.Surface, {
|
|
868
866
|
role: "search-input",
|
|
869
867
|
limit: 1
|
|
870
868
|
}))), /* @__PURE__ */ React9.createElement("span", {
|
|
871
869
|
role: "none",
|
|
872
870
|
className: "grow"
|
|
873
|
-
}), /* @__PURE__ */ React9.createElement(Surface5, {
|
|
871
|
+
}), /* @__PURE__ */ React9.createElement(Surface5.Surface, {
|
|
874
872
|
role: "header-end",
|
|
875
873
|
limit: 1
|
|
876
|
-
}), /* @__PURE__ */ React9.createElement(Surface5, {
|
|
874
|
+
}), /* @__PURE__ */ React9.createElement(Surface5.Surface, {
|
|
877
875
|
role: "notch-start",
|
|
878
876
|
limit: 1
|
|
879
877
|
}));
|
|
@@ -885,7 +883,8 @@ import { Mosaic } from "@dxos/react-ui-mosaic";
|
|
|
885
883
|
|
|
886
884
|
// src/components/DeckLayout/ActiveNode.tsx
|
|
887
885
|
import React10 from "react";
|
|
888
|
-
import { Surface as Surface6
|
|
886
|
+
import { Surface as Surface6 } from "@dxos/app-framework/ui";
|
|
887
|
+
import { useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
|
|
889
888
|
import { useNode as useNode2 } from "@dxos/plugin-graph";
|
|
890
889
|
import { useAttended } from "@dxos/react-ui-attention";
|
|
891
890
|
var ActiveNode = () => {
|
|
@@ -896,7 +895,7 @@ var ActiveNode = () => {
|
|
|
896
895
|
return /* @__PURE__ */ React10.createElement("div", {
|
|
897
896
|
role: "none",
|
|
898
897
|
className: "sr-only"
|
|
899
|
-
}, /* @__PURE__ */ React10.createElement(Surface6, {
|
|
898
|
+
}, /* @__PURE__ */ React10.createElement(Surface6.Surface, {
|
|
900
899
|
role: "document-title",
|
|
901
900
|
data: {
|
|
902
901
|
subject: activeNode
|
|
@@ -907,8 +906,8 @@ var ActiveNode = () => {
|
|
|
907
906
|
|
|
908
907
|
// src/components/DeckLayout/DeckMain.tsx
|
|
909
908
|
import React14, { Fragment as Fragment3, useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2 } from "react";
|
|
910
|
-
import {
|
|
911
|
-
import {
|
|
909
|
+
import { useAtomCapability, useOperationInvoker as useOperationInvoker6, usePluginManager } from "@dxos/app-framework/ui";
|
|
910
|
+
import { LayoutOperation as LayoutOperation5 } from "@dxos/app-toolkit";
|
|
912
911
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
913
912
|
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
914
913
|
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
|
|
@@ -916,7 +915,7 @@ import { mainPaddingTransitions, mx as mx6 } from "@dxos/ui-theme";
|
|
|
916
915
|
|
|
917
916
|
// src/components/DeckLayout/ContentEmpty.tsx
|
|
918
917
|
import React11 from "react";
|
|
919
|
-
import { Surface as Surface7 } from "@dxos/app-framework/
|
|
918
|
+
import { Surface as Surface7 } from "@dxos/app-framework/ui";
|
|
920
919
|
var ContentEmpty = () => {
|
|
921
920
|
const breakpoint = useBreakpoints();
|
|
922
921
|
const { deck } = useDeckState();
|
|
@@ -924,9 +923,9 @@ var ContentEmpty = () => {
|
|
|
924
923
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
925
924
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
926
925
|
role: "none",
|
|
927
|
-
className: "grid place-items-center p-8 relative bg-
|
|
926
|
+
className: "grid place-items-center p-8 relative bg-deck-surface",
|
|
928
927
|
"data-testid": "layoutPlugin.firstRunMessage"
|
|
929
|
-
}, /* @__PURE__ */ React11.createElement(Surface7, {
|
|
928
|
+
}, /* @__PURE__ */ React11.createElement(Surface7.Surface, {
|
|
930
929
|
role: "keyshortcuts"
|
|
931
930
|
}), !topbar && /* @__PURE__ */ React11.createElement(ToggleSidebarButton, {
|
|
932
931
|
variant: "default",
|
|
@@ -936,18 +935,18 @@ var ContentEmpty = () => {
|
|
|
936
935
|
|
|
937
936
|
// src/components/DeckLayout/StatusBar.tsx
|
|
938
937
|
import React12 from "react";
|
|
939
|
-
import { Surface as Surface8 } from "@dxos/app-framework/
|
|
938
|
+
import { Surface as Surface8 } from "@dxos/app-framework/ui";
|
|
940
939
|
import { useLandmarkMover } from "@dxos/react-ui";
|
|
941
940
|
var StatusBar = ({ showHints }) => {
|
|
942
941
|
const mover = useLandmarkMover(void 0, "3");
|
|
943
942
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
944
943
|
role: "contentinfo",
|
|
945
|
-
className: "fixed
|
|
944
|
+
className: "fixed bottom-0 inset-x-0 h-(--dx-statusbar-size) border-y border-separator z-[2] flex text-description",
|
|
946
945
|
...mover
|
|
947
|
-
}, showHints && /* @__PURE__ */ React12.createElement(Surface8, {
|
|
946
|
+
}, showHints && /* @__PURE__ */ React12.createElement(Surface8.Surface, {
|
|
948
947
|
role: "hints",
|
|
949
948
|
limit: 1
|
|
950
|
-
}), /* @__PURE__ */ React12.createElement(Surface8, {
|
|
949
|
+
}), /* @__PURE__ */ React12.createElement(Surface8.Surface, {
|
|
951
950
|
role: "status-bar",
|
|
952
951
|
limit: 1
|
|
953
952
|
}));
|
|
@@ -967,7 +966,8 @@ var DeckMain = () => {
|
|
|
967
966
|
const settings = useAtomCapability(DeckCapabilities.Settings);
|
|
968
967
|
const { state, deck, updateState } = useDeckState();
|
|
969
968
|
const { sidebarState, complementarySidebarState, complementarySidebarPanel } = state;
|
|
970
|
-
const { active,
|
|
969
|
+
const { active, companionOpen, companionVariant, fullscreen, solo, plankSizing } = deck;
|
|
970
|
+
const effectiveCompanionVariant = companionOpen ? companionVariant : void 0;
|
|
971
971
|
const layoutMode = getMode(deck);
|
|
972
972
|
const breakpoint = useBreakpoints();
|
|
973
973
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
@@ -990,12 +990,12 @@ var DeckMain = () => {
|
|
|
990
990
|
const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
|
|
991
991
|
const attended = attention.getCurrent();
|
|
992
992
|
shouldRevert.current = true;
|
|
993
|
-
invokeSync(
|
|
993
|
+
invokeSync(LayoutOperation5.SetLayoutMode, {
|
|
994
994
|
subject: attended[0],
|
|
995
995
|
mode: "solo"
|
|
996
996
|
});
|
|
997
997
|
} else if (isNotMobile && layoutMode === "solo" && shouldRevert.current) {
|
|
998
|
-
invokeSync(
|
|
998
|
+
invokeSync(LayoutOperation5.SetLayoutMode, {
|
|
999
999
|
revert: true
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
@@ -1006,7 +1006,7 @@ var DeckMain = () => {
|
|
|
1006
1006
|
]);
|
|
1007
1007
|
useEffect4(() => {
|
|
1008
1008
|
if (!settings?.enableDeck && layoutMode === "deck") {
|
|
1009
|
-
invokeSync(
|
|
1009
|
+
invokeSync(LayoutOperation5.SetLayoutMode, {
|
|
1010
1010
|
subject: active[0],
|
|
1011
1011
|
mode: "solo"
|
|
1012
1012
|
});
|
|
@@ -1051,9 +1051,9 @@ var DeckMain = () => {
|
|
|
1051
1051
|
deck
|
|
1052
1052
|
]);
|
|
1053
1053
|
const mainPosition = useMemo5(() => [
|
|
1054
|
-
"grid !
|
|
1055
|
-
topbar && "!
|
|
1056
|
-
hoistStatusbar && "lg:
|
|
1054
|
+
"grid !top-[env(safe-area-inset-top)]",
|
|
1055
|
+
topbar && "!top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
|
|
1056
|
+
hoistStatusbar && "lg:bottom-(--dx-statusbar-size)"
|
|
1057
1057
|
], [
|
|
1058
1058
|
topbar,
|
|
1059
1059
|
hoistStatusbar
|
|
@@ -1061,7 +1061,7 @@ var DeckMain = () => {
|
|
|
1061
1061
|
const { order, itemsCount } = useMemo5(() => {
|
|
1062
1062
|
return active.reduce((acc, entryId) => {
|
|
1063
1063
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1064
|
-
acc.itemsCount +=
|
|
1064
|
+
acc.itemsCount += companionOpen ? 3 : 2;
|
|
1065
1065
|
return acc;
|
|
1066
1066
|
}, {
|
|
1067
1067
|
order: {},
|
|
@@ -1069,7 +1069,7 @@ var DeckMain = () => {
|
|
|
1069
1069
|
});
|
|
1070
1070
|
}, [
|
|
1071
1071
|
active,
|
|
1072
|
-
|
|
1072
|
+
companionOpen
|
|
1073
1073
|
]);
|
|
1074
1074
|
const handleNavigationSidebarStateChange = useCallback6((next) => {
|
|
1075
1075
|
updateState((s) => ({
|
|
@@ -1104,14 +1104,14 @@ var DeckMain = () => {
|
|
|
1104
1104
|
classNames: mainPosition,
|
|
1105
1105
|
style: {
|
|
1106
1106
|
"--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
|
|
1107
|
-
"--dx-main-
|
|
1108
|
-
"--dx-main-
|
|
1109
|
-
"--dx-main-
|
|
1110
|
-
"--dx-main-
|
|
1107
|
+
"--dx-main-sidebar-width": sidebarState === "expanded" ? "var(--dx-nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--dx-l0-size)" : "0",
|
|
1108
|
+
"--dx-main-complementary-width": complementarySidebarState === "expanded" ? "var(--dx-complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--dx-rail-size)" : "0",
|
|
1109
|
+
"--dx-main-content-first-width": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
1110
|
+
"--dx-main-content-last-width": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
|
|
1111
1111
|
}
|
|
1112
1112
|
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1113
1113
|
role: "none",
|
|
1114
|
-
className: !solo ? "relative bg-
|
|
1114
|
+
className: !solo ? "relative bg-deck-surface overflow-hidden" : "sr-only",
|
|
1115
1115
|
...solo && {
|
|
1116
1116
|
inert: true
|
|
1117
1117
|
}
|
|
@@ -1125,7 +1125,7 @@ var DeckMain = () => {
|
|
|
1125
1125
|
size: "contain",
|
|
1126
1126
|
itemsCount: itemsCount - 1,
|
|
1127
1127
|
classNames: [
|
|
1128
|
-
"absolute inset-
|
|
1128
|
+
"absolute inset-y-(--main-spacing) -inset-w-px h-[calc(100%-2*var(--main-spacing))]",
|
|
1129
1129
|
mainPaddingTransitions
|
|
1130
1130
|
],
|
|
1131
1131
|
style: padding,
|
|
@@ -1137,7 +1137,7 @@ var DeckMain = () => {
|
|
|
1137
1137
|
encapsulate: !!settings?.enableDeck
|
|
1138
1138
|
}), /* @__PURE__ */ React14.createElement(Plank, {
|
|
1139
1139
|
id: entryId,
|
|
1140
|
-
|
|
1140
|
+
companionVariant: effectiveCompanionVariant,
|
|
1141
1141
|
part: "deck",
|
|
1142
1142
|
order: order[entryId],
|
|
1143
1143
|
active,
|
|
@@ -1145,7 +1145,7 @@ var DeckMain = () => {
|
|
|
1145
1145
|
settings
|
|
1146
1146
|
}))))), /* @__PURE__ */ React14.createElement("div", {
|
|
1147
1147
|
role: "none",
|
|
1148
|
-
className: solo ? "relative overflow-hidden bg-
|
|
1148
|
+
className: solo ? "relative overflow-hidden bg-deck-surface" : "sr-only",
|
|
1149
1149
|
...!solo && {
|
|
1150
1150
|
inert: true
|
|
1151
1151
|
}
|
|
@@ -1161,7 +1161,7 @@ var DeckMain = () => {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
}, /* @__PURE__ */ React14.createElement(Plank, {
|
|
1163
1163
|
id: solo,
|
|
1164
|
-
|
|
1164
|
+
companionVariant: effectiveCompanionVariant,
|
|
1165
1165
|
part: "solo",
|
|
1166
1166
|
layoutMode,
|
|
1167
1167
|
settings
|
|
@@ -1171,7 +1171,7 @@ var DeckMain = () => {
|
|
|
1171
1171
|
};
|
|
1172
1172
|
var PlankSeparator = ({ order, encapsulate }) => order > 0 ? /* @__PURE__ */ React14.createElement("span", {
|
|
1173
1173
|
role: "separator",
|
|
1174
|
-
className: mx6("row-span-2 bg-
|
|
1174
|
+
className: mx6("row-span-2 bg-deck-surface", encapsulate ? "w-0" : "w-4"),
|
|
1175
1175
|
style: {
|
|
1176
1176
|
gridColumn: order
|
|
1177
1177
|
}
|
|
@@ -1179,7 +1179,7 @@ var PlankSeparator = ({ order, encapsulate }) => order > 0 ? /* @__PURE__ */ Rea
|
|
|
1179
1179
|
|
|
1180
1180
|
// src/components/DeckLayout/Dialog.tsx
|
|
1181
1181
|
import React15, { useCallback as useCallback7 } from "react";
|
|
1182
|
-
import { Surface as Surface9 } from "@dxos/app-framework/
|
|
1182
|
+
import { Surface as Surface9 } from "@dxos/app-framework/ui";
|
|
1183
1183
|
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
1184
1184
|
var Dialog = () => {
|
|
1185
1185
|
const { state, updateEphemeral } = useDeckState();
|
|
@@ -1200,31 +1200,33 @@ var Dialog = () => {
|
|
|
1200
1200
|
onOpenChange: handleOpenChange
|
|
1201
1201
|
}, dialogBlockAlign === "end" ? (
|
|
1202
1202
|
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1203
|
-
/* @__PURE__ */ React15.createElement(Surface9, {
|
|
1203
|
+
/* @__PURE__ */ React15.createElement(Surface9.Surface, {
|
|
1204
1204
|
role: "dialog",
|
|
1205
1205
|
data: dialogContent,
|
|
1206
1206
|
limit: 1,
|
|
1207
|
-
fallback:
|
|
1207
|
+
fallback: PlankErrorFallback,
|
|
1208
1208
|
placeholder: /* @__PURE__ */ React15.createElement("div", null)
|
|
1209
1209
|
})
|
|
1210
1210
|
) : /* @__PURE__ */ React15.createElement(Overlay, {
|
|
1211
1211
|
blockAlign: dialogBlockAlign,
|
|
1212
1212
|
classNames: dialogOverlayClasses,
|
|
1213
1213
|
style: dialogOverlayStyle
|
|
1214
|
-
}, /* @__PURE__ */ React15.createElement(Surface9, {
|
|
1214
|
+
}, /* @__PURE__ */ React15.createElement(Surface9.Surface, {
|
|
1215
1215
|
role: "dialog",
|
|
1216
1216
|
data: dialogContent,
|
|
1217
1217
|
limit: 1,
|
|
1218
|
-
fallback:
|
|
1218
|
+
fallback: PlankErrorFallback
|
|
1219
1219
|
})));
|
|
1220
1220
|
};
|
|
1221
1221
|
|
|
1222
1222
|
// src/components/DeckLayout/Popover.tsx
|
|
1223
1223
|
import { createContext } from "@radix-ui/react-context";
|
|
1224
1224
|
import React16, { useCallback as useCallback8, useEffect as useEffect5, useRef as useRef3, useState as useState3 } from "react";
|
|
1225
|
-
import { Surface as Surface10 } from "@dxos/app-framework/
|
|
1225
|
+
import { Surface as Surface10, useOperationInvoker as useOperationInvoker7 } from "@dxos/app-framework/ui";
|
|
1226
|
+
import { LayoutOperation as LayoutOperation6 } from "@dxos/app-toolkit";
|
|
1227
|
+
import { useObjectNavigate } from "@dxos/app-toolkit/ui";
|
|
1226
1228
|
import { Popover as Popover2, toLocalizedString as toLocalizedString3, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1227
|
-
import { Card } from "@dxos/react-ui
|
|
1229
|
+
import { Card } from "@dxos/react-ui";
|
|
1228
1230
|
var DEBOUNCE_DELAY = 40;
|
|
1229
1231
|
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
1230
1232
|
var PopoverRoot = ({ children }) => {
|
|
@@ -1261,10 +1263,13 @@ var PopoverRoot = ({ children }) => {
|
|
|
1261
1263
|
virtualRef
|
|
1262
1264
|
}), children));
|
|
1263
1265
|
};
|
|
1266
|
+
var getPopoverSubject = (content) => content && typeof content === "object" && "subject" in content ? content.subject : content;
|
|
1264
1267
|
var PopoverContent = () => {
|
|
1265
1268
|
const { t } = useTranslation7(meta.id);
|
|
1266
1269
|
const { state, updateEphemeral } = useDeckState();
|
|
1267
1270
|
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
1271
|
+
const { invokeSync } = useOperationInvoker7();
|
|
1272
|
+
const handleNavigate = useObjectNavigate(getPopoverSubject(state.popoverContent));
|
|
1268
1273
|
const handleClose = useCallback8(() => {
|
|
1269
1274
|
setOpen(false);
|
|
1270
1275
|
updateEphemeral((state2) => ({
|
|
@@ -1295,17 +1300,33 @@ var PopoverContent = () => {
|
|
|
1295
1300
|
hideWhenDetached: true,
|
|
1296
1301
|
onInteractOutside: handleInteractOutside,
|
|
1297
1302
|
onEscapeKeyDown: handleInteractOutside
|
|
1298
|
-
}, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, state.popoverKind === "
|
|
1299
|
-
|
|
1300
|
-
})), /* @__PURE__ */ React16.createElement(Surface10, {
|
|
1301
|
-
role: "card--content",
|
|
1303
|
+
}, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, state.popoverKind === "base" && /* @__PURE__ */ React16.createElement(Surface10.Surface, {
|
|
1304
|
+
role: "popover",
|
|
1302
1305
|
data: state.popoverContent,
|
|
1303
1306
|
limit: 1
|
|
1304
|
-
})
|
|
1305
|
-
|
|
1307
|
+
}), state.popoverKind === "card" && /* @__PURE__ */ React16.createElement(Card.Root, {
|
|
1308
|
+
border: false,
|
|
1309
|
+
classNames: "dx-card-popover"
|
|
1310
|
+
}, /* @__PURE__ */ React16.createElement(Card.Toolbar, null, state.popoverContentRef ? /* @__PURE__ */ React16.createElement(Card.ToolbarIconButton, {
|
|
1311
|
+
icon: "ph--arrow-square-out--regular",
|
|
1312
|
+
iconOnly: true,
|
|
1313
|
+
label: t("open item label"),
|
|
1314
|
+
onClick: () => {
|
|
1315
|
+
invokeSync(LayoutOperation6.Open, {
|
|
1316
|
+
subject: [
|
|
1317
|
+
state.popoverContentRef
|
|
1318
|
+
]
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
}) : /* @__PURE__ */ React16.createElement("div", null), state.popoverTitle ? /* @__PURE__ */ React16.createElement(Card.Title, {
|
|
1322
|
+
onClick: handleNavigate
|
|
1323
|
+
}, toLocalizedString3(state.popoverTitle, t)) : /* @__PURE__ */ React16.createElement("span", null), /* @__PURE__ */ React16.createElement(Card.CloseIconButton, {
|
|
1324
|
+
onClick: handleClose
|
|
1325
|
+
})), /* @__PURE__ */ React16.createElement(Surface10.Surface, {
|
|
1326
|
+
role: "card--content",
|
|
1306
1327
|
data: state.popoverContent,
|
|
1307
1328
|
limit: 1
|
|
1308
|
-
})), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
|
|
1329
|
+
}))), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
|
|
1309
1330
|
};
|
|
1310
1331
|
|
|
1311
1332
|
// src/components/DeckLayout/Toast.tsx
|
|
@@ -1359,91 +1380,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1359
1380
|
})));
|
|
1360
1381
|
};
|
|
1361
1382
|
|
|
1362
|
-
// src/components/DeckSettings/DeckSettings.tsx
|
|
1363
|
-
import React19 from "react";
|
|
1364
|
-
import { Input, Select, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
1365
|
-
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
1366
|
-
var isSocket = !!globalThis.__args;
|
|
1367
|
-
var DeckSettings = ({ settings, onSettingsChange }) => {
|
|
1368
|
-
const { t } = useTranslation9(meta.id);
|
|
1369
|
-
return /* @__PURE__ */ React19.createElement(ControlPage, null, /* @__PURE__ */ React19.createElement(ControlSection, {
|
|
1370
|
-
title: t("settings title", {
|
|
1371
|
-
ns: meta.id
|
|
1372
|
-
})
|
|
1373
|
-
}, /* @__PURE__ */ React19.createElement(ControlGroup, null, /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1374
|
-
title: t("settings enable deck label")
|
|
1375
|
-
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1376
|
-
checked: settings.enableDeck,
|
|
1377
|
-
onCheckedChange: (checked) => onSettingsChange((s) => ({
|
|
1378
|
-
...s,
|
|
1379
|
-
enableDeck: checked
|
|
1380
|
-
}))
|
|
1381
|
-
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1382
|
-
title: t("settings encapsulated planks label")
|
|
1383
|
-
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1384
|
-
checked: settings.encapsulatedPlanks ?? false,
|
|
1385
|
-
onCheckedChange: (checked) => onSettingsChange((s) => ({
|
|
1386
|
-
...s,
|
|
1387
|
-
encapsulatedPlanks: checked
|
|
1388
|
-
}))
|
|
1389
|
-
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1390
|
-
title: t("select new plank positioning label")
|
|
1391
|
-
}, /* @__PURE__ */ React19.createElement(Select.Root, {
|
|
1392
|
-
disabled: !settings.enableDeck,
|
|
1393
|
-
value: settings.newPlankPositioning ?? "start",
|
|
1394
|
-
onValueChange: (value) => onSettingsChange((s) => ({
|
|
1395
|
-
...s,
|
|
1396
|
-
newPlankPositioning: value
|
|
1397
|
-
}))
|
|
1398
|
-
}, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
|
|
1399
|
-
placeholder: t("select new plank positioning placeholder")
|
|
1400
|
-
}), /* @__PURE__ */ React19.createElement(Select.Portal, null, /* @__PURE__ */ React19.createElement(Select.Content, null, /* @__PURE__ */ React19.createElement(Select.Viewport, null, NewPlankPositions.map((position) => /* @__PURE__ */ React19.createElement(Select.Option, {
|
|
1401
|
-
key: position,
|
|
1402
|
-
value: position
|
|
1403
|
-
}, t(`settings new plank position ${position} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1404
|
-
title: t("settings overscroll label")
|
|
1405
|
-
}, /* @__PURE__ */ React19.createElement(Select.Root, {
|
|
1406
|
-
disabled: !settings.enableDeck,
|
|
1407
|
-
value: settings.overscroll ?? "none",
|
|
1408
|
-
onValueChange: (value) => onSettingsChange((s) => ({
|
|
1409
|
-
...s,
|
|
1410
|
-
overscroll: value
|
|
1411
|
-
}))
|
|
1412
|
-
}, /* @__PURE__ */ React19.createElement(Select.TriggerButton, {
|
|
1413
|
-
placeholder: t("select overscroll placeholder")
|
|
1414
|
-
}), /* @__PURE__ */ React19.createElement(Select.Portal, null, /* @__PURE__ */ React19.createElement(Select.Content, null, /* @__PURE__ */ React19.createElement(Select.Viewport, null, OverscrollOptions.map((option) => /* @__PURE__ */ React19.createElement(Select.Option, {
|
|
1415
|
-
key: option,
|
|
1416
|
-
value: option
|
|
1417
|
-
}, t(`settings overscroll ${option} label`)))), /* @__PURE__ */ React19.createElement(Select.Arrow, null))))), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1418
|
-
title: t("settings enable statusbar label")
|
|
1419
|
-
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1420
|
-
checked: settings.enableStatusbar,
|
|
1421
|
-
onCheckedChange: (checked) => onSettingsChange((s) => ({
|
|
1422
|
-
...s,
|
|
1423
|
-
enableStatusbar: checked
|
|
1424
|
-
}))
|
|
1425
|
-
})), /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1426
|
-
title: t("settings show hints label")
|
|
1427
|
-
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1428
|
-
checked: settings.showHints,
|
|
1429
|
-
onCheckedChange: (checked) => onSettingsChange((s) => ({
|
|
1430
|
-
...s,
|
|
1431
|
-
showHints: checked
|
|
1432
|
-
}))
|
|
1433
|
-
})), !isSocket && /* @__PURE__ */ React19.createElement(ControlItemInput, {
|
|
1434
|
-
title: t("settings native redirect label")
|
|
1435
|
-
}, /* @__PURE__ */ React19.createElement(Input.Switch, {
|
|
1436
|
-
checked: settings.enableNativeRedirect,
|
|
1437
|
-
onCheckedChange: (checked) => onSettingsChange((s) => ({
|
|
1438
|
-
...s,
|
|
1439
|
-
enableNativeRedirect: checked
|
|
1440
|
-
}))
|
|
1441
|
-
})))));
|
|
1442
|
-
};
|
|
1443
|
-
|
|
1444
1383
|
export {
|
|
1445
1384
|
Banner,
|
|
1446
|
-
DeckLayout
|
|
1447
|
-
DeckSettings
|
|
1385
|
+
DeckLayout
|
|
1448
1386
|
};
|
|
1449
|
-
//# sourceMappingURL=chunk-
|
|
1387
|
+
//# sourceMappingURL=chunk-MBCCNIWY.mjs.map
|