@dxos/app-framework 0.3.10-main.dcfebef → 0.3.10-main.e948ee0
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 +141 -92
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +156 -107
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/types/src/plugins/common/layout.d.ts +3 -2
- package/dist/types/src/plugins/common/layout.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/types/src/plugins/components/index.d.ts +1 -1
- package/dist/types/src/plugins/components/index.d.ts.map +1 -1
- package/package.json +14 -13
- package/src/plugins/common/layout.ts +4 -1
- package/src/plugins/components/CommandsDialog.tsx +100 -0
- package/src/plugins/components/SettingsDialog.tsx +28 -30
- package/src/plugins/components/index.ts +1 -1
- package/tsconfig.json +3 -0
- package/dist/types/src/plugins/components/ShortcutsDialog.d.ts +0 -2
- package/dist/types/src/plugins/components/ShortcutsDialog.d.ts.map +0 -1
- package/src/plugins/components/ShortcutsDialog.tsx +0 -61
package/dist/lib/node/index.cjs
CHANGED
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var node_exports = {};
|
|
30
30
|
__export(node_exports, {
|
|
31
|
+
CommandsDialogContent: () => CommandsDialogContent,
|
|
31
32
|
ErrorBoundary: () => ErrorBoundary,
|
|
32
33
|
IntentProvider: () => import_chunk_BOQBLWMX.IntentProvider,
|
|
33
34
|
Layout: () => Layout,
|
|
@@ -40,7 +41,6 @@ __export(node_exports, {
|
|
|
40
41
|
ResourceLanguage: () => ResourceLanguage,
|
|
41
42
|
SettingsDialogContent: () => SettingsDialogContent,
|
|
42
43
|
SettingsValue: () => SettingsValue,
|
|
43
|
-
ShortcutsDialogContent: () => ShortcutsDialogContent,
|
|
44
44
|
Surface: () => Surface,
|
|
45
45
|
SurfaceProvider: () => import_chunk_DC3GU6QR.SurfaceProvider,
|
|
46
46
|
createApp: () => createApp,
|
|
@@ -74,24 +74,26 @@ var import_chunk_BOQBLWMX = require("./chunk-BOQBLWMX.cjs");
|
|
|
74
74
|
var import_chunk_VDKZ7AAF = require("./chunk-VDKZ7AAF.cjs");
|
|
75
75
|
var import_zod = require("zod");
|
|
76
76
|
var import_zod2 = require("zod");
|
|
77
|
-
var import_react =
|
|
77
|
+
var import_react = require("@phosphor-icons/react");
|
|
78
|
+
var import_react2 = __toESM(require("react"));
|
|
79
|
+
var import_keyboard = require("@dxos/keyboard");
|
|
78
80
|
var import_react_ui = require("@dxos/react-ui");
|
|
81
|
+
var import_react_ui_searchlist = require("@dxos/react-ui-searchlist");
|
|
79
82
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
80
|
-
var
|
|
81
|
-
var
|
|
82
|
-
var
|
|
83
|
+
var import_react3 = __toESM(require("react"));
|
|
84
|
+
var import_react_ui2 = require("@dxos/react-ui");
|
|
85
|
+
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
86
|
+
var import_react4 = require("react");
|
|
87
|
+
var import_react5 = require("deepsignal/react");
|
|
88
|
+
var import_react6 = __toESM(require("react"));
|
|
83
89
|
var import_local_storage = require("@dxos/local-storage");
|
|
84
90
|
var import_log = require("@dxos/log");
|
|
85
|
-
var
|
|
86
|
-
var import_react6 = __toESM(require("react"));
|
|
87
|
-
var import_react7 = require("react");
|
|
91
|
+
var import_react7 = __toESM(require("react"));
|
|
88
92
|
var import_react8 = __toESM(require("react"));
|
|
89
|
-
var
|
|
90
|
-
var import_react9 = __toESM(require("react"));
|
|
91
|
-
var import_keyboard = require("@dxos/keyboard");
|
|
92
|
-
var import_react_ui3 = require("@dxos/react-ui");
|
|
93
|
-
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
93
|
+
var import_react9 = require("react");
|
|
94
94
|
var import_react10 = __toESM(require("react"));
|
|
95
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
96
|
+
var import_react11 = __toESM(require("react"));
|
|
95
97
|
var import_invariant = require("@dxos/invariant");
|
|
96
98
|
var parseGraphPlugin = (plugin) => plugin.provides.graph?.root ? plugin : void 0;
|
|
97
99
|
var parseGraphBuilderPlugin = (plugin) => plugin.provides.graph?.builder ? plugin : void 0;
|
|
@@ -124,9 +126,13 @@ var LayoutAction;
|
|
|
124
126
|
LayoutAction2[LayoutAction2["CLOSE_DIALOG"] = `${LAYOUT_ACTION}/close-dialog`] = "CLOSE_DIALOG";
|
|
125
127
|
LayoutAction2[LayoutAction2["OPEN_POPOVER"] = `${LAYOUT_ACTION}/open-popover`] = "OPEN_POPOVER";
|
|
126
128
|
LayoutAction2[LayoutAction2["CLOSE_POPOVER"] = `${LAYOUT_ACTION}/close-popover`] = "CLOSE_POPOVER";
|
|
129
|
+
LayoutAction2[LayoutAction2["ACTIVATE"] = `${LAYOUT_ACTION}/activate`] = "ACTIVATE";
|
|
130
|
+
LayoutAction2[LayoutAction2[
|
|
131
|
+
// TODO(burdon): Move to new plugin.
|
|
132
|
+
"OPEN_COMMANDS"
|
|
133
|
+
] = `${LAYOUT_ACTION}/open-commands`] = "OPEN_COMMANDS";
|
|
127
134
|
LayoutAction2[LayoutAction2["OPEN_SETTINGS"] = `${LAYOUT_ACTION}/open-settings`] = "OPEN_SETTINGS";
|
|
128
135
|
LayoutAction2[LayoutAction2["OPEN_SHORTCUTS"] = `${LAYOUT_ACTION}/open-shortcuts`] = "OPEN_SHORTCUTS";
|
|
129
|
-
LayoutAction2[LayoutAction2["ACTIVATE"] = `${LAYOUT_ACTION}/activate`] = "ACTIVATE";
|
|
130
136
|
})(LayoutAction || (LayoutAction = {}));
|
|
131
137
|
var parseMetadataRecordsPlugin = (plugin) => {
|
|
132
138
|
return plugin.provides.metadata?.records ? plugin : void 0;
|
|
@@ -144,6 +150,86 @@ var parseTranslationsPlugin = (plugin) => {
|
|
|
144
150
|
const { success } = import_zod2.z.array(Resource).safeParse(plugin.provides.translations);
|
|
145
151
|
return success ? plugin : void 0;
|
|
146
152
|
};
|
|
153
|
+
var CommandsDialogContent = ({ graph }) => {
|
|
154
|
+
const { t } = (0, import_react_ui.useTranslation)("os");
|
|
155
|
+
const toString = (label) => Array.isArray(label) ? t(...label) : label;
|
|
156
|
+
const actions = (0, import_react2.useMemo)(() => {
|
|
157
|
+
const current = import_keyboard.Keyboard.singleton.getCurrentContext();
|
|
158
|
+
const actionMap = /* @__PURE__ */ new Set();
|
|
159
|
+
const actions2 = [];
|
|
160
|
+
graph?.traverse({
|
|
161
|
+
visitor: (node, path) => {
|
|
162
|
+
if (current.startsWith(path.join("/"))) {
|
|
163
|
+
node.actions.forEach((action) => {
|
|
164
|
+
if (!actionMap.has(action.id)) {
|
|
165
|
+
actionMap.add(action.id);
|
|
166
|
+
actions2.push(action);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
actions2.sort(({ label: a }, { label: b }) => {
|
|
173
|
+
return toString(a)?.toLowerCase().localeCompare(toString(b)?.toLowerCase());
|
|
174
|
+
});
|
|
175
|
+
return actions2;
|
|
176
|
+
}, [
|
|
177
|
+
graph
|
|
178
|
+
]);
|
|
179
|
+
const buttonRef = (0, import_react2.useRef)(null);
|
|
180
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Content, {
|
|
181
|
+
classNames: [
|
|
182
|
+
"md:max-is-[30rem] overflow-hidden"
|
|
183
|
+
]
|
|
184
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Title, null, t("commands dialog title", {
|
|
185
|
+
ns: "os"
|
|
186
|
+
})), /* @__PURE__ */ import_react2.default.createElement(import_react_ui_searchlist.SearchList.Root, {
|
|
187
|
+
label: t("commandlist input placeholder"),
|
|
188
|
+
classNames: "flex flex-col grow overflow-hidden my-2"
|
|
189
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui_searchlist.SearchList.Input, {
|
|
190
|
+
placeholder: t("commandlist input placeholder"),
|
|
191
|
+
classNames: (0, import_react_ui_theme.mx)("px-1 my-2")
|
|
192
|
+
}), /* @__PURE__ */ import_react2.default.createElement(import_react_ui_searchlist.SearchList.Content, {
|
|
193
|
+
classNames: [
|
|
194
|
+
"max-bs-[30rem] overflow-auto"
|
|
195
|
+
]
|
|
196
|
+
}, actions?.map((action) => {
|
|
197
|
+
const label = toString(action.label);
|
|
198
|
+
const Icon = action.icon ?? import_react.DotOutline;
|
|
199
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react_ui_searchlist.SearchList.Item, {
|
|
200
|
+
value: label,
|
|
201
|
+
key: action.id,
|
|
202
|
+
onSelect: () => {
|
|
203
|
+
if (action.properties.disabled) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
buttonRef.current?.click();
|
|
207
|
+
setTimeout(() => {
|
|
208
|
+
void action.invoke();
|
|
209
|
+
});
|
|
210
|
+
},
|
|
211
|
+
classNames: "flex items-center gap-2",
|
|
212
|
+
disabled: action.properties.disabled,
|
|
213
|
+
...action.properties?.testId && {
|
|
214
|
+
"data-testid": action.properties.testId
|
|
215
|
+
}
|
|
216
|
+
}, /* @__PURE__ */ import_react2.default.createElement(Icon, {
|
|
217
|
+
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(4), "shrink-0", !action.icon && "invisible")
|
|
218
|
+
}), /* @__PURE__ */ import_react2.default.createElement("span", {
|
|
219
|
+
className: "grow truncate"
|
|
220
|
+
}, label), action.keyBinding && /* @__PURE__ */ import_react2.default.createElement("span", {
|
|
221
|
+
className: (0, import_react_ui_theme.mx)("shrink-0", import_react_ui_theme.descriptionText)
|
|
222
|
+
}, (0, import_keyboard.keySymbols)(action.keyBinding).join("")));
|
|
223
|
+
}))), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Dialog.Close, {
|
|
224
|
+
asChild: true
|
|
225
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Button, {
|
|
226
|
+
ref: buttonRef,
|
|
227
|
+
variant: "primary",
|
|
228
|
+
classNames: "mbs-2"
|
|
229
|
+
}, t("close label", {
|
|
230
|
+
ns: "os"
|
|
231
|
+
}))));
|
|
232
|
+
};
|
|
147
233
|
var pluginMeta = (meta) => meta;
|
|
148
234
|
var Plugin;
|
|
149
235
|
(function(Plugin2) {
|
|
@@ -153,7 +239,7 @@ var Plugin;
|
|
|
153
239
|
});
|
|
154
240
|
};
|
|
155
241
|
})(Plugin || (Plugin = {}));
|
|
156
|
-
var PluginContext = /* @__PURE__ */ (0,
|
|
242
|
+
var PluginContext = /* @__PURE__ */ (0, import_react4.createContext)({
|
|
157
243
|
ready: false,
|
|
158
244
|
enabled: [],
|
|
159
245
|
plugins: [],
|
|
@@ -161,7 +247,7 @@ var PluginContext = /* @__PURE__ */ (0, import_react2.createContext)({
|
|
|
161
247
|
setPlugin: () => {
|
|
162
248
|
}
|
|
163
249
|
});
|
|
164
|
-
var usePlugins = () => (0,
|
|
250
|
+
var usePlugins = () => (0, import_react4.useContext)(PluginContext);
|
|
165
251
|
var usePlugin = (id) => {
|
|
166
252
|
const { plugins } = usePlugins();
|
|
167
253
|
return (0, import_chunk_VDKZ7AAF.findPlugin)(plugins, id);
|
|
@@ -201,11 +287,11 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
201
287
|
},
|
|
202
288
|
provides: {
|
|
203
289
|
plugins: state.values,
|
|
204
|
-
context: ({ children }) => /* @__PURE__ */
|
|
290
|
+
context: ({ children }) => /* @__PURE__ */ import_react6.default.createElement(PluginProvider, {
|
|
205
291
|
value: state.values
|
|
206
292
|
}, children),
|
|
207
293
|
root: () => {
|
|
208
|
-
(0,
|
|
294
|
+
(0, import_react6.useEffect)(() => {
|
|
209
295
|
(0, import_log.log)("initializing plugins", {
|
|
210
296
|
enabled: state.values.enabled
|
|
211
297
|
}, {
|
|
@@ -250,7 +336,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
250
336
|
S: void 0,
|
|
251
337
|
C: (f, a) => f(...a)
|
|
252
338
|
});
|
|
253
|
-
state.values.plugins = (0,
|
|
339
|
+
state.values.plugins = (0, import_react5.shallow)(plugins);
|
|
254
340
|
state.values.ready = true;
|
|
255
341
|
});
|
|
256
342
|
return () => {
|
|
@@ -259,10 +345,10 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
259
345
|
};
|
|
260
346
|
}, []);
|
|
261
347
|
if (!state.values.ready) {
|
|
262
|
-
return /* @__PURE__ */
|
|
348
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, fallback);
|
|
263
349
|
}
|
|
264
350
|
const ComposedContext = composeContext(state.values.plugins);
|
|
265
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ import_react6.default.createElement(ComposedContext, null, rootComponents(state.values.plugins));
|
|
266
352
|
}
|
|
267
353
|
}
|
|
268
354
|
};
|
|
@@ -281,7 +367,7 @@ var rootComponents = (plugins) => {
|
|
|
281
367
|
return plugins.map((plugin) => {
|
|
282
368
|
const Component2 = plugin.provides.root;
|
|
283
369
|
if (Component2) {
|
|
284
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ import_react6.default.createElement(Component2, {
|
|
285
371
|
key: plugin.meta.id
|
|
286
372
|
});
|
|
287
373
|
} else {
|
|
@@ -295,10 +381,10 @@ var composeContext = (plugins) => {
|
|
|
295
381
|
var compose = (contexts) => {
|
|
296
382
|
return [
|
|
297
383
|
...contexts
|
|
298
|
-
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */
|
|
384
|
+
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ import_react6.default.createElement(Acc, null, /* @__PURE__ */ import_react6.default.createElement(Next, null, children)));
|
|
299
385
|
};
|
|
300
386
|
var isObject = (data) => !!data && typeof data === "object";
|
|
301
|
-
var ErrorBoundary = class extends
|
|
387
|
+
var ErrorBoundary = class extends import_react7.Component {
|
|
302
388
|
constructor(props) {
|
|
303
389
|
super(props);
|
|
304
390
|
this.state = {
|
|
@@ -317,7 +403,7 @@ var ErrorBoundary = class extends import_react5.Component {
|
|
|
317
403
|
}
|
|
318
404
|
render() {
|
|
319
405
|
if (this.state.error) {
|
|
320
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ import_react7.default.createElement(this.props.fallback, {
|
|
321
407
|
error: this.state.error,
|
|
322
408
|
reset: this.resetError
|
|
323
409
|
});
|
|
@@ -330,30 +416,30 @@ var ErrorBoundary = class extends import_react5.Component {
|
|
|
330
416
|
});
|
|
331
417
|
}
|
|
332
418
|
};
|
|
333
|
-
var Surface = /* @__PURE__ */ (0,
|
|
419
|
+
var Surface = /* @__PURE__ */ (0, import_react8.forwardRef)(({ role, name = role, fallback, ...rest }, forwardedRef) => {
|
|
334
420
|
const props = {
|
|
335
421
|
role,
|
|
336
422
|
name,
|
|
337
423
|
fallback,
|
|
338
424
|
...rest
|
|
339
425
|
};
|
|
340
|
-
const context = (0,
|
|
426
|
+
const context = (0, import_react9.useContext)(SurfaceContext);
|
|
341
427
|
const data = props.data ?? (name && context?.surfaces?.[name]?.data || {});
|
|
342
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, fallback ? /* @__PURE__ */ import_react8.default.createElement(ErrorBoundary, {
|
|
343
429
|
data,
|
|
344
430
|
fallback
|
|
345
|
-
}, /* @__PURE__ */
|
|
431
|
+
}, /* @__PURE__ */ import_react8.default.createElement(SurfaceResolver, {
|
|
346
432
|
...props,
|
|
347
433
|
ref: forwardedRef
|
|
348
|
-
})) : /* @__PURE__ */
|
|
434
|
+
})) : /* @__PURE__ */ import_react8.default.createElement(SurfaceResolver, {
|
|
349
435
|
...props,
|
|
350
436
|
ref: forwardedRef
|
|
351
437
|
}));
|
|
352
438
|
});
|
|
353
|
-
var SurfaceContext = /* @__PURE__ */ (0,
|
|
354
|
-
var SurfaceResolver = /* @__PURE__ */ (0,
|
|
439
|
+
var SurfaceContext = /* @__PURE__ */ (0, import_react9.createContext)(null);
|
|
440
|
+
var SurfaceResolver = /* @__PURE__ */ (0, import_react8.forwardRef)((props, forwardedRef) => {
|
|
355
441
|
const { components } = (0, import_chunk_DC3GU6QR.useSurface)();
|
|
356
|
-
const parent = (0,
|
|
442
|
+
const parent = (0, import_react9.useContext)(SurfaceContext);
|
|
357
443
|
const nodes = resolveNodes(components, props, parent, forwardedRef);
|
|
358
444
|
const currentContext = {
|
|
359
445
|
...props,
|
|
@@ -362,9 +448,9 @@ var SurfaceResolver = /* @__PURE__ */ (0, import_react6.forwardRef)((props, forw
|
|
|
362
448
|
...props.surfaces
|
|
363
449
|
}
|
|
364
450
|
};
|
|
365
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ import_react8.default.createElement(SurfaceContext.Provider, {
|
|
366
452
|
value: currentContext
|
|
367
|
-
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */
|
|
453
|
+
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */ import_react8.default.createElement(props.contentFallback, null) : null);
|
|
368
454
|
});
|
|
369
455
|
var resolveNodes = (components, props, context, forwardedRef) => {
|
|
370
456
|
const data = {
|
|
@@ -382,7 +468,7 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
382
468
|
return "node" in result ? [
|
|
383
469
|
key,
|
|
384
470
|
result
|
|
385
|
-
] : /* @__PURE__ */ (0,
|
|
471
|
+
] : /* @__PURE__ */ (0, import_react8.isValidElement)(result) ? [
|
|
386
472
|
key,
|
|
387
473
|
{
|
|
388
474
|
node: result
|
|
@@ -399,14 +485,14 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
399
485
|
return 1;
|
|
400
486
|
}
|
|
401
487
|
return 0;
|
|
402
|
-
}).map(([key, result]) => /* @__PURE__ */
|
|
488
|
+
}).map(([key, result]) => /* @__PURE__ */ import_react8.default.createElement(import_react8.Fragment, {
|
|
403
489
|
key
|
|
404
490
|
}, result.node));
|
|
405
491
|
return props.limit ? nodes.slice(0, props.limit) : nodes;
|
|
406
492
|
};
|
|
407
493
|
var SettingsDialogContent = () => {
|
|
408
|
-
const { t } = (0,
|
|
409
|
-
const [plugin, setPlugin] = (0,
|
|
494
|
+
const { t } = (0, import_react_ui2.useTranslation)("os");
|
|
495
|
+
const [plugin, setPlugin] = (0, import_react3.useState)("dxos.org/plugin/registry");
|
|
410
496
|
const { plugins, enabled } = usePlugins();
|
|
411
497
|
const core = [
|
|
412
498
|
"dxos.org/plugin/layout",
|
|
@@ -415,120 +501,83 @@ var SettingsDialogContent = () => {
|
|
|
415
501
|
"dxos.org/plugin/registry"
|
|
416
502
|
];
|
|
417
503
|
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);
|
|
418
|
-
return /* @__PURE__ */
|
|
419
|
-
density: "fine"
|
|
420
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, {
|
|
504
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Content, {
|
|
421
505
|
classNames: [
|
|
422
|
-
"h-
|
|
506
|
+
"h-full md:max-is-[40rem] overflow-hidden"
|
|
423
507
|
]
|
|
424
|
-
}, /* @__PURE__ */
|
|
508
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Title, null, t("settings dialog title", {
|
|
425
509
|
ns: "os"
|
|
426
|
-
})), /* @__PURE__ */
|
|
510
|
+
})), /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
427
511
|
className: "flex grow mlb-4 overflow-hidden"
|
|
428
|
-
}, /* @__PURE__ */
|
|
429
|
-
className: (0,
|
|
430
|
-
}, /* @__PURE__ */
|
|
512
|
+
}, /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
513
|
+
className: (0, import_react_ui_theme2.mx)("flex flex-col w-[200px] space-y-4 pr-4 border-r overflow-y-auto", import_react_ui_theme2.groupBorder)
|
|
514
|
+
}, /* @__PURE__ */ import_react3.default.createElement(PluginList, {
|
|
431
515
|
title: "Options",
|
|
432
516
|
plugins: core.map((id) => plugins.find((p) => p.meta.id === id).meta),
|
|
433
517
|
selected: plugin,
|
|
434
518
|
onSelect: (plugin2) => setPlugin(plugin2)
|
|
435
|
-
}), /* @__PURE__ */
|
|
519
|
+
}), /* @__PURE__ */ import_react3.default.createElement(PluginList, {
|
|
436
520
|
title: "Plugins",
|
|
437
521
|
plugins: filteredPlugins,
|
|
438
522
|
selected: plugin,
|
|
439
523
|
onSelect: (plugin2) => setPlugin(plugin2)
|
|
440
|
-
})), /* @__PURE__ */
|
|
441
|
-
className: (0,
|
|
442
|
-
}, /* @__PURE__ */
|
|
524
|
+
})), /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
525
|
+
className: (0, import_react_ui_theme2.mx)("flex flex-col w-full md:px-4 divide-y overflow-y-auto", import_react_ui_theme2.groupBorder)
|
|
526
|
+
}, /* @__PURE__ */ import_react3.default.createElement(Surface, {
|
|
443
527
|
role: "settings",
|
|
444
528
|
data: {
|
|
445
529
|
plugin
|
|
446
530
|
}
|
|
447
|
-
}))), /* @__PURE__ */
|
|
531
|
+
}))), /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Close, {
|
|
448
532
|
asChild: true
|
|
449
|
-
}, /* @__PURE__ */
|
|
533
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Button, {
|
|
450
534
|
variant: "primary",
|
|
451
|
-
classNames: "mbs-2"
|
|
535
|
+
classNames: "mbs-2",
|
|
536
|
+
autoFocus: true
|
|
452
537
|
}, t("done label", {
|
|
453
538
|
ns: "os"
|
|
454
|
-
}))))
|
|
539
|
+
}))));
|
|
455
540
|
};
|
|
456
541
|
var PluginList = ({ title, plugins, selected, onSelect }) => {
|
|
457
|
-
return /* @__PURE__ */
|
|
542
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
458
543
|
role: "none"
|
|
459
|
-
}, /* @__PURE__ */
|
|
544
|
+
}, /* @__PURE__ */ import_react3.default.createElement("h2", {
|
|
460
545
|
className: "my-1 px-2 text-sm text-neutral-500"
|
|
461
|
-
}, title), /* @__PURE__ */
|
|
546
|
+
}, title), /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.List, {
|
|
462
547
|
selectable: true
|
|
463
|
-
}, plugins.map((plugin) => /* @__PURE__ */
|
|
548
|
+
}, plugins.map((plugin) => /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.ListItem.Root, {
|
|
464
549
|
key: plugin.id,
|
|
465
550
|
onClick: () => onSelect(plugin.id),
|
|
466
551
|
selected: plugin.id === selected,
|
|
467
552
|
classNames: [
|
|
468
553
|
"px-2 rounded",
|
|
469
|
-
plugin.id === selected &&
|
|
470
|
-
|
|
554
|
+
plugin.id === selected && import_react_ui_theme2.ghostSelected,
|
|
555
|
+
import_react_ui_theme2.ghostHover
|
|
471
556
|
]
|
|
472
|
-
}, /* @__PURE__ */
|
|
557
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.ListItem.Heading, {
|
|
473
558
|
classNames: [
|
|
474
559
|
"flex w-full items-center cursor-pointer"
|
|
475
560
|
]
|
|
476
561
|
}, plugin.name)))));
|
|
477
562
|
};
|
|
478
563
|
var SettingsValue = ({ label, description, children }) => {
|
|
479
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
480
565
|
role: "none",
|
|
481
566
|
className: "flex w-full gap-4 py-1"
|
|
482
|
-
}, /* @__PURE__ */
|
|
567
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
483
568
|
role: "none",
|
|
484
569
|
className: "flex flex-col w-full"
|
|
485
|
-
}, /* @__PURE__ */
|
|
570
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.Label, {
|
|
486
571
|
classNames: "flex min-h-[40px] items-center"
|
|
487
|
-
}, label), description && /* @__PURE__ */
|
|
572
|
+
}, label), description && /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.DescriptionAndValidation, {
|
|
488
573
|
classNames: "mbs-0.5"
|
|
489
|
-
}, /* @__PURE__ */
|
|
574
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.Description, null, description))), /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
490
575
|
role: "none"
|
|
491
|
-
}, /* @__PURE__ */
|
|
576
|
+
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
492
577
|
role: "none",
|
|
493
578
|
className: "flex min-h-[40px] items-center"
|
|
494
579
|
}, children))));
|
|
495
580
|
};
|
|
496
|
-
var ShortcutsDialogContent = () => {
|
|
497
|
-
const { t } = (0, import_react_ui3.useTranslation)("os");
|
|
498
|
-
const bindings = import_keyboard.Keyboard.singleton.getBindings();
|
|
499
|
-
const getLabel = (label) => Array.isArray(label) ? t(...label) : label;
|
|
500
|
-
return /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.DensityProvider, {
|
|
501
|
-
density: "fine"
|
|
502
|
-
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Dialog.Content, {
|
|
503
|
-
classNames: [
|
|
504
|
-
"md:max-is-[30rem] overflow-hidden"
|
|
505
|
-
]
|
|
506
|
-
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Dialog.Title, null, t("shortcuts dialog title", {
|
|
507
|
-
ns: "os"
|
|
508
|
-
})), /* @__PURE__ */ import_react9.default.createElement("table", {
|
|
509
|
-
className: "table-fixed border-collapse my-4"
|
|
510
|
-
}, /* @__PURE__ */ import_react9.default.createElement("tbody", null, bindings.map((binding, i) => /* @__PURE__ */ import_react9.default.createElement("tr", {
|
|
511
|
-
key: i
|
|
512
|
-
}, /* @__PURE__ */ import_react9.default.createElement("td", {
|
|
513
|
-
className: "p-1 w-[120px]"
|
|
514
|
-
}, /* @__PURE__ */ import_react9.default.createElement("div", {
|
|
515
|
-
className: "flex gap-1"
|
|
516
|
-
}, (0, import_keyboard.keySymbols)(binding.binding).map((c, i2) => /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
517
|
-
key: i2,
|
|
518
|
-
className: (0, import_react_ui_theme2.mx)("inline-flex w-[24px] h-[24px] justify-center items-center text-xs", "rounded border border-neutral-300 dark:border-neutral-600 bg-neutral-50 dark:bg-neutral-850")
|
|
519
|
-
}, c)))), /* @__PURE__ */ import_react9.default.createElement("td", {
|
|
520
|
-
className: "p-1"
|
|
521
|
-
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
522
|
-
className: "grow truncate"
|
|
523
|
-
}, getLabel(binding.data))))))), /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Dialog.Close, {
|
|
524
|
-
asChild: true
|
|
525
|
-
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui3.Button, {
|
|
526
|
-
variant: "primary",
|
|
527
|
-
classNames: "mbs-2"
|
|
528
|
-
}, t("close label", {
|
|
529
|
-
ns: "os"
|
|
530
|
-
})))));
|
|
531
|
-
};
|
|
532
581
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
533
582
|
var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }) => {
|
|
534
583
|
const host = PluginHost({
|
|
@@ -569,10 +618,11 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
569
618
|
});
|
|
570
619
|
const Context = host.provides.context;
|
|
571
620
|
const Root = host.provides.root;
|
|
572
|
-
return () => /* @__PURE__ */
|
|
621
|
+
return () => /* @__PURE__ */ import_react11.default.createElement(Context, null, /* @__PURE__ */ import_react11.default.createElement(Root, null));
|
|
573
622
|
};
|
|
574
623
|
// Annotate the CommonJS export names for ESM import in node:
|
|
575
624
|
0 && (module.exports = {
|
|
625
|
+
CommandsDialogContent,
|
|
576
626
|
ErrorBoundary,
|
|
577
627
|
IntentProvider,
|
|
578
628
|
Layout,
|
|
@@ -585,7 +635,6 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
585
635
|
ResourceLanguage,
|
|
586
636
|
SettingsDialogContent,
|
|
587
637
|
SettingsValue,
|
|
588
|
-
ShortcutsDialogContent,
|
|
589
638
|
Surface,
|
|
590
639
|
SurfaceProvider,
|
|
591
640
|
createApp,
|