@dxos/app-framework 0.3.10-main.cb1d9e2 → 0.3.10-main.cc91b2d
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 +230 -34
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +237 -46
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/plugins/PluginHost/PluginContext.d.ts +1 -8
- 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 +8 -0
- package/dist/types/src/plugins/PluginHost/plugin.d.ts.map +1 -1
- package/dist/types/src/plugins/common/index.d.ts +1 -0
- package/dist/types/src/plugins/common/index.d.ts.map +1 -1
- package/dist/types/src/plugins/common/layout.d.ts +9 -6
- package/dist/types/src/plugins/common/layout.d.ts.map +1 -1
- package/dist/types/src/plugins/common/settings.d.ts +8 -0
- package/dist/types/src/plugins/common/settings.d.ts.map +1 -0
- package/dist/types/src/plugins/components/CommandsDialog.d.ts +5 -0
- package/dist/types/src/plugins/components/CommandsDialog.d.ts.map +1 -0
- package/dist/types/src/plugins/components/SettingsDialog.d.ts +2 -0
- package/dist/types/src/plugins/components/SettingsDialog.d.ts.map +1 -0
- package/dist/types/src/plugins/components/SettingsValue.d.ts +8 -0
- package/dist/types/src/plugins/components/SettingsValue.d.ts.map +1 -0
- package/dist/types/src/plugins/components/index.d.ts +4 -0
- package/dist/types/src/plugins/components/index.d.ts.map +1 -0
- package/dist/types/src/plugins/index.d.ts +1 -0
- package/dist/types/src/plugins/index.d.ts.map +1 -1
- package/package.json +16 -9
- package/src/plugins/PluginHost/PluginContext.tsx +2 -11
- package/src/plugins/PluginHost/PluginHost.tsx +6 -5
- package/src/plugins/PluginHost/plugin.ts +5 -0
- package/src/plugins/common/index.ts +1 -0
- package/src/plugins/common/layout.ts +10 -3
- package/src/plugins/common/settings.ts +16 -0
- package/src/plugins/components/CommandsDialog.tsx +100 -0
- package/src/plugins/components/SettingsDialog.tsx +98 -0
- package/src/plugins/components/SettingsValue.tsx +36 -0
- package/src/plugins/components/index.ts +7 -0
- package/src/plugins/index.ts +1 -0
- package/tsconfig.json +15 -0
|
@@ -29,11 +29,12 @@ var Layout = z.object({
|
|
|
29
29
|
fullscreen: z.boolean(),
|
|
30
30
|
sidebarOpen: z.boolean(),
|
|
31
31
|
complementarySidebarOpen: z.boolean(),
|
|
32
|
-
|
|
32
|
+
// TODO(burdon): Why do we have a single root?
|
|
33
33
|
dialogOpen: z.boolean(),
|
|
34
|
-
|
|
35
|
-
popoverContent: z.any().optional().describe("Data to be passed to the popover Surface."),
|
|
34
|
+
dialogContent: z.any().optional().describe("Data to be passed to the dialog Surface."),
|
|
36
35
|
popoverOpen: z.boolean(),
|
|
36
|
+
popoverContent: z.any().optional().describe("Data to be passed to the popover Surface."),
|
|
37
|
+
popoverAnchorId: z.string().optional(),
|
|
37
38
|
// TODO(wittjosiah): Array?
|
|
38
39
|
active: z.string().optional().describe("Id of the currently active item."),
|
|
39
40
|
// TODO(wittjosiah): History?
|
|
@@ -54,6 +55,12 @@ var LayoutAction;
|
|
|
54
55
|
LayoutAction2[LayoutAction2["OPEN_POPOVER"] = `${LAYOUT_ACTION}/open-popover`] = "OPEN_POPOVER";
|
|
55
56
|
LayoutAction2[LayoutAction2["CLOSE_POPOVER"] = `${LAYOUT_ACTION}/close-popover`] = "CLOSE_POPOVER";
|
|
56
57
|
LayoutAction2[LayoutAction2["ACTIVATE"] = `${LAYOUT_ACTION}/activate`] = "ACTIVATE";
|
|
58
|
+
LayoutAction2[LayoutAction2[
|
|
59
|
+
// TODO(burdon): Move to new plugin.
|
|
60
|
+
"OPEN_COMMANDS"
|
|
61
|
+
] = `${LAYOUT_ACTION}/open-commands`] = "OPEN_COMMANDS";
|
|
62
|
+
LayoutAction2[LayoutAction2["OPEN_SETTINGS"] = `${LAYOUT_ACTION}/open-settings`] = "OPEN_SETTINGS";
|
|
63
|
+
LayoutAction2[LayoutAction2["OPEN_SHORTCUTS"] = `${LAYOUT_ACTION}/open-shortcuts`] = "OPEN_SHORTCUTS";
|
|
57
64
|
})(LayoutAction || (LayoutAction = {}));
|
|
58
65
|
|
|
59
66
|
// packages/sdk/app-framework/src/plugins/common/metadata.ts
|
|
@@ -77,6 +84,99 @@ var parseTranslationsPlugin = (plugin) => {
|
|
|
77
84
|
return success ? plugin : void 0;
|
|
78
85
|
};
|
|
79
86
|
|
|
87
|
+
// packages/sdk/app-framework/src/plugins/components/CommandsDialog.tsx
|
|
88
|
+
import { DotOutline } from "@phosphor-icons/react";
|
|
89
|
+
import React, { useMemo, useRef } from "react";
|
|
90
|
+
import { Keyboard, keySymbols } from "@dxos/keyboard";
|
|
91
|
+
import { Button, Dialog, useTranslation } from "@dxos/react-ui";
|
|
92
|
+
import { SearchList } from "@dxos/react-ui-searchlist";
|
|
93
|
+
import { descriptionText, getSize, mx } from "@dxos/react-ui-theme";
|
|
94
|
+
var CommandsDialogContent = ({ graph }) => {
|
|
95
|
+
const { t } = useTranslation("os");
|
|
96
|
+
const toString = (label) => Array.isArray(label) ? t(...label) : label;
|
|
97
|
+
const actions = useMemo(() => {
|
|
98
|
+
const current = Keyboard.singleton.getCurrentContext();
|
|
99
|
+
const actionMap = /* @__PURE__ */ new Set();
|
|
100
|
+
const actions2 = [];
|
|
101
|
+
graph?.traverse({
|
|
102
|
+
visitor: (node, path) => {
|
|
103
|
+
if (current.startsWith(path.join("/"))) {
|
|
104
|
+
node.actions.forEach((action) => {
|
|
105
|
+
if (!actionMap.has(action.id)) {
|
|
106
|
+
actionMap.add(action.id);
|
|
107
|
+
actions2.push(action);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
actions2.sort(({ label: a }, { label: b }) => {
|
|
114
|
+
return toString(a)?.toLowerCase().localeCompare(toString(b)?.toLowerCase());
|
|
115
|
+
});
|
|
116
|
+
return actions2;
|
|
117
|
+
}, [
|
|
118
|
+
graph
|
|
119
|
+
]);
|
|
120
|
+
const buttonRef = useRef(null);
|
|
121
|
+
return /* @__PURE__ */ React.createElement(Dialog.Content, {
|
|
122
|
+
classNames: [
|
|
123
|
+
"md:max-is-[30rem] overflow-hidden"
|
|
124
|
+
]
|
|
125
|
+
}, /* @__PURE__ */ React.createElement(Dialog.Title, null, t("commands dialog title", {
|
|
126
|
+
ns: "os"
|
|
127
|
+
})), /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
128
|
+
label: t("commandlist input placeholder"),
|
|
129
|
+
classNames: "flex flex-col grow overflow-hidden my-2"
|
|
130
|
+
}, /* @__PURE__ */ React.createElement(SearchList.Input, {
|
|
131
|
+
placeholder: t("commandlist input placeholder"),
|
|
132
|
+
classNames: mx("px-1 my-2")
|
|
133
|
+
}), /* @__PURE__ */ React.createElement(SearchList.Content, {
|
|
134
|
+
classNames: [
|
|
135
|
+
"max-bs-[30rem] overflow-auto"
|
|
136
|
+
]
|
|
137
|
+
}, actions?.map((action) => {
|
|
138
|
+
const label = toString(action.label);
|
|
139
|
+
const Icon = action.icon ?? DotOutline;
|
|
140
|
+
return /* @__PURE__ */ React.createElement(SearchList.Item, {
|
|
141
|
+
value: label,
|
|
142
|
+
key: action.id,
|
|
143
|
+
onSelect: () => {
|
|
144
|
+
if (action.properties.disabled) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
buttonRef.current?.click();
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
void action.invoke();
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
classNames: "flex items-center gap-2",
|
|
153
|
+
disabled: action.properties.disabled,
|
|
154
|
+
...action.properties?.testId && {
|
|
155
|
+
"data-testid": action.properties.testId
|
|
156
|
+
}
|
|
157
|
+
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
158
|
+
className: mx(getSize(4), "shrink-0", !action.icon && "invisible")
|
|
159
|
+
}), /* @__PURE__ */ React.createElement("span", {
|
|
160
|
+
className: "grow truncate"
|
|
161
|
+
}, label), action.keyBinding && /* @__PURE__ */ React.createElement("span", {
|
|
162
|
+
className: mx("shrink-0", descriptionText)
|
|
163
|
+
}, keySymbols(action.keyBinding).join("")));
|
|
164
|
+
}))), /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
165
|
+
asChild: true
|
|
166
|
+
}, /* @__PURE__ */ React.createElement(Button, {
|
|
167
|
+
ref: buttonRef,
|
|
168
|
+
variant: "primary",
|
|
169
|
+
classNames: "mbs-2"
|
|
170
|
+
}, t("close label", {
|
|
171
|
+
ns: "os"
|
|
172
|
+
}))));
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// packages/sdk/app-framework/src/plugins/components/SettingsDialog.tsx
|
|
176
|
+
import React5, { useState } from "react";
|
|
177
|
+
import { Button as Button2, Dialog as Dialog2, List, ListItem, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
178
|
+
import { ghostHover, ghostSelected, groupBorder, mx as mx2 } from "@dxos/react-ui-theme";
|
|
179
|
+
|
|
80
180
|
// packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts
|
|
81
181
|
var pluginMeta = (meta) => meta;
|
|
82
182
|
var Plugin;
|
|
@@ -95,9 +195,7 @@ var PluginContext = /* @__PURE__ */ createContext({
|
|
|
95
195
|
enabled: [],
|
|
96
196
|
plugins: [],
|
|
97
197
|
available: [],
|
|
98
|
-
|
|
99
|
-
},
|
|
100
|
-
disablePlugin: () => {
|
|
198
|
+
setPlugin: () => {
|
|
101
199
|
}
|
|
102
200
|
});
|
|
103
201
|
var usePlugins = () => useContext(PluginContext);
|
|
@@ -113,7 +211,7 @@ var PluginProvider = PluginContext.Provider;
|
|
|
113
211
|
|
|
114
212
|
// packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx
|
|
115
213
|
import { shallow } from "deepsignal/react";
|
|
116
|
-
import
|
|
214
|
+
import React2, { useEffect } from "react";
|
|
117
215
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
118
216
|
import { log } from "@dxos/log";
|
|
119
217
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx";
|
|
@@ -127,14 +225,15 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
127
225
|
],
|
|
128
226
|
plugins: [],
|
|
129
227
|
available: order.filter(({ id }) => !core.includes(id)),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
228
|
+
setPlugin: (id, enabled) => {
|
|
229
|
+
if (enabled) {
|
|
230
|
+
state.values.enabled = [
|
|
231
|
+
...state.values.enabled,
|
|
232
|
+
id
|
|
233
|
+
];
|
|
234
|
+
} else {
|
|
235
|
+
state.values.enabled = state.values.enabled.filter((enabled2) => enabled2 !== id);
|
|
236
|
+
}
|
|
138
237
|
}
|
|
139
238
|
});
|
|
140
239
|
state.prop(state.values.$enabled, "enabled", LocalStorageStore.json);
|
|
@@ -145,7 +244,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
145
244
|
},
|
|
146
245
|
provides: {
|
|
147
246
|
plugins: state.values,
|
|
148
|
-
context: ({ children }) => /* @__PURE__ */
|
|
247
|
+
context: ({ children }) => /* @__PURE__ */ React2.createElement(PluginProvider, {
|
|
149
248
|
value: state.values
|
|
150
249
|
}, children),
|
|
151
250
|
root: () => {
|
|
@@ -154,7 +253,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
154
253
|
enabled: state.values.enabled
|
|
155
254
|
}, {
|
|
156
255
|
F: __dxlog_file,
|
|
157
|
-
L:
|
|
256
|
+
L: 67,
|
|
158
257
|
S: void 0,
|
|
159
258
|
C: (f, a) => f(...a)
|
|
160
259
|
});
|
|
@@ -179,7 +278,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
179
278
|
plugins
|
|
180
279
|
}, {
|
|
181
280
|
F: __dxlog_file,
|
|
182
|
-
L:
|
|
281
|
+
L: 92,
|
|
183
282
|
S: void 0,
|
|
184
283
|
C: (f, a) => f(...a)
|
|
185
284
|
});
|
|
@@ -190,7 +289,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
190
289
|
plugins
|
|
191
290
|
}, {
|
|
192
291
|
F: __dxlog_file,
|
|
193
|
-
L:
|
|
292
|
+
L: 99,
|
|
194
293
|
S: void 0,
|
|
195
294
|
C: (f, a) => f(...a)
|
|
196
295
|
});
|
|
@@ -203,10 +302,10 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
203
302
|
};
|
|
204
303
|
}, []);
|
|
205
304
|
if (!state.values.ready) {
|
|
206
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, fallback);
|
|
207
306
|
}
|
|
208
307
|
const ComposedContext = composeContext(state.values.plugins);
|
|
209
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ React2.createElement(ComposedContext, null, rootComponents(state.values.plugins));
|
|
210
309
|
}
|
|
211
310
|
}
|
|
212
311
|
};
|
|
@@ -225,7 +324,7 @@ var rootComponents = (plugins) => {
|
|
|
225
324
|
return plugins.map((plugin) => {
|
|
226
325
|
const Component2 = plugin.provides.root;
|
|
227
326
|
if (Component2) {
|
|
228
|
-
return /* @__PURE__ */
|
|
327
|
+
return /* @__PURE__ */ React2.createElement(Component2, {
|
|
229
328
|
key: plugin.meta.id
|
|
230
329
|
});
|
|
231
330
|
} else {
|
|
@@ -239,14 +338,14 @@ var composeContext = (plugins) => {
|
|
|
239
338
|
var compose = (contexts) => {
|
|
240
339
|
return [
|
|
241
340
|
...contexts
|
|
242
|
-
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */
|
|
341
|
+
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React2.createElement(Acc, null, /* @__PURE__ */ React2.createElement(Next, null, children)));
|
|
243
342
|
};
|
|
244
343
|
|
|
245
344
|
// packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts
|
|
246
345
|
var isObject = (data) => !!data && typeof data === "object";
|
|
247
346
|
|
|
248
347
|
// packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx
|
|
249
|
-
import
|
|
348
|
+
import React3, { Component } from "react";
|
|
250
349
|
var ErrorBoundary = class extends Component {
|
|
251
350
|
constructor(props) {
|
|
252
351
|
super(props);
|
|
@@ -266,7 +365,7 @@ var ErrorBoundary = class extends Component {
|
|
|
266
365
|
}
|
|
267
366
|
render() {
|
|
268
367
|
if (this.state.error) {
|
|
269
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ React3.createElement(this.props.fallback, {
|
|
270
369
|
error: this.state.error,
|
|
271
370
|
reset: this.resetError
|
|
272
371
|
});
|
|
@@ -281,7 +380,7 @@ var ErrorBoundary = class extends Component {
|
|
|
281
380
|
};
|
|
282
381
|
|
|
283
382
|
// packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx
|
|
284
|
-
import
|
|
383
|
+
import React4, { forwardRef, Fragment, isValidElement } from "react";
|
|
285
384
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
286
385
|
var Surface = /* @__PURE__ */ forwardRef(({ role, name = role, fallback, ...rest }, forwardedRef) => {
|
|
287
386
|
const props = {
|
|
@@ -292,13 +391,13 @@ var Surface = /* @__PURE__ */ forwardRef(({ role, name = role, fallback, ...rest
|
|
|
292
391
|
};
|
|
293
392
|
const context = useContext2(SurfaceContext);
|
|
294
393
|
const data = props.data ?? (name && context?.surfaces?.[name]?.data || {});
|
|
295
|
-
return /* @__PURE__ */
|
|
394
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, fallback ? /* @__PURE__ */ React4.createElement(ErrorBoundary, {
|
|
296
395
|
data,
|
|
297
396
|
fallback
|
|
298
|
-
}, /* @__PURE__ */
|
|
397
|
+
}, /* @__PURE__ */ React4.createElement(SurfaceResolver, {
|
|
299
398
|
...props,
|
|
300
399
|
ref: forwardedRef
|
|
301
|
-
})) : /* @__PURE__ */
|
|
400
|
+
})) : /* @__PURE__ */ React4.createElement(SurfaceResolver, {
|
|
302
401
|
...props,
|
|
303
402
|
ref: forwardedRef
|
|
304
403
|
}));
|
|
@@ -315,9 +414,9 @@ var SurfaceResolver = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
315
414
|
...props.surfaces
|
|
316
415
|
}
|
|
317
416
|
};
|
|
318
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ React4.createElement(SurfaceContext.Provider, {
|
|
319
418
|
value: currentContext
|
|
320
|
-
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */
|
|
419
|
+
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */ React4.createElement(props.contentFallback, null) : null);
|
|
321
420
|
});
|
|
322
421
|
var resolveNodes = (components, props, context, forwardedRef) => {
|
|
323
422
|
const data = {
|
|
@@ -352,14 +451,108 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
352
451
|
return 1;
|
|
353
452
|
}
|
|
354
453
|
return 0;
|
|
355
|
-
}).map(([key, result]) => /* @__PURE__ */
|
|
454
|
+
}).map(([key, result]) => /* @__PURE__ */ React4.createElement(Fragment, {
|
|
356
455
|
key
|
|
357
456
|
}, result.node));
|
|
358
457
|
return props.limit ? nodes.slice(0, props.limit) : nodes;
|
|
359
458
|
};
|
|
360
459
|
|
|
460
|
+
// packages/sdk/app-framework/src/plugins/components/SettingsDialog.tsx
|
|
461
|
+
var SettingsDialogContent = () => {
|
|
462
|
+
const { t } = useTranslation2("os");
|
|
463
|
+
const [plugin, setPlugin] = useState("dxos.org/plugin/registry");
|
|
464
|
+
const { plugins, enabled } = usePlugins();
|
|
465
|
+
const core = [
|
|
466
|
+
"dxos.org/plugin/layout",
|
|
467
|
+
"dxos.org/plugin/client",
|
|
468
|
+
"dxos.org/plugin/space",
|
|
469
|
+
"dxos.org/plugin/registry"
|
|
470
|
+
];
|
|
471
|
+
const filteredPlugins = enabled.map((id) => plugins.find((plugin2) => plugin2.meta.id === id)).filter((plugin2) => plugin2?.provides?.settings).map((plugin2) => plugin2.meta).sort(({ name: a }, { name: b }) => a?.localeCompare(b ?? "") ?? 0);
|
|
472
|
+
return /* @__PURE__ */ React5.createElement(Dialog2.Content, {
|
|
473
|
+
classNames: [
|
|
474
|
+
"h-full md:max-is-[40rem] overflow-hidden"
|
|
475
|
+
]
|
|
476
|
+
}, /* @__PURE__ */ React5.createElement(Dialog2.Title, null, t("settings dialog title", {
|
|
477
|
+
ns: "os"
|
|
478
|
+
})), /* @__PURE__ */ React5.createElement("div", {
|
|
479
|
+
className: "flex grow mlb-4 overflow-hidden"
|
|
480
|
+
}, /* @__PURE__ */ React5.createElement("div", {
|
|
481
|
+
className: mx2("flex flex-col w-[200px] space-y-4 pr-4 border-r overflow-y-auto", groupBorder)
|
|
482
|
+
}, /* @__PURE__ */ React5.createElement(PluginList, {
|
|
483
|
+
title: "Options",
|
|
484
|
+
plugins: core.map((id) => plugins.find((p) => p.meta.id === id).meta),
|
|
485
|
+
selected: plugin,
|
|
486
|
+
onSelect: (plugin2) => setPlugin(plugin2)
|
|
487
|
+
}), /* @__PURE__ */ React5.createElement(PluginList, {
|
|
488
|
+
title: "Plugins",
|
|
489
|
+
plugins: filteredPlugins,
|
|
490
|
+
selected: plugin,
|
|
491
|
+
onSelect: (plugin2) => setPlugin(plugin2)
|
|
492
|
+
})), /* @__PURE__ */ React5.createElement("div", {
|
|
493
|
+
className: mx2("flex flex-col w-full md:px-4 divide-y overflow-y-auto", groupBorder)
|
|
494
|
+
}, /* @__PURE__ */ React5.createElement(Surface, {
|
|
495
|
+
role: "settings",
|
|
496
|
+
data: {
|
|
497
|
+
plugin
|
|
498
|
+
}
|
|
499
|
+
}))), /* @__PURE__ */ React5.createElement(Dialog2.Close, {
|
|
500
|
+
asChild: true
|
|
501
|
+
}, /* @__PURE__ */ React5.createElement(Button2, {
|
|
502
|
+
variant: "primary",
|
|
503
|
+
classNames: "mbs-2",
|
|
504
|
+
autoFocus: true
|
|
505
|
+
}, t("done label", {
|
|
506
|
+
ns: "os"
|
|
507
|
+
}))));
|
|
508
|
+
};
|
|
509
|
+
var PluginList = ({ title, plugins, selected, onSelect }) => {
|
|
510
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
511
|
+
role: "none"
|
|
512
|
+
}, /* @__PURE__ */ React5.createElement("h2", {
|
|
513
|
+
className: "my-1 px-2 text-sm text-neutral-500"
|
|
514
|
+
}, title), /* @__PURE__ */ React5.createElement(List, {
|
|
515
|
+
selectable: true
|
|
516
|
+
}, plugins.map((plugin) => /* @__PURE__ */ React5.createElement(ListItem.Root, {
|
|
517
|
+
key: plugin.id,
|
|
518
|
+
onClick: () => onSelect(plugin.id),
|
|
519
|
+
selected: plugin.id === selected,
|
|
520
|
+
classNames: [
|
|
521
|
+
"px-2 rounded",
|
|
522
|
+
plugin.id === selected && ghostSelected,
|
|
523
|
+
ghostHover
|
|
524
|
+
]
|
|
525
|
+
}, /* @__PURE__ */ React5.createElement(ListItem.Heading, {
|
|
526
|
+
classNames: [
|
|
527
|
+
"flex w-full items-center cursor-pointer"
|
|
528
|
+
]
|
|
529
|
+
}, plugin.name)))));
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
// packages/sdk/app-framework/src/plugins/components/SettingsValue.tsx
|
|
533
|
+
import React6 from "react";
|
|
534
|
+
import { Input } from "@dxos/react-ui";
|
|
535
|
+
var SettingsValue = ({ label, description, children }) => {
|
|
536
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
537
|
+
role: "none",
|
|
538
|
+
className: "flex w-full gap-4 py-1"
|
|
539
|
+
}, /* @__PURE__ */ React6.createElement(Input.Root, null, /* @__PURE__ */ React6.createElement("div", {
|
|
540
|
+
role: "none",
|
|
541
|
+
className: "flex flex-col w-full"
|
|
542
|
+
}, /* @__PURE__ */ React6.createElement(Input.Label, {
|
|
543
|
+
classNames: "flex min-h-[40px] items-center"
|
|
544
|
+
}, label), description && /* @__PURE__ */ React6.createElement(Input.DescriptionAndValidation, {
|
|
545
|
+
classNames: "mbs-0.5"
|
|
546
|
+
}, /* @__PURE__ */ React6.createElement(Input.Description, null, description))), /* @__PURE__ */ React6.createElement("div", {
|
|
547
|
+
role: "none"
|
|
548
|
+
}, /* @__PURE__ */ React6.createElement("div", {
|
|
549
|
+
role: "none",
|
|
550
|
+
className: "flex min-h-[40px] items-center"
|
|
551
|
+
}, children))));
|
|
552
|
+
};
|
|
553
|
+
|
|
361
554
|
// packages/sdk/app-framework/src/App.tsx
|
|
362
|
-
import
|
|
555
|
+
import React7 from "react";
|
|
363
556
|
import { invariant } from "@dxos/invariant";
|
|
364
557
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
365
558
|
var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }) => {
|
|
@@ -401,9 +594,10 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
401
594
|
});
|
|
402
595
|
const Context = host.provides.context;
|
|
403
596
|
const Root = host.provides.root;
|
|
404
|
-
return () => /* @__PURE__ */
|
|
597
|
+
return () => /* @__PURE__ */ React7.createElement(Context, null, /* @__PURE__ */ React7.createElement(Root, null));
|
|
405
598
|
};
|
|
406
599
|
export {
|
|
600
|
+
CommandsDialogContent,
|
|
407
601
|
ErrorBoundary,
|
|
408
602
|
IntentProvider,
|
|
409
603
|
Layout,
|
|
@@ -414,6 +608,8 @@ export {
|
|
|
414
608
|
Resource,
|
|
415
609
|
ResourceKey,
|
|
416
610
|
ResourceLanguage,
|
|
611
|
+
SettingsDialogContent,
|
|
612
|
+
SettingsValue,
|
|
417
613
|
Surface,
|
|
418
614
|
SurfaceProvider,
|
|
419
615
|
createApp,
|