@dxos/plugin-deck 0.8.2-main.12df754 → 0.8.2-main.36232bc
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/{check-app-scheme-SEYECDHI.mjs → check-app-scheme-O7JPE4TM.mjs} +2 -3
- package/dist/lib/browser/check-app-scheme-O7JPE4TM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VP6FCWFV.mjs → chunk-STZ4VVW6.mjs} +54 -43
- package/dist/lib/browser/chunk-STZ4VVW6.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4QSEGMY3.mjs → chunk-WFTGOFIF.mjs} +5 -5
- package/dist/lib/browser/index.mjs +1 -1
- package/dist/lib/browser/{intent-resolver-6AK45PT5.mjs → intent-resolver-JKWXWUV6.mjs} +12 -5
- package/dist/lib/browser/intent-resolver-JKWXWUV6.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-KA2IL5RA.mjs → react-root-7JVQQA4K.mjs} +3 -3
- package/dist/lib/browser/{react-surface-LIPGYEYN.mjs → react-surface-MQ7QJ7JJ.mjs} +3 -3
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Popover.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.map +1 -1
- package/dist/types/src/components/Plank/PlankHeading.d.ts.map +1 -1
- package/package.json +29 -28
- package/src/capabilities/check-app-scheme.ts +3 -5
- package/src/capabilities/intent-resolver.ts +54 -46
- package/src/components/DeckLayout/Popover.tsx +55 -42
- package/src/components/Plank/PlankControls.tsx +11 -5
- package/src/components/Plank/PlankError.tsx +2 -6
- package/src/components/Plank/PlankHeading.tsx +3 -1
- package/dist/lib/browser/check-app-scheme-SEYECDHI.mjs.map +0 -7
- package/dist/lib/browser/chunk-VP6FCWFV.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-6AK45PT5.mjs.map +0 -7
- /package/dist/lib/browser/{chunk-4QSEGMY3.mjs.map → chunk-WFTGOFIF.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-KA2IL5RA.mjs.map → react-root-7JVQQA4K.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-LIPGYEYN.mjs.map → react-surface-MQ7QJ7JJ.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-deck",
|
|
3
|
-
"version": "0.8.2-main.
|
|
3
|
+
"version": "0.8.2-main.36232bc",
|
|
4
4
|
"description": "DXOS Surface plugin for the main application layout.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,30 +33,31 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fluentui/react-tabster": "^9.24.2",
|
|
35
35
|
"@preact/signals-core": "^1.6.0",
|
|
36
|
+
"@radix-ui/react-context": "1.1.1",
|
|
36
37
|
"effect": "3.13.3",
|
|
37
38
|
"immer": "^10.1.1",
|
|
38
|
-
"@dxos/app-framework": "0.8.2-main.
|
|
39
|
-
"@dxos/artifact": "0.8.2-main.
|
|
40
|
-
"@dxos/async": "0.8.2-main.
|
|
41
|
-
"@dxos/echo-schema": "0.8.2-main.
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/invariant": "0.8.2-main.
|
|
45
|
-
"@dxos/keyboard": "0.8.2-main.
|
|
46
|
-
"@dxos/live-object": "0.8.2-main.
|
|
47
|
-
"@dxos/local-storage": "0.8.2-main.
|
|
48
|
-
"@dxos/log": "0.8.2-main.
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/react-
|
|
54
|
-
"@dxos/react-ui-attention": "0.8.2-main.
|
|
55
|
-
"@dxos/react-
|
|
56
|
-
"@dxos/react-ui-
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/react-ui-
|
|
59
|
-
"@dxos/util": "0.8.2-main.
|
|
39
|
+
"@dxos/app-framework": "0.8.2-main.36232bc",
|
|
40
|
+
"@dxos/artifact": "0.8.2-main.36232bc",
|
|
41
|
+
"@dxos/async": "0.8.2-main.36232bc",
|
|
42
|
+
"@dxos/echo-schema": "0.8.2-main.36232bc",
|
|
43
|
+
"@dxos/debug": "0.8.2-main.36232bc",
|
|
44
|
+
"@dxos/echo-signals": "0.8.2-main.36232bc",
|
|
45
|
+
"@dxos/invariant": "0.8.2-main.36232bc",
|
|
46
|
+
"@dxos/keyboard": "0.8.2-main.36232bc",
|
|
47
|
+
"@dxos/live-object": "0.8.2-main.36232bc",
|
|
48
|
+
"@dxos/local-storage": "0.8.2-main.36232bc",
|
|
49
|
+
"@dxos/log": "0.8.2-main.36232bc",
|
|
50
|
+
"@dxos/plugin-attention": "0.8.2-main.36232bc",
|
|
51
|
+
"@dxos/plugin-graph": "0.8.2-main.36232bc",
|
|
52
|
+
"@dxos/plugin-theme": "0.8.2-main.36232bc",
|
|
53
|
+
"@dxos/plugin-observability": "0.8.2-main.36232bc",
|
|
54
|
+
"@dxos/react-client": "0.8.2-main.36232bc",
|
|
55
|
+
"@dxos/react-ui-attention": "0.8.2-main.36232bc",
|
|
56
|
+
"@dxos/react-ui-form": "0.8.2-main.36232bc",
|
|
57
|
+
"@dxos/react-ui-stack": "0.8.2-main.36232bc",
|
|
58
|
+
"@dxos/react-ui-tabs": "0.8.2-main.36232bc",
|
|
59
|
+
"@dxos/react-ui-text-tooltip": "0.8.2-main.36232bc",
|
|
60
|
+
"@dxos/util": "0.8.2-main.36232bc"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
63
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -65,16 +66,16 @@
|
|
|
65
66
|
"react": "~18.2.0",
|
|
66
67
|
"react-dom": "~18.2.0",
|
|
67
68
|
"vite": "5.4.7",
|
|
68
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
69
|
-
"@dxos/react-ui-theme": "0.8.2-main.
|
|
70
|
-
"@dxos/storybook-utils": "0.8.2-main.
|
|
69
|
+
"@dxos/react-ui": "0.8.2-main.36232bc",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.2-main.36232bc",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.2-main.36232bc"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
74
|
"@phosphor-icons/react": "^2.0.5",
|
|
74
75
|
"react": "~18.2.0",
|
|
75
76
|
"react-dom": "~18.2.0",
|
|
76
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
77
|
-
"@dxos/react-ui
|
|
77
|
+
"@dxos/react-ui-theme": "0.8.2-main.36232bc",
|
|
78
|
+
"@dxos/react-ui": "0.8.2-main.36232bc"
|
|
78
79
|
},
|
|
79
80
|
"publishConfig": {
|
|
80
81
|
"access": "public"
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
|
-
//
|
|
5
|
-
// Copyright 2025 DXOS.org
|
|
6
|
-
//
|
|
7
4
|
|
|
8
5
|
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
9
6
|
|
|
@@ -34,8 +31,9 @@ const checkAppScheme = (url: string) => {
|
|
|
34
31
|
};
|
|
35
32
|
|
|
36
33
|
export default async (context: PluginsContext) => {
|
|
37
|
-
const
|
|
38
|
-
|
|
34
|
+
const settings = context
|
|
35
|
+
.requestCapability(Capabilities.SettingsStore)
|
|
36
|
+
.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
|
|
39
37
|
if (!isSocket && settings?.enableNativeRedirect) {
|
|
40
38
|
checkAppScheme(appScheme);
|
|
41
39
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { batch } from '@preact/signals-core';
|
|
6
|
-
import { pipe } from 'effect';
|
|
6
|
+
import { Effect, pipe } from 'effect';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
9
|
Capabilities,
|
|
@@ -241,55 +241,63 @@ export default (context: PluginsContext) =>
|
|
|
241
241
|
intent: LayoutAction.UpdateLayout,
|
|
242
242
|
filter: (data): data is S.Schema.Type<typeof LayoutAction.Open.fields.input> =>
|
|
243
243
|
S.is(LayoutAction.Open.fields.input)(data),
|
|
244
|
-
resolve: ({ subject, options }) =>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
resolve: ({ subject, options }) =>
|
|
245
|
+
Effect.gen(function* () {
|
|
246
|
+
const { graph } = context.requestCapability(Capabilities.AppGraph);
|
|
247
|
+
const state = context.requestCapability(DeckCapabilities.MutableDeckState);
|
|
248
|
+
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
249
|
+
const settings = context
|
|
250
|
+
.requestCapabilities(Capabilities.SettingsStore)[0]
|
|
251
|
+
?.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
|
|
251
252
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
openEntry(acc, entryId, {
|
|
259
|
-
key: options?.key,
|
|
260
|
-
positioning: options?.positioning ?? settings?.newPlankPositioning,
|
|
261
|
-
pivotId: options?.pivotId,
|
|
262
|
-
variant: options?.variant,
|
|
263
|
-
}),
|
|
264
|
-
state.deck.active,
|
|
265
|
-
);
|
|
253
|
+
if (options?.workspace && state.activeDeck !== options?.workspace) {
|
|
254
|
+
const { dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
255
|
+
yield* dispatch(
|
|
256
|
+
createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: options.workspace }),
|
|
257
|
+
);
|
|
258
|
+
}
|
|
266
259
|
|
|
267
|
-
|
|
268
|
-
|
|
260
|
+
const previouslyOpenIds = new Set<string>(state.deck.solo ? [state.deck.solo] : state.deck.active);
|
|
261
|
+
batch(() => {
|
|
262
|
+
const next = state.deck.solo
|
|
263
|
+
? (subject as string[]).map((id) => createEntryId(id, options?.variant))
|
|
264
|
+
: subject.reduce(
|
|
265
|
+
(acc, entryId) =>
|
|
266
|
+
openEntry(acc, entryId, {
|
|
267
|
+
key: options?.key,
|
|
268
|
+
positioning: options?.positioning ?? settings?.newPlankPositioning,
|
|
269
|
+
pivotId: options?.pivotId,
|
|
270
|
+
variant: options?.variant,
|
|
271
|
+
}),
|
|
272
|
+
state.deck.active,
|
|
273
|
+
);
|
|
269
274
|
|
|
270
|
-
|
|
271
|
-
|
|
275
|
+
return setActive({ next, state, attention });
|
|
276
|
+
});
|
|
272
277
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
278
|
+
const ids = state.deck.solo ? [state.deck.solo] : state.deck.active;
|
|
279
|
+
const newlyOpen = ids.filter((i) => !previouslyOpenIds.has(i));
|
|
280
|
+
|
|
281
|
+
return {
|
|
282
|
+
intents: [
|
|
283
|
+
...(options?.scrollIntoView !== false
|
|
284
|
+
? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: newlyOpen[0] ?? subject[0] })]
|
|
285
|
+
: []),
|
|
286
|
+
createIntent(LayoutAction.Expose, { part: 'navigation', subject: newlyOpen[0] ?? subject[0] }),
|
|
287
|
+
...newlyOpen.map((subjectId) => {
|
|
288
|
+
const active = graph?.findNode(subjectId)?.data;
|
|
289
|
+
const typename = isLiveObject(active) ? getTypename(active) : undefined;
|
|
290
|
+
return createIntent(ObservabilityAction.SendEvent, {
|
|
291
|
+
name: 'navigation.activate',
|
|
292
|
+
properties: {
|
|
293
|
+
subjectId,
|
|
294
|
+
typename,
|
|
295
|
+
},
|
|
296
|
+
});
|
|
297
|
+
}),
|
|
298
|
+
],
|
|
299
|
+
};
|
|
300
|
+
}),
|
|
293
301
|
}),
|
|
294
302
|
createResolver({
|
|
295
303
|
intent: LayoutAction.UpdateLayout,
|
|
@@ -2,72 +2,85 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { createContext } from '@radix-ui/react-context';
|
|
5
6
|
import React, { type PropsWithChildren, useCallback, useEffect, useRef, useState } from 'react';
|
|
6
7
|
|
|
7
8
|
import { Surface, useCapability } from '@dxos/app-framework';
|
|
8
|
-
import { Popover } from '@dxos/react-ui';
|
|
9
|
+
import { Popover, type PopoverContentInteractOutsideEvent } from '@dxos/react-ui';
|
|
9
10
|
|
|
10
11
|
import { DeckCapabilities } from '../../capabilities';
|
|
11
12
|
|
|
12
13
|
export type DeckPopoverRootProps = PropsWithChildren<{}>;
|
|
13
14
|
|
|
15
|
+
const DEBOUNCE_DELAY = 40;
|
|
16
|
+
|
|
17
|
+
type DeckPopoverContextValue = {
|
|
18
|
+
setOpen: (open: boolean) => void;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const [DeckPopoverProvider, useDeckPopoverContext] = createContext<DeckPopoverContextValue>('DeckPopover');
|
|
22
|
+
|
|
14
23
|
export const PopoverRoot = ({ children }: DeckPopoverRootProps) => {
|
|
15
|
-
const
|
|
24
|
+
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
16
25
|
const virtualRef = useRef<HTMLButtonElement | null>(null);
|
|
17
26
|
const [virtualIter, setVirtualIter] = useState(0);
|
|
27
|
+
const [open, setOpen] = useState(false);
|
|
28
|
+
const debounceRef = useRef<NodeJS.Timeout | null>(null);
|
|
18
29
|
|
|
19
|
-
// TODO(thure): This is a workaround for the
|
|
20
|
-
// the anchor further down the tree
|
|
21
|
-
const [delayedPopoverVisibility, setDelayedPopoverVisibility] = useState(false);
|
|
30
|
+
// TODO(thure): This is a workaround for the race condition between displaying a Popover and either rendering
|
|
31
|
+
// the anchor further down the tree or measuring the virtual trigger’s client rect.
|
|
22
32
|
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(nextOpen: boolean) => {
|
|
28
|
-
if (nextOpen && (context.popoverAnchor || context.popoverAnchorId)) {
|
|
29
|
-
context.popoverOpen = true;
|
|
30
|
-
} else {
|
|
31
|
-
context.popoverOpen = false;
|
|
32
|
-
context.popoverAnchor = undefined;
|
|
33
|
-
context.popoverAnchorId = undefined;
|
|
34
|
-
context.popoverSide = undefined;
|
|
33
|
+
setOpen(false);
|
|
34
|
+
if (layout.popoverOpen) {
|
|
35
|
+
if (debounceRef.current) {
|
|
36
|
+
clearTimeout(debounceRef.current);
|
|
35
37
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [context.popoverAnchor]);
|
|
38
|
+
if (layout.popoverAnchor && virtualRef.current !== layout.popoverAnchor) {
|
|
39
|
+
virtualRef.current = layout.popoverAnchor ?? null;
|
|
40
|
+
setVirtualIter((iter) => iter + 1);
|
|
41
|
+
}
|
|
42
|
+
debounceRef.current = setTimeout(() => setOpen(true), DEBOUNCE_DELAY);
|
|
43
|
+
}
|
|
44
|
+
}, [layout.popoverOpen, layout.popoverAnchorId, layout.popoverAnchor, layout.popoverContent]);
|
|
44
45
|
|
|
45
46
|
return (
|
|
46
|
-
<
|
|
47
|
-
modal
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{children}
|
|
53
|
-
</Popover.Root>
|
|
47
|
+
<DeckPopoverProvider setOpen={setOpen}>
|
|
48
|
+
<Popover.Root modal open={open}>
|
|
49
|
+
{layout.popoverAnchor && <Popover.VirtualTrigger key={virtualIter} virtualRef={virtualRef} />}
|
|
50
|
+
{children}
|
|
51
|
+
</Popover.Root>
|
|
52
|
+
</DeckPopoverProvider>
|
|
54
53
|
);
|
|
55
54
|
};
|
|
56
55
|
|
|
57
56
|
export const PopoverContent = () => {
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
const layout = useCapability(DeckCapabilities.MutableDeckState);
|
|
58
|
+
const { setOpen } = useDeckPopoverContext('PopoverContent');
|
|
59
|
+
|
|
60
|
+
const handleClose = useCallback(
|
|
61
|
+
(event: KeyboardEvent | PopoverContentInteractOutsideEvent) => {
|
|
62
|
+
if (
|
|
63
|
+
// TODO(thure): CodeMirror should not focus itself when it updates.
|
|
64
|
+
event.type === 'dismissableLayer.focusOutside' &&
|
|
65
|
+
(event.currentTarget as HTMLElement | undefined)?.classList.contains('cm-content')
|
|
66
|
+
) {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
} else {
|
|
69
|
+
setOpen(false);
|
|
70
|
+
layout.popoverOpen = false;
|
|
71
|
+
layout.popoverAnchor = undefined;
|
|
72
|
+
layout.popoverAnchorId = undefined;
|
|
73
|
+
layout.popoverSide = undefined;
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
[setOpen],
|
|
77
|
+
);
|
|
65
78
|
|
|
66
79
|
return (
|
|
67
80
|
<Popover.Portal>
|
|
68
|
-
<Popover.Content side={
|
|
81
|
+
<Popover.Content side={layout.popoverSide} onInteractOutside={handleClose} onEscapeKeyDown={handleClose}>
|
|
69
82
|
<Popover.Viewport>
|
|
70
|
-
<Surface role='popover' data={
|
|
83
|
+
<Surface role='popover' data={layout.popoverContent} limit={1} />
|
|
71
84
|
</Popover.Viewport>
|
|
72
85
|
<Popover.Arrow />
|
|
73
86
|
</Popover.Content>
|
|
@@ -73,7 +73,7 @@ export const PlankCompanionControls = forwardRef<HTMLDivElement, PlankCompliment
|
|
|
73
73
|
<PlankControl
|
|
74
74
|
label={t('close companion label')}
|
|
75
75
|
variant='ghost'
|
|
76
|
-
icon='ph--
|
|
76
|
+
icon='ph--x--regular'
|
|
77
77
|
onClick={handleCloseCompanion}
|
|
78
78
|
classNames={plankControlSpacing}
|
|
79
79
|
/>
|
|
@@ -114,12 +114,18 @@ export const PlankControls = forwardRef<HTMLDivElement, PlankControlsProps>(
|
|
|
114
114
|
label={t(
|
|
115
115
|
layoutMode === 'solo--fullscreen'
|
|
116
116
|
? 'exit fullscreen label'
|
|
117
|
-
:
|
|
118
|
-
? 'show
|
|
119
|
-
: 'show
|
|
117
|
+
: layoutIsAnySolo
|
|
118
|
+
? 'show deck plank label'
|
|
119
|
+
: 'show solo plank label',
|
|
120
120
|
)}
|
|
121
121
|
classNames={buttonClassNames}
|
|
122
|
-
icon={
|
|
122
|
+
icon={
|
|
123
|
+
layoutMode === 'solo--fullscreen'
|
|
124
|
+
? 'ph--corners-in--regular'
|
|
125
|
+
: layoutIsAnySolo
|
|
126
|
+
? 'ph--arrows-in-line-horizontal--regular'
|
|
127
|
+
: 'ph--arrows-out-line-horizontal--regular'
|
|
128
|
+
}
|
|
123
129
|
onClick={() => onClick?.(layoutMode === 'solo--fullscreen' ? 'solo--fullscreen' : 'solo')}
|
|
124
130
|
/>
|
|
125
131
|
</>
|
|
@@ -6,7 +6,7 @@ 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 {
|
|
9
|
+
import { descriptionMessage, mx } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
11
|
import { PlankHeading, type PlankHeadingProps } from './PlankHeading';
|
|
12
12
|
import { PlankLoading } from './PlankLoading';
|
|
@@ -19,11 +19,7 @@ export const PlankContentError = ({ error }: { error?: Error }) => {
|
|
|
19
19
|
<div role='none' className='overflow-auto p-8 attention-surface grid place-items-center'>
|
|
20
20
|
<p
|
|
21
21
|
role='alert'
|
|
22
|
-
className={mx(
|
|
23
|
-
descriptionText,
|
|
24
|
-
'break-words border border-dashed border-separator rounded-lg p-8',
|
|
25
|
-
errorString.length < 256 && 'text-lg',
|
|
26
|
-
)}
|
|
22
|
+
className={mx(descriptionMessage, 'break-words rounded-lg p-8', errorString.length < 256 && 'text-lg')}
|
|
27
23
|
>
|
|
28
24
|
{error ? errorString : t('error fallback message')}
|
|
29
25
|
</p>
|
|
@@ -17,6 +17,8 @@ import { PLANK_COMPANION_TYPE, DeckAction, type ResolvedPart, type LayoutMode }
|
|
|
17
17
|
import { useBreakpoints } from '../../util';
|
|
18
18
|
import { soloInlinePadding } from '../fragments';
|
|
19
19
|
|
|
20
|
+
const MAX_COMPANIONS = 5;
|
|
21
|
+
|
|
20
22
|
export type PlankHeadingProps = {
|
|
21
23
|
id: string;
|
|
22
24
|
part: ResolvedPart;
|
|
@@ -152,7 +154,7 @@ export const PlankHeading = memo(
|
|
|
152
154
|
key={id}
|
|
153
155
|
data-id={id}
|
|
154
156
|
icon={icon}
|
|
155
|
-
iconOnly={node?.id !== id}
|
|
157
|
+
iconOnly={companions.length > MAX_COMPANIONS && node?.id !== id}
|
|
156
158
|
label={toLocalizedString(label, t)}
|
|
157
159
|
size={5}
|
|
158
160
|
variant={node?.id === id ? 'primary' : 'default'}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/check-app-scheme.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';\n\nimport { DECK_PLUGIN } from '../meta';\nimport { type DeckSettingsProps } from '../types';\n\nconst isSocket = !!(globalThis as any).__args;\n\n// TODO(mjamesderocher): Can we get this directly from Socket?\nconst appScheme = 'composer://';\n\n// TODO(mjamesderocher): Factor out as part of NavigationPlugin.\nconst checkAppScheme = (url: string) => {\n const iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n iframe.src = url + window.location.pathname.replace(/^\\/+/, '') + window.location.search;\n\n const timer = setTimeout(() => {\n document.body.removeChild(iframe);\n }, 3000);\n\n window.addEventListener('pagehide', (event) => {\n clearTimeout(timer);\n document.body.removeChild(iframe);\n });\n};\n\nexport default async (context: PluginsContext) => {\n const settingsStore = context.requestCapability(Capabilities.SettingsStore);\n const settings = settingsStore.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;\n if (!isSocket && settings?.enableNativeRedirect) {\n checkAppScheme(appScheme);\n }\n\n return contributes(Capabilities.Null, null);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAOA,SAASA,cAAcC,mBAAwC;AAK/D,IAAMC,WAAW,CAAC,CAAEC,WAAmBC;AAGvC,IAAMC,YAAY;AAGlB,IAAMC,iBAAiB,CAACC,QAAAA;AACtB,QAAMC,SAASC,SAASC,cAAc,QAAA;AACtCF,SAAOG,MAAMC,UAAU;AACvBH,WAASI,KAAKC,YAAYN,MAAAA;AAE1BA,SAAOO,MAAMR,MAAMS,OAAOC,SAASC,SAASC,QAAQ,QAAQ,EAAA,IAAMH,OAAOC,SAASG;AAElF,QAAMC,QAAQC,WAAW,MAAA;AACvBb,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,GAAG,GAAA;AAEHQ,SAAOQ,iBAAiB,YAAY,CAACC,UAAAA;AACnCC,iBAAaL,KAAAA;AACbZ,aAASI,KAAKU,YAAYf,MAAAA;EAC5B,CAAA;AACF;AAEA,IAAA,2BAAe,OAAOmB,YAAAA;AACpB,QAAMC,gBAAgBD,QAAQE,kBAAkBC,aAAaC,aAAa;AAC1E,QAAMC,WAAWJ,cAAcK,SAA4BC,WAAAA,GAAcC;AACzE,MAAI,CAACjC,YAAY8B,UAAUI,sBAAsB;AAC/C9B,mBAAeD,SAAAA;EACjB;AAEA,SAAOgC,YAAYP,aAAaQ,MAAM,IAAA;AACxC;",
|
|
6
|
-
"names": ["Capabilities", "contributes", "isSocket", "globalThis", "__args", "appScheme", "checkAppScheme", "url", "iframe", "document", "createElement", "style", "display", "body", "appendChild", "src", "window", "location", "pathname", "replace", "search", "timer", "setTimeout", "removeChild", "addEventListener", "event", "clearTimeout", "context", "settingsStore", "requestCapability", "Capabilities", "SettingsStore", "settings", "getStore", "DECK_PLUGIN", "value", "enableNativeRedirect", "contributes", "Null"]
|
|
7
|
-
}
|