@dxos/plugin-deck 0.8.4-main.3f58842 → 0.8.4-main.52d7546f51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/app-graph-builder-X7LCO5KE.mjs +121 -0
- package/dist/lib/browser/app-graph-builder-X7LCO5KE.mjs.map +7 -0
- package/dist/lib/browser/check-app-scheme-PGISDJX7.mjs +32 -0
- package/dist/lib/browser/check-app-scheme-PGISDJX7.mjs.map +7 -0
- package/dist/lib/browser/chunk-DONG2FYU.mjs +295 -0
- package/dist/lib/browser/chunk-DONG2FYU.mjs.map +7 -0
- package/dist/lib/browser/chunk-JGC4ZLG3.mjs +1469 -0
- package/dist/lib/browser/chunk-JGC4ZLG3.mjs.map +7 -0
- package/dist/lib/browser/{chunk-CNTGBCMK.mjs → chunk-NHABISX2.mjs} +40 -33
- package/dist/lib/browser/chunk-NHABISX2.mjs.map +7 -0
- package/dist/lib/browser/chunk-YT3AJVUU.mjs +161 -0
- package/dist/lib/browser/chunk-YT3AJVUU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +89 -75
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-XJFR3PNQ.mjs +597 -0
- package/dist/lib/browser/operation-resolver-XJFR3PNQ.mjs.map +7 -0
- package/dist/lib/browser/react-root-AJFHKHRL.mjs +47 -0
- package/dist/lib/browser/react-root-AJFHKHRL.mjs.map +7 -0
- package/dist/lib/browser/react-surface-KBRBGEXY.mjs +43 -0
- package/dist/lib/browser/react-surface-KBRBGEXY.mjs.map +7 -0
- package/dist/lib/browser/settings-ES42FGLG.mjs +38 -0
- package/dist/lib/browser/settings-ES42FGLG.mjs.map +7 -0
- package/dist/lib/browser/state-YMI6IDEL.mjs +104 -0
- package/dist/lib/browser/state-YMI6IDEL.mjs.map +7 -0
- package/dist/lib/browser/toolkit-VRD54KY3.mjs +54 -0
- package/dist/lib/browser/toolkit-VRD54KY3.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +11 -4
- package/dist/lib/browser/url-handler-37UPOB3U.mjs +94 -0
- package/dist/lib/browser/url-handler-37UPOB3U.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-US54I64T.mjs +122 -0
- package/dist/lib/node-esm/app-graph-builder-US54I64T.mjs.map +7 -0
- package/dist/lib/node-esm/check-app-scheme-CK6EVG5D.mjs +33 -0
- package/dist/lib/node-esm/check-app-scheme-CK6EVG5D.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7NPS347C.mjs +1470 -0
- package/dist/lib/node-esm/chunk-7NPS347C.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs +154 -0
- package/dist/lib/node-esm/chunk-ADPMWKLL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CVYHPJIN.mjs +297 -0
- package/dist/lib/node-esm/chunk-CVYHPJIN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZMJPCZ3V.mjs +162 -0
- package/dist/lib/node-esm/chunk-ZMJPCZ3V.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +183 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/operation-resolver-ZQGNATPX.mjs +598 -0
- package/dist/lib/node-esm/operation-resolver-ZQGNATPX.mjs.map +7 -0
- package/dist/lib/node-esm/react-root-2S77ABBS.mjs +48 -0
- package/dist/lib/node-esm/react-root-2S77ABBS.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-FIHMAFXH.mjs +44 -0
- package/dist/lib/node-esm/react-surface-FIHMAFXH.mjs.map +7 -0
- package/dist/lib/node-esm/settings-E3TH3FAW.mjs +39 -0
- package/dist/lib/node-esm/settings-E3TH3FAW.mjs.map +7 -0
- package/dist/lib/node-esm/state-WQEFBQMD.mjs +105 -0
- package/dist/lib/node-esm/state-WQEFBQMD.mjs.map +7 -0
- package/dist/lib/node-esm/toolkit-ME546G5T.mjs +55 -0
- package/dist/lib/node-esm/toolkit-ME546G5T.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +40 -0
- package/dist/lib/node-esm/url-handler-2KYHXINK.mjs +95 -0
- package/dist/lib/node-esm/url-handler-2KYHXINK.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +2 -1
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts +5 -0
- package/dist/types/src/capabilities/check-app-scheme/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts +3 -0
- package/dist/types/src/capabilities/check-app-scheme/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -13
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/index.d.ts +6 -0
- package/dist/types/src/capabilities/react-root/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts +9 -0
- package/dist/types/src/capabilities/react-root/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +19 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +22 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/index.d.ts +174 -0
- package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/state/state.d.ts +177 -0
- package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
- package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts +27 -0
- package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/index.d.ts +3 -0
- package/dist/types/src/capabilities/tools/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools/tools.d.ts +12 -0
- package/dist/types/src/capabilities/tools/tools.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/url-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts +5 -0
- package/dist/types/src/capabilities/url-handler/url-handler.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -3
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts +75 -0
- package/dist/types/src/components/DeckLayout/DeckLayout.stories.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/DeckMain.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/Dialog.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 +7 -2
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts +4 -2
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +4 -4
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +105 -5
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts +1 -1
- package/dist/types/src/components/Plank/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +3 -3
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/Sidebar/SidebarButton.d.ts.map +1 -1
- 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 +3 -3
- package/dist/types/src/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useDeckState.d.ts +17 -0
- package/dist/types/src/hooks/useDeckState.d.ts.map +1 -0
- package/dist/types/src/hooks/useHoistStatusbar.d.ts +1 -1
- package/dist/types/src/hooks/useHoistStatusbar.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/{capabilities → types}/capabilities.d.ts +98 -90
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +7 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +92 -30
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/util/set-active.d.ts +18 -3
- package/dist/types/src/util/set-active.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +57 -46
- package/src/DeckPlugin.ts +46 -61
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +119 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/check-app-scheme/check-app-scheme.ts +45 -0
- package/src/capabilities/check-app-scheme/index.ts +7 -0
- package/src/capabilities/index.ts +9 -13
- package/src/capabilities/operation-resolver/index.ts +10 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +570 -0
- package/src/capabilities/react-root/index.ts +7 -0
- package/src/capabilities/react-root/react-root.tsx +47 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +38 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +39 -0
- package/src/capabilities/state/index.ts +7 -0
- package/src/capabilities/state/state.ts +105 -0
- package/src/capabilities/toolkit/index.ts +7 -0
- package/src/capabilities/toolkit/toolkit.ts +64 -0
- package/src/capabilities/tools/index.ts +7 -0
- package/src/capabilities/tools/tools.ts +92 -0
- package/src/capabilities/url-handler/index.ts +7 -0
- package/src/capabilities/url-handler/url-handler.ts +96 -0
- package/src/components/DeckLayout/ActiveNode.tsx +3 -2
- package/src/components/DeckLayout/Banner.tsx +9 -9
- package/src/components/DeckLayout/ContentEmpty.tsx +5 -6
- package/src/components/DeckLayout/DeckLayout.stories.tsx +52 -0
- package/src/components/DeckLayout/DeckLayout.tsx +18 -285
- package/src/components/DeckLayout/DeckMain.tsx +286 -0
- package/src/components/DeckLayout/Dialog.tsx +21 -12
- package/src/components/DeckLayout/Fallback.tsx +4 -4
- package/src/components/DeckLayout/Popover.tsx +60 -32
- package/src/components/DeckLayout/StatusBar.tsx +3 -3
- package/src/components/DeckLayout/Toast.tsx +30 -5
- package/src/components/DeckSettings/DeckSettings.tsx +91 -66
- package/src/components/Plank/Plank.stories.tsx +24 -16
- package/src/components/Plank/Plank.tsx +91 -57
- package/src/components/Plank/PlankControls.tsx +9 -9
- package/src/components/Plank/PlankError.tsx +5 -4
- package/src/components/Plank/PlankHeading.tsx +41 -44
- package/src/components/Sidebar/ComplementarySidebar.tsx +69 -37
- package/src/components/Sidebar/Sidebar.tsx +7 -7
- package/src/components/Sidebar/SidebarButton.tsx +39 -32
- package/src/components/fragments.ts +1 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useCompanions.ts +1 -1
- package/src/hooks/useDeckCompanions.ts +7 -5
- package/src/hooks/useDeckState.ts +82 -0
- package/src/hooks/useHoistStatusbar.ts +4 -5
- package/src/hooks/useNodeActionExpander.ts +4 -4
- package/src/index.ts +1 -2
- package/src/meta.ts +8 -5
- package/src/translations.ts +4 -1
- package/src/types/capabilities.ts +33 -0
- package/src/types/events.ts +21 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +90 -14
- package/src/util/layoutAppliesTopbar.ts +1 -1
- package/src/util/set-active.ts +49 -29
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs +0 -152
- package/dist/lib/browser/app-graph-builder-JTFSDT2I.mjs.map +0 -7
- package/dist/lib/browser/check-app-scheme-57U62A3A.mjs +0 -32
- package/dist/lib/browser/check-app-scheme-57U62A3A.mjs.map +0 -7
- package/dist/lib/browser/chunk-CNTGBCMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-D7KTFCUV.mjs +0 -1494
- package/dist/lib/browser/chunk-D7KTFCUV.mjs.map +0 -7
- package/dist/lib/browser/chunk-F5BQOOEG.mjs +0 -160
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +0 -7
- package/dist/lib/browser/chunk-JFTXENFN.mjs +0 -129
- package/dist/lib/browser/chunk-JFTXENFN.mjs.map +0 -7
- package/dist/lib/browser/chunk-M57WD3V6.mjs +0 -16
- package/dist/lib/browser/chunk-M57WD3V6.mjs.map +0 -7
- package/dist/lib/browser/chunk-QDZO4AJ4.mjs +0 -127
- package/dist/lib/browser/chunk-QDZO4AJ4.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5KITAZW.mjs +0 -13
- package/dist/lib/browser/chunk-Z5KITAZW.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs +0 -521
- package/dist/lib/browser/intent-resolver-P2OBK5HK.mjs.map +0 -7
- package/dist/lib/browser/react-root-PO64J7ML.mjs +0 -43
- package/dist/lib/browser/react-root-PO64J7ML.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E45YOVF5.mjs +0 -40
- package/dist/lib/browser/react-surface-E45YOVF5.mjs.map +0 -7
- package/dist/lib/browser/settings-6AJZPZPM.mjs +0 -29
- package/dist/lib/browser/settings-6AJZPZPM.mjs.map +0 -7
- package/dist/lib/browser/state-MVDYX77Y.mjs +0 -12
- package/dist/lib/browser/tools-TKQDPCHJ.mjs +0 -88
- package/dist/lib/browser/tools-TKQDPCHJ.mjs.map +0 -7
- package/dist/lib/browser/url-handler-7L7M6IKH.mjs +0 -70
- package/dist/lib/browser/url-handler-7L7M6IKH.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +0 -4
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-root.d.ts +0 -7
- package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/capabilities/state.d.ts +0 -101
- package/dist/types/src/capabilities/state.d.ts.map +0 -1
- package/dist/types/src/capabilities/tools.d.ts +0 -11
- package/dist/types/src/capabilities/tools.d.ts.map +0 -1
- package/dist/types/src/capabilities/url-handler.d.ts +0 -4
- package/dist/types/src/capabilities/url-handler.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -141
- package/src/capabilities/capabilities.ts +0 -14
- package/src/capabilities/check-app-scheme.ts +0 -40
- package/src/capabilities/intent-resolver.ts +0 -468
- package/src/capabilities/react-root.tsx +0 -38
- package/src/capabilities/react-surface.tsx +0 -30
- package/src/capabilities/settings.ts +0 -26
- package/src/capabilities/state.ts +0 -104
- package/src/capabilities/tools.ts +0 -81
- package/src/capabilities/url-handler.ts +0 -59
- package/src/events.ts +0 -11
- /package/dist/lib/{browser/state-MVDYX77Y.mjs.map → node-esm/types/index.mjs.map} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { useFocusFinders } from '@fluentui/react-tabster';
|
|
5
6
|
import React, {
|
|
6
7
|
type KeyboardEvent,
|
|
7
8
|
type PropsWithChildren,
|
|
@@ -12,30 +13,29 @@ import React, {
|
|
|
12
13
|
useRef,
|
|
13
14
|
} from 'react';
|
|
14
15
|
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
createIntent,
|
|
19
|
-
useCapability,
|
|
20
|
-
useAppGraph,
|
|
21
|
-
useIntentDispatcher,
|
|
22
|
-
} from '@dxos/app-framework';
|
|
16
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
17
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
18
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
23
19
|
import { debounce } from '@dxos/async';
|
|
24
|
-
import {
|
|
20
|
+
import { type Node, useNode } from '@dxos/plugin-graph';
|
|
25
21
|
import { ATTENDABLE_PATH_SEPARATOR, useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
26
22
|
import { StackItem, railGridHorizontal } from '@dxos/react-ui-stack';
|
|
27
|
-
import { mainIntrinsicSize, mx } from '@dxos/
|
|
23
|
+
import { mainIntrinsicSize, mx } from '@dxos/ui-theme';
|
|
24
|
+
|
|
25
|
+
import { useCompanions, useDeckState, useMainSize } from '../../hooks';
|
|
26
|
+
import { parseEntryId } from '../../layout';
|
|
27
|
+
import { DeckOperation, type DeckSettingsProps, type LayoutMode, type ResolvedPart } from '../../types';
|
|
28
28
|
|
|
29
29
|
import { PlankContentError, PlankError } from './PlankError';
|
|
30
30
|
import { PlankHeading } from './PlankHeading';
|
|
31
31
|
import { PlankLoading } from './PlankLoading';
|
|
32
|
-
import { DeckCapabilities } from '../../capabilities';
|
|
33
|
-
import { useMainSize, useCompanions } from '../../hooks';
|
|
34
|
-
import { parseEntryId } from '../../layout';
|
|
35
|
-
import { DeckAction, type LayoutMode, type ResolvedPart, type DeckSettingsProps } from '../../types';
|
|
36
32
|
|
|
37
33
|
const UNKNOWN_ID = 'unknown_id';
|
|
38
34
|
|
|
35
|
+
//
|
|
36
|
+
// Plank
|
|
37
|
+
//
|
|
38
|
+
|
|
39
39
|
export type PlankProps = Pick<PlankComponentProps, 'layoutMode' | 'part' | 'path' | 'order' | 'active' | 'settings'> & {
|
|
40
40
|
id?: string;
|
|
41
41
|
companionId?: string;
|
|
@@ -49,10 +49,10 @@ export type PlankProps = Pick<PlankComponentProps, 'layoutMode' | 'part' | 'path
|
|
|
49
49
|
// benefits. I think where we anticipate users will definitely want to quickly switch between showing and hiding entire
|
|
50
50
|
// articles, over the (again probably large) performance benefit that unmounting them would confer, we can mount and
|
|
51
51
|
// hide them, but I think that scenario in its most unambiguous form is probably rare. You could extrapolate
|
|
52
|
-
// the scenario to include all
|
|
53
|
-
// don
|
|
52
|
+
// the scenario to include all "potential" planks such as companions, which we could keep mounted and hidden, but I
|
|
53
|
+
// don't think the resulting performance would be acceptable. I think the real issue is "perceived performance" which
|
|
54
54
|
// has mitigations that are in between mounting and un-mounting since both of those have tradeoffs; we may need one or more
|
|
55
|
-
//
|
|
55
|
+
// "partially-mounted" experiences, like loading skeletons at the simple end, or screenshots of "sleeping" planks at
|
|
56
56
|
// the advanced end.
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -67,7 +67,11 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
|
|
|
67
67
|
const hasCompanion = !!(companionId && currentCompanion);
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
|
-
<PlankContainer
|
|
70
|
+
<PlankContainer
|
|
71
|
+
solo={props.part === 'solo'}
|
|
72
|
+
companion={hasCompanion}
|
|
73
|
+
encapsulate={!!props.settings?.encapsulatedPlanks}
|
|
74
|
+
>
|
|
71
75
|
<PlankComponent
|
|
72
76
|
id={id}
|
|
73
77
|
node={node}
|
|
@@ -91,7 +95,13 @@ export const Plank = memo(({ id = UNKNOWN_ID, companionId, ...props }: PlankProp
|
|
|
91
95
|
);
|
|
92
96
|
});
|
|
93
97
|
|
|
94
|
-
|
|
98
|
+
//
|
|
99
|
+
// PlankContainer
|
|
100
|
+
//
|
|
101
|
+
|
|
102
|
+
type PlankContainerProps = PropsWithChildren<{ solo: boolean; companion: boolean; encapsulate: boolean }>;
|
|
103
|
+
|
|
104
|
+
const PlankContainer = ({ children, solo, companion, encapsulate }: PlankContainerProps) => {
|
|
95
105
|
const sizeAttrs = useMainSize();
|
|
96
106
|
if (!solo) {
|
|
97
107
|
return children;
|
|
@@ -101,7 +111,14 @@ const PlankContainer = ({ children, solo, companion }: PropsWithChildren<{ solo:
|
|
|
101
111
|
return (
|
|
102
112
|
<div
|
|
103
113
|
role='none'
|
|
104
|
-
|
|
114
|
+
data-popover-collision-boundary={true}
|
|
115
|
+
className={mx(
|
|
116
|
+
'absolute inset-[--main-spacing] grid',
|
|
117
|
+
encapsulate && 'border border-separator rounded overflow-hidden',
|
|
118
|
+
companion && 'grid-cols-[6fr_4fr]', // TODO(burdon): Resize.
|
|
119
|
+
railGridHorizontal,
|
|
120
|
+
mainIntrinsicSize,
|
|
121
|
+
)}
|
|
105
122
|
{...sizeAttrs}
|
|
106
123
|
>
|
|
107
124
|
{children}
|
|
@@ -109,6 +126,10 @@ const PlankContainer = ({ children, solo, companion }: PropsWithChildren<{ solo:
|
|
|
109
126
|
);
|
|
110
127
|
};
|
|
111
128
|
|
|
129
|
+
//
|
|
130
|
+
// PlankComponent
|
|
131
|
+
//
|
|
132
|
+
|
|
112
133
|
type PlankComponentProps = {
|
|
113
134
|
layoutMode: LayoutMode;
|
|
114
135
|
id: string;
|
|
@@ -116,11 +137,10 @@ type PlankComponentProps = {
|
|
|
116
137
|
path?: string[];
|
|
117
138
|
order?: number;
|
|
118
139
|
active?: string[];
|
|
119
|
-
// TODO(burdon): Change to role?
|
|
120
140
|
companioned?: 'primary' | 'companion';
|
|
121
|
-
node?: Node;
|
|
122
|
-
primary?: Node;
|
|
123
|
-
companions?: Node[];
|
|
141
|
+
node?: Node.Node;
|
|
142
|
+
primary?: Node.Node;
|
|
143
|
+
companions?: Node.Node[];
|
|
124
144
|
settings?: DeckSettingsProps;
|
|
125
145
|
};
|
|
126
146
|
|
|
@@ -138,8 +158,10 @@ const PlankComponent = memo(
|
|
|
138
158
|
companions,
|
|
139
159
|
settings,
|
|
140
160
|
}: PlankComponentProps) => {
|
|
141
|
-
const {
|
|
142
|
-
const {
|
|
161
|
+
const { invokePromise } = useOperationInvoker();
|
|
162
|
+
const { state, deck } = useDeckState();
|
|
163
|
+
const { popoverAnchorId, scrollIntoView } = state;
|
|
164
|
+
const { findFirstFocusable } = useFocusFinders();
|
|
143
165
|
const canResize = layoutMode === 'deck';
|
|
144
166
|
|
|
145
167
|
const attentionAttrs = useAttentionAttributes(primary?.id ?? id);
|
|
@@ -156,29 +178,32 @@ const PlankComponent = memo(
|
|
|
156
178
|
|
|
157
179
|
const handleSizeChange = useCallback(
|
|
158
180
|
debounce((nextSize: number) => {
|
|
159
|
-
return
|
|
181
|
+
return invokePromise(DeckOperation.UpdatePlankSize, { id: sizeKey, size: nextSize });
|
|
160
182
|
}, 200),
|
|
161
|
-
[
|
|
183
|
+
[invokePromise, sizeKey],
|
|
162
184
|
);
|
|
163
185
|
|
|
164
|
-
// TODO(thure): Tabster
|
|
186
|
+
// TODO(thure): Tabster's focus group should handle moving focus to Main, but something is blocking it.
|
|
165
187
|
const handleKeyDown = useCallback((event: KeyboardEvent) => {
|
|
166
|
-
if (event.target === event.currentTarget
|
|
167
|
-
|
|
188
|
+
if (event.target === event.currentTarget) {
|
|
189
|
+
switch (event.key) {
|
|
190
|
+
case 'Escape':
|
|
191
|
+
rootElement.current?.closest('main')?.focus();
|
|
192
|
+
break;
|
|
193
|
+
case 'Enter':
|
|
194
|
+
rootElement.current && findFirstFocusable(rootElement.current)?.focus();
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
168
197
|
}
|
|
169
198
|
}, []);
|
|
170
199
|
|
|
171
200
|
useLayoutEffect(() => {
|
|
172
201
|
if (scrollIntoView === id) {
|
|
173
|
-
|
|
174
|
-
// Forcing focus to something smaller than the plank prevents large focus ring in the interim.
|
|
175
|
-
const focusable = rootElement.current?.querySelector('button') || rootElement.current;
|
|
176
|
-
focusable?.focus({ preventScroll: true });
|
|
177
|
-
layoutMode === 'deck' && focusable?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
|
|
202
|
+
layoutMode === 'deck' && rootElement.current?.scrollIntoView({ behavior: 'smooth', inline: 'center' });
|
|
178
203
|
// Clear the scroll into view state once it has been actioned.
|
|
179
|
-
void
|
|
204
|
+
void invokePromise(LayoutOperation.ScrollIntoView, { subject: undefined });
|
|
180
205
|
}
|
|
181
|
-
}, [id, scrollIntoView, layoutMode]);
|
|
206
|
+
}, [id, scrollIntoView, layoutMode, invokePromise]);
|
|
182
207
|
|
|
183
208
|
const isSolo = layoutMode.startsWith('solo') && part === 'solo';
|
|
184
209
|
const isAttendable =
|
|
@@ -189,34 +214,42 @@ const PlankComponent = memo(
|
|
|
189
214
|
const data = useMemo(
|
|
190
215
|
() =>
|
|
191
216
|
node && {
|
|
217
|
+
attendableId: id,
|
|
192
218
|
subject: node.data,
|
|
193
219
|
companionTo: primary?.data,
|
|
220
|
+
properties: node.properties,
|
|
194
221
|
variant,
|
|
195
222
|
path,
|
|
196
223
|
popoverAnchorId,
|
|
197
224
|
},
|
|
198
|
-
[node, node?.data, path, popoverAnchorId, primary?.data, variant],
|
|
225
|
+
[node, node?.data, node?.properties, path, popoverAnchorId, primary?.data, variant],
|
|
199
226
|
);
|
|
200
227
|
|
|
201
228
|
// TODO(wittjosiah): Change prop to accept a component.
|
|
202
229
|
const placeholder = useMemo(() => <PlankLoading />, []);
|
|
203
230
|
|
|
204
231
|
const Root = part.startsWith('solo') ? 'article' : StackItem.Root;
|
|
232
|
+
const fullscreen = layoutMode === 'solo--fullscreen';
|
|
205
233
|
const className = mx(
|
|
206
234
|
'attention-surface relative dx-focus-ring-inset-over-all density-coarse',
|
|
207
|
-
isSolo && mainIntrinsicSize,
|
|
208
|
-
isSolo && railGridHorizontal,
|
|
209
235
|
isSolo && 'absolute inset-0',
|
|
236
|
+
isSolo && mainIntrinsicSize,
|
|
237
|
+
railGridHorizontal,
|
|
210
238
|
part.startsWith('solo') && 'grid',
|
|
239
|
+
part.startsWith('solo-') && 'grid-rows-subgrid row-span-2 min-is-0',
|
|
240
|
+
fullscreen && 'grid-rows-1',
|
|
211
241
|
part === 'deck' && (companioned === 'companion' ? '!border-separator border-ie' : '!border-separator border-li'),
|
|
212
|
-
part.startsWith('solo-') && 'row-span-2 grid-rows-subgrid min-is-0',
|
|
213
242
|
part === 'solo-companion' && '!border-separator border-is',
|
|
243
|
+
settings?.encapsulatedPlanks &&
|
|
244
|
+
!part.startsWith('solo') &&
|
|
245
|
+
'mli-[--main-spacing] !border-separator border rounded overflow-hidden',
|
|
214
246
|
);
|
|
215
247
|
|
|
216
248
|
return (
|
|
217
249
|
<Root
|
|
218
250
|
ref={rootElement}
|
|
219
251
|
data-testid='deck.plank'
|
|
252
|
+
data-popover-collision-boundary={true}
|
|
220
253
|
tabIndex={0}
|
|
221
254
|
{...(part.startsWith('solo')
|
|
222
255
|
? ({ ...sizeAttrs, className } as any)
|
|
@@ -233,20 +266,22 @@ const PlankComponent = memo(
|
|
|
233
266
|
>
|
|
234
267
|
{node ? (
|
|
235
268
|
<>
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
269
|
+
{!fullscreen && (
|
|
270
|
+
<PlankHeading
|
|
271
|
+
id={id}
|
|
272
|
+
part={part.startsWith('solo-') ? 'solo' : part}
|
|
273
|
+
node={node}
|
|
274
|
+
layoutMode={layoutMode}
|
|
275
|
+
deckEnabled={settings?.enableDeck}
|
|
276
|
+
canIncrementStart={canIncrementStart}
|
|
277
|
+
canIncrementEnd={canIncrementEnd}
|
|
278
|
+
popoverAnchorId={popoverAnchorId}
|
|
279
|
+
primaryId={primary?.id}
|
|
280
|
+
companioned={companioned}
|
|
281
|
+
companions={companions}
|
|
282
|
+
/>
|
|
283
|
+
)}
|
|
284
|
+
<Surface.Surface
|
|
250
285
|
key={node.id}
|
|
251
286
|
role='article'
|
|
252
287
|
data={data}
|
|
@@ -258,7 +293,6 @@ const PlankComponent = memo(
|
|
|
258
293
|
) : (
|
|
259
294
|
<PlankError id={id} part={part} />
|
|
260
295
|
)}
|
|
261
|
-
|
|
262
296
|
{canResize && <StackItem.ResizeHandle />}
|
|
263
297
|
</Root>
|
|
264
298
|
);
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { forwardRef, useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { ButtonGroup, type ButtonGroupProps, type ButtonProps, IconButton, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { DeckAction, type LayoutMode } from '../../types';
|
|
11
|
+
import { meta } from '../../meta';
|
|
12
|
+
import { type DeckAction, DeckOperation, type LayoutMode } from '../../types';
|
|
13
13
|
|
|
14
14
|
export type PlankControlHandler = (event: DeckAction.PartAdjustment) => void;
|
|
15
15
|
|
|
@@ -32,7 +32,7 @@ export type PlankControlsProps = Omit<ButtonGroupProps, 'onClick'> & {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const PlankControl = ({ icon, label, ...props }: Omit<ButtonProps, 'children'> & { label: string; icon: string }) => {
|
|
35
|
-
return <IconButton
|
|
35
|
+
return <IconButton label={label} icon={icon} iconOnly variant='ghost' tooltipSide='bottom' {...props} />;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const plankControlSpacing = 'pli-2';
|
|
@@ -43,12 +43,12 @@ type PlankComplimentControlsProps = {
|
|
|
43
43
|
|
|
44
44
|
export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankComplimentControlsProps>(
|
|
45
45
|
({ primary }, forwardedRef) => {
|
|
46
|
-
const { t } = useTranslation(
|
|
47
|
-
const {
|
|
46
|
+
const { t } = useTranslation(meta.id);
|
|
47
|
+
const { invokePromise } = useOperationInvoker();
|
|
48
48
|
const handleCloseCompanion = useCallback(() => {
|
|
49
49
|
invariant(primary);
|
|
50
|
-
return
|
|
51
|
-
}, []);
|
|
50
|
+
return invokePromise(DeckOperation.ChangeCompanion, { primary, companion: null });
|
|
51
|
+
}, [invokePromise, primary]);
|
|
52
52
|
return (
|
|
53
53
|
<div ref={forwardedRef} className='contents app-no-drag'>
|
|
54
54
|
<PlankControl
|
|
@@ -71,7 +71,7 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
|
71
71
|
{ children, classNames, variant = 'default', capabilities, layoutMode, pin, close = false, onClick, ...props },
|
|
72
72
|
forwardedRef,
|
|
73
73
|
) => {
|
|
74
|
-
const { t } = useTranslation(
|
|
74
|
+
const { t } = useTranslation(meta.id);
|
|
75
75
|
const buttonClassNames =
|
|
76
76
|
variant === 'hide-disabled' ? `disabled:hidden ${plankControlSpacing}` : plankControlSpacing;
|
|
77
77
|
|
|
@@ -6,14 +6,15 @@ import React, { useEffect, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Node } from '@dxos/plugin-graph';
|
|
8
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { descriptionMessage, mx } from '@dxos/
|
|
9
|
+
import { descriptionMessage, mx } from '@dxos/ui-theme';
|
|
10
|
+
|
|
11
|
+
import { meta } from '../../meta';
|
|
10
12
|
|
|
11
13
|
import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
|
|
12
14
|
import { PlankLoading } from './PlankLoading';
|
|
13
|
-
import { DECK_PLUGIN } from '../../meta';
|
|
14
15
|
|
|
15
16
|
export const PlankContentError = ({ error }: { error?: Error }) => {
|
|
16
|
-
const { t } = useTranslation(
|
|
17
|
+
const { t } = useTranslation(meta.id);
|
|
17
18
|
const errorString = error?.toString() ?? '';
|
|
18
19
|
return (
|
|
19
20
|
<div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
|
|
@@ -32,7 +33,7 @@ export const PlankError = ({
|
|
|
32
33
|
}: {
|
|
33
34
|
id: string;
|
|
34
35
|
part: PlankHeadingProps['part'];
|
|
35
|
-
node?: Node;
|
|
36
|
+
node?: Node.Node;
|
|
36
37
|
error?: Error;
|
|
37
38
|
}) => {
|
|
38
39
|
const [timedOut, setTimedOut] = useState(false);
|
|
@@ -2,29 +2,32 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React, { Fragment, memo, useCallback, useEffect, useMemo
|
|
5
|
+
import React, { Fragment, type MouseEvent, memo, useCallback, useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Surface, useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
|
+
import { LayoutOperation } from '@dxos/app-toolkit';
|
|
9
|
+
import { useAppGraph } from '@dxos/app-toolkit/ui';
|
|
10
|
+
import { Graph, type Node, useActionRunner } from '@dxos/plugin-graph';
|
|
9
11
|
import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
12
|
import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
|
|
11
13
|
import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
12
|
-
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/
|
|
14
|
+
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/ui-theme';
|
|
13
15
|
|
|
14
|
-
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
15
16
|
import { useBreakpoints } from '../../hooks';
|
|
16
17
|
import { parseEntryId } from '../../layout';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
18
|
+
import { meta } from '../../meta';
|
|
19
|
+
import { DeckOperation, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
|
|
19
20
|
import { soloInlinePadding } from '../fragments';
|
|
20
21
|
|
|
22
|
+
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
23
|
+
|
|
21
24
|
const MAX_COMPANIONS = 5;
|
|
22
25
|
|
|
23
26
|
export type PlankHeadingProps = {
|
|
24
27
|
id: string;
|
|
25
28
|
part: ResolvedPart;
|
|
26
29
|
layoutMode?: LayoutMode;
|
|
27
|
-
node?: Node;
|
|
30
|
+
node?: Node.Node;
|
|
28
31
|
deckEnabled?: boolean;
|
|
29
32
|
canIncrementStart?: boolean;
|
|
30
33
|
canIncrementEnd?: boolean;
|
|
@@ -32,7 +35,7 @@ export type PlankHeadingProps = {
|
|
|
32
35
|
primaryId?: string;
|
|
33
36
|
pending?: boolean;
|
|
34
37
|
companioned?: 'primary' | 'companion';
|
|
35
|
-
companions?: Node[];
|
|
38
|
+
companions?: Node.Node[];
|
|
36
39
|
actions?: StackItemSigilAction[];
|
|
37
40
|
};
|
|
38
41
|
|
|
@@ -52,14 +55,15 @@ export const PlankHeading = memo(
|
|
|
52
55
|
layoutMode,
|
|
53
56
|
actions = [],
|
|
54
57
|
}: PlankHeadingProps) => {
|
|
55
|
-
const { t } = useTranslation(
|
|
56
|
-
const {
|
|
58
|
+
const { t } = useTranslation(meta.id);
|
|
59
|
+
const { invokePromise, invokeSync } = useOperationInvoker();
|
|
60
|
+
const runAction = useActionRunner();
|
|
57
61
|
const { graph } = useAppGraph();
|
|
58
62
|
const breakpoint = useBreakpoints();
|
|
59
63
|
const icon = node?.properties?.icon ?? 'ph--placeholder--regular';
|
|
60
64
|
const label = pending
|
|
61
65
|
? t('pending heading')
|
|
62
|
-
: toLocalizedString(node?.properties?.label ?? ['plank heading fallback label', { ns:
|
|
66
|
+
: toLocalizedString(node?.properties?.label ?? ['plank heading fallback label', { ns: meta.id }], t);
|
|
63
67
|
|
|
64
68
|
const isCompanionNode = node?.type === PLANK_COMPANION_TYPE;
|
|
65
69
|
|
|
@@ -67,7 +71,7 @@ export const PlankHeading = memo(
|
|
|
67
71
|
const frame = requestAnimationFrame(() => {
|
|
68
72
|
// Load actions for the node.
|
|
69
73
|
if (node) {
|
|
70
|
-
void
|
|
74
|
+
void Graph.expand(graph, node.id);
|
|
71
75
|
}
|
|
72
76
|
});
|
|
73
77
|
|
|
@@ -96,60 +100,53 @@ export const PlankHeading = memo(
|
|
|
96
100
|
} else {
|
|
97
101
|
return [
|
|
98
102
|
actions,
|
|
99
|
-
graph
|
|
100
|
-
.
|
|
101
|
-
|
|
103
|
+
Graph.getActions(graph, node.id).filter((a) =>
|
|
104
|
+
['list-item', 'list-item-primary', 'heading-list-item'].includes(a.properties.disposition),
|
|
105
|
+
),
|
|
102
106
|
].filter((a) => a.length > 0);
|
|
103
107
|
}
|
|
104
108
|
}, [actions, node, variant, graph]);
|
|
105
109
|
|
|
106
110
|
const handleAction = useCallback(
|
|
107
111
|
(action: StackItemSigilAction) => {
|
|
108
|
-
typeof action.data === 'function'
|
|
112
|
+
if (typeof action.data === 'function') {
|
|
113
|
+
void runAction(action as Node.Action, { parent: node, caller: meta.id });
|
|
114
|
+
}
|
|
109
115
|
},
|
|
110
|
-
[node],
|
|
116
|
+
[node, runAction],
|
|
111
117
|
);
|
|
112
118
|
|
|
113
119
|
const handlePlankAction = useCallback(
|
|
114
|
-
(eventType:
|
|
120
|
+
(eventType: DeckOperation.PartAdjustment) => {
|
|
115
121
|
if (eventType.startsWith('solo')) {
|
|
116
|
-
return
|
|
122
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
117
123
|
} else if (eventType === 'close') {
|
|
118
124
|
if (part === 'complementary') {
|
|
119
|
-
return
|
|
120
|
-
createIntent(LayoutAction.UpdateComplementary, {
|
|
121
|
-
part: 'complementary',
|
|
122
|
-
options: { state: 'collapsed' },
|
|
123
|
-
}),
|
|
124
|
-
);
|
|
125
|
+
return invokeSync(LayoutOperation.UpdateComplementary, { state: 'collapsed' });
|
|
125
126
|
} else {
|
|
126
|
-
return
|
|
127
|
-
createIntent(LayoutAction.Close, { part: 'main', subject: [id], options: { state: false } }),
|
|
128
|
-
);
|
|
127
|
+
return invokeSync(LayoutOperation.Close, { subject: [id] });
|
|
129
128
|
}
|
|
130
129
|
} else {
|
|
131
|
-
return
|
|
130
|
+
return invokePromise(DeckOperation.Adjust, { type: eventType, id });
|
|
132
131
|
}
|
|
133
132
|
},
|
|
134
|
-
[
|
|
133
|
+
[invokePromise, invokeSync, id, part],
|
|
135
134
|
);
|
|
136
135
|
|
|
137
|
-
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${
|
|
136
|
+
const ActionRoot = node && popoverAnchorId === `dxos.org/ui/${meta.id}/${node.id}` ? Popover.Anchor : Fragment;
|
|
138
137
|
|
|
139
138
|
const handleTabClick = useCallback(
|
|
140
139
|
(event: MouseEvent) => {
|
|
141
140
|
const target = (event.target as HTMLElement).closest('[data-id]') as HTMLElement | null;
|
|
142
141
|
const tabId = target?.dataset?.id;
|
|
143
142
|
if (primaryId && tabId) {
|
|
144
|
-
void
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}),
|
|
149
|
-
);
|
|
143
|
+
void invokePromise(DeckOperation.ChangeCompanion, {
|
|
144
|
+
primary: primaryId,
|
|
145
|
+
companion: tabId,
|
|
146
|
+
});
|
|
150
147
|
}
|
|
151
148
|
},
|
|
152
|
-
[primaryId],
|
|
149
|
+
[primaryId, invokePromise],
|
|
153
150
|
);
|
|
154
151
|
|
|
155
152
|
return (
|
|
@@ -161,7 +158,8 @@ export const PlankHeading = memo(
|
|
|
161
158
|
? [
|
|
162
159
|
hoverableControls,
|
|
163
160
|
hoverableFocusedWithinControls,
|
|
164
|
-
'*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color]
|
|
161
|
+
'*:transition-opacity *:opacity-[--controls-opacity] bg-transparent border-transparent transition-[background-color,border-color]',
|
|
162
|
+
'hover-hover:hover:bg-headerSurface focus-within:bg-headerSurface hover-hover:hover:border-subduedSeparator focus-within:border-subduedSeparator',
|
|
165
163
|
]
|
|
166
164
|
: []),
|
|
167
165
|
]}
|
|
@@ -177,7 +175,6 @@ export const PlankHeading = memo(
|
|
|
177
175
|
icon={icon}
|
|
178
176
|
iconOnly={companions.length > MAX_COMPANIONS && node?.id !== id}
|
|
179
177
|
label={toLocalizedString(label, t)}
|
|
180
|
-
size={5}
|
|
181
178
|
variant={node?.id === id ? 'primary' : 'ghost'}
|
|
182
179
|
onClick={handleTabClick}
|
|
183
180
|
/>
|
|
@@ -195,12 +192,12 @@ export const PlankHeading = memo(
|
|
|
195
192
|
actions={sigilActions}
|
|
196
193
|
onAction={handleAction}
|
|
197
194
|
>
|
|
198
|
-
<Surface role='menu-footer' data={{ subject: node.data }} />
|
|
195
|
+
<Surface.Surface role='menu-footer' data={{ subject: node.data }} />
|
|
199
196
|
</StackItem.Sigil>
|
|
200
197
|
) : (
|
|
201
198
|
<StackItem.SigilButton>
|
|
202
199
|
<span className='sr-only'>{label}</span>
|
|
203
|
-
<Icon icon={icon}
|
|
200
|
+
<Icon icon={icon} />
|
|
204
201
|
</StackItem.SigilButton>
|
|
205
202
|
)}
|
|
206
203
|
</ActionRoot>
|
|
@@ -215,7 +212,7 @@ export const PlankHeading = memo(
|
|
|
215
212
|
</TextTooltip>
|
|
216
213
|
</>
|
|
217
214
|
)}
|
|
218
|
-
{node && part !== 'complementary' && <Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
215
|
+
{node && part !== 'complementary' && <Surface.Surface role='navbar-end' data={{ subject: node.data }} />}
|
|
219
216
|
{companioned === 'companion' ? (
|
|
220
217
|
<PlankCompanionControls primary={primaryId} />
|
|
221
218
|
) : (
|