@dxos/app-framework 0.7.5-labs.e27f9b9 → 0.7.5-main.2567c87
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/{chunk-G3HBVVT5.mjs → chunk-GNLU3GAU.mjs} +819 -627
- package/dist/lib/browser/chunk-GNLU3GAU.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +74 -57
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +3 -10
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/lib/node/chunk-FBA4BB3J.cjs +1639 -0
- package/dist/lib/node/chunk-FBA4BB3J.cjs.map +7 -0
- package/dist/lib/node/index.cjs +118 -106
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/testing/index.cjs +8 -15
- package/dist/lib/node/testing/index.cjs.map +3 -3
- package/dist/lib/node-esm/{chunk-ZTB4TA6Q.mjs → chunk-KPMTPXQI.mjs} +819 -627
- package/dist/lib/node-esm/chunk-KPMTPXQI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +74 -57
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +3 -10
- package/dist/lib/node-esm/testing/index.mjs.map +3 -3
- package/dist/types/src/App.d.ts.map +1 -1
- package/dist/types/src/common/capabilities.d.ts +110 -66
- package/dist/types/src/common/capabilities.d.ts.map +1 -1
- package/dist/types/src/common/events.d.ts +1 -8
- package/dist/types/src/common/events.d.ts.map +1 -1
- package/dist/types/src/common/file.d.ts +1 -1
- package/dist/types/src/common/file.d.ts.map +1 -1
- package/dist/types/src/common/graph.d.ts +2 -2
- package/dist/types/src/common/graph.d.ts.map +1 -1
- package/dist/types/src/common/index.d.ts +1 -0
- package/dist/types/src/common/index.d.ts.map +1 -1
- package/dist/types/src/common/layout.d.ts +121 -204
- package/dist/types/src/common/layout.d.ts.map +1 -1
- package/dist/types/src/common/navigation.d.ts +241 -0
- package/dist/types/src/common/navigation.d.ts.map +1 -0
- package/dist/types/src/common/surface.d.ts +3 -3
- package/dist/types/src/common/surface.d.ts.map +1 -1
- package/dist/types/src/common/translations.d.ts +7 -7
- package/dist/types/src/common/translations.d.ts.map +1 -1
- package/dist/types/src/core/capabilities.d.ts +2 -6
- package/dist/types/src/core/capabilities.d.ts.map +1 -1
- package/dist/types/src/core/manager.d.ts +9 -2
- package/dist/types/src/core/manager.d.ts.map +1 -1
- package/dist/types/src/core/plugin.d.ts +2 -5
- package/dist/types/src/core/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/generator/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/generator/generator.d.ts +0 -2
- package/dist/types/src/playground/generator/generator.d.ts.map +1 -1
- package/dist/types/src/playground/generator/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/Toolbar.d.ts.map +1 -1
- package/dist/types/src/playground/logger/plugin.d.ts.map +1 -1
- package/dist/types/src/playground/logger/schema.d.ts +1 -1
- package/dist/types/src/playground/logger/schema.d.ts.map +1 -1
- package/dist/types/src/{react → plugin-intent}/IntentContext.d.ts +1 -1
- package/dist/types/src/plugin-intent/IntentContext.d.ts.map +1 -0
- package/dist/types/src/plugin-intent/IntentPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts +1 -1
- package/dist/types/src/plugin-intent/actions.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/index.d.ts +1 -0
- package/dist/types/src/plugin-intent/index.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts +20 -27
- package/dist/types/src/plugin-intent/intent-dispatcher.d.ts.map +1 -1
- package/dist/types/src/plugin-intent/intent.d.ts +3 -3
- package/dist/types/src/plugin-intent/intent.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/SettingsPlugin.d.ts.map +1 -1
- package/dist/types/src/plugin-settings/actions.d.ts +1 -11
- package/dist/types/src/plugin-settings/actions.d.ts.map +1 -1
- package/dist/types/src/react/Surface.d.ts.map +1 -1
- package/dist/types/src/react/index.d.ts +0 -2
- package/dist/types/src/react/index.d.ts.map +1 -1
- package/dist/types/src/react/useCapabilities.d.ts.map +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts +1 -1
- package/dist/types/src/testing/withPluginManager.d.ts.map +1 -1
- package/package.json +21 -28
- package/project.json +3 -3
- package/src/App.tsx +14 -15
- package/src/common/capabilities.ts +11 -26
- package/src/common/events.ts +1 -10
- package/src/common/file.ts +1 -1
- package/src/common/graph.ts +2 -2
- package/src/common/index.ts +1 -0
- package/src/common/layout.ts +126 -194
- package/src/common/navigation.ts +199 -0
- package/src/common/surface.ts +2 -2
- package/src/common/translations.ts +8 -7
- package/src/core/capabilities.ts +7 -16
- package/src/core/manager.test.ts +73 -22
- package/src/core/manager.ts +91 -105
- package/src/core/plugin.ts +3 -6
- package/src/playground/debug/plugin.ts +1 -1
- package/src/playground/generator/Toolbar.tsx +11 -11
- package/src/playground/generator/generator.ts +0 -25
- package/src/playground/generator/plugin.ts +1 -6
- package/src/playground/layout/plugin.ts +1 -1
- package/src/playground/logger/Toolbar.tsx +1 -2
- package/src/playground/logger/plugin.ts +3 -6
- package/src/playground/logger/schema.ts +1 -1
- package/src/{react → plugin-intent}/IntentContext.tsx +2 -2
- package/src/plugin-intent/IntentPlugin.tsx +43 -3
- package/src/plugin-intent/actions.ts +1 -1
- package/src/plugin-intent/errors.ts +1 -1
- package/src/plugin-intent/index.ts +1 -0
- package/src/plugin-intent/intent-dispatcher.test.ts +29 -48
- package/src/plugin-intent/intent-dispatcher.ts +41 -76
- package/src/plugin-intent/intent.ts +5 -5
- package/src/plugin-settings/SettingsPlugin.ts +13 -19
- package/src/plugin-settings/actions.ts +1 -11
- package/src/react/Surface.tsx +8 -11
- package/src/react/index.ts +0 -2
- package/src/react/useCapabilities.ts +0 -1
- package/src/testing/withPluginManager.tsx +3 -11
- package/tsconfig.json +3 -6
- package/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs +0 -137
- package/dist/lib/browser/app-graph-builder-MOLT4EHG.mjs.map +0 -7
- package/dist/lib/browser/chunk-G3HBVVT5.mjs.map +0 -7
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs +0 -32
- package/dist/lib/browser/chunk-LDJ3T4V3.mjs.map +0 -7
- package/dist/lib/browser/chunk-TGOF2WQZ.mjs +0 -285
- package/dist/lib/browser/chunk-TGOF2WQZ.mjs.map +0 -7
- package/dist/lib/browser/intent-dispatcher-LJKNIGAM.mjs +0 -11
- package/dist/lib/browser/intent-dispatcher-LJKNIGAM.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-Z724VAMC.mjs +0 -38
- package/dist/lib/browser/intent-resolver-Z724VAMC.mjs.map +0 -7
- package/dist/lib/browser/store-NWCY7LAP.mjs +0 -19
- package/dist/lib/browser/store-NWCY7LAP.mjs.map +0 -7
- package/dist/lib/browser/worker.mjs +0 -77
- package/dist/lib/browser/worker.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs +0 -146
- package/dist/lib/node/app-graph-builder-G7SRXDFD.cjs.map +0 -7
- package/dist/lib/node/chunk-55KIQ6YK.cjs +0 -1437
- package/dist/lib/node/chunk-55KIQ6YK.cjs.map +0 -7
- package/dist/lib/node/chunk-5GABBW2Q.cjs +0 -308
- package/dist/lib/node/chunk-5GABBW2Q.cjs.map +0 -7
- package/dist/lib/node/chunk-QLVQ6PND.cjs +0 -58
- package/dist/lib/node/chunk-QLVQ6PND.cjs.map +0 -7
- package/dist/lib/node/intent-dispatcher-CGUK3BCJ.cjs +0 -32
- package/dist/lib/node/intent-dispatcher-CGUK3BCJ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-7GNKPRWT.cjs +0 -45
- package/dist/lib/node/intent-resolver-7GNKPRWT.cjs.map +0 -7
- package/dist/lib/node/store-WMJSEQPC.cjs +0 -34
- package/dist/lib/node/store-WMJSEQPC.cjs.map +0 -7
- package/dist/lib/node/worker.cjs +0 -99
- package/dist/lib/node/worker.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs +0 -138
- package/dist/lib/node-esm/app-graph-builder-MKLYH3NE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-47FG42II.mjs +0 -286
- package/dist/lib/node-esm/chunk-47FG42II.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs +0 -34
- package/dist/lib/node-esm/chunk-CNJYZNSL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZTB4TA6Q.mjs.map +0 -7
- package/dist/lib/node-esm/intent-dispatcher-RZAWA4XD.mjs +0 -12
- package/dist/lib/node-esm/intent-dispatcher-RZAWA4XD.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs +0 -39
- package/dist/lib/node-esm/intent-resolver-UIU37CKJ.mjs.map +0 -7
- package/dist/lib/node-esm/store-YUWINFBN.mjs +0 -20
- package/dist/lib/node-esm/store-YUWINFBN.mjs.map +0 -7
- package/dist/lib/node-esm/worker.mjs +0 -78
- package/dist/lib/node-esm/worker.mjs.map +0 -7
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts +0 -197
- package/dist/types/src/plugin-settings/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/intent-resolver.d.ts +0 -4
- package/dist/types/src/plugin-settings/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/store.d.ts +0 -5
- package/dist/types/src/plugin-settings/store.d.ts.map +0 -1
- package/dist/types/src/plugin-settings/translations.d.ts +0 -11
- package/dist/types/src/plugin-settings/translations.d.ts.map +0 -1
- package/dist/types/src/react/IntentContext.d.ts.map +0 -1
- package/dist/types/src/react/Surface.stories.d.ts +0 -16
- package/dist/types/src/react/Surface.stories.d.ts.map +0 -1
- package/dist/types/src/react/common.d.ts +0 -12
- package/dist/types/src/react/common.d.ts.map +0 -1
- package/dist/types/src/react/useIntentResolver.d.ts +0 -3
- package/dist/types/src/react/useIntentResolver.d.ts.map +0 -1
- package/dist/types/src/worker.d.ts +0 -4
- package/dist/types/src/worker.d.ts.map +0 -1
- package/src/plugin-settings/app-graph-builder.ts +0 -122
- package/src/plugin-settings/intent-resolver.ts +0 -28
- package/src/plugin-settings/store.ts +0 -20
- package/src/plugin-settings/translations.ts +0 -17
- package/src/react/Surface.stories.tsx +0 -96
- package/src/react/common.ts +0 -12
- package/src/react/useIntentResolver.ts +0 -22
- package/src/worker.ts +0 -11
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { type Node } from '@dxos/app-graph';
|
|
2
|
-
import { type PluginsContext } from '../core';
|
|
3
|
-
declare const _default: (context: PluginsContext) => import("../core").Capability<Readonly<{
|
|
4
|
-
id: string;
|
|
5
|
-
position: import("@dxos/util").Position;
|
|
6
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
7
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
8
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
9
|
-
type?: string;
|
|
10
|
-
filter?: (node: Node) => boolean;
|
|
11
|
-
}> | Readonly<{
|
|
12
|
-
id: string;
|
|
13
|
-
position: import("@dxos/util").Position;
|
|
14
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
15
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
16
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
17
|
-
type?: string;
|
|
18
|
-
filter?: (node: Node) => boolean;
|
|
19
|
-
}>[] | (Readonly<{
|
|
20
|
-
id: string;
|
|
21
|
-
position: import("@dxos/util").Position;
|
|
22
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
23
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
24
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
25
|
-
type?: string;
|
|
26
|
-
filter?: (node: Node) => boolean;
|
|
27
|
-
}> | Readonly<{
|
|
28
|
-
id: string;
|
|
29
|
-
position: import("@dxos/util").Position;
|
|
30
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
31
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
32
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
33
|
-
type?: string;
|
|
34
|
-
filter?: (node: Node) => boolean;
|
|
35
|
-
}>[] | (Readonly<{
|
|
36
|
-
id: string;
|
|
37
|
-
position: import("@dxos/util").Position;
|
|
38
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
39
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
40
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
41
|
-
type?: string;
|
|
42
|
-
filter?: (node: Node) => boolean;
|
|
43
|
-
}> | Readonly<{
|
|
44
|
-
id: string;
|
|
45
|
-
position: import("@dxos/util").Position;
|
|
46
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
47
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
48
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
49
|
-
type?: string;
|
|
50
|
-
filter?: (node: Node) => boolean;
|
|
51
|
-
}>[] | (Readonly<{
|
|
52
|
-
id: string;
|
|
53
|
-
position: import("@dxos/util").Position;
|
|
54
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
55
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
56
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
57
|
-
type?: string;
|
|
58
|
-
filter?: (node: Node) => boolean;
|
|
59
|
-
}> | Readonly<{
|
|
60
|
-
id: string;
|
|
61
|
-
position: import("@dxos/util").Position;
|
|
62
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
63
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
64
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
65
|
-
type?: string;
|
|
66
|
-
filter?: (node: Node) => boolean;
|
|
67
|
-
}>[] | (Readonly<{
|
|
68
|
-
id: string;
|
|
69
|
-
position: import("@dxos/util").Position;
|
|
70
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
71
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
72
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
73
|
-
type?: string;
|
|
74
|
-
filter?: (node: Node) => boolean;
|
|
75
|
-
}> | Readonly<{
|
|
76
|
-
id: string;
|
|
77
|
-
position: import("@dxos/util").Position;
|
|
78
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
79
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
80
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
81
|
-
type?: string;
|
|
82
|
-
filter?: (node: Node) => boolean;
|
|
83
|
-
}>[] | (Readonly<{
|
|
84
|
-
id: string;
|
|
85
|
-
position: import("@dxos/util").Position;
|
|
86
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
87
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
88
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
89
|
-
type?: string;
|
|
90
|
-
filter?: (node: Node) => boolean;
|
|
91
|
-
}> | Readonly<{
|
|
92
|
-
id: string;
|
|
93
|
-
position: import("@dxos/util").Position;
|
|
94
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
95
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
96
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
97
|
-
type?: string;
|
|
98
|
-
filter?: (node: Node) => boolean;
|
|
99
|
-
}>[] | (Readonly<{
|
|
100
|
-
id: string;
|
|
101
|
-
position: import("@dxos/util").Position;
|
|
102
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
103
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
104
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
105
|
-
type?: string;
|
|
106
|
-
filter?: (node: Node) => boolean;
|
|
107
|
-
}> | Readonly<{
|
|
108
|
-
id: string;
|
|
109
|
-
position: import("@dxos/util").Position;
|
|
110
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
111
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
112
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
113
|
-
type?: string;
|
|
114
|
-
filter?: (node: Node) => boolean;
|
|
115
|
-
}>[] | (Readonly<{
|
|
116
|
-
id: string;
|
|
117
|
-
position: import("@dxos/util").Position;
|
|
118
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
119
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
120
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
121
|
-
type?: string;
|
|
122
|
-
filter?: (node: Node) => boolean;
|
|
123
|
-
}> | Readonly<{
|
|
124
|
-
id: string;
|
|
125
|
-
position: import("@dxos/util").Position;
|
|
126
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
127
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
128
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
129
|
-
type?: string;
|
|
130
|
-
filter?: (node: Node) => boolean;
|
|
131
|
-
}>[] | (Readonly<{
|
|
132
|
-
id: string;
|
|
133
|
-
position: import("@dxos/util").Position;
|
|
134
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
135
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
136
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
137
|
-
type?: string;
|
|
138
|
-
filter?: (node: Node) => boolean;
|
|
139
|
-
}> | Readonly<{
|
|
140
|
-
id: string;
|
|
141
|
-
position: import("@dxos/util").Position;
|
|
142
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
143
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
144
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
145
|
-
type?: string;
|
|
146
|
-
filter?: (node: Node) => boolean;
|
|
147
|
-
}>[] | (Readonly<{
|
|
148
|
-
id: string;
|
|
149
|
-
position: import("@dxos/util").Position;
|
|
150
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
151
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
152
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
153
|
-
type?: string;
|
|
154
|
-
filter?: (node: Node) => boolean;
|
|
155
|
-
}> | Readonly<{
|
|
156
|
-
id: string;
|
|
157
|
-
position: import("@dxos/util").Position;
|
|
158
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
159
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
160
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
161
|
-
type?: string;
|
|
162
|
-
filter?: (node: Node) => boolean;
|
|
163
|
-
}>[] | (Readonly<{
|
|
164
|
-
id: string;
|
|
165
|
-
position: import("@dxos/util").Position;
|
|
166
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
167
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
168
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
169
|
-
type?: string;
|
|
170
|
-
filter?: (node: Node) => boolean;
|
|
171
|
-
}> | Readonly<{
|
|
172
|
-
id: string;
|
|
173
|
-
position: import("@dxos/util").Position;
|
|
174
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
175
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
176
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
177
|
-
type?: string;
|
|
178
|
-
filter?: (node: Node) => boolean;
|
|
179
|
-
}>[] | (Readonly<{
|
|
180
|
-
id: string;
|
|
181
|
-
position: import("@dxos/util").Position;
|
|
182
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
183
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
184
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
185
|
-
type?: string;
|
|
186
|
-
filter?: (node: Node) => boolean;
|
|
187
|
-
}> | Readonly<{
|
|
188
|
-
id: string;
|
|
189
|
-
position: import("@dxos/util").Position;
|
|
190
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
191
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
192
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
193
|
-
type?: string;
|
|
194
|
-
filter?: (node: Node) => boolean;
|
|
195
|
-
}>[] | /*elided*/ any)[])[])[])[])[])[])[])[])[])[])[]>;
|
|
196
|
-
export default _default;
|
|
197
|
-
//# sourceMappingURL=app-graph-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAM7D,OAAO,EAAgC,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;kCAGnD,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAvC,wBA4GK"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/intent-resolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAgB,MAAM,WAAW,CAAC;;AAIvD,wBAgBI"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { RootSettingsStore } from '@dxos/local-storage';
|
|
2
|
-
import { type PluginsContext } from '../core';
|
|
3
|
-
declare const _default: (context: PluginsContext) => import("../core").Capability<RootSettingsStore>;
|
|
4
|
-
export default _default;
|
|
5
|
-
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/store.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;kCAElC,cAAc;AAAvC,wBAUE"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
'en-US': {
|
|
3
|
-
"dxos.org/plugin/settings": {
|
|
4
|
-
'open settings label': string;
|
|
5
|
-
'app settings label': string;
|
|
6
|
-
'custom plugins label': string;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
}[];
|
|
10
|
-
export default _default;
|
|
11
|
-
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../../src/plugin-settings/translations.ts"],"names":[],"mappings":";;;;;;;;;AAMA,wBAUE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntentContext.d.ts","sourceRoot":"","sources":["../../../../src/react/IntentContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAA6B,KAAK,QAAQ,EAAa,MAAM,OAAO,CAAC;AAO1F,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE9E,QAAA,MAAM,aAAa,EAAE,OAAO,CAAC,aAAa,GAAG,SAAS,CAAuD,CAAC;AAE9G,eAAO,MAAM,mBAAmB,QAAO,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,iBAAiB,CAGxF,CAAC;AAEF,eAAO,MAAM,iBAAiB,WAAY,MAAM,YAAY,iBAAiB,SAW5E,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,aAAa,GAAG,SAAS,CAA0B,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { type PluginManager } from '../core';
|
|
4
|
-
declare const _default: {
|
|
5
|
-
title: string;
|
|
6
|
-
render: ({ manager }: {
|
|
7
|
-
manager: PluginManager;
|
|
8
|
-
}) => React.JSX.Element;
|
|
9
|
-
decorators: import("@storybook/react/*").Decorator[];
|
|
10
|
-
args: {
|
|
11
|
-
manager: PluginManager;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export default _default;
|
|
15
|
-
export declare const Default: {};
|
|
16
|
-
//# sourceMappingURL=Surface.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Surface.stories.d.ts","sourceRoot":"","sources":["../../../../src/react/Surface.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAgC,MAAM,OAAO,CAAC;AASrD,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;;;0BAkErB;QAAE,OAAO,EAAE,aAAa,CAAA;KAAE;;;;;;AAFlD,wBAcE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const useIntentDispatcher: () => import("..").IntentContext;
|
|
2
|
-
export declare const useAppGraph: () => Readonly<Pick<import("packages/sdk/app-graph/dist/types/src").GraphBuilder, "graph" | "explore">>;
|
|
3
|
-
export declare const useLayout: () => Readonly<{
|
|
4
|
-
mode: string;
|
|
5
|
-
dialogOpen: boolean;
|
|
6
|
-
sidebarOpen: boolean;
|
|
7
|
-
complementarySidebarOpen: boolean;
|
|
8
|
-
active: string[];
|
|
9
|
-
inactive: string[];
|
|
10
|
-
scrollIntoView: string | undefined;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/react/common.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB,kCAAqD,CAAC;AAEtF,eAAO,MAAM,WAAW,yGAA6C,CAAC;AAEtE,eAAO,MAAM,SAAS;;;;;;;;EAA2C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIntentResolver.d.ts","sourceRoot":"","sources":["../../../../src/react/useIntentResolver.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,eAAO,MAAM,iBAAiB,WAAY,MAAM,YAAY,iBAAiB,SAW5E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../src/worker.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AAEvB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { createExtension, type Node } from '@dxos/app-graph';
|
|
6
|
-
import { type SettingsStore, type SettingsValue } from '@dxos/local-storage';
|
|
7
|
-
import { nonNullable } from '@dxos/util';
|
|
8
|
-
|
|
9
|
-
import { SETTINGS_ID, SETTINGS_KEY, SETTINGS_PLUGIN, SettingsAction } from './actions';
|
|
10
|
-
import { Capabilities } from '../common';
|
|
11
|
-
import { contributes, type PluginMeta, type PluginsContext } from '../core';
|
|
12
|
-
import { createIntent } from '../plugin-intent';
|
|
13
|
-
|
|
14
|
-
export default (context: PluginsContext) =>
|
|
15
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
16
|
-
createExtension({
|
|
17
|
-
id: `${SETTINGS_PLUGIN}/action`,
|
|
18
|
-
filter: (node): node is Node<null> => node.id === 'root',
|
|
19
|
-
actions: () => [
|
|
20
|
-
{
|
|
21
|
-
id: SETTINGS_PLUGIN,
|
|
22
|
-
data: async () => {
|
|
23
|
-
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
24
|
-
await dispatch(createIntent(SettingsAction.Open));
|
|
25
|
-
},
|
|
26
|
-
properties: {
|
|
27
|
-
label: ['open settings label', { ns: SETTINGS_PLUGIN }],
|
|
28
|
-
icon: 'ph--gear--regular',
|
|
29
|
-
keyBinding: {
|
|
30
|
-
macos: 'meta+,',
|
|
31
|
-
windows: 'alt+,',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
],
|
|
36
|
-
}),
|
|
37
|
-
createExtension({
|
|
38
|
-
id: `${SETTINGS_PLUGIN}/core`,
|
|
39
|
-
filter: (node): node is Node<null> => node.id === 'root',
|
|
40
|
-
connector: () => [
|
|
41
|
-
{
|
|
42
|
-
id: SETTINGS_ID,
|
|
43
|
-
type: SETTINGS_PLUGIN,
|
|
44
|
-
properties: {
|
|
45
|
-
label: ['app settings label', { ns: SETTINGS_PLUGIN }],
|
|
46
|
-
icon: 'ph--gear--regular',
|
|
47
|
-
disposition: 'pin-end',
|
|
48
|
-
position: 'fallback',
|
|
49
|
-
testId: 'treeView.appSettings',
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
}),
|
|
54
|
-
createExtension({
|
|
55
|
-
id: `${SETTINGS_PLUGIN}/core-plugins`,
|
|
56
|
-
filter: (node): node is Node<null> => node.id === SETTINGS_ID,
|
|
57
|
-
connector: () => {
|
|
58
|
-
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
59
|
-
const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);
|
|
60
|
-
return [
|
|
61
|
-
...manager.plugins
|
|
62
|
-
.filter((plugin) => manager.core.includes(plugin.meta.id))
|
|
63
|
-
.map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {
|
|
64
|
-
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
65
|
-
if (!settings) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return [plugin.meta, settings];
|
|
70
|
-
})
|
|
71
|
-
.filter(nonNullable)
|
|
72
|
-
.map(([meta, settings]) => ({
|
|
73
|
-
id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
|
|
74
|
-
type: 'category',
|
|
75
|
-
data: settings,
|
|
76
|
-
properties: {
|
|
77
|
-
label: meta.name ?? meta.id,
|
|
78
|
-
icon: meta.icon ?? 'ph--circle--regular',
|
|
79
|
-
},
|
|
80
|
-
})),
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
id: `${SETTINGS_KEY}:custom-plugins`,
|
|
84
|
-
type: 'collection',
|
|
85
|
-
properties: {
|
|
86
|
-
label: ['custom plugins label', { ns: SETTINGS_PLUGIN }],
|
|
87
|
-
icon: 'ph--squares-four--regular',
|
|
88
|
-
role: 'branch',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
},
|
|
93
|
-
}),
|
|
94
|
-
createExtension({
|
|
95
|
-
id: `${SETTINGS_PLUGIN}/custom-plugins`,
|
|
96
|
-
filter: (node): node is Node<null> => node.id === `${SETTINGS_KEY}:custom-plugins`,
|
|
97
|
-
connector: () => {
|
|
98
|
-
const manager = context.requestCapability(Capabilities.PluginManager);
|
|
99
|
-
const [settingsStore] = context.requestCapabilities(Capabilities.SettingsStore);
|
|
100
|
-
return manager.plugins
|
|
101
|
-
.filter((plugin) => !manager.core.includes(plugin.meta.id))
|
|
102
|
-
.map((plugin): [PluginMeta, SettingsStore<SettingsValue>] | null => {
|
|
103
|
-
const settings = settingsStore?.getStore(plugin.meta.id);
|
|
104
|
-
if (!settings) {
|
|
105
|
-
return null;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return [plugin.meta, settings];
|
|
109
|
-
})
|
|
110
|
-
.filter(nonNullable)
|
|
111
|
-
.map(([meta, settings]) => ({
|
|
112
|
-
id: `${SETTINGS_KEY}:${meta.id.replaceAll('/', ':')}`,
|
|
113
|
-
type: 'category',
|
|
114
|
-
data: settings,
|
|
115
|
-
properties: {
|
|
116
|
-
label: meta.name ?? meta.id,
|
|
117
|
-
icon: meta.icon ?? 'ph--circle--regular',
|
|
118
|
-
},
|
|
119
|
-
}));
|
|
120
|
-
},
|
|
121
|
-
}),
|
|
122
|
-
]);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { pipe } from 'effect';
|
|
6
|
-
|
|
7
|
-
import { SETTINGS_ID, SETTINGS_KEY, SettingsAction } from './actions';
|
|
8
|
-
import { Capabilities, LayoutAction } from '../common';
|
|
9
|
-
import { contributes } from '../core';
|
|
10
|
-
import { createResolver, createIntent, chain } from '../plugin-intent';
|
|
11
|
-
|
|
12
|
-
export default () =>
|
|
13
|
-
contributes(
|
|
14
|
-
Capabilities.IntentResolver,
|
|
15
|
-
createResolver({
|
|
16
|
-
intent: SettingsAction.Open,
|
|
17
|
-
resolve: ({ plugin }) => {
|
|
18
|
-
return {
|
|
19
|
-
intents: [
|
|
20
|
-
pipe(
|
|
21
|
-
createIntent(LayoutAction.SwitchWorkspace, { part: 'workspace', subject: SETTINGS_ID }),
|
|
22
|
-
chain(LayoutAction.Open, { part: 'main', subject: [`${SETTINGS_KEY}:${plugin.replaceAll('/', ':')}`] }),
|
|
23
|
-
),
|
|
24
|
-
],
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { RootSettingsStore } from '@dxos/local-storage';
|
|
6
|
-
|
|
7
|
-
import { Capabilities } from '../common';
|
|
8
|
-
import { contributes, type PluginsContext } from '../core';
|
|
9
|
-
|
|
10
|
-
export default (context: PluginsContext) => {
|
|
11
|
-
// TODO(wittjosiah): This should subscribe to capabilities and create stores for newly added settings objects.
|
|
12
|
-
const allSettings = context.requestCapabilities(Capabilities.Settings);
|
|
13
|
-
const settingsStore = new RootSettingsStore();
|
|
14
|
-
|
|
15
|
-
allSettings.forEach((setting) => {
|
|
16
|
-
settingsStore.createStore(setting as any);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
return contributes(Capabilities.SettingsStore, settingsStore);
|
|
20
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { SETTINGS_PLUGIN } from './actions';
|
|
6
|
-
|
|
7
|
-
export default [
|
|
8
|
-
{
|
|
9
|
-
'en-US': {
|
|
10
|
-
[SETTINGS_PLUGIN]: {
|
|
11
|
-
'open settings label': 'Open settings',
|
|
12
|
-
'app settings label': 'Settings',
|
|
13
|
-
'custom plugins label': 'Plugins',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
];
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import React, { useCallback, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { faker } from '@dxos/random';
|
|
10
|
-
import { Button, List, ListItem } from '@dxos/react-ui';
|
|
11
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
12
|
-
|
|
13
|
-
import { PluginManagerProvider, usePluginManager } from './PluginManagerProvider';
|
|
14
|
-
import { Surface, useSurfaces } from './Surface';
|
|
15
|
-
import { Capabilities, createSurface } from '../common';
|
|
16
|
-
import { type PluginManager } from '../core';
|
|
17
|
-
import { setupPluginManager } from '../testing';
|
|
18
|
-
|
|
19
|
-
const randomColor = (): string => {
|
|
20
|
-
const hue = faker.number.int({ min: 0, max: 360 });
|
|
21
|
-
const saturation = faker.number.int({ min: 50, max: 90 });
|
|
22
|
-
const lightness = faker.number.int({ min: 40, max: 70 });
|
|
23
|
-
return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const Story = () => {
|
|
27
|
-
const manager = usePluginManager();
|
|
28
|
-
const surfaces = useSurfaces();
|
|
29
|
-
const [picked, setPicked] = useState('test');
|
|
30
|
-
|
|
31
|
-
const handleAdd = useCallback(() => {
|
|
32
|
-
const id = `test-${faker.number.int({ min: 0, max: 1_000_000 })}`;
|
|
33
|
-
const backgroundColor = randomColor();
|
|
34
|
-
|
|
35
|
-
manager.context.contributeCapability({
|
|
36
|
-
module: 'test',
|
|
37
|
-
interface: Capabilities.ReactSurface,
|
|
38
|
-
implementation: createSurface({
|
|
39
|
-
id,
|
|
40
|
-
role: id,
|
|
41
|
-
component: () => (
|
|
42
|
-
<div className='flex-1' style={{ backgroundColor }}>
|
|
43
|
-
{id}
|
|
44
|
-
</div>
|
|
45
|
-
),
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
setPicked(id);
|
|
50
|
-
}, [manager]);
|
|
51
|
-
|
|
52
|
-
const handlePick = useCallback(() => {
|
|
53
|
-
setPicked(faker.helpers.arrayElement(surfaces).id);
|
|
54
|
-
}, [surfaces]);
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div className='flex flex-col gap-2'>
|
|
58
|
-
<div className='flex gap-2'>
|
|
59
|
-
<Button onClick={handleAdd}>Add</Button>
|
|
60
|
-
<Button onClick={handlePick}>Pick</Button>
|
|
61
|
-
</div>
|
|
62
|
-
<div className='flex gap-2'>
|
|
63
|
-
<div className='flex-1'>
|
|
64
|
-
<List itemSizes='one'>
|
|
65
|
-
{surfaces.map((surface) => (
|
|
66
|
-
<ListItem.Root key={surface.id} id={surface.id}>
|
|
67
|
-
<ListItem.Heading classNames='grow pbs-2'>{surface.id}</ListItem.Heading>
|
|
68
|
-
</ListItem.Root>
|
|
69
|
-
))}
|
|
70
|
-
</List>
|
|
71
|
-
</div>
|
|
72
|
-
<div className='flex-1'>
|
|
73
|
-
<Surface role={picked} limit={1} />
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export default {
|
|
81
|
-
title: 'sdk/app-framework/Surface',
|
|
82
|
-
render: ({ manager }: { manager: PluginManager }) => {
|
|
83
|
-
return (
|
|
84
|
-
<PluginManagerProvider value={manager}>
|
|
85
|
-
<Story />
|
|
86
|
-
</PluginManagerProvider>
|
|
87
|
-
);
|
|
88
|
-
},
|
|
89
|
-
// NOTE: Intentionally not using withPluginManager to try to reduce surface area of the story.
|
|
90
|
-
decorators: [withTheme, withLayout({ tooltips: true })],
|
|
91
|
-
args: {
|
|
92
|
-
manager: setupPluginManager(),
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
export const Default = {};
|
package/src/react/common.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useCapability } from './useCapabilities';
|
|
6
|
-
import { Capabilities } from '../common';
|
|
7
|
-
|
|
8
|
-
export const useIntentDispatcher = () => useCapability(Capabilities.IntentDispatcher);
|
|
9
|
-
|
|
10
|
-
export const useAppGraph = () => useCapability(Capabilities.AppGraph);
|
|
11
|
-
|
|
12
|
-
export const useLayout = () => useCapability(Capabilities.Layout);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useEffect } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities } from '../common';
|
|
8
|
-
import { type AnyIntentResolver } from '../plugin-intent';
|
|
9
|
-
import { usePluginManager } from '../react';
|
|
10
|
-
|
|
11
|
-
export const useIntentResolver = (module: string, resolver: AnyIntentResolver) => {
|
|
12
|
-
const manager = usePluginManager();
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
manager.context.contributeCapability({
|
|
15
|
-
module,
|
|
16
|
-
interface: Capabilities.IntentResolver,
|
|
17
|
-
implementation: resolver,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return () => manager.context.removeCapability(Capabilities.IntentResolver, resolver);
|
|
21
|
-
}, [module, resolver]);
|
|
22
|
-
};
|
package/src/worker.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
// Entrypoint for using plugins in workers runtimes (e.g. Cloudflare Workers, etc.)
|
|
6
|
-
// Excludes all frontend code & dependencies (e.g. localStorage, React, etc.)
|
|
7
|
-
|
|
8
|
-
export * from './core';
|
|
9
|
-
// NOTE: Common includes browser capabilities but they are types only.
|
|
10
|
-
export * from './common';
|
|
11
|
-
export * from './plugin-intent';
|