@dxos/plugin-deck 0.8.0 → 0.8.1-main.81238a8
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-IYHAGFA3.mjs → app-graph-builder-K4KVSHNT.mjs} +3 -3
- package/dist/lib/browser/{check-app-scheme-S3EYUPMF.mjs → check-app-scheme-6SS6I3RN.mjs} +2 -2
- package/dist/lib/browser/{chunk-N7TEPFVR.mjs → chunk-2WTHB3TG.mjs} +1 -1
- package/dist/lib/browser/{chunk-N7TEPFVR.mjs.map → chunk-2WTHB3TG.mjs.map} +2 -2
- package/dist/lib/browser/chunk-7A5DLPQ3.mjs +24 -0
- package/dist/lib/browser/{chunk-FT33W5CI.mjs → chunk-7X43JKZG.mjs} +34 -4
- package/dist/lib/browser/chunk-7X43JKZG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OEDK54N2.mjs → chunk-7YPIAXSW.mjs} +179 -72
- package/dist/lib/browser/chunk-7YPIAXSW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KANJBSIX.mjs → chunk-RZLH5F56.mjs} +5 -5
- package/dist/lib/browser/{chunk-KANJBSIX.mjs.map → chunk-RZLH5F56.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-22AQ5IVX.mjs → chunk-WCNPMAR4.mjs} +2 -2
- package/dist/lib/browser/index.mjs +8 -7
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/{intent-resolver-ZD67BRUI.mjs → intent-resolver-MEBOMCYI.mjs} +46 -17
- package/dist/lib/browser/intent-resolver-MEBOMCYI.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-root-2T6BCRK4.mjs → react-root-PPKFVPO7.mjs} +7 -7
- package/dist/lib/browser/{react-surface-GFMOJSIA.mjs → react-surface-7JBPPUHM.mjs} +7 -7
- package/dist/lib/browser/{settings-H35U6NHE.mjs → settings-DYS3FFMN.mjs} +4 -4
- package/dist/lib/browser/{settings-H35U6NHE.mjs.map → settings-DYS3FFMN.mjs.map} +3 -3
- package/dist/lib/browser/{state-U4SHOPJW.mjs → state-DRRCGMU2.mjs} +7 -11
- package/dist/lib/browser/state-DRRCGMU2.mjs.map +7 -0
- package/dist/lib/browser/tools-NDEUSO4R.mjs +78 -0
- package/dist/lib/browser/tools-NDEUSO4R.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +10 -4
- package/dist/lib/browser/{url-handler-MVHTKUYA.mjs → url-handler-4BCN7AYC.mjs} +7 -9
- package/dist/lib/browser/url-handler-4BCN7AYC.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +26 -2
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/state.d.ts +13 -1
- package/dist/types/src/capabilities/state.d.ts.map +1 -1
- package/dist/types/src/capabilities/tools.d.ts +1 -0
- package/dist/types/src/capabilities/tools.d.ts.map +1 -1
- package/dist/types/src/capabilities/url-handler.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/ActiveNode.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/ContentEmpty.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/Fallback.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +6 -2
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Plank.d.ts +4 -4
- package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts +6 -1
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankError.d.ts +3 -2
- package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/PlankLoading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +4 -3
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +2 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -1
- package/dist/types/src/components/LayoutSettings.d.ts +2 -1
- package/dist/types/src/components/LayoutSettings.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -5
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +42 -11
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +31 -31
- package/src/capabilities/intent-resolver.ts +29 -3
- package/src/capabilities/settings.ts +1 -1
- package/src/capabilities/state.ts +2 -9
- package/src/capabilities/tools.ts +34 -22
- package/src/capabilities/url-handler.ts +2 -8
- package/src/components/DeckLayout/DeckLayout.tsx +36 -11
- package/src/components/DeckLayout/NodePlankHeading.tsx +49 -29
- package/src/components/DeckLayout/Plank.tsx +181 -111
- package/src/components/DeckLayout/PlankControls.tsx +34 -3
- package/src/components/LayoutSettings.tsx +3 -3
- package/src/meta.ts +2 -2
- package/src/translations.ts +4 -3
- package/src/types.ts +30 -1
- package/src/util/useHoistStatusbar.ts +4 -4
- package/dist/lib/browser/chunk-FT33W5CI.mjs.map +0 -7
- package/dist/lib/browser/chunk-J65MNI4S.mjs +0 -24
- package/dist/lib/browser/chunk-OEDK54N2.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZD67BRUI.mjs.map +0 -7
- package/dist/lib/browser/state-U4SHOPJW.mjs.map +0 -7
- package/dist/lib/browser/tools-64LXGLYR.mjs +0 -59
- package/dist/lib/browser/tools-64LXGLYR.mjs.map +0 -7
- package/dist/lib/browser/url-handler-MVHTKUYA.mjs.map +0 -7
- /package/dist/lib/browser/{app-graph-builder-IYHAGFA3.mjs.map → app-graph-builder-K4KVSHNT.mjs.map} +0 -0
- /package/dist/lib/browser/{check-app-scheme-S3EYUPMF.mjs.map → check-app-scheme-6SS6I3RN.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-J65MNI4S.mjs.map → chunk-7A5DLPQ3.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-22AQ5IVX.mjs.map → chunk-WCNPMAR4.mjs.map} +0 -0
- /package/dist/lib/browser/{react-root-2T6BCRK4.mjs.map → react-root-PPKFVPO7.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-GFMOJSIA.mjs.map → react-surface-7JBPPUHM.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlankError.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/PlankError.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlankError.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/PlankError.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAIlF,eAAO,MAAM,iBAAiB,cAAe;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,sBAiB7D,CAAC;AAEF,eAAO,MAAM,UAAU,+BAKpB;IACD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC;CACf,sBAWA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlankLoading.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/PlankLoading.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlankLoading.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/PlankLoading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,YAAY,yBAExB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Sidebar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Sidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAWvC,eAAO,MAAM,OAAO,yBAuBnB,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type IconButtonProps, type ThemedClassName } from '@dxos/react-ui';
|
|
2
|
-
export declare const ToggleSidebarButton: ({ classNames, variant, }: ThemedClassName<Pick<IconButtonProps, "variant">>) =>
|
|
3
|
-
export declare const CloseSidebarButton: () =>
|
|
3
|
+
export declare const ToggleSidebarButton: ({ classNames, variant, }: ThemedClassName<Pick<IconButtonProps, "variant">>) => React.JSX.Element;
|
|
4
|
+
export declare const CloseSidebarButton: () => React.JSX.Element;
|
|
4
5
|
export declare const ToggleComplementarySidebarButton: ({ inR0, classNames }: ThemedClassName<{
|
|
5
6
|
inR0?: boolean;
|
|
6
|
-
}>) =>
|
|
7
|
+
}>) => React.JSX.Element;
|
|
7
8
|
//# sourceMappingURL=SidebarButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/SidebarButton.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/SidebarButton.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAc,KAAK,eAAe,EAAE,KAAK,eAAe,EAAkB,MAAM,gBAAgB,CAAC;AAKxG,eAAO,MAAM,mBAAmB,6BAG7B,eAAe,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC,sBAgBnD,CAAC;AAEF,eAAO,MAAM,kBAAkB,yBAc9B,CAAC;AAEF,eAAO,MAAM,gCAAgC,yBAA0B,eAAe,CAAC;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,sBAkBzG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/StatusBar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/StatusBar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,eAAO,MAAM,SAAS,kBAAmB;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,sBAY/D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type LayoutAction } from '@dxos/app-framework';
|
|
2
3
|
import { type ToastRootProps } from '@dxos/react-ui';
|
|
3
|
-
export declare const Toast: ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange, }: LayoutAction.Toast & Pick<ToastRootProps, "onOpenChange">) =>
|
|
4
|
+
export declare const Toast: ({ id, title, description, icon, duration, actionLabel, actionAlt, closeLabel, onAction, onOpenChange, }: LayoutAction.Toast & Pick<ToastRootProps, "onOpenChange">) => React.JSX.Element;
|
|
4
5
|
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Toast.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Toast.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAKxB,eAAO,MAAM,KAAK,4GAWf,YAAY,CAAC,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,sBA8B3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Topbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Topbar.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Topbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/DeckLayout/Topbar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,MAAM,yBAElB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { type DeckSettingsProps } from '../types';
|
|
2
3
|
export declare const LayoutSettings: ({ settings }: {
|
|
3
4
|
settings: DeckSettingsProps;
|
|
4
|
-
}) =>
|
|
5
|
+
}) => React.JSX.Element;
|
|
5
6
|
//# sourceMappingURL=LayoutSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/LayoutSettings.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayoutSettings.d.ts","sourceRoot":"","sources":["../../../../src/components/LayoutSettings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAGL,KAAK,iBAAiB,EAGvB,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,cAAc,iBAAkB;IAAE,QAAQ,EAAE,iBAAiB,CAAA;CAAE,sBA8D3E,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
1
2
|
export declare const DECK_PLUGIN: "dxos.org/plugin/deck";
|
|
2
|
-
export declare const meta:
|
|
3
|
-
id: "dxos.org/plugin/deck";
|
|
4
|
-
name: string;
|
|
5
|
-
icon: string;
|
|
6
|
-
};
|
|
3
|
+
export declare const meta: PluginMeta;
|
|
7
4
|
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,WAAW,EAAG,sBAA+B,CAAC;AAE3D,eAAO,MAAM,IAAI,EAAE,UAIlB,CAAC"}
|
|
@@ -43,10 +43,11 @@ declare const _default: {
|
|
|
43
43
|
'select overscroll placeholder': string;
|
|
44
44
|
'settings overscroll centering label': string;
|
|
45
45
|
'settings overscroll none label': string;
|
|
46
|
-
'settings enable
|
|
46
|
+
'settings enable statusbar label': string;
|
|
47
47
|
'close current label': string;
|
|
48
48
|
'close others label': string;
|
|
49
49
|
'close all label': string;
|
|
50
|
+
'companion plank heading fallback label': string;
|
|
50
51
|
};
|
|
51
52
|
};
|
|
52
53
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAuDE"}
|
|
@@ -6,6 +6,8 @@ export declare const NewPlankPositions: readonly ["start", "end"];
|
|
|
6
6
|
export type NewPlankPositioning = (typeof NewPlankPositions)[number];
|
|
7
7
|
export declare const OverscrollOptions: readonly ["none", "centering"];
|
|
8
8
|
export type Overscroll = (typeof OverscrollOptions)[number];
|
|
9
|
+
export type Part = 'solo' | 'deck' | 'complementary';
|
|
10
|
+
export type ResolvedPart = Part | 'solo-primary' | 'solo-companion';
|
|
9
11
|
export type Panel = {
|
|
10
12
|
id: string;
|
|
11
13
|
label: Label;
|
|
@@ -20,7 +22,7 @@ export type Panel = {
|
|
|
20
22
|
export declare const DeckSettingsSchema: S.mutable<S.Struct<{
|
|
21
23
|
showHints: typeof S.Boolean;
|
|
22
24
|
enableNativeRedirect: typeof S.Boolean;
|
|
23
|
-
|
|
25
|
+
enableStatusbar: typeof S.Boolean;
|
|
24
26
|
newPlankPositioning: S.Literal<["start", "end"]>;
|
|
25
27
|
overscroll: S.Literal<["none", "centering"]>;
|
|
26
28
|
}>>;
|
|
@@ -33,12 +35,26 @@ export type PlankSizing = S.Schema.Type<typeof PlankSizing>;
|
|
|
33
35
|
export declare const Deck: S.Struct<{
|
|
34
36
|
initialized: S.SchemaClass<boolean, boolean, never>;
|
|
35
37
|
active: S.mutable<S.Array$<typeof S.String>>;
|
|
38
|
+
activeCompanions: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.String>>>;
|
|
36
39
|
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
37
40
|
solo: S.optional<typeof S.String>;
|
|
38
41
|
fullscreen: typeof S.Boolean;
|
|
39
42
|
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
43
|
+
companionFrameSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
40
44
|
}>;
|
|
41
45
|
export type Deck = S.Schema.Type<typeof Deck>;
|
|
46
|
+
export declare const defaultDeck: {
|
|
47
|
+
initialized: false;
|
|
48
|
+
active: never[];
|
|
49
|
+
activeCompanions: {};
|
|
50
|
+
inactive: never[];
|
|
51
|
+
fullscreen: false;
|
|
52
|
+
solo: undefined;
|
|
53
|
+
plankSizing: {};
|
|
54
|
+
companionFrameSizing: {};
|
|
55
|
+
};
|
|
56
|
+
export declare const surfaceVariantSeparator = "--";
|
|
57
|
+
export declare const surfaceVariant: (id: string) => string;
|
|
42
58
|
export declare const DeckState: S.mutable<S.Struct<{
|
|
43
59
|
sidebarState: S.Literal<["closed", "collapsed", "expanded"]>;
|
|
44
60
|
complementarySidebarState: S.Literal<["closed", "collapsed", "expanded"]>;
|
|
@@ -59,28 +75,28 @@ export declare const DeckState: S.mutable<S.Struct<{
|
|
|
59
75
|
popoverAnchorId: S.optional<typeof S.String>;
|
|
60
76
|
toasts: S.mutable<S.Array$<S.Struct<{
|
|
61
77
|
id: S.SchemaClass<string, string, never>;
|
|
62
|
-
title: S.optional<S.Union<[typeof S.String, S.mutable<S.
|
|
78
|
+
title: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
63
79
|
ns: typeof S.String;
|
|
64
80
|
count: S.optional<typeof S.Number>;
|
|
65
|
-
}
|
|
66
|
-
description: S.optional<S.Union<[typeof S.String, S.mutable<S.
|
|
81
|
+
}>>>>]>>;
|
|
82
|
+
description: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
67
83
|
ns: typeof S.String;
|
|
68
84
|
count: S.optional<typeof S.Number>;
|
|
69
|
-
}
|
|
85
|
+
}>>>>]>>;
|
|
70
86
|
icon: S.optional<S.SchemaClass<string, string, never>>;
|
|
71
87
|
duration: S.optional<S.SchemaClass<number, number, never>>;
|
|
72
|
-
closeLabel: S.optional<S.Union<[typeof S.String, S.mutable<S.
|
|
88
|
+
closeLabel: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
73
89
|
ns: typeof S.String;
|
|
74
90
|
count: S.optional<typeof S.Number>;
|
|
75
|
-
}
|
|
76
|
-
actionLabel: S.optional<S.Union<[typeof S.String, S.mutable<S.
|
|
91
|
+
}>>>>]>>;
|
|
92
|
+
actionLabel: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
77
93
|
ns: typeof S.String;
|
|
78
94
|
count: S.optional<typeof S.Number>;
|
|
79
|
-
}
|
|
80
|
-
actionAlt: S.optional<S.Union<[typeof S.String, S.mutable<S.
|
|
95
|
+
}>>>>]>>;
|
|
96
|
+
actionAlt: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple2<typeof S.String, S.mutable<S.Struct<{
|
|
81
97
|
ns: typeof S.String;
|
|
82
98
|
count: S.optional<typeof S.Number>;
|
|
83
|
-
}
|
|
99
|
+
}>>>>]>>;
|
|
84
100
|
onAction: S.optional<S.SchemaClass<any, any, never>>;
|
|
85
101
|
}>>>;
|
|
86
102
|
currentUndoId: S.optional<typeof S.String>;
|
|
@@ -89,19 +105,23 @@ export declare const DeckState: S.mutable<S.Struct<{
|
|
|
89
105
|
decks: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
90
106
|
initialized: S.SchemaClass<boolean, boolean, never>;
|
|
91
107
|
active: S.mutable<S.Array$<typeof S.String>>;
|
|
108
|
+
activeCompanions: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.String>>>;
|
|
92
109
|
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
93
110
|
solo: S.optional<typeof S.String>;
|
|
94
111
|
fullscreen: typeof S.Boolean;
|
|
95
112
|
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
113
|
+
companionFrameSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
96
114
|
}>>>>;
|
|
97
115
|
previousMode: S.mutable<S.Record$<typeof S.String, S.Union<[S.Literal<["deck"]>, S.Literal<["solo"]>, S.Literal<["fullscreen"]>]>>>;
|
|
98
116
|
deck: S.mutable<S.Struct<{
|
|
99
117
|
initialized: S.SchemaClass<boolean, boolean, never>;
|
|
100
118
|
active: S.mutable<S.Array$<typeof S.String>>;
|
|
119
|
+
activeCompanions: S.optional<S.mutable<S.Record$<typeof S.String, typeof S.String>>>;
|
|
101
120
|
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
102
121
|
solo: S.optional<typeof S.String>;
|
|
103
122
|
fullscreen: typeof S.Boolean;
|
|
104
123
|
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
124
|
+
companionFrameSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
105
125
|
}>>;
|
|
106
126
|
/**
|
|
107
127
|
* The identifier of a component to scroll into view when it is mounted.
|
|
@@ -145,6 +165,17 @@ export declare namespace DeckAction {
|
|
|
145
165
|
}>;
|
|
146
166
|
export class UpdatePlankSize extends UpdatePlankSize_base {
|
|
147
167
|
}
|
|
168
|
+
const ChangeCompanion_base: S.TaggedClass<ChangeCompanion, `${string}/change-companion`, {
|
|
169
|
+
readonly _tag: S.tag<`${string}/change-companion`>;
|
|
170
|
+
} & {
|
|
171
|
+
input: S.Struct<{
|
|
172
|
+
primary: typeof S.String;
|
|
173
|
+
companion: S.Union<[typeof S.String, typeof S.Null]>;
|
|
174
|
+
}>;
|
|
175
|
+
output: typeof S.Void;
|
|
176
|
+
}>;
|
|
177
|
+
export class ChangeCompanion extends ChangeCompanion_base {
|
|
178
|
+
}
|
|
148
179
|
export {};
|
|
149
180
|
}
|
|
150
181
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAK3C,eAAO,MAAM,iBAAiB,2BAA4B,CAAC;AAC3D,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE,eAAO,MAAM,iBAAiB,gCAAiC,CAAC;AAChE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EA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C,OAAO,SAAS,CAAC,CAAC;AAExD,eAAO,MAAM,OAAO,SAAU,IAAI,KAAG,UAMpC,CAAC;AAGF,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,eAAO,MAAM,WAAW,QAA0B,CAAC;AAEnD,yBAAiB,UAAU,CAAC;IAC1B,MAAM,oBAAoB,oHAKzB,CAAC;IACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,oBAAoB,CAAC,CAAC;IACxE,MAAM,CAAC,MAAM,UAAU;;;OAAoE,CAAC;IAC5F,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;;;;;;;;;;IAE1D;;OAEG;IACH,MAAM,OAAO,MAAO,SAAQ,WAG1B;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAMnC;KAAG;;;;;;;;;;IAEL,MAAM,OAAO,eAAgB,SAAQ,oBAMnC;KAAG;;CACN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-deck",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-main.81238a8",
|
|
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",
|
|
@@ -31,33 +31,33 @@
|
|
|
31
31
|
"src"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@fluentui/react-tabster": "9.
|
|
34
|
+
"@fluentui/react-tabster": "^9.24.2",
|
|
35
35
|
"@preact/signals-core": "^1.6.0",
|
|
36
|
-
"effect": "
|
|
36
|
+
"effect": "3.13.3",
|
|
37
37
|
"immer": "^10.1.1",
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/debug": "0.8.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/echo-schema": "0.8.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/keyboard": "0.8.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-attention": "0.8.
|
|
50
|
-
"@dxos/plugin-
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/plugin-
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/react-ui-
|
|
56
|
-
"@dxos/react-
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/react-ui-tabs": "0.8.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
38
|
+
"@dxos/artifact": "0.8.1-main.81238a8",
|
|
39
|
+
"@dxos/async": "0.8.1-main.81238a8",
|
|
40
|
+
"@dxos/debug": "0.8.1-main.81238a8",
|
|
41
|
+
"@dxos/app-framework": "0.8.1-main.81238a8",
|
|
42
|
+
"@dxos/echo-schema": "0.8.1-main.81238a8",
|
|
43
|
+
"@dxos/echo-signals": "0.8.1-main.81238a8",
|
|
44
|
+
"@dxos/keyboard": "0.8.1-main.81238a8",
|
|
45
|
+
"@dxos/invariant": "0.8.1-main.81238a8",
|
|
46
|
+
"@dxos/live-object": "0.8.1-main.81238a8",
|
|
47
|
+
"@dxos/local-storage": "0.8.1-main.81238a8",
|
|
48
|
+
"@dxos/log": "0.8.1-main.81238a8",
|
|
49
|
+
"@dxos/plugin-attention": "0.8.1-main.81238a8",
|
|
50
|
+
"@dxos/plugin-graph": "0.8.1-main.81238a8",
|
|
51
|
+
"@dxos/plugin-client": "0.8.1-main.81238a8",
|
|
52
|
+
"@dxos/plugin-theme": "0.8.1-main.81238a8",
|
|
53
|
+
"@dxos/react-ui-attention": "0.8.1-main.81238a8",
|
|
54
|
+
"@dxos/plugin-observability": "0.8.1-main.81238a8",
|
|
55
|
+
"@dxos/react-ui-form": "0.8.1-main.81238a8",
|
|
56
|
+
"@dxos/react-client": "0.8.1-main.81238a8",
|
|
57
|
+
"@dxos/react-ui-stack": "0.8.1-main.81238a8",
|
|
58
|
+
"@dxos/react-ui-tabs": "0.8.1-main.81238a8",
|
|
59
|
+
"@dxos/util": "0.8.1-main.81238a8",
|
|
60
|
+
"@dxos/react-ui-text-tooltip": "0.8.1-main.81238a8"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -66,16 +66,16 @@
|
|
|
66
66
|
"react": "~18.2.0",
|
|
67
67
|
"react-dom": "~18.2.0",
|
|
68
68
|
"vite": "5.4.7",
|
|
69
|
-
"@dxos/react-ui": "0.8.
|
|
70
|
-
"@dxos/react-ui-theme": "0.8.
|
|
71
|
-
"@dxos/storybook-utils": "0.8.
|
|
69
|
+
"@dxos/react-ui": "0.8.1-main.81238a8",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.1-main.81238a8",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.1-main.81238a8"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
74
|
"@phosphor-icons/react": "^2.0.5",
|
|
75
75
|
"react": "~18.2.0",
|
|
76
76
|
"react-dom": "~18.2.0",
|
|
77
|
-
"@dxos/react-ui": "0.8.
|
|
78
|
-
"@dxos/react-ui-theme": "0.8.
|
|
77
|
+
"@dxos/react-ui": "0.8.1-main.81238a8",
|
|
78
|
+
"@dxos/react-ui-theme": "0.8.1-main.81238a8"
|
|
79
79
|
},
|
|
80
80
|
"publishConfig": {
|
|
81
81
|
"access": "public"
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
chain,
|
|
17
17
|
} from '@dxos/app-framework';
|
|
18
18
|
import { getTypename, S } from '@dxos/echo-schema';
|
|
19
|
+
import { invariant } from '@dxos/invariant';
|
|
19
20
|
import { isReactiveObject } from '@dxos/live-object';
|
|
20
21
|
import { log } from '@dxos/log';
|
|
21
22
|
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
@@ -25,7 +26,7 @@ import { isNonNullable } from '@dxos/util';
|
|
|
25
26
|
import { DeckCapabilities } from './capabilities';
|
|
26
27
|
import { closeEntry, incrementPlank, openEntry } from '../layout';
|
|
27
28
|
import { DECK_PLUGIN } from '../meta';
|
|
28
|
-
import { DeckAction, type LayoutMode, type DeckSettingsProps, isLayoutMode, getMode } from '../types';
|
|
29
|
+
import { DeckAction, type LayoutMode, type DeckSettingsProps, isLayoutMode, getMode, defaultDeck } from '../types';
|
|
29
30
|
import { setActive } from '../util';
|
|
30
31
|
|
|
31
32
|
export default (context: PluginsContext) =>
|
|
@@ -201,7 +202,7 @@ export default (context: PluginsContext) =>
|
|
|
201
202
|
}
|
|
202
203
|
state.activeDeck = subject;
|
|
203
204
|
if (!state.decks[subject]) {
|
|
204
|
-
state.decks[subject] = {
|
|
205
|
+
state.decks[subject] = { ...defaultDeck };
|
|
205
206
|
}
|
|
206
207
|
});
|
|
207
208
|
|
|
@@ -287,8 +288,16 @@ export default (context: PluginsContext) =>
|
|
|
287
288
|
const active = state.deck.solo ? [state.deck.solo] : state.deck.active;
|
|
288
289
|
const next = subject.reduce((acc, id) => closeEntry(acc, id), active);
|
|
289
290
|
const toAttend = setActive({ next, state, attention });
|
|
291
|
+
|
|
292
|
+
const clearCompanionIntents = subject
|
|
293
|
+
.filter((id) => state.deck.activeCompanions && id in state.deck.activeCompanions)
|
|
294
|
+
.map((primary) => createIntent(DeckAction.ChangeCompanion, { primary, companion: null }));
|
|
295
|
+
|
|
290
296
|
return {
|
|
291
|
-
intents:
|
|
297
|
+
intents: [
|
|
298
|
+
...clearCompanionIntents,
|
|
299
|
+
...(toAttend ? [createIntent(LayoutAction.ScrollIntoView, { part: 'current', subject: toAttend })] : []),
|
|
300
|
+
],
|
|
292
301
|
};
|
|
293
302
|
},
|
|
294
303
|
}),
|
|
@@ -321,6 +330,23 @@ export default (context: PluginsContext) =>
|
|
|
321
330
|
state.deck.plankSizing[data.id] = data.size;
|
|
322
331
|
},
|
|
323
332
|
}),
|
|
333
|
+
createResolver({
|
|
334
|
+
intent: DeckAction.ChangeCompanion,
|
|
335
|
+
resolve: (data) => {
|
|
336
|
+
const state = context.requestCapability(DeckCapabilities.MutableDeckState);
|
|
337
|
+
// TODO(thure): Reactivity only works when creating a lexically new `activeCompanions`… Are these not proxy objects?
|
|
338
|
+
if (data.companion === null) {
|
|
339
|
+
const { [data.primary]: _, ...nextActiveCompanions } = state.deck.activeCompanions ?? {};
|
|
340
|
+
state.deck.activeCompanions = nextActiveCompanions;
|
|
341
|
+
} else {
|
|
342
|
+
invariant(data.companion !== data.primary);
|
|
343
|
+
state.deck.activeCompanions = {
|
|
344
|
+
...state.deck.activeCompanions,
|
|
345
|
+
[data.primary]: data.companion,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
}),
|
|
324
350
|
createResolver({
|
|
325
351
|
intent: DeckAction.Adjust,
|
|
326
352
|
resolve: (adjustment) => {
|
|
@@ -10,7 +10,7 @@ import { type SidebarState } from '@dxos/react-ui';
|
|
|
10
10
|
|
|
11
11
|
import { DeckCapabilities } from './capabilities';
|
|
12
12
|
import { DECK_PLUGIN } from '../meta';
|
|
13
|
-
import { getMode, type Deck, type DeckState } from '../types';
|
|
13
|
+
import { getMode, type Deck, type DeckState, defaultDeck } from '../types';
|
|
14
14
|
|
|
15
15
|
const boolean = /true|false/;
|
|
16
16
|
|
|
@@ -48,14 +48,7 @@ export default () => {
|
|
|
48
48
|
activeDeck: 'default',
|
|
49
49
|
previousDeck: 'default',
|
|
50
50
|
decks: {
|
|
51
|
-
default: {
|
|
52
|
-
initialized: false,
|
|
53
|
-
active: [],
|
|
54
|
-
inactive: [],
|
|
55
|
-
fullscreen: false,
|
|
56
|
-
solo: undefined,
|
|
57
|
-
plankSizing: {},
|
|
58
|
-
},
|
|
51
|
+
default: { ...defaultDeck },
|
|
59
52
|
},
|
|
60
53
|
get deck() {
|
|
61
54
|
const deck = this.decks[this.activeDeck];
|
|
@@ -14,12 +14,14 @@ import { S } from '@dxos/echo-schema';
|
|
|
14
14
|
import { invariant } from '@dxos/invariant';
|
|
15
15
|
|
|
16
16
|
import { meta } from '../meta';
|
|
17
|
+
import { DeckAction } from '../types';
|
|
17
18
|
|
|
18
19
|
// TODO(burdon): Factor out.
|
|
19
20
|
declare global {
|
|
20
21
|
interface ToolContextExtensions {
|
|
21
22
|
dispatch?: PromiseIntentDispatcher;
|
|
22
23
|
pivotId?: string;
|
|
24
|
+
part?: 'deck' | 'dialog';
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
|
|
@@ -27,10 +29,9 @@ export default () =>
|
|
|
27
29
|
contributes(Capabilities.Tools, [
|
|
28
30
|
defineTool(meta.id, {
|
|
29
31
|
name: 'show',
|
|
30
|
-
// TODO(ZaymonFC): We should update the prompt to teach the LLM the difference between object ids and fully qualified ids.
|
|
31
32
|
description: `
|
|
32
|
-
Show an item
|
|
33
|
-
When supplying IDs
|
|
33
|
+
Show an item as a companion to an existing plank. This will make the item appear alongside the primary content.
|
|
34
|
+
When supplying IDs, they must be fully qualified like space:object.
|
|
34
35
|
`,
|
|
35
36
|
caption: 'Showing item...',
|
|
36
37
|
// TODO(wittjosiah): Refactor Layout/Navigation/Deck actions so that they can be used directly.
|
|
@@ -38,29 +39,40 @@ export default () =>
|
|
|
38
39
|
id: S.String.annotations({
|
|
39
40
|
description: 'The ID of the item to show.',
|
|
40
41
|
}),
|
|
41
|
-
pivotId: S.optional(
|
|
42
|
-
S.String.annotations({
|
|
43
|
-
description: 'The ID of the chat. If provided, the item will be added after the pivot item.',
|
|
44
|
-
}),
|
|
45
|
-
),
|
|
46
42
|
}),
|
|
47
43
|
execute: async ({ id }, { extensions }) => {
|
|
44
|
+
invariant(extensions?.pivotId, 'No pivot ID');
|
|
48
45
|
invariant(extensions?.dispatch, 'No intent dispatcher');
|
|
49
|
-
const { data, error } = await extensions.dispatch(
|
|
50
|
-
createIntent(LayoutAction.Open, {
|
|
51
|
-
subject: [id],
|
|
52
|
-
part: 'main',
|
|
53
|
-
options: {
|
|
54
|
-
pivotId: extensions.pivotId,
|
|
55
|
-
positioning: 'end',
|
|
56
|
-
},
|
|
57
|
-
}),
|
|
58
|
-
);
|
|
59
|
-
if (error) {
|
|
60
|
-
return ToolResult.Error(error.message);
|
|
61
|
-
}
|
|
62
46
|
|
|
63
|
-
|
|
47
|
+
if (extensions.part === 'deck') {
|
|
48
|
+
const { data, error } = await extensions.dispatch(
|
|
49
|
+
createIntent(DeckAction.ChangeCompanion, {
|
|
50
|
+
primary: extensions.pivotId,
|
|
51
|
+
companion: id,
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
if (error) {
|
|
55
|
+
return ToolResult.Error(error.message);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return ToolResult.Success(data);
|
|
59
|
+
} else {
|
|
60
|
+
const { data, error } = await extensions.dispatch(
|
|
61
|
+
createIntent(LayoutAction.Open, {
|
|
62
|
+
subject: [id],
|
|
63
|
+
part: 'main',
|
|
64
|
+
options: {
|
|
65
|
+
pivotId: extensions.pivotId,
|
|
66
|
+
positioning: 'end',
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
);
|
|
70
|
+
if (error) {
|
|
71
|
+
return ToolResult.Error(error.message);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return ToolResult.Success(data);
|
|
75
|
+
}
|
|
64
76
|
},
|
|
65
77
|
}),
|
|
66
78
|
]);
|
|
@@ -6,6 +6,7 @@ import { Capabilities, contributes, createIntent, LayoutAction, type PluginsCont
|
|
|
6
6
|
import { scheduledEffect } from '@dxos/echo-signals/core';
|
|
7
7
|
|
|
8
8
|
import { DeckCapabilities } from './capabilities';
|
|
9
|
+
import { defaultDeck } from '../types';
|
|
9
10
|
|
|
10
11
|
// TODO(wittjosiah): Cleanup the url handling. May justify introducing routing capabilities.
|
|
11
12
|
export default async (context: PluginsContext) => {
|
|
@@ -17,14 +18,7 @@ export default async (context: PluginsContext) => {
|
|
|
17
18
|
if (pathname === '/reset') {
|
|
18
19
|
state.activeDeck = 'default';
|
|
19
20
|
state.decks = {
|
|
20
|
-
default: {
|
|
21
|
-
initialized: false,
|
|
22
|
-
active: [],
|
|
23
|
-
inactive: [],
|
|
24
|
-
fullscreen: false,
|
|
25
|
-
solo: undefined,
|
|
26
|
-
plankSizing: {},
|
|
27
|
-
},
|
|
21
|
+
default: { ...defaultDeck },
|
|
28
22
|
};
|
|
29
23
|
window.location.pathname = '/';
|
|
30
24
|
return;
|