@dxos/app-framework 0.6.6-main.e1a6e1f → 0.6.6-staging.41c080b
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/index.mjs +21 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +22 -10
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/plugins/PluginHost/PluginContext.d.ts +4 -0
- package/dist/types/src/plugins/PluginHost/PluginContext.d.ts.map +1 -1
- package/dist/types/src/plugins/PluginHost/PluginHost.d.ts.map +1 -1
- package/dist/types/src/plugins/common/layout.d.ts +14 -4
- package/dist/types/src/plugins/common/layout.d.ts.map +1 -1
- package/dist/types/src/plugins/common/navigation.d.ts +25 -26
- package/dist/types/src/plugins/common/navigation.d.ts.map +1 -1
- package/package.json +10 -10
- package/src/plugins/PluginHost/PluginContext.tsx +6 -0
- package/src/plugins/PluginHost/PluginHost.tsx +1 -0
- package/src/plugins/common/layout.ts +13 -2
- package/src/plugins/common/navigation.ts +3 -9
|
@@ -40,8 +40,11 @@ export type Toast = z.infer<typeof Toast>;
|
|
|
40
40
|
* Generally only one dialog or popover should be open at a time, a layout plugin should manage this.
|
|
41
41
|
* For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.
|
|
42
42
|
*/
|
|
43
|
+
declare const LayoutMode: z.ZodUnion<[z.ZodLiteral<"deck">, z.ZodLiteral<"solo">, z.ZodLiteral<"fullscreen">]>;
|
|
44
|
+
export declare const isLayoutMode: (value: any) => value is "deck" | "solo" | "fullscreen";
|
|
45
|
+
export type LayoutMode = z.infer<typeof LayoutMode>;
|
|
43
46
|
export declare const Layout: z.ZodObject<{
|
|
44
|
-
|
|
47
|
+
layoutMode: z.ZodUnion<[z.ZodLiteral<"deck">, z.ZodLiteral<"solo">, z.ZodLiteral<"fullscreen">]>;
|
|
45
48
|
sidebarOpen: z.ZodBoolean;
|
|
46
49
|
complementarySidebarOpen: z.ZodBoolean;
|
|
47
50
|
/**
|
|
@@ -87,7 +90,7 @@ export declare const Layout: z.ZodObject<{
|
|
|
87
90
|
}>, "many">;
|
|
88
91
|
scrollIntoView: z.ZodOptional<z.ZodString>;
|
|
89
92
|
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
|
|
93
|
+
layoutMode: "deck" | "solo" | "fullscreen";
|
|
91
94
|
sidebarOpen: boolean;
|
|
92
95
|
complementarySidebarOpen: boolean;
|
|
93
96
|
dialogOpen: boolean;
|
|
@@ -110,7 +113,7 @@ export declare const Layout: z.ZodObject<{
|
|
|
110
113
|
popoverAnchorId?: string | undefined;
|
|
111
114
|
scrollIntoView?: string | undefined;
|
|
112
115
|
}, {
|
|
113
|
-
|
|
116
|
+
layoutMode: "deck" | "solo" | "fullscreen";
|
|
114
117
|
sidebarOpen: boolean;
|
|
115
118
|
complementarySidebarOpen: boolean;
|
|
116
119
|
dialogOpen: boolean;
|
|
@@ -146,12 +149,18 @@ export type LayoutProvides = {
|
|
|
146
149
|
export declare const parseLayoutPlugin: (plugin: Plugin) => Plugin<LayoutProvides> | undefined;
|
|
147
150
|
export declare enum LayoutAction {
|
|
148
151
|
SET_LAYOUT = "dxos.org/plugin/layout/set-layout",
|
|
149
|
-
|
|
152
|
+
SET_LAYOUT_MODE = "dxos.org/plugin/layout/set-layout-mode",
|
|
153
|
+
SCROLL_INTO_VIEW = "dxos.org/plugin/layout/scroll-into-view",
|
|
154
|
+
UPDATE_PLANK_SIZE = "dxos.org/plugin/layout/update-plank-size"
|
|
150
155
|
}
|
|
151
156
|
/**
|
|
152
157
|
* Expected payload for layout actions.
|
|
153
158
|
*/
|
|
154
159
|
export declare namespace LayoutAction {
|
|
160
|
+
type SetLayoutMode = IntentData<{
|
|
161
|
+
layoutMode?: LayoutMode;
|
|
162
|
+
revert?: boolean;
|
|
163
|
+
}>;
|
|
155
164
|
type SetLayout = IntentData<{
|
|
156
165
|
/**
|
|
157
166
|
* Element to set the state of.
|
|
@@ -182,4 +191,5 @@ export declare namespace LayoutAction {
|
|
|
182
191
|
dialogBlockAlign?: 'start' | 'center';
|
|
183
192
|
}>;
|
|
184
193
|
}
|
|
194
|
+
export {};
|
|
185
195
|
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAE1C;;;;;;GAMG;AAEH,eAAO,MAAM,MAAM;;;;
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/common/layout.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAE1C;;;;;;GAMG;AAEH,QAAA,MAAM,UAAU,sFAA2E,CAAC;AAC5F,eAAO,MAAM,YAAY,UAAW,GAAG,4CAA6D,CAAC;AACrG,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,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Y_VALUE_SEPARATOR = "-";
|
|
8
8
|
export declare const SLUG_PATH_SEPARATOR = "~";
|
|
9
9
|
export declare const SLUG_COLLECTION_INDICATOR = "";
|
|
10
|
-
export declare const SLUG_SOLO_INDICATOR = "$";
|
|
11
10
|
declare const LayoutEntrySchema: S.mutable<S.Struct<{
|
|
12
11
|
id: typeof S.String;
|
|
13
|
-
solo: S.optional<typeof S.Boolean>;
|
|
14
12
|
path: S.optional<typeof S.String>;
|
|
15
13
|
}>>;
|
|
16
14
|
export type LayoutEntry = S.Schema.Type<typeof LayoutEntrySchema>;
|
|
17
|
-
declare const LayoutPartSchema: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
15
|
+
declare const LayoutPartSchema: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["solo"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
18
16
|
export type LayoutPart = S.Schema.Type<typeof LayoutPartSchema>;
|
|
19
17
|
declare const LayoutPartsSchema: S.SchemaClass<{
|
|
20
18
|
main?: {
|
|
21
19
|
path?: string | undefined;
|
|
22
20
|
id: string;
|
|
23
|
-
|
|
21
|
+
}[] | undefined;
|
|
22
|
+
solo?: {
|
|
23
|
+
path?: string | undefined;
|
|
24
|
+
id: string;
|
|
24
25
|
}[] | undefined;
|
|
25
26
|
sidebar?: {
|
|
26
27
|
path?: string | undefined;
|
|
27
28
|
id: string;
|
|
28
|
-
solo?: boolean | undefined;
|
|
29
29
|
}[] | undefined;
|
|
30
30
|
complementary?: {
|
|
31
31
|
path?: string | undefined;
|
|
32
32
|
id: string;
|
|
33
|
-
solo?: boolean | undefined;
|
|
34
33
|
}[] | undefined;
|
|
35
34
|
fullScreen?: {
|
|
36
35
|
path?: string | undefined;
|
|
37
36
|
id: string;
|
|
38
|
-
solo?: boolean | undefined;
|
|
39
37
|
}[] | undefined;
|
|
40
38
|
}, {
|
|
41
39
|
main?: {
|
|
42
40
|
id: string;
|
|
43
41
|
path?: string | undefined;
|
|
44
|
-
|
|
42
|
+
}[] | undefined;
|
|
43
|
+
solo?: {
|
|
44
|
+
id: string;
|
|
45
|
+
path?: string | undefined;
|
|
45
46
|
}[] | undefined;
|
|
46
47
|
sidebar?: {
|
|
47
48
|
id: string;
|
|
48
49
|
path?: string | undefined;
|
|
49
|
-
solo?: boolean | undefined;
|
|
50
50
|
}[] | undefined;
|
|
51
51
|
complementary?: {
|
|
52
52
|
id: string;
|
|
53
53
|
path?: string | undefined;
|
|
54
|
-
solo?: boolean | undefined;
|
|
55
54
|
}[] | undefined;
|
|
56
55
|
fullScreen?: {
|
|
57
56
|
id: string;
|
|
58
57
|
path?: string | undefined;
|
|
59
|
-
solo?: boolean | undefined;
|
|
60
58
|
}[] | undefined;
|
|
61
59
|
}, never>;
|
|
62
60
|
export type LayoutParts = S.Schema.Type<typeof LayoutPartsSchema>;
|
|
63
61
|
declare const LayoutCoordinateSchema: S.mutable<S.Struct<{
|
|
64
|
-
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
62
|
+
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["solo"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
65
63
|
entryId: typeof S.String;
|
|
66
64
|
}>>;
|
|
67
65
|
export type LayoutCoordinate = S.Schema.Type<typeof LayoutCoordinateSchema>;
|
|
@@ -69,7 +67,7 @@ declare const PartAdjustmentSchema: S.Union<[S.Literal<["increment-start"]>, S.L
|
|
|
69
67
|
export type PartAdjustment = S.Schema.Type<typeof PartAdjustmentSchema>;
|
|
70
68
|
declare const LayoutAdjustmentSchema: S.mutable<S.Struct<{
|
|
71
69
|
layoutCoordinate: S.mutable<S.Struct<{
|
|
72
|
-
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
70
|
+
part: S.Union<[S.Literal<["sidebar"]>, S.Literal<["main"]>, S.Literal<["solo"]>, S.Literal<["complementary"]>, S.Literal<["fullScreen"]>]>;
|
|
73
71
|
entryId: typeof S.String;
|
|
74
72
|
}>>;
|
|
75
73
|
type: S.Union<[S.Literal<["increment-start"]>, S.Literal<["increment-end"]>, S.Literal<["solo"]>]>;
|
|
@@ -98,43 +96,43 @@ declare const LocationProvidesSchema: S.mutable<S.Struct<{
|
|
|
98
96
|
main?: {
|
|
99
97
|
path?: string | undefined;
|
|
100
98
|
id: string;
|
|
101
|
-
|
|
99
|
+
}[] | undefined;
|
|
100
|
+
solo?: {
|
|
101
|
+
path?: string | undefined;
|
|
102
|
+
id: string;
|
|
102
103
|
}[] | undefined;
|
|
103
104
|
sidebar?: {
|
|
104
105
|
path?: string | undefined;
|
|
105
106
|
id: string;
|
|
106
|
-
solo?: boolean | undefined;
|
|
107
107
|
}[] | undefined;
|
|
108
108
|
complementary?: {
|
|
109
109
|
path?: string | undefined;
|
|
110
110
|
id: string;
|
|
111
|
-
solo?: boolean | undefined;
|
|
112
111
|
}[] | undefined;
|
|
113
112
|
fullScreen?: {
|
|
114
113
|
path?: string | undefined;
|
|
115
114
|
id: string;
|
|
116
|
-
solo?: boolean | undefined;
|
|
117
115
|
}[] | undefined;
|
|
118
116
|
}, {
|
|
119
117
|
main?: {
|
|
120
118
|
id: string;
|
|
121
119
|
path?: string | undefined;
|
|
122
|
-
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
solo?: {
|
|
122
|
+
id: string;
|
|
123
|
+
path?: string | undefined;
|
|
123
124
|
}[] | undefined;
|
|
124
125
|
sidebar?: {
|
|
125
126
|
id: string;
|
|
126
127
|
path?: string | undefined;
|
|
127
|
-
solo?: boolean | undefined;
|
|
128
128
|
}[] | undefined;
|
|
129
129
|
complementary?: {
|
|
130
130
|
id: string;
|
|
131
131
|
path?: string | undefined;
|
|
132
|
-
solo?: boolean | undefined;
|
|
133
132
|
}[] | undefined;
|
|
134
133
|
fullScreen?: {
|
|
135
134
|
id: string;
|
|
136
135
|
path?: string | undefined;
|
|
137
|
-
solo?: boolean | undefined;
|
|
138
136
|
}[] | undefined;
|
|
139
137
|
}, never>;
|
|
140
138
|
closed: S.Array$<typeof S.String>;
|
|
@@ -148,28 +146,28 @@ export declare const isLayoutParts: (value: unknown) => value is {
|
|
|
148
146
|
main?: {
|
|
149
147
|
path?: string | undefined;
|
|
150
148
|
id: string;
|
|
151
|
-
|
|
149
|
+
}[] | undefined;
|
|
150
|
+
solo?: {
|
|
151
|
+
path?: string | undefined;
|
|
152
|
+
id: string;
|
|
152
153
|
}[] | undefined;
|
|
153
154
|
sidebar?: {
|
|
154
155
|
path?: string | undefined;
|
|
155
156
|
id: string;
|
|
156
|
-
solo?: boolean | undefined;
|
|
157
157
|
}[] | undefined;
|
|
158
158
|
complementary?: {
|
|
159
159
|
path?: string | undefined;
|
|
160
160
|
id: string;
|
|
161
|
-
solo?: boolean | undefined;
|
|
162
161
|
}[] | undefined;
|
|
163
162
|
fullScreen?: {
|
|
164
163
|
path?: string | undefined;
|
|
165
164
|
id: string;
|
|
166
|
-
solo?: boolean | undefined;
|
|
167
165
|
}[] | undefined;
|
|
168
166
|
};
|
|
169
167
|
export declare const isLayoutAdjustment: (value: unknown) => value is {
|
|
170
168
|
type: "solo" | "increment-start" | "increment-end";
|
|
171
169
|
layoutCoordinate: {
|
|
172
|
-
part: "main" | "sidebar" | "complementary" | "fullScreen";
|
|
170
|
+
part: "main" | "solo" | "sidebar" | "complementary" | "fullScreen";
|
|
173
171
|
entryId: string;
|
|
174
172
|
};
|
|
175
173
|
};
|
|
@@ -215,6 +213,7 @@ export declare namespace NavigationAction {
|
|
|
215
213
|
*/
|
|
216
214
|
type Close = IntentData<{
|
|
217
215
|
activeParts: ActiveParts;
|
|
216
|
+
noToggle?: boolean;
|
|
218
217
|
}>;
|
|
219
218
|
/**
|
|
220
219
|
* The active parts to directly set, to be used when working with URLs or restoring a specific state.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/common/navigation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/common/navigation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAK5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAI5C,QAAA,MAAM,iBAAiB;;;GAAoE,CAAC;AAE5F,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAKlE,QAAA,MAAM,gBAAgB,sIAMrB,CAAC;AACF,MAAM,MAAM,UA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AAW,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAC3D;;OAEG;IACH,KAAY,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;CACnD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.6.6-
|
|
3
|
+
"version": "0.6.6-staging.41c080b",
|
|
4
4
|
"description": "A framework for building applications from composible plugins.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
"@phosphor-icons/react": "^2.1.5",
|
|
24
24
|
"@preact/signals-core": "^1.6.0",
|
|
25
25
|
"zod": "^3.22.4",
|
|
26
|
-
"@dxos/
|
|
27
|
-
"@dxos/
|
|
28
|
-
"@dxos/
|
|
29
|
-
"@dxos/
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/log": "0.6.6-
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/util": "0.6.6-
|
|
26
|
+
"@dxos/app-graph": "0.6.6-staging.41c080b",
|
|
27
|
+
"@dxos/async": "0.6.6-staging.41c080b",
|
|
28
|
+
"@dxos/client-protocol": "0.6.6-staging.41c080b",
|
|
29
|
+
"@dxos/debug": "0.6.6-staging.41c080b",
|
|
30
|
+
"@dxos/echo-schema": "0.6.6-staging.41c080b",
|
|
31
|
+
"@dxos/invariant": "0.6.6-staging.41c080b",
|
|
32
|
+
"@dxos/log": "0.6.6-staging.41c080b",
|
|
33
|
+
"@dxos/local-storage": "0.6.6-staging.41c080b",
|
|
34
|
+
"@dxos/util": "0.6.6-staging.41c080b"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/react": "^18.0.21",
|
|
@@ -13,6 +13,11 @@ export type PluginContext = {
|
|
|
13
13
|
*/
|
|
14
14
|
ready: boolean;
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Core plugins.
|
|
18
|
+
*/
|
|
19
|
+
core: string[];
|
|
20
|
+
|
|
16
21
|
/**
|
|
17
22
|
* Ids of plugins which are enabled on this device.
|
|
18
23
|
*/
|
|
@@ -38,6 +43,7 @@ export type PluginContext = {
|
|
|
38
43
|
|
|
39
44
|
const PluginContext: Context<PluginContext> = createContext<PluginContext>({
|
|
40
45
|
ready: false,
|
|
46
|
+
core: [],
|
|
41
47
|
enabled: [],
|
|
42
48
|
plugins: [],
|
|
43
49
|
available: [],
|
|
@@ -42,6 +42,7 @@ export const PluginHost = ({
|
|
|
42
42
|
}: BootstrapPluginsParams): PluginDefinition<PluginHostProvides> => {
|
|
43
43
|
const state = new LocalStorageStore<PluginContext>(PLUGIN_HOST, {
|
|
44
44
|
ready: false,
|
|
45
|
+
core,
|
|
45
46
|
enabled: [...defaults],
|
|
46
47
|
plugins: [],
|
|
47
48
|
available: order.filter(({ id }) => !core.includes(id)),
|
|
@@ -33,12 +33,16 @@ export type Toast = z.infer<typeof Toast>;
|
|
|
33
33
|
* Generally only one dialog or popover should be open at a time, a layout plugin should manage this.
|
|
34
34
|
* For other landmarks, such as toasts, rendering them in the layout prevents them from unmounting when navigating.
|
|
35
35
|
*/
|
|
36
|
+
|
|
37
|
+
const LayoutMode = z.union([z.literal('deck'), z.literal('solo'), z.literal('fullscreen')]);
|
|
38
|
+
export const isLayoutMode = (value: any): value is LayoutMode => LayoutMode.safeParse(value).success;
|
|
39
|
+
export type LayoutMode = z.infer<typeof LayoutMode>;
|
|
40
|
+
|
|
36
41
|
// TODO(wittjosiah): Replace Zod w/ Effect Schema to align with ECHO.
|
|
37
42
|
export const Layout = z.object({
|
|
38
|
-
|
|
43
|
+
layoutMode: z.union([z.literal('deck'), z.literal('solo'), z.literal('fullscreen')]),
|
|
39
44
|
|
|
40
45
|
sidebarOpen: z.boolean(),
|
|
41
|
-
|
|
42
46
|
complementarySidebarOpen: z.boolean(),
|
|
43
47
|
/**
|
|
44
48
|
* @deprecated
|
|
@@ -89,13 +93,20 @@ export const parseLayoutPlugin = (plugin: Plugin) => {
|
|
|
89
93
|
const LAYOUT_ACTION = 'dxos.org/plugin/layout';
|
|
90
94
|
export enum LayoutAction {
|
|
91
95
|
SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,
|
|
96
|
+
SET_LAYOUT_MODE = `${LAYOUT_ACTION}/set-layout-mode`,
|
|
92
97
|
SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,
|
|
98
|
+
UPDATE_PLANK_SIZE = `${LAYOUT_ACTION}/update-plank-size`,
|
|
93
99
|
}
|
|
94
100
|
|
|
95
101
|
/**
|
|
96
102
|
* Expected payload for layout actions.
|
|
97
103
|
*/
|
|
98
104
|
export namespace LayoutAction {
|
|
105
|
+
export type SetLayoutMode = IntentData<{
|
|
106
|
+
layoutMode?: LayoutMode;
|
|
107
|
+
revert?: boolean;
|
|
108
|
+
}>;
|
|
109
|
+
|
|
99
110
|
export type SetLayout = IntentData<{
|
|
100
111
|
/**
|
|
101
112
|
* Element to set the state of.
|
|
@@ -17,17 +17,10 @@ export const SLUG_ENTRY_SEPARATOR = '_';
|
|
|
17
17
|
export const SLUG_KEY_VALUE_SEPARATOR = '-';
|
|
18
18
|
export const SLUG_PATH_SEPARATOR = '~';
|
|
19
19
|
export const SLUG_COLLECTION_INDICATOR = '';
|
|
20
|
-
export const SLUG_SOLO_INDICATOR = '$';
|
|
21
20
|
|
|
22
21
|
//
|
|
23
22
|
// --- Types ------------------------------------------------------------------
|
|
24
|
-
const LayoutEntrySchema = S.mutable(
|
|
25
|
-
S.Struct({
|
|
26
|
-
id: S.String,
|
|
27
|
-
solo: S.optional(S.Boolean),
|
|
28
|
-
path: S.optional(S.String),
|
|
29
|
-
}),
|
|
30
|
-
);
|
|
23
|
+
const LayoutEntrySchema = S.mutable(S.Struct({ id: S.String, path: S.optional(S.String) }));
|
|
31
24
|
|
|
32
25
|
export type LayoutEntry = S.Schema.Type<typeof LayoutEntrySchema>;
|
|
33
26
|
|
|
@@ -37,6 +30,7 @@ export type LayoutEntry = S.Schema.Type<typeof LayoutEntrySchema>;
|
|
|
37
30
|
const LayoutPartSchema = S.Union(
|
|
38
31
|
S.Literal('sidebar'),
|
|
39
32
|
S.Literal('main'),
|
|
33
|
+
S.Literal('solo'),
|
|
40
34
|
S.Literal('complementary'),
|
|
41
35
|
S.Literal('fullScreen'),
|
|
42
36
|
);
|
|
@@ -180,7 +174,7 @@ export namespace NavigationAction {
|
|
|
180
174
|
/**
|
|
181
175
|
* A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)
|
|
182
176
|
*/
|
|
183
|
-
export type Close = IntentData<{ activeParts: ActiveParts }>;
|
|
177
|
+
export type Close = IntentData<{ activeParts: ActiveParts; noToggle?: boolean }>;
|
|
184
178
|
/**
|
|
185
179
|
* The active parts to directly set, to be used when working with URLs or restoring a specific state.
|
|
186
180
|
*/
|