@dxos/react-ui 0.1.25-next.3c6b542 → 0.1.26

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 (132) hide show
  1. package/dist/lib/browser/index.mjs +452 -1092
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts +1 -2
  5. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -1
  6. package/dist/types/src/components/IdentityList/IdentityListItem.stories.d.ts +1 -2
  7. package/dist/types/src/components/IdentityList/IdentityListItem.stories.d.ts.map +1 -1
  8. package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts +2 -3
  9. package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts.map +1 -1
  10. package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts +1 -3
  11. package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts.map +1 -1
  12. package/dist/types/src/components/IdentityList/index.d.ts +0 -1
  13. package/dist/types/src/components/IdentityList/index.d.ts.map +1 -1
  14. package/dist/types/src/components/InvitationList/InvitationList.d.ts.map +1 -1
  15. package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
  16. package/dist/types/src/components/InvitationList/InvitationStatusAvatar.d.ts +1 -6
  17. package/dist/types/src/components/InvitationList/InvitationStatusAvatar.d.ts.map +1 -1
  18. package/dist/types/src/components/InvitationList/InvitationStatusAvatar.stories.d.ts +1 -1
  19. package/dist/types/src/components/index.d.ts +0 -1
  20. package/dist/types/src/components/index.d.ts.map +1 -1
  21. package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts +1 -1
  22. package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -1
  23. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts +2 -2
  24. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
  25. package/dist/types/src/composites/index.d.ts +0 -2
  26. package/dist/types/src/composites/index.d.ts.map +1 -1
  27. package/dist/types/src/layouts/PanelAlertDialog/PanelAlertDialog.d.ts.map +1 -1
  28. package/dist/types/src/layouts/index.d.ts +0 -1
  29. package/dist/types/src/layouts/index.d.ts.map +1 -1
  30. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +0 -3
  31. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -1
  32. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
  33. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
  34. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +3 -4
  35. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
  36. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts +1 -1
  37. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts.map +1 -1
  38. package/dist/types/src/panels/JoinPanel/view-states/IdentityAdded.d.ts +2 -10
  39. package/dist/types/src/panels/JoinPanel/view-states/IdentityAdded.d.ts.map +1 -1
  40. package/dist/types/src/panels/JoinPanel/view-states/IdentityInput.d.ts.map +1 -1
  41. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts +1 -1
  42. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts.map +1 -1
  43. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts.map +1 -1
  44. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts.map +1 -1
  45. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts.map +1 -1
  46. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts.map +1 -1
  47. package/dist/types/src/panels/index.d.ts +0 -2
  48. package/dist/types/src/panels/index.d.ts.map +1 -1
  49. package/dist/types/src/styles/index.d.ts +0 -1
  50. package/dist/types/src/styles/index.d.ts.map +1 -1
  51. package/dist/types/src/translations/locales/en-US.d.ts +1 -12
  52. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  53. package/package.json +11 -12
  54. package/src/components/IdentityList/IdentityListItem.tsx +3 -15
  55. package/src/components/IdentityList/SpaceMemberList.tsx +8 -10
  56. package/src/components/IdentityList/SpaceMemberListContainer.tsx +4 -5
  57. package/src/components/IdentityList/index.ts +0 -1
  58. package/src/components/InvitationList/InvitationList.tsx +2 -6
  59. package/src/components/InvitationList/InvitationListItem.tsx +25 -36
  60. package/src/components/InvitationList/InvitationStatusAvatar.tsx +5 -10
  61. package/src/components/index.ts +0 -1
  62. package/src/composites/JoinDialog/JoinDialog.stories.tsx +58 -59
  63. package/src/composites/JoinDialog/JoinDialog.tsx +1 -3
  64. package/src/composites/index.ts +0 -3
  65. package/src/layouts/PanelAlertDialog/PanelAlertDialog.tsx +8 -4
  66. package/src/layouts/PanelSidebar/PanelSidebar.tsx +1 -1
  67. package/src/layouts/index.ts +0 -1
  68. package/src/panels/JoinPanel/JoinHeading.tsx +16 -44
  69. package/src/panels/JoinPanel/JoinPanel.tsx +11 -32
  70. package/src/panels/JoinPanel/JoinPanelProps.ts +8 -4
  71. package/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx +1 -5
  72. package/src/panels/JoinPanel/view-states/IdentityAdded.tsx +24 -63
  73. package/src/panels/JoinPanel/view-states/IdentityInput.tsx +1 -8
  74. package/src/panels/JoinPanel/view-states/IdentitySelector.tsx +1 -4
  75. package/src/panels/JoinPanel/view-states/InvitationAccepted.tsx +0 -1
  76. package/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx +1 -4
  77. package/src/panels/JoinPanel/view-states/InvitationInput.tsx +1 -8
  78. package/src/panels/JoinPanel/view-states/InvitationRescuer.tsx +1 -4
  79. package/src/panels/index.ts +0 -2
  80. package/src/styles/index.ts +0 -1
  81. package/src/translations/locales/en-US.ts +3 -14
  82. package/dist/types/src/components/IdentityList/DeviceList.d.ts +0 -7
  83. package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +0 -1
  84. package/dist/types/src/components/SpaceList/SpaceListItem.d.ts +0 -7
  85. package/dist/types/src/components/SpaceList/SpaceListItem.d.ts.map +0 -1
  86. package/dist/types/src/components/SpaceList/index.d.ts +0 -2
  87. package/dist/types/src/components/SpaceList/index.d.ts.map +0 -1
  88. package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts +0 -6
  89. package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts.map +0 -1
  90. package/dist/types/src/composites/DevicesDialog/index.d.ts +0 -2
  91. package/dist/types/src/composites/DevicesDialog/index.d.ts.map +0 -1
  92. package/dist/types/src/composites/Shell/Shell.d.ts +0 -6
  93. package/dist/types/src/composites/Shell/Shell.d.ts.map +0 -1
  94. package/dist/types/src/composites/Shell/index.d.ts +0 -2
  95. package/dist/types/src/composites/Shell/index.d.ts.map +0 -1
  96. package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts +0 -6
  97. package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +0 -1
  98. package/dist/types/src/composites/SpaceDialog/index.d.ts +0 -2
  99. package/dist/types/src/composites/SpaceDialog/index.d.ts.map +0 -1
  100. package/dist/types/src/layouts/PanelDialog/PanelDialog.d.ts +0 -14
  101. package/dist/types/src/layouts/PanelDialog/PanelDialog.d.ts.map +0 -1
  102. package/dist/types/src/layouts/PanelDialog/index.d.ts +0 -2
  103. package/dist/types/src/layouts/PanelDialog/index.d.ts.map +0 -1
  104. package/dist/types/src/panels/DevicesPanel/DevicesPanel.d.ts +0 -10
  105. package/dist/types/src/panels/DevicesPanel/DevicesPanel.d.ts.map +0 -1
  106. package/dist/types/src/panels/DevicesPanel/index.d.ts +0 -2
  107. package/dist/types/src/panels/DevicesPanel/index.d.ts.map +0 -1
  108. package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts +0 -18
  109. package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +0 -1
  110. package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts +0 -9
  111. package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +0 -1
  112. package/dist/types/src/panels/SpacePanel/index.d.ts +0 -2
  113. package/dist/types/src/panels/SpacePanel/index.d.ts.map +0 -1
  114. package/dist/types/src/styles/dialogStyles.d.ts +0 -3
  115. package/dist/types/src/styles/dialogStyles.d.ts.map +0 -1
  116. package/src/components/IdentityList/DeviceList.tsx +0 -31
  117. package/src/components/SpaceList/SpaceListItem.tsx +0 -32
  118. package/src/components/SpaceList/index.ts +0 -5
  119. package/src/composites/DevicesDialog/DevicesDialog.tsx +0 -38
  120. package/src/composites/DevicesDialog/index.ts +0 -5
  121. package/src/composites/Shell/Shell.tsx +0 -92
  122. package/src/composites/Shell/index.ts +0 -5
  123. package/src/composites/SpaceDialog/SpaceDialog.tsx +0 -38
  124. package/src/composites/SpaceDialog/index.ts +0 -5
  125. package/src/layouts/PanelDialog/PanelDialog.tsx +0 -39
  126. package/src/layouts/PanelDialog/index.ts +0 -5
  127. package/src/panels/DevicesPanel/DevicesPanel.tsx +0 -98
  128. package/src/panels/DevicesPanel/index.ts +0 -5
  129. package/src/panels/SpacePanel/SpacePanel.stories.tsx +0 -53
  130. package/src/panels/SpacePanel/SpacePanel.tsx +0 -174
  131. package/src/panels/SpacePanel/index.ts +0 -5
  132. package/src/styles/dialogStyles.ts +0 -8
@@ -4,13 +4,10 @@ var __export = (target, all) => {
4
4
  __defProp(target, name, { get: all[name], enumerable: true });
5
5
  };
6
6
 
7
- // packages/apps/patterns/react-ui/src/components/IdentityList/DeviceList.tsx
8
- import React2 from "react";
9
-
10
7
  // packages/apps/patterns/react-ui/src/components/IdentityList/IdentityListItem.tsx
11
8
  import React from "react";
12
9
  import { SpaceMember } from "@dxos/client";
13
- import { Avatar, mx, useTranslation } from "@dxos/react-components";
10
+ import { Avatar, useTranslation } from "@dxos/react-components";
14
11
  function _extends() {
15
12
  _extends = Object.assign || function(target) {
16
13
  for (var i = 1; i < arguments.length; i++) {
@@ -25,13 +22,11 @@ function _extends() {
25
22
  };
26
23
  return _extends.apply(this, arguments);
27
24
  }
28
- var IdentityListItem = ({ identity, presence, onClick }) => {
25
+ var IdentityListItem = ({ identity, presence }) => {
29
26
  var _a;
30
27
  const { t } = useTranslation("os");
31
28
  return /* @__PURE__ */ React.createElement("li", {
32
- className: mx("flex gap-2 items-center", onClick && "cursor-pointer"),
33
- onClick: () => onClick == null ? void 0 : onClick(),
34
- "data-testid": "identity-list-item"
29
+ className: "flex gap-2 items-center"
35
30
  }, /* @__PURE__ */ React.createElement(Avatar, _extends({}, {
36
31
  variant: "circle",
37
32
  size: 9,
@@ -59,61 +54,38 @@ var IdentityListItem = ({ identity, presence, onClick }) => {
59
54
  })));
60
55
  };
61
56
 
62
- // packages/apps/patterns/react-ui/src/components/IdentityList/DeviceList.tsx
63
- var DeviceList = ({ devices, onSelect }) => {
57
+ // packages/apps/patterns/react-ui/src/components/IdentityList/SpaceMemberList.tsx
58
+ import React2 from "react";
59
+ var SpaceMemberList = ({ spaceMembers }) => {
64
60
  return /* @__PURE__ */ React2.createElement("ul", {
65
61
  className: "flex flex-col gap-2"
66
- }, devices.map((device) => {
67
- const identity = {
68
- identityKey: device.publicKey,
69
- displayName: device.displayName
70
- };
62
+ }, spaceMembers.filter((spaceMember) => spaceMember.profile).map((spaceMember) => {
71
63
  return /* @__PURE__ */ React2.createElement(IdentityListItem, {
72
- key: device.publicKey.toHex(),
73
- identity,
74
- onClick: onSelect && (() => onSelect(device))
75
- });
76
- }));
77
- };
78
-
79
- // packages/apps/patterns/react-ui/src/components/IdentityList/SpaceMemberList.tsx
80
- import React3 from "react";
81
- var SpaceMemberList = ({ members, onSelect }) => {
82
- return /* @__PURE__ */ React3.createElement("ul", {
83
- className: "flex flex-col gap-2"
84
- }, members.filter((member) => member.profile).map((member) => {
85
- return /* @__PURE__ */ React3.createElement(IdentityListItem, {
86
- key: member.identityKey.toHex(),
87
- identity: member.profile,
88
- presence: member.presence,
89
- onClick: onSelect && (() => onSelect(member))
64
+ key: spaceMember.identityKey.toHex(),
65
+ identity: spaceMember.profile,
66
+ presence: spaceMember.presence
90
67
  });
91
68
  }));
92
69
  };
93
70
 
94
71
  // packages/apps/patterns/react-ui/src/components/IdentityList/SpaceMemberListContainer.tsx
95
- import React4, { useMemo } from "react";
72
+ import React3, { useMemo } from "react";
96
73
  import { useClient, useMembers } from "@dxos/react-client";
97
- var SpaceMemberListContainer = ({ spaceKey, includeSelf, onSelect }) => {
74
+ var SpaceMemberListContainer = ({ spaceKey, includeSelf }) => {
98
75
  const client = useClient();
99
76
  const allUnsortedMembers = useMembers(spaceKey);
100
- const members = useMemo(() => includeSelf ? allUnsortedMembers.sort((a) => a.identityKey.equals(client.halo.profile.identityKey) ? -1 : 1) : allUnsortedMembers.filter((member) => !member.identityKey.equals(client.halo.profile.identityKey)), [
77
+ const spaceMembers = useMemo(() => includeSelf ? allUnsortedMembers.sort((a) => a.identityKey.equals(client.halo.profile.identityKey) ? -1 : 1) : allUnsortedMembers.filter((member) => !member.identityKey.equals(client.halo.profile.identityKey)), [
101
78
  allUnsortedMembers
102
79
  ]);
103
- return /* @__PURE__ */ React4.createElement(SpaceMemberList, {
104
- members,
105
- onSelect
80
+ return /* @__PURE__ */ React3.createElement(SpaceMemberList, {
81
+ spaceMembers
106
82
  });
107
83
  };
108
84
 
109
85
  // packages/apps/patterns/react-ui/src/components/InvitationList/InvitationStatusAvatar.tsx
110
- import React5 from "react";
86
+ import React4 from "react";
111
87
  import { Invitation as Invitation3 } from "@dxos/client";
112
- import { getSize, mx as mx2 } from "@dxos/react-components";
113
-
114
- // packages/apps/patterns/react-ui/src/styles/dialogStyles.ts
115
- var defaultOverlay = "fixed inset-0 backdrop-blur z-50 overflow-auto grid place-items-center p-2 md:p-4 lg:p-8";
116
- var defaultDialogContent = "is-full min-is-[260px] max-is-[320px] rounded-md shadow-md backdrop-blur-md";
88
+ import { getSize } from "@dxos/react-components";
117
89
 
118
90
  // packages/apps/patterns/react-ui/src/styles/panelStyles.ts
119
91
  var defaultSurface = "bg-neutral-50/[.72] dark:bg-neutral-950/[.72]";
@@ -194,7 +166,7 @@ function _extends2() {
194
166
  return _extends2.apply(this, arguments);
195
167
  }
196
168
  var svgSize = 32;
197
- var strokeWidth = 5;
169
+ var strokeWidth = 4;
198
170
  var radius = (svgSize - strokeWidth) / 2;
199
171
  var circumference = Math.PI * 2 * radius;
200
172
  var gap = circumference / 12;
@@ -207,20 +179,19 @@ var circleProps = {
207
179
  cx: svgSize / 2,
208
180
  cy: svgSize / 2,
209
181
  r: radius,
210
- strokeWidth,
182
+ strokeWidth: 4,
211
183
  strokeDasharray: `${segment - gap} ${2 * segment + gap}`
212
184
  };
213
- var InvitationStatusAvatar = ({ size = 10, status, haltedAt, slots = {} }) => {
214
- var _a;
185
+ var InvitationStatusAvatar = ({ size = 10, status, haltedAt }) => {
215
186
  const resolvedColor = resolvedStrokeColor(status);
216
187
  const halted = status === Invitation3.State.CANCELLED || status === Invitation3.State.TIMEOUT || status === Invitation3.State.ERROR;
217
188
  const cursor = invitationStatusValue.get(halted ? haltedAt : status);
218
- return /* @__PURE__ */ React5.createElement("svg", _extends2({}, slots.svg, {
189
+ return /* @__PURE__ */ React4.createElement("svg", {
219
190
  viewBox: `0 0 ${svgSize} ${svgSize}`,
220
- className: mx2(getSize(size), (_a = slots.svg) == null ? void 0 : _a.className)
221
- }), [
191
+ className: getSize(size)
192
+ }, [
222
193
  ...Array(nSegments)
223
- ].map((_, index) => /* @__PURE__ */ React5.createElement("circle", _extends2({
194
+ ].map((_, index) => /* @__PURE__ */ React4.createElement("circle", _extends2({
224
195
  key: index
225
196
  }, circleProps, {
226
197
  strokeDashoffset: index * segment + baseOffset,
@@ -232,9 +203,9 @@ var InvitationStatusAvatar = ({ size = 10, status, haltedAt, slots = {} }) => {
232
203
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
233
204
  import { Copy, ProhibitInset, QrCode, X } from "phosphor-react";
234
205
  import { QRCodeSVG } from "qrcode.react";
235
- import React6, { useCallback } from "react";
206
+ import React5, { useCallback } from "react";
236
207
  import { useInvitationStatus } from "@dxos/react-client";
237
- import { Button, getSize as getSize2, mx as mx3, useId, useTranslation as useTranslation2 } from "@dxos/react-components";
208
+ import { Button, getSize as getSize2, mx, useTranslation as useTranslation2 } from "@dxos/react-components";
238
209
  function _extends3() {
239
210
  _extends3 = Object.assign || function(target) {
240
211
  for (var i = 1; i < arguments.length; i++) {
@@ -252,98 +223,85 @@ function _extends3() {
252
223
  var InvitationListItem = ({ invitation, value, onClickRemove, createInvitationUrl }) => {
253
224
  var _a;
254
225
  const { t } = useTranslation2("os");
255
- const qrLabel = useId("qrLabel");
256
226
  const { cancel, status, haltedAt, invitationCode, authenticationCode } = useInvitationStatus(invitation);
257
227
  const statusValue = (_a = invitationStatusValue.get(status)) != null ? _a : 0;
258
228
  const isCancellable = statusValue < 4 && statusValue >= 0;
259
229
  const showShare = statusValue < 3 && statusValue >= 0;
260
- const showAuthCode = statusValue === 3;
230
+ const showPin = statusValue === 3;
261
231
  const handleClickRemove = useCallback(() => onClickRemove(invitation), [
262
232
  invitation,
263
233
  onClickRemove
264
234
  ]);
265
235
  const invitationUrl = invitationCode && createInvitationUrl(invitationCode);
266
- const handleClickCopy = useCallback(() => {
236
+ const handleCLickCopy = useCallback(() => {
267
237
  if (invitationUrl) {
268
238
  void navigator.clipboard.writeText(invitationUrl);
269
239
  }
270
240
  }, [
271
241
  invitationUrl
272
242
  ]);
273
- return /* @__PURE__ */ React6.createElement(AccordionPrimitive.Item, {
243
+ return /* @__PURE__ */ React5.createElement(AccordionPrimitive.Item, {
274
244
  value
275
- }, /* @__PURE__ */ React6.createElement(AccordionPrimitive.Header, {
245
+ }, /* @__PURE__ */ React5.createElement(AccordionPrimitive.Header, {
276
246
  className: "flex gap-2 items-center"
277
- }, /* @__PURE__ */ React6.createElement(InvitationStatusAvatar, _extends3({}, {
247
+ }, /* @__PURE__ */ React5.createElement(InvitationStatusAvatar, _extends3({}, {
278
248
  status,
279
- haltedAt,
280
- size: 8
281
- })), showShare && invitationUrl ? /* @__PURE__ */ React6.createElement(React6.Fragment, null, /* @__PURE__ */ React6.createElement(AccordionPrimitive.Trigger, {
249
+ haltedAt
250
+ })), showShare && invitationUrl ? /* @__PURE__ */ React5.createElement(AccordionPrimitive.Trigger, {
282
251
  asChild: true
283
- }, /* @__PURE__ */ React6.createElement(Button, {
284
- className: "grow flex gap-1",
285
- "data-testid": "show-qrcode"
286
- }, /* @__PURE__ */ React6.createElement("span", null, t("open share panel label")), /* @__PURE__ */ React6.createElement(QrCode, {
252
+ }, /* @__PURE__ */ React5.createElement(Button, {
253
+ className: "grow flex gap-1"
254
+ }, /* @__PURE__ */ React5.createElement("span", null, t("open share panel label")), /* @__PURE__ */ React5.createElement(QrCode, {
287
255
  className: getSize2(4),
288
256
  weight: "bold"
289
- }))), /* @__PURE__ */ React6.createElement(Button, {
290
- className: "flex gap-1",
291
- onClick: handleClickCopy,
292
- "data-testid": "copy-invitation"
293
- }, /* @__PURE__ */ React6.createElement("span", {
294
- className: "pli-1"
295
- }, t("copy invitation code label")), /* @__PURE__ */ React6.createElement(Copy, {
296
- className: getSize2(4),
297
- weight: "bold"
298
- }))) : showAuthCode ? /* @__PURE__ */ React6.createElement("p", {
257
+ }))) : showPin ? /* @__PURE__ */ React5.createElement("p", {
299
258
  className: "grow text-xl text-center text-success-500 dark:text-success-300 font-mono"
300
- }, authenticationCode) : /* @__PURE__ */ React6.createElement("span", {
259
+ }, authenticationCode) : /* @__PURE__ */ React5.createElement("span", {
301
260
  role: "none",
302
261
  className: "grow"
303
- }), isCancellable ? /* @__PURE__ */ React6.createElement(Button, {
262
+ }), isCancellable ? /* @__PURE__ */ React5.createElement(Button, {
304
263
  variant: "ghost",
305
264
  compact: true,
306
265
  className: "flex gap-1",
307
- onClick: cancel,
308
- "data-testid": "cancel-invitation"
309
- }, /* @__PURE__ */ React6.createElement("span", {
266
+ onClick: cancel
267
+ }, /* @__PURE__ */ React5.createElement("span", {
310
268
  className: "sr-only"
311
- }, t("cancel invitation label")), /* @__PURE__ */ React6.createElement(ProhibitInset, {
269
+ }, t("cancel invitation label")), /* @__PURE__ */ React5.createElement(ProhibitInset, {
312
270
  className: getSize2(4),
313
271
  weight: "bold"
314
- })) : /* @__PURE__ */ React6.createElement(Button, {
272
+ })) : /* @__PURE__ */ React5.createElement(Button, {
315
273
  variant: "ghost",
316
274
  compact: true,
317
275
  className: "flex gap-1",
318
- onClick: handleClickRemove,
319
- "data-testid": "remove-invitation"
320
- }, /* @__PURE__ */ React6.createElement("span", {
276
+ onClick: handleClickRemove
277
+ }, /* @__PURE__ */ React5.createElement("span", {
321
278
  className: "sr-only"
322
- }, t("remove invitation label")), /* @__PURE__ */ React6.createElement(X, {
279
+ }, t("remove invitation label")), /* @__PURE__ */ React5.createElement(X, {
323
280
  className: getSize2(4),
324
281
  weight: "bold"
325
- }))), showShare && invitationUrl && /* @__PURE__ */ React6.createElement(AccordionPrimitive.Content, {
326
- className: "flex gap-2 is-full radix-state-open:p-1 items-center"
327
- }, /* @__PURE__ */ React6.createElement(QRCodeSVG, {
282
+ }))), showShare && invitationUrl && /* @__PURE__ */ React5.createElement(AccordionPrimitive.Content, null, /* @__PURE__ */ React5.createElement(Button, {
283
+ className: "flex gap-2 is-full p-2",
284
+ onClick: handleCLickCopy
285
+ }, /* @__PURE__ */ React5.createElement(QRCodeSVG, {
328
286
  bgColor: "transparent",
329
287
  fgColor: "currentColor",
330
288
  value: invitationUrl,
331
- className: mx3("grow-[2] aspect-square is-24 bs-auto"),
332
- "aria-labelledby": qrLabel
333
- }), /* @__PURE__ */ React6.createElement("span", {
334
- className: "pli-1 flex-1 font-system-normal text-sm text-center",
335
- id: qrLabel
336
- }, t("qr label"))));
289
+ className: mx("grow aspect-square is-24 bs-auto")
290
+ }), /* @__PURE__ */ React5.createElement("span", {
291
+ className: "pli-1"
292
+ }, t("copy invitation code label"), /* @__PURE__ */ React5.createElement(Copy, {
293
+ className: mx(getSize2(4), "inline mis-1"),
294
+ weight: "bold"
295
+ })))));
337
296
  };
338
297
 
339
298
  // packages/apps/patterns/react-ui/src/components/InvitationList/InvitationListContainer.tsx
340
- import React8, { useCallback as useCallback2 } from "react";
299
+ import React7, { useCallback as useCallback2 } from "react";
341
300
  import { useSpace, useSpaceInvitations } from "@dxos/react-client";
342
301
 
343
302
  // packages/apps/patterns/react-ui/src/components/InvitationList/InvitationList.tsx
344
303
  import { Root as AccordionRoot } from "@radix-ui/react-accordion";
345
- import React7 from "react";
346
- import { defaultDescription, mx as mx4, useTranslation as useTranslation3 } from "@dxos/react-components";
304
+ import React6 from "react";
347
305
  function _extends4() {
348
306
  _extends4 = Object.assign || function(target) {
349
307
  for (var i = 1; i < arguments.length; i++) {
@@ -359,22 +317,18 @@ function _extends4() {
359
317
  return _extends4.apply(this, arguments);
360
318
  }
361
319
  var InvitationList = ({ invitations, ...invitationProps }) => {
362
- const { t } = useTranslation3("os");
363
- return invitations.length ? /* @__PURE__ */ React7.createElement(AccordionRoot, {
320
+ return /* @__PURE__ */ React6.createElement(AccordionRoot, {
364
321
  type: "single",
365
- collapsible: true,
366
- className: "flex flex-col gap-1"
322
+ collapsible: true
367
323
  }, invitations.map((invitation, index) => {
368
324
  var _a, _b;
369
325
  const value = (_b = (_a = invitation.invitation) == null ? void 0 : _a.invitationId) != null ? _b : `inv_${index}`;
370
- return /* @__PURE__ */ React7.createElement(InvitationListItem, _extends4({
326
+ return /* @__PURE__ */ React6.createElement(InvitationListItem, _extends4({
371
327
  key: value,
372
328
  value,
373
329
  invitation
374
330
  }, invitationProps));
375
- })) : /* @__PURE__ */ React7.createElement("p", {
376
- className: mx4(defaultDescription, "text-center p-2")
377
- }, t("empty invitations message"));
331
+ }));
378
332
  };
379
333
 
380
334
  // packages/apps/patterns/react-ui/src/components/InvitationList/InvitationListContainer.tsx
@@ -400,7 +354,7 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl }) => {
400
354
  }, [
401
355
  space
402
356
  ]);
403
- return /* @__PURE__ */ React8.createElement(InvitationList, _extends5({
357
+ return /* @__PURE__ */ React7.createElement(InvitationList, _extends5({
404
358
  invitations
405
359
  }, {
406
360
  onClickRemove,
@@ -409,8 +363,8 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl }) => {
409
363
  };
410
364
 
411
365
  // packages/apps/patterns/react-ui/src/components/PanelSeparator/PanelSeparator.tsx
412
- import React9 from "react";
413
- import { mx as mx5 } from "@dxos/react-components";
366
+ import React8 from "react";
367
+ import { mx as mx2 } from "@dxos/react-components";
414
368
  function _extends6() {
415
369
  _extends6 = Object.assign || function(target) {
416
370
  for (var i = 1; i < arguments.length; i++) {
@@ -426,65 +380,22 @@ function _extends6() {
426
380
  return _extends6.apply(this, arguments);
427
381
  }
428
382
  var PanelSeparator = ({ className, ...props }) => {
429
- return /* @__PURE__ */ React9.createElement("span", _extends6({
383
+ return /* @__PURE__ */ React8.createElement("span", _extends6({
430
384
  role: "none"
431
385
  }, props, {
432
- className: mx5("block bs-px mlb-1 bg-neutral-800/10 dark:bg-neutral-200/10", className)
386
+ className: mx2("block bs-px mlb-1 bg-neutral-800/10 dark:bg-neutral-200/10", className)
433
387
  }));
434
388
  };
435
389
 
436
- // packages/apps/patterns/react-ui/src/components/SpaceList/SpaceListItem.tsx
437
- import React10, { forwardRef } from "react";
438
- import { Avatar as Avatar2, mx as mx6 } from "@dxos/react-components";
439
- import { humanize } from "@dxos/util";
440
- function _extends7() {
441
- _extends7 = Object.assign || function(target) {
442
- for (var i = 1; i < arguments.length; i++) {
443
- var source = arguments[i];
444
- for (var key in source) {
445
- if (Object.prototype.hasOwnProperty.call(source, key)) {
446
- target[key] = source[key];
447
- }
448
- }
449
- }
450
- return target;
451
- };
452
- return _extends7.apply(this, arguments);
453
- }
454
- var SpaceListItem = /* @__PURE__ */ forwardRef(({ space, onClick }, ref) => {
455
- var _a;
456
- return /* @__PURE__ */ React10.createElement("li", {
457
- className: mx6("flex gap-2 items-center", onClick && "cursor-pointer"),
458
- onClick: () => onClick == null ? void 0 : onClick(),
459
- ref,
460
- "data-testid": "space-list-item"
461
- }, /* @__PURE__ */ React10.createElement(Avatar2, _extends7({}, {
462
- variant: "circle",
463
- size: 9,
464
- fallbackValue: space.key.toHex(),
465
- label: /* @__PURE__ */ React10.createElement("p", {
466
- className: "text-sm truncate"
467
- }, (_a = space.properties.name) != null ? _a : humanize(space.key)),
468
- slots: {
469
- labels: {
470
- className: "block shrink overflow-hidden"
471
- },
472
- root: {
473
- className: "shrink-0"
474
- }
475
- }
476
- })));
477
- });
478
-
479
390
  // packages/apps/patterns/react-ui/src/composites/IdentityPopover/IdentityPopover.tsx
480
- import React29 from "react";
481
- import { Avatar as Avatar8, mx as mx23 } from "@dxos/react-components";
391
+ import React24 from "react";
392
+ import { Avatar as Avatar7, mx as mx16 } from "@dxos/react-components";
482
393
 
483
394
  // packages/apps/patterns/react-ui/src/layouts/PanelPopover/PanelPopover.tsx
484
- import React11 from "react";
485
- import { mx as mx7, Popover } from "@dxos/react-components";
486
- function _extends8() {
487
- _extends8 = Object.assign || function(target) {
395
+ import React9 from "react";
396
+ import { mx as mx3, Popover } from "@dxos/react-components";
397
+ function _extends7() {
398
+ _extends7 = Object.assign || function(target) {
488
399
  for (var i = 1; i < arguments.length; i++) {
489
400
  var source = arguments[i];
490
401
  for (var key in source) {
@@ -495,25 +406,25 @@ function _extends8() {
495
406
  }
496
407
  return target;
497
408
  };
498
- return _extends8.apply(this, arguments);
409
+ return _extends7.apply(this, arguments);
499
410
  }
500
411
  var PanelPopover = ({ slots, children, ...popoverProps }) => {
501
412
  var _a, _b, _c;
502
- return /* @__PURE__ */ React11.createElement(Popover, _extends8({
413
+ return /* @__PURE__ */ React9.createElement(Popover, _extends7({
503
414
  slots: {
504
415
  arrow: {
505
416
  ...slots == null ? void 0 : slots.arrow,
506
- className: mx7(defaultArrow, (_a = slots == null ? void 0 : slots.arrow) == null ? void 0 : _a.className)
417
+ className: mx3(defaultArrow, (_a = slots == null ? void 0 : slots.arrow) == null ? void 0 : _a.className)
507
418
  },
508
419
  content: {
509
420
  collisionPadding: 8,
510
421
  sideOffset: 4,
511
422
  ...slots == null ? void 0 : slots.content,
512
- className: mx7(defaultSurface, (_b = slots == null ? void 0 : slots.content) == null ? void 0 : _b.className)
423
+ className: mx3(defaultSurface, (_b = slots == null ? void 0 : slots.content) == null ? void 0 : _b.className)
513
424
  },
514
425
  trigger: {
515
426
  ...slots == null ? void 0 : slots.trigger,
516
- className: mx7("", (_c = slots == null ? void 0 : slots.trigger) == null ? void 0 : _c.className)
427
+ className: mx3("", (_c = slots == null ? void 0 : slots.trigger) == null ? void 0 : _c.className)
517
428
  },
518
429
  ...slots
519
430
  }
@@ -522,10 +433,10 @@ var PanelPopover = ({ slots, children, ...popoverProps }) => {
522
433
 
523
434
  // packages/apps/patterns/react-ui/src/layouts/PanelSidebar/PanelSidebar.tsx
524
435
  import * as DialogPrimitive from "@radix-ui/react-dialog";
525
- import React12, { createContext, useCallback as useCallback3, useContext, useState } from "react";
526
- import { defaultOverlay as defaultOverlay2, mx as mx8, useMediaQuery, useTranslation as useTranslation4 } from "@dxos/react-components";
527
- function _extends9() {
528
- _extends9 = Object.assign || function(target) {
436
+ import React10, { createContext, useCallback as useCallback3, useContext, useState } from "react";
437
+ import { defaultOverlay, mx as mx4, useMediaQuery, useTranslation as useTranslation3 } from "@dxos/react-components";
438
+ function _extends8() {
439
+ _extends8 = Object.assign || function(target) {
529
440
  for (var i = 1; i < arguments.length; i++) {
530
441
  var source = arguments[i];
531
442
  for (var key in source) {
@@ -536,7 +447,7 @@ function _extends9() {
536
447
  }
537
448
  return target;
538
449
  };
539
- return _extends9.apply(this, arguments);
450
+ return _extends8.apply(this, arguments);
540
451
  }
541
452
  var PanelSidebarContext = /* @__PURE__ */ createContext({
542
453
  displayState: "hide",
@@ -553,7 +464,7 @@ var useTogglePanelSidebar = () => {
553
464
  };
554
465
  var PanelSidebarProvider = ({ children, slots }) => {
555
466
  var _a, _b, _c;
556
- const { t } = useTranslation4("os");
467
+ const { t } = useTranslation3("os");
557
468
  const [isLg] = useMediaQuery("lg", {
558
469
  ssr: false
559
470
  });
@@ -576,37 +487,37 @@ var PanelSidebarProvider = ({ children, slots }) => {
576
487
  }, 0);
577
488
  };
578
489
  const setDisplayState = (displayState2) => displayState2 === "show" ? internalShow() : internalHide();
579
- return /* @__PURE__ */ React12.createElement(PanelSidebarContext.Provider, {
490
+ return /* @__PURE__ */ React10.createElement(PanelSidebarContext.Provider, {
580
491
  value: {
581
492
  setDisplayState,
582
493
  displayState
583
494
  }
584
- }, /* @__PURE__ */ React12.createElement(DialogPrimitive.Root, {
495
+ }, /* @__PURE__ */ React10.createElement(DialogPrimitive.Root, {
585
496
  open: domShow,
586
497
  modal: !isLg
587
- }, /* @__PURE__ */ React12.createElement(DialogPrimitive.Content, _extends9({
498
+ }, /* @__PURE__ */ React10.createElement(DialogPrimitive.Content, _extends8({
588
499
  onOpenAutoFocus: (event) => isLg && event.preventDefault(),
589
500
  onCloseAutoFocus: (event) => isLg && event.preventDefault()
590
501
  }, slots == null ? void 0 : slots.content, {
591
- className: mx8("fixed block-start-0 block-end-0 is-sidebar z-30 overscroll-contain overflow-x-hidden overflow-y-auto", "transition-[inset-inline-start,inset-inline-end] duration-200 ease-in-out", transitionShow ? "inline-start-0" : "-inline-start-sidebar", (_a = slots == null ? void 0 : slots.content) == null ? void 0 : _a.className)
592
- }), /* @__PURE__ */ React12.createElement(DialogPrimitive.Title, {
502
+ className: mx4("fixed block-start-0 block-end-0 is-sidebar z-50 overscroll-contain overflow-x-hidden overflow-y-auto", "transition-[inset-inline-start,inset-inline-end] duration-200 ease-in-out", transitionShow ? "inline-start-0" : "-inline-start-sidebar", (_a = slots == null ? void 0 : slots.content) == null ? void 0 : _a.className)
503
+ }), /* @__PURE__ */ React10.createElement(DialogPrimitive.Title, {
593
504
  className: "sr-only"
594
- }, t("sidebar label")), (_b = slots == null ? void 0 : slots.content) == null ? void 0 : _b.children), !isLg && /* @__PURE__ */ React12.createElement(DialogPrimitive.Overlay, {
595
- className: mx8(defaultOverlay2, "transition-opacity duration-200 ease-in-out", transitionShow ? "opacity-100" : "opacity-0"),
505
+ }, t("sidebar label")), (_b = slots == null ? void 0 : slots.content) == null ? void 0 : _b.children), !isLg && /* @__PURE__ */ React10.createElement(DialogPrimitive.Overlay, {
506
+ className: mx4(defaultOverlay, "transition-opacity duration-200 ease-in-out", transitionShow ? "opacity-100" : "opacity-0"),
596
507
  onClick: internalHide
597
- }), /* @__PURE__ */ React12.createElement("div", _extends9({
508
+ }), /* @__PURE__ */ React10.createElement("div", _extends8({
598
509
  role: "none"
599
510
  }, slots == null ? void 0 : slots.main, {
600
- className: mx8("transition-[padding-inline-start] duration-200 ease-in-out", isLg && isOpen ? "pis-sidebar" : "pis-0", (_c = slots == null ? void 0 : slots.main) == null ? void 0 : _c.className)
511
+ className: mx4("transition-[padding-inline-start] duration-200 ease-in-out", isLg && isOpen ? "pis-sidebar" : "pis-0", (_c = slots == null ? void 0 : slots.main) == null ? void 0 : _c.className)
601
512
  }), children)));
602
513
  };
603
514
 
604
515
  // packages/apps/patterns/react-ui/src/layouts/PanelAlertDialog/PanelAlertDialog.tsx
605
516
  import * as AlertDialog from "@radix-ui/react-alert-dialog";
606
- import React13 from "react";
607
- import { mx as mx9 } from "@dxos/react-components";
608
- function _extends10() {
609
- _extends10 = Object.assign || function(target) {
517
+ import React11 from "react";
518
+ import { mx as mx5 } from "@dxos/react-components";
519
+ function _extends9() {
520
+ _extends9 = Object.assign || function(target) {
610
521
  for (var i = 1; i < arguments.length; i++) {
611
522
  var source = arguments[i];
612
523
  for (var key in source) {
@@ -617,162 +528,47 @@ function _extends10() {
617
528
  }
618
529
  return target;
619
530
  };
620
- return _extends10.apply(this, arguments);
531
+ return _extends9.apply(this, arguments);
621
532
  }
622
533
  var PanelAlertDialog = ({ titleId, slots = {}, children }) => {
623
534
  var _a, _b;
624
- return /* @__PURE__ */ React13.createElement(AlertDialog.Root, _extends10({
535
+ return /* @__PURE__ */ React11.createElement(AlertDialog.Root, _extends9({
625
536
  defaultOpen: true
626
- }, slots.root), slots.trigger && /* @__PURE__ */ React13.createElement(AlertDialog.Trigger, _extends10({}, slots.trigger)), /* @__PURE__ */ React13.createElement(AlertDialog.Overlay, _extends10({}, slots.overlay, {
627
- className: mx9(defaultOverlay, "z-40", (_a = slots.overlay) == null ? void 0 : _a.className)
628
- }), /* @__PURE__ */ React13.createElement(AlertDialog.Content, _extends10({
537
+ }, slots.root), slots.trigger && /* @__PURE__ */ React11.createElement(AlertDialog.Trigger, _extends9({}, slots.trigger)), /* @__PURE__ */ React11.createElement(AlertDialog.Overlay, _extends9({}, slots.overlay, {
538
+ className: mx5("fixed inset-0 backdrop-blur z-50 overflow-auto grid place-items-center p-2 md:p-4 lg:p-8", (_a = slots.overlay) == null ? void 0 : _a.className)
539
+ }), /* @__PURE__ */ React11.createElement(AlertDialog.Content, _extends9({
629
540
  onEscapeKeyDown: (event) => event.preventDefault()
630
541
  }, slots.content, {
631
542
  "aria-labelledby": titleId,
632
- className: mx9(defaultDialogContent, (_b = slots.content) == null ? void 0 : _b.className)
633
- }), children)));
634
- };
635
-
636
- // packages/apps/patterns/react-ui/src/layouts/PanelDialog/PanelDialog.tsx
637
- import * as Dialog from "@radix-ui/react-dialog";
638
- import React14 from "react";
639
- import { mx as mx10 } from "@dxos/react-components";
640
- function _extends11() {
641
- _extends11 = Object.assign || function(target) {
642
- for (var i = 1; i < arguments.length; i++) {
643
- var source = arguments[i];
644
- for (var key in source) {
645
- if (Object.prototype.hasOwnProperty.call(source, key)) {
646
- target[key] = source[key];
647
- }
648
- }
649
- }
650
- return target;
651
- };
652
- return _extends11.apply(this, arguments);
653
- }
654
- var PanelDialog = ({ titleId, slots = {}, children }) => {
655
- var _a, _b;
656
- return /* @__PURE__ */ React14.createElement(Dialog.Root, _extends11({
657
- defaultOpen: true
658
- }, slots.root), slots.trigger && /* @__PURE__ */ React14.createElement(Dialog.Trigger, _extends11({}, slots.trigger)), /* @__PURE__ */ React14.createElement(Dialog.Overlay, _extends11({}, slots.overlay, {
659
- className: mx10(defaultOverlay, "z-40", (_a = slots.overlay) == null ? void 0 : _a.className)
660
- }), /* @__PURE__ */ React14.createElement(Dialog.Content, _extends11({}, slots.content, {
661
- "aria-labelledby": titleId,
662
- className: mx10(defaultDialogContent, (_b = slots.content) == null ? void 0 : _b.className)
543
+ className: mx5("is-full min-is-[260px] max-is-[320px] shadow-md backdrop-blur-md", (_b = slots.content) == null ? void 0 : _b.className)
663
544
  }), children)));
664
545
  };
665
546
 
666
- // packages/apps/patterns/react-ui/src/panels/DevicesPanel/DevicesPanel.tsx
667
- import { UserPlus, X as X2 } from "phosphor-react";
668
- import React15, { cloneElement, useReducer } from "react";
669
- import { useClient as useClient2, useDevices, useHaloInvitations, useIdentity } from "@dxos/react-client";
670
- import { Button as Button2, getSize as getSize3, mx as mx11, Tooltip, useTranslation as useTranslation5 } from "@dxos/react-components";
671
- function _extends12() {
672
- _extends12 = Object.assign || function(target) {
673
- for (var i = 1; i < arguments.length; i++) {
674
- var source = arguments[i];
675
- for (var key in source) {
676
- if (Object.prototype.hasOwnProperty.call(source, key)) {
677
- target[key] = source[key];
678
- }
679
- }
680
- }
681
- return target;
682
- };
683
- return _extends12.apply(this, arguments);
684
- }
685
- var DeviceListView = ({ createInvitationUrl, titleId, onDone, doneActionParent }) => {
686
- const { t } = useTranslation5("os");
687
- const client = useClient2();
688
- const identity = useIdentity();
689
- const devices = useDevices();
690
- const invitations = useHaloInvitations();
691
- const displayName = identity == null ? void 0 : identity.displayName;
692
- if (!identity) {
693
- return null;
694
- }
695
- const doneButton = /* @__PURE__ */ React15.createElement(Button2, {
696
- compact: true,
697
- variant: "ghost",
698
- onClick: () => onDone == null ? void 0 : onDone(),
699
- "data-testid": "show-all-spaces"
700
- }, /* @__PURE__ */ React15.createElement(X2, {
701
- className: getSize3(4),
702
- weight: "bold"
703
- }));
704
- return /* @__PURE__ */ React15.createElement("div", {
705
- role: "none",
706
- className: "flex flex-col"
707
- }, /* @__PURE__ */ React15.createElement("div", {
708
- role: "none",
709
- className: mx11(subduedSurface, "rounded-bs-md flex items-center p-2 gap-2")
710
- }, /* @__PURE__ */ React15.createElement("h2", {
711
- id: titleId,
712
- className: mx11("grow font-system-medium", !displayName && "font-mono")
713
- }, displayName != null ? displayName : identity.identityKey.truncate()), /* @__PURE__ */ React15.createElement(Tooltip, {
714
- content: t("close label"),
715
- zIndex: "z-50"
716
- }, doneActionParent ? /* @__PURE__ */ cloneElement(doneActionParent, {}, doneButton) : doneButton)), /* @__PURE__ */ React15.createElement("div", {
717
- role: "region",
718
- className: mx11(defaultSurface, "rounded-be-md p-2")
719
- }, /* @__PURE__ */ React15.createElement(InvitationList, {
720
- invitations,
721
- onClickRemove: ({ invitation }) => invitation && client.halo.removeInvitation(invitation.invitationId),
722
- createInvitationUrl
723
- }), /* @__PURE__ */ React15.createElement(Button2, {
724
- className: "is-full flex gap-2 mbs-2",
725
- compact: true,
726
- onClick: () => client.halo.createInvitation(),
727
- "data-testid": "create-space-invitation"
728
- }, /* @__PURE__ */ React15.createElement("span", null, t("create space invitation label")), /* @__PURE__ */ React15.createElement(UserPlus, {
729
- className: getSize3(4),
730
- weight: "bold"
731
- })), /* @__PURE__ */ React15.createElement(PanelSeparator, null), /* @__PURE__ */ React15.createElement(DeviceList, {
732
- devices
733
- })));
734
- };
735
- var DevicesPanel = (props) => {
736
- const reducer = (state, action) => {
737
- const nextState = {
738
- ...state
739
- };
740
- switch (action.type) {
741
- case null:
742
- }
743
- return nextState;
744
- };
745
- const [panelState] = useReducer(reducer, {
746
- activeView: "device list"
747
- });
748
- return /* @__PURE__ */ React15.createElement(React15.Fragment, null, panelState.activeView === "device list" ? /* @__PURE__ */ React15.createElement(DeviceListView, _extends12({}, props)) : null);
749
- };
750
-
751
547
  // packages/apps/patterns/react-ui/src/panels/IdentityPanel/IdentityPanel.tsx
752
- import React16 from "react";
753
- import { useClient as useClient3 } from "@dxos/react-client";
754
- import { Avatar as Avatar3, Button as Button3, ThemeContext, useTranslation as useTranslation6 } from "@dxos/react-components";
548
+ import React12 from "react";
549
+ import { useClient as useClient2 } from "@dxos/react-client";
550
+ import { Avatar as Avatar2, Button as Button2, ThemeContext, useTranslation as useTranslation4 } from "@dxos/react-components";
755
551
  var IdentityPanel = ({ identity, onClickManageProfile }) => {
756
552
  var _a;
757
- const { t } = useTranslation6("os");
758
- const client = useClient3();
553
+ const { t } = useTranslation4("os");
554
+ const client = useClient2();
759
555
  const defaultManageProfile = () => {
760
556
  const remoteSource = new URL((client == null ? void 0 : client.config.get("runtime.client.remoteSource")) || "https://halo.dxos.org");
761
557
  const tab = window.open(remoteSource.origin, "_blank");
762
558
  tab == null ? void 0 : tab.focus();
763
559
  };
764
- return /* @__PURE__ */ React16.createElement(ThemeContext.Provider, {
560
+ return /* @__PURE__ */ React12.createElement(ThemeContext.Provider, {
765
561
  value: {
766
562
  themeVariant: "os"
767
563
  }
768
- }, /* @__PURE__ */ React16.createElement("div", {
564
+ }, /* @__PURE__ */ React12.createElement("div", {
769
565
  className: "flex flex-col gap-2 justify-center items-center"
770
- }, /* @__PURE__ */ React16.createElement(Avatar3, {
566
+ }, /* @__PURE__ */ React12.createElement(Avatar2, {
771
567
  size: 16,
772
568
  variant: "circle",
773
569
  fallbackValue: identity.identityKey.toHex(),
774
570
  label: (_a = identity.displayName) != null ? _a : ""
775
- }), /* @__PURE__ */ React16.createElement(Button3, {
571
+ }), /* @__PURE__ */ React12.createElement(Button2, {
776
572
  compact: true,
777
573
  onClick: onClickManageProfile != null ? onClickManageProfile : defaultManageProfile,
778
574
  className: "is-full"
@@ -780,19 +576,19 @@ var IdentityPanel = ({ identity, onClickManageProfile }) => {
780
576
  };
781
577
 
782
578
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/JoinPanel.tsx
783
- import React27, { useEffect, useReducer as useReducer2, useState as useState6 } from "react";
579
+ import React23, { useEffect, useReducer } from "react";
784
580
  import { InvitationEncoder as InvitationEncoder2 } from "@dxos/client";
785
581
  import { log } from "@dxos/log";
786
- import { useClient as useClient6, useIdentity as useIdentity2 } from "@dxos/react-client";
787
- import { useId as useId4 } from "@dxos/react-components";
582
+ import { useClient as useClient5, useIdentity } from "@dxos/react-client";
583
+ import { useId as useId3 } from "@dxos/react-components";
788
584
 
789
585
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/JoinHeading.tsx
790
586
  import { ProhibitInset as ProhibitInset2 } from "phosphor-react";
791
- import React17, { cloneElement as cloneElement2, forwardRef as forwardRef2 } from "react";
587
+ import React13, { cloneElement, forwardRef } from "react";
792
588
  import { useSpace as useSpace2 } from "@dxos/react-client";
793
- import { Avatar as Avatar4, Button as Button4, getSize as getSize4, Heading, mx as mx12, Trans, useId as useId2, useTranslation as useTranslation7 } from "@dxos/react-components";
794
- function _extends13() {
795
- _extends13 = Object.assign || function(target) {
589
+ import { Avatar as Avatar3, Button as Button3, getSize as getSize3, Heading, mx as mx6, Trans, useId, useTranslation as useTranslation5 } from "@dxos/react-components";
590
+ function _extends10() {
591
+ _extends10 = Object.assign || function(target) {
796
592
  for (var i = 1; i < arguments.length; i++) {
797
593
  var source = arguments[i];
798
594
  for (var key in source) {
@@ -803,77 +599,70 @@ function _extends13() {
803
599
  }
804
600
  return target;
805
601
  };
806
- return _extends13.apply(this, arguments);
602
+ return _extends10.apply(this, arguments);
807
603
  }
808
- var JoinHeading = /* @__PURE__ */ forwardRef2(({ mode, titleId, invitation, onExit, exitActionParent, preventExit }, ref) => {
809
- var _a, _b, _c, _d, _e, _f;
810
- const { t } = useTranslation7("os");
604
+ var JoinHeading = /* @__PURE__ */ forwardRef(({ titleId, invitation, onExit, exitActionParent }, ref) => {
605
+ var _a, _b, _c, _d, _e;
606
+ const { t } = useTranslation5("os");
811
607
  const space = useSpace2((_a = invitation == null ? void 0 : invitation.invitation) == null ? void 0 : _a.spaceKey);
812
- const name = mode === "halo-only" ? "(Unknown identity)" : (_b = space == null ? void 0 : space.properties.name) != null ? _b : "(Space name not available)";
813
- const nameId = useId2(mode === "halo-only" ? "identityDisplayName" : "spaceDisplayName");
814
- const invitationKey = mode === "halo-only" ? (_d = (_c = invitation == null ? void 0 : invitation.invitation) == null ? void 0 : _c.identityKey) == null ? void 0 : _d.toHex() : (_f = (_e = invitation == null ? void 0 : invitation.invitation) == null ? void 0 : _e.identityKey) == null ? void 0 : _f.toHex();
815
- const exitButton = /* @__PURE__ */ React17.createElement(Button4, _extends13({
608
+ const spaceTitle = (_b = space == null ? void 0 : space.properties.name) != null ? _b : "(Space not available)";
609
+ const nameId = useId("spaceDisplayName");
610
+ const exitButton = /* @__PURE__ */ React13.createElement(Button3, _extends10({
816
611
  compact: true,
817
612
  variant: "ghost"
818
613
  }, onExit && {
819
614
  onClick: onExit
820
615
  }, {
821
- className: "grow-0 shrink-0",
822
- "data-testid": "join-exit"
823
- }), /* @__PURE__ */ React17.createElement(ProhibitInset2, {
824
- className: getSize4(5)
825
- }), /* @__PURE__ */ React17.createElement("span", {
616
+ className: "grow-0 shrink-0"
617
+ }), /* @__PURE__ */ React13.createElement(ProhibitInset2, {
618
+ className: getSize3(5)
619
+ }), /* @__PURE__ */ React13.createElement("span", {
826
620
  className: "sr-only"
827
621
  }, t("exit label")));
828
- return /* @__PURE__ */ React17.createElement("div", {
622
+ return /* @__PURE__ */ React13.createElement("div", {
829
623
  role: "none",
830
- className: mx12(subduedSurface, "p-2 rounded-bs-md"),
624
+ className: mx6(subduedSurface, "p-2 rounded-bs-md"),
831
625
  ref
832
- }, /* @__PURE__ */ React17.createElement("div", {
626
+ }, /* @__PURE__ */ React13.createElement("div", {
833
627
  role: "group",
834
628
  className: "flex items-center gap-2"
835
- }, invitationKey ? /* @__PURE__ */ React17.createElement(Avatar4, {
836
- fallbackValue: invitationKey,
629
+ }, /* @__PURE__ */ React13.createElement(Avatar3, {
630
+ fallbackValue: (_e = (_d = (_c = invitation == null ? void 0 : invitation.invitation) == null ? void 0 : _c.spaceKey) == null ? void 0 : _d.toHex()) != null ? _e : "",
837
631
  labelId: nameId
838
- }) : /* @__PURE__ */ React17.createElement("span", {
839
- role: "none",
840
- className: mx12(getSize4(10), "bg-neutral-300 dark:bg-neutral-700 rounded-full")
841
- }), /* @__PURE__ */ React17.createElement(Heading, {
632
+ }), /* @__PURE__ */ React13.createElement(Heading, {
842
633
  level: 1,
843
634
  className: "font-body font-normal text-base grow",
844
635
  id: titleId
845
- }, invitation ? /* @__PURE__ */ React17.createElement(Trans, _extends13({}, {
846
- defaults: t("joining heading"),
636
+ }, /* @__PURE__ */ React13.createElement(Trans, _extends10({}, {
637
+ defaults: t("join space heading"),
847
638
  components: {
848
- small: /* @__PURE__ */ React17.createElement("span", {
639
+ small: /* @__PURE__ */ React13.createElement("span", {
849
640
  className: "block leading-none mbe-1 font-system-medium text-sm"
850
641
  }),
851
- large: /* @__PURE__ */ React17.createElement("span", {
642
+ large: /* @__PURE__ */ React13.createElement("span", {
852
643
  className: "block leading-none",
853
644
  id: nameId
854
645
  })
855
646
  },
856
647
  values: {
857
- name
648
+ spaceTitle
858
649
  }
859
- })) : /* @__PURE__ */ React17.createElement("span", {
860
- className: "block leading-none font-system-medium text-sm"
861
- }, mode === "halo-only" ? t("halo heading") : t("join space heading"))), !preventExit && mode !== "halo-only" && (exitActionParent ? /* @__PURE__ */ cloneElement2(exitActionParent, {}, exitButton) : exitButton)));
650
+ }))), exitActionParent ? /* @__PURE__ */ cloneElement(exitActionParent, {}, exitButton) : exitButton));
862
651
  });
863
652
 
864
653
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx
865
654
  import { CaretLeft, CaretRight, Plus, QrCode as QrCode2, Textbox } from "phosphor-react";
866
- import React19 from "react";
867
- import { Button as Button5, CompoundButton, getSize as getSize6, mx as mx14, useTranslation as useTranslation9 } from "@dxos/react-components";
655
+ import React15 from "react";
656
+ import { Button as Button4, CompoundButton, getSize as getSize5, mx as mx8, useTranslation as useTranslation7 } from "@dxos/react-components";
868
657
 
869
658
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/ViewState.tsx
870
- import { CheckCircle, HourglassSimple, X as X3 } from "phosphor-react";
871
- import React18, { useMemo as useMemo2 } from "react";
659
+ import { CheckCircle, HourglassSimple, X as X2 } from "phosphor-react";
660
+ import React14, { useMemo as useMemo2 } from "react";
872
661
  import { Invitation as Invitation4 } from "@dxos/client";
873
662
  import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client";
874
- import { mx as mx13, useTranslation as useTranslation8, Trans as Trans2, Avatar as Avatar5, useId as useId3, getSize as getSize5, strongShimmer } from "@dxos/react-components";
875
- function _extends14() {
876
- _extends14 = Object.assign || function(target) {
663
+ import { mx as mx7, useTranslation as useTranslation6, Trans as Trans2, Avatar as Avatar4, useId as useId2, getSize as getSize4, strongShimmer } from "@dxos/react-components";
664
+ function _extends11() {
665
+ _extends11 = Object.assign || function(target) {
877
666
  for (var i = 1; i < arguments.length; i++) {
878
667
  var source = arguments[i];
879
668
  for (var key in source) {
@@ -884,39 +673,39 @@ function _extends14() {
884
673
  }
885
674
  return target;
886
675
  };
887
- return _extends14.apply(this, arguments);
676
+ return _extends11.apply(this, arguments);
888
677
  }
889
- var stripe = mx13("rounded-full grow", getSize5(3));
678
+ var stripe = mx7("rounded-full grow", getSize4(3));
890
679
  var ViewStateHeading = ({ children, className, ...props }) => {
891
- return /* @__PURE__ */ React18.createElement("h2", _extends14({}, props, {
892
- className: mx13("font-system-medium text-sm md:text-base mbe-1 mli-1 text-center", className)
680
+ return /* @__PURE__ */ React14.createElement("h2", _extends11({}, props, {
681
+ className: mx7("font-system-medium text-sm md:text-base mbe-1 mli-1 text-center", className)
893
682
  }), children);
894
683
  };
895
684
  var PureViewStateInvitation = ({ halted, cursor, label, resolvedColor }) => {
896
- const labelId = useId3("invitationState");
897
- return /* @__PURE__ */ React18.createElement("div", {
685
+ const labelId = useId2("invitationState");
686
+ return /* @__PURE__ */ React14.createElement("div", {
898
687
  role: "none",
899
- className: mx13(defaultSurface, "pli-2 pbs-2")
900
- }, /* @__PURE__ */ React18.createElement("div", {
688
+ className: mx7(defaultSurface, "pli-2 pbs-2")
689
+ }, /* @__PURE__ */ React14.createElement("div", {
901
690
  role: "status",
902
691
  "aria-labelledby": labelId,
903
692
  className: "flex gap-2 items-center mlb-1"
904
- }, /* @__PURE__ */ React18.createElement("div", {
693
+ }, /* @__PURE__ */ React14.createElement("div", {
905
694
  role: "none",
906
- className: mx13(stripe, !halted && cursor === 1 && strongShimmer, cursor === 2 ? halted ? resolvedColor : activeBgColor : cursor > 1 ? resolvedColor : inactiveBgColor)
907
- }), /* @__PURE__ */ React18.createElement("div", {
695
+ className: mx7(stripe, !halted && cursor === 1 && strongShimmer, cursor === 2 ? halted ? resolvedColor : activeBgColor : cursor > 1 ? resolvedColor : inactiveBgColor)
696
+ }), /* @__PURE__ */ React14.createElement("div", {
908
697
  role: "none",
909
- className: mx13(stripe, !halted && cursor === 3 && strongShimmer, cursor === 3 ? halted ? resolvedColor : activeBgColor : cursor > 3 ? resolvedColor : inactiveBgColor)
910
- }), /* @__PURE__ */ React18.createElement("div", {
698
+ className: mx7(stripe, !halted && cursor === 3 && strongShimmer, cursor === 3 ? halted ? resolvedColor : activeBgColor : cursor > 3 ? resolvedColor : inactiveBgColor)
699
+ }), /* @__PURE__ */ React14.createElement("div", {
911
700
  role: "none",
912
- className: mx13(stripe, cursor > 3 ? halted ? resolvedColor : resolvedColor : inactiveBgColor)
913
- })), /* @__PURE__ */ React18.createElement(ViewStateHeading, {
701
+ className: mx7(stripe, cursor > 3 ? halted ? resolvedColor : resolvedColor : inactiveBgColor)
702
+ })), /* @__PURE__ */ React14.createElement(ViewStateHeading, {
914
703
  id: labelId,
915
704
  className: "mbs-2 flex justify-center items-center gap-2"
916
705
  }, label));
917
706
  };
918
707
  var ViewStateInvitationStatus = ({ activeInvitation }) => {
919
- const { t } = useTranslation8("os");
708
+ const { t } = useTranslation6("os");
920
709
  const { status, haltedAt } = useInvitationStatus2(activeInvitation);
921
710
  const halted = status === Invitation4.State.CANCELLED || status === Invitation4.State.TIMEOUT || status === Invitation4.State.ERROR;
922
711
  const cursor = invitationStatusValue.get(halted ? haltedAt : status);
@@ -924,24 +713,24 @@ var ViewStateInvitationStatus = ({ activeInvitation }) => {
924
713
  const statusLabelMap = useMemo2(() => /* @__PURE__ */ new Map([
925
714
  [
926
715
  Invitation4.State.ERROR,
927
- /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(X3, {
716
+ /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(X2, {
928
717
  weight: "bold",
929
- className: mx13(getSize5(4), "text-error-600 dark:text-error-400")
930
- }), /* @__PURE__ */ React18.createElement("span", null, t("error status label")))
718
+ className: mx7(getSize4(4), "text-error-600 dark:text-error-400")
719
+ }), /* @__PURE__ */ React14.createElement("span", null, t("error status label")))
931
720
  ],
932
721
  [
933
722
  Invitation4.State.TIMEOUT,
934
- /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(HourglassSimple, {
723
+ /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(HourglassSimple, {
935
724
  weight: "fill",
936
- className: mx13(getSize5(4), "text-warning-600 dark:text-warning-400")
937
- }), /* @__PURE__ */ React18.createElement("span", null, t("timeout status label")))
725
+ className: mx7(getSize4(4), "text-warning-600 dark:text-warning-400")
726
+ }), /* @__PURE__ */ React14.createElement("span", null, t("timeout status label")))
938
727
  ],
939
728
  [
940
729
  Invitation4.State.CANCELLED,
941
- /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(X3, {
730
+ /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(X2, {
942
731
  weight: "bold",
943
- className: mx13(getSize5(4), "text-warning-600 dark:text-warning-400")
944
- }), /* @__PURE__ */ React18.createElement("span", null, t("cancelled status label")))
732
+ className: mx7(getSize4(4), "text-warning-600 dark:text-warning-400")
733
+ }), /* @__PURE__ */ React14.createElement("span", null, t("cancelled status label")))
945
734
  ],
946
735
  [
947
736
  Invitation4.State.INIT,
@@ -961,15 +750,15 @@ var ViewStateInvitationStatus = ({ activeInvitation }) => {
961
750
  ],
962
751
  [
963
752
  Invitation4.State.SUCCESS,
964
- /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(CheckCircle, {
753
+ /* @__PURE__ */ React14.createElement(React14.Fragment, null, /* @__PURE__ */ React14.createElement(CheckCircle, {
965
754
  weight: "fill",
966
- className: mx13(getSize5(4), "text-success-600 dark:text-success-400")
967
- }), /* @__PURE__ */ React18.createElement("span", null, t("success status label")))
755
+ className: mx7(getSize4(4), "text-success-600 dark:text-success-400")
756
+ }), /* @__PURE__ */ React14.createElement("span", null, t("success status label")))
968
757
  ]
969
758
  ]), [
970
759
  t
971
760
  ]);
972
- return /* @__PURE__ */ React18.createElement(PureViewStateInvitation, _extends14({}, {
761
+ return /* @__PURE__ */ React14.createElement(PureViewStateInvitation, _extends11({}, {
973
762
  label: statusLabelMap.get(status),
974
763
  resolvedColor,
975
764
  cursor,
@@ -978,29 +767,29 @@ var ViewStateInvitationStatus = ({ activeInvitation }) => {
978
767
  };
979
768
  var ViewState = ({ active, children, className, dispatch, selectedIdentity, activeInvitation, ...props }) => {
980
769
  var _a;
981
- const { t } = useTranslation8("os");
982
- const identityLabel = useId3("selectedIdentityLabel");
983
- return /* @__PURE__ */ React18.createElement("div", _extends14({
770
+ const { t } = useTranslation6("os");
771
+ const identityLabel = useId2("selectedIdentityLabel");
772
+ return /* @__PURE__ */ React14.createElement("div", _extends11({
984
773
  role: "none"
985
774
  }, props, !active && {
986
775
  "aria-hidden": true
987
776
  }, {
988
- className: mx13("is-[50%] flex flex-col", active ? "order-2" : "order-4", className)
989
- }), selectedIdentity && /* @__PURE__ */ React18.createElement("div", {
777
+ className: mx7("is-[50%] flex flex-col", active ? "order-2" : "order-4", className)
778
+ }), selectedIdentity && /* @__PURE__ */ React14.createElement("div", {
990
779
  role: "none",
991
- className: mx13(subduedSurface, "flex-none flex items-center gap-1 pli-2 pbe-1.5")
992
- }, /* @__PURE__ */ React18.createElement(Trans2, _extends14({}, {
780
+ className: mx7(subduedSurface, "flex-none flex items-center gap-1 pli-2 pbe-1.5")
781
+ }, /* @__PURE__ */ React14.createElement(Trans2, _extends11({}, {
993
782
  defaults: t("join space as identity heading"),
994
783
  components: {
995
- icon: /* @__PURE__ */ React18.createElement(Avatar5, {
784
+ icon: /* @__PURE__ */ React14.createElement(Avatar4, {
996
785
  size: 4,
997
786
  fallbackValue: selectedIdentity === true ? "" : selectedIdentity.identityKey.toHex(),
998
787
  labelId: identityLabel
999
788
  }),
1000
- label: /* @__PURE__ */ React18.createElement("span", {
789
+ label: /* @__PURE__ */ React14.createElement("span", {
1001
790
  id: identityLabel
1002
791
  }),
1003
- part: /* @__PURE__ */ React18.createElement("span", {
792
+ part: /* @__PURE__ */ React14.createElement("span", {
1004
793
  role: "none",
1005
794
  className: "flex items-center gap-1 leading-none"
1006
795
  })
@@ -1008,23 +797,23 @@ var ViewState = ({ active, children, className, dispatch, selectedIdentity, acti
1008
797
  values: {
1009
798
  labelValue: selectedIdentity === true ? "\xA0" : (_a = selectedIdentity.displayName) != null ? _a : selectedIdentity.identityKey.truncate()
1010
799
  }
1011
- }))), activeInvitation && (activeInvitation === true ? /* @__PURE__ */ React18.createElement(PureViewStateInvitation, _extends14({}, {
800
+ }))), activeInvitation && (activeInvitation === true ? /* @__PURE__ */ React14.createElement(PureViewStateInvitation, _extends11({}, {
1012
801
  halted: false,
1013
802
  status: Invitation4.State.INIT,
1014
803
  label: t("invitation input label"),
1015
804
  cursor: 0,
1016
805
  resolvedColor: inactiveBgColor
1017
- })) : /* @__PURE__ */ React18.createElement(ViewStateInvitationStatus, _extends14({}, {
806
+ })) : /* @__PURE__ */ React14.createElement(ViewStateInvitationStatus, _extends11({}, {
1018
807
  activeInvitation
1019
- }))), /* @__PURE__ */ React18.createElement("div", {
808
+ }))), /* @__PURE__ */ React14.createElement("div", {
1020
809
  role: "region",
1021
- className: mx13(defaultSurface, "rounded-be-md grow shrink-0 flex flex-col gap-1 p-2")
810
+ className: mx7(defaultSurface, "rounded-be-md grow shrink-0 flex flex-col gap-1 p-2")
1022
811
  }, children));
1023
812
  };
1024
813
 
1025
814
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx
1026
- function _extends15() {
1027
- _extends15 = Object.assign || function(target) {
815
+ function _extends12() {
816
+ _extends12 = Object.assign || function(target) {
1028
817
  for (var i = 1; i < arguments.length; i++) {
1029
818
  var source = arguments[i];
1030
819
  for (var key in source) {
@@ -1035,16 +824,16 @@ function _extends15() {
1035
824
  }
1036
825
  return target;
1037
826
  };
1038
- return _extends15.apply(this, arguments);
827
+ return _extends12.apply(this, arguments);
1039
828
  }
1040
829
  var AdditionMethodSelector = ({ availableIdentities, ...viewStateProps }) => {
1041
830
  const disabled = !viewStateProps.active;
1042
831
  const { dispatch } = viewStateProps;
1043
- const { t } = useTranslation9("os");
832
+ const { t } = useTranslation7("os");
1044
833
  const sharedButtonProps = {
1045
834
  disabled,
1046
- after: /* @__PURE__ */ React19.createElement(CaretRight, {
1047
- className: getSize6(4),
835
+ after: /* @__PURE__ */ React15.createElement(CaretRight, {
836
+ className: getSize5(4),
1048
837
  weight: "bold"
1049
838
  }),
1050
839
  slots: {
@@ -1053,63 +842,59 @@ var AdditionMethodSelector = ({ availableIdentities, ...viewStateProps }) => {
1053
842
  }
1054
843
  }
1055
844
  };
1056
- return /* @__PURE__ */ React19.createElement(ViewState, _extends15({}, viewStateProps), /* @__PURE__ */ React19.createElement(ViewStateHeading, null, t("addition method selector title")), /* @__PURE__ */ React19.createElement("div", {
845
+ return /* @__PURE__ */ React15.createElement(ViewState, _extends12({}, viewStateProps), /* @__PURE__ */ React15.createElement(ViewStateHeading, null, t("addition method selector title")), /* @__PURE__ */ React15.createElement("div", {
1057
846
  role: "none",
1058
847
  className: "flex flex-col gap-1 grow"
1059
- }, /* @__PURE__ */ React19.createElement(CompoundButton, _extends15({}, sharedButtonProps, {
848
+ }, /* @__PURE__ */ React15.createElement(CompoundButton, _extends12({}, sharedButtonProps, {
1060
849
  description: t("create identity description"),
1061
- before: /* @__PURE__ */ React19.createElement(Plus, {
1062
- className: getSize6(6)
850
+ before: /* @__PURE__ */ React15.createElement(Plus, {
851
+ className: getSize5(6)
1063
852
  }),
1064
853
  onClick: () => dispatch({
1065
854
  type: "select addition method",
1066
855
  method: "create identity"
1067
856
  }),
1068
- "data-autofocus": "addition method selector",
1069
- "data-testid": "create-identity"
1070
- }), t("create identity label")), /* @__PURE__ */ React19.createElement(CompoundButton, _extends15({}, sharedButtonProps, {
857
+ "data-autofocus": "addition method selector"
858
+ }), t("create identity label")), /* @__PURE__ */ React15.createElement(CompoundButton, _extends12({}, sharedButtonProps, {
1071
859
  description: t("join identity description"),
1072
- before: /* @__PURE__ */ React19.createElement(QrCode2, {
1073
- className: getSize6(6)
860
+ before: /* @__PURE__ */ React15.createElement(QrCode2, {
861
+ className: getSize5(6)
1074
862
  }),
1075
863
  onClick: () => dispatch({
1076
864
  type: "select addition method",
1077
865
  method: "accept device invitation"
1078
- }),
1079
- "data-testid": "join-identity"
1080
- }), t("join identity label")), /* @__PURE__ */ React19.createElement(CompoundButton, _extends15({}, sharedButtonProps, {
866
+ })
867
+ }), t("join identity label")), /* @__PURE__ */ React15.createElement(CompoundButton, _extends12({}, sharedButtonProps, {
1081
868
  description: t("recover identity description"),
1082
- before: /* @__PURE__ */ React19.createElement(Textbox, {
1083
- className: getSize6(6)
869
+ before: /* @__PURE__ */ React15.createElement(Textbox, {
870
+ className: getSize5(6)
1084
871
  }),
1085
872
  onClick: () => dispatch({
1086
873
  type: "select addition method",
1087
874
  method: "recover identity"
1088
- }),
1089
- "data-testid": "recover-identity"
1090
- }), t("recover identity label"))), /* @__PURE__ */ React19.createElement(Button5, {
875
+ })
876
+ }), t("recover identity label"))), /* @__PURE__ */ React15.createElement(Button4, {
1091
877
  disabled: disabled || availableIdentities.length < 1,
1092
878
  onClick: () => dispatch({
1093
879
  type: "deselect identity"
1094
- }),
1095
- "data-testid": "deselect-identity"
1096
- }, /* @__PURE__ */ React19.createElement(CaretLeft, {
1097
- className: getSize6(4),
880
+ })
881
+ }, /* @__PURE__ */ React15.createElement(CaretLeft, {
882
+ className: getSize5(4),
1098
883
  weight: "bold"
1099
- }), /* @__PURE__ */ React19.createElement("span", {
884
+ }), /* @__PURE__ */ React15.createElement("span", {
1100
885
  className: "grow"
1101
- }, t("deselect identity label")), /* @__PURE__ */ React19.createElement(CaretRight, {
1102
- className: mx14(getSize6(4), "invisible"),
886
+ }, t("deselect identity label")), /* @__PURE__ */ React15.createElement(CaretRight, {
887
+ className: mx8(getSize5(4), "invisible"),
1103
888
  weight: "bold"
1104
889
  })));
1105
890
  };
1106
891
 
1107
892
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/IdentityAdded.tsx
1108
- import { CaretLeft as CaretLeft2, CaretRight as CaretRight2, Check } from "phosphor-react";
1109
- import React20, { cloneElement as cloneElement3 } from "react";
1110
- import { Avatar as Avatar6, Button as Button6, getSize as getSize7, mx as mx15, useTranslation as useTranslation10 } from "@dxos/react-components";
1111
- function _extends16() {
1112
- _extends16 = Object.assign || function(target) {
893
+ import { CaretLeft as CaretLeft2, CaretRight as CaretRight2 } from "phosphor-react";
894
+ import React16 from "react";
895
+ import { Avatar as Avatar5, Button as Button5, getSize as getSize6, mx as mx9, useTranslation as useTranslation8 } from "@dxos/react-components";
896
+ function _extends13() {
897
+ _extends13 = Object.assign || function(target) {
1113
898
  for (var i = 1; i < arguments.length; i++) {
1114
899
  var source = arguments[i];
1115
900
  for (var key in source) {
@@ -1120,51 +905,27 @@ function _extends16() {
1120
905
  }
1121
906
  return target;
1122
907
  };
1123
- return _extends16.apply(this, arguments);
908
+ return _extends13.apply(this, arguments);
1124
909
  }
1125
- var Done = ({ onDone, doneActionParent, active }) => {
1126
- const disabled = !active;
1127
- const { t } = useTranslation10("os");
1128
- const doneButton = /* @__PURE__ */ React20.createElement(Button6, _extends16({}, onDone && {
1129
- onClick: () => onDone(null)
1130
- }, {
1131
- disabled,
1132
- className: "grow flex items-center gap-2 pli-2",
1133
- "data-autofocus": "identity added",
1134
- "data-testid": "identity-added-done"
1135
- }), /* @__PURE__ */ React20.createElement(CaretLeft2, {
1136
- weight: "bold",
1137
- className: mx15(getSize7(2), "invisible")
1138
- }), /* @__PURE__ */ React20.createElement("span", {
1139
- className: "grow"
1140
- }, t("done label")), /* @__PURE__ */ React20.createElement(Check, {
1141
- weight: "bold",
1142
- className: getSize7(4)
1143
- }));
1144
- return doneActionParent ? /* @__PURE__ */ cloneElement3(doneActionParent, {}, doneButton) : doneButton;
1145
- };
1146
- var IdentityAdded = ({ mode, addedIdentity, onDone, doneActionParent, ...viewStateProps }) => {
910
+ var IdentityAdded = ({ addedIdentity, ...viewStateProps }) => {
1147
911
  var _a, _b, _c;
1148
912
  const disabled = !viewStateProps.active;
1149
913
  const { dispatch } = viewStateProps;
1150
- const { t } = useTranslation10("os");
1151
- return /* @__PURE__ */ React20.createElement(ViewState, _extends16({}, viewStateProps), /* @__PURE__ */ React20.createElement(ViewStateHeading, null, t("identity added label")), /* @__PURE__ */ React20.createElement("div", {
914
+ const { t } = useTranslation8("os");
915
+ return /* @__PURE__ */ React16.createElement(ViewState, _extends13({}, viewStateProps), /* @__PURE__ */ React16.createElement(ViewStateHeading, null, t("identity added label")), /* @__PURE__ */ React16.createElement("div", {
1152
916
  role: "none",
1153
917
  className: "grow flex flex-col items-center justify-center text-center gap-2"
1154
- }, /* @__PURE__ */ React20.createElement(Avatar6, {
918
+ }, /* @__PURE__ */ React16.createElement(Avatar5, {
1155
919
  size: 20,
1156
920
  fallbackValue: (_a = addedIdentity == null ? void 0 : addedIdentity.identityKey.toHex()) != null ? _a : "",
1157
- label: /* @__PURE__ */ React20.createElement("p", {
1158
- className: mx15("text-lg", !(addedIdentity == null ? void 0 : addedIdentity.displayName) && "font-mono")
921
+ label: /* @__PURE__ */ React16.createElement("p", {
922
+ className: mx9("text-lg", !(addedIdentity == null ? void 0 : addedIdentity.displayName) && "font-mono")
1159
923
  }, (_c = (_b = addedIdentity == null ? void 0 : addedIdentity.displayName) != null ? _b : addedIdentity == null ? void 0 : addedIdentity.identityKey.truncate()) != null ? _c : "\xA0"),
1160
924
  variant: "circle",
1161
925
  status: "active"
1162
- })), mode === "halo-only" ? /* @__PURE__ */ React20.createElement(Done, _extends16({
1163
- onDone,
1164
- doneActionParent
1165
- }, viewStateProps)) : /* @__PURE__ */ React20.createElement("div", {
926
+ })), /* @__PURE__ */ React16.createElement("div", {
1166
927
  className: "flex gap-2"
1167
- }, /* @__PURE__ */ React20.createElement(Button6, {
928
+ }, /* @__PURE__ */ React16.createElement(Button5, {
1168
929
  disabled: disabled || !addedIdentity,
1169
930
  className: "grow flex items-center gap-2 pli-2 order-2",
1170
931
  onClick: () => addedIdentity && dispatch({
@@ -1172,33 +933,33 @@ var IdentityAdded = ({ mode, addedIdentity, onDone, doneActionParent, ...viewSta
1172
933
  identity: addedIdentity
1173
934
  }),
1174
935
  "data-autofocus": "identity added"
1175
- }, /* @__PURE__ */ React20.createElement(CaretLeft2, {
936
+ }, /* @__PURE__ */ React16.createElement(CaretLeft2, {
1176
937
  weight: "bold",
1177
- className: mx15(getSize7(2), "invisible")
1178
- }), /* @__PURE__ */ React20.createElement("span", {
938
+ className: mx9(getSize6(2), "invisible")
939
+ }), /* @__PURE__ */ React16.createElement("span", {
1179
940
  className: "grow"
1180
- }, t("continue label")), /* @__PURE__ */ React20.createElement(CaretRight2, {
941
+ }, t("continue label")), /* @__PURE__ */ React16.createElement(CaretRight2, {
1181
942
  weight: "bold",
1182
- className: getSize7(4)
1183
- })), /* @__PURE__ */ React20.createElement(Button6, {
943
+ className: getSize6(4)
944
+ })), /* @__PURE__ */ React16.createElement(Button5, {
1184
945
  disabled,
1185
946
  onClick: () => dispatch({
1186
947
  type: "deselect identity"
1187
948
  }),
1188
949
  className: "flex items-center gap-2 pis-2 pie-4"
1189
- }, /* @__PURE__ */ React20.createElement(CaretLeft2, {
950
+ }, /* @__PURE__ */ React16.createElement(CaretLeft2, {
1190
951
  weight: "bold",
1191
- className: getSize7(4)
1192
- }), /* @__PURE__ */ React20.createElement("span", null, t("deselect identity label")))));
952
+ className: getSize6(4)
953
+ }), /* @__PURE__ */ React16.createElement("span", null, t("deselect identity label")))));
1193
954
  };
1194
955
 
1195
956
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/IdentitySelector.tsx
1196
957
  import * as RadioGroup from "@radix-ui/react-radio-group";
1197
- import { CaretLeft as CaretLeft3, CaretRight as CaretRight3, UserPlus as UserPlus2 } from "phosphor-react";
1198
- import React21, { useCallback as useCallback4, useState as useState2 } from "react";
1199
- import { Avatar as Avatar7, Button as Button7, themeVariantFocus, getSize as getSize8, mx as mx16, useTranslation as useTranslation11 } from "@dxos/react-components";
1200
- function _extends17() {
1201
- _extends17 = Object.assign || function(target) {
958
+ import { CaretLeft as CaretLeft3, CaretRight as CaretRight3, UserPlus } from "phosphor-react";
959
+ import React17, { useCallback as useCallback4, useState as useState2 } from "react";
960
+ import { Avatar as Avatar6, Button as Button6, themeVariantFocus, getSize as getSize7, mx as mx10, useTranslation as useTranslation9 } from "@dxos/react-components";
961
+ function _extends14() {
962
+ _extends14 = Object.assign || function(target) {
1202
963
  for (var i = 1; i < arguments.length; i++) {
1203
964
  var source = arguments[i];
1204
965
  for (var key in source) {
@@ -1209,17 +970,17 @@ function _extends17() {
1209
970
  }
1210
971
  return target;
1211
972
  };
1212
- return _extends17.apply(this, arguments);
973
+ return _extends14.apply(this, arguments);
1213
974
  }
1214
975
  var IdentitySelector = ({ availableIdentities, ...viewStateProps }) => {
1215
976
  const { dispatch } = viewStateProps;
1216
977
  const disabled = !viewStateProps.active;
1217
- const { t } = useTranslation11("os");
978
+ const { t } = useTranslation9("os");
1218
979
  const [activeIdentity, setActiveIdentity] = useState2(availableIdentities[0]);
1219
980
  const onValueChange = useCallback4((nextHex) => setActiveIdentity(availableIdentities.find((identity) => identity.identityKey.toHex() === nextHex) || activeIdentity), [
1220
981
  availableIdentities
1221
982
  ]);
1222
- return /* @__PURE__ */ React21.createElement(ViewState, _extends17({}, viewStateProps), /* @__PURE__ */ React21.createElement(ViewStateHeading, null, t("identity selector title")), /* @__PURE__ */ React21.createElement(RadioGroup.Root, {
983
+ return /* @__PURE__ */ React17.createElement(ViewState, _extends14({}, viewStateProps), /* @__PURE__ */ React17.createElement(ViewStateHeading, null, t("identity selector title")), /* @__PURE__ */ React17.createElement(RadioGroup.Root, {
1223
984
  disabled,
1224
985
  value: activeIdentity == null ? void 0 : activeIdentity.identityKey.toHex(),
1225
986
  onValueChange,
@@ -1231,65 +992,62 @@ var IdentitySelector = ({ availableIdentities, ...viewStateProps }) => {
1231
992
  const hex = identityKey.toHex();
1232
993
  const inputId = `identitySelector__item--${hex}`;
1233
994
  const labelId = `identitySelector__itemLabel--${hex}`;
1234
- return /* @__PURE__ */ React21.createElement("label", {
995
+ return /* @__PURE__ */ React17.createElement("label", {
1235
996
  htmlFor: inputId,
1236
997
  key: hex,
1237
998
  className: "flex items-center mbe-2 gap-2 cursor-pointer"
1238
- }, /* @__PURE__ */ React21.createElement(RadioGroup.Item, {
999
+ }, /* @__PURE__ */ React17.createElement(RadioGroup.Item, {
1239
1000
  id: inputId,
1240
1001
  "aria-labelledby": labelId,
1241
1002
  value: hex,
1242
- className: mx16("peer relative w-4 h-4 rounded-full", "border border-transparent text-white", "radix-state-checked:bg-primary-600", "radix-state-unchecked:bg-neutral-100 dark:radix-state-unchecked:bg-neutral-900", themeVariantFocus("os")),
1243
- "data-testid": "identity-selector-item"
1244
- }, /* @__PURE__ */ React21.createElement(RadioGroup.Indicator, {
1003
+ className: mx10("peer relative w-4 h-4 rounded-full", "border border-transparent text-white", "radix-state-checked:bg-primary-600", "radix-state-unchecked:bg-neutral-100 dark:radix-state-unchecked:bg-neutral-900", themeVariantFocus("os"))
1004
+ }, /* @__PURE__ */ React17.createElement(RadioGroup.Indicator, {
1245
1005
  className: "absolute inset-0 flex items-center justify-center leading-0"
1246
- }, /* @__PURE__ */ React21.createElement("div", {
1006
+ }, /* @__PURE__ */ React17.createElement("div", {
1247
1007
  className: "w-1.5 h-1.5 rounded-full bg-white"
1248
- }))), /* @__PURE__ */ React21.createElement(Avatar7, {
1008
+ }))), /* @__PURE__ */ React17.createElement(Avatar6, {
1249
1009
  fallbackValue: hex,
1250
1010
  labelId,
1251
1011
  variant: "circle"
1252
- }), /* @__PURE__ */ React21.createElement("span", {
1012
+ }), /* @__PURE__ */ React17.createElement("span", {
1253
1013
  id: labelId,
1254
- className: mx16(!displayName && "font-mono")
1014
+ className: mx10(!displayName && "font-mono")
1255
1015
  }, (_a = displayName != null ? displayName : identityKey.truncate()) != null ? _a : ""));
1256
- })), /* @__PURE__ */ React21.createElement(Button7, {
1016
+ })), /* @__PURE__ */ React17.createElement(Button6, {
1257
1017
  disabled,
1258
1018
  compact: true,
1259
1019
  onClick: () => dispatch({
1260
1020
  type: "add identity"
1261
1021
  }),
1262
- className: "flex items-center gap-2 pli-2",
1263
- "data-testid": "add-identity"
1264
- }, /* @__PURE__ */ React21.createElement("span", null, t("add identity label")), /* @__PURE__ */ React21.createElement(UserPlus2, {
1022
+ className: "flex items-center gap-2 pli-2"
1023
+ }, /* @__PURE__ */ React17.createElement("span", null, t("add identity label")), /* @__PURE__ */ React17.createElement(UserPlus, {
1265
1024
  weight: "bold",
1266
- className: getSize8(3.5)
1267
- })), /* @__PURE__ */ React21.createElement(Button7, {
1025
+ className: getSize7(3.5)
1026
+ })), /* @__PURE__ */ React17.createElement(Button6, {
1268
1027
  disabled: disabled || !activeIdentity,
1269
1028
  className: "flex items-center gap-2 pli-2",
1270
1029
  onClick: () => dispatch({
1271
1030
  type: "select identity",
1272
1031
  identity: activeIdentity
1273
- }),
1274
- "data-testid": "select-identity"
1275
- }, /* @__PURE__ */ React21.createElement(CaretLeft3, {
1032
+ })
1033
+ }, /* @__PURE__ */ React17.createElement(CaretLeft3, {
1276
1034
  weight: "bold",
1277
- className: mx16(getSize8(4), "invisible")
1278
- }), /* @__PURE__ */ React21.createElement("span", {
1035
+ className: mx10(getSize7(4), "invisible")
1036
+ }), /* @__PURE__ */ React17.createElement("span", {
1279
1037
  className: "grow"
1280
- }, t("continue label")), /* @__PURE__ */ React21.createElement(CaretRight3, {
1038
+ }, t("continue label")), /* @__PURE__ */ React17.createElement(CaretRight3, {
1281
1039
  weight: "bold",
1282
- className: getSize8(4)
1040
+ className: getSize7(4)
1283
1041
  })));
1284
1042
  };
1285
1043
 
1286
1044
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/IdentityInput.tsx
1287
1045
  import { CaretLeft as CaretLeft4, CaretRight as CaretRight4 } from "phosphor-react";
1288
- import React22, { useState as useState3 } from "react";
1289
- import { useClient as useClient4 } from "@dxos/react-client";
1290
- import { Button as Button8, getSize as getSize9, Input, mx as mx17, useTranslation as useTranslation12 } from "@dxos/react-components";
1291
- function _extends18() {
1292
- _extends18 = Object.assign || function(target) {
1046
+ import React18, { useState as useState3 } from "react";
1047
+ import { useClient as useClient3 } from "@dxos/react-client";
1048
+ import { Button as Button7, getSize as getSize8, Input, mx as mx11, useTranslation as useTranslation10 } from "@dxos/react-components";
1049
+ function _extends15() {
1050
+ _extends15 = Object.assign || function(target) {
1293
1051
  for (var i = 1; i < arguments.length; i++) {
1294
1052
  var source = arguments[i];
1295
1053
  for (var key in source) {
@@ -1300,14 +1058,14 @@ function _extends18() {
1300
1058
  }
1301
1059
  return target;
1302
1060
  };
1303
- return _extends18.apply(this, arguments);
1061
+ return _extends15.apply(this, arguments);
1304
1062
  }
1305
1063
  var IdentityInput = ({ method, ...viewStateProps }) => {
1306
1064
  const disabled = !viewStateProps.active;
1307
1065
  const { dispatch } = viewStateProps;
1308
- const { t } = useTranslation12("os");
1066
+ const { t } = useTranslation10("os");
1309
1067
  const [inputValue, setInputValue] = useState3("");
1310
- const client = useClient4();
1068
+ const client = useClient3();
1311
1069
  const [validationMessage, setValidationMessage] = useState3("");
1312
1070
  const isRecover = method === "recover identity";
1313
1071
  const handleNext = () => {
@@ -1322,9 +1080,9 @@ var IdentityInput = ({ method, ...viewStateProps }) => {
1322
1080
  setValidationMessage(t(isRecover ? "failed to recover identity message" : "failed to create identity message"));
1323
1081
  });
1324
1082
  };
1325
- return /* @__PURE__ */ React22.createElement(ViewState, _extends18({}, viewStateProps), /* @__PURE__ */ React22.createElement(Input, _extends18({
1083
+ return /* @__PURE__ */ React18.createElement(ViewState, _extends15({}, viewStateProps), /* @__PURE__ */ React18.createElement(Input, _extends15({
1326
1084
  disabled,
1327
- label: /* @__PURE__ */ React22.createElement(ViewStateHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
1085
+ label: /* @__PURE__ */ React18.createElement(ViewStateHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
1328
1086
  onChange: ({ target: { value } }) => setInputValue(value),
1329
1087
  slots: {
1330
1088
  root: {
@@ -1338,46 +1096,42 @@ var IdentityInput = ({ method, ...viewStateProps }) => {
1338
1096
  }, validationMessage.length && {
1339
1097
  validationValence: "error",
1340
1098
  validationMessage
1341
- }, {
1342
- "data-testid": "identity-input"
1343
- })), /* @__PURE__ */ React22.createElement("div", {
1099
+ })), /* @__PURE__ */ React18.createElement("div", {
1344
1100
  role: "none",
1345
1101
  className: "grow"
1346
- }), /* @__PURE__ */ React22.createElement("div", {
1102
+ }), /* @__PURE__ */ React18.createElement("div", {
1347
1103
  className: "flex gap-2"
1348
- }, /* @__PURE__ */ React22.createElement(Button8, {
1104
+ }, /* @__PURE__ */ React18.createElement(Button7, {
1349
1105
  disabled,
1350
1106
  className: "grow flex items-center gap-2 pli-2 order-2",
1351
- onClick: handleNext,
1352
- "data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-continue`
1353
- }, /* @__PURE__ */ React22.createElement(CaretLeft4, {
1107
+ onClick: handleNext
1108
+ }, /* @__PURE__ */ React18.createElement(CaretLeft4, {
1354
1109
  weight: "bold",
1355
- className: mx17(getSize9(2), "invisible")
1356
- }), /* @__PURE__ */ React22.createElement("span", {
1110
+ className: mx11(getSize8(2), "invisible")
1111
+ }), /* @__PURE__ */ React18.createElement("span", {
1357
1112
  className: "grow"
1358
- }, t("continue label")), /* @__PURE__ */ React22.createElement(CaretRight4, {
1113
+ }, t("continue label")), /* @__PURE__ */ React18.createElement(CaretRight4, {
1359
1114
  weight: "bold",
1360
- className: getSize9(4)
1361
- })), /* @__PURE__ */ React22.createElement(Button8, {
1115
+ className: getSize8(4)
1116
+ })), /* @__PURE__ */ React18.createElement(Button7, {
1362
1117
  disabled,
1363
1118
  onClick: () => dispatch({
1364
1119
  type: "add identity"
1365
1120
  }),
1366
- className: "flex items-center gap-2 pis-2 pie-4",
1367
- "data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-back`
1368
- }, /* @__PURE__ */ React22.createElement(CaretLeft4, {
1121
+ className: "flex items-center gap-2 pis-2 pie-4"
1122
+ }, /* @__PURE__ */ React18.createElement(CaretLeft4, {
1369
1123
  weight: "bold",
1370
- className: getSize9(4)
1371
- }), /* @__PURE__ */ React22.createElement("span", null, t("back label")))));
1124
+ className: getSize8(4)
1125
+ }), /* @__PURE__ */ React18.createElement("span", null, t("back label")))));
1372
1126
  };
1373
1127
 
1374
1128
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/InvitationAccepted.tsx
1375
- import { CaretLeft as CaretLeft5, Check as Check2 } from "phosphor-react";
1376
- import React23, { cloneElement as cloneElement4 } from "react";
1129
+ import { CaretLeft as CaretLeft5, Check } from "phosphor-react";
1130
+ import React19, { cloneElement as cloneElement2 } from "react";
1377
1131
  import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client";
1378
- import { Button as Button9, getSize as getSize10, mx as mx18, useTranslation as useTranslation13 } from "@dxos/react-components";
1379
- function _extends19() {
1380
- _extends19 = Object.assign || function(target) {
1132
+ import { Button as Button8, getSize as getSize9, mx as mx12, useTranslation as useTranslation11 } from "@dxos/react-components";
1133
+ function _extends16() {
1134
+ _extends16 = Object.assign || function(target) {
1381
1135
  for (var i = 1; i < arguments.length; i++) {
1382
1136
  var source = arguments[i];
1383
1137
  for (var key in source) {
@@ -1388,51 +1142,50 @@ function _extends19() {
1388
1142
  }
1389
1143
  return target;
1390
1144
  };
1391
- return _extends19.apply(this, arguments);
1145
+ return _extends16.apply(this, arguments);
1392
1146
  }
1393
1147
  var PureInvitationAcceptedContent = ({ onDone, result, invitationType, doneActionParent, active }) => {
1394
1148
  const disabled = !active;
1395
- const { t } = useTranslation13("os");
1396
- const doneButton = /* @__PURE__ */ React23.createElement(Button9, _extends19({}, onDone && {
1149
+ const { t } = useTranslation11("os");
1150
+ const doneButton = /* @__PURE__ */ React19.createElement(Button8, _extends16({}, onDone && {
1397
1151
  onClick: () => onDone(result)
1398
1152
  }, {
1399
1153
  disabled,
1400
1154
  className: "grow flex items-center gap-2 pli-2",
1401
- "data-autofocus": `${invitationType} invitation acceptor; invitation accepted`,
1402
- "data-testid": `${invitationType}-invitation-accepted-done`
1403
- }), /* @__PURE__ */ React23.createElement(CaretLeft5, {
1155
+ "data-autofocus": `${invitationType} invitation acceptor; invitation accepted`
1156
+ }), /* @__PURE__ */ React19.createElement(CaretLeft5, {
1404
1157
  weight: "bold",
1405
- className: mx18(getSize10(2), "invisible")
1406
- }), /* @__PURE__ */ React23.createElement("span", {
1158
+ className: mx12(getSize9(2), "invisible")
1159
+ }), /* @__PURE__ */ React19.createElement("span", {
1407
1160
  className: "grow"
1408
- }, t("done label")), /* @__PURE__ */ React23.createElement(Check2, {
1161
+ }, t("done label")), /* @__PURE__ */ React19.createElement(Check, {
1409
1162
  weight: "bold",
1410
- className: getSize10(4)
1163
+ className: getSize9(4)
1411
1164
  }));
1412
- return doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, doneButton) : doneButton;
1165
+ return doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneButton) : doneButton;
1413
1166
  };
1414
1167
  var InvitationAcceptedContent = (props) => {
1415
1168
  const { result } = useInvitationStatus3(props.activeInvitation);
1416
- return /* @__PURE__ */ React23.createElement(PureInvitationAcceptedContent, _extends19({}, props, {
1169
+ return /* @__PURE__ */ React19.createElement(PureInvitationAcceptedContent, _extends16({}, props, {
1417
1170
  result
1418
1171
  }));
1419
1172
  };
1420
1173
  var InvitationAccepted = (props) => {
1421
1174
  const { invitationType: _invitationType, doneActionParent: _doneActionParent, onDone: _onDone, ...viewStateProps } = props;
1422
1175
  const { activeInvitation } = viewStateProps;
1423
- return /* @__PURE__ */ React23.createElement(ViewState, _extends19({}, viewStateProps), !activeInvitation || activeInvitation === true ? /* @__PURE__ */ React23.createElement(PureInvitationAcceptedContent, _extends19({}, props, {
1176
+ return /* @__PURE__ */ React19.createElement(ViewState, _extends16({}, viewStateProps), !activeInvitation || activeInvitation === true ? /* @__PURE__ */ React19.createElement(PureInvitationAcceptedContent, _extends16({}, props, {
1424
1177
  result: null
1425
- })) : /* @__PURE__ */ React23.createElement(InvitationAcceptedContent, _extends19({}, props)));
1178
+ })) : /* @__PURE__ */ React19.createElement(InvitationAcceptedContent, _extends16({}, props)));
1426
1179
  };
1427
1180
 
1428
1181
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/InvitationInput.tsx
1429
1182
  import { CaretLeft as CaretLeft6, CaretRight as CaretRight5 } from "phosphor-react";
1430
- import React24, { useState as useState4 } from "react";
1183
+ import React20, { useState as useState4 } from "react";
1431
1184
  import { InvitationEncoder } from "@dxos/client";
1432
- import { useClient as useClient5 } from "@dxos/react-client";
1433
- import { Button as Button10, getSize as getSize11, Input as Input2, mx as mx19, useTranslation as useTranslation14 } from "@dxos/react-components";
1434
- function _extends20() {
1435
- _extends20 = Object.assign || function(target) {
1185
+ import { useClient as useClient4 } from "@dxos/react-client";
1186
+ import { Button as Button9, getSize as getSize10, Input as Input2, mx as mx13, useTranslation as useTranslation12 } from "@dxos/react-components";
1187
+ function _extends17() {
1188
+ _extends17 = Object.assign || function(target) {
1436
1189
  for (var i = 1; i < arguments.length; i++) {
1437
1190
  var source = arguments[i];
1438
1191
  for (var key in source) {
@@ -1443,22 +1196,22 @@ function _extends20() {
1443
1196
  }
1444
1197
  return target;
1445
1198
  };
1446
- return _extends20.apply(this, arguments);
1199
+ return _extends17.apply(this, arguments);
1447
1200
  }
1448
1201
  var InvitationInput = ({ invitationType, ...viewStateProps }) => {
1449
- const client = useClient5();
1202
+ const client = useClient4();
1450
1203
  const disabled = !viewStateProps.active;
1451
1204
  const { dispatch } = viewStateProps;
1452
- const { t } = useTranslation14("os");
1205
+ const { t } = useTranslation12("os");
1453
1206
  const [inputValue, setInputValue] = useState4("");
1454
1207
  const handleNext = () => dispatch({
1455
1208
  type: "connecting invitation",
1456
1209
  from: invitationType,
1457
1210
  invitation: client[invitationType === "halo" ? "halo" : "echo"].acceptInvitation(InvitationEncoder.decode(inputValue))
1458
1211
  });
1459
- return /* @__PURE__ */ React24.createElement(ViewState, _extends20({}, viewStateProps), /* @__PURE__ */ React24.createElement(Input2, {
1212
+ return /* @__PURE__ */ React20.createElement(ViewState, _extends17({}, viewStateProps), /* @__PURE__ */ React20.createElement(Input2, {
1460
1213
  disabled,
1461
- label: /* @__PURE__ */ React24.createElement(ViewStateHeading, null, t("invitation input label")),
1214
+ label: /* @__PURE__ */ React20.createElement(ViewStateHeading, null, t("invitation input label")),
1462
1215
  onChange: ({ target: { value } }) => setInputValue(value),
1463
1216
  slots: {
1464
1217
  root: {
@@ -1471,47 +1224,44 @@ var InvitationInput = ({ invitationType, ...viewStateProps }) => {
1471
1224
  "data-autofocus": `${invitationType} invitation acceptor; invitation input`,
1472
1225
  onKeyUp: ({ key }) => key === "Enter" && handleNext()
1473
1226
  }
1474
- },
1475
- "data-testid": "invitation-input"
1476
- }), /* @__PURE__ */ React24.createElement("div", {
1227
+ }
1228
+ }), /* @__PURE__ */ React20.createElement("div", {
1477
1229
  role: "none",
1478
1230
  className: "grow"
1479
- }), /* @__PURE__ */ React24.createElement("div", {
1231
+ }), /* @__PURE__ */ React20.createElement("div", {
1480
1232
  className: "flex gap-2"
1481
- }, /* @__PURE__ */ React24.createElement(Button10, {
1233
+ }, /* @__PURE__ */ React20.createElement(Button9, {
1482
1234
  disabled,
1483
1235
  className: "grow flex items-center gap-2 pli-2 order-2",
1484
- onClick: handleNext,
1485
- "data-testid": `${invitationType}-invitation-input-continue`
1486
- }, /* @__PURE__ */ React24.createElement(CaretLeft6, {
1236
+ onClick: handleNext
1237
+ }, /* @__PURE__ */ React20.createElement(CaretLeft6, {
1487
1238
  weight: "bold",
1488
- className: mx19(getSize11(2), "invisible")
1489
- }), /* @__PURE__ */ React24.createElement("span", {
1239
+ className: mx13(getSize10(2), "invisible")
1240
+ }), /* @__PURE__ */ React20.createElement("span", {
1490
1241
  className: "grow"
1491
- }, t("continue label")), /* @__PURE__ */ React24.createElement(CaretRight5, {
1242
+ }, t("continue label")), /* @__PURE__ */ React20.createElement(CaretRight5, {
1492
1243
  weight: "bold",
1493
- className: getSize11(4)
1494
- })), /* @__PURE__ */ React24.createElement(Button10, {
1244
+ className: getSize10(4)
1245
+ })), /* @__PURE__ */ React20.createElement(Button9, {
1495
1246
  disabled,
1496
1247
  onClick: () => dispatch({
1497
1248
  type: "add identity"
1498
1249
  }),
1499
- className: "flex items-center gap-2 pis-2 pie-4",
1500
- "data-testid": `${invitationType}-invitation-input-back`
1501
- }, /* @__PURE__ */ React24.createElement(CaretLeft6, {
1250
+ className: "flex items-center gap-2 pis-2 pie-4"
1251
+ }, /* @__PURE__ */ React20.createElement(CaretLeft6, {
1502
1252
  weight: "bold",
1503
- className: getSize11(4)
1504
- }), /* @__PURE__ */ React24.createElement("span", null, t("back label")))));
1253
+ className: getSize10(4)
1254
+ }), /* @__PURE__ */ React20.createElement("span", null, t("back label")))));
1505
1255
  };
1506
1256
 
1507
1257
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/InvitationRescuer.tsx
1508
1258
  import { ArrowsClockwise, CaretLeft as CaretLeft7, CaretRight as CaretRight6 } from "phosphor-react";
1509
- import React25 from "react";
1259
+ import React21 from "react";
1510
1260
  import { Invitation as Invitation5 } from "@dxos/client";
1511
1261
  import { useInvitationStatus as useInvitationStatus4 } from "@dxos/react-client";
1512
- import { Button as Button11, getSize as getSize12, mx as mx20, useTranslation as useTranslation15 } from "@dxos/react-components";
1513
- function _extends21() {
1514
- _extends21 = Object.assign || function(target) {
1262
+ import { Button as Button10, getSize as getSize11, mx as mx14, useTranslation as useTranslation13 } from "@dxos/react-components";
1263
+ function _extends18() {
1264
+ _extends18 = Object.assign || function(target) {
1515
1265
  for (var i = 1; i < arguments.length; i++) {
1516
1266
  var source = arguments[i];
1517
1267
  for (var key in source) {
@@ -1522,82 +1272,78 @@ function _extends21() {
1522
1272
  }
1523
1273
  return target;
1524
1274
  };
1525
- return _extends21.apply(this, arguments);
1275
+ return _extends18.apply(this, arguments);
1526
1276
  }
1527
1277
  var InvitationActions = ({ activeInvitation, disabled, dispatch, invitationType }) => {
1528
1278
  const { status, cancel } = useInvitationStatus4(activeInvitation);
1529
- const { t } = useTranslation15("os");
1279
+ const { t } = useTranslation13("os");
1530
1280
  switch (status) {
1531
1281
  case Invitation5.State.CONNECTING:
1532
- return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement("div", {
1282
+ return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("div", {
1533
1283
  role: "none",
1534
1284
  className: "grow"
1535
- }), /* @__PURE__ */ React25.createElement("div", {
1285
+ }), /* @__PURE__ */ React21.createElement("div", {
1536
1286
  className: "flex gap-2"
1537
- }, /* @__PURE__ */ React25.createElement(Button11, {
1287
+ }, /* @__PURE__ */ React21.createElement(Button10, {
1538
1288
  disabled: true,
1539
- className: "grow flex items-center gap-2 pli-2 order-2",
1540
- "data-testid": "next"
1541
- }, /* @__PURE__ */ React25.createElement(CaretLeft7, {
1289
+ className: "grow flex items-center gap-2 pli-2 order-2"
1290
+ }, /* @__PURE__ */ React21.createElement(CaretLeft7, {
1542
1291
  weight: "bold",
1543
- className: mx20(getSize12(2), "invisible")
1544
- }), /* @__PURE__ */ React25.createElement("span", {
1292
+ className: mx14(getSize11(2), "invisible")
1293
+ }), /* @__PURE__ */ React21.createElement("span", {
1545
1294
  className: "grow"
1546
- }, t("next label")), /* @__PURE__ */ React25.createElement(CaretRight6, {
1295
+ }, t("next label")), /* @__PURE__ */ React21.createElement(CaretRight6, {
1547
1296
  weight: "bold",
1548
- className: getSize12(4)
1549
- })), /* @__PURE__ */ React25.createElement(Button11, {
1297
+ className: getSize11(4)
1298
+ })), /* @__PURE__ */ React21.createElement(Button10, {
1550
1299
  disabled,
1551
1300
  className: "flex items-center gap-2 pis-2 pie-4",
1552
1301
  onClick: cancel,
1553
- "data-autofocus": `${invitationType} invitation acceptor; invitation rescuer`,
1554
- "data-testid": "invitation-rescuer-cancel"
1555
- }, /* @__PURE__ */ React25.createElement(CaretLeft7, {
1302
+ "data-autofocus": `${invitationType} invitation acceptor; invitation rescuer`
1303
+ }, /* @__PURE__ */ React21.createElement(CaretLeft7, {
1556
1304
  weight: "bold",
1557
- className: getSize12(4)
1558
- }), /* @__PURE__ */ React25.createElement("span", null, t("cancel label")))));
1305
+ className: getSize11(4)
1306
+ }), /* @__PURE__ */ React21.createElement("span", null, t("cancel label")))));
1559
1307
  case Invitation5.State.TIMEOUT:
1560
1308
  case Invitation5.State.CANCELLED:
1561
1309
  case Invitation5.State.ERROR:
1562
1310
  default:
1563
- return /* @__PURE__ */ React25.createElement(Button11, {
1311
+ return /* @__PURE__ */ React21.createElement(Button10, {
1564
1312
  disabled,
1565
1313
  className: "grow flex items-center gap-2 pli-2",
1566
1314
  onClick: () => dispatch({
1567
1315
  type: "reset invitation",
1568
1316
  from: invitationType
1569
1317
  }),
1570
- "data-autofocus": `${invitationType} invitation acceptor; invitation rescuer`,
1571
- "data-testid": "invitation-rescuer-reset"
1572
- }, /* @__PURE__ */ React25.createElement(CaretLeft7, {
1318
+ "data-autofocus": `${invitationType} invitation acceptor; invitation rescuer`
1319
+ }, /* @__PURE__ */ React21.createElement(CaretLeft7, {
1573
1320
  weight: "bold",
1574
- className: mx20(getSize12(5), "invisible")
1575
- }), /* @__PURE__ */ React25.createElement("span", {
1321
+ className: mx14(getSize11(5), "invisible")
1322
+ }), /* @__PURE__ */ React21.createElement("span", {
1576
1323
  className: "grow"
1577
- }, t("reset label")), /* @__PURE__ */ React25.createElement(ArrowsClockwise, {
1324
+ }, t("reset label")), /* @__PURE__ */ React21.createElement(ArrowsClockwise, {
1578
1325
  weight: "bold",
1579
- className: getSize12(5)
1326
+ className: getSize11(5)
1580
1327
  }));
1581
1328
  }
1582
1329
  };
1583
1330
  var InvitationRescuer = ({ invitationType, ...viewStateProps }) => {
1584
1331
  const disabled = !viewStateProps.active;
1585
1332
  const { dispatch, activeInvitation } = viewStateProps;
1586
- const { t } = useTranslation15("os");
1587
- return /* @__PURE__ */ React25.createElement(ViewState, _extends21({}, viewStateProps), activeInvitation === true || !activeInvitation ? /* @__PURE__ */ React25.createElement(Button11, {
1333
+ const { t } = useTranslation13("os");
1334
+ return /* @__PURE__ */ React21.createElement(ViewState, _extends18({}, viewStateProps), activeInvitation === true || !activeInvitation ? /* @__PURE__ */ React21.createElement(Button10, {
1588
1335
  disabled,
1589
1336
  className: "grow flex items-center gap-2 pli-2",
1590
- "data-autofocus": "space invitation acceptor; invitation rescuer",
1591
- "data-testid": "invitation-rescuer-connect"
1592
- }, /* @__PURE__ */ React25.createElement(CaretLeft7, {
1337
+ "data-autofocus": "space invitation acceptor; invitation rescuer"
1338
+ }, /* @__PURE__ */ React21.createElement(CaretLeft7, {
1593
1339
  weight: "bold",
1594
- className: mx20(getSize12(5), "invisible")
1595
- }), /* @__PURE__ */ React25.createElement("span", {
1340
+ className: mx14(getSize11(5), "invisible")
1341
+ }), /* @__PURE__ */ React21.createElement("span", {
1596
1342
  className: "grow"
1597
- }, t("connect label")), /* @__PURE__ */ React25.createElement(ArrowsClockwise, {
1343
+ }, t("connect label")), /* @__PURE__ */ React21.createElement(ArrowsClockwise, {
1598
1344
  weight: "bold",
1599
- className: getSize12(5)
1600
- })) : /* @__PURE__ */ React25.createElement(InvitationActions, _extends21({}, {
1345
+ className: getSize11(5)
1346
+ })) : /* @__PURE__ */ React21.createElement(InvitationActions, _extends18({}, {
1601
1347
  activeInvitation,
1602
1348
  disabled,
1603
1349
  dispatch,
@@ -1607,11 +1353,11 @@ var InvitationRescuer = ({ invitationType, ...viewStateProps }) => {
1607
1353
 
1608
1354
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx
1609
1355
  import { CaretLeft as CaretLeft8, CaretRight as CaretRight7 } from "phosphor-react";
1610
- import React26, { useCallback as useCallback5, useState as useState5 } from "react";
1356
+ import React22, { useCallback as useCallback5, useState as useState5 } from "react";
1611
1357
  import { useInvitationStatus as useInvitationStatus5 } from "@dxos/react-client";
1612
- import { Button as Button12, getSize as getSize13, Input as Input3, mx as mx21, useTranslation as useTranslation16 } from "@dxos/react-components";
1613
- function _extends22() {
1614
- _extends22 = Object.assign || function(target) {
1358
+ import { Button as Button11, getSize as getSize12, Input as Input3, mx as mx15, useTranslation as useTranslation14 } from "@dxos/react-components";
1359
+ function _extends19() {
1360
+ _extends19 = Object.assign || function(target) {
1615
1361
  for (var i = 1; i < arguments.length; i++) {
1616
1362
  var source = arguments[i];
1617
1363
  for (var key in source) {
@@ -1622,13 +1368,13 @@ function _extends22() {
1622
1368
  }
1623
1369
  return target;
1624
1370
  };
1625
- return _extends22.apply(this, arguments);
1371
+ return _extends19.apply(this, arguments);
1626
1372
  }
1627
1373
  var pinLength = 6;
1628
1374
  var PureInvitationAuthenticatorContent = ({ disabled, failed, dispatch, invitationType, onChange, onAuthenticate }) => {
1629
- const { t } = useTranslation16("os");
1630
- return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Input3, _extends22({
1631
- label: t("auth code input label"),
1375
+ const { t } = useTranslation14("os");
1376
+ return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Input3, _extends19({
1377
+ label: t("pin input label"),
1632
1378
  size: "pin",
1633
1379
  length: pinLength,
1634
1380
  onChange,
@@ -1653,39 +1399,35 @@ var PureInvitationAuthenticatorContent = ({ disabled, failed, dispatch, invitati
1653
1399
  }, failed && {
1654
1400
  validationValence: "error",
1655
1401
  validationMessage: t("failed to authenticate message")
1656
- }, {
1657
- "data-testid": "auth-code-input"
1658
- })), /* @__PURE__ */ React26.createElement("div", {
1402
+ })), /* @__PURE__ */ React22.createElement("div", {
1659
1403
  role: "none",
1660
1404
  className: "grow"
1661
- }), /* @__PURE__ */ React26.createElement("div", {
1405
+ }), /* @__PURE__ */ React22.createElement("div", {
1662
1406
  className: "flex gap-2"
1663
- }, /* @__PURE__ */ React26.createElement(Button12, {
1407
+ }, /* @__PURE__ */ React22.createElement(Button11, {
1664
1408
  disabled,
1665
1409
  className: "grow flex items-center gap-2 pli-2 order-2",
1666
1410
  onClick: onAuthenticate,
1667
- "data-autofocus-pinlength": invitationType,
1668
- "data-testid": `${invitationType}-invitation-authenticator-next`
1669
- }, /* @__PURE__ */ React26.createElement(CaretLeft8, {
1411
+ "data-autofocus-pinlength": invitationType
1412
+ }, /* @__PURE__ */ React22.createElement(CaretLeft8, {
1670
1413
  weight: "bold",
1671
- className: mx21(getSize13(2), "invisible")
1672
- }), /* @__PURE__ */ React26.createElement("span", {
1414
+ className: mx15(getSize12(2), "invisible")
1415
+ }), /* @__PURE__ */ React22.createElement("span", {
1673
1416
  className: "grow"
1674
- }, t("next label")), /* @__PURE__ */ React26.createElement(CaretRight7, {
1417
+ }, t("next label")), /* @__PURE__ */ React22.createElement(CaretRight7, {
1675
1418
  weight: "bold",
1676
- className: getSize13(4)
1677
- })), /* @__PURE__ */ React26.createElement(Button12, {
1419
+ className: getSize12(4)
1420
+ })), /* @__PURE__ */ React22.createElement(Button11, {
1678
1421
  disabled,
1679
1422
  className: "flex items-center gap-2 pis-2 pie-4",
1680
1423
  onClick: () => dispatch({
1681
1424
  type: "cancel invitation",
1682
1425
  from: invitationType
1683
- }),
1684
- "data-testid": `${invitationType}-invitation-authenticator-cancel`
1685
- }, /* @__PURE__ */ React26.createElement(CaretLeft8, {
1426
+ })
1427
+ }, /* @__PURE__ */ React22.createElement(CaretLeft8, {
1686
1428
  weight: "bold",
1687
- className: getSize13(4)
1688
- }), /* @__PURE__ */ React26.createElement("span", null, t("cancel label")))));
1429
+ className: getSize12(4)
1430
+ }), /* @__PURE__ */ React22.createElement("span", null, t("cancel label")))));
1689
1431
  };
1690
1432
  var InvitationAuthenticatorContent = ({ disabled, invitation, dispatch, invitationType, failed }) => {
1691
1433
  const [pinValue, setPinValue] = useState5("");
@@ -1712,7 +1454,7 @@ var InvitationAuthenticatorContent = ({ disabled, invitation, dispatch, invitati
1712
1454
  authenticate,
1713
1455
  pinValue
1714
1456
  ]);
1715
- return /* @__PURE__ */ React26.createElement(PureInvitationAuthenticatorContent, _extends22({}, {
1457
+ return /* @__PURE__ */ React22.createElement(PureInvitationAuthenticatorContent, _extends19({}, {
1716
1458
  disabled,
1717
1459
  failed,
1718
1460
  dispatch,
@@ -1724,7 +1466,7 @@ var InvitationAuthenticatorContent = ({ disabled, invitation, dispatch, invitati
1724
1466
  var InvitationAuthenticator = ({ invitationType, failed, ...viewStateProps }) => {
1725
1467
  const disabled = !viewStateProps.active;
1726
1468
  const { activeInvitation, dispatch } = viewStateProps;
1727
- return /* @__PURE__ */ React26.createElement(ViewState, _extends22({}, viewStateProps), !activeInvitation || activeInvitation === true ? /* @__PURE__ */ React26.createElement(PureInvitationAuthenticatorContent, _extends22({}, {
1469
+ return /* @__PURE__ */ React22.createElement(ViewState, _extends19({}, viewStateProps), !activeInvitation || activeInvitation === true ? /* @__PURE__ */ React22.createElement(PureInvitationAuthenticatorContent, _extends19({}, {
1728
1470
  disabled,
1729
1471
  failed,
1730
1472
  dispatch,
@@ -1733,7 +1475,7 @@ var InvitationAuthenticator = ({ invitationType, failed, ...viewStateProps }) =>
1733
1475
  },
1734
1476
  onAuthenticate: () => {
1735
1477
  }
1736
- })) : /* @__PURE__ */ React26.createElement(InvitationAuthenticatorContent, _extends22({}, {
1478
+ })) : /* @__PURE__ */ React22.createElement(InvitationAuthenticatorContent, _extends19({}, {
1737
1479
  disabled,
1738
1480
  failed,
1739
1481
  invitation: activeInvitation,
@@ -1743,8 +1485,8 @@ var InvitationAuthenticator = ({ invitationType, failed, ...viewStateProps }) =>
1743
1485
  };
1744
1486
 
1745
1487
  // packages/apps/patterns/react-ui/src/panels/JoinPanel/JoinPanel.tsx
1746
- function _extends23() {
1747
- _extends23 = Object.assign || function(target) {
1488
+ function _extends20() {
1489
+ _extends20 = Object.assign || function(target) {
1748
1490
  for (var i = 1; i < arguments.length; i++) {
1749
1491
  var source = arguments[i];
1750
1492
  for (var key in source) {
@@ -1755,14 +1497,13 @@ function _extends23() {
1755
1497
  }
1756
1498
  return target;
1757
1499
  };
1758
- return _extends23.apply(this, arguments);
1500
+ return _extends20.apply(this, arguments);
1759
1501
  }
1760
- var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActionParent, onExit, doneActionParent, onDone, preventExit }) => {
1761
- const client = useClient6();
1762
- const internalTitleId = useId4("joinPanel__title");
1502
+ var JoinPanel = ({ initialInvitationCode, titleId: propsTitleId, exitActionParent, onExit, doneActionParent, onDone }) => {
1503
+ const client = useClient5();
1504
+ const internalTitleId = useId3("joinPanel__title");
1763
1505
  const titleId = propsTitleId != null ? propsTitleId : internalTitleId;
1764
- const identity = useIdentity2();
1765
- const [prevIdentity, setPrevIdentity] = useState6(identity);
1506
+ const identity = useIdentity();
1766
1507
  const availableIdentities = identity ? [
1767
1508
  identity
1768
1509
  ] : [];
@@ -1783,7 +1524,7 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
1783
1524
  if (action.method === "accept device invitation") {
1784
1525
  nextState.activeView = "halo invitation acceptor";
1785
1526
  if (state.unredeemedHaloInvitationCode) {
1786
- nextState.haloInvitation = client.halo.acceptInvitation(InvitationEncoder2.decode(state.unredeemedHaloInvitationCode));
1527
+ nextState.haloInvitation = client.echo.acceptInvitation(InvitationEncoder2.decode(state.unredeemedHaloInvitationCode));
1787
1528
  nextState.unredeemedHaloInvitationCode = void 0;
1788
1529
  nextState.haloViewState = "invitation authenticator";
1789
1530
  } else {
@@ -1847,21 +1588,20 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
1847
1588
  nextState[action.from === "halo" ? "haloViewState" : "spaceViewState"] = "invitation input";
1848
1589
  break;
1849
1590
  }
1850
- log("[join panel reducer]", {
1591
+ log.debug("[join panel reducer]", {
1851
1592
  action,
1852
1593
  nextState
1853
1594
  }, {
1854
1595
  file: "JoinPanel.tsx",
1855
- line: 125,
1596
+ line: 123,
1856
1597
  scope: void 0,
1857
1598
  callSite: (f, a) => f(...a)
1858
1599
  });
1859
1600
  return nextState;
1860
1601
  };
1861
- const unredeemedHaloInvitationCode = mode === "halo-only" ? initialInvitationCode : void 0;
1862
- const [joinState, dispatch] = useReducer2(reducer, {
1863
- unredeemedHaloInvitationCode,
1864
- unredeemedSpaceInvitationCode: mode === "halo-only" ? void 0 : initialInvitationCode,
1602
+ const [joinState, dispatch] = useReducer(reducer, {
1603
+ unredeemedHaloInvitationCode: void 0,
1604
+ unredeemedSpaceInvitationCode: initialInvitationCode,
1865
1605
  spaceInvitation: void 0,
1866
1606
  haloInvitation: void 0,
1867
1607
  activeView: availableIdentities.length > 0 ? "identity selector" : "addition method selector",
@@ -1870,30 +1610,13 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
1870
1610
  spaceViewState: "invitation input",
1871
1611
  haloViewState: "invitation input"
1872
1612
  });
1873
- if (identity !== prevIdentity) {
1874
- setPrevIdentity(identity);
1875
- identity && !prevIdentity && dispatch({
1876
- type: "added identity",
1877
- identity
1878
- });
1879
- }
1880
- useEffect(() => {
1881
- if (unredeemedHaloInvitationCode) {
1882
- dispatch({
1883
- type: "select addition method",
1884
- method: "accept device invitation"
1885
- });
1886
- }
1887
- }, [
1888
- unredeemedHaloInvitationCode
1889
- ]);
1890
1613
  useEffect(() => {
1891
1614
  const attrValue = joinState.activeView === "identity input" ? `${joinState.activeView}; ${joinState.additionMethod}` : joinState.activeView === "space invitation acceptor" ? `${joinState.activeView}; ${joinState.spaceViewState}` : joinState.activeView === "halo invitation acceptor" ? `${joinState.activeView}; ${joinState.haloViewState}` : joinState.activeView;
1892
- log("[autofocus value]", {
1615
+ log.debug("[autofocus value]", {
1893
1616
  attrValue
1894
1617
  }, {
1895
1618
  file: "JoinPanel.tsx",
1896
- line: 163,
1619
+ line: 149,
1897
1620
  scope: void 0,
1898
1621
  callSite: (f, a) => f(...a)
1899
1622
  });
@@ -1968,47 +1691,45 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
1968
1691
  }, [
1969
1692
  joinState.haloInvitation
1970
1693
  ]);
1971
- return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(JoinHeading, _extends23({}, {
1972
- mode,
1694
+ return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(JoinHeading, _extends20({}, {
1973
1695
  titleId,
1974
1696
  invitation: joinState.spaceInvitation,
1975
1697
  onExit,
1976
- exitActionParent,
1977
- preventExit
1978
- })), /* @__PURE__ */ React27.createElement("div", {
1698
+ exitActionParent
1699
+ })), /* @__PURE__ */ React23.createElement("div", {
1979
1700
  role: "none",
1980
1701
  className: "is-full overflow-hidden"
1981
- }, /* @__PURE__ */ React27.createElement("div", {
1702
+ }, /* @__PURE__ */ React23.createElement("div", {
1982
1703
  role: "none",
1983
1704
  className: "flex is-[1300%]",
1984
1705
  "aria-live": "polite"
1985
- }, /* @__PURE__ */ React27.createElement(IdentitySelector, _extends23({}, {
1706
+ }, /* @__PURE__ */ React23.createElement(IdentitySelector, _extends20({}, {
1986
1707
  dispatch,
1987
1708
  availableIdentities,
1988
1709
  active: joinState.activeView === "identity selector"
1989
- })), /* @__PURE__ */ React27.createElement(AdditionMethodSelector, _extends23({}, {
1710
+ })), /* @__PURE__ */ React23.createElement(AdditionMethodSelector, _extends20({}, {
1990
1711
  dispatch,
1991
1712
  availableIdentities,
1992
1713
  active: joinState.activeView === "addition method selector"
1993
- })), /* @__PURE__ */ React27.createElement(IdentityInput, _extends23({}, {
1714
+ })), /* @__PURE__ */ React23.createElement(IdentityInput, _extends20({}, {
1994
1715
  dispatch,
1995
1716
  active: joinState.activeView === "identity input" && joinState.additionMethod === "create identity",
1996
1717
  method: "create identity"
1997
- })), /* @__PURE__ */ React27.createElement(IdentityInput, _extends23({}, {
1718
+ })), /* @__PURE__ */ React23.createElement(IdentityInput, _extends20({}, {
1998
1719
  dispatch,
1999
1720
  active: joinState.activeView === "identity input" && joinState.additionMethod === "recover identity",
2000
1721
  method: "recover identity"
2001
- })), /* @__PURE__ */ React27.createElement(InvitationInput, _extends23({}, {
1722
+ })), /* @__PURE__ */ React23.createElement(InvitationInput, _extends20({}, {
2002
1723
  dispatch,
2003
1724
  activeInvitation: joinState.haloInvitation || true,
2004
1725
  active: joinState.activeView === "halo invitation acceptor" && joinState.haloViewState === "invitation input",
2005
1726
  invitationType: "halo"
2006
- })), /* @__PURE__ */ React27.createElement(InvitationRescuer, _extends23({}, {
1727
+ })), /* @__PURE__ */ React23.createElement(InvitationRescuer, _extends20({}, {
2007
1728
  dispatch,
2008
1729
  activeInvitation: joinState.haloInvitation || true,
2009
1730
  active: joinState.activeView === "halo invitation acceptor" && joinState.haloViewState === "invitation rescuer",
2010
1731
  invitationType: "halo"
2011
- })), /* @__PURE__ */ React27.createElement(InvitationAuthenticator, _extends23({}, {
1732
+ })), /* @__PURE__ */ React23.createElement(InvitationAuthenticator, _extends20({}, {
2012
1733
  dispatch,
2013
1734
  activeInvitation: joinState.haloInvitation || true,
2014
1735
  active: joinState.activeView === "halo invitation acceptor" && joinState.haloViewState === "invitation authenticator",
@@ -2016,33 +1737,28 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
2016
1737
  ...joinState.spaceInvitationAnnotation === "authentication failed" && {
2017
1738
  failed: true
2018
1739
  }
2019
- })), /* @__PURE__ */ React27.createElement(InvitationAccepted, _extends23({}, {
1740
+ })), /* @__PURE__ */ React23.createElement(InvitationAccepted, _extends20({}, {
2020
1741
  dispatch,
2021
1742
  activeInvitation: joinState.haloInvitation || true,
2022
1743
  active: joinState.activeView === "halo invitation acceptor" && joinState.haloViewState === "invitation accepted",
2023
- invitationType: "halo",
2024
- doneActionParent,
2025
- onDone
2026
- })), /* @__PURE__ */ React27.createElement(IdentityAdded, _extends23({}, {
2027
- mode,
1744
+ invitationType: "halo"
1745
+ })), /* @__PURE__ */ React23.createElement(IdentityAdded, _extends20({}, {
2028
1746
  dispatch,
2029
1747
  addedIdentity: joinState.selectedIdentity,
2030
- active: joinState.activeView === "identity added",
2031
- doneActionParent,
2032
- onDone
2033
- })), /* @__PURE__ */ React27.createElement(InvitationInput, _extends23({}, {
1748
+ active: joinState.activeView === "identity added"
1749
+ })), /* @__PURE__ */ React23.createElement(InvitationInput, _extends20({}, {
2034
1750
  dispatch,
2035
1751
  activeInvitation: joinState.spaceInvitation || true,
2036
1752
  selectedIdentity: joinState.selectedIdentity,
2037
1753
  active: joinState.activeView === "space invitation acceptor" && joinState.spaceViewState === "invitation input",
2038
1754
  invitationType: "space"
2039
- })), /* @__PURE__ */ React27.createElement(InvitationRescuer, _extends23({}, {
1755
+ })), /* @__PURE__ */ React23.createElement(InvitationRescuer, _extends20({}, {
2040
1756
  dispatch,
2041
1757
  activeInvitation: joinState.spaceInvitation || true,
2042
1758
  selectedIdentity: joinState.selectedIdentity,
2043
1759
  active: joinState.activeView === "space invitation acceptor" && joinState.spaceViewState === "invitation rescuer",
2044
1760
  invitationType: "space"
2045
- })), /* @__PURE__ */ React27.createElement(InvitationAuthenticator, _extends23({}, {
1761
+ })), /* @__PURE__ */ React23.createElement(InvitationAuthenticator, _extends20({}, {
2046
1762
  dispatch,
2047
1763
  activeInvitation: joinState.spaceInvitation || true,
2048
1764
  selectedIdentity: joinState.selectedIdentity,
@@ -2051,7 +1767,7 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
2051
1767
  ...joinState.spaceInvitationAnnotation === "authentication failed" && {
2052
1768
  failed: true
2053
1769
  }
2054
- })), /* @__PURE__ */ React27.createElement(InvitationAccepted, _extends23({}, {
1770
+ })), /* @__PURE__ */ React23.createElement(InvitationAccepted, _extends20({}, {
2055
1771
  dispatch,
2056
1772
  activeInvitation: joinState.spaceInvitation || true,
2057
1773
  selectedIdentity: joinState.selectedIdentity,
@@ -2062,167 +1778,9 @@ var JoinPanel = ({ mode, initialInvitationCode, titleId: propsTitleId, exitActio
2062
1778
  })))));
2063
1779
  };
2064
1780
 
2065
- // packages/apps/patterns/react-ui/src/panels/SpacePanel/SpacePanel.tsx
2066
- import { CaretLeft as CaretLeft9, CaretRight as CaretRight8, Intersect, PlusCircle, UserPlus as UserPlus3 } from "phosphor-react";
2067
- import React28, { cloneElement as cloneElement5, useReducer as useReducer3 } from "react";
2068
- import { useClient as useClient7, useSpaceInvitations as useSpaceInvitations2, useSpaces } from "@dxos/react-client";
2069
- import { Button as Button13, getSize as getSize14, mx as mx22, Tooltip as Tooltip2, useTranslation as useTranslation17 } from "@dxos/react-components";
2070
- function _extends24() {
2071
- _extends24 = Object.assign || function(target) {
2072
- for (var i = 1; i < arguments.length; i++) {
2073
- var source = arguments[i];
2074
- for (var key in source) {
2075
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2076
- target[key] = source[key];
2077
- }
2078
- }
2079
- }
2080
- return target;
2081
- };
2082
- return _extends24.apply(this, arguments);
2083
- }
2084
- var CurrentSpaceView = ({ space, createInvitationUrl, onClickMember, onShowAll, titleId }) => {
2085
- const { t } = useTranslation17("os");
2086
- const invitations = useSpaceInvitations2(space == null ? void 0 : space.key);
2087
- const name = space == null ? void 0 : space.properties.name;
2088
- if (!space) {
2089
- return null;
2090
- }
2091
- return /* @__PURE__ */ React28.createElement("div", {
2092
- role: "none",
2093
- className: "flex flex-col"
2094
- }, /* @__PURE__ */ React28.createElement("div", {
2095
- role: "none",
2096
- className: mx22(subduedSurface, "rounded-bs-md flex items-center p-2 gap-2")
2097
- }, /* @__PURE__ */ React28.createElement(Tooltip2, {
2098
- content: t("show all spaces label"),
2099
- zIndex: "z-50"
2100
- }, /* @__PURE__ */ React28.createElement(Button13, {
2101
- compact: true,
2102
- variant: "ghost",
2103
- onClick: onShowAll,
2104
- "data-testid": "show-all-spaces"
2105
- }, /* @__PURE__ */ React28.createElement(CaretLeft9, {
2106
- className: getSize14(4),
2107
- weight: "bold"
2108
- }))), /* @__PURE__ */ React28.createElement("h2", {
2109
- id: titleId,
2110
- className: mx22("grow font-system-medium", !name && "font-mono")
2111
- }, name != null ? name : space.key.truncate())), /* @__PURE__ */ React28.createElement("div", {
2112
- role: "region",
2113
- className: mx22(defaultSurface, "rounded-be-md p-2")
2114
- }, /* @__PURE__ */ React28.createElement(InvitationList, {
2115
- invitations,
2116
- onClickRemove: ({ invitation }) => invitation && (space == null ? void 0 : space.removeInvitation(invitation.invitationId)),
2117
- createInvitationUrl
2118
- }), /* @__PURE__ */ React28.createElement(Button13, {
2119
- className: "is-full flex gap-2 mbs-2",
2120
- compact: true,
2121
- onClick: () => space == null ? void 0 : space.createInvitation(),
2122
- "data-testid": "create-space-invitation"
2123
- }, /* @__PURE__ */ React28.createElement("span", null, t("create space invitation label")), /* @__PURE__ */ React28.createElement(UserPlus3, {
2124
- className: getSize14(4),
2125
- weight: "bold"
2126
- })), /* @__PURE__ */ React28.createElement(PanelSeparator, null), /* @__PURE__ */ React28.createElement(SpaceMemberListContainer, {
2127
- spaceKey: space.key,
2128
- includeSelf: true,
2129
- onSelect: onClickMember
2130
- })));
2131
- };
2132
- var SpaceListView = ({ doneActionParent, onDone, onClickJoinSpace, onShowCurrent, titleId }) => {
2133
- const { t } = useTranslation17("os");
2134
- const client = useClient7();
2135
- const spaces = useSpaces();
2136
- const handleCreateSpace = async () => {
2137
- const space = await client.echo.createSpace();
2138
- onDone == null ? void 0 : onDone(space);
2139
- };
2140
- return /* @__PURE__ */ React28.createElement("div", {
2141
- role: "none",
2142
- className: "flex flex-col"
2143
- }, /* @__PURE__ */ React28.createElement("div", {
2144
- role: "none",
2145
- className: mx22(subduedSurface, "rounded-bs-md flex items-center p-2 gap-2")
2146
- }, /* @__PURE__ */ React28.createElement("h2", {
2147
- id: titleId,
2148
- className: "grow font-system-medium"
2149
- }, t("all spaces label")), /* @__PURE__ */ React28.createElement(Tooltip2, {
2150
- content: t("show current space label"),
2151
- zIndex: "z-50"
2152
- }, /* @__PURE__ */ React28.createElement(Button13, {
2153
- compact: true,
2154
- variant: "ghost",
2155
- onClick: onShowCurrent,
2156
- "data-testid": "show-current-space"
2157
- }, /* @__PURE__ */ React28.createElement(CaretRight8, {
2158
- className: getSize14(4),
2159
- weight: "bold"
2160
- })))), /* @__PURE__ */ React28.createElement("div", {
2161
- role: "region",
2162
- className: mx22(defaultSurface, "rounded-be-md p-2")
2163
- }, /* @__PURE__ */ React28.createElement("ul", {
2164
- className: "flex flex-col gap-2"
2165
- }, spaces.map((space) => {
2166
- const key = space.key.toHex();
2167
- const listItem = /* @__PURE__ */ React28.createElement(SpaceListItem, {
2168
- key,
2169
- space,
2170
- onClick: () => onDone == null ? void 0 : onDone(space)
2171
- });
2172
- return doneActionParent ? /* @__PURE__ */ cloneElement5(doneActionParent, {
2173
- key
2174
- }, listItem) : listItem;
2175
- })), /* @__PURE__ */ React28.createElement(Button13, {
2176
- className: "is-full flex gap-2 mbs-2",
2177
- compact: true,
2178
- onClick: handleCreateSpace,
2179
- "data-testid": "create-space"
2180
- }, /* @__PURE__ */ React28.createElement("span", null, t("create space label")), /* @__PURE__ */ React28.createElement(PlusCircle, {
2181
- className: getSize14(4),
2182
- weight: "bold"
2183
- })), onClickJoinSpace && /* @__PURE__ */ React28.createElement(Button13, {
2184
- className: "is-full flex gap-2 mbs-2",
2185
- compact: true,
2186
- onClick: () => onClickJoinSpace == null ? void 0 : onClickJoinSpace(),
2187
- "data-testid": "join-space"
2188
- }, /* @__PURE__ */ React28.createElement("span", null, t("join space label")), /* @__PURE__ */ React28.createElement(Intersect, {
2189
- className: getSize14(4),
2190
- weight: "bold"
2191
- }))));
2192
- };
2193
- var SpacePanel = (props) => {
2194
- var _a;
2195
- const reducer = (state, action) => {
2196
- const nextState = {
2197
- ...state
2198
- };
2199
- switch (action.type) {
2200
- case "deselect space":
2201
- nextState.activeView = "space list";
2202
- break;
2203
- case "select space":
2204
- nextState.activeView = "current space";
2205
- break;
2206
- }
2207
- return nextState;
2208
- };
2209
- const [panelState, dispatch] = useReducer3(reducer, {
2210
- activeView: (_a = props.initialState) != null ? _a : "current space"
2211
- });
2212
- return /* @__PURE__ */ React28.createElement(React28.Fragment, null, panelState.activeView === "current space" ? /* @__PURE__ */ React28.createElement(CurrentSpaceView, _extends24({}, props, {
2213
- onShowAll: () => dispatch({
2214
- type: "deselect space"
2215
- })
2216
- })) : /* @__PURE__ */ React28.createElement(SpaceListView, _extends24({}, props, {
2217
- onShowCurrent: () => dispatch({
2218
- type: "select space"
2219
- })
2220
- })));
2221
- };
2222
-
2223
1781
  // packages/apps/patterns/react-ui/src/composites/IdentityPopover/IdentityPopover.tsx
2224
- function _extends25() {
2225
- _extends25 = Object.assign || function(target) {
1782
+ function _extends21() {
1783
+ _extends21 = Object.assign || function(target) {
2226
1784
  for (var i = 1; i < arguments.length; i++) {
2227
1785
  var source = arguments[i];
2228
1786
  for (var key in source) {
@@ -2233,12 +1791,12 @@ function _extends25() {
2233
1791
  }
2234
1792
  return target;
2235
1793
  };
2236
- return _extends25.apply(this, arguments);
1794
+ return _extends21.apply(this, arguments);
2237
1795
  }
2238
1796
  var IdentityPopover = ({ identity, openTrigger, slots, triggerIsInToolbar = true, onClickManageProfile, ...popoverProps }) => {
2239
1797
  var _a, _b;
2240
- return /* @__PURE__ */ React29.createElement(PanelPopover, _extends25({}, popoverProps, {
2241
- openTrigger: openTrigger != null ? openTrigger : /* @__PURE__ */ React29.createElement(Avatar8, {
1798
+ return /* @__PURE__ */ React24.createElement(PanelPopover, _extends21({}, popoverProps, {
1799
+ openTrigger: openTrigger != null ? openTrigger : /* @__PURE__ */ React24.createElement(Avatar7, {
2242
1800
  size: 10,
2243
1801
  variant: "circle",
2244
1802
  fallbackValue: identity.identityKey.toHex(),
@@ -2248,11 +1806,11 @@ var IdentityPopover = ({ identity, openTrigger, slots, triggerIsInToolbar = true
2248
1806
  ...slots,
2249
1807
  trigger: {
2250
1808
  ...slots == null ? void 0 : slots.trigger,
2251
- className: mx23("flex justify-self-end pointer-events-auto bg-white dark:bg-neutral-700 p-0.5 button-elevation rounded-full", (_b = slots == null ? void 0 : slots.trigger) == null ? void 0 : _b.className)
1809
+ className: mx16("flex justify-self-end pointer-events-auto bg-white dark:bg-neutral-700 p-0.5 button-elevation rounded-full", (_b = slots == null ? void 0 : slots.trigger) == null ? void 0 : _b.className)
2252
1810
  }
2253
1811
  },
2254
1812
  triggerIsInToolbar
2255
- }), /* @__PURE__ */ React29.createElement(IdentityPanel, _extends25({}, {
1813
+ }), /* @__PURE__ */ React24.createElement(IdentityPanel, _extends21({}, {
2256
1814
  identity,
2257
1815
  onClickManageProfile
2258
1816
  })));
@@ -2260,10 +1818,10 @@ var IdentityPopover = ({ identity, openTrigger, slots, triggerIsInToolbar = true
2260
1818
 
2261
1819
  // packages/apps/patterns/react-ui/src/composites/JoinDialog/JoinDialog.tsx
2262
1820
  import { Action, Cancel } from "@radix-ui/react-alert-dialog";
2263
- import React30 from "react";
2264
- import { ThemeContext as ThemeContext2, useId as useId5 } from "@dxos/react-components";
2265
- function _extends26() {
2266
- _extends26 = Object.assign || function(target) {
1821
+ import React25 from "react";
1822
+ import { ThemeContext as ThemeContext2, useId as useId4 } from "@dxos/react-components";
1823
+ function _extends22() {
1824
+ _extends22 = Object.assign || function(target) {
2267
1825
  for (var i = 1; i < arguments.length; i++) {
2268
1826
  var source = arguments[i];
2269
1827
  for (var key in source) {
@@ -2274,207 +1832,29 @@ function _extends26() {
2274
1832
  }
2275
1833
  return target;
2276
1834
  };
2277
- return _extends26.apply(this, arguments);
1835
+ return _extends22.apply(this, arguments);
2278
1836
  }
2279
1837
  var JoinDialog = ({ slots, ...joinPanelProps }) => {
2280
- const titleId = useId5("joinDialog__title");
2281
- return /* @__PURE__ */ React30.createElement(PanelAlertDialog, _extends26({}, {
1838
+ const titleId = useId4("joinDialog__title");
1839
+ return /* @__PURE__ */ React25.createElement(PanelAlertDialog, _extends22({}, {
2282
1840
  slots,
2283
1841
  titleId
2284
- }), /* @__PURE__ */ React30.createElement(ThemeContext2.Provider, {
1842
+ }), /* @__PURE__ */ React25.createElement(ThemeContext2.Provider, {
2285
1843
  value: {
2286
1844
  themeVariant: "os"
2287
1845
  }
2288
- }, /* @__PURE__ */ React30.createElement(JoinPanel, _extends26({}, {
1846
+ }, /* @__PURE__ */ React25.createElement(JoinPanel, _extends22({}, {
2289
1847
  ...joinPanelProps,
2290
1848
  titleId,
2291
- exitActionParent: /* @__PURE__ */ React30.createElement(Cancel, {
1849
+ exitActionParent: /* @__PURE__ */ React25.createElement(Cancel, {
2292
1850
  asChild: true
2293
1851
  }),
2294
- doneActionParent: /* @__PURE__ */ React30.createElement(Action, {
1852
+ doneActionParent: /* @__PURE__ */ React25.createElement(Action, {
2295
1853
  asChild: true
2296
1854
  })
2297
1855
  }))));
2298
1856
  };
2299
1857
 
2300
- // packages/apps/patterns/react-ui/src/composites/Shell/Shell.tsx
2301
- import React33, { useEffect as useEffect2, useState as useState7 } from "react";
2302
- import { ShellDisplay, ShellLayout } from "@dxos/protocols/proto/dxos/iframe";
2303
- import { useClient as useClient8, useSpace as useSpace3, useSpaces as useSpaces2 } from "@dxos/react-client";
2304
-
2305
- // packages/apps/patterns/react-ui/src/composites/DevicesDialog/DevicesDialog.tsx
2306
- import { Close } from "@radix-ui/react-dialog";
2307
- import React31 from "react";
2308
- import { ThemeContext as ThemeContext3, useId as useId6 } from "@dxos/react-components";
2309
- function _extends27() {
2310
- _extends27 = Object.assign || function(target) {
2311
- for (var i = 1; i < arguments.length; i++) {
2312
- var source = arguments[i];
2313
- for (var key in source) {
2314
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2315
- target[key] = source[key];
2316
- }
2317
- }
2318
- }
2319
- return target;
2320
- };
2321
- return _extends27.apply(this, arguments);
2322
- }
2323
- var DevicesDialog = ({ slots, ...devicesDialogProps }) => {
2324
- const titleId = useId6("spaceDialog__title");
2325
- return /* @__PURE__ */ React31.createElement(PanelDialog, _extends27({}, {
2326
- slots: {
2327
- ...slots,
2328
- root: {
2329
- onOpenChange: (open) => {
2330
- var _a;
2331
- return open || ((_a = devicesDialogProps.onDone) == null ? void 0 : _a.call(devicesDialogProps));
2332
- },
2333
- ...slots == null ? void 0 : slots.root
2334
- }
2335
- },
2336
- titleId
2337
- }), /* @__PURE__ */ React31.createElement(ThemeContext3.Provider, {
2338
- value: {
2339
- themeVariant: "os"
2340
- }
2341
- }, /* @__PURE__ */ React31.createElement(DevicesPanel, _extends27({}, {
2342
- ...devicesDialogProps,
2343
- titleId,
2344
- doneActionParent: /* @__PURE__ */ React31.createElement(Close, {
2345
- asChild: true
2346
- })
2347
- }))));
2348
- };
2349
-
2350
- // packages/apps/patterns/react-ui/src/composites/SpaceDialog/SpaceDialog.tsx
2351
- import { Close as Close2 } from "@radix-ui/react-dialog";
2352
- import React32 from "react";
2353
- import { ThemeContext as ThemeContext4, useId as useId7 } from "@dxos/react-components";
2354
- function _extends28() {
2355
- _extends28 = Object.assign || function(target) {
2356
- for (var i = 1; i < arguments.length; i++) {
2357
- var source = arguments[i];
2358
- for (var key in source) {
2359
- if (Object.prototype.hasOwnProperty.call(source, key)) {
2360
- target[key] = source[key];
2361
- }
2362
- }
2363
- }
2364
- return target;
2365
- };
2366
- return _extends28.apply(this, arguments);
2367
- }
2368
- var SpaceDialog = ({ slots, ...spacePanelProps }) => {
2369
- const titleId = useId7("spaceDialog__title");
2370
- return /* @__PURE__ */ React32.createElement(PanelDialog, _extends28({}, {
2371
- slots: {
2372
- ...slots,
2373
- root: {
2374
- onOpenChange: (open) => {
2375
- var _a;
2376
- return open || ((_a = spacePanelProps.onDone) == null ? void 0 : _a.call(spacePanelProps, null));
2377
- },
2378
- ...slots == null ? void 0 : slots.root
2379
- }
2380
- },
2381
- titleId
2382
- }), /* @__PURE__ */ React32.createElement(ThemeContext4.Provider, {
2383
- value: {
2384
- themeVariant: "os"
2385
- }
2386
- }, /* @__PURE__ */ React32.createElement(SpacePanel, _extends28({}, {
2387
- ...spacePanelProps,
2388
- titleId,
2389
- doneActionParent: /* @__PURE__ */ React32.createElement(Close2, {
2390
- asChild: true
2391
- })
2392
- }))));
2393
- };
2394
-
2395
- // packages/apps/patterns/react-ui/src/composites/Shell/Shell.tsx
2396
- var Shell = ({ runtime, origin }) => {
2397
- const [{ layout, invitationCode, spaceKey }, setLayout] = useState7({
2398
- layout: runtime.layout,
2399
- invitationCode: runtime.invitationCode,
2400
- spaceKey: runtime.spaceKey
2401
- });
2402
- const client = useClient8();
2403
- const spaces = useSpaces2();
2404
- const space = useSpace3(spaceKey);
2405
- useEffect2(() => {
2406
- return runtime.layoutUpdate.on((request) => setLayout(request));
2407
- }, []);
2408
- switch (layout) {
2409
- case ShellLayout.AUTH:
2410
- return /* @__PURE__ */ React33.createElement(JoinDialog, {
2411
- mode: "halo-only",
2412
- initialInvitationCode: invitationCode,
2413
- onDone: async () => {
2414
- var _a;
2415
- const space2 = (_a = spaces[0]) != null ? _a : await client.echo.createSpace();
2416
- await runtime.setAppContext({
2417
- display: ShellDisplay.NONE,
2418
- spaceKey: space2.key
2419
- });
2420
- runtime.setLayout(ShellLayout.DEFAULT);
2421
- }
2422
- });
2423
- case ShellLayout.CURRENT_SPACE:
2424
- case ShellLayout.SPACE_LIST:
2425
- return /* @__PURE__ */ React33.createElement(SpaceDialog, {
2426
- space,
2427
- initialState: layout === ShellLayout.SPACE_LIST ? "space list" : "current space",
2428
- createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
2429
- onClickJoinSpace: () => runtime.setLayout(ShellLayout.JOIN_SPACE, {
2430
- spaceKey: space == null ? void 0 : space.key
2431
- }),
2432
- onClickMember: () => runtime.setLayout(ShellLayout.DEVICES_LIST, {
2433
- spaceKey: space == null ? void 0 : space.key
2434
- }),
2435
- onDone: async (space2) => {
2436
- await runtime.setAppContext({
2437
- display: ShellDisplay.NONE,
2438
- spaceKey: space2 ? space2.key : spaceKey
2439
- });
2440
- runtime.setLayout(ShellLayout.DEFAULT);
2441
- }
2442
- });
2443
- case ShellLayout.JOIN_SPACE:
2444
- return /* @__PURE__ */ React33.createElement(JoinDialog, {
2445
- initialInvitationCode: invitationCode,
2446
- onDone: async (result) => {
2447
- var _a;
2448
- await runtime.setAppContext({
2449
- display: ShellDisplay.NONE,
2450
- spaceKey: (_a = result == null ? void 0 : result.spaceKey) != null ? _a : void 0
2451
- });
2452
- runtime.setLayout(ShellLayout.DEFAULT);
2453
- },
2454
- onExit: async () => {
2455
- await runtime.setAppContext({
2456
- display: ShellDisplay.NONE,
2457
- spaceKey: runtime.spaceKey
2458
- });
2459
- runtime.setLayout(ShellLayout.DEFAULT);
2460
- }
2461
- });
2462
- case ShellLayout.DEVICES_LIST:
2463
- return /* @__PURE__ */ React33.createElement(DevicesDialog, {
2464
- createInvitationUrl: (invitationCode2) => `${origin}?haloInvitationCode=${invitationCode2}`,
2465
- onDone: async () => {
2466
- await runtime.setAppContext({
2467
- display: ShellDisplay.NONE,
2468
- spaceKey: runtime.spaceKey
2469
- });
2470
- runtime.setLayout(ShellLayout.DEFAULT);
2471
- }
2472
- });
2473
- default:
2474
- return null;
2475
- }
2476
- };
2477
-
2478
1858
  // packages/apps/patterns/react-ui/src/translations/locales/en-US.ts
2479
1859
  var en_US_exports = {};
2480
1860
  __export(en_US_exports, {
@@ -2486,9 +1866,7 @@ var os = {
2486
1866
  "sidebar label": "DXOS sidebar",
2487
1867
  "copy invitation code label": "Copy",
2488
1868
  "open share panel label": "Share",
2489
- "joining heading": "<small>Joining</small><large>{{name}}</large>",
2490
- "join space heading": "Join a space",
2491
- "halo heading": "Initialize device identity",
1869
+ "join space heading": "<small>Joining</small><large>{{spaceTitle}}</large>",
2492
1870
  "exit label": "Exit",
2493
1871
  "identity selector title": "Join as",
2494
1872
  "identity radio group title": "Select an identity you\u2019ve associated with this device already",
@@ -2496,7 +1874,6 @@ var os = {
2496
1874
  "continue label": "Continue",
2497
1875
  "back label": "Back",
2498
1876
  "next label": "Next",
2499
- "close label": "Close",
2500
1877
  "auth choices label": "Choose an identity",
2501
1878
  "create identity label": "Create an identity",
2502
1879
  "create identity description": "Create a new identity.",
@@ -2526,16 +1903,8 @@ var os = {
2526
1903
  "cancel label": "Cancel",
2527
1904
  "done label": "Done",
2528
1905
  "reset label": "Start over",
2529
- "auth code input label": "Auth code provided by the invitation sender",
2530
- "invitation input label": "Paste an invitation code or URL",
2531
- "create space invitation label": "Invite",
2532
- "qr label": "Scan to accept invitation",
2533
- "empty invitations message": "No pending invitations",
2534
- "show all spaces label": "All spaces",
2535
- "all spaces label": "All spaces",
2536
- "create space label": "Create a new space",
2537
- "join space label": "Join a space",
2538
- "show current space label": "Current space"
1906
+ "pin input label": "The PIN provided by the invitation sender",
1907
+ "invitation input label": "Paste an invitation code or URL"
2539
1908
  };
2540
1909
 
2541
1910
  // packages/apps/patterns/react-ui/src/translations/index.ts
@@ -2543,8 +1912,6 @@ var osTranslations = {
2543
1912
  "en-US": en_US_exports
2544
1913
  };
2545
1914
  export {
2546
- DeviceList,
2547
- DevicesPanel,
2548
1915
  IdentityListItem,
2549
1916
  IdentityPanel,
2550
1917
  IdentityPopover,
@@ -2555,17 +1922,12 @@ export {
2555
1922
  JoinDialog,
2556
1923
  JoinPanel,
2557
1924
  PanelAlertDialog,
2558
- PanelDialog,
2559
1925
  PanelPopover,
2560
1926
  PanelSeparator,
2561
1927
  PanelSidebarContext,
2562
1928
  PanelSidebarProvider,
2563
- Shell,
2564
- SpaceDialog,
2565
- SpaceListItem,
2566
1929
  SpaceMemberList,
2567
1930
  SpaceMemberListContainer,
2568
- SpacePanel,
2569
1931
  activeBgColor,
2570
1932
  activeStrokeColor,
2571
1933
  activeTextColor,
@@ -2573,8 +1935,6 @@ export {
2573
1935
  cancelledStrokeColor,
2574
1936
  cancelledTextColor,
2575
1937
  defaultArrow,
2576
- defaultDialogContent,
2577
- defaultOverlay,
2578
1938
  defaultSurface,
2579
1939
  errorBgColor,
2580
1940
  errorStrokeColor,