@dxos/app-framework 0.5.2-next.51d50f2 → 0.5.3-main.056e7da
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 +10 -3
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +11 -3
- 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 +1 -3
- 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/PluginHost/plugin.d.ts +1 -1
- package/dist/types/src/plugins/PluginHost/plugin.d.ts.map +1 -1
- package/dist/types/src/plugins/PluginHost/plugin.test.d.ts.map +1 -1
- package/dist/types/src/plugins/SurfacePlugin/ErrorBoundary.d.ts +1 -0
- package/dist/types/src/plugins/SurfacePlugin/ErrorBoundary.d.ts.map +1 -1
- package/dist/types/src/plugins/common/layout.d.ts +4 -2
- package/dist/types/src/plugins/common/layout.d.ts.map +1 -1
- package/dist/types/src/plugins/common/navigation.d.ts +17 -1
- package/dist/types/src/plugins/common/navigation.d.ts.map +1 -1
- package/dist/types/src/plugins/helpers.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/plugins/SurfacePlugin/ErrorBoundary.tsx +2 -2
- package/src/plugins/common/layout.ts +6 -5
- package/src/plugins/common/navigation.ts +13 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/plugins/helpers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/plugins/helpers.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,YAAY,sBAAuB,OAAO,SAAS,CAAC,KAAG,OAAO,SAAS,CAAW,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,UAAU,eAAgB,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,CAAC,GAAG,SAIzE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,eAAgB,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,CAEpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,eACf,MAAM,EAAE,aACN,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,KACnD,OAAO,CAAC,CAAC,EAAkG,CAAC;AAE/G;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,eACf,MAAM,EAAE,aACN,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,SAAS,KACnD,OAAO,CAAC,CAAC,GAAG,SAAiD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/app-framework",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3-main.056e7da",
|
|
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",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"@phosphor-icons/react": "^2.1.5",
|
|
16
16
|
"@preact/signals-core": "^1.6.0",
|
|
17
17
|
"zod": "^3.22.4",
|
|
18
|
-
"@dxos/app-graph": "0.5.
|
|
19
|
-
"@dxos/
|
|
20
|
-
"@dxos/echo-schema": "0.5.
|
|
21
|
-
"@dxos/invariant": "0.5.
|
|
22
|
-
"@dxos/
|
|
23
|
-
"@dxos/
|
|
24
|
-
"@dxos/util": "0.5.
|
|
25
|
-
"@dxos/
|
|
18
|
+
"@dxos/app-graph": "0.5.3-main.056e7da",
|
|
19
|
+
"@dxos/async": "0.5.3-main.056e7da",
|
|
20
|
+
"@dxos/echo-schema": "0.5.3-main.056e7da",
|
|
21
|
+
"@dxos/invariant": "0.5.3-main.056e7da",
|
|
22
|
+
"@dxos/debug": "0.5.3-main.056e7da",
|
|
23
|
+
"@dxos/local-storage": "0.5.3-main.056e7da",
|
|
24
|
+
"@dxos/util": "0.5.3-main.056e7da",
|
|
25
|
+
"@dxos/log": "0.5.3-main.056e7da"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/react": "^18.0.21",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { Component, type FC, type PropsWithChildren } from 'react';
|
|
6
6
|
|
|
7
|
-
type Props = PropsWithChildren<{ data?: any; fallback: FC<{ error: Error; reset: () => void }> }>;
|
|
7
|
+
type Props = PropsWithChildren<{ data?: any; fallback: FC<{ data?: any; error: Error; reset: () => void }> }>;
|
|
8
8
|
type State = { error: Error | undefined };
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -33,7 +33,7 @@ export class ErrorBoundary extends Component<Props, State> {
|
|
|
33
33
|
|
|
34
34
|
override render() {
|
|
35
35
|
if (this.state.error) {
|
|
36
|
-
return <this.props.fallback error={this.state.error} reset={this.resetError} />;
|
|
36
|
+
return <this.props.fallback data={this.props.data} error={this.state.error} reset={this.resetError} />;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
return this.props.children;
|
|
@@ -57,6 +57,11 @@ export const Layout = z.object({
|
|
|
57
57
|
popoverAnchorId: z.string().optional(),
|
|
58
58
|
|
|
59
59
|
toasts: z.array(Toast),
|
|
60
|
+
|
|
61
|
+
scrollIntoView: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('The identifier of a component to scroll into view when it is mounted.'),
|
|
60
65
|
});
|
|
61
66
|
|
|
62
67
|
export type Layout = z.infer<typeof Layout>;
|
|
@@ -83,11 +88,7 @@ export const parseLayoutPlugin = (plugin: Plugin) => {
|
|
|
83
88
|
const LAYOUT_ACTION = 'dxos.org/plugin/layout';
|
|
84
89
|
export enum LayoutAction {
|
|
85
90
|
SET_LAYOUT = `${LAYOUT_ACTION}/set-layout`,
|
|
86
|
-
|
|
87
|
-
/** @deprecated */
|
|
88
|
-
// TODO(wittjosiah): At minimum this should be renamed, "focus" means something very specific on a web page.
|
|
89
|
-
// Consider removing this action entirely, it's maybe not generic enough to live here.
|
|
90
|
-
FOCUS = `${LAYOUT_ACTION}/focus`,
|
|
91
|
+
SCROLL_INTO_VIEW = `${LAYOUT_ACTION}/scroll-into-view`,
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
/**
|
|
@@ -8,7 +8,7 @@ import type { IntentData } from '../IntentPlugin';
|
|
|
8
8
|
import type { Plugin } from '../PluginHost';
|
|
9
9
|
|
|
10
10
|
// NOTE(thure): These are chosen from RFC 1738’s `safe` characters: http://www.faqs.org/rfcs/rfc1738.html
|
|
11
|
-
export const SLUG_LIST_SEPARATOR = '
|
|
11
|
+
export const SLUG_LIST_SEPARATOR = '+';
|
|
12
12
|
export const SLUG_ENTRY_SEPARATOR = '_';
|
|
13
13
|
export const SLUG_KEY_VALUE_SEPARATOR = '-';
|
|
14
14
|
export const SLUG_PATH_SEPARATOR = '~';
|
|
@@ -36,8 +36,14 @@ export const Location = z.object({
|
|
|
36
36
|
.describe('Id or ids of recently closed items, in order of when they were closed.'),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
export const Attention = z.object({
|
|
40
|
+
attended: z.set(z.string()).optional().describe('Ids of items which have focus.'),
|
|
41
|
+
});
|
|
42
|
+
|
|
39
43
|
export type ActiveParts = z.infer<typeof ActiveParts>;
|
|
40
44
|
export type Location = z.infer<typeof Location>;
|
|
45
|
+
export type Attention = z.infer<typeof Attention>;
|
|
46
|
+
|
|
41
47
|
/**
|
|
42
48
|
* Composed of [ part name, index within the part, size of the part ]
|
|
43
49
|
*/
|
|
@@ -77,6 +83,7 @@ export const isIdActive = (active: string | ActiveParts | undefined, id: string)
|
|
|
77
83
|
*/
|
|
78
84
|
export type LocationProvides = {
|
|
79
85
|
location: Readonly<Location>;
|
|
86
|
+
attention?: Readonly<Attention>;
|
|
80
87
|
};
|
|
81
88
|
|
|
82
89
|
/**
|
|
@@ -94,6 +101,7 @@ export const parseNavigationPlugin = (plugin: Plugin) => {
|
|
|
94
101
|
const NAVIGATION_ACTION = 'dxos.org/plugin/navigation';
|
|
95
102
|
export enum NavigationAction {
|
|
96
103
|
OPEN = `${NAVIGATION_ACTION}/open`,
|
|
104
|
+
SET = `${NAVIGATION_ACTION}/set`,
|
|
97
105
|
ADJUST = `${NAVIGATION_ACTION}/adjust`,
|
|
98
106
|
CLOSE = `${NAVIGATION_ACTION}/close`,
|
|
99
107
|
}
|
|
@@ -110,6 +118,10 @@ export namespace NavigationAction {
|
|
|
110
118
|
* A subtractive overlay to apply to `location.active` (i.e. the result is a subtraction from the previous active of the argument)
|
|
111
119
|
*/
|
|
112
120
|
export type Close = IntentData<{ activeParts: ActiveParts }>;
|
|
121
|
+
/**
|
|
122
|
+
* The active parts to directly set, to be used when working with URLs or restoring a specific state.
|
|
123
|
+
*/
|
|
124
|
+
export type Set = IntentData<{ activeParts: ActiveParts }>;
|
|
113
125
|
/**
|
|
114
126
|
* An atomic transaction to apply to `location.active`, describing which element to (attempt to) move to which location.
|
|
115
127
|
*/
|