@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,82 +1,81 @@
|
|
|
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
|
-
import { mx as mx4 } from "@dxos/ui-theme";
|
|
38
|
+
import { largeIconSize as largeIconSize2, 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";
|
|
64
65
|
import { TextTooltip } from "@dxos/react-ui-text-tooltip";
|
|
65
|
-
import { hoverableControls, hoverableFocusedWithinControls } from "@dxos/ui-theme";
|
|
66
|
+
import { hoverableControls, hoverableFocusedWithinControls, largeIconSize } from "@dxos/ui-theme";
|
|
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,37 +267,36 @@ 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, {
|
|
283
|
+
"data-plank-heading": true,
|
|
284
|
+
style: largeIconSize,
|
|
297
285
|
classNames: [
|
|
298
|
-
"
|
|
299
|
-
part === "solo" ? soloInlinePadding : "
|
|
286
|
+
"py-1 items-stretch gap-1 sticky left-12 dx-app-drag min-w-0 dx-contain-layout dx-density-coarse",
|
|
287
|
+
part === "solo" ? soloInlinePadding : "px-1",
|
|
300
288
|
...layoutMode === "solo--fullscreen" ? [
|
|
301
289
|
hoverableControls,
|
|
302
290
|
hoverableFocusedWithinControls,
|
|
303
|
-
"*:transition-opacity *:opacity-
|
|
304
|
-
"hover-hover:hover:bg-
|
|
291
|
+
"*:transition-opacity *:opacity-(--controls-opacity) bg-transparent border-transparent transition-[background-color,border-color]",
|
|
292
|
+
"hover-hover:hover:bg-header-surface focus-within:bg-header-surface hover-hover:hover:border-subdued-separator focus-within:border-subdued-separator"
|
|
305
293
|
] : []
|
|
306
|
-
]
|
|
307
|
-
"data-plank-heading": true
|
|
294
|
+
]
|
|
308
295
|
}, companions && isCompanionNode ? (
|
|
309
296
|
/* TODO(thure): IMPORTANT: This is a tablist; it should be implemented as such. */
|
|
310
297
|
/* @__PURE__ */ React2.createElement("div", {
|
|
311
298
|
role: "none",
|
|
312
|
-
className: "flex-1 min-
|
|
299
|
+
className: "flex-1 min-w-0 overflow-x-auto scrollbar-none flex gap-1"
|
|
313
300
|
}, companions.map(({ id: id2, properties: { icon: icon2, label: label4 } }) => /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
314
301
|
key: id2,
|
|
315
302
|
"data-id": id2,
|
|
@@ -326,7 +313,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
326
313
|
triggerLabel: t("actions menu label"),
|
|
327
314
|
actions: sigilActions,
|
|
328
315
|
onAction: handleAction
|
|
329
|
-
}, /* @__PURE__ */ React2.createElement(Surface, {
|
|
316
|
+
}, /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
330
317
|
role: "menu-footer",
|
|
331
318
|
data: {
|
|
332
319
|
subject: node.data
|
|
@@ -344,7 +331,7 @@ var PlankHeading = /* @__PURE__ */ memo(({ id, part, node, deckEnabled, canIncre
|
|
|
344
331
|
...pending && {
|
|
345
332
|
classNames: "text-description"
|
|
346
333
|
}
|
|
347
|
-
}, label3))), node && part !== "complementary" && /* @__PURE__ */ React2.createElement(Surface, {
|
|
334
|
+
}, label3))), node && part !== "complementary" && /* @__PURE__ */ React2.createElement(Surface.Surface, {
|
|
348
335
|
role: "navbar-end",
|
|
349
336
|
data: {
|
|
350
337
|
subject: node.data
|
|
@@ -364,45 +351,55 @@ import React3 from "react";
|
|
|
364
351
|
var PlankLoading = () => {
|
|
365
352
|
return /* @__PURE__ */ React3.createElement("div", {
|
|
366
353
|
role: "none",
|
|
367
|
-
className: "grid place-items-center attention-surface"
|
|
354
|
+
className: "grid place-items-center dx-attention-surface"
|
|
368
355
|
});
|
|
369
356
|
};
|
|
370
357
|
|
|
371
358
|
// 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
359
|
var PlankError = ({ id, part, node, error }) => {
|
|
384
360
|
const [timedOut, setTimedOut] = useState(false);
|
|
385
361
|
useEffect2(() => {
|
|
386
|
-
setTimeout(() => setTimedOut(true), 5e3);
|
|
362
|
+
const timer = setTimeout(() => setTimedOut(true), 5e3);
|
|
363
|
+
return () => clearTimeout(timer);
|
|
387
364
|
}, []);
|
|
388
365
|
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(PlankHeading, {
|
|
389
366
|
id,
|
|
390
367
|
part,
|
|
391
368
|
node,
|
|
392
369
|
pending: !timedOut
|
|
393
|
-
}), timedOut ? /* @__PURE__ */ React4.createElement(
|
|
370
|
+
}), timedOut ? /* @__PURE__ */ React4.createElement(PlankErrorFallback, {
|
|
394
371
|
error
|
|
395
372
|
}) : /* @__PURE__ */ React4.createElement(PlankLoading, null));
|
|
396
373
|
};
|
|
374
|
+
var PlankErrorFallback = ({ error }) => {
|
|
375
|
+
const { t } = useTranslation3(meta.id);
|
|
376
|
+
if (process.env.NODE_ENV === "development") {
|
|
377
|
+
return /* @__PURE__ */ React4.createElement(ErrorFallback, {
|
|
378
|
+
title: "Plank Error",
|
|
379
|
+
error
|
|
380
|
+
});
|
|
381
|
+
} else {
|
|
382
|
+
const errorString = error?.toString() ?? "";
|
|
383
|
+
return /* @__PURE__ */ React4.createElement("div", {
|
|
384
|
+
role: "alert",
|
|
385
|
+
"data-testid": "plank-content-error",
|
|
386
|
+
className: "dx-attention-surface overflow-y-auto p-8 grid place-items-center"
|
|
387
|
+
}, /* @__PURE__ */ React4.createElement("p", {
|
|
388
|
+
className: mx2(descriptionMessage, "break-all rounded-md p-4")
|
|
389
|
+
}, error ? errorString : t("error fallback message")));
|
|
390
|
+
}
|
|
391
|
+
};
|
|
397
392
|
|
|
398
393
|
// src/components/Plank/Plank.tsx
|
|
399
394
|
var UNKNOWN_ID = "unknown_id";
|
|
400
|
-
var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID,
|
|
395
|
+
var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionVariant, ...props }) => {
|
|
401
396
|
const { graph } = useAppGraph2();
|
|
402
397
|
const node = useNode(graph, id);
|
|
403
398
|
const companions = useCompanions(id);
|
|
404
|
-
const
|
|
405
|
-
const
|
|
399
|
+
const { companionId } = useSelectedCompanion(companions, companionVariant);
|
|
400
|
+
const resolvedCompanionId = companionVariant ? companionId : void 0;
|
|
401
|
+
const currentCompanion = companions.find(({ id: id2 }) => id2 === resolvedCompanionId);
|
|
402
|
+
const hasCompanion = !!(resolvedCompanionId && currentCompanion);
|
|
406
403
|
return /* @__PURE__ */ React5.createElement(PlankContainer, {
|
|
407
404
|
solo: props.part === "solo",
|
|
408
405
|
companion: hasCompanion,
|
|
@@ -417,7 +414,7 @@ var Plank = /* @__PURE__ */ memo2(({ id = UNKNOWN_ID, companionId, ...props }) =
|
|
|
417
414
|
part: "solo-primary"
|
|
418
415
|
} : {}
|
|
419
416
|
}), hasCompanion && /* @__PURE__ */ React5.createElement(PlankComponent, {
|
|
420
|
-
id:
|
|
417
|
+
id: resolvedCompanionId,
|
|
421
418
|
node: currentCompanion,
|
|
422
419
|
primary: node,
|
|
423
420
|
companions,
|
|
@@ -438,7 +435,7 @@ var PlankContainer = ({ children, solo, companion, encapsulate }) => {
|
|
|
438
435
|
return /* @__PURE__ */ React5.createElement("div", {
|
|
439
436
|
role: "none",
|
|
440
437
|
"data-popover-collision-boundary": true,
|
|
441
|
-
className: mx3("absolute inset-
|
|
438
|
+
className: mx3("absolute inset-(--main-spacing) grid", encapsulate && "border border-separator rounded-sm overflow-hidden", companion && "grid-cols-[6fr_4fr]", railGridHorizontal, mainIntrinsicSize),
|
|
442
439
|
...sizeAttrs
|
|
443
440
|
}, children);
|
|
444
441
|
};
|
|
@@ -454,8 +451,8 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
454
451
|
const canIncrementStart = active && index !== void 0 && index > 0 && length !== void 0 && length > 1;
|
|
455
452
|
const canIncrementEnd = active && index !== void 0 && index < length - 1 && length !== void 0;
|
|
456
453
|
const rootElement = useRef(null);
|
|
457
|
-
const
|
|
458
|
-
const sizeKey =
|
|
454
|
+
const variant = node?.type === PLANK_COMPANION_TYPE ? getCompanionVariant2(id) : void 0;
|
|
455
|
+
const sizeKey = id.split("+")[0];
|
|
459
456
|
const size = deck.plankSizing[sizeKey];
|
|
460
457
|
const handleSizeChange = useCallback3(debounce((nextSize) => {
|
|
461
458
|
return invokePromise(DeckOperation.UpdatePlankSize, {
|
|
@@ -484,7 +481,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
484
481
|
behavior: "smooth",
|
|
485
482
|
inline: "center"
|
|
486
483
|
});
|
|
487
|
-
void invokePromise(
|
|
484
|
+
void invokePromise(LayoutOperation2.ScrollIntoView, {
|
|
488
485
|
subject: void 0
|
|
489
486
|
});
|
|
490
487
|
}
|
|
@@ -517,7 +514,7 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
517
514
|
const placeholder = useMemo2(() => /* @__PURE__ */ React5.createElement(PlankLoading, null), []);
|
|
518
515
|
const Root = part.startsWith("solo") ? "article" : StackItem2.Root;
|
|
519
516
|
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-
|
|
517
|
+
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
518
|
return /* @__PURE__ */ React5.createElement(Root, {
|
|
522
519
|
ref: rootElement,
|
|
523
520
|
"data-testid": "deck.plank",
|
|
@@ -550,12 +547,12 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
550
547
|
primaryId: primary?.id,
|
|
551
548
|
companioned,
|
|
552
549
|
companions
|
|
553
|
-
}), /* @__PURE__ */ React5.createElement(Surface2, {
|
|
550
|
+
}), /* @__PURE__ */ React5.createElement(Surface2.Surface, {
|
|
554
551
|
key: node.id,
|
|
555
552
|
role: "article",
|
|
556
553
|
data,
|
|
557
554
|
limit: 1,
|
|
558
|
-
fallback:
|
|
555
|
+
fallback: PlankErrorFallback,
|
|
559
556
|
placeholder
|
|
560
557
|
})) : /* @__PURE__ */ React5.createElement(PlankError, {
|
|
561
558
|
id,
|
|
@@ -565,16 +562,16 @@ var PlankComponent = /* @__PURE__ */ memo2(({ layoutMode, id, part, path, order,
|
|
|
565
562
|
|
|
566
563
|
// src/components/Sidebar/SidebarButton.tsx
|
|
567
564
|
import React6, { useCallback as useCallback4 } from "react";
|
|
568
|
-
import {
|
|
569
|
-
import {
|
|
565
|
+
import { useOperationInvoker as useOperationInvoker4 } from "@dxos/app-framework/ui";
|
|
566
|
+
import { LayoutOperation as LayoutOperation3, getCompanionVariant as getCompanionVariant3 } from "@dxos/app-toolkit";
|
|
570
567
|
import { IconButton as IconButton3, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
571
568
|
var ToggleSidebarButton = ({ classNames, variant = "ghost" }) => {
|
|
572
|
-
const {
|
|
569
|
+
const { updateState } = useDeckState();
|
|
573
570
|
const { t } = useTranslation4(meta.id);
|
|
574
571
|
const handleClick = useCallback4(() => {
|
|
575
|
-
updateState((
|
|
576
|
-
...
|
|
577
|
-
sidebarState:
|
|
572
|
+
updateState((state) => ({
|
|
573
|
+
...state,
|
|
574
|
+
sidebarState: state.sidebarState === "expanded" ? "collapsed" : "expanded"
|
|
578
575
|
}));
|
|
579
576
|
}, [
|
|
580
577
|
updateState
|
|
@@ -593,8 +590,8 @@ var CloseSidebarButton = () => {
|
|
|
593
590
|
const { updateState } = useDeckState();
|
|
594
591
|
const { t } = useTranslation4(meta.id);
|
|
595
592
|
const handleClick = useCallback4(() => {
|
|
596
|
-
updateState((
|
|
597
|
-
...
|
|
593
|
+
updateState((state) => ({
|
|
594
|
+
...state,
|
|
598
595
|
sidebarState: "collapsed"
|
|
599
596
|
}));
|
|
600
597
|
}, [
|
|
@@ -607,7 +604,7 @@ var CloseSidebarButton = () => {
|
|
|
607
604
|
size: 4,
|
|
608
605
|
label: t("close navigation sidebar label"),
|
|
609
606
|
onClick: handleClick,
|
|
610
|
-
classNames: "rounded-none
|
|
607
|
+
classNames: "rounded-none px-1 dx-focus-ring-inset pe-[max(.5rem,env(safe-area-inset-left))]"
|
|
611
608
|
});
|
|
612
609
|
};
|
|
613
610
|
var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
@@ -617,13 +614,13 @@ var ToggleComplementarySidebarButton = ({ inR0, classNames, current }) => {
|
|
|
617
614
|
const companions = useDeckCompanions();
|
|
618
615
|
const handleClick = useCallback4(() => {
|
|
619
616
|
const nextState = state.complementarySidebarState === "expanded" ? "collapsed" : "expanded";
|
|
620
|
-
updateState((
|
|
621
|
-
...
|
|
617
|
+
updateState((state2) => ({
|
|
618
|
+
...state2,
|
|
622
619
|
complementarySidebarState: nextState
|
|
623
620
|
}));
|
|
624
|
-
const subject = state.complementarySidebarPanel ?? (companions[0] &&
|
|
621
|
+
const subject = state.complementarySidebarPanel ?? (companions[0] && getCompanionVariant3(companions[0].id));
|
|
625
622
|
if (nextState === "expanded" && !current && subject) {
|
|
626
|
-
invokeSync(
|
|
623
|
+
invokeSync(LayoutOperation3.UpdateComplementary, {
|
|
627
624
|
subject
|
|
628
625
|
});
|
|
629
626
|
}
|
|
@@ -665,8 +662,8 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
665
662
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
666
663
|
const hoistStatusbar = useHoistStatusbar(breakpoint, layoutMode);
|
|
667
664
|
const companions = useDeckCompanions();
|
|
668
|
-
const activeCompanion = companions.find((companion) =>
|
|
669
|
-
const activeId = activeCompanion &&
|
|
665
|
+
const activeCompanion = companions.find((companion) => getCompanionVariant4(companion.id) === current);
|
|
666
|
+
const activeId = activeCompanion && getCompanionVariant4(activeCompanion.id);
|
|
670
667
|
const [internalValue, setInternalValue] = useState2(activeId);
|
|
671
668
|
useEffect3(() => {
|
|
672
669
|
setInternalValue(activeId);
|
|
@@ -676,17 +673,17 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
676
673
|
const handleTabClick = useCallback5((event) => {
|
|
677
674
|
const nextValue = event.currentTarget.getAttribute("data-value");
|
|
678
675
|
if (nextValue === activeId) {
|
|
679
|
-
updateState((
|
|
680
|
-
...
|
|
681
|
-
complementarySidebarState:
|
|
676
|
+
updateState((state2) => ({
|
|
677
|
+
...state2,
|
|
678
|
+
complementarySidebarState: state2.complementarySidebarState === "expanded" ? "collapsed" : "expanded"
|
|
682
679
|
}));
|
|
683
680
|
} else {
|
|
684
681
|
setInternalValue(nextValue);
|
|
685
|
-
updateState((
|
|
686
|
-
...
|
|
682
|
+
updateState((state2) => ({
|
|
683
|
+
...state2,
|
|
687
684
|
complementarySidebarState: "expanded"
|
|
688
685
|
}));
|
|
689
|
-
invokeSync(
|
|
686
|
+
invokeSync(LayoutOperation4.UpdateComplementary, {
|
|
690
687
|
subject: nextValue
|
|
691
688
|
});
|
|
692
689
|
}
|
|
@@ -705,7 +702,7 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
705
702
|
]);
|
|
706
703
|
useEffect3(() => {
|
|
707
704
|
if (!activeId) {
|
|
708
|
-
invokeSync(
|
|
705
|
+
invokeSync(LayoutOperation4.UpdateComplementary, {
|
|
709
706
|
state: "collapsed"
|
|
710
707
|
});
|
|
711
708
|
}
|
|
@@ -716,8 +713,8 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
716
713
|
return /* @__PURE__ */ React7.createElement(Main.ComplementarySidebar, {
|
|
717
714
|
label,
|
|
718
715
|
classNames: [
|
|
719
|
-
topbar && "
|
|
720
|
-
hoistStatusbar && "
|
|
716
|
+
topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
|
|
717
|
+
hoistStatusbar && "bottom-(--dx-statusbar-size)"
|
|
721
718
|
]
|
|
722
719
|
}, /* @__PURE__ */ React7.createElement(Tabs.Root, {
|
|
723
720
|
orientation: "vertical",
|
|
@@ -726,37 +723,38 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
726
723
|
classNames: "contents"
|
|
727
724
|
}, /* @__PURE__ */ React7.createElement("div", {
|
|
728
725
|
role: "none",
|
|
729
|
-
|
|
726
|
+
style: largeIconSize2,
|
|
727
|
+
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
728
|
}, /* @__PURE__ */ React7.createElement(Tabs.Tablist, {
|
|
731
|
-
classNames: "grid grid-cols-1 auto-rows-
|
|
729
|
+
classNames: "grid grid-cols-1 auto-rows-(--dx-rail-action) p-1 gap-1 overflow-y-auto!"
|
|
732
730
|
}, companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tab, {
|
|
733
|
-
key:
|
|
734
|
-
value:
|
|
731
|
+
key: getCompanionVariant4(companion.id),
|
|
732
|
+
value: getCompanionVariant4(companion.id),
|
|
735
733
|
asChild: true
|
|
736
734
|
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
737
735
|
label: toLocalizedString2(companion.properties.label, t),
|
|
738
736
|
icon: companion.properties.icon,
|
|
739
737
|
iconOnly: true,
|
|
740
738
|
tooltipSide: "left",
|
|
741
|
-
"data-value":
|
|
742
|
-
variant: activeId ===
|
|
739
|
+
"data-value": getCompanionVariant4(companion.id),
|
|
740
|
+
variant: activeId === getCompanionVariant4(companion.id) ? state.complementarySidebarState === "expanded" ? "primary" : "default" : "ghost",
|
|
743
741
|
onClick: handleTabClick
|
|
744
742
|
})))), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
|
|
745
743
|
role: "none",
|
|
746
|
-
className: "grid grid-cols-1 auto-rows-
|
|
747
|
-
}, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
744
|
+
className: "grid grid-cols-1 auto-rows-(--dx-rail-item) p-1 overflow-y-auto"
|
|
745
|
+
}, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
|
|
748
746
|
role: "status-bar--r0-footer",
|
|
749
747
|
limit: 1
|
|
750
748
|
})), /* @__PURE__ */ React7.createElement("div", {
|
|
751
749
|
role: "none",
|
|
752
|
-
className: "hidden lg:grid grid-cols-1 auto-rows-
|
|
750
|
+
className: "hidden lg:grid grid-cols-1 auto-rows-(--dx-rail-action) p-1"
|
|
753
751
|
}, /* @__PURE__ */ React7.createElement(ToggleComplementarySidebarButton, null))), activeId && companions.map((companion) => /* @__PURE__ */ React7.createElement(Tabs.Tabpanel, {
|
|
754
|
-
key:
|
|
755
|
-
value:
|
|
752
|
+
key: getCompanionVariant4(companion.id),
|
|
753
|
+
value: getCompanionVariant4(companion.id),
|
|
756
754
|
classNames: [
|
|
757
755
|
'absolute data-[state="inactive"]:-z-[1] overflow-hidden',
|
|
758
|
-
"inset-
|
|
759
|
-
"grid grid-cols-1 grid-rows-[var(--rail-size)_1fr_min-content]
|
|
756
|
+
"inset-y-0 start-0 w-[calc(100%-var(--dx-r0-size))] lg:w-(--dx-r1-size)",
|
|
757
|
+
"grid grid-cols-1 grid-rows-[var(--dx-rail-size)_1fr_min-content] py-[env(safe-area-inset-top)]"
|
|
760
758
|
],
|
|
761
759
|
...state.complementarySidebarState !== "expanded" && {
|
|
762
760
|
inert: true
|
|
@@ -770,46 +768,48 @@ var ComplementarySidebar = ({ current }) => {
|
|
|
770
768
|
};
|
|
771
769
|
var ComplementarySidebarPanel = ({ companion, activeId, data, hoistStatusbar }) => {
|
|
772
770
|
const { t } = useTranslation5(meta.id);
|
|
773
|
-
if (
|
|
771
|
+
if (getCompanionVariant4(companion.id) !== activeId && !data) {
|
|
774
772
|
return null;
|
|
775
773
|
}
|
|
776
|
-
const Wrapper = companion.properties.fixed ? Fragment2 :
|
|
774
|
+
const Wrapper = companion.properties.fixed ? Fragment2 : ScrollAreaWrapper;
|
|
777
775
|
return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement("div", {
|
|
778
776
|
role: "none",
|
|
779
|
-
className: "flex items-center p-1 gap-1 border-
|
|
777
|
+
className: "flex items-center p-1 gap-1 border-b border-subdued-separator"
|
|
780
778
|
}, /* @__PURE__ */ React7.createElement(IconButton4, {
|
|
781
779
|
label: toLocalizedString2(companion.properties.label, t),
|
|
782
780
|
icon: companion.properties.icon,
|
|
783
781
|
iconOnly: true,
|
|
784
782
|
tooltipSide: "left",
|
|
785
|
-
"data-value":
|
|
786
|
-
classNames: "
|
|
783
|
+
"data-value": getCompanionVariant4(companion.id),
|
|
784
|
+
classNames: "h-10 w-10",
|
|
787
785
|
variant: "default"
|
|
788
786
|
}), /* @__PURE__ */ React7.createElement("div", {
|
|
789
787
|
role: "none",
|
|
790
|
-
className: "
|
|
791
|
-
}, toLocalizedString2(companion.properties.label, t))), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
792
|
-
role: `deck-companion--${
|
|
788
|
+
className: "px-1"
|
|
789
|
+
}, toLocalizedString2(companion.properties.label, t))), /* @__PURE__ */ React7.createElement(Wrapper, null, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
|
|
790
|
+
role: `deck-companion--${getCompanionVariant4(companion.id)}`,
|
|
793
791
|
data,
|
|
794
|
-
fallback:
|
|
792
|
+
fallback: PlankErrorFallback,
|
|
795
793
|
placeholder: /* @__PURE__ */ React7.createElement(PlankLoading, null)
|
|
796
794
|
})), !hoistStatusbar && /* @__PURE__ */ React7.createElement("div", {
|
|
797
795
|
role: "contentinfo",
|
|
798
|
-
className: "flex flex-wrap justify-center items-center border-
|
|
799
|
-
}, /* @__PURE__ */ React7.createElement(Surface3, {
|
|
796
|
+
className: "flex flex-wrap justify-center items-center border-y border-subdued-separator pt-1 pb-[max(env(safe-area-inset-bottom),0.25rem)]"
|
|
797
|
+
}, /* @__PURE__ */ React7.createElement(Surface3.Surface, {
|
|
800
798
|
role: "status-bar--r1-footer",
|
|
801
799
|
limit: 1
|
|
802
800
|
})));
|
|
803
801
|
};
|
|
804
|
-
var
|
|
805
|
-
return /* @__PURE__ */ React7.createElement(
|
|
806
|
-
|
|
807
|
-
|
|
802
|
+
var ScrollAreaWrapper = ({ children }) => {
|
|
803
|
+
return /* @__PURE__ */ React7.createElement(ScrollArea.Root, {
|
|
804
|
+
thin: true,
|
|
805
|
+
orientation: "vertical",
|
|
806
|
+
classNames: "grow"
|
|
807
|
+
}, /* @__PURE__ */ React7.createElement(ScrollArea.Viewport, null, children));
|
|
808
808
|
};
|
|
809
809
|
|
|
810
810
|
// src/components/Sidebar/Sidebar.tsx
|
|
811
811
|
import React8, { useMemo as useMemo4 } from "react";
|
|
812
|
-
import { Surface as Surface4 } from "@dxos/app-framework/
|
|
812
|
+
import { Surface as Surface4 } from "@dxos/app-framework/ui";
|
|
813
813
|
import { Main as Main2 } from "@dxos/react-ui";
|
|
814
814
|
var label2 = [
|
|
815
815
|
"sidebar title",
|
|
@@ -839,10 +839,10 @@ var Sidebar = () => {
|
|
|
839
839
|
label: label2,
|
|
840
840
|
classNames: [
|
|
841
841
|
"grid",
|
|
842
|
-
topbar && "
|
|
843
|
-
hoistStatusbar && "
|
|
842
|
+
topbar && "top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
|
|
843
|
+
hoistStatusbar && "bottom-(--dx-statusbar-size)"
|
|
844
844
|
]
|
|
845
|
-
}, /* @__PURE__ */ React8.createElement(Surface4, {
|
|
845
|
+
}, /* @__PURE__ */ React8.createElement(Surface4.Surface, {
|
|
846
846
|
role: "navigation",
|
|
847
847
|
data: navigationData,
|
|
848
848
|
limit: 1
|
|
@@ -853,9 +853,9 @@ var Sidebar = () => {
|
|
|
853
853
|
var Banner = ({ variant, classNames }) => {
|
|
854
854
|
const { t } = useTranslation6(meta.id);
|
|
855
855
|
return /* @__PURE__ */ React9.createElement("header", {
|
|
856
|
-
className: mx5("flex items-stretch relative
|
|
856
|
+
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
857
|
}, variant === "sidebar" ? /* @__PURE__ */ React9.createElement(CloseSidebarButton, null) : /* @__PURE__ */ React9.createElement(ToggleSidebarButton, null), /* @__PURE__ */ React9.createElement("span", {
|
|
858
|
-
className: "self-center grow
|
|
858
|
+
className: "self-center grow ms-1"
|
|
859
859
|
}, t("current app name", {
|
|
860
860
|
ns: osTranslations
|
|
861
861
|
})), variant === "topbar" && /* @__PURE__ */ React9.createElement("div", {
|
|
@@ -863,17 +863,17 @@ var Banner = ({ variant, classNames }) => {
|
|
|
863
863
|
className: "absolute inset-0 pointer-events-none"
|
|
864
864
|
}, /* @__PURE__ */ React9.createElement("div", {
|
|
865
865
|
role: "none",
|
|
866
|
-
className: "grid
|
|
867
|
-
}, /* @__PURE__ */ React9.createElement(Surface5, {
|
|
866
|
+
className: "grid h-full pointer-fine:p-1 max-w-md mx-auto pointer-events-auto"
|
|
867
|
+
}, /* @__PURE__ */ React9.createElement(Surface5.Surface, {
|
|
868
868
|
role: "search-input",
|
|
869
869
|
limit: 1
|
|
870
870
|
}))), /* @__PURE__ */ React9.createElement("span", {
|
|
871
871
|
role: "none",
|
|
872
872
|
className: "grow"
|
|
873
|
-
}), /* @__PURE__ */ React9.createElement(Surface5, {
|
|
873
|
+
}), /* @__PURE__ */ React9.createElement(Surface5.Surface, {
|
|
874
874
|
role: "header-end",
|
|
875
875
|
limit: 1
|
|
876
|
-
}), /* @__PURE__ */ React9.createElement(Surface5, {
|
|
876
|
+
}), /* @__PURE__ */ React9.createElement(Surface5.Surface, {
|
|
877
877
|
role: "notch-start",
|
|
878
878
|
limit: 1
|
|
879
879
|
}));
|
|
@@ -885,7 +885,8 @@ import { Mosaic } from "@dxos/react-ui-mosaic";
|
|
|
885
885
|
|
|
886
886
|
// src/components/DeckLayout/ActiveNode.tsx
|
|
887
887
|
import React10 from "react";
|
|
888
|
-
import { Surface as Surface6
|
|
888
|
+
import { Surface as Surface6 } from "@dxos/app-framework/ui";
|
|
889
|
+
import { useAppGraph as useAppGraph3 } from "@dxos/app-toolkit/ui";
|
|
889
890
|
import { useNode as useNode2 } from "@dxos/plugin-graph";
|
|
890
891
|
import { useAttended } from "@dxos/react-ui-attention";
|
|
891
892
|
var ActiveNode = () => {
|
|
@@ -896,7 +897,7 @@ var ActiveNode = () => {
|
|
|
896
897
|
return /* @__PURE__ */ React10.createElement("div", {
|
|
897
898
|
role: "none",
|
|
898
899
|
className: "sr-only"
|
|
899
|
-
}, /* @__PURE__ */ React10.createElement(Surface6, {
|
|
900
|
+
}, /* @__PURE__ */ React10.createElement(Surface6.Surface, {
|
|
900
901
|
role: "document-title",
|
|
901
902
|
data: {
|
|
902
903
|
subject: activeNode
|
|
@@ -907,8 +908,8 @@ var ActiveNode = () => {
|
|
|
907
908
|
|
|
908
909
|
// src/components/DeckLayout/DeckMain.tsx
|
|
909
910
|
import React14, { Fragment as Fragment3, useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo5, useRef as useRef2 } from "react";
|
|
910
|
-
import {
|
|
911
|
-
import {
|
|
911
|
+
import { useAtomCapability, useOperationInvoker as useOperationInvoker6, usePluginManager } from "@dxos/app-framework/ui";
|
|
912
|
+
import { LayoutOperation as LayoutOperation5 } from "@dxos/app-toolkit";
|
|
912
913
|
import { AttentionCapabilities } from "@dxos/plugin-attention";
|
|
913
914
|
import { Main as Main3, useMediaQuery, useOnTransition } from "@dxos/react-ui";
|
|
914
915
|
import { DEFAULT_HORIZONTAL_SIZE, Stack, StackContext } from "@dxos/react-ui-stack";
|
|
@@ -916,7 +917,7 @@ import { mainPaddingTransitions, mx as mx6 } from "@dxos/ui-theme";
|
|
|
916
917
|
|
|
917
918
|
// src/components/DeckLayout/ContentEmpty.tsx
|
|
918
919
|
import React11 from "react";
|
|
919
|
-
import { Surface as Surface7 } from "@dxos/app-framework/
|
|
920
|
+
import { Surface as Surface7 } from "@dxos/app-framework/ui";
|
|
920
921
|
var ContentEmpty = () => {
|
|
921
922
|
const breakpoint = useBreakpoints();
|
|
922
923
|
const { deck } = useDeckState();
|
|
@@ -924,9 +925,9 @@ var ContentEmpty = () => {
|
|
|
924
925
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
925
926
|
return /* @__PURE__ */ React11.createElement("div", {
|
|
926
927
|
role: "none",
|
|
927
|
-
className: "grid place-items-center p-8 relative bg-
|
|
928
|
+
className: "grid place-items-center p-8 relative bg-deck-surface",
|
|
928
929
|
"data-testid": "layoutPlugin.firstRunMessage"
|
|
929
|
-
}, /* @__PURE__ */ React11.createElement(Surface7, {
|
|
930
|
+
}, /* @__PURE__ */ React11.createElement(Surface7.Surface, {
|
|
930
931
|
role: "keyshortcuts"
|
|
931
932
|
}), !topbar && /* @__PURE__ */ React11.createElement(ToggleSidebarButton, {
|
|
932
933
|
variant: "default",
|
|
@@ -936,18 +937,18 @@ var ContentEmpty = () => {
|
|
|
936
937
|
|
|
937
938
|
// src/components/DeckLayout/StatusBar.tsx
|
|
938
939
|
import React12 from "react";
|
|
939
|
-
import { Surface as Surface8 } from "@dxos/app-framework/
|
|
940
|
+
import { Surface as Surface8 } from "@dxos/app-framework/ui";
|
|
940
941
|
import { useLandmarkMover } from "@dxos/react-ui";
|
|
941
942
|
var StatusBar = ({ showHints }) => {
|
|
942
943
|
const mover = useLandmarkMover(void 0, "3");
|
|
943
944
|
return /* @__PURE__ */ React12.createElement("div", {
|
|
944
945
|
role: "contentinfo",
|
|
945
|
-
className: "fixed
|
|
946
|
+
className: "fixed bottom-0 inset-x-0 h-(--dx-statusbar-size) border-y border-separator z-[2] flex text-description",
|
|
946
947
|
...mover
|
|
947
|
-
}, showHints && /* @__PURE__ */ React12.createElement(Surface8, {
|
|
948
|
+
}, showHints && /* @__PURE__ */ React12.createElement(Surface8.Surface, {
|
|
948
949
|
role: "hints",
|
|
949
950
|
limit: 1
|
|
950
|
-
}), /* @__PURE__ */ React12.createElement(Surface8, {
|
|
951
|
+
}), /* @__PURE__ */ React12.createElement(Surface8.Surface, {
|
|
951
952
|
role: "status-bar",
|
|
952
953
|
limit: 1
|
|
953
954
|
}));
|
|
@@ -967,7 +968,8 @@ var DeckMain = () => {
|
|
|
967
968
|
const settings = useAtomCapability(DeckCapabilities.Settings);
|
|
968
969
|
const { state, deck, updateState } = useDeckState();
|
|
969
970
|
const { sidebarState, complementarySidebarState, complementarySidebarPanel } = state;
|
|
970
|
-
const { active,
|
|
971
|
+
const { active, companionOpen, companionVariant, fullscreen, solo, plankSizing } = deck;
|
|
972
|
+
const effectiveCompanionVariant = companionOpen ? companionVariant : void 0;
|
|
971
973
|
const layoutMode = getMode(deck);
|
|
972
974
|
const breakpoint = useBreakpoints();
|
|
973
975
|
const topbar = layoutAppliesTopbar(breakpoint, layoutMode);
|
|
@@ -990,12 +992,12 @@ var DeckMain = () => {
|
|
|
990
992
|
const attention = pluginManager.capabilities.get(AttentionCapabilities.Attention);
|
|
991
993
|
const attended = attention.getCurrent();
|
|
992
994
|
shouldRevert.current = true;
|
|
993
|
-
invokeSync(
|
|
995
|
+
invokeSync(LayoutOperation5.SetLayoutMode, {
|
|
994
996
|
subject: attended[0],
|
|
995
997
|
mode: "solo"
|
|
996
998
|
});
|
|
997
999
|
} else if (isNotMobile && layoutMode === "solo" && shouldRevert.current) {
|
|
998
|
-
invokeSync(
|
|
1000
|
+
invokeSync(LayoutOperation5.SetLayoutMode, {
|
|
999
1001
|
revert: true
|
|
1000
1002
|
});
|
|
1001
1003
|
}
|
|
@@ -1006,7 +1008,7 @@ var DeckMain = () => {
|
|
|
1006
1008
|
]);
|
|
1007
1009
|
useEffect4(() => {
|
|
1008
1010
|
if (!settings?.enableDeck && layoutMode === "deck") {
|
|
1009
|
-
invokeSync(
|
|
1011
|
+
invokeSync(LayoutOperation5.SetLayoutMode, {
|
|
1010
1012
|
subject: active[0],
|
|
1011
1013
|
mode: "solo"
|
|
1012
1014
|
});
|
|
@@ -1051,9 +1053,9 @@ var DeckMain = () => {
|
|
|
1051
1053
|
deck
|
|
1052
1054
|
]);
|
|
1053
1055
|
const mainPosition = useMemo5(() => [
|
|
1054
|
-
"grid !
|
|
1055
|
-
topbar && "!
|
|
1056
|
-
hoistStatusbar && "lg:
|
|
1056
|
+
"grid !top-[env(safe-area-inset-top)]",
|
|
1057
|
+
topbar && "!top-[calc(env(safe-area-inset-top)+var(--dx-rail-size))]",
|
|
1058
|
+
hoistStatusbar && "lg:bottom-(--dx-statusbar-size)"
|
|
1057
1059
|
], [
|
|
1058
1060
|
topbar,
|
|
1059
1061
|
hoistStatusbar
|
|
@@ -1061,7 +1063,7 @@ var DeckMain = () => {
|
|
|
1061
1063
|
const { order, itemsCount } = useMemo5(() => {
|
|
1062
1064
|
return active.reduce((acc, entryId) => {
|
|
1063
1065
|
acc.order[entryId] = acc.itemsCount + 1;
|
|
1064
|
-
acc.itemsCount +=
|
|
1066
|
+
acc.itemsCount += companionOpen ? 3 : 2;
|
|
1065
1067
|
return acc;
|
|
1066
1068
|
}, {
|
|
1067
1069
|
order: {},
|
|
@@ -1069,7 +1071,7 @@ var DeckMain = () => {
|
|
|
1069
1071
|
});
|
|
1070
1072
|
}, [
|
|
1071
1073
|
active,
|
|
1072
|
-
|
|
1074
|
+
companionOpen
|
|
1073
1075
|
]);
|
|
1074
1076
|
const handleNavigationSidebarStateChange = useCallback6((next) => {
|
|
1075
1077
|
updateState((s) => ({
|
|
@@ -1104,14 +1106,14 @@ var DeckMain = () => {
|
|
|
1104
1106
|
classNames: mainPosition,
|
|
1105
1107
|
style: {
|
|
1106
1108
|
"--main-spacing": settings?.encapsulatedPlanks ? "0.75rem" : "0",
|
|
1107
|
-
"--dx-main-
|
|
1108
|
-
"--dx-main-
|
|
1109
|
-
"--dx-main-
|
|
1110
|
-
"--dx-main-
|
|
1109
|
+
"--dx-main-sidebar-width": sidebarState === "expanded" ? "var(--dx-nav-sidebar-size)" : sidebarState === "collapsed" ? "var(--dx-l0-size)" : "0",
|
|
1110
|
+
"--dx-main-complementary-width": complementarySidebarState === "expanded" ? "var(--dx-complementary-sidebar-size)" : complementarySidebarState === "collapsed" ? "var(--dx-rail-size)" : "0",
|
|
1111
|
+
"--dx-main-content-first-width": `${plankSizing[active[0] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`,
|
|
1112
|
+
"--dx-main-content-last-width": `${plankSizing[active[(active.length ?? 1) - 1] ?? "never"] ?? DEFAULT_HORIZONTAL_SIZE}rem`
|
|
1111
1113
|
}
|
|
1112
1114
|
}, /* @__PURE__ */ React14.createElement("div", {
|
|
1113
1115
|
role: "none",
|
|
1114
|
-
className: !solo ? "relative bg-
|
|
1116
|
+
className: !solo ? "relative bg-deck-surface overflow-hidden" : "sr-only",
|
|
1115
1117
|
...solo && {
|
|
1116
1118
|
inert: true
|
|
1117
1119
|
}
|
|
@@ -1125,7 +1127,7 @@ var DeckMain = () => {
|
|
|
1125
1127
|
size: "contain",
|
|
1126
1128
|
itemsCount: itemsCount - 1,
|
|
1127
1129
|
classNames: [
|
|
1128
|
-
"absolute inset-
|
|
1130
|
+
"absolute inset-y-(--main-spacing) -inset-w-px h-[calc(100%-2*var(--main-spacing))]",
|
|
1129
1131
|
mainPaddingTransitions
|
|
1130
1132
|
],
|
|
1131
1133
|
style: padding,
|
|
@@ -1137,7 +1139,7 @@ var DeckMain = () => {
|
|
|
1137
1139
|
encapsulate: !!settings?.enableDeck
|
|
1138
1140
|
}), /* @__PURE__ */ React14.createElement(Plank, {
|
|
1139
1141
|
id: entryId,
|
|
1140
|
-
|
|
1142
|
+
companionVariant: effectiveCompanionVariant,
|
|
1141
1143
|
part: "deck",
|
|
1142
1144
|
order: order[entryId],
|
|
1143
1145
|
active,
|
|
@@ -1145,7 +1147,7 @@ var DeckMain = () => {
|
|
|
1145
1147
|
settings
|
|
1146
1148
|
}))))), /* @__PURE__ */ React14.createElement("div", {
|
|
1147
1149
|
role: "none",
|
|
1148
|
-
className: solo ? "relative overflow-hidden bg-
|
|
1150
|
+
className: solo ? "relative overflow-hidden bg-deck-surface" : "sr-only",
|
|
1149
1151
|
...!solo && {
|
|
1150
1152
|
inert: true
|
|
1151
1153
|
}
|
|
@@ -1161,7 +1163,7 @@ var DeckMain = () => {
|
|
|
1161
1163
|
}
|
|
1162
1164
|
}, /* @__PURE__ */ React14.createElement(Plank, {
|
|
1163
1165
|
id: solo,
|
|
1164
|
-
|
|
1166
|
+
companionVariant: effectiveCompanionVariant,
|
|
1165
1167
|
part: "solo",
|
|
1166
1168
|
layoutMode,
|
|
1167
1169
|
settings
|
|
@@ -1171,7 +1173,7 @@ var DeckMain = () => {
|
|
|
1171
1173
|
};
|
|
1172
1174
|
var PlankSeparator = ({ order, encapsulate }) => order > 0 ? /* @__PURE__ */ React14.createElement("span", {
|
|
1173
1175
|
role: "separator",
|
|
1174
|
-
className: mx6("row-span-2 bg-
|
|
1176
|
+
className: mx6("row-span-2 bg-deck-surface", encapsulate ? "w-0" : "w-4"),
|
|
1175
1177
|
style: {
|
|
1176
1178
|
gridColumn: order
|
|
1177
1179
|
}
|
|
@@ -1179,7 +1181,7 @@ var PlankSeparator = ({ order, encapsulate }) => order > 0 ? /* @__PURE__ */ Rea
|
|
|
1179
1181
|
|
|
1180
1182
|
// src/components/DeckLayout/Dialog.tsx
|
|
1181
1183
|
import React15, { useCallback as useCallback7 } from "react";
|
|
1182
|
-
import { Surface as Surface9 } from "@dxos/app-framework/
|
|
1184
|
+
import { Surface as Surface9 } from "@dxos/app-framework/ui";
|
|
1183
1185
|
import { AlertDialog, Dialog as NaturalDialog } from "@dxos/react-ui";
|
|
1184
1186
|
var Dialog = () => {
|
|
1185
1187
|
const { state, updateEphemeral } = useDeckState();
|
|
@@ -1200,31 +1202,35 @@ var Dialog = () => {
|
|
|
1200
1202
|
onOpenChange: handleOpenChange
|
|
1201
1203
|
}, dialogBlockAlign === "end" ? (
|
|
1202
1204
|
// TODO(burdon): Placeholder creates a suspense boundary; replace with defaults.
|
|
1203
|
-
/* @__PURE__ */ React15.createElement(Surface9, {
|
|
1205
|
+
/* @__PURE__ */ React15.createElement(Surface9.Surface, {
|
|
1204
1206
|
role: "dialog",
|
|
1205
1207
|
data: dialogContent,
|
|
1206
1208
|
limit: 1,
|
|
1207
|
-
fallback:
|
|
1209
|
+
fallback: PlankErrorFallback,
|
|
1208
1210
|
placeholder: /* @__PURE__ */ React15.createElement("div", null)
|
|
1209
1211
|
})
|
|
1210
1212
|
) : /* @__PURE__ */ React15.createElement(Overlay, {
|
|
1211
1213
|
blockAlign: dialogBlockAlign,
|
|
1212
1214
|
classNames: dialogOverlayClasses,
|
|
1213
1215
|
style: dialogOverlayStyle
|
|
1214
|
-
}, /* @__PURE__ */ React15.createElement(Surface9, {
|
|
1216
|
+
}, /* @__PURE__ */ React15.createElement(Surface9.Surface, {
|
|
1215
1217
|
role: "dialog",
|
|
1216
1218
|
data: dialogContent,
|
|
1217
1219
|
limit: 1,
|
|
1218
|
-
fallback:
|
|
1220
|
+
fallback: PlankErrorFallback
|
|
1219
1221
|
})));
|
|
1220
1222
|
};
|
|
1221
1223
|
|
|
1222
1224
|
// src/components/DeckLayout/Popover.tsx
|
|
1223
1225
|
import { createContext } from "@radix-ui/react-context";
|
|
1226
|
+
import * as Function from "effect/Function";
|
|
1227
|
+
import * as Option from "effect/Option";
|
|
1224
1228
|
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/
|
|
1226
|
-
import {
|
|
1227
|
-
import {
|
|
1229
|
+
import { Surface as Surface10 } from "@dxos/app-framework/ui";
|
|
1230
|
+
import { useObjectMenuItems } from "@dxos/app-toolkit/ui";
|
|
1231
|
+
import { Annotation, Obj } from "@dxos/echo";
|
|
1232
|
+
import { Card, Popover as Popover2, toLocalizedString as toLocalizedString3, Toolbar, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
1233
|
+
import { Menu } from "@dxos/react-ui-menu";
|
|
1228
1234
|
var DEBOUNCE_DELAY = 40;
|
|
1229
1235
|
var [DeckPopoverProvider, useDeckPopoverContext] = createContext("DeckPopover");
|
|
1230
1236
|
var PopoverRoot = ({ children }) => {
|
|
@@ -1265,6 +1271,10 @@ var PopoverContent = () => {
|
|
|
1265
1271
|
const { t } = useTranslation7(meta.id);
|
|
1266
1272
|
const { state, updateEphemeral } = useDeckState();
|
|
1267
1273
|
const { setOpen } = useDeckPopoverContext("PopoverContent");
|
|
1274
|
+
const popoverSubject = state.popoverContent?.subject;
|
|
1275
|
+
const isObjectPopover = Obj.isObject(popoverSubject);
|
|
1276
|
+
const objectMenuItems = useObjectMenuItems(popoverSubject);
|
|
1277
|
+
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;
|
|
1268
1278
|
const handleClose = useCallback8(() => {
|
|
1269
1279
|
setOpen(false);
|
|
1270
1280
|
updateEphemeral((state2) => ({
|
|
@@ -1295,17 +1305,30 @@ var PopoverContent = () => {
|
|
|
1295
1305
|
hideWhenDetached: true,
|
|
1296
1306
|
onInteractOutside: handleInteractOutside,
|
|
1297
1307
|
onEscapeKeyDown: handleInteractOutside
|
|
1298
|
-
}, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, state.popoverKind === "
|
|
1299
|
-
|
|
1300
|
-
})), /* @__PURE__ */ React16.createElement(Surface10, {
|
|
1301
|
-
role: "card--content",
|
|
1308
|
+
}, /* @__PURE__ */ React16.createElement(Popover2.Viewport, null, state.popoverKind === "base" && /* @__PURE__ */ React16.createElement(Surface10.Surface, {
|
|
1309
|
+
role: "popover",
|
|
1302
1310
|
data: state.popoverContent,
|
|
1303
1311
|
limit: 1
|
|
1304
|
-
})
|
|
1305
|
-
|
|
1312
|
+
}), state.popoverKind === "card" && /* @__PURE__ */ React16.createElement(Menu.Root, null, /* @__PURE__ */ React16.createElement(Card.Root, {
|
|
1313
|
+
border: false,
|
|
1314
|
+
classNames: "dx-card-popover"
|
|
1315
|
+
}, /* @__PURE__ */ React16.createElement(Card.Toolbar, null, icon ? /* @__PURE__ */ React16.createElement(Card.Icon, {
|
|
1316
|
+
icon
|
|
1317
|
+
}) : /* @__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, {
|
|
1318
|
+
asChild: true,
|
|
1319
|
+
disabled: !objectMenuItems.length
|
|
1320
|
+
}, /* @__PURE__ */ React16.createElement(Toolbar.IconButton, {
|
|
1321
|
+
iconOnly: true,
|
|
1322
|
+
variant: "ghost",
|
|
1323
|
+
icon: "ph--dots-three-vertical--regular",
|
|
1324
|
+
label: "Actions"
|
|
1325
|
+
})), /* @__PURE__ */ React16.createElement(Menu.Content, {
|
|
1326
|
+
items: objectMenuItems
|
|
1327
|
+
})), /* @__PURE__ */ React16.createElement(Surface10.Surface, {
|
|
1328
|
+
role: "card--content",
|
|
1306
1329
|
data: state.popoverContent,
|
|
1307
1330
|
limit: 1
|
|
1308
|
-
})), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
|
|
1331
|
+
})))), /* @__PURE__ */ React16.createElement(Popover2.Arrow, null)));
|
|
1309
1332
|
};
|
|
1310
1333
|
|
|
1311
1334
|
// src/components/DeckLayout/Toast.tsx
|
|
@@ -1359,91 +1382,8 @@ var DeckLayout = ({ onDismissToast }) => {
|
|
|
1359
1382
|
})));
|
|
1360
1383
|
};
|
|
1361
1384
|
|
|
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
1385
|
export {
|
|
1445
1386
|
Banner,
|
|
1446
|
-
DeckLayout
|
|
1447
|
-
DeckSettings
|
|
1387
|
+
DeckLayout
|
|
1448
1388
|
};
|
|
1449
|
-
//# sourceMappingURL=chunk-
|
|
1389
|
+
//# sourceMappingURL=chunk-CQ3XYTNJ.mjs.map
|