@dxos/shell 0.5.1-main.39e0ee2 → 0.5.1-main.3ccf9bd
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 +1098 -1099
- 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 +17 -57
- 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/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +18 -2
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +0 -3
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +5 -5
- package/dist/types/src/translations/locales/en-US.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
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +18 -2
- package/src/steps/InvitationManager.tsx +0 -3
- package/src/translations/locales/en-US.ts +5 -5
|
@@ -1524,9 +1524,6 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1524
1524
|
const showAuthCode = statusValue === 3;
|
|
1525
1525
|
const emoji = hexToEmoji3(id);
|
|
1526
1526
|
const activeView = useMemo2(() => {
|
|
1527
|
-
if (multiUse) {
|
|
1528
|
-
return "showing qr";
|
|
1529
|
-
}
|
|
1530
1527
|
switch (true) {
|
|
1531
1528
|
case statusValue === 5:
|
|
1532
1529
|
case statusValue < 0:
|
|
@@ -3508,8 +3505,8 @@ var SpaceManager = (props) => {
|
|
|
3508
3505
|
icon: UsersThree,
|
|
3509
3506
|
onClick: useCallback8(() => {
|
|
3510
3507
|
const invitation = space.share?.({
|
|
3511
|
-
type: Invitation7.Type.
|
|
3512
|
-
authMethod: Invitation7.AuthMethod.
|
|
3508
|
+
type: Invitation7.Type.INTERACTIVE,
|
|
3509
|
+
authMethod: Invitation7.AuthMethod.NONE,
|
|
3513
3510
|
multiUse: true,
|
|
3514
3511
|
target
|
|
3515
3512
|
});
|
|
@@ -3795,37 +3792,17 @@ var StatusDialog = () => {
|
|
|
3795
3792
|
|
|
3796
3793
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3797
3794
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3798
|
-
var Shell = ({ runtime }) => {
|
|
3795
|
+
var Shell = ({ runtime, origin }) => {
|
|
3799
3796
|
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState13({
|
|
3800
3797
|
layout: runtime.layout,
|
|
3801
3798
|
invitationCode: runtime.invitationCode,
|
|
3802
3799
|
spaceKey: runtime.spaceKey,
|
|
3803
3800
|
target: runtime.target
|
|
3804
3801
|
});
|
|
3805
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState13({
|
|
3806
|
-
invitationUrl: runtime.invitationUrl,
|
|
3807
|
-
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
3808
|
-
spaceInvitationParam: runtime.spaceInvitationParam
|
|
3809
|
-
});
|
|
3810
3802
|
const client = useClient7();
|
|
3811
3803
|
const space = useSpace2(spaceKey);
|
|
3812
|
-
const createDeviceInvitationUrl = (invitationCode2) => {
|
|
3813
|
-
const baseUrl = new URL(invitationUrl);
|
|
3814
|
-
baseUrl.searchParams.set(deviceInvitationParam, invitationCode2);
|
|
3815
|
-
return baseUrl.toString();
|
|
3816
|
-
};
|
|
3817
|
-
const createSpaceInvitationUrl = (invitationCode2) => {
|
|
3818
|
-
const baseUrl = new URL(invitationUrl);
|
|
3819
|
-
baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
|
|
3820
|
-
return baseUrl.toString();
|
|
3821
|
-
};
|
|
3822
3804
|
useEffect7(() => {
|
|
3823
|
-
|
|
3824
|
-
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
3825
|
-
return () => {
|
|
3826
|
-
unsubscribeLayout();
|
|
3827
|
-
unsubscribeInvitationUrl();
|
|
3828
|
-
};
|
|
3805
|
+
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
3829
3806
|
}, [
|
|
3830
3807
|
runtime
|
|
3831
3808
|
]);
|
|
@@ -3833,7 +3810,7 @@ var Shell = ({ runtime }) => {
|
|
|
3833
3810
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3834
3811
|
log14.warn("No space found for shell space invitations.", void 0, {
|
|
3835
3812
|
F: __dxlog_file13,
|
|
3836
|
-
L:
|
|
3813
|
+
L: 33,
|
|
3837
3814
|
S: void 0,
|
|
3838
3815
|
C: (f, a) => f(...a)
|
|
3839
3816
|
});
|
|
@@ -3877,7 +3854,7 @@ var Shell = ({ runtime }) => {
|
|
|
3877
3854
|
case ShellLayout.SHARE_IDENTITY:
|
|
3878
3855
|
case ShellLayout.EDIT_PROFILE:
|
|
3879
3856
|
return /* @__PURE__ */ React46.createElement(IdentityDialog, {
|
|
3880
|
-
createInvitationUrl:
|
|
3857
|
+
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3881
3858
|
onResetStorage: async () => {
|
|
3882
3859
|
runtime.setLayout({
|
|
3883
3860
|
layout: ShellLayout.STATUS
|
|
@@ -3911,7 +3888,7 @@ var Shell = ({ runtime }) => {
|
|
|
3911
3888
|
return space ? /* @__PURE__ */ React46.createElement(SpaceDialog, {
|
|
3912
3889
|
space,
|
|
3913
3890
|
target,
|
|
3914
|
-
createInvitationUrl:
|
|
3891
|
+
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
3915
3892
|
onDone: async () => {
|
|
3916
3893
|
await runtime.setAppContext({
|
|
3917
3894
|
display: ShellDisplay.NONE
|
|
@@ -4037,14 +4014,14 @@ var os = {
|
|
|
4037
4014
|
"auth code message": "Enter the following auth code on the joining device.",
|
|
4038
4015
|
"display name input label": "Display name",
|
|
4039
4016
|
"display name input placeholder": "Enter a display name",
|
|
4040
|
-
"invite one label": "
|
|
4017
|
+
"invite one label": "Invite one",
|
|
4041
4018
|
"invite one description": "Only one user may join.",
|
|
4042
|
-
"invite one qr label": "Single-use
|
|
4019
|
+
"invite one qr label": "Single-use",
|
|
4043
4020
|
"invite one list item label": "Active single-use invitation",
|
|
4044
|
-
"invite many label": "
|
|
4021
|
+
"invite many label": "Invite many",
|
|
4045
4022
|
"invite many description": "Anyone with the link can join.",
|
|
4046
|
-
"invite many qr label": "
|
|
4047
|
-
"invite many list item label": "Active
|
|
4023
|
+
"invite many qr label": "Multiple-use",
|
|
4024
|
+
"invite many list item label": "Active multiple-use invitation",
|
|
4048
4025
|
"invite options label": "Change the active invite option.",
|
|
4049
4026
|
"reset in progress label": "Resetting...",
|
|
4050
4027
|
"confirm label": "Confirm",
|
|
@@ -4125,7 +4102,8 @@ var runShell = async (config = new Config()) => {
|
|
|
4125
4102
|
status: SystemStatus.ACTIVE
|
|
4126
4103
|
}
|
|
4127
4104
|
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4128
|
-
runtime
|
|
4105
|
+
runtime,
|
|
4106
|
+
origin: location.origin
|
|
4129
4107
|
}))))))));
|
|
4130
4108
|
} catch {
|
|
4131
4109
|
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React47.createElement(StrictMode, null, /* @__PURE__ */ React47.createElement(ThemeProvider, {
|
|
@@ -4164,16 +4142,12 @@ import { mx as mx25 } from "@dxos/react-ui-theme";
|
|
|
4164
4142
|
import { Event } from "@dxos/async";
|
|
4165
4143
|
import { ShellLayout as ShellLayout2 } from "@dxos/react-client";
|
|
4166
4144
|
var MemoryShellRuntime = class {
|
|
4167
|
-
constructor({ layout, invitationCode, spaceKey
|
|
4145
|
+
constructor({ layout, invitationCode, spaceKey } = {}) {
|
|
4168
4146
|
this.layoutUpdate = new Event();
|
|
4169
|
-
this.invitationUrlUpdate = new Event();
|
|
4170
4147
|
this.contextUpdate = new Event();
|
|
4171
4148
|
this._layout = layout ?? ShellLayout2.DEFAULT;
|
|
4172
4149
|
this._invitationCode = invitationCode;
|
|
4173
4150
|
this._spaceKey = spaceKey;
|
|
4174
|
-
this._invitationUrl = invitationUrl ?? window.location.origin;
|
|
4175
|
-
this._deviceInvitationParam = deviceInvitationParam ?? "deviceInvitationCode";
|
|
4176
|
-
this._spaceInvitationParam = spaceInvitationParam ?? "spaceInvitationCode";
|
|
4177
4151
|
}
|
|
4178
4152
|
get layout() {
|
|
4179
4153
|
return this._layout;
|
|
@@ -4184,27 +4158,12 @@ var MemoryShellRuntime = class {
|
|
|
4184
4158
|
get spaceKey() {
|
|
4185
4159
|
return this._spaceKey;
|
|
4186
4160
|
}
|
|
4187
|
-
get invitationUrl() {
|
|
4188
|
-
return this._invitationUrl;
|
|
4189
|
-
}
|
|
4190
|
-
get deviceInvitationParam() {
|
|
4191
|
-
return this._deviceInvitationParam;
|
|
4192
|
-
}
|
|
4193
|
-
get spaceInvitationParam() {
|
|
4194
|
-
return this._spaceInvitationParam;
|
|
4195
|
-
}
|
|
4196
4161
|
setLayout(request) {
|
|
4197
4162
|
this._layout = request.layout;
|
|
4198
4163
|
this._invitationCode = request.invitationCode;
|
|
4199
4164
|
this._spaceKey = request.spaceKey;
|
|
4200
4165
|
this.layoutUpdate.emit(request);
|
|
4201
4166
|
}
|
|
4202
|
-
setInvitationUrl(request) {
|
|
4203
|
-
this._invitationUrl = request.invitationUrl;
|
|
4204
|
-
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
4205
|
-
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
4206
|
-
this.invitationUrlUpdate.emit(request);
|
|
4207
|
-
}
|
|
4208
4167
|
async setAppContext(context) {
|
|
4209
4168
|
this.contextUpdate.emit(context);
|
|
4210
4169
|
}
|
|
@@ -4309,7 +4268,8 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4309
4268
|
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, shellRuntime && /* @__PURE__ */ React48.createElement("div", {
|
|
4310
4269
|
className: mx25(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4311
4270
|
}, /* @__PURE__ */ React48.createElement(Shell, {
|
|
4312
|
-
runtime: shellRuntime
|
|
4271
|
+
runtime: shellRuntime,
|
|
4272
|
+
origin: window.location.origin
|
|
4313
4273
|
})), /* @__PURE__ */ React48.createElement(ShellContext.Provider, {
|
|
4314
4274
|
value: {
|
|
4315
4275
|
runtime: shellRuntime,
|