@dxos/plugin-deck 0.8.3-staging.0fa589b → 0.8.4-main.1da679c
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-YCO7Y54J.mjs → app-graph-builder-DD2EJBLZ.mjs} +8 -8
- package/dist/lib/browser/app-graph-builder-DD2EJBLZ.mjs.map +7 -0
- package/dist/lib/browser/{check-app-scheme-7AXGR6UT.mjs → check-app-scheme-BKIOCWXT.mjs} +5 -5
- package/dist/lib/browser/{check-app-scheme-7AXGR6UT.mjs.map → check-app-scheme-BKIOCWXT.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-TRFYUEBA.mjs → chunk-CNTGBCMK.mjs} +5 -5
- package/dist/lib/browser/{chunk-YN5OZEGS.mjs → chunk-F5BQOOEG.mjs} +7 -9
- package/dist/lib/browser/chunk-F5BQOOEG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RMCRP7HV.mjs → chunk-FMGWFTHR.mjs} +231 -227
- package/dist/lib/browser/chunk-FMGWFTHR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RAZK4XT5.mjs → chunk-KCXWTPSU.mjs} +20 -20
- package/dist/lib/browser/{chunk-RAZK4XT5.mjs.map → chunk-KCXWTPSU.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-KLN73CM3.mjs → chunk-M57WD3V6.mjs} +3 -3
- package/dist/lib/browser/{chunk-FX44YX3G.mjs → chunk-NRCPV6AV.mjs} +8 -7
- package/dist/lib/browser/{chunk-FX44YX3G.mjs.map → chunk-NRCPV6AV.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-NSATFAEE.mjs → chunk-Z5KITAZW.mjs} +2 -2
- package/dist/lib/browser/index.mjs +24 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-EGLWTKJG.mjs → intent-resolver-XSCCU7JI.mjs} +13 -13
- package/dist/lib/browser/intent-resolver-XSCCU7JI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-C4HIM5CI.mjs → react-root-E54PO26O.mjs} +11 -11
- package/dist/lib/browser/{react-root-C4HIM5CI.mjs.map → react-root-E54PO26O.mjs.map} +2 -2
- package/dist/lib/browser/{react-surface-RV2AZ6WZ.mjs → react-surface-DIZC3J4P.mjs} +11 -11
- package/dist/lib/browser/{react-surface-RV2AZ6WZ.mjs.map → react-surface-DIZC3J4P.mjs.map} +2 -2
- package/dist/lib/browser/{settings-7VUU3ZJ4.mjs → settings-RNPLZT5S.mjs} +6 -6
- package/dist/lib/browser/{settings-7VUU3ZJ4.mjs.map → settings-RNPLZT5S.mjs.map} +2 -2
- package/dist/lib/browser/state-CRXR7X63.mjs +12 -0
- package/dist/lib/browser/toolkit-HPFRHY67.mjs +61 -0
- package/dist/lib/browser/toolkit-HPFRHY67.mjs.map +7 -0
- package/dist/lib/browser/{types.mjs → types/index.mjs} +3 -5
- package/dist/lib/browser/{url-handler-BUGI6XRE.mjs → url-handler-6IJME37M.mjs} +8 -8
- package/dist/lib/browser/url-handler-6IJME37M.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts +1 -1
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +9 -9
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-root.d.ts +2 -2
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/state.d.ts +2 -2
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/toolkit.d.ts +5 -0
- package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
- package/dist/types/src/capabilities/tools.d.ts +1 -1
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckSettings/DeckSettings.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts +1 -1
- package/dist/types/src/components/Plank/Plank.d.ts.map +1 -1
- package/dist/types/src/components/Plank/Plank.stories.d.ts +84 -4
- package/dist/types/src/components/Plank/Plank.stories.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts +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/hooks/useDeckCompanions.d.ts.map +1 -1
- package/dist/types/src/hooks/useNodeActionExpander.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +57 -56
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/{types.d.ts → types/schema.d.ts} +7 -8
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +42 -40
- package/src/DeckPlugin.ts +12 -6
- package/src/capabilities/app-graph-builder.ts +4 -3
- package/src/capabilities/check-app-scheme.ts +1 -1
- package/src/capabilities/index.ts +2 -1
- package/src/capabilities/intent-resolver.ts +11 -10
- package/src/capabilities/react-root.tsx +2 -1
- package/src/capabilities/react-surface.tsx +1 -1
- package/src/capabilities/settings.ts +1 -1
- package/src/capabilities/state.ts +4 -3
- package/src/capabilities/toolkit.ts +55 -0
- package/src/capabilities/tools.ts +9 -6
- package/src/capabilities/url-handler.ts +3 -2
- package/src/components/DeckLayout/Banner.tsx +1 -1
- package/src/components/DeckLayout/ContentEmpty.tsx +1 -1
- package/src/components/DeckLayout/DeckLayout.tsx +11 -10
- package/src/components/DeckLayout/Popover.tsx +1 -1
- package/src/components/DeckSettings/DeckSettings.tsx +72 -63
- package/src/components/Plank/Plank.stories.tsx +9 -8
- package/src/components/Plank/Plank.tsx +7 -6
- package/src/components/Plank/PlankError.tsx +4 -6
- package/src/components/Plank/PlankHeading.tsx +7 -6
- package/src/components/Sidebar/ComplementarySidebar.tsx +4 -3
- package/src/components/Sidebar/SidebarButton.tsx +2 -2
- package/src/hooks/useDeckCompanions.ts +2 -2
- package/src/hooks/useNodeActionExpander.ts +1 -1
- package/src/translations.ts +7 -4
- package/src/types/index.ts +5 -0
- package/src/{types.ts → types/schema.ts} +4 -6
- package/dist/lib/browser/app-graph-builder-YCO7Y54J.mjs.map +0 -7
- package/dist/lib/browser/chunk-RMCRP7HV.mjs.map +0 -7
- package/dist/lib/browser/chunk-YN5OZEGS.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-EGLWTKJG.mjs.map +0 -7
- package/dist/lib/browser/state-VJ6E3ADY.mjs +0 -10
- package/dist/lib/browser/tools-N57NQ2LH.mjs +0 -88
- package/dist/lib/browser/tools-N57NQ2LH.mjs.map +0 -7
- package/dist/lib/browser/url-handler-BUGI6XRE.mjs.map +0 -7
- package/dist/types/src/types.d.ts.map +0 -1
- /package/dist/lib/browser/{chunk-TRFYUEBA.mjs.map → chunk-CNTGBCMK.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-KLN73CM3.mjs.map → chunk-M57WD3V6.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-NSATFAEE.mjs.map → chunk-Z5KITAZW.mjs.map} +0 -0
- /package/dist/lib/browser/{state-VJ6E3ADY.mjs.map → state-CRXR7X63.mjs.map} +0 -0
- /package/dist/lib/browser/{types.mjs.map → types/index.mjs.map} +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Input, Select, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import {
|
|
8
|
+
import { ControlGroup, ControlItemInput, ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
9
9
|
|
|
10
10
|
import { DECK_PLUGIN } from '../../meta';
|
|
11
11
|
import {
|
|
@@ -22,67 +22,76 @@ export const DeckSettings = ({ settings }: { settings: DeckSettingsProps }) => {
|
|
|
22
22
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
25
|
+
<ControlPage>
|
|
26
|
+
<ControlSection title={t('settings title', { ns: DECK_PLUGIN })}>
|
|
27
|
+
<ControlGroup>
|
|
28
|
+
<ControlItemInput title={t('settings enable deck label')}>
|
|
29
|
+
<Input.Switch
|
|
30
|
+
checked={settings.enableDeck}
|
|
31
|
+
onCheckedChange={(checked) => (settings.enableDeck = checked)}
|
|
32
|
+
/>
|
|
33
|
+
</ControlItemInput>
|
|
34
|
+
<ControlItemInput title={t('select new plank positioning label')}>
|
|
35
|
+
<Select.Root
|
|
36
|
+
disabled={!settings.enableDeck}
|
|
37
|
+
value={settings.newPlankPositioning ?? 'start'}
|
|
38
|
+
onValueChange={(value) => (settings.newPlankPositioning = value as NewPlankPositioning)}
|
|
39
|
+
>
|
|
40
|
+
<Select.TriggerButton placeholder={t('select new plank positioning placeholder')} />
|
|
41
|
+
<Select.Portal>
|
|
42
|
+
<Select.Content>
|
|
43
|
+
<Select.Viewport>
|
|
44
|
+
{NewPlankPositions.map((position) => (
|
|
45
|
+
<Select.Option key={position} value={position}>
|
|
46
|
+
{t(`settings new plank position ${position} label`)}
|
|
47
|
+
</Select.Option>
|
|
48
|
+
))}
|
|
49
|
+
</Select.Viewport>
|
|
50
|
+
<Select.Arrow />
|
|
51
|
+
</Select.Content>
|
|
52
|
+
</Select.Portal>
|
|
53
|
+
</Select.Root>
|
|
54
|
+
</ControlItemInput>
|
|
55
|
+
<ControlItemInput title={t('settings overscroll label')}>
|
|
56
|
+
<Select.Root
|
|
57
|
+
disabled={!settings.enableDeck}
|
|
58
|
+
value={settings.overscroll ?? 'none'}
|
|
59
|
+
onValueChange={(value) => (settings.overscroll = value as Overscroll)}
|
|
60
|
+
>
|
|
61
|
+
<Select.TriggerButton placeholder={t('select overscroll placeholder')} />
|
|
62
|
+
<Select.Portal>
|
|
63
|
+
<Select.Content>
|
|
64
|
+
<Select.Viewport>
|
|
65
|
+
{OverscrollOptions.map((option) => (
|
|
66
|
+
<Select.Option key={option} value={option}>
|
|
67
|
+
{t(`settings overscroll ${option} label`)}
|
|
68
|
+
</Select.Option>
|
|
69
|
+
))}
|
|
70
|
+
</Select.Viewport>
|
|
71
|
+
<Select.Arrow />
|
|
72
|
+
</Select.Content>
|
|
73
|
+
</Select.Portal>
|
|
74
|
+
</Select.Root>
|
|
75
|
+
</ControlItemInput>
|
|
76
|
+
<ControlItemInput title={t('settings enable statusbar label')}>
|
|
77
|
+
<Input.Switch
|
|
78
|
+
checked={settings.enableStatusbar}
|
|
79
|
+
onCheckedChange={(checked) => (settings.enableStatusbar = checked)}
|
|
80
|
+
/>
|
|
81
|
+
</ControlItemInput>
|
|
82
|
+
<ControlItemInput title={t('settings show hints label')}>
|
|
83
|
+
<Input.Switch checked={settings.showHints} onCheckedChange={(checked) => (settings.showHints = checked)} />
|
|
84
|
+
</ControlItemInput>
|
|
85
|
+
{!isSocket && (
|
|
86
|
+
<ControlItemInput title={t('settings native redirect label')}>
|
|
87
|
+
<Input.Switch
|
|
88
|
+
checked={settings.enableNativeRedirect}
|
|
89
|
+
onCheckedChange={(checked) => (settings.enableNativeRedirect = checked)}
|
|
90
|
+
/>
|
|
91
|
+
</ControlItemInput>
|
|
92
|
+
)}
|
|
93
|
+
</ControlGroup>
|
|
94
|
+
</ControlSection>
|
|
95
|
+
</ControlPage>
|
|
87
96
|
);
|
|
88
97
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
@@ -12,13 +12,14 @@ import { withPluginManager } from '@dxos/app-framework/testing';
|
|
|
12
12
|
import { AttentionPlugin } from '@dxos/plugin-attention';
|
|
13
13
|
import { GraphPlugin } from '@dxos/plugin-graph';
|
|
14
14
|
import { Stack } from '@dxos/react-ui-stack';
|
|
15
|
-
import {
|
|
15
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
19
|
-
import translations from '../../translations';
|
|
17
|
+
import { DeckStateFactory } from '../../capabilities';
|
|
18
|
+
import { translations } from '../../translations';
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
import { Plank } from './Plank';
|
|
21
|
+
|
|
22
|
+
const meta = {
|
|
22
23
|
title: 'plugins/plugin-deck/Plank',
|
|
23
24
|
component: Plank,
|
|
24
25
|
render: (args) => {
|
|
@@ -39,11 +40,11 @@ const meta: Meta<PlankProps> = {
|
|
|
39
40
|
parameters: {
|
|
40
41
|
translations,
|
|
41
42
|
},
|
|
42
|
-
}
|
|
43
|
+
} satisfies Meta<typeof Plank>;
|
|
43
44
|
|
|
44
45
|
export default meta;
|
|
45
46
|
|
|
46
|
-
type Story = StoryObj<
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
47
48
|
|
|
48
49
|
// TODO(burdon): Need to define surface provider?
|
|
49
50
|
export const Default: Story = {
|
|
@@ -16,23 +16,24 @@ import {
|
|
|
16
16
|
LayoutAction,
|
|
17
17
|
Surface,
|
|
18
18
|
createIntent,
|
|
19
|
-
useCapability,
|
|
20
19
|
useAppGraph,
|
|
20
|
+
useCapability,
|
|
21
21
|
useIntentDispatcher,
|
|
22
22
|
} from '@dxos/app-framework';
|
|
23
23
|
import { debounce } from '@dxos/async';
|
|
24
|
-
import {
|
|
24
|
+
import { type Node, useNode } from '@dxos/plugin-graph';
|
|
25
25
|
import { ATTENDABLE_PATH_SEPARATOR, useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
26
26
|
import { StackItem, railGridHorizontal } from '@dxos/react-ui-stack';
|
|
27
27
|
import { mainIntrinsicSize, mx } from '@dxos/react-ui-theme';
|
|
28
28
|
|
|
29
|
+
import { DeckCapabilities } from '../../capabilities';
|
|
30
|
+
import { useCompanions, useMainSize } from '../../hooks';
|
|
31
|
+
import { parseEntryId } from '../../layout';
|
|
32
|
+
import { DeckAction, type DeckSettingsProps, type LayoutMode, type ResolvedPart } from '../../types';
|
|
33
|
+
|
|
29
34
|
import { PlankContentError, PlankError } from './PlankError';
|
|
30
35
|
import { PlankHeading } from './PlankHeading';
|
|
31
36
|
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
37
|
|
|
37
38
|
const UNKNOWN_ID = 'unknown_id';
|
|
38
39
|
|
|
@@ -8,19 +8,17 @@ import { type Node } from '@dxos/plugin-graph';
|
|
|
8
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { descriptionMessage, mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
|
+
import { DECK_PLUGIN } from '../../meta';
|
|
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
17
|
const { t } = useTranslation(DECK_PLUGIN);
|
|
17
18
|
const errorString = error?.toString() ?? '';
|
|
18
19
|
return (
|
|
19
|
-
<div role='none' className='overflow-auto p-8 attention-surface grid place-items-center'>
|
|
20
|
-
<p
|
|
21
|
-
role='alert'
|
|
22
|
-
className={mx(descriptionMessage, 'break-words rounded-md p-8', errorString.length < 256 && 'text-lg')}
|
|
23
|
-
>
|
|
20
|
+
<div role='none' className='overflow-y-auto p-8 attention-surface grid place-items-center'>
|
|
21
|
+
<p role='alert' className={mx(descriptionMessage, 'break-all rounded-md p-4')}>
|
|
24
22
|
{error ? errorString : t('error fallback message')}
|
|
25
23
|
</p>
|
|
26
24
|
</div>
|
|
@@ -2,22 +2,23 @@
|
|
|
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 {
|
|
7
|
+
import { LayoutAction, Surface, createIntent, useAppGraph, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { type Node } from '@dxos/plugin-graph';
|
|
9
9
|
import { Icon, IconButton, Popover, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
10
|
import { StackItem, type StackItemSigilAction } from '@dxos/react-ui-stack';
|
|
11
11
|
import { TextTooltip } from '@dxos/react-ui-text-tooltip';
|
|
12
12
|
import { hoverableControls, hoverableFocusedWithinControls } from '@dxos/react-ui-theme';
|
|
13
13
|
|
|
14
|
-
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
15
14
|
import { useBreakpoints } from '../../hooks';
|
|
16
15
|
import { parseEntryId } from '../../layout';
|
|
17
16
|
import { DECK_PLUGIN } from '../../meta';
|
|
18
|
-
import {
|
|
17
|
+
import { DeckAction, type LayoutMode, PLANK_COMPANION_TYPE, type ResolvedPart } from '../../types';
|
|
19
18
|
import { soloInlinePadding } from '../fragments';
|
|
20
19
|
|
|
20
|
+
import { PlankCompanionControls, PlankControls } from './PlankControls';
|
|
21
|
+
|
|
21
22
|
const MAX_COMPANIONS = 5;
|
|
22
23
|
|
|
23
24
|
export type PlankHeadingProps = {
|
|
@@ -105,7 +106,7 @@ export const PlankHeading = memo(
|
|
|
105
106
|
|
|
106
107
|
const handleAction = useCallback(
|
|
107
108
|
(action: StackItemSigilAction) => {
|
|
108
|
-
typeof action.data === 'function' && action.data?.({ parent: node, caller: DECK_PLUGIN });
|
|
109
|
+
typeof action.data === 'function' && void action.data?.({ parent: node, caller: DECK_PLUGIN });
|
|
109
110
|
},
|
|
110
111
|
[node],
|
|
111
112
|
);
|
|
@@ -155,7 +156,7 @@ export const PlankHeading = memo(
|
|
|
155
156
|
return (
|
|
156
157
|
<StackItem.Heading
|
|
157
158
|
classNames={[
|
|
158
|
-
'plb-1 items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout',
|
|
159
|
+
'plb-1 items-stretch gap-1 sticky inline-start-12 app-drag min-is-0 contain-layout density-coarse',
|
|
159
160
|
part === 'solo' ? soloInlinePadding : 'pli-1',
|
|
160
161
|
...(layoutMode === 'solo--fullscreen'
|
|
161
162
|
? [
|
|
@@ -13,17 +13,18 @@ import React, {
|
|
|
13
13
|
} from 'react';
|
|
14
14
|
|
|
15
15
|
import { LayoutAction, Surface, createIntent, useCapability, useIntentDispatcher } from '@dxos/app-framework';
|
|
16
|
-
import {
|
|
16
|
+
import { IconButton, type Label, Main, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
17
17
|
import { Tabs } from '@dxos/react-ui-tabs';
|
|
18
18
|
|
|
19
|
-
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
20
19
|
import { DeckCapabilities } from '../../capabilities';
|
|
21
|
-
import { type DeckCompanion, getCompanionId,
|
|
20
|
+
import { type DeckCompanion, getCompanionId, useBreakpoints, useDeckCompanions, useHoistStatusbar } from '../../hooks';
|
|
22
21
|
import { DECK_PLUGIN } from '../../meta';
|
|
23
22
|
import { getMode } from '../../types';
|
|
24
23
|
import { layoutAppliesTopbar } from '../../util';
|
|
25
24
|
import { PlankContentError, PlankLoading } from '../Plank';
|
|
26
25
|
|
|
26
|
+
import { ToggleComplementarySidebarButton } from './SidebarButton';
|
|
27
|
+
|
|
27
28
|
const label = ['complementary sidebar title', { ns: DECK_PLUGIN }] satisfies Label;
|
|
28
29
|
|
|
29
30
|
export type ComplementarySidebarProps = {
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { LayoutAction, createIntent, useCapability, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { IconButton, type IconButtonProps, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
9
9
|
|
|
10
10
|
import { DeckCapabilities } from '../../capabilities';
|
|
11
|
-
import {
|
|
11
|
+
import { getCompanionId, useDeckCompanions } from '../../hooks';
|
|
12
12
|
import { DECK_PLUGIN } from '../../meta';
|
|
13
13
|
|
|
14
14
|
export const ToggleSidebarButton = ({
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Label, useAppGraph } from '@dxos/app-framework';
|
|
6
|
-
import { ROOT_ID, useConnections
|
|
7
|
-
import {
|
|
6
|
+
import { type Node, ROOT_ID, useConnections } from '@dxos/plugin-graph';
|
|
7
|
+
import { type Position, byPosition } from '@dxos/util';
|
|
8
8
|
|
|
9
9
|
import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE } from '../types';
|
|
10
10
|
|
package/src/translations.ts
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const translations = [
|
|
8
10
|
{
|
|
9
11
|
'en-US': {
|
|
10
|
-
[
|
|
12
|
+
[meta.id]: {
|
|
11
13
|
'plugin name': 'Deck',
|
|
14
|
+
'settings title': 'Deck settings',
|
|
12
15
|
'main header label': 'Main header',
|
|
13
16
|
'open navigation sidebar label': 'Open sidebar',
|
|
14
17
|
'collapse navigation sidebar label': 'Minimize sidebar',
|
|
@@ -63,4 +66,4 @@ export default [
|
|
|
63
66
|
},
|
|
64
67
|
},
|
|
65
68
|
},
|
|
66
|
-
];
|
|
69
|
+
] as const satisfies Resource[];
|
|
@@ -7,7 +7,7 @@ import { Schema } from 'effect';
|
|
|
7
7
|
import { LayoutAction } from '@dxos/app-framework';
|
|
8
8
|
import { type DeepReadonly } from '@dxos/util';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { meta } from '../meta';
|
|
11
11
|
|
|
12
12
|
export { ATTENDABLE_PATH_SEPARATOR } from '@dxos/react-ui-attention';
|
|
13
13
|
|
|
@@ -111,8 +111,6 @@ export const DeckPluginState = Schema.Struct({
|
|
|
111
111
|
|
|
112
112
|
export type DeckPluginState = Schema.Schema.Type<typeof DeckPluginState>;
|
|
113
113
|
|
|
114
|
-
export const DECK_ACTION = `${DECK_PLUGIN}/action`;
|
|
115
|
-
|
|
116
114
|
export namespace DeckAction {
|
|
117
115
|
const PartAdjustmentSchema = Schema.Union(
|
|
118
116
|
Schema.Literal('close').annotations({ description: 'Close the plank.' }),
|
|
@@ -127,12 +125,12 @@ export namespace DeckAction {
|
|
|
127
125
|
export type Adjustment = Schema.Schema.Type<typeof Adjustment>;
|
|
128
126
|
|
|
129
127
|
// An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
130
|
-
export class Adjust extends Schema.TaggedClass<Adjust>()(`${
|
|
128
|
+
export class Adjust extends Schema.TaggedClass<Adjust>()(`${meta.id}/action/adjust`, {
|
|
131
129
|
input: Adjustment,
|
|
132
130
|
output: Schema.Void,
|
|
133
131
|
}) {}
|
|
134
132
|
|
|
135
|
-
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${
|
|
133
|
+
export class UpdatePlankSize extends Schema.TaggedClass<UpdatePlankSize>()(`${meta.id}/action/update-plank-size`, {
|
|
136
134
|
input: Schema.Struct({
|
|
137
135
|
id: Schema.String,
|
|
138
136
|
size: Schema.Number,
|
|
@@ -140,7 +138,7 @@ export namespace DeckAction {
|
|
|
140
138
|
output: Schema.Void,
|
|
141
139
|
}) {}
|
|
142
140
|
|
|
143
|
-
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${
|
|
141
|
+
export class ChangeCompanion extends Schema.TaggedClass<ChangeCompanion>()(`${meta.id}/action/change-companion`, {
|
|
144
142
|
input: Schema.Struct({
|
|
145
143
|
primary: Schema.String,
|
|
146
144
|
companion: Schema.Union(Schema.String, Schema.Null),
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, createIntent, LayoutAction, type PluginContext } from '@dxos/app-framework';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';\n\nimport { DeckCapabilities } from './capabilities';\nimport { DECK_PLUGIN } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(\n Capabilities.AppGraphBuilder,\n createExtension({\n id: DECK_PLUGIN,\n actions: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),\n Option.map(() => {\n const state = context.getCapability(DeckCapabilities.MutableDeckState);\n\n // NOTE(Zan): This is currently disabled.\n // TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.\n const _fullscreen = {\n id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }),\n );\n },\n properties: {\n label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],\n icon: 'ph--arrows-out--regular',\n keyBinding: {\n macos: 'ctrl+meta+f',\n windows: 'shift+ctrl+f',\n },\n },\n };\n\n const closeCurrent = {\n id: `${LayoutAction.Close._tag}/current`,\n data: async () => {\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n if (attended) {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: [attended],\n options: { state: false },\n }),\n );\n }\n },\n properties: {\n label: ['close current label', { ns: DECK_PLUGIN }],\n icon: 'ph--x--regular',\n },\n };\n\n const closeOthers = {\n id: `${LayoutAction.Close._tag}/others`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n const attention = context.getCapability(AttentionCapabilities.Attention);\n const attended = attention.current.at(-1);\n const ids = state.deck.active.filter((id) => id !== attended) ?? [];\n await dispatch(\n createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }),\n );\n },\n properties: {\n label: ['close others label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-square--regular',\n },\n };\n\n const closeAll = {\n id: `${LayoutAction.Close._tag}/all`,\n data: async () => {\n const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);\n await dispatch(\n createIntent(LayoutAction.Close, {\n part: 'main',\n subject: state.deck.active,\n options: { state: false },\n }),\n );\n },\n properties: {\n label: ['close all label', { ns: DECK_PLUGIN }],\n icon: 'ph--x-circle--regular',\n },\n };\n\n const toggleSidebar = {\n id: `${LayoutAction.UpdateSidebar._tag}/nav`,\n data: async () => {\n state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';\n },\n properties: {\n label: [\n get(\n rxFromSignal(() =>\n state.sidebarState === 'expanded'\n ? 'collapse navigation sidebar label'\n : 'open navigation sidebar label',\n ),\n ),\n { ns: DECK_PLUGIN },\n ],\n icon: 'ph--sidebar--regular',\n keyBinding: {\n macos: \"meta+'\",\n },\n disposition: 'pin-end',\n position: 'hoist',\n l0Breakpoint: 'lg',\n },\n };\n\n return get(\n rxFromSignal(() =>\n !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSideb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AgB;MACpBrD,IAAI,GAAGmB,aAAamC,cAAcjC,IAAI;MACtCC,MAAM,YAAA;AACJR,cAAMyC,eAAezC,MAAMyC,iBAAiB,aAAa,cAAc;MACzE;MACAxB,YAAY;QACVC,OAAO;UACL1B,IACEkD,aAAa,MACX1C,MAAMyC,iBAAiB,aACnB,sCACA,+BAAA,CAAA;UAGR;YAAEtB,IAAIhC;UAAY;;QAEpBiC,MAAM;QACNC,YAAY;UACVC,OAAO;QACT;QACAqB,aAAa;QACbC,UAAU;QACVC,cAAc;MAChB;IACF;AAEA,WAAOrD,IACLkD,aAAa,MACX,CAAC1C,MAAMmC,KAAKW,OAAO;MAACtB;MAAcS;MAAaK;MAAUC;QAAiB;MAACA;KAAc,CAAA;EAG/F,CAAA,GACA7C,OAAOqD,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;AAGjC,CAAA,CAAA;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "createIntent", "LayoutAction", "AttentionCapabilities", "createExtension", "ROOT_ID", "rxFromSignal", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "DECK_PLUGIN", "actions", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "ROOT_ID", "some", "none", "map", "state", "getCapability", "DeckCapabilities", "MutableDeckState", "_fullscreen", "LayoutAction", "UpdateLayout", "_tag", "data", "dispatchPromise", "dispatch", "IntentDispatcher", "createIntent", "SetLayoutMode", "part", "options", "mode", "properties", "label", "ns", "icon", "keyBinding", "macos", "windows", "closeCurrent", "Close", "attention", "AttentionCapabilities", "Attention", "attended", "current", "at", "subject", "closeOthers", "ids", "deck", "active", "filter", "closeAll", "toggleSidebar", "UpdateSidebar", "sidebarState", "rxFromSignal", "disposition", "position", "l0Breakpoint", "solo", "getOrElse"]
|
|
7
|
-
}
|