@dxos/react-ui 0.1.35 → 0.1.36

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.
Files changed (50) hide show
  1. package/dist/lib/browser/chunk-5VRACIDE.mjs +10 -0
  2. package/dist/lib/browser/chunk-5VRACIDE.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +231 -181
  4. package/dist/lib/browser/index.mjs.map +3 -3
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +45 -0
  7. package/dist/lib/browser/testing/index.mjs.map +7 -0
  8. package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts.map +1 -1
  9. package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
  10. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
  11. package/dist/types/src/composites/Shell/ShellContext.d.ts.map +1 -1
  12. package/dist/types/src/panels/DevicesPanel/DevicesPanel.d.ts.map +1 -1
  13. package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +5 -5
  14. package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -1
  15. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts +1 -1
  16. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts.map +1 -1
  17. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts +2 -2
  18. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts.map +1 -1
  19. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts +2 -2
  20. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts.map +1 -1
  21. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts +2 -2
  22. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts.map +1 -1
  23. package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -1
  24. package/dist/types/src/playwright/invitations-manager.d.ts +8 -17
  25. package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
  26. package/dist/types/src/testing/index.d.ts +2 -0
  27. package/dist/types/src/testing/index.d.ts.map +1 -0
  28. package/dist/types/src/testing/shell-manager.d.ts +16 -0
  29. package/dist/types/src/testing/shell-manager.d.ts.map +1 -0
  30. package/dist/types/src/util/invitationStatusValue.d.ts.map +1 -1
  31. package/package.json +25 -14
  32. package/src/components/InvitationList/InvitationList.tsx +2 -2
  33. package/src/components/InvitationList/InvitationListContainer.tsx +3 -2
  34. package/src/components/InvitationList/InvitationListItem.tsx +4 -8
  35. package/src/composites/JoinDialog/JoinDialog.stories.tsx +3 -12
  36. package/src/composites/Shell/Shell.tsx +4 -4
  37. package/src/composites/Shell/ShellContext.tsx +11 -8
  38. package/src/panels/DevicesPanel/DevicesPanel.tsx +3 -1
  39. package/src/panels/JoinPanel/JoinPanel.tsx +8 -8
  40. package/src/panels/JoinPanel/joinMachine.ts +108 -98
  41. package/src/panels/JoinPanel/view-states/InvitationAccepted.tsx +7 -7
  42. package/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx +14 -14
  43. package/src/panels/JoinPanel/view-states/InvitationInput.tsx +9 -9
  44. package/src/panels/JoinPanel/view-states/InvitationRescuer.tsx +10 -10
  45. package/src/panels/SpacePanel/SpacePanel.tsx +19 -4
  46. package/src/playwright/invitations-manager.ts +23 -78
  47. package/src/playwright/invitations.spec.ts +147 -139
  48. package/src/testing/index.ts +5 -0
  49. package/src/testing/shell-manager.ts +61 -0
  50. package/src/util/invitationStatusValue.ts +3 -2
@@ -1,8 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
1
+ import {
2
+ __export
3
+ } from "./chunk-5VRACIDE.mjs";
6
4
 
7
5
  // packages/apps/patterns/react-ui/src/components/Clipboard/CopyButton.tsx
8
6
  import { Check, Copy } from "@phosphor-icons/react";
@@ -197,12 +195,16 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
197
195
  2
198
196
  ],
199
197
  [
200
- Invitation.State.AUTHENTICATING,
198
+ Invitation.State.READY_FOR_AUTHENTICATION,
201
199
  3
202
200
  ],
203
201
  [
204
- Invitation.State.SUCCESS,
202
+ Invitation.State.AUTHENTICATING,
205
203
  4
204
+ ],
205
+ [
206
+ Invitation.State.SUCCESS,
207
+ 5
206
208
  ]
207
209
  ]);
208
210
 
@@ -364,12 +366,12 @@ function _extends4() {
364
366
  return _extends4.apply(this, arguments);
365
367
  }
366
368
  var InvitationListItem = ({ invitation, value, onClickRemove, createInvitationUrl }) => {
367
- var _a, _b;
369
+ var _a;
368
370
  const { t } = useTranslation3("os");
369
371
  const qrLabel = useId("qrLabel");
370
- const { cancel, status, haltedAt, invitationCode, authenticationCode } = useInvitationStatus(invitation);
372
+ const { cancel, status, haltedAt, invitationCode, authCode } = useInvitationStatus(invitation);
371
373
  const statusValue = (_a = invitationStatusValue.get(status)) != null ? _a : 0;
372
- const isCancellable = statusValue < 4 && statusValue >= 0;
374
+ const isCancellable = statusValue < 5 && statusValue >= 0;
373
375
  const showShare = statusValue < 3 && statusValue >= 0;
374
376
  const showAuthCode = statusValue === 3;
375
377
  const handleClickRemove = useCallback2(() => onClickRemove(invitation), [
@@ -385,7 +387,7 @@ var InvitationListItem = ({ invitation, value, onClickRemove, createInvitationUr
385
387
  status,
386
388
  haltedAt,
387
389
  size: 8,
388
- invitationId: (_b = invitation == null ? void 0 : invitation.invitation) == null ? void 0 : _b.invitationId
390
+ invitationId: invitation == null ? void 0 : invitation.get().invitationId
389
391
  })), showShare && invitationUrl ? /* @__PURE__ */ React9.createElement(React9.Fragment, null, /* @__PURE__ */ React9.createElement(AccordionPrimitive.Trigger, {
390
392
  asChild: true
391
393
  }, /* @__PURE__ */ React9.createElement(Button2, {
@@ -398,7 +400,7 @@ var InvitationListItem = ({ invitation, value, onClickRemove, createInvitationUr
398
400
  value: invitationUrl
399
401
  })) : showAuthCode ? /* @__PURE__ */ React9.createElement("p", {
400
402
  className: "grow text-xl text-center text-success-500 dark:text-success-300 font-mono"
401
- }, authenticationCode) : /* @__PURE__ */ React9.createElement("span", {
403
+ }, authCode) : /* @__PURE__ */ React9.createElement("span", {
402
404
  role: "none",
403
405
  className: "grow"
404
406
  }), isCancellable ? /* @__PURE__ */ React9.createElement(Button2, {
@@ -465,9 +467,8 @@ var InvitationList = ({ invitations, ...invitationProps }) => {
465
467
  className: "flex flex-col gap-1"
466
468
  }, /* @__PURE__ */ React10.createElement(DensityProvider, {
467
469
  density: "fine"
468
- }, /* @__PURE__ */ React10.createElement(ClipboardProvider, null, invitations.map((invitation, index) => {
469
- var _a, _b;
470
- const value = (_b = (_a = invitation.invitation) == null ? void 0 : _a.invitationId) != null ? _b : `inv_${index}`;
470
+ }, /* @__PURE__ */ React10.createElement(ClipboardProvider, null, invitations.map((invitation) => {
471
+ const value = invitation.get().invitationId;
471
472
  return /* @__PURE__ */ React10.createElement(InvitationListItem, _extends5({
472
473
  key: value,
473
474
  value,
@@ -496,8 +497,9 @@ function _extends6() {
496
497
  var InvitationListContainer = ({ spaceKey, createInvitationUrl }) => {
497
498
  const space = useSpace(spaceKey);
498
499
  const invitations = useSpaceInvitations(spaceKey);
499
- const onClickRemove = useCallback3(({ invitation }) => {
500
- (invitation == null ? void 0 : invitation.invitationId) && (space == null ? void 0 : space.removeInvitation(invitation.invitationId));
500
+ const onClickRemove = useCallback3((invitation) => {
501
+ const invitationId = invitation.get().invitationId;
502
+ invitationId && (space == null ? void 0 : space.removeInvitation(invitationId));
501
503
  }, [
502
504
  space
503
505
  ]);
@@ -823,7 +825,7 @@ var DeviceListView = ({ createInvitationUrl, titleId, onDone, doneActionParent }
823
825
  className: mx13(defaultSurface, "rounded-be-md p-2")
824
826
  }, /* @__PURE__ */ React18.createElement(InvitationList, {
825
827
  invitations,
826
- onClickRemove: ({ invitation }) => invitation && client.halo.removeInvitation(invitation.invitationId),
828
+ onClickRemove: (invitation) => invitation.get() && client.halo.removeInvitation(invitation.get().invitationId),
827
829
  createInvitationUrl
828
830
  }), /* @__PURE__ */ React18.createElement(Button3, {
829
831
  className: "is-full flex gap-2 mbs-2",
@@ -957,219 +959,245 @@ import { useCallback as useCallback5 } from "react";
957
959
  import { assign, createMachine } from "xstate";
958
960
  import { Invitation as Invitation4, InvitationEncoder } from "@dxos/client";
959
961
  import { log } from "@dxos/log";
960
- var getInvitationSubscribable = (Domain, invitation) => {
962
+ var getInvitationSubscribable = (Kind, invitation) => {
961
963
  log("[subscribing to invitation]", invitation, {
962
964
  file: "joinMachine.ts",
963
- line: 75,
965
+ line: 77,
964
966
  scope: void 0,
965
967
  callSite: (f, a) => f(...a)
966
968
  });
967
969
  return {
968
- subscribe: (next, onError, complete) => {
969
- const unsubscribe = invitation.subscribe({
970
- onAuthenticating: (invitation2) => {
971
- log("[invitation authenticating]", {
972
- Domain,
970
+ subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
971
+ switch (invitation2.state) {
972
+ case Invitation4.State.CONNECTING: {
973
+ log("[invitation connecting]", {
974
+ Kind,
973
975
  invitation: invitation2
974
976
  }, {
975
977
  file: "joinMachine.ts",
976
- line: 84,
978
+ line: 88,
977
979
  scope: void 0,
978
980
  callSite: (f, a) => f(...a)
979
981
  });
980
982
  return next({
981
- type: `authenticate${Domain}Invitation`,
983
+ type: `connecting${Kind}Invitation`,
982
984
  invitation: invitation2
983
985
  });
984
- },
985
- onCancelled: () => {
986
- log.warn("[invitation cancelled]", {
987
- Domain
986
+ }
987
+ case Invitation4.State.CONNECTED: {
988
+ log("[invitation connected]", {
989
+ Kind,
990
+ invitation: invitation2
988
991
  }, {
989
992
  file: "joinMachine.ts",
990
- line: 88,
993
+ line: 93,
991
994
  scope: void 0,
992
995
  callSite: (f, a) => f(...a)
993
996
  });
994
997
  return next({
995
- type: `fail${Domain}Invitation`,
996
- reason: "cancelled"
998
+ type: `connected${Kind}Invitation`,
999
+ invitation: invitation2
997
1000
  });
998
- },
999
- onTimeout: () => {
1000
- log.error("[invitation timeout]", {
1001
- Domain
1001
+ }
1002
+ case Invitation4.State.READY_FOR_AUTHENTICATION: {
1003
+ log("[invitation ready for authentication]", {
1004
+ Kind,
1005
+ invitation: invitation2
1002
1006
  }, {
1003
1007
  file: "joinMachine.ts",
1004
- line: 92,
1008
+ line: 98,
1005
1009
  scope: void 0,
1006
1010
  callSite: (f, a) => f(...a)
1007
1011
  });
1008
1012
  return next({
1009
- type: `fail${Domain}Invitation`,
1010
- reason: "timeout"
1013
+ type: `readyForAuthentication${Kind}Invitation`,
1014
+ invitation: invitation2
1011
1015
  });
1012
- },
1013
- onConnecting: (invitation2) => {
1014
- log("[invitation connecting]", {
1015
- Domain,
1016
+ }
1017
+ case Invitation4.State.AUTHENTICATING: {
1018
+ log("[invitation authenticating]", {
1019
+ Kind,
1016
1020
  invitation: invitation2
1017
1021
  }, {
1018
1022
  file: "joinMachine.ts",
1019
- line: 96,
1023
+ line: 103,
1020
1024
  scope: void 0,
1021
1025
  callSite: (f, a) => f(...a)
1022
1026
  });
1023
1027
  return next({
1024
- type: `connect${Domain}Invitation`,
1028
+ type: `authenticating${Kind}Invitation`,
1025
1029
  invitation: invitation2
1026
1030
  });
1027
- },
1028
- onConnected: (invitation2) => {
1029
- log("[invitation connected]", {
1030
- Domain,
1031
+ }
1032
+ case Invitation4.State.SUCCESS: {
1033
+ log("[invitation success]", {
1034
+ Kind,
1031
1035
  invitation: invitation2
1032
1036
  }, {
1033
1037
  file: "joinMachine.ts",
1034
- line: 100,
1038
+ line: 108,
1035
1039
  scope: void 0,
1036
1040
  callSite: (f, a) => f(...a)
1037
1041
  });
1038
- return next({
1039
- type: `connectionSuccess${Domain}Invitation`,
1042
+ next({
1043
+ type: `success${Kind}Invitation`,
1040
1044
  invitation: invitation2
1041
1045
  });
1042
- },
1043
- onSuccess: () => {
1044
- log("[invitation success]", {
1045
- Domain
1046
+ return complete == null ? void 0 : complete();
1047
+ }
1048
+ case Invitation4.State.CANCELLED: {
1049
+ log.warn("[invitation cancelled]", {
1050
+ Kind
1046
1051
  }, {
1047
1052
  file: "joinMachine.ts",
1048
- line: 104,
1053
+ line: 114,
1049
1054
  scope: void 0,
1050
1055
  callSite: (f, a) => f(...a)
1051
1056
  });
1052
- next({
1053
- type: `succeed${Domain}Invitation`
1057
+ return next({
1058
+ type: `fail${Kind}Invitation`,
1059
+ reason: "cancelled"
1054
1060
  });
1055
- return complete == null ? void 0 : complete();
1056
- },
1057
- onError: (error) => {
1058
- log.error("[invitation errored]", {
1059
- Domain,
1060
- error
1061
+ }
1062
+ case Invitation4.State.TIMEOUT: {
1063
+ log.error("[invitation timeout]", {
1064
+ Kind
1061
1065
  }, {
1062
1066
  file: "joinMachine.ts",
1063
- line: 109,
1067
+ line: 119,
1064
1068
  scope: void 0,
1065
1069
  callSite: (f, a) => f(...a)
1066
1070
  });
1067
- next({
1068
- type: `fail${Domain}Invitation`,
1069
- reason: "error"
1071
+ return next({
1072
+ type: `fail${Kind}Invitation`,
1073
+ reason: "timeout"
1070
1074
  });
1071
- return onError == null ? void 0 : onError(error);
1072
1075
  }
1076
+ }
1077
+ }, (error) => {
1078
+ log.error("[invitation errored]", {
1079
+ Kind,
1080
+ error
1081
+ }, {
1082
+ file: "joinMachine.ts",
1083
+ line: 125,
1084
+ scope: void 0,
1085
+ callSite: (f, a) => f(...a)
1073
1086
  });
1074
- return {
1075
- unsubscribe
1076
- };
1077
- }
1087
+ next({
1088
+ type: `fail${Kind}Invitation`,
1089
+ reason: "error"
1090
+ });
1091
+ return onError == null ? void 0 : onError(error);
1092
+ })
1078
1093
  };
1079
1094
  };
1080
- var acceptingInvitationTemplate = (Domain, successTarget) => {
1095
+ var acceptingInvitationTemplate = (Kind, successTarget) => {
1081
1096
  const config = {
1082
- initial: `unknown${Domain}`,
1097
+ initial: `unknown${Kind}`,
1083
1098
  states: {
1084
- [`unknown${Domain}`]: {
1099
+ [`unknown${Kind}`]: {
1085
1100
  always: [
1086
1101
  {
1087
- cond: ({ mode }) => mode === "halo-only" && Domain === "Space",
1102
+ cond: ({ mode }) => mode === "halo-only" && Kind === "Space",
1088
1103
  target: "#join.finishingJoiningHalo"
1089
1104
  },
1090
1105
  {
1091
- // cond: `no${Domain}Invitation`,
1092
- target: `inputting${Domain}InvitationCode`,
1106
+ // cond: `no${Kind}Invitation`,
1107
+ target: `inputting${Kind}InvitationCode`,
1093
1108
  actions: "log"
1094
1109
  }
1095
1110
  ]
1096
1111
  },
1097
- [`inputting${Domain}InvitationCode`]: {},
1098
- [`acceptingRedeemed${Domain}Invitation`]: {
1112
+ [`inputting${Kind}InvitationCode`]: {},
1113
+ [`acceptingRedeemed${Kind}Invitation`]: {
1099
1114
  invoke: {
1100
- src: (context) => context[Domain.toLowerCase()].invitationSubscribable
1115
+ src: (context) => context[Kind.toLowerCase()].invitationSubscribable
1101
1116
  },
1102
- initial: `unknown${Domain}Invitation`,
1117
+ initial: `unknown${Kind}Invitation`,
1103
1118
  states: {
1104
- [`unknown${Domain}Invitation`]: {
1119
+ [`unknown${Kind}Invitation`]: {
1105
1120
  always: [
1106
1121
  {
1107
1122
  cond: (context) => {
1108
- const invitation = context[Domain.toLowerCase()].invitation;
1123
+ const invitation = context[Kind.toLowerCase()].invitation;
1109
1124
  return !invitation || (invitation == null ? void 0 : invitation.state) === Invitation4.State.CONNECTING;
1110
1125
  },
1111
- target: `connecting${Domain}Invitation`,
1126
+ target: `connecting${Kind}Invitation`,
1112
1127
  actions: "log"
1113
1128
  },
1114
1129
  {
1115
- target: `inputting${Domain}VerificationCode`,
1130
+ target: `inputting${Kind}VerificationCode`,
1116
1131
  actions: "log"
1117
1132
  }
1118
1133
  ]
1119
1134
  },
1120
- [`connecting${Domain}Invitation`]: {},
1121
- [`inputting${Domain}VerificationCode`]: {
1122
- on: {
1123
- [`authenticate${Domain}VerificationCode`]: {
1124
- target: `authenticating${Domain}VerificationCode`,
1125
- actions: "log"
1126
- }
1127
- }
1128
- },
1129
- [`authenticating${Domain}VerificationCode`]: {
1135
+ [`connecting${Kind}Invitation`]: {},
1136
+ [`inputting${Kind}VerificationCode`]: {},
1137
+ [`authenticating${Kind}VerificationCode`]: {
1130
1138
  on: {
1131
- [`authenticate${Domain}Invitation`]: {
1132
- target: `authenticationFailing${Domain}VerificationCode`,
1133
- actions: "log"
1139
+ [`readyForAuthentication${Kind}Invitation`]: {
1140
+ target: `authenticationFailing${Kind}VerificationCode`,
1141
+ actions: [
1142
+ "setInvitation",
1143
+ "log"
1144
+ ]
1134
1145
  }
1135
1146
  }
1136
1147
  },
1137
- [`authenticationFailing${Domain}VerificationCode`]: {},
1138
- [`failing${Domain}Invitation`]: {},
1139
- [`success${Domain}Invitation`]: {}
1148
+ [`authenticationFailing${Kind}VerificationCode`]: {},
1149
+ [`failing${Kind}Invitation`]: {},
1150
+ [`success${Kind}Invitation`]: {}
1140
1151
  },
1141
1152
  on: {
1142
- [`reset${Domain}Invitation`]: {
1143
- target: `#join${Domain === "Halo" ? ".choosingIdentity" : ""}.accepting${Domain}Invitation.unknown${Domain}`,
1153
+ [`reset${Kind}Invitation`]: {
1154
+ target: `#join${Kind === "Halo" ? ".choosingIdentity" : ""}.accepting${Kind}Invitation.unknown${Kind}`,
1144
1155
  actions: [
1145
1156
  "resetInvitation",
1146
1157
  "log"
1147
1158
  ]
1148
1159
  },
1149
- [`connect${Domain}Invitation`]: {
1150
- target: `.connecting${Domain}Invitation`,
1160
+ [`connecting${Kind}Invitation`]: {
1161
+ target: `.connecting${Kind}Invitation`,
1151
1162
  actions: [
1152
1163
  "setInvitation",
1153
1164
  "log"
1154
1165
  ]
1155
1166
  },
1156
- [`connectionSuccess${Domain}Invitation`]: {
1157
- target: `.inputting${Domain}VerificationCode`,
1167
+ [`connected${Kind}Invitation`]: {
1168
+ target: `.connecting${Kind}Invitation`,
1158
1169
  actions: [
1159
1170
  "setInvitation",
1160
1171
  "log"
1161
1172
  ]
1162
1173
  },
1163
- [`succeed${Domain}Invitation`]: {
1174
+ [`readyForAuthentication${Kind}Invitation`]: {
1175
+ target: `.inputting${Kind}VerificationCode`,
1176
+ actions: [
1177
+ "setInvitation",
1178
+ "log"
1179
+ ]
1180
+ },
1181
+ [`authenticating${Kind}Invitation`]: {
1182
+ target: `.authenticating${Kind}VerificationCode`,
1183
+ actions: [
1184
+ "setInvitation",
1185
+ "log"
1186
+ ]
1187
+ },
1188
+ [`success${Kind}Invitation`]: {
1164
1189
  target: successTarget,
1165
- actions: "log"
1190
+ actions: [
1191
+ "setInvitation",
1192
+ "log"
1193
+ ]
1166
1194
  },
1167
- [`fail${Domain}Invitation`]: {
1168
- target: `.failing${Domain}Invitation`,
1195
+ [`fail${Kind}Invitation`]: {
1196
+ target: `.failing${Kind}Invitation`,
1169
1197
  actions: [
1170
1198
  assign({
1171
- [Domain.toLowerCase()]: (context, event) => ({
1172
- ...context[Domain.toLowerCase()],
1199
+ [Kind.toLowerCase()]: (context, event) => ({
1200
+ ...context[Kind.toLowerCase()],
1173
1201
  failReason: event.reason
1174
1202
  })
1175
1203
  }),
@@ -1180,16 +1208,16 @@ var acceptingInvitationTemplate = (Domain, successTarget) => {
1180
1208
  }
1181
1209
  },
1182
1210
  on: {
1183
- [`set${Domain}InvitationCode`]: {
1184
- target: `.acceptingRedeemed${Domain}Invitation`,
1211
+ [`set${Kind}InvitationCode`]: {
1212
+ target: `.acceptingRedeemed${Kind}Invitation`,
1185
1213
  actions: [
1186
1214
  assign({
1187
- [Domain.toLowerCase()]: (context, event) => ({
1188
- ...context[Domain.toLowerCase()],
1215
+ [Kind.toLowerCase()]: (context, event) => ({
1216
+ ...context[Kind.toLowerCase()],
1189
1217
  unredeemedCode: event.code
1190
1218
  })
1191
1219
  }),
1192
- `redeem${Domain}InvitationCode`,
1220
+ `redeem${Kind}InvitationCode`,
1193
1221
  "log"
1194
1222
  ]
1195
1223
  }
@@ -1312,7 +1340,7 @@ var joinMachine = createMachine({
1312
1340
  spaceInvitation: context.space.invitation
1313
1341
  }, {
1314
1342
  file: "joinMachine.ts",
1315
- line: 341,
1343
+ line: 351,
1316
1344
  scope: void 0,
1317
1345
  callSite: (f, a) => f(...a)
1318
1346
  });
@@ -1327,7 +1355,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
1327
1355
  } catch (err) {
1328
1356
  log.catch(err, {}, {
1329
1357
  file: "joinMachine.ts",
1330
- line: 367,
1358
+ line: 377,
1331
1359
  scope: void 0,
1332
1360
  callSite: (f, a) => f(...a)
1333
1361
  });
@@ -1682,17 +1710,16 @@ function _extends19() {
1682
1710
  };
1683
1711
  return _extends19.apply(this, arguments);
1684
1712
  }
1685
- var PureInvitationAcceptedContent = ({ onDone, result, Domain, doneActionParent, active }) => {
1713
+ var PureInvitationAcceptedContent = ({ onDone, result, Kind, doneActionParent, active }) => {
1686
1714
  const disabled = !active;
1687
1715
  const { t } = useTranslation13("os");
1688
- const doneButton = /* @__PURE__ */ React25.createElement(Button8, _extends19({}, onDone && {
1689
- onClick: () => onDone(result)
1690
- }, {
1716
+ const doneButton = /* @__PURE__ */ React25.createElement(Button8, {
1717
+ onClick: () => onDone == null ? void 0 : onDone(result),
1691
1718
  disabled,
1692
1719
  className: "flex items-center gap-2 pli-2",
1693
- "data-autofocus": `success${Domain}Invitation finishingJoining${Domain}`,
1694
- "data-testid": `${Domain.toLowerCase()}-invitation-accepted-done`
1695
- }), /* @__PURE__ */ React25.createElement(CaretLeft3, {
1720
+ "data-autofocus": `success${Kind}Invitation finishingJoining${Kind}`,
1721
+ "data-testid": `${Kind.toLowerCase()}-invitation-accepted-done`
1722
+ }, /* @__PURE__ */ React25.createElement(CaretLeft3, {
1696
1723
  weight: "bold",
1697
1724
  className: mx18(getSize11(2), "invisible")
1698
1725
  }), /* @__PURE__ */ React25.createElement("span", {
@@ -1715,8 +1742,8 @@ var InvitationAcceptedContent = (props) => {
1715
1742
  };
1716
1743
  var InvitationAccepted = (props) => {
1717
1744
  var _a;
1718
- const { Domain, doneActionParent: _doneActionParent, onDone: _onDone, ...viewStateProps } = props;
1719
- const activeInvitation = (_a = viewStateProps.joinState) == null ? void 0 : _a.context[Domain.toLowerCase()].invitationObservable;
1745
+ const { Kind, doneActionParent: _doneActionParent, onDone: _onDone, ...viewStateProps } = props;
1746
+ const activeInvitation = (_a = viewStateProps.joinState) == null ? void 0 : _a.context[Kind.toLowerCase()].invitationObservable;
1720
1747
  return /* @__PURE__ */ React25.createElement(ViewState, _extends19({}, viewStateProps), !activeInvitation ? /* @__PURE__ */ React25.createElement(PureInvitationAcceptedContent, _extends19({}, props, {
1721
1748
  result: null
1722
1749
  })) : /* @__PURE__ */ React25.createElement(InvitationAcceptedContent, _extends19({}, props, {
@@ -1742,11 +1769,11 @@ function _extends20() {
1742
1769
  };
1743
1770
  return _extends20.apply(this, arguments);
1744
1771
  }
1745
- var InvitationInput = ({ Domain, ...viewStateProps }) => {
1772
+ var InvitationInput = ({ Kind, ...viewStateProps }) => {
1746
1773
  const disabled = !viewStateProps.active;
1747
1774
  const { joinSend, joinState } = viewStateProps;
1748
1775
  const { t } = useTranslation14("os");
1749
- const contextUnredeemedCode = joinState == null ? void 0 : joinState.context[Domain.toLowerCase()].unredeemedCode;
1776
+ const contextUnredeemedCode = joinState == null ? void 0 : joinState.context[Kind.toLowerCase()].unredeemedCode;
1750
1777
  const [inputValue, setInputValue] = useState4(contextUnredeemedCode != null ? contextUnredeemedCode : "");
1751
1778
  useEffect(() => {
1752
1779
  contextUnredeemedCode && setInputValue(contextUnredeemedCode != null ? contextUnredeemedCode : "");
@@ -1754,7 +1781,7 @@ var InvitationInput = ({ Domain, ...viewStateProps }) => {
1754
1781
  contextUnredeemedCode
1755
1782
  ]);
1756
1783
  const handleNext = () => joinSend({
1757
- type: `set${Domain}InvitationCode`,
1784
+ type: `set${Kind}InvitationCode`,
1758
1785
  code: inputValue
1759
1786
  });
1760
1787
  return /* @__PURE__ */ React26.createElement(ViewState, _extends20({}, viewStateProps), /* @__PURE__ */ React26.createElement(Input2, {
@@ -1767,8 +1794,8 @@ var InvitationInput = ({ Domain, ...viewStateProps }) => {
1767
1794
  className: "m-0"
1768
1795
  },
1769
1796
  input: {
1770
- "data-autofocus": `inputting${Domain}InvitationCode`,
1771
- "data-testid": `${Domain.toLowerCase()}-invitation-input`,
1797
+ "data-autofocus": `inputting${Kind}InvitationCode`,
1798
+ "data-testid": `${Kind.toLowerCase()}-invitation-input`,
1772
1799
  onKeyUp: ({ key }) => key === "Enter" && handleNext()
1773
1800
  }
1774
1801
  }
@@ -1781,7 +1808,7 @@ var InvitationInput = ({ Domain, ...viewStateProps }) => {
1781
1808
  disabled,
1782
1809
  className: "grow flex items-center gap-2 pli-2 order-2",
1783
1810
  onClick: handleNext,
1784
- "data-testid": `${Domain.toLowerCase()}-invitation-input-continue`
1811
+ "data-testid": `${Kind.toLowerCase()}-invitation-input-continue`
1785
1812
  }, /* @__PURE__ */ React26.createElement(CaretLeft4, {
1786
1813
  weight: "bold",
1787
1814
  className: mx19(getSize12(2), "invisible")
@@ -1791,12 +1818,12 @@ var InvitationInput = ({ Domain, ...viewStateProps }) => {
1791
1818
  weight: "bold",
1792
1819
  className: getSize12(4)
1793
1820
  })), /* @__PURE__ */ React26.createElement(Button9, {
1794
- disabled: Domain === "Space",
1821
+ disabled: disabled || Kind === "Space",
1795
1822
  onClick: () => joinSend({
1796
1823
  type: "deselectAuthMethod"
1797
1824
  }),
1798
1825
  className: "flex items-center gap-2 pis-2 pie-4",
1799
- "data-testid": `${Domain.toLowerCase()}-invitation-input-back`
1826
+ "data-testid": `${Kind.toLowerCase()}-invitation-input-back`
1800
1827
  }, /* @__PURE__ */ React26.createElement(CaretLeft4, {
1801
1828
  weight: "bold",
1802
1829
  className: getSize12(4)
@@ -1822,9 +1849,9 @@ function _extends21() {
1822
1849
  };
1823
1850
  return _extends21.apply(this, arguments);
1824
1851
  }
1825
- var InvitationActions = ({ invitationState, disabled, joinSend, joinState, Domain }) => {
1852
+ var InvitationActions = ({ invitationState, disabled, joinSend, joinState, Kind }) => {
1826
1853
  const { t } = useTranslation15("os");
1827
- const invitationType = Domain.toLowerCase();
1854
+ const invitationType = Kind.toLowerCase();
1828
1855
  switch (invitationState) {
1829
1856
  case Invitation6.State.CONNECTING:
1830
1857
  return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(ViewStateHeading, {
@@ -1871,7 +1898,7 @@ var InvitationActions = ({ invitationState, disabled, joinSend, joinState, Domai
1871
1898
  disabled,
1872
1899
  className: "flex items-center gap-2 pli-2",
1873
1900
  onClick: () => joinSend({
1874
- type: `reset${Domain}Invitation`
1901
+ type: `reset${Kind}Invitation`
1875
1902
  }),
1876
1903
  "data-testid": "invitation-rescuer-reset"
1877
1904
  }, /* @__PURE__ */ React27.createElement(CaretLeft5, {
@@ -1884,11 +1911,11 @@ var InvitationActions = ({ invitationState, disabled, joinSend, joinState, Domai
1884
1911
  })));
1885
1912
  }
1886
1913
  };
1887
- var InvitationRescuer = ({ Domain, ...viewStateProps }) => {
1914
+ var InvitationRescuer = ({ Kind, ...viewStateProps }) => {
1888
1915
  var _a;
1889
1916
  const disabled = !viewStateProps.active;
1890
1917
  const { joinSend, joinState } = viewStateProps;
1891
- const invitationState = (_a = joinState == null ? void 0 : joinState.context[Domain.toLowerCase()].invitation) == null ? void 0 : _a.state;
1918
+ const invitationState = (_a = joinState == null ? void 0 : joinState.context[Kind.toLowerCase()].invitation) == null ? void 0 : _a.state;
1892
1919
  const { t } = useTranslation15("os");
1893
1920
  return /* @__PURE__ */ React27.createElement(ViewState, _extends21({}, viewStateProps), typeof invitationState === "undefined" ? /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement("div", {
1894
1921
  role: "none",
@@ -1896,10 +1923,10 @@ var InvitationRescuer = ({ Domain, ...viewStateProps }) => {
1896
1923
  }), /* @__PURE__ */ React27.createElement(Button10, {
1897
1924
  disabled,
1898
1925
  className: "flex items-center gap-2 pli-2",
1899
- "data-autofocus": `inputting${Domain}InvitationCode`,
1926
+ "data-autofocus": `inputting${Kind}InvitationCode`,
1900
1927
  "data-testid": "invitation-rescuer-blank-reset",
1901
1928
  onClick: () => joinSend({
1902
- type: `reset${Domain}Invitation`
1929
+ type: `reset${Kind}Invitation`
1903
1930
  })
1904
1931
  }, /* @__PURE__ */ React27.createElement(CaretLeft5, {
1905
1932
  weight: "bold",
@@ -1913,7 +1940,7 @@ var InvitationRescuer = ({ Domain, ...viewStateProps }) => {
1913
1940
  disabled,
1914
1941
  joinSend,
1915
1942
  joinState,
1916
- Domain
1943
+ Kind
1917
1944
  })));
1918
1945
  };
1919
1946
 
@@ -1937,9 +1964,9 @@ function _extends22() {
1937
1964
  return _extends22.apply(this, arguments);
1938
1965
  }
1939
1966
  var pinLength = 6;
1940
- var PureInvitationAuthenticatorContent = ({ disabled, failed, joinSend, joinState, Domain, onChange, onAuthenticate }) => {
1967
+ var PureInvitationAuthenticatorContent = ({ disabled, failed, joinSend, joinState, Kind, onChange, onAuthenticate }) => {
1941
1968
  const { t } = useTranslation16("os");
1942
- const invitationType = Domain.toLowerCase();
1969
+ const invitationType = Kind.toLowerCase();
1943
1970
  return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(Input3, _extends22({
1944
1971
  label: /* @__PURE__ */ React28.createElement(ViewStateHeading, null, t("auth code input label")),
1945
1972
  size: "pin",
@@ -1958,7 +1985,7 @@ var PureInvitationAuthenticatorContent = ({ disabled, failed, joinSend, joinStat
1958
1985
  inputMode: "numeric",
1959
1986
  autoComplete: "off",
1960
1987
  pattern: "\\d*",
1961
- "data-autofocus": `connecting${Domain}Invitation inputting${Domain}VerificationCode authenticationFailing${Domain}VerificationCode authenticating${Domain}VerificationCode`,
1988
+ "data-autofocus": `connecting${Kind}Invitation inputting${Kind}VerificationCode authenticationFailing${Kind}VerificationCode authenticating${Kind}VerificationCode`,
1962
1989
  "data-prevent-ios-autofocus": true,
1963
1990
  "data-testid": `${invitationType}-auth-code-input`,
1964
1991
  "data-1p-ignore": true
@@ -1999,13 +2026,13 @@ var PureInvitationAuthenticatorContent = ({ disabled, failed, joinSend, joinStat
1999
2026
  className: getSize14(4)
2000
2027
  }), /* @__PURE__ */ React28.createElement("span", null, t("cancel label")))));
2001
2028
  };
2002
- var InvitationAuthenticatorContent = ({ joinSend, joinState, disabled, invitation, Domain, failed }) => {
2003
- const invitationType = Domain.toLowerCase();
2029
+ var InvitationAuthenticatorContent = ({ joinSend, joinState, disabled, invitation, Kind, failed }) => {
2030
+ const invitationType = Kind.toLowerCase();
2004
2031
  const [pinValue, setPinValue] = useState5("");
2005
2032
  const { authenticate } = useInvitationStatus4(invitation);
2006
2033
  const onAuthenticate = useCallback6(() => {
2007
2034
  joinSend({
2008
- type: `authenticate${Domain}VerificationCode`
2035
+ type: `authenticate${Kind}VerificationCode`
2009
2036
  });
2010
2037
  void authenticate(pinValue);
2011
2038
  }, [
@@ -2028,24 +2055,24 @@ var InvitationAuthenticatorContent = ({ joinSend, joinState, disabled, invitatio
2028
2055
  failed,
2029
2056
  joinSend,
2030
2057
  joinState,
2031
- Domain,
2058
+ Kind,
2032
2059
  onChange,
2033
2060
  onAuthenticate
2034
2061
  }));
2035
2062
  };
2036
- var InvitationAuthenticator = ({ failed, Domain, ...viewStateProps }) => {
2063
+ var InvitationAuthenticator = ({ failed, Kind, ...viewStateProps }) => {
2037
2064
  const { joinSend, joinState } = viewStateProps;
2038
2065
  const disabled = !viewStateProps.active || [
2039
2066
  "connecting",
2040
2067
  "authenticating"
2041
2068
  ].some((str) => joinState == null ? void 0 : joinState.configuration[0].id.includes(str));
2042
- const activeInvitation = joinState == null ? void 0 : joinState.context[Domain.toLowerCase()].invitationObservable;
2069
+ const activeInvitation = joinState == null ? void 0 : joinState.context[Kind.toLowerCase()].invitationObservable;
2043
2070
  return /* @__PURE__ */ React28.createElement(ViewState, _extends22({}, viewStateProps), !activeInvitation ? /* @__PURE__ */ React28.createElement(PureInvitationAuthenticatorContent, _extends22({}, {
2044
2071
  disabled,
2045
2072
  failed,
2046
2073
  joinSend,
2047
2074
  joinState,
2048
- Domain,
2075
+ Kind,
2049
2076
  onChange: () => {
2050
2077
  },
2051
2078
  onAuthenticate: () => {
@@ -2056,7 +2083,7 @@ var InvitationAuthenticator = ({ failed, Domain, ...viewStateProps }) => {
2056
2083
  invitation: activeInvitation,
2057
2084
  joinSend,
2058
2085
  joinState,
2059
- Domain
2086
+ Kind
2060
2087
  })));
2061
2088
  };
2062
2089
 
@@ -2160,7 +2187,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2160
2187
  acceptingHaloInvitation: "inputtingHaloInvitationCode"
2161
2188
  }
2162
2189
  }),
2163
- Domain: "Halo"
2190
+ Kind: "Halo"
2164
2191
  })), /* @__PURE__ */ React29.createElement(InvitationRescuer, _extends23({}, {
2165
2192
  joinState,
2166
2193
  joinSend,
@@ -2180,7 +2207,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2180
2207
  }
2181
2208
  }
2182
2209
  ].some(joinState.matches),
2183
- Domain: "Halo"
2210
+ Kind: "Halo"
2184
2211
  })), /* @__PURE__ */ React29.createElement(InvitationAuthenticator, _extends23({}, {
2185
2212
  joinState,
2186
2213
  joinSend,
@@ -2207,7 +2234,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2207
2234
  }
2208
2235
  }
2209
2236
  ].some(joinState.matches),
2210
- Domain: "Halo",
2237
+ Kind: "Halo",
2211
2238
  ...joinState.matches({
2212
2239
  acceptingHaloInvitation: {
2213
2240
  acceptingRedeemedHaloInvitation: "authenticationFailingHaloVerificationCode"
@@ -2228,7 +2255,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2228
2255
  },
2229
2256
  "finishingJoiningHalo"
2230
2257
  ].some(joinState.matches),
2231
- Domain: "Halo",
2258
+ Kind: "Halo",
2232
2259
  doneActionParent,
2233
2260
  onDone
2234
2261
  })), /* @__PURE__ */ React29.createElement(IdentityAdded, _extends23({}, {
@@ -2246,7 +2273,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2246
2273
  active: joinState.matches({
2247
2274
  acceptingSpaceInvitation: "inputtingSpaceInvitationCode"
2248
2275
  }),
2249
- Domain: "Space"
2276
+ Kind: "Space"
2250
2277
  })), /* @__PURE__ */ React29.createElement(InvitationRescuer, _extends23({}, {
2251
2278
  joinState,
2252
2279
  joinSend,
@@ -2262,7 +2289,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2262
2289
  }
2263
2290
  }
2264
2291
  ].some(joinState.matches),
2265
- Domain: "Space"
2292
+ Kind: "Space"
2266
2293
  })), /* @__PURE__ */ React29.createElement(InvitationAuthenticator, _extends23({}, {
2267
2294
  joinState,
2268
2295
  joinSend,
@@ -2283,7 +2310,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2283
2310
  }
2284
2311
  }
2285
2312
  ].some(joinState.matches),
2286
- Domain: "Space",
2313
+ Kind: "Space",
2287
2314
  ...joinState.matches({
2288
2315
  acceptingSpaceInvitation: {
2289
2316
  acceptingRedeemedSpaceInvitation: "authenticationFailingSpaceVerificationCode"
@@ -2295,7 +2322,7 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2295
2322
  joinState,
2296
2323
  joinSend,
2297
2324
  active: joinState.matches("finishingJoiningSpace"),
2298
- Domain: "Space",
2325
+ Kind: "Space",
2299
2326
  doneActionParent,
2300
2327
  onDone
2301
2328
  })))));
@@ -2303,7 +2330,8 @@ var JoinPanel = ({ mode = "default", initialInvitationCode, exitActionParent, on
2303
2330
 
2304
2331
  // packages/apps/patterns/react-ui/src/panels/SpacePanel/SpacePanel.tsx
2305
2332
  import { UserPlus as UserPlus2 } from "@phosphor-icons/react";
2306
- import React30, { useReducer as useReducer2 } from "react";
2333
+ import React30, { useCallback as useCallback7, useReducer as useReducer2 } from "react";
2334
+ import { InvitationEncoder as InvitationEncoder2 } from "@dxos/client";
2307
2335
  import { useSpaceInvitations as useSpaceInvitations2, observer } from "@dxos/react-client";
2308
2336
  import { Button as Button12, DensityProvider as DensityProvider5, getSize as getSize15, mx as mx22, useTranslation as useTranslation17 } from "@dxos/react-components";
2309
2337
  function _extends24() {
@@ -2324,9 +2352,21 @@ var CurrentSpaceView = observer(({ space, createInvitationUrl, titleId }) => {
2324
2352
  const { t } = useTranslation17("os");
2325
2353
  const invitations = useSpaceInvitations2(space == null ? void 0 : space.key);
2326
2354
  const name = space == null ? void 0 : space.properties.name;
2355
+ console.log("[space panel]", "development");
2327
2356
  if (!space) {
2328
2357
  return null;
2329
2358
  }
2359
+ const onInvitationEvent = useCallback7((invitation) => {
2360
+ const invitationCode = InvitationEncoder2.encode(invitation);
2361
+ console.log(JSON.stringify({
2362
+ invitationCode
2363
+ }));
2364
+ if (invitation.authCode) {
2365
+ console.log(JSON.stringify({
2366
+ authCode: invitation.authCode
2367
+ }));
2368
+ }
2369
+ }, []);
2330
2370
  return /* @__PURE__ */ React30.createElement("div", {
2331
2371
  role: "none",
2332
2372
  className: "flex flex-col"
@@ -2341,11 +2381,16 @@ var CurrentSpaceView = observer(({ space, createInvitationUrl, titleId }) => {
2341
2381
  className: mx22(defaultSurface, "rounded-be-md p-2")
2342
2382
  }, /* @__PURE__ */ React30.createElement(InvitationList, {
2343
2383
  invitations,
2344
- onClickRemove: ({ invitation }) => invitation && (space == null ? void 0 : space.removeInvitation(invitation.invitationId)),
2384
+ onClickRemove: (invitation) => invitation.get() && (space == null ? void 0 : space.removeInvitation(invitation.get().invitationId)),
2345
2385
  createInvitationUrl
2346
2386
  }), /* @__PURE__ */ React30.createElement(Button12, {
2347
2387
  className: "is-full flex gap-2 mbs-2",
2348
- onClick: () => space == null ? void 0 : space.createInvitation(),
2388
+ onClick: () => {
2389
+ const invitation = space == null ? void 0 : space.createInvitation();
2390
+ if (true) {
2391
+ invitation.subscribe(onInvitationEvent);
2392
+ }
2393
+ },
2349
2394
  "data-testid": "spaces-panel.create-invitation"
2350
2395
  }, /* @__PURE__ */ React30.createElement("span", null, t("create space invitation label")), /* @__PURE__ */ React30.createElement(UserPlus2, {
2351
2396
  className: getSize15(4),
@@ -2593,12 +2638,12 @@ var Shell = ({ runtime, origin }) => {
2593
2638
  return /* @__PURE__ */ React35.createElement(JoinDialog, {
2594
2639
  mode: "halo-only",
2595
2640
  initialInvitationCode: invitationCode,
2596
- onDone: async () => {
2597
- spaces.length > 0 || await client.createSpace();
2598
- await runtime.setAppContext({
2641
+ onDone: () => {
2642
+ void runtime.setAppContext({
2599
2643
  display: ShellDisplay.NONE
2600
2644
  });
2601
2645
  runtime.setLayout(ShellLayout.DEFAULT);
2646
+ spaces.length > 0 || client.createSpace();
2602
2647
  }
2603
2648
  });
2604
2649
  case ShellLayout.DEVICE_INVITATIONS:
@@ -2646,7 +2691,7 @@ var Shell = ({ runtime, origin }) => {
2646
2691
  };
2647
2692
 
2648
2693
  // packages/apps/patterns/react-ui/src/composites/Shell/ShellContext.tsx
2649
- import React36, { createContext as createContext3, useCallback as useCallback7, useContext as useContext3, useEffect as useEffect4, useMemo as useMemo3, useState as useState7 } from "react";
2694
+ import React36, { createContext as createContext3, useCallback as useCallback8, useContext as useContext3, useEffect as useEffect4, useMemo as useMemo3, useState as useState7 } from "react";
2650
2695
  import { IFrameClientServicesProxy, ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout2 } from "@dxos/client";
2651
2696
  import { MemoryShellRuntime } from "@dxos/client-services";
2652
2697
  import { useClient as useClient7, useIdentity as useIdentity3 } from "@dxos/react-client";
@@ -2689,7 +2734,7 @@ var ShellProvider = ({ space, haloInvitationCode, spaceInvitationCode, onJoinedS
2689
2734
  const identity = useIdentity3();
2690
2735
  const [display, setDisplay] = useState7(!identity || spaceInvitationCode || haloInvitationCode ? ShellDisplay2.FULLSCREEN : ShellDisplay2.NONE);
2691
2736
  const shellRuntime = useMemo3(() => {
2692
- if (client.config.get("runtime.app.env.DX_VAULT") === "true") {
2737
+ if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
2693
2738
  return;
2694
2739
  }
2695
2740
  if (spaceInvitationCode) {
@@ -2698,9 +2743,14 @@ var ShellProvider = ({ space, haloInvitationCode, spaceInvitationCode, onJoinedS
2698
2743
  invitationCode: spaceInvitationCode
2699
2744
  });
2700
2745
  }
2746
+ if (haloInvitationCode) {
2747
+ return new MemoryShellRuntime({
2748
+ layout: ShellLayout2.INITIALIZE_IDENTITY,
2749
+ invitationCode: haloInvitationCode
2750
+ });
2751
+ }
2701
2752
  return new MemoryShellRuntime({
2702
- layout: identity ? ShellLayout2.DEFAULT : ShellLayout2.INITIALIZE_IDENTITY,
2703
- invitationCode: haloInvitationCode != null ? haloInvitationCode : void 0
2753
+ layout: identity ? ShellLayout2.DEFAULT : ShellLayout2.INITIALIZE_IDENTITY
2704
2754
  });
2705
2755
  }, [
2706
2756
  client,
@@ -2708,7 +2758,7 @@ var ShellProvider = ({ space, haloInvitationCode, spaceInvitationCode, onJoinedS
2708
2758
  spaceInvitationCode,
2709
2759
  haloInvitationCode
2710
2760
  ]);
2711
- const handleKeyDown = useCallback7((event) => {
2761
+ const handleKeyDown = useCallback8((event) => {
2712
2762
  if (!space || !shellRuntime) {
2713
2763
  return;
2714
2764
  }
@@ -2757,7 +2807,7 @@ var ShellProvider = ({ space, haloInvitationCode, spaceInvitationCode, onJoinedS
2757
2807
  runtime: shellRuntime,
2758
2808
  setDisplay
2759
2809
  }
2760
- }, identity ? children : void 0));
2810
+ }, children));
2761
2811
  };
2762
2812
 
2763
2813
  // packages/apps/patterns/react-ui/src/translations/locales/en-US.ts