@dxos/app-framework 0.3.10-main.92d1f2c → 0.3.10-main.a0865c9
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 +30 -260
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +42 -266
- 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 +8 -11
- package/dist/types/src/plugins/common/layout.d.ts.map +1 -1
- package/dist/types/src/plugins/common/settings.d.ts +6 -5
- package/dist/types/src/plugins/common/settings.d.ts.map +1 -1
- package/dist/types/src/plugins/index.d.ts +0 -1
- package/dist/types/src/plugins/index.d.ts.map +1 -1
- package/package.json +9 -16
- package/src/plugins/common/layout.ts +1 -6
- package/src/plugins/common/settings.ts +11 -5
- package/src/plugins/index.ts +0 -1
- package/tsconfig.json +0 -15
- package/dist/types/src/plugins/components/CommandsDialog.d.ts +0 -5
- package/dist/types/src/plugins/components/CommandsDialog.d.ts.map +0 -1
- package/dist/types/src/plugins/components/SettingsDialog.d.ts +0 -2
- package/dist/types/src/plugins/components/SettingsDialog.d.ts.map +0 -1
- package/dist/types/src/plugins/components/SettingsValue.d.ts +0 -8
- package/dist/types/src/plugins/components/SettingsValue.d.ts.map +0 -1
- package/dist/types/src/plugins/components/ShortcutsDialog.d.ts +0 -2
- package/dist/types/src/plugins/components/ShortcutsDialog.d.ts.map +0 -1
- package/dist/types/src/plugins/components/index.d.ts +0 -5
- package/dist/types/src/plugins/components/index.d.ts.map +0 -1
- package/src/plugins/components/CommandsDialog.tsx +0 -100
- package/src/plugins/components/SettingsDialog.tsx +0 -98
- package/src/plugins/components/SettingsValue.tsx +0 -36
- package/src/plugins/components/ShortcutsDialog.tsx +0 -65
- package/src/plugins/components/index.ts +0 -8
|
@@ -44,7 +44,7 @@ var parseLayoutPlugin = (plugin) => {
|
|
|
44
44
|
const { success } = Layout.safeParse(plugin.provides.layout);
|
|
45
45
|
return success ? plugin : void 0;
|
|
46
46
|
};
|
|
47
|
-
var LAYOUT_ACTION = "dxos.org/plugin/
|
|
47
|
+
var LAYOUT_ACTION = "dxos.org/plugin/layout";
|
|
48
48
|
var LayoutAction;
|
|
49
49
|
(function(LayoutAction2) {
|
|
50
50
|
LayoutAction2[LayoutAction2["TOGGLE_FULLSCREEN"] = `${LAYOUT_ACTION}/toggle-fullscreen`] = "TOGGLE_FULLSCREEN";
|
|
@@ -55,12 +55,6 @@ var LayoutAction;
|
|
|
55
55
|
LayoutAction2[LayoutAction2["OPEN_POPOVER"] = `${LAYOUT_ACTION}/open-popover`] = "OPEN_POPOVER";
|
|
56
56
|
LayoutAction2[LayoutAction2["CLOSE_POPOVER"] = `${LAYOUT_ACTION}/close-popover`] = "CLOSE_POPOVER";
|
|
57
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";
|
|
64
58
|
})(LayoutAction || (LayoutAction = {}));
|
|
65
59
|
|
|
66
60
|
// packages/sdk/app-framework/src/plugins/common/metadata.ts
|
|
@@ -71,6 +65,16 @@ var parseMetadataResolverPlugin = (plugin) => {
|
|
|
71
65
|
return plugin.provides.metadata?.resolver ? plugin : void 0;
|
|
72
66
|
};
|
|
73
67
|
|
|
68
|
+
// packages/sdk/app-framework/src/plugins/common/settings.ts
|
|
69
|
+
var parseSettingsPlugin = (plugin) => {
|
|
70
|
+
return typeof plugin.provides.settings === "object" ? plugin : void 0;
|
|
71
|
+
};
|
|
72
|
+
var SETTINGS_ACTION = "dxos.org/plugin/settings";
|
|
73
|
+
var SettingsAction;
|
|
74
|
+
(function(SettingsAction2) {
|
|
75
|
+
SettingsAction2[SettingsAction2["OPEN"] = `${SETTINGS_ACTION}/open`] = "OPEN";
|
|
76
|
+
})(SettingsAction || (SettingsAction = {}));
|
|
77
|
+
|
|
74
78
|
// packages/sdk/app-framework/src/plugins/common/translations.ts
|
|
75
79
|
import { z as z2 } from "zod";
|
|
76
80
|
var ResourceKey = z2.union([
|
|
@@ -84,99 +88,6 @@ var parseTranslationsPlugin = (plugin) => {
|
|
|
84
88
|
return success ? plugin : void 0;
|
|
85
89
|
};
|
|
86
90
|
|
|
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
|
-
|
|
180
91
|
// packages/sdk/app-framework/src/plugins/PluginHost/plugin.ts
|
|
181
92
|
var pluginMeta = (meta) => meta;
|
|
182
93
|
var Plugin;
|
|
@@ -211,7 +122,7 @@ var PluginProvider = PluginContext.Provider;
|
|
|
211
122
|
|
|
212
123
|
// packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx
|
|
213
124
|
import { shallow } from "deepsignal/react";
|
|
214
|
-
import
|
|
125
|
+
import React, { useEffect } from "react";
|
|
215
126
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
216
127
|
import { log } from "@dxos/log";
|
|
217
128
|
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/plugins/PluginHost/PluginHost.tsx";
|
|
@@ -244,7 +155,7 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
244
155
|
},
|
|
245
156
|
provides: {
|
|
246
157
|
plugins: state.values,
|
|
247
|
-
context: ({ children }) => /* @__PURE__ */
|
|
158
|
+
context: ({ children }) => /* @__PURE__ */ React.createElement(PluginProvider, {
|
|
248
159
|
value: state.values
|
|
249
160
|
}, children),
|
|
250
161
|
root: () => {
|
|
@@ -302,10 +213,10 @@ var PluginHost = ({ order, plugins: definitions, core = [], defaults = [], fallb
|
|
|
302
213
|
};
|
|
303
214
|
}, []);
|
|
304
215
|
if (!state.values.ready) {
|
|
305
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, fallback);
|
|
306
217
|
}
|
|
307
218
|
const ComposedContext = composeContext(state.values.plugins);
|
|
308
|
-
return /* @__PURE__ */
|
|
219
|
+
return /* @__PURE__ */ React.createElement(ComposedContext, null, rootComponents(state.values.plugins));
|
|
309
220
|
}
|
|
310
221
|
}
|
|
311
222
|
};
|
|
@@ -324,7 +235,7 @@ var rootComponents = (plugins) => {
|
|
|
324
235
|
return plugins.map((plugin) => {
|
|
325
236
|
const Component2 = plugin.provides.root;
|
|
326
237
|
if (Component2) {
|
|
327
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ React.createElement(Component2, {
|
|
328
239
|
key: plugin.meta.id
|
|
329
240
|
});
|
|
330
241
|
} else {
|
|
@@ -338,14 +249,14 @@ var composeContext = (plugins) => {
|
|
|
338
249
|
var compose = (contexts) => {
|
|
339
250
|
return [
|
|
340
251
|
...contexts
|
|
341
|
-
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */
|
|
252
|
+
].reduce((Acc, Next) => ({ children }) => /* @__PURE__ */ React.createElement(Acc, null, /* @__PURE__ */ React.createElement(Next, null, children)));
|
|
342
253
|
};
|
|
343
254
|
|
|
344
255
|
// packages/sdk/app-framework/src/plugins/SurfacePlugin/helpers.ts
|
|
345
256
|
var isObject = (data) => !!data && typeof data === "object";
|
|
346
257
|
|
|
347
258
|
// packages/sdk/app-framework/src/plugins/SurfacePlugin/ErrorBoundary.tsx
|
|
348
|
-
import
|
|
259
|
+
import React2, { Component } from "react";
|
|
349
260
|
var ErrorBoundary = class extends Component {
|
|
350
261
|
constructor(props) {
|
|
351
262
|
super(props);
|
|
@@ -365,7 +276,7 @@ var ErrorBoundary = class extends Component {
|
|
|
365
276
|
}
|
|
366
277
|
render() {
|
|
367
278
|
if (this.state.error) {
|
|
368
|
-
return /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ React2.createElement(this.props.fallback, {
|
|
369
280
|
error: this.state.error,
|
|
370
281
|
reset: this.resetError
|
|
371
282
|
});
|
|
@@ -380,7 +291,7 @@ var ErrorBoundary = class extends Component {
|
|
|
380
291
|
};
|
|
381
292
|
|
|
382
293
|
// packages/sdk/app-framework/src/plugins/SurfacePlugin/Surface.tsx
|
|
383
|
-
import
|
|
294
|
+
import React3, { forwardRef, Fragment, isValidElement } from "react";
|
|
384
295
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
385
296
|
var Surface = /* @__PURE__ */ forwardRef(({ role, name = role, fallback, ...rest }, forwardedRef) => {
|
|
386
297
|
const props = {
|
|
@@ -391,13 +302,13 @@ var Surface = /* @__PURE__ */ forwardRef(({ role, name = role, fallback, ...rest
|
|
|
391
302
|
};
|
|
392
303
|
const context = useContext2(SurfaceContext);
|
|
393
304
|
const data = props.data ?? (name && context?.surfaces?.[name]?.data || {});
|
|
394
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, fallback ? /* @__PURE__ */ React3.createElement(ErrorBoundary, {
|
|
395
306
|
data,
|
|
396
307
|
fallback
|
|
397
|
-
}, /* @__PURE__ */
|
|
308
|
+
}, /* @__PURE__ */ React3.createElement(SurfaceResolver, {
|
|
398
309
|
...props,
|
|
399
310
|
ref: forwardedRef
|
|
400
|
-
})) : /* @__PURE__ */
|
|
311
|
+
})) : /* @__PURE__ */ React3.createElement(SurfaceResolver, {
|
|
401
312
|
...props,
|
|
402
313
|
ref: forwardedRef
|
|
403
314
|
}));
|
|
@@ -414,9 +325,9 @@ var SurfaceResolver = /* @__PURE__ */ forwardRef((props, forwardedRef) => {
|
|
|
414
325
|
...props.surfaces
|
|
415
326
|
}
|
|
416
327
|
};
|
|
417
|
-
return /* @__PURE__ */
|
|
328
|
+
return /* @__PURE__ */ React3.createElement(SurfaceContext.Provider, {
|
|
418
329
|
value: currentContext
|
|
419
|
-
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */
|
|
330
|
+
}, nodes.length > 0 ? nodes : props.contentFallback ? /* @__PURE__ */ React3.createElement(props.contentFallback, null) : null);
|
|
420
331
|
});
|
|
421
332
|
var resolveNodes = (components, props, context, forwardedRef) => {
|
|
422
333
|
const data = {
|
|
@@ -451,153 +362,14 @@ var resolveNodes = (components, props, context, forwardedRef) => {
|
|
|
451
362
|
return 1;
|
|
452
363
|
}
|
|
453
364
|
return 0;
|
|
454
|
-
}).map(([key, result]) => /* @__PURE__ */
|
|
365
|
+
}).map(([key, result]) => /* @__PURE__ */ React3.createElement(Fragment, {
|
|
455
366
|
key
|
|
456
367
|
}, result.node));
|
|
457
368
|
return props.limit ? nodes.slice(0, props.limit) : nodes;
|
|
458
369
|
};
|
|
459
370
|
|
|
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
|
-
|
|
554
|
-
// packages/sdk/app-framework/src/plugins/components/ShortcutsDialog.tsx
|
|
555
|
-
import React7 from "react";
|
|
556
|
-
import { Keyboard as Keyboard2, keySymbols as keySymbols2 } from "@dxos/keyboard";
|
|
557
|
-
import { Button as Button3, Dialog as Dialog3, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
558
|
-
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
559
|
-
var ShortcutsDialogContent = () => {
|
|
560
|
-
const { t } = useTranslation3("os");
|
|
561
|
-
const toString = (label) => Array.isArray(label) ? t(...label) : label;
|
|
562
|
-
const bindings = Keyboard2.singleton.getBindings();
|
|
563
|
-
bindings.sort((a, b) => {
|
|
564
|
-
return toString(a.data)?.toLowerCase().localeCompare(toString(b.data)?.toLowerCase());
|
|
565
|
-
});
|
|
566
|
-
return /* @__PURE__ */ React7.createElement(Dialog3.Content, {
|
|
567
|
-
classNames: [
|
|
568
|
-
"max-bs-[40rem] md:max-is-[30rem] overflow-hidden"
|
|
569
|
-
]
|
|
570
|
-
}, /* @__PURE__ */ React7.createElement(Dialog3.Title, null, t("shortcuts dialog title", {
|
|
571
|
-
ns: "os"
|
|
572
|
-
})), /* @__PURE__ */ React7.createElement("div", {
|
|
573
|
-
className: "grow overflow-y-auto py-2"
|
|
574
|
-
}, /* @__PURE__ */ React7.createElement("table", {
|
|
575
|
-
className: "table-fixed border-collapse my-4"
|
|
576
|
-
}, /* @__PURE__ */ React7.createElement("tbody", null, bindings.map((binding, i) => /* @__PURE__ */ React7.createElement("tr", {
|
|
577
|
-
key: i
|
|
578
|
-
}, /* @__PURE__ */ React7.createElement("td", {
|
|
579
|
-
className: "p-1 w-[120px]"
|
|
580
|
-
}, /* @__PURE__ */ React7.createElement("div", {
|
|
581
|
-
className: "flex gap-1"
|
|
582
|
-
}, keySymbols2(binding.binding).map((c, i2) => /* @__PURE__ */ React7.createElement("span", {
|
|
583
|
-
key: i2,
|
|
584
|
-
className: mx3("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")
|
|
585
|
-
}, c)))), /* @__PURE__ */ React7.createElement("td", {
|
|
586
|
-
className: "p-1"
|
|
587
|
-
}, /* @__PURE__ */ React7.createElement("span", {
|
|
588
|
-
className: "grow truncate"
|
|
589
|
-
}, toString(binding.data)))))))), /* @__PURE__ */ React7.createElement(Dialog3.Close, {
|
|
590
|
-
asChild: true
|
|
591
|
-
}, /* @__PURE__ */ React7.createElement(Button3, {
|
|
592
|
-
variant: "primary",
|
|
593
|
-
classNames: "mbs-2"
|
|
594
|
-
}, t("close label", {
|
|
595
|
-
ns: "os"
|
|
596
|
-
}))));
|
|
597
|
-
};
|
|
598
|
-
|
|
599
371
|
// packages/sdk/app-framework/src/App.tsx
|
|
600
|
-
import
|
|
372
|
+
import React4 from "react";
|
|
601
373
|
import { invariant } from "@dxos/invariant";
|
|
602
374
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/app-framework/src/App.tsx";
|
|
603
375
|
var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }) => {
|
|
@@ -639,10 +411,9 @@ var createApp = ({ order, plugins, core = order.map(({ id }) => id), ...params }
|
|
|
639
411
|
});
|
|
640
412
|
const Context = host.provides.context;
|
|
641
413
|
const Root = host.provides.root;
|
|
642
|
-
return () => /* @__PURE__ */
|
|
414
|
+
return () => /* @__PURE__ */ React4.createElement(Context, null, /* @__PURE__ */ React4.createElement(Root, null));
|
|
643
415
|
};
|
|
644
416
|
export {
|
|
645
|
-
CommandsDialogContent,
|
|
646
417
|
ErrorBoundary,
|
|
647
418
|
IntentProvider,
|
|
648
419
|
Layout,
|
|
@@ -653,9 +424,7 @@ export {
|
|
|
653
424
|
Resource,
|
|
654
425
|
ResourceKey,
|
|
655
426
|
ResourceLanguage,
|
|
656
|
-
|
|
657
|
-
SettingsValue,
|
|
658
|
-
ShortcutsDialogContent,
|
|
427
|
+
SettingsAction,
|
|
659
428
|
Surface,
|
|
660
429
|
SurfaceProvider,
|
|
661
430
|
createApp,
|
|
@@ -673,6 +442,7 @@ export {
|
|
|
673
442
|
parseMetadataResolverPlugin,
|
|
674
443
|
parsePluginHost,
|
|
675
444
|
parseRootSurfacePlugin,
|
|
445
|
+
parseSettingsPlugin,
|
|
676
446
|
parseSurfacePlugin,
|
|
677
447
|
parseTranslationsPlugin,
|
|
678
448
|
pluginMeta,
|