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