@dxos/app-framework 0.6.12-staging.e11e696 → 0.6.13-main.548ca8d
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 +168 -158
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +168 -162
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +168 -158
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/App.d.ts +4 -4
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/plugins/PluginHost/PluginContainer.d.ts +14 -0
- package/dist/types/src/plugins/PluginHost/PluginContainer.d.ts.map +1 -0
- package/dist/types/src/plugins/PluginHost/PluginContext.d.ts +4 -4
- package/dist/types/src/plugins/PluginHost/PluginContext.d.ts.map +1 -1
- package/dist/types/src/plugins/PluginHost/PluginHost.d.ts +4 -8
- package/dist/types/src/plugins/PluginHost/PluginHost.d.ts.map +1 -1
- package/dist/types/src/plugins/PluginHost/plugin.d.ts +37 -72
- package/dist/types/src/plugins/PluginHost/plugin.d.ts.map +1 -1
- package/dist/types/src/plugins/common/navigation.d.ts.map +1 -1
- package/package.json +11 -11
- package/src/App.tsx +10 -9
- package/src/plugins/PluginHost/PluginContainer.tsx +120 -0
- package/src/plugins/PluginHost/PluginContext.tsx +8 -14
- package/src/plugins/PluginHost/PluginHost.tsx +18 -121
- package/src/plugins/PluginHost/plugin.ts +45 -45
- package/src/plugins/common/navigation.ts +3 -1
- package/tsconfig.json +1 -29
|
@@ -20,54 +20,56 @@ export type PluginProvides<TProvides> = TProvides & {
|
|
|
20
20
|
root?: FC<PropsWithChildren>;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
+
export type PluginMeta = {
|
|
24
|
+
/**
|
|
25
|
+
* Globally unique ID.
|
|
26
|
+
*
|
|
27
|
+
* Expected to be in the form of a valid URL.
|
|
28
|
+
*
|
|
29
|
+
* @example dxos.org/plugin/example
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Short ID for use in URLs.
|
|
35
|
+
*
|
|
36
|
+
* NOTE: This is especially experimental and likely to change.
|
|
37
|
+
*/
|
|
38
|
+
// TODO(wittjosiah): How should these be managed?
|
|
39
|
+
shortId?: string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Human-readable name.
|
|
43
|
+
*/
|
|
44
|
+
name?: string;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Short description of plugin functionality.
|
|
48
|
+
*/
|
|
49
|
+
description?: string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* URL of home page.
|
|
53
|
+
*/
|
|
54
|
+
homePage?: string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Tags to help categorize the plugin.
|
|
58
|
+
*/
|
|
59
|
+
tags?: string[];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
|
|
63
|
+
*/
|
|
64
|
+
icon?: string;
|
|
65
|
+
};
|
|
66
|
+
|
|
23
67
|
/**
|
|
24
68
|
* A unit of containment of modular functionality that can be provided to an application.
|
|
25
69
|
* Plugins provide things like components, state, actions, etc. to the application.
|
|
26
70
|
*/
|
|
27
71
|
export type Plugin<TProvides = {}> = {
|
|
28
|
-
meta:
|
|
29
|
-
/**
|
|
30
|
-
* Globally unique ID.
|
|
31
|
-
*
|
|
32
|
-
* Expected to be in the form of a valid URL.
|
|
33
|
-
*
|
|
34
|
-
* @example dxos.org/plugin/example
|
|
35
|
-
*/
|
|
36
|
-
id: string;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Short ID for use in URLs.
|
|
40
|
-
*
|
|
41
|
-
* NOTE: This is especially experimental and likely to change.
|
|
42
|
-
*/
|
|
43
|
-
// TODO(wittjosiah): How should these be managed?
|
|
44
|
-
shortId?: string;
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Human-readable name.
|
|
48
|
-
*/
|
|
49
|
-
name?: string;
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Short description of plugin functionality.
|
|
53
|
-
*/
|
|
54
|
-
description?: string;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* URL of home page.
|
|
58
|
-
*/
|
|
59
|
-
homePage?: string;
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Tags to help categorize the plugin.
|
|
63
|
-
*/
|
|
64
|
-
tags?: string[];
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* A grep-able symbol string which can be resolved to an icon asset by @ch-ui/icons, via @ch-ui/vite-plugin-icons.
|
|
68
|
-
*/
|
|
69
|
-
icon?: string;
|
|
70
|
-
};
|
|
72
|
+
meta: PluginMeta;
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
* Capabilities provided by the plugin.
|
|
@@ -107,8 +109,6 @@ export type PluginDefinition<TProvides = {}, TInitializeProvides = {}> = Omit<Pl
|
|
|
107
109
|
unload?: () => Promise<void>;
|
|
108
110
|
};
|
|
109
111
|
|
|
110
|
-
export const pluginMeta = (meta: Plugin['meta']) => meta;
|
|
111
|
-
|
|
112
112
|
type LazyPlugin<T> = () => Promise<{ default: (props: T) => PluginDefinition }>;
|
|
113
113
|
|
|
114
114
|
export namespace Plugin {
|
|
@@ -29,7 +29,9 @@ const LayoutPartSchema = S.Union(
|
|
|
29
29
|
);
|
|
30
30
|
export type LayoutPart = S.Schema.Type<typeof LayoutPartSchema>;
|
|
31
31
|
|
|
32
|
-
const LayoutPartsSchema = S.partial(
|
|
32
|
+
const LayoutPartsSchema = S.partial(
|
|
33
|
+
S.mutable(S.Record({ key: LayoutPartSchema, value: S.mutable(S.Array(LayoutEntrySchema)) })),
|
|
34
|
+
);
|
|
33
35
|
export type LayoutParts = S.Schema.Type<typeof LayoutPartsSchema>;
|
|
34
36
|
|
|
35
37
|
const LayoutCoordinateSchema = S.mutable(S.Struct({ part: LayoutPartSchema, entryId: S.String }));
|
package/tsconfig.json
CHANGED
|
@@ -16,35 +16,7 @@
|
|
|
16
16
|
"include": [
|
|
17
17
|
"src"
|
|
18
18
|
],
|
|
19
|
-
"references": [
|
|
20
|
-
{
|
|
21
|
-
"path": "../../common/async"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"path": "../../common/debug"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"path": "../../common/invariant"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"path": "../../common/local-storage"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "../../common/log"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"path": "../../common/util"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"path": "../../core/echo/echo-schema"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"path": "../app-graph"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"path": "../client-protocol"
|
|
46
|
-
}
|
|
47
|
-
],
|
|
19
|
+
"references": [],
|
|
48
20
|
"ts-node": {
|
|
49
21
|
"compilerOptions": {
|
|
50
22
|
"module": "CommonJS"
|