@dxos/plugin-deck 0.7.5-main.9d26e3a → 0.7.5-main.e9bb01b
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-CI6ZFMNL.mjs +147 -0
- package/dist/lib/browser/app-graph-builder-CI6ZFMNL.mjs.map +7 -0
- package/dist/lib/browser/check-app-scheme-S3EYUPMF.mjs +33 -0
- package/dist/lib/browser/check-app-scheme-S3EYUPMF.mjs.map +7 -0
- package/dist/lib/browser/chunk-M2L53AIH.mjs +126 -0
- package/dist/lib/browser/chunk-M2L53AIH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GVOGPULO.mjs → chunk-N7TEPFVR.mjs} +5 -4
- package/dist/lib/browser/chunk-N7TEPFVR.mjs.map +7 -0
- package/dist/lib/browser/chunk-NYZJCVAU.mjs +22 -0
- package/dist/lib/browser/chunk-NYZJCVAU.mjs.map +7 -0
- package/dist/lib/browser/chunk-WXNLVMK2.mjs +1119 -0
- package/dist/lib/browser/chunk-WXNLVMK2.mjs.map +7 -0
- package/dist/lib/browser/chunk-YQ2GWTDU.mjs +17 -0
- package/dist/lib/browser/chunk-YQ2GWTDU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +90 -1775
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs +494 -0
- package/dist/lib/browser/intent-resolver-CSXFDKTC.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-root-ECDQZYQT.mjs +46 -0
- package/dist/lib/browser/react-root-ECDQZYQT.mjs.map +7 -0
- package/dist/lib/browser/react-surface-4WIQZW2S.mjs +38 -0
- package/dist/lib/browser/react-surface-4WIQZW2S.mjs.map +7 -0
- package/dist/lib/browser/settings-WACNLCPB.mjs +28 -0
- package/dist/lib/browser/settings-WACNLCPB.mjs.map +7 -0
- package/dist/lib/browser/state-VPOYUKK6.mjs +117 -0
- package/dist/lib/browser/state-VPOYUKK6.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +16 -4
- package/dist/lib/browser/url-handler-HLF42IHP.mjs +70 -0
- package/dist/lib/browser/url-handler-HLF42IHP.mjs.map +7 -0
- package/dist/types/src/DeckPlugin.d.ts +1 -5
- package/dist/types/src/DeckPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +142 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts +4 -0
- package/dist/types/src/capabilities/check-app-scheme.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +189 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-root.d.ts +7 -0
- package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/set-active.d.ts +9 -0
- package/dist/types/src/capabilities/set-active.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/state.d.ts +76 -0
- package/dist/types/src/capabilities/state.d.ts.map +1 -0
- package/dist/types/src/capabilities/url-handler.d.ts +4 -0
- package/dist/types/src/capabilities/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 +6 -0
- package/dist/types/src/components/DeckLayout/Banner.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/ComplementarySidebar.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 +1 -4
- package/dist/types/src/components/DeckLayout/DeckLayout.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Fullscreen.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts +3 -3
- package/dist/types/src/components/DeckLayout/NodePlankHeading.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Plank.d.ts +8 -6
- package/dist/types/src/components/DeckLayout/Plank.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts +2 -2
- package/dist/types/src/components/DeckLayout/PlankControls.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/PlankError.d.ts +4 -3
- package/dist/types/src/components/DeckLayout/PlankError.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts +1 -5
- package/dist/types/src/components/DeckLayout/Sidebar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts +8 -0
- package/dist/types/src/components/DeckLayout/SidebarButton.d.ts.map +1 -0
- package/dist/types/src/components/DeckLayout/StatusBar.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Toast.d.ts +2 -2
- package/dist/types/src/components/DeckLayout/Toast.d.ts.map +1 -1
- package/dist/types/src/components/DeckLayout/Topbar.d.ts +3 -0
- package/dist/types/src/components/DeckLayout/Topbar.d.ts.map +1 -0
- package/dist/types/src/components/fragments.d.ts +4 -0
- package/dist/types/src/components/fragments.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +4 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/hooks/useMainSize.d.ts +2 -2
- package/dist/types/src/index.d.ts +3 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layout.d.ts +5 -19
- package/dist/types/src/layout.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -4
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +117 -20
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +3 -2
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/layoutAppliesTopbar.d.ts +2 -0
- package/dist/types/src/util/layoutAppliesTopbar.d.ts.map +1 -0
- package/dist/types/src/util/useBreakpoints.d.ts +2 -0
- package/dist/types/src/util/useBreakpoints.d.ts.map +1 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts +2 -0
- package/dist/types/src/util/useHoistStatusbar.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -36
- package/src/DeckPlugin.ts +77 -0
- package/src/capabilities/app-graph-builder.ts +109 -0
- package/src/capabilities/capabilities.ts +18 -0
- package/src/capabilities/check-app-scheme.ts +44 -0
- package/src/capabilities/index.ts +16 -0
- package/src/capabilities/intent-resolver.ts +350 -0
- package/src/capabilities/react-root.tsx +48 -0
- package/src/capabilities/react-surface.tsx +31 -0
- package/src/capabilities/set-active.ts +43 -0
- package/src/capabilities/settings.ts +21 -0
- package/src/capabilities/state.ts +102 -0
- package/src/capabilities/url-handler.ts +63 -0
- package/src/components/DeckLayout/ActiveNode.tsx +2 -3
- package/src/components/DeckLayout/Banner.tsx +37 -0
- package/src/components/DeckLayout/ComplementarySidebar.tsx +128 -55
- package/src/components/DeckLayout/ContentEmpty.tsx +9 -4
- package/src/components/DeckLayout/DeckLayout.tsx +113 -76
- package/src/components/DeckLayout/Fullscreen.tsx +2 -3
- package/src/components/DeckLayout/NodePlankHeading.tsx +64 -77
- package/src/components/DeckLayout/Plank.tsx +34 -43
- package/src/components/DeckLayout/PlankControls.tsx +11 -10
- package/src/components/DeckLayout/PlankError.tsx +6 -5
- package/src/components/DeckLayout/Sidebar.tsx +19 -9
- package/src/components/DeckLayout/SidebarButton.tsx +68 -0
- package/src/components/DeckLayout/StatusBar.tsx +6 -12
- package/src/components/DeckLayout/Toast.tsx +2 -2
- package/src/components/DeckLayout/Topbar.tsx +11 -0
- package/src/components/LayoutSettings.tsx +8 -8
- package/src/components/fragments.ts +14 -0
- package/src/components/index.ts +0 -2
- package/src/events.ts +11 -0
- package/src/hooks/useMainSize.ts +3 -3
- package/src/index.ts +3 -4
- package/src/layout.ts +43 -212
- package/src/meta.ts +3 -2
- package/src/translations.ts +8 -6
- package/src/types.ts +95 -34
- package/src/util/index.ts +3 -2
- package/src/util/layoutAppliesTopbar.ts +7 -0
- package/src/util/useBreakpoints.ts +11 -0
- package/src/util/useHoistStatusbar.ts +24 -0
- package/dist/lib/browser/chunk-GVOGPULO.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZC3K6C2W.mjs +0 -37
- package/dist/lib/browser/chunk-ZC3K6C2W.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/components/DeckContext.d.ts +0 -8
- package/dist/types/src/components/DeckContext.d.ts.map +0 -1
- package/dist/types/src/components/LayoutContext.d.ts +0 -5
- package/dist/types/src/components/LayoutContext.d.ts.map +0 -1
- package/dist/types/src/layout.test.d.ts +0 -2
- package/dist/types/src/layout.test.d.ts.map +0 -1
- package/dist/types/src/util/check-app-scheme.d.ts +0 -2
- package/dist/types/src/util/check-app-scheme.d.ts.map +0 -1
- package/dist/types/src/util/layout-parts.d.ts +0 -7
- package/dist/types/src/util/layout-parts.d.ts.map +0 -1
- package/src/DeckPlugin.tsx +0 -623
- package/src/components/DeckContext.ts +0 -14
- package/src/components/LayoutContext.ts +0 -12
- package/src/layout.test.ts +0 -380
- package/src/util/check-app-scheme.ts +0 -21
- package/src/util/layout-parts.ts +0 -12
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Plugin, GraphBuilderProvides, IntentResolverProvides, LayoutProvides, LocationProvides, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
2
1
|
import { S } from '@dxos/echo-schema';
|
|
3
2
|
import { type Label } from '@dxos/react-ui';
|
|
4
3
|
export declare const NewPlankPositions: readonly ["start", "end"];
|
|
@@ -10,26 +9,123 @@ export type Panel = {
|
|
|
10
9
|
label: Label;
|
|
11
10
|
icon: string;
|
|
12
11
|
};
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
export declare const DeckSettingsSchema: S.mutable<S.Struct<{
|
|
13
|
+
showHints: typeof S.Boolean;
|
|
14
|
+
enableNativeRedirect: typeof S.Boolean;
|
|
15
|
+
enableIdeStyleStatusbar: typeof S.Boolean;
|
|
16
|
+
newPlankPositioning: S.Literal<["start", "end"]>;
|
|
17
|
+
overscroll: S.Literal<["none", "centering"]>;
|
|
18
|
+
}>>;
|
|
19
|
+
export type DeckSettingsProps = S.Schema.Type<typeof DeckSettingsSchema>;
|
|
20
|
+
declare const LayoutMode: S.Union<[S.Literal<["deck"]>, S.Literal<["solo"]>, S.Literal<["fullscreen"]>]>;
|
|
21
|
+
export declare const isLayoutMode: (value: any) => value is LayoutMode;
|
|
22
|
+
export type LayoutMode = S.Schema.Type<typeof LayoutMode>;
|
|
23
|
+
export declare const PlankSizing: S.Record$<typeof S.String, typeof S.Number>;
|
|
24
|
+
export type PlankSizing = S.Schema.Type<typeof PlankSizing>;
|
|
25
|
+
export declare const Deck: S.Struct<{
|
|
26
|
+
initialized: S.SchemaClass<boolean, boolean, never>;
|
|
27
|
+
active: S.mutable<S.Array$<typeof S.String>>;
|
|
28
|
+
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
29
|
+
solo: S.optional<typeof S.String>;
|
|
30
|
+
fullscreen: typeof S.Boolean;
|
|
31
|
+
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
32
|
+
}>;
|
|
33
|
+
export type Deck = S.Schema.Type<typeof Deck>;
|
|
34
|
+
export declare const DeckState: S.mutable<S.Struct<{
|
|
35
|
+
sidebarState: S.Literal<["closed", "collapsed", "expanded"]>;
|
|
36
|
+
complementarySidebarState: S.Literal<["closed", "collapsed", "expanded"]>;
|
|
37
|
+
complementarySidebarPanel: S.optional<typeof S.String>;
|
|
38
|
+
dialogOpen: typeof S.Boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Data to be passed to the dialog Surface.
|
|
41
|
+
*/
|
|
42
|
+
dialogContent: S.optional<typeof S.Any>;
|
|
43
|
+
dialogBlockAlign: S.optional<S.Literal<["start", "center"]>>;
|
|
44
|
+
dialogType: S.optional<S.Literal<["default", "alert"]>>;
|
|
45
|
+
popoverOpen: typeof S.Boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Data to be passed to the popover Surface.
|
|
48
|
+
*/
|
|
49
|
+
popoverContent: S.optional<typeof S.Any>;
|
|
50
|
+
popoverAnchorId: S.optional<typeof S.String>;
|
|
51
|
+
toasts: S.mutable<S.Array$<S.Struct<{
|
|
52
|
+
id: S.SchemaClass<string, string, never>;
|
|
53
|
+
title: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
|
|
54
|
+
ns: typeof S.String;
|
|
55
|
+
count: S.optional<typeof S.Number>;
|
|
56
|
+
}>>]>>]>>;
|
|
57
|
+
description: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
|
|
58
|
+
ns: typeof S.String;
|
|
59
|
+
count: S.optional<typeof S.Number>;
|
|
60
|
+
}>>]>>]>>;
|
|
61
|
+
icon: S.optional<S.SchemaClass<string, string, never>>;
|
|
62
|
+
duration: S.optional<S.SchemaClass<number, number, never>>;
|
|
63
|
+
closeLabel: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
|
|
64
|
+
ns: typeof S.String;
|
|
65
|
+
count: S.optional<typeof S.Number>;
|
|
66
|
+
}>>]>>]>>;
|
|
67
|
+
actionLabel: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
|
|
68
|
+
ns: typeof S.String;
|
|
69
|
+
count: S.optional<typeof S.Number>;
|
|
70
|
+
}>>]>>]>>;
|
|
71
|
+
actionAlt: S.optional<S.Union<[typeof S.String, S.mutable<S.Tuple<[typeof S.String, S.mutable<S.Struct<{
|
|
72
|
+
ns: typeof S.String;
|
|
73
|
+
count: S.optional<typeof S.Number>;
|
|
74
|
+
}>>]>>]>>;
|
|
75
|
+
onAction: S.optional<S.SchemaClass<any, any, never>>;
|
|
76
|
+
}>>>;
|
|
77
|
+
currentUndoId: S.optional<typeof S.String>;
|
|
78
|
+
activeDeck: typeof S.String;
|
|
79
|
+
decks: S.mutable<S.Record$<typeof S.String, S.mutable<S.Struct<{
|
|
80
|
+
initialized: S.SchemaClass<boolean, boolean, never>;
|
|
81
|
+
active: S.mutable<S.Array$<typeof S.String>>;
|
|
82
|
+
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
83
|
+
solo: S.optional<typeof S.String>;
|
|
84
|
+
fullscreen: typeof S.Boolean;
|
|
85
|
+
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
86
|
+
}>>>>;
|
|
87
|
+
previousMode: S.mutable<S.Record$<typeof S.String, S.Union<[S.Literal<["deck"]>, S.Literal<["solo"]>, S.Literal<["fullscreen"]>]>>>;
|
|
88
|
+
deck: S.mutable<S.Struct<{
|
|
89
|
+
initialized: S.SchemaClass<boolean, boolean, never>;
|
|
90
|
+
active: S.mutable<S.Array$<typeof S.String>>;
|
|
91
|
+
inactive: S.mutable<S.Array$<typeof S.String>>;
|
|
92
|
+
solo: S.optional<typeof S.String>;
|
|
93
|
+
fullscreen: typeof S.Boolean;
|
|
94
|
+
plankSizing: S.mutable<S.Record$<typeof S.String, typeof S.Number>>;
|
|
95
|
+
}>>;
|
|
96
|
+
/**
|
|
97
|
+
* The identifier of a component to scroll into view when it is mounted.
|
|
98
|
+
*/
|
|
99
|
+
scrollIntoView: S.optional<typeof S.String>;
|
|
100
|
+
}>>;
|
|
101
|
+
export type DeckState = S.Schema.Type<typeof DeckState>;
|
|
102
|
+
export declare const getMode: (deck: Deck) => LayoutMode;
|
|
103
|
+
export declare const SLUG_PATH_SEPARATOR = "~";
|
|
104
|
+
export declare const DECK_ACTION: string;
|
|
30
105
|
export declare namespace DeckAction {
|
|
31
|
-
const
|
|
32
|
-
|
|
106
|
+
const PartAdjustmentSchema: S.Union<[S.Literal<["close"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
107
|
+
export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;
|
|
108
|
+
export const Adjustment: S.mutable<S.Struct<{
|
|
109
|
+
id: typeof S.String;
|
|
110
|
+
type: S.Union<[S.Literal<["close"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
111
|
+
}>>;
|
|
112
|
+
export type Adjustment = S.Schema.Type<typeof Adjustment>;
|
|
113
|
+
const Adjust_base: S.TaggedClass<Adjust, `${string}/adjust`, {
|
|
114
|
+
readonly _tag: S.tag<`${string}/adjust`>;
|
|
115
|
+
} & {
|
|
116
|
+
input: S.mutable<S.Struct<{
|
|
117
|
+
id: typeof S.String;
|
|
118
|
+
type: S.Union<[S.Literal<["close"]>, S.Literal<["solo"]>, S.Literal<["increment-start"]>, S.Literal<["increment-end"]>]>;
|
|
119
|
+
}>>;
|
|
120
|
+
output: typeof S.Void;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* An atomic transaction to apply to the deck, describing which element to move to which location.
|
|
124
|
+
*/
|
|
125
|
+
export class Adjust extends Adjust_base {
|
|
126
|
+
}
|
|
127
|
+
const UpdatePlankSize_base: S.TaggedClass<UpdatePlankSize, `${string}/update-plank-size`, {
|
|
128
|
+
readonly _tag: S.tag<`${string}/update-plank-size`>;
|
|
33
129
|
} & {
|
|
34
130
|
input: S.Struct<{
|
|
35
131
|
id: typeof S.String;
|
|
@@ -41,4 +137,5 @@ export declare namespace DeckAction {
|
|
|
41
137
|
}
|
|
42
138
|
export {};
|
|
43
139
|
}
|
|
140
|
+
export {};
|
|
44
141
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"
|
|
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,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAK5C,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;AAG5D,MAAM,MAAM,KAAK,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/D,eAAO,MAAM,kBAAkB;;;;;;GAQ9B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEzE,QAAA,MAAM,UAAU,gFAAyE,CAAC;AAC1F,eAAO,MAAM,YAAY,UAAW,GAAG,KAAG,KAAK,IAAI,UAAqC,CAAC;AACzF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE1D,eAAO,MAAM,WAAW,6CAA+C,CAAC;AACxE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,WAAW,CAAC,CAAC;AAE5D,eAAO,MAAM,IAAI;;;;;;;EASf,CAAC;AACH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;AAE9C,eAAO,MAAM,SAAS;;;;;IAOlB;;OAEG;;;;;IAMH;;OAEG;;;;YAqD2B,EAAG,WAAW;eAAuC,EAAG,QAAQ,CAAC,EAAE,KAAK,SACtG,EAAG,MAAM,EAAC,EAAG,OACf,CAAI,EAAA,KAAI,SAAQ,EACZ,MAAC,EAAC,EAAI,OAAM,CAAC,EACf,MAAC;uBAEH,EAAG,MAEJ;mBAAoB,EAAG,QAAQ,QAAO,EAAG,MAAM;;qBAA0C,EAAG,QAAQ,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,MAAM;uBAAyB,EAAG,MAAM;mBAAoB,EAAG,QAAQ,QAAO,EAAG,MAAM;;cAAmC,EAAG,QAAQ,CAAC,EAAE,WAAW;kBAA2C,EAAG,QAAQ,CAAC,EAAE,WAAW;oBAA6C,EAAG,QAAQ,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,MAAM;uBAAyB,EAAG,MAAM;mBAAoB,EAAG,QAAQ,QAAO,EAAG,MAAM;;qBAA0C,EAAG,QAAQ,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,MAAM;uBAAyB,EAAG,MAAM;mBAAoB,EAAG,QAAQ,QAAO,EAAG,MAAM;;mBAAwC,EAAG,QAAQ,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,KAAK,SAAQ,EAAG,MAAM,EAAC,EAAG,OAAO,CAAC,EAAE,MAAM;uBAAyB,EAAG,MAAM;mBAAoB,EAAG,QAAQ,QAAO,EAAG,MAAM;;kBAAuC,EAAG,QAAQ,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;IAjDzkC;;OAEG;;GAGN,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,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;;CACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layoutAppliesTopbar.d.ts","sourceRoot":"","sources":["../../../../src/util/layoutAppliesTopbar.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,eAAgB,MAAM,YAErD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoints.d.ts","sourceRoot":"","sources":["../../../../src/util/useBreakpoints.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,uCAI1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHoistStatusbar.d.ts","sourceRoot":"","sources":["../../../../src/util/useHoistStatusbar.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,iBAAiB,eAAgB,MAAM,YAYnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.7.
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-deck",
|
|
3
|
-
"version": "0.7.5-main.
|
|
3
|
+
"version": "0.7.5-main.e9bb01b",
|
|
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",
|
|
@@ -12,10 +12,6 @@
|
|
|
12
12
|
"types": "./dist/types/src/index.d.ts",
|
|
13
13
|
"browser": "./dist/lib/browser/index.mjs"
|
|
14
14
|
},
|
|
15
|
-
"./meta": {
|
|
16
|
-
"types": "./dist/types/src/meta.d.ts",
|
|
17
|
-
"browser": "./dist/lib/browser/meta.mjs"
|
|
18
|
-
},
|
|
19
15
|
"./types": {
|
|
20
16
|
"types": "./dist/types/src/types.d.ts",
|
|
21
17
|
"browser": "./dist/lib/browser/types.mjs"
|
|
@@ -24,9 +20,6 @@
|
|
|
24
20
|
"types": "dist/types/src/index.d.ts",
|
|
25
21
|
"typesVersions": {
|
|
26
22
|
"*": {
|
|
27
|
-
"meta": [
|
|
28
|
-
"dist/types/src/meta.d.ts"
|
|
29
|
-
],
|
|
30
23
|
"types": [
|
|
31
24
|
"dist/types/src/types.d.ts"
|
|
32
25
|
]
|
|
@@ -37,32 +30,33 @@
|
|
|
37
30
|
"src"
|
|
38
31
|
],
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@fluentui/react-tabster": "
|
|
33
|
+
"@fluentui/react-tabster": "9.23.3",
|
|
41
34
|
"@preact/signals-core": "^1.6.0",
|
|
42
35
|
"effect": "^3.12.1",
|
|
43
36
|
"immer": "^10.1.1",
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/echo-schema": "0.7.5-main.
|
|
48
|
-
"@dxos/echo-signals": "0.7.5-main.
|
|
49
|
-
"@dxos/invariant": "0.7.5-main.
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/local-storage": "0.7.5-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/plugin-
|
|
55
|
-
"@dxos/plugin-
|
|
56
|
-
"@dxos/plugin-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/react-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/react-ui-
|
|
62
|
-
"@dxos/react-ui-
|
|
63
|
-
"@dxos/react-ui-
|
|
64
|
-
"@dxos/react-ui-
|
|
65
|
-
"@dxos/
|
|
37
|
+
"@dxos/app-framework": "0.7.5-main.e9bb01b",
|
|
38
|
+
"@dxos/debug": "0.7.5-main.e9bb01b",
|
|
39
|
+
"@dxos/async": "0.7.5-main.e9bb01b",
|
|
40
|
+
"@dxos/echo-schema": "0.7.5-main.e9bb01b",
|
|
41
|
+
"@dxos/echo-signals": "0.7.5-main.e9bb01b",
|
|
42
|
+
"@dxos/invariant": "0.7.5-main.e9bb01b",
|
|
43
|
+
"@dxos/keyboard": "0.7.5-main.e9bb01b",
|
|
44
|
+
"@dxos/live-object": "0.7.5-main.e9bb01b",
|
|
45
|
+
"@dxos/local-storage": "0.7.5-main.e9bb01b",
|
|
46
|
+
"@dxos/plugin-attention": "0.7.5-main.e9bb01b",
|
|
47
|
+
"@dxos/plugin-client": "0.7.5-main.e9bb01b",
|
|
48
|
+
"@dxos/plugin-graph": "0.7.5-main.e9bb01b",
|
|
49
|
+
"@dxos/plugin-observability": "0.7.5-main.e9bb01b",
|
|
50
|
+
"@dxos/log": "0.7.5-main.e9bb01b",
|
|
51
|
+
"@dxos/plugin-theme": "0.7.5-main.e9bb01b",
|
|
52
|
+
"@dxos/react-client": "0.7.5-main.e9bb01b",
|
|
53
|
+
"@dxos/react-ui-attention": "0.7.5-main.e9bb01b",
|
|
54
|
+
"@dxos/react-ui-form": "0.7.5-main.e9bb01b",
|
|
55
|
+
"@dxos/react-ui-mosaic": "0.7.5-main.e9bb01b",
|
|
56
|
+
"@dxos/react-ui-stack": "0.7.5-main.e9bb01b",
|
|
57
|
+
"@dxos/react-ui-tabs": "0.7.5-main.e9bb01b",
|
|
58
|
+
"@dxos/react-ui-text-tooltip": "0.7.5-main.e9bb01b",
|
|
59
|
+
"@dxos/util": "0.7.5-main.e9bb01b"
|
|
66
60
|
},
|
|
67
61
|
"devDependencies": {
|
|
68
62
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -71,16 +65,16 @@
|
|
|
71
65
|
"react": "~18.2.0",
|
|
72
66
|
"react-dom": "~18.2.0",
|
|
73
67
|
"vite": "5.4.7",
|
|
74
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
68
|
+
"@dxos/react-ui": "0.7.5-main.e9bb01b",
|
|
69
|
+
"@dxos/react-ui-theme": "0.7.5-main.e9bb01b",
|
|
70
|
+
"@dxos/storybook-utils": "0.7.5-main.e9bb01b"
|
|
77
71
|
},
|
|
78
72
|
"peerDependencies": {
|
|
79
73
|
"@phosphor-icons/react": "^2.0.5",
|
|
80
74
|
"react": "~18.2.0",
|
|
81
75
|
"react-dom": "~18.2.0",
|
|
82
|
-
"@dxos/react-ui": "0.7.5-main.
|
|
83
|
-
"@dxos/react-ui
|
|
76
|
+
"@dxos/react-ui-theme": "0.7.5-main.e9bb01b",
|
|
77
|
+
"@dxos/react-ui": "0.7.5-main.e9bb01b"
|
|
84
78
|
},
|
|
85
79
|
"publishConfig": {
|
|
86
80
|
"access": "public"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { setAutoFreeze } from 'immer';
|
|
6
|
+
|
|
7
|
+
import { allOf, Capabilities, contributes, defineModule, definePlugin, Events, oneOf } from '@dxos/app-framework';
|
|
8
|
+
import { translations as stackTranslations } from '@dxos/react-ui-stack';
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
AppGraphBuilder,
|
|
12
|
+
CheckAppScheme,
|
|
13
|
+
DeckState,
|
|
14
|
+
LayoutIntentResolver,
|
|
15
|
+
ReactRoot,
|
|
16
|
+
DeckSettings,
|
|
17
|
+
ReactSurface,
|
|
18
|
+
UrlHandler,
|
|
19
|
+
} from './capabilities';
|
|
20
|
+
import { DeckEvents } from './events';
|
|
21
|
+
import { meta } from './meta';
|
|
22
|
+
import translations from './translations';
|
|
23
|
+
|
|
24
|
+
// NOTE(Zan): When producing values with immer, we shouldn't auto-freeze them because
|
|
25
|
+
// our signal implementation needs to add some hidden properties to the produced values.
|
|
26
|
+
// TODO(Zan): Move this to a more global location if we use immer more broadly.
|
|
27
|
+
setAutoFreeze(false);
|
|
28
|
+
|
|
29
|
+
export const DeckPlugin = () =>
|
|
30
|
+
definePlugin(meta, [
|
|
31
|
+
defineModule({
|
|
32
|
+
id: `${meta.id}/module/check-app-scheme`,
|
|
33
|
+
activatesOn: Events.SettingsReady,
|
|
34
|
+
activate: CheckAppScheme,
|
|
35
|
+
}),
|
|
36
|
+
defineModule({
|
|
37
|
+
id: `${meta.id}/module/settings`,
|
|
38
|
+
activatesOn: Events.SetupSettings,
|
|
39
|
+
activate: DeckSettings,
|
|
40
|
+
}),
|
|
41
|
+
defineModule({
|
|
42
|
+
id: `${meta.id}/module/layout`,
|
|
43
|
+
activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
|
|
44
|
+
activatesAfter: [Events.LayoutReady, DeckEvents.StateReady],
|
|
45
|
+
activate: DeckState,
|
|
46
|
+
}),
|
|
47
|
+
defineModule({
|
|
48
|
+
id: `${meta.id}/module/translations`,
|
|
49
|
+
activatesOn: Events.SetupTranslations,
|
|
50
|
+
activate: () => contributes(Capabilities.Translations, [...translations, ...stackTranslations]),
|
|
51
|
+
}),
|
|
52
|
+
defineModule({
|
|
53
|
+
id: `${meta.id}/module/react-root`,
|
|
54
|
+
activatesOn: Events.Startup,
|
|
55
|
+
activate: ReactRoot,
|
|
56
|
+
}),
|
|
57
|
+
defineModule({
|
|
58
|
+
id: `${meta.id}/module/react-surface`,
|
|
59
|
+
activatesOn: Events.SetupSurfaces,
|
|
60
|
+
activate: ReactSurface,
|
|
61
|
+
}),
|
|
62
|
+
defineModule({
|
|
63
|
+
id: `${meta.id}/module/layout-intent-resolver`,
|
|
64
|
+
activatesOn: Events.SetupIntents,
|
|
65
|
+
activate: LayoutIntentResolver,
|
|
66
|
+
}),
|
|
67
|
+
defineModule({
|
|
68
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
69
|
+
activatesOn: Events.SetupAppGraph,
|
|
70
|
+
activate: AppGraphBuilder,
|
|
71
|
+
}),
|
|
72
|
+
defineModule({
|
|
73
|
+
id: `${meta.id}/module/url`,
|
|
74
|
+
activatesOn: allOf(Events.DispatcherReady, DeckEvents.StateReady),
|
|
75
|
+
activate: UrlHandler,
|
|
76
|
+
}),
|
|
77
|
+
]);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
+
import { AttentionCapabilities } from '@dxos/plugin-attention';
|
|
7
|
+
import { createExtension, type Node, ROOT_ID } from '@dxos/plugin-graph';
|
|
8
|
+
|
|
9
|
+
import { DeckCapabilities } from './capabilities';
|
|
10
|
+
import { DECK_PLUGIN } from '../meta';
|
|
11
|
+
|
|
12
|
+
export default (context: PluginsContext) =>
|
|
13
|
+
contributes(
|
|
14
|
+
Capabilities.AppGraphBuilder,
|
|
15
|
+
createExtension({
|
|
16
|
+
id: DECK_PLUGIN,
|
|
17
|
+
filter: (node): node is Node<null> => node.id === ROOT_ID,
|
|
18
|
+
actions: () => {
|
|
19
|
+
const state = context.requestCapability(DeckCapabilities.MutableDeckState);
|
|
20
|
+
|
|
21
|
+
// NOTE(Zan): This is currently disabled.
|
|
22
|
+
// TODO(Zan): Fullscreen needs to know the active node and provide that to the layout part.
|
|
23
|
+
const _fullscreen = {
|
|
24
|
+
id: `${LayoutAction.UpdateLayout._tag}/fullscreen`,
|
|
25
|
+
data: async () => {
|
|
26
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
27
|
+
await dispatch(createIntent(LayoutAction.SetLayoutMode, { part: 'mode', options: { mode: 'fullscreen' } }));
|
|
28
|
+
},
|
|
29
|
+
properties: {
|
|
30
|
+
label: ['toggle fullscreen label', { ns: DECK_PLUGIN }],
|
|
31
|
+
icon: 'ph--arrows-out--regular',
|
|
32
|
+
keyBinding: {
|
|
33
|
+
macos: 'ctrl+meta+f',
|
|
34
|
+
windows: 'shift+ctrl+f',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const closeCurrent = {
|
|
40
|
+
id: `${LayoutAction.Close._tag}/current`,
|
|
41
|
+
data: async () => {
|
|
42
|
+
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
43
|
+
const attended = attention.current.at(-1);
|
|
44
|
+
if (attended) {
|
|
45
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
46
|
+
await dispatch(
|
|
47
|
+
createIntent(LayoutAction.Close, { part: 'main', subject: [attended], options: { state: false } }),
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
properties: {
|
|
52
|
+
label: ['close current label', { ns: DECK_PLUGIN }],
|
|
53
|
+
icon: 'ph--x--regular',
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const closeOthers = {
|
|
58
|
+
id: `${LayoutAction.Close._tag}/others`,
|
|
59
|
+
data: async () => {
|
|
60
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
61
|
+
const attention = context.requestCapability(AttentionCapabilities.Attention);
|
|
62
|
+
const attended = attention.current.at(-1);
|
|
63
|
+
const ids = state.deck.active.filter((id) => id !== attended) ?? [];
|
|
64
|
+
await dispatch(createIntent(LayoutAction.Close, { part: 'main', subject: ids, options: { state: false } }));
|
|
65
|
+
},
|
|
66
|
+
properties: {
|
|
67
|
+
label: ['close others label', { ns: DECK_PLUGIN }],
|
|
68
|
+
icon: 'ph--x-square--regular',
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const closeAll = {
|
|
73
|
+
id: `${LayoutAction.Close._tag}/all`,
|
|
74
|
+
data: async () => {
|
|
75
|
+
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
76
|
+
await dispatch(
|
|
77
|
+
createIntent(LayoutAction.Close, {
|
|
78
|
+
part: 'main',
|
|
79
|
+
subject: state.deck.active,
|
|
80
|
+
options: { state: false },
|
|
81
|
+
}),
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
properties: {
|
|
85
|
+
label: ['close all label', { ns: DECK_PLUGIN }],
|
|
86
|
+
icon: 'ph--x-circle--regular',
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const toggleSidebar = {
|
|
91
|
+
id: `${LayoutAction.UpdateSidebar._tag}/nav`,
|
|
92
|
+
data: async () => {
|
|
93
|
+
state.sidebarState = state.sidebarState === 'expanded' ? 'collapsed' : 'expanded';
|
|
94
|
+
},
|
|
95
|
+
properties: {
|
|
96
|
+
label: [
|
|
97
|
+
state.sidebarState === 'expanded' ? 'collapse navigation sidebar label' : 'open navigation sidebar label',
|
|
98
|
+
{ ns: DECK_PLUGIN },
|
|
99
|
+
],
|
|
100
|
+
icon: 'ph--sidebar--regular',
|
|
101
|
+
disposition: 'pin-end',
|
|
102
|
+
l0Breakpoint: 'lg',
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return !state.deck.solo ? [closeCurrent, closeOthers, closeAll, toggleSidebar] : [toggleSidebar];
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability, type Label } from '@dxos/app-framework';
|
|
6
|
+
import { type DeepReadonly } from '@dxos/util';
|
|
7
|
+
|
|
8
|
+
import { DECK_PLUGIN } from '../meta';
|
|
9
|
+
import { type DeckState } from '../types';
|
|
10
|
+
|
|
11
|
+
export namespace DeckCapabilities {
|
|
12
|
+
export const DeckState = defineCapability<DeepReadonly<DeckState>>(`${DECK_PLUGIN}/capability/state`);
|
|
13
|
+
export const MutableDeckState = defineCapability<DeckState>(`${DECK_PLUGIN}/capability/state`);
|
|
14
|
+
|
|
15
|
+
export const ComplementaryPanel = defineCapability<{ id: string; label: Label; icon: string }>(
|
|
16
|
+
`${DECK_PLUGIN}/capability/complementary-panel`,
|
|
17
|
+
);
|
|
18
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2025 DXOS.org
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
|
|
9
|
+
|
|
10
|
+
import { DECK_PLUGIN } from '../meta';
|
|
11
|
+
import { type DeckSettingsProps } from '../types';
|
|
12
|
+
|
|
13
|
+
const isSocket = !!(globalThis as any).__args;
|
|
14
|
+
|
|
15
|
+
// TODO(mjamesderocher): Can we get this directly from Socket?
|
|
16
|
+
const appScheme = 'composer://';
|
|
17
|
+
|
|
18
|
+
// TODO(mjamesderocher): Factor out as part of NavigationPlugin.
|
|
19
|
+
const checkAppScheme = (url: string) => {
|
|
20
|
+
const iframe = document.createElement('iframe');
|
|
21
|
+
iframe.style.display = 'none';
|
|
22
|
+
document.body.appendChild(iframe);
|
|
23
|
+
|
|
24
|
+
iframe.src = url + window.location.pathname.replace(/^\/+/, '') + window.location.search;
|
|
25
|
+
|
|
26
|
+
const timer = setTimeout(() => {
|
|
27
|
+
document.body.removeChild(iframe);
|
|
28
|
+
}, 3000);
|
|
29
|
+
|
|
30
|
+
window.addEventListener('pagehide', (event) => {
|
|
31
|
+
clearTimeout(timer);
|
|
32
|
+
document.body.removeChild(iframe);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default async (context: PluginsContext) => {
|
|
37
|
+
const settingsStore = context.requestCapability(Capabilities.SettingsStore);
|
|
38
|
+
const settings = settingsStore.getStore<DeckSettingsProps>(DECK_PLUGIN)?.value;
|
|
39
|
+
if (!isSocket && settings?.enableNativeRedirect) {
|
|
40
|
+
checkAppScheme(appScheme);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return contributes(Capabilities.Null, null);
|
|
44
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { lazy } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
+
export const CheckAppScheme = lazy(() => import('./check-app-scheme'));
|
|
9
|
+
export const LayoutIntentResolver = lazy(() => import('./intent-resolver'));
|
|
10
|
+
export const ReactRoot = lazy(() => import('./react-root'));
|
|
11
|
+
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
12
|
+
export const DeckSettings = lazy(() => import('./settings'));
|
|
13
|
+
export const DeckState = lazy(() => import('./state'));
|
|
14
|
+
export const UrlHandler = lazy(() => import('./url-handler'));
|
|
15
|
+
|
|
16
|
+
export * from './capabilities';
|