@dxos/app-framework 0.3.10-main.ec4f2f4 → 0.3.10-main.f460bb8
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 +144 -50
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +158 -65
- 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 +4 -1
- 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 -0
- package/dist/types/src/plugins/components/index.d.ts.map +1 -1
- package/package.json +14 -11
- package/src/plugins/common/layout.ts +5 -0
- package/src/plugins/components/CommandsDialog.tsx +100 -0
- package/src/plugins/components/SettingsDialog.tsx +31 -31
- package/src/plugins/components/index.ts +1 -0
- package/tsconfig.json +9 -0
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,
|
|
@@ -73,20 +74,26 @@ var import_chunk_BOQBLWMX = require("./chunk-BOQBLWMX.cjs");
|
|
|
73
74
|
var import_chunk_VDKZ7AAF = require("./chunk-VDKZ7AAF.cjs");
|
|
74
75
|
var import_zod = require("zod");
|
|
75
76
|
var import_zod2 = require("zod");
|
|
76
|
-
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");
|
|
77
80
|
var import_react_ui = require("@dxos/react-ui");
|
|
81
|
+
var import_react_ui_searchlist = require("@dxos/react-ui-searchlist");
|
|
78
82
|
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
79
|
-
var
|
|
80
|
-
var
|
|
81
|
-
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"));
|
|
82
89
|
var import_local_storage = require("@dxos/local-storage");
|
|
83
90
|
var import_log = require("@dxos/log");
|
|
84
|
-
var
|
|
85
|
-
var import_react6 = __toESM(require("react"));
|
|
86
|
-
var import_react7 = require("react");
|
|
91
|
+
var import_react7 = __toESM(require("react"));
|
|
87
92
|
var import_react8 = __toESM(require("react"));
|
|
88
|
-
var
|
|
89
|
-
var
|
|
93
|
+
var import_react9 = require("react");
|
|
94
|
+
var import_react10 = __toESM(require("react"));
|
|
95
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
96
|
+
var import_react11 = __toESM(require("react"));
|
|
90
97
|
var import_invariant = require("@dxos/invariant");
|
|
91
98
|
var parseGraphPlugin = (plugin) => plugin.provides.graph?.root ? plugin : void 0;
|
|
92
99
|
var parseGraphBuilderPlugin = (plugin) => plugin.provides.graph?.builder ? plugin : void 0;
|
|
@@ -120,6 +127,12 @@ var LayoutAction;
|
|
|
120
127
|
LayoutAction2[LayoutAction2["OPEN_POPOVER"] = `${LAYOUT_ACTION}/open-popover`] = "OPEN_POPOVER";
|
|
121
128
|
LayoutAction2[LayoutAction2["CLOSE_POPOVER"] = `${LAYOUT_ACTION}/close-popover`] = "CLOSE_POPOVER";
|
|
122
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";
|
|
134
|
+
LayoutAction2[LayoutAction2["OPEN_SETTINGS"] = `${LAYOUT_ACTION}/open-settings`] = "OPEN_SETTINGS";
|
|
135
|
+
LayoutAction2[LayoutAction2["OPEN_SHORTCUTS"] = `${LAYOUT_ACTION}/open-shortcuts`] = "OPEN_SHORTCUTS";
|
|
123
136
|
})(LayoutAction || (LayoutAction = {}));
|
|
124
137
|
var parseMetadataRecordsPlugin = (plugin) => {
|
|
125
138
|
return plugin.provides.metadata?.records ? plugin : void 0;
|
|
@@ -137,6 +150,86 @@ var parseTranslationsPlugin = (plugin) => {
|
|
|
137
150
|
const { success } = import_zod2.z.array(Resource).safeParse(plugin.provides.translations);
|
|
138
151
|
return success ? plugin : void 0;
|
|
139
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
|
+
};
|
|
140
233
|
var pluginMeta = (meta) => meta;
|
|
141
234
|
var Plugin;
|
|
142
235
|
(function(Plugin2) {
|
|
@@ -146,7 +239,7 @@ var Plugin;
|
|
|
146
239
|
});
|
|
147
240
|
};
|
|
148
241
|
})(Plugin || (Plugin = {}));
|
|
149
|
-
var PluginContext = /* @__PURE__ */ (0,
|
|
242
|
+
var PluginContext = /* @__PURE__ */ (0, import_react4.createContext)({
|
|
150
243
|
ready: false,
|
|
151
244
|
enabled: [],
|
|
152
245
|
plugins: [],
|
|
@@ -154,7 +247,7 @@ var PluginContext = /* @__PURE__ */ (0, import_react2.createContext)({
|
|
|
154
247
|
setPlugin: () => {
|
|
155
248
|
}
|
|
156
249
|
});
|
|
157
|
-
var usePlugins = () => (0,
|
|
250
|
+
var usePlugins = () => (0, import_react4.useContext)(PluginContext);
|
|
158
251
|
var usePlugin = (id) => {
|
|
159
252
|
const { plugins } = usePlugins();
|
|
160
253
|
return (0, import_chunk_VDKZ7AAF.findPlugin)(plugins, id);
|
|
@@ -194,11 +287,11 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
194
287
|
},
|
|
195
288
|
provides: {
|
|
196
289
|
plugins: state.values,
|
|
197
|
-
context: ({ children }) => /* @__PURE__ */
|
|
290
|
+
context: ({ children }) => /* @__PURE__ */ import_react6.default.createElement(PluginProvider, {
|
|
198
291
|
value: state.values
|
|
199
292
|
}, children),
|
|
200
293
|
root: () => {
|
|
201
|
-
(0,
|
|
294
|
+
(0, import_react6.useEffect)(() => {
|
|
202
295
|
(0, import_log.log)("initializing plugins", {
|
|
203
296
|
enabled: state.values.enabled
|
|
204
297
|
}, {
|
|
@@ -243,7 +336,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
243
336
|
S: void 0,
|
|
244
337
|
C: (f, a) => f(...a)
|
|
245
338
|
});
|
|
246
|
-
state.values.plugins = (0,
|
|
339
|
+
state.values.plugins = (0, import_react5.shallow)(plugins);
|
|
247
340
|
state.values.ready = true;
|
|
248
341
|
});
|
|
249
342
|
return () => {
|
|
@@ -252,10 +345,10 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
252
345
|
};
|
|
253
346
|
}, []);
|
|
254
347
|
if (!state.values.ready) {
|
|
255
|
-
return /* @__PURE__ */
|
|
348
|
+
return /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, fallback);
|
|
256
349
|
}
|
|
257
350
|
const ComposedContext = composeContext(state.values.plugins);
|
|
258
|
-
return /* @__PURE__ */
|
|
351
|
+
return /* @__PURE__ */ import_react6.default.createElement(ComposedContext, null, rootComponents(state.values.plugins));
|
|
259
352
|
}
|
|
260
353
|
}
|
|
261
354
|
};
|
|
@@ -274,7 +367,7 @@ var rootComponents = (plugins) => {
|
|
|
274
367
|
return plugins.map((plugin) => {
|
|
275
368
|
const Component2 = plugin.provides.root;
|
|
276
369
|
if (Component2) {
|
|
277
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ import_react6.default.createElement(Component2, {
|
|
278
371
|
key: plugin.meta.id
|
|
279
372
|
});
|
|
280
373
|
} else {
|
|
@@ -288,10 +381,10 @@ var composeContext = (plugins) => {
|
|
|
288
381
|
var compose = (contexts) => {
|
|
289
382
|
return [
|
|
290
383
|
...contexts
|
|
291
|
-
].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)));
|
|
292
385
|
};
|
|
293
386
|
var isObject = (data) => !!data && typeof data === "object";
|
|
294
|
-
var ErrorBoundary = class extends
|
|
387
|
+
var ErrorBoundary = class extends import_react7.Component {
|
|
295
388
|
constructor(props) {
|
|
296
389
|
super(props);
|
|
297
390
|
this.state = {
|
|
@@ -310,7 +403,7 @@ var ErrorBoundary = class extends import_react5.Component {
|
|
|
310
403
|
}
|
|
311
404
|
render() {
|
|
312
405
|
if (this.state.error) {
|
|
313
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ import_react7.default.createElement(this.props.fallback, {
|
|
314
407
|
error: this.state.error,
|
|
315
408
|
reset: this.resetError
|
|
316
409
|
});
|
|
@@ -323,30 +416,30 @@ var ErrorBoundary = class extends import_react5.Component {
|
|
|
323
416
|
});
|
|
324
417
|
}
|
|
325
418
|
};
|
|
326
|
-
var Surface = /* @__PURE__ */ (0,
|
|
419
|
+
var Surface = /* @__PURE__ */ (0, import_react8.forwardRef)(({ role, name = role, fallback, ...rest }, forwardedRef) => {
|
|
327
420
|
const props = {
|
|
328
421
|
role,
|
|
329
422
|
name,
|
|
330
423
|
fallback,
|
|
331
424
|
...rest
|
|
332
425
|
};
|
|
333
|
-
const context = (0,
|
|
426
|
+
const context = (0, import_react9.useContext)(SurfaceContext);
|
|
334
427
|
const data = props.data ?? (name && context?.surfaces?.[name]?.data || {});
|
|
335
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_react8.default.Fragment, null, fallback ? /* @__PURE__ */ import_react8.default.createElement(ErrorBoundary, {
|
|
336
429
|
data,
|
|
337
430
|
fallback
|
|
338
|
-
}, /* @__PURE__ */
|
|
431
|
+
}, /* @__PURE__ */ import_react8.default.createElement(SurfaceResolver, {
|
|
339
432
|
...props,
|
|
340
433
|
ref: forwardedRef
|
|
341
|
-
})) : /* @__PURE__ */
|
|
434
|
+
})) : /* @__PURE__ */ import_react8.default.createElement(SurfaceResolver, {
|
|
342
435
|
...props,
|
|
343
436
|
ref: forwardedRef
|
|
344
437
|
}));
|
|
345
438
|
});
|
|
346
|
-
var SurfaceContext = /* @__PURE__ */ (0,
|
|
347
|
-
var SurfaceResolver = /* @__PURE__ */ (0,
|
|
439
|
+
var SurfaceContext = /* @__PURE__ */ (0, import_react9.createContext)(null);
|
|
440
|
+
var SurfaceResolver = /* @__PURE__ */ (0, import_react8.forwardRef)((props, forwardedRef) => {
|
|
348
441
|
const { components } = (0, import_chunk_DC3GU6QR.useSurface)();
|
|
349
|
-
const parent = (0,
|
|
442
|
+
const parent = (0, import_react9.useContext)(SurfaceContext);
|
|
350
443
|
const nodes = resolveNodes(components, props, parent, forwardedRef);
|
|
351
444
|
const currentContext = {
|
|
352
445
|
...props,
|
|
@@ -355,9 +448,9 @@ var SurfaceResolver = /* @__PURE__ */ (0, import_react6.forwardRef)((props, forw
|
|
|
355
448
|
...props.surfaces
|
|
356
449
|
}
|
|
357
450
|
};
|
|
358
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ import_react8.default.createElement(SurfaceContext.Provider, {
|
|
359
452
|
value: currentContext
|
|
360
|
-
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */
|
|
453
|
+
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */ import_react8.default.createElement(props.contentFallback, null) : null);
|
|
361
454
|
});
|
|
362
455
|
var resolveNodes = (components, props, context, forwardedRef) => {
|
|
363
456
|
const data = {
|
|
@@ -375,7 +468,7 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
375
468
|
return "node" in result ? [
|
|
376
469
|
key,
|
|
377
470
|
result
|
|
378
|
-
] : /* @__PURE__ */ (0,
|
|
471
|
+
] : /* @__PURE__ */ (0, import_react8.isValidElement)(result) ? [
|
|
379
472
|
key,
|
|
380
473
|
{
|
|
381
474
|
node: result
|
|
@@ -392,14 +485,14 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
392
485
|
return 1;
|
|
393
486
|
}
|
|
394
487
|
return 0;
|
|
395
|
-
}).map(([key, result]) => /* @__PURE__ */
|
|
488
|
+
}).map(([key, result]) => /* @__PURE__ */ import_react8.default.createElement(import_react8.Fragment, {
|
|
396
489
|
key
|
|
397
490
|
}, result.node));
|
|
398
491
|
return props.limit ? nodes.slice(0, props.limit) : nodes;
|
|
399
492
|
};
|
|
400
493
|
var SettingsDialogContent = () => {
|
|
401
|
-
const
|
|
402
|
-
const
|
|
494
|
+
const { t } = (0, import_react_ui2.useTranslation)("os");
|
|
495
|
+
const [plugin, setPlugin] = (0, import_react3.useState)("dxos.org/plugin/registry");
|
|
403
496
|
const { plugins, enabled } = usePlugins();
|
|
404
497
|
const core = [
|
|
405
498
|
"dxos.org/plugin/layout",
|
|
@@ -408,80 +501,79 @@ var SettingsDialogContent = () => {
|
|
|
408
501
|
"dxos.org/plugin/registry"
|
|
409
502
|
];
|
|
410
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);
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
density: "fine"
|
|
413
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_react_ui.Dialog.Content, {
|
|
504
|
+
return /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Content, {
|
|
414
505
|
classNames: [
|
|
415
|
-
"h-
|
|
506
|
+
"h-full md:max-is-[40rem] overflow-hidden"
|
|
416
507
|
]
|
|
417
|
-
}, /* @__PURE__ */
|
|
508
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Title, null, t("settings dialog title", {
|
|
418
509
|
ns: "os"
|
|
419
|
-
})), /* @__PURE__ */
|
|
510
|
+
})), /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
420
511
|
className: "flex grow mlb-4 overflow-hidden"
|
|
421
|
-
}, /* @__PURE__ */
|
|
422
|
-
className: (0,
|
|
423
|
-
}, /* @__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, {
|
|
424
515
|
title: "Options",
|
|
425
516
|
plugins: core.map((id) => plugins.find((p) => p.meta.id === id).meta),
|
|
426
517
|
selected: plugin,
|
|
427
518
|
onSelect: (plugin2) => setPlugin(plugin2)
|
|
428
|
-
}), /* @__PURE__ */
|
|
519
|
+
}), /* @__PURE__ */ import_react3.default.createElement(PluginList, {
|
|
429
520
|
title: "Plugins",
|
|
430
521
|
plugins: filteredPlugins,
|
|
431
522
|
selected: plugin,
|
|
432
523
|
onSelect: (plugin2) => setPlugin(plugin2)
|
|
433
|
-
})), /* @__PURE__ */
|
|
434
|
-
className: (0,
|
|
435
|
-
}, /* @__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, {
|
|
436
527
|
role: "settings",
|
|
437
528
|
data: {
|
|
438
529
|
plugin
|
|
439
530
|
}
|
|
440
|
-
}))), /* @__PURE__ */
|
|
531
|
+
}))), /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Dialog.Close, {
|
|
441
532
|
asChild: true
|
|
442
|
-
}, /* @__PURE__ */
|
|
533
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.Button, {
|
|
443
534
|
variant: "primary",
|
|
444
|
-
classNames: "mbs-2"
|
|
535
|
+
classNames: "mbs-2",
|
|
536
|
+
autoFocus: true
|
|
445
537
|
}, t("done label", {
|
|
446
538
|
ns: "os"
|
|
447
|
-
}))))
|
|
539
|
+
}))));
|
|
448
540
|
};
|
|
449
541
|
var PluginList = ({ title, plugins, selected, onSelect }) => {
|
|
450
|
-
return /* @__PURE__ */
|
|
542
|
+
return /* @__PURE__ */ import_react3.default.createElement("div", {
|
|
451
543
|
role: "none"
|
|
452
|
-
}, /* @__PURE__ */
|
|
544
|
+
}, /* @__PURE__ */ import_react3.default.createElement("h2", {
|
|
453
545
|
className: "my-1 px-2 text-sm text-neutral-500"
|
|
454
|
-
}, title), /* @__PURE__ */
|
|
546
|
+
}, title), /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.List, {
|
|
455
547
|
selectable: true
|
|
456
|
-
}, plugins.map((plugin) => /* @__PURE__ */
|
|
548
|
+
}, plugins.map((plugin) => /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.ListItem.Root, {
|
|
457
549
|
key: plugin.id,
|
|
458
550
|
onClick: () => onSelect(plugin.id),
|
|
459
551
|
selected: plugin.id === selected,
|
|
460
552
|
classNames: [
|
|
461
553
|
"px-2 rounded",
|
|
462
|
-
plugin.id === selected &&
|
|
463
|
-
|
|
554
|
+
plugin.id === selected && import_react_ui_theme2.ghostSelected,
|
|
555
|
+
import_react_ui_theme2.ghostHover
|
|
464
556
|
]
|
|
465
|
-
}, /* @__PURE__ */
|
|
557
|
+
}, /* @__PURE__ */ import_react3.default.createElement(import_react_ui2.ListItem.Heading, {
|
|
466
558
|
classNames: [
|
|
467
559
|
"flex w-full items-center cursor-pointer"
|
|
468
560
|
]
|
|
469
561
|
}, plugin.name)))));
|
|
470
562
|
};
|
|
471
563
|
var SettingsValue = ({ label, description, children }) => {
|
|
472
|
-
return /* @__PURE__ */
|
|
564
|
+
return /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
473
565
|
role: "none",
|
|
474
566
|
className: "flex w-full gap-4 py-1"
|
|
475
|
-
}, /* @__PURE__ */
|
|
567
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.Root, null, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
476
568
|
role: "none",
|
|
477
569
|
className: "flex flex-col w-full"
|
|
478
|
-
}, /* @__PURE__ */
|
|
570
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.Label, {
|
|
479
571
|
classNames: "flex min-h-[40px] items-center"
|
|
480
|
-
}, label), description && /* @__PURE__ */
|
|
572
|
+
}, label), description && /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.DescriptionAndValidation, {
|
|
481
573
|
classNames: "mbs-0.5"
|
|
482
|
-
}, /* @__PURE__ */
|
|
574
|
+
}, /* @__PURE__ */ import_react10.default.createElement(import_react_ui3.Input.Description, null, description))), /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
483
575
|
role: "none"
|
|
484
|
-
}, /* @__PURE__ */
|
|
576
|
+
}, /* @__PURE__ */ import_react10.default.createElement("div", {
|
|
485
577
|
role: "none",
|
|
486
578
|
className: "flex min-h-[40px] items-center"
|
|
487
579
|
}, children))));
|
|
@@ -526,10 +618,11 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
526
618
|
});
|
|
527
619
|
const Context = host.provides.context;
|
|
528
620
|
const Root = host.provides.root;
|
|
529
|
-
return () => /* @__PURE__ */
|
|
621
|
+
return () => /* @__PURE__ */ import_react11.default.createElement(Context, null, /* @__PURE__ */ import_react11.default.createElement(Root, null));
|
|
530
622
|
};
|
|
531
623
|
// Annotate the CommonJS export names for ESM import in node:
|
|
532
624
|
0 && (module.exports = {
|
|
625
|
+
CommandsDialogContent,
|
|
533
626
|
ErrorBoundary,
|
|
534
627
|
IntentProvider,
|
|
535
628
|
Layout,
|