@dxos/shell 0.5.1-next.5e6b3f6 → 0.5.1-next.823fe3b
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/bundle/shell.mjs +4575 -4587
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +54 -54
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +35 -60
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +10 -29
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +0 -1
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +0 -1
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +21 -21
- package/src/composites/Shell/run-shell.tsx +19 -51
- package/src/translations/locales/en-US.ts +0 -1
|
@@ -3746,8 +3746,8 @@ import React47, { StrictMode } from "react";
|
|
|
3746
3746
|
import { createRoot } from "react-dom/client";
|
|
3747
3747
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3748
3748
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
3749
|
-
import { AgentHostingProvider, Client, ClientContext, ClientServicesProxy, Config,
|
|
3750
|
-
import {
|
|
3749
|
+
import { AgentHostingProvider, Client, ClientContext, ClientServicesProxy, Config, SystemStatus } from "@dxos/react-client";
|
|
3750
|
+
import { ThemeProvider, Tooltip as Tooltip7 } from "@dxos/react-ui";
|
|
3751
3751
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
3752
3752
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3753
3753
|
|
|
@@ -4067,8 +4067,7 @@ var os = {
|
|
|
4067
4067
|
"agent message body": "Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it\u2019s always online your changes will sync even when all your physical devices are\xA0asleep.",
|
|
4068
4068
|
"create agent label": "Start an agent",
|
|
4069
4069
|
"destroy agent label": "Shut down agent",
|
|
4070
|
-
"agent device label": "Your agent"
|
|
4071
|
-
"shell fallback title": "Shell failed to connect"
|
|
4070
|
+
"agent device label": "Your agent"
|
|
4072
4071
|
};
|
|
4073
4072
|
|
|
4074
4073
|
// packages/sdk/shell/src/translations/index.ts
|
|
@@ -4078,63 +4077,39 @@ var osTranslations = {
|
|
|
4078
4077
|
|
|
4079
4078
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
4080
4079
|
var runShell = async (config = new Config()) => {
|
|
4080
|
+
const services = new ClientServicesProxy(createIFramePort({
|
|
4081
|
+
channel: DEFAULT_CLIENT_CHANNEL
|
|
4082
|
+
}));
|
|
4083
|
+
const client = new Client({
|
|
4084
|
+
config,
|
|
4085
|
+
services
|
|
4086
|
+
});
|
|
4081
4087
|
const runtime = new ShellRuntimeImpl(createIFramePort({
|
|
4082
4088
|
channel: DEFAULT_SHELL_CHANNEL
|
|
4083
4089
|
}));
|
|
4084
|
-
await
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
status: SystemStatus.ACTIVE
|
|
4103
|
-
}
|
|
4104
|
-
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4105
|
-
runtime,
|
|
4106
|
-
origin: location.origin
|
|
4107
|
-
}))))))));
|
|
4108
|
-
} catch {
|
|
4109
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
4110
|
-
tx: defaultTx,
|
|
4111
|
-
resourceExtensions: [
|
|
4112
|
-
osTranslations
|
|
4113
|
-
]
|
|
4114
|
-
}, /* @__PURE__ */ React47.createElement(Fallback, {
|
|
4115
|
-
onClose: () => runtime.setAppContext({
|
|
4116
|
-
display: ShellDisplay2.NONE
|
|
4117
|
-
})
|
|
4118
|
-
}))));
|
|
4119
|
-
}
|
|
4120
|
-
};
|
|
4121
|
-
var Fallback = ({ onClose }) => {
|
|
4122
|
-
const { t } = useTranslation26("os");
|
|
4123
|
-
return /* @__PURE__ */ React47.createElement(Dialog3.Root, {
|
|
4124
|
-
modal: true,
|
|
4125
|
-
open: true,
|
|
4126
|
-
onOpenChange: () => onClose?.()
|
|
4127
|
-
}, /* @__PURE__ */ React47.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React47.createElement(Dialog3.Content, null, /* @__PURE__ */ React47.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React47.createElement(Dialog3.Close, {
|
|
4128
|
-
asChild: true,
|
|
4129
|
-
onClick: () => onClose?.()
|
|
4130
|
-
}, /* @__PURE__ */ React47.createElement(Button11, {
|
|
4131
|
-
variant: "primary"
|
|
4132
|
-
}, t("close label"))))));
|
|
4090
|
+
await Promise.all([
|
|
4091
|
+
runtime.open(),
|
|
4092
|
+
client.initialize()
|
|
4093
|
+
]);
|
|
4094
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
4095
|
+
tx: defaultTx,
|
|
4096
|
+
resourceExtensions: [
|
|
4097
|
+
osTranslations
|
|
4098
|
+
]
|
|
4099
|
+
}, /* @__PURE__ */ React47.createElement(ClientContext.Provider, {
|
|
4100
|
+
value: {
|
|
4101
|
+
client,
|
|
4102
|
+
status: SystemStatus.ACTIVE
|
|
4103
|
+
}
|
|
4104
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4105
|
+
runtime,
|
|
4106
|
+
origin: location.origin
|
|
4107
|
+
}))))))));
|
|
4133
4108
|
};
|
|
4134
4109
|
|
|
4135
4110
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4136
4111
|
import React48, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState14 } from "react";
|
|
4137
|
-
import { ShellDisplay as
|
|
4112
|
+
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as useClient8 } from "@dxos/react-client";
|
|
4138
4113
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4139
4114
|
import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
4140
4115
|
|
|
@@ -4177,9 +4152,9 @@ var useShell = () => {
|
|
|
4177
4152
|
const setLayout = async (layout, options) => {
|
|
4178
4153
|
if (runtime) {
|
|
4179
4154
|
if (layout === ShellLayout3.DEFAULT) {
|
|
4180
|
-
setDisplay?.(
|
|
4155
|
+
setDisplay?.(ShellDisplay2.NONE);
|
|
4181
4156
|
} else {
|
|
4182
|
-
setDisplay?.(
|
|
4157
|
+
setDisplay?.(ShellDisplay2.FULLSCREEN);
|
|
4183
4158
|
}
|
|
4184
4159
|
runtime.setLayout({
|
|
4185
4160
|
layout,
|
|
@@ -4195,7 +4170,7 @@ var useShell = () => {
|
|
|
4195
4170
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4196
4171
|
const client = useClient8();
|
|
4197
4172
|
const identity = useIdentity3();
|
|
4198
|
-
const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ?
|
|
4173
|
+
const [display, setDisplay] = useState14(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
|
|
4199
4174
|
const shellRuntime = useMemo6(() => {
|
|
4200
4175
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4201
4176
|
return;
|
|
@@ -4230,13 +4205,13 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4230
4205
|
shellRuntime.setLayout({
|
|
4231
4206
|
layout: ShellLayout3.SHARE_IDENTITY
|
|
4232
4207
|
});
|
|
4233
|
-
setDisplay(
|
|
4208
|
+
setDisplay(ShellDisplay2.FULLSCREEN);
|
|
4234
4209
|
} else if (event.key === "." && modifier) {
|
|
4235
4210
|
shellRuntime.setLayout({
|
|
4236
4211
|
layout: ShellLayout3.SPACE,
|
|
4237
4212
|
spaceKey: space.key
|
|
4238
4213
|
});
|
|
4239
|
-
setDisplay(
|
|
4214
|
+
setDisplay(ShellDisplay2.FULLSCREEN);
|
|
4240
4215
|
}
|
|
4241
4216
|
}, [
|
|
4242
4217
|
space,
|
|
@@ -4266,7 +4241,7 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4266
4241
|
shellRuntime
|
|
4267
4242
|
]);
|
|
4268
4243
|
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4269
|
-
className: mx25(display ===
|
|
4244
|
+
className: mx25(display === ShellDisplay2.NONE ? "hidden" : "")
|
|
4270
4245
|
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4271
4246
|
runtime: shellRuntime,
|
|
4272
4247
|
origin: window.location.origin
|