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