@dxos/shell 0.5.1-main.6564b82 → 0.5.1-main.6df1309
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 +1049 -1064
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +29 -29
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +10 -47
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/types/src/composites/Shell/Shell.d.ts +2 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +4 -24
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js.map +1 -1
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts +2 -10
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/memory-shell-runtime.js +1 -20
- package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +1 -1
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
- package/package.json +21 -21
- package/src/composites/Shell/Shell.tsx +5 -36
- package/src/composites/Shell/ShellContext.tsx +1 -1
- package/src/composites/Shell/memory-shell-runtime.ts +2 -36
- package/src/composites/Shell/run-shell.tsx +1 -1
|
@@ -3792,37 +3792,17 @@ var StatusDialog = () => {
|
|
|
3792
3792
|
|
|
3793
3793
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3794
3794
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3795
|
-
var Shell = ({ runtime }) => {
|
|
3795
|
+
var Shell = ({ runtime, origin }) => {
|
|
3796
3796
|
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState13({
|
|
3797
3797
|
layout: runtime.layout,
|
|
3798
3798
|
invitationCode: runtime.invitationCode,
|
|
3799
3799
|
spaceKey: runtime.spaceKey,
|
|
3800
3800
|
target: runtime.target
|
|
3801
3801
|
});
|
|
3802
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState13({
|
|
3803
|
-
invitationUrl: runtime.invitationUrl,
|
|
3804
|
-
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
3805
|
-
spaceInvitationParam: runtime.spaceInvitationParam
|
|
3806
|
-
});
|
|
3807
3802
|
const client = useClient7();
|
|
3808
3803
|
const space = useSpace2(spaceKey);
|
|
3809
|
-
const createDeviceInvitationUrl = (invitationCode2) => {
|
|
3810
|
-
const baseUrl = new URL(invitationUrl);
|
|
3811
|
-
baseUrl.searchParams.set(deviceInvitationParam, invitationCode2);
|
|
3812
|
-
return baseUrl.toString();
|
|
3813
|
-
};
|
|
3814
|
-
const createSpaceInvitationUrl = (invitationCode2) => {
|
|
3815
|
-
const baseUrl = new URL(invitationUrl);
|
|
3816
|
-
baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
|
|
3817
|
-
return baseUrl.toString();
|
|
3818
|
-
};
|
|
3819
3804
|
useEffect7(() => {
|
|
3820
|
-
|
|
3821
|
-
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
3822
|
-
return () => {
|
|
3823
|
-
unsubscribeLayout();
|
|
3824
|
-
unsubscribeInvitationUrl();
|
|
3825
|
-
};
|
|
3805
|
+
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
3826
3806
|
}, [
|
|
3827
3807
|
runtime
|
|
3828
3808
|
]);
|
|
@@ -3830,7 +3810,7 @@ var Shell = ({ runtime }) => {
|
|
|
3830
3810
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3831
3811
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3832
3812
|
F: __dxlog_file13,
|
|
3833
|
-
L:
|
|
3813
|
+
L: 33,
|
|
3834
3814
|
S: void 0,
|
|
3835
3815
|
C: (f, a) => f(...a)
|
|
3836
3816
|
});
|
|
@@ -3874,7 +3854,7 @@ var Shell = ({ runtime }) => {
|
|
|
3874
3854
|
case ShellLayout.SHARE_IDENTITY:
|
|
3875
3855
|
case ShellLayout.EDIT_PROFILE:
|
|
3876
3856
|
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
3877
|
-
createInvitationUrl:
|
|
3857
|
+
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3878
3858
|
onResetStorage: async () => {
|
|
3879
3859
|
runtime.setLayout({
|
|
3880
3860
|
layout: ShellLayout.STATUS
|
|
@@ -3908,7 +3888,7 @@ var Shell = ({ runtime }) => {
|
|
|
3908
3888
|
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
3909
3889
|
space,
|
|
3910
3890
|
target,
|
|
3911
|
-
createInvitationUrl:
|
|
3891
|
+
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
3912
3892
|
onDone: async () => {
|
|
3913
3893
|
await runtime.setAppContext({
|
|
3914
3894
|
display: ShellDisplay.NONE
|
|
@@ -4122,7 +4102,8 @@ var runShell = async (config = new Config()) => {
|
|
|
4122
4102
|
status: SystemStatus.ACTIVE
|
|
4123
4103
|
}
|
|
4124
4104
|
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4125
|
-
runtime
|
|
4105
|
+
runtime,
|
|
4106
|
+
origin: location.origin
|
|
4126
4107
|
}))))))));
|
|
4127
4108
|
} catch {
|
|
4128
4109
|
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
@@ -4161,16 +4142,12 @@ import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
|
4161
4142
|
import { Event } from "@dxos/async";
|
|
4162
4143
|
import { ShellLayout as ShellLayout2 } from "@dxos/react-client";
|
|
4163
4144
|
var MemoryShellRuntime = class {
|
|
4164
|
-
constructor({ layout, invitationCode, spaceKey
|
|
4145
|
+
constructor({ layout, invitationCode, spaceKey } = {}) {
|
|
4165
4146
|
this.layoutUpdate = new Event();
|
|
4166
|
-
this.invitationUrlUpdate = new Event();
|
|
4167
4147
|
this.contextUpdate = new Event();
|
|
4168
4148
|
this._layout = layout ?? ShellLayout2.DEFAULT;
|
|
4169
4149
|
this._invitationCode = invitationCode;
|
|
4170
4150
|
this._spaceKey = spaceKey;
|
|
4171
|
-
this._invitationUrl = invitationUrl ?? window.location.origin;
|
|
4172
|
-
this._deviceInvitationParam = deviceInvitationParam ?? "deviceInvitationCode";
|
|
4173
|
-
this._spaceInvitationParam = spaceInvitationParam ?? "spaceInvitationCode";
|
|
4174
4151
|
}
|
|
4175
4152
|
get layout() {
|
|
4176
4153
|
return this._layout;
|
|
@@ -4181,27 +4158,12 @@ var MemoryShellRuntime = class {
|
|
|
4181
4158
|
get spaceKey() {
|
|
4182
4159
|
return this._spaceKey;
|
|
4183
4160
|
}
|
|
4184
|
-
get invitationUrl() {
|
|
4185
|
-
return this._invitationUrl;
|
|
4186
|
-
}
|
|
4187
|
-
get deviceInvitationParam() {
|
|
4188
|
-
return this._deviceInvitationParam;
|
|
4189
|
-
}
|
|
4190
|
-
get spaceInvitationParam() {
|
|
4191
|
-
return this._spaceInvitationParam;
|
|
4192
|
-
}
|
|
4193
4161
|
setLayout(request) {
|
|
4194
4162
|
this._layout = request.layout;
|
|
4195
4163
|
this._invitationCode = request.invitationCode;
|
|
4196
4164
|
this._spaceKey = request.spaceKey;
|
|
4197
4165
|
this.layoutUpdate.emit(request);
|
|
4198
4166
|
}
|
|
4199
|
-
setInvitationUrl(request) {
|
|
4200
|
-
this._invitationUrl = request.invitationUrl;
|
|
4201
|
-
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
4202
|
-
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
4203
|
-
this.invitationUrlUpdate.emit(request);
|
|
4204
|
-
}
|
|
4205
4167
|
async setAppContext(context) {
|
|
4206
4168
|
this.contextUpdate.emit(context);
|
|
4207
4169
|
}
|
|
@@ -4306,7 +4268,8 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4306
4268
|
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4307
4269
|
className: mx25(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4308
4270
|
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4309
|
-
runtime: shellRuntime
|
|
4271
|
+
runtime: shellRuntime,
|
|
4272
|
+
origin: window.location.origin
|
|
4310
4273
|
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4311
4274
|
value: {
|
|
4312
4275
|
runtime: shellRuntime,
|