@dxos/shell 0.4.4-main.fcf0b00 → 0.4.4-next.e0df51e

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 (46) hide show
  1. package/dist/bundle/shell.mjs +922 -880
  2. package/dist/bundle/shell.mjs.map +1 -1
  3. package/dist/bundle/shell.umd.js +27 -27
  4. package/dist/bundle/shell.umd.js.map +1 -1
  5. package/dist/bundle/style.css +1 -1
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/browser/react.mjs +46 -29
  8. package/dist/lib/browser/react.mjs.map +3 -3
  9. package/dist/types/src/components/Clipboard/CopyButton.js +3 -3
  10. package/dist/types/src/components/Clipboard/CopyButton.js.map +1 -1
  11. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts +3 -1
  12. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -1
  13. package/dist/types/src/components/IdentityList/IdentityListItem.js +3 -3
  14. package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -1
  15. package/dist/types/src/components/InvitationList/InvitationListItem.d.ts +8 -5
  16. package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
  17. package/dist/types/src/components/InvitationList/InvitationListItem.js +10 -10
  18. package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
  19. package/dist/types/src/components/Panel/Action.js +3 -3
  20. package/dist/types/src/components/Panel/Action.js.map +1 -1
  21. package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +1 -1
  22. package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts +2 -1
  23. package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts.map +1 -1
  24. package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +6 -3
  25. package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +1 -1
  26. package/dist/types/src/panels/SpacePanel/SpacePanel.js +1 -1
  27. package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
  28. package/dist/types/src/react.d.ts +1 -0
  29. package/dist/types/src/react.d.ts.map +1 -1
  30. package/dist/types/src/react.js +1 -0
  31. package/dist/types/src/react.js.map +1 -1
  32. package/dist/types/src/stories/Invitations.e2e-stories.js +1 -1
  33. package/dist/types/src/translations/locales/en-US.d.ts +1 -0
  34. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  35. package/dist/types/src/translations/locales/en-US.js +1 -0
  36. package/dist/types/src/translations/locales/en-US.js.map +1 -1
  37. package/package.json +19 -19
  38. package/src/components/Clipboard/CopyButton.tsx +3 -3
  39. package/src/components/IdentityList/IdentityListItem.tsx +28 -26
  40. package/src/components/InvitationList/InvitationListItem.tsx +42 -15
  41. package/src/components/Panel/Action.tsx +3 -3
  42. package/src/panels/JoinPanel/steps/ResetIdentity.tsx +13 -4
  43. package/src/panels/SpacePanel/SpacePanel.tsx +1 -1
  44. package/src/react.ts +1 -0
  45. package/src/stories/Invitations.e2e-stories.tsx +1 -1
  46. package/src/translations/locales/en-US.ts +1 -0
@@ -50,8 +50,7 @@ var CopyButton = ({ value, classNames, iconProps, ...props }) => {
50
50
  }, /* @__PURE__ */ React2.createElement("span", {
51
51
  className: "pli-1"
52
52
  }, t("copy invitation code label")), /* @__PURE__ */ React2.createElement(Copy, {
53
- className: getSize(4),
54
- weight: "bold",
53
+ className: getSize(5),
55
54
  ...iconProps
56
55
  })), /* @__PURE__ */ React2.createElement("div", {
57
56
  role: "none",
@@ -59,8 +58,7 @@ var CopyButton = ({ value, classNames, iconProps, ...props }) => {
59
58
  }, /* @__PURE__ */ React2.createElement("span", {
60
59
  className: "pli-1"
61
60
  }, t("copy invitation code success label")), /* @__PURE__ */ React2.createElement(Check, {
62
- className: getSize(4),
63
- weight: "bold",
61
+ className: getSize(5),
64
62
  ...iconProps
65
63
  })));
66
64
  };
@@ -92,7 +90,6 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
92
90
  ]
93
91
  }, /* @__PURE__ */ React2.createElement(Copy, {
94
92
  className: getSize(5),
95
- weight: "bold",
96
93
  ...iconProps
97
94
  }))));
98
95
  };
@@ -154,13 +151,14 @@ import { generateName } from "@dxos/display-name";
154
151
  import { SpaceMember } from "@dxos/react-client/echo";
155
152
  import { ListItem, Avatar, useJdenticonHref, useId as useId2 } from "@dxos/react-ui";
156
153
  import { mx as mx3 } from "@dxos/react-ui-theme";
157
- var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick }, forwardedRef) => {
154
+ var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick, classNames, ...props }, forwardedRef) => {
158
155
  const fallbackValue = identity.identityKey.toHex();
159
156
  const labelId = useId2("identityListItem__label");
160
157
  const jdenticon = useJdenticonHref(fallbackValue ?? "", 12);
161
158
  const displayName = identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
162
159
  return /* @__PURE__ */ React4.createElement(ListItem.Root, {
163
- classNames: mx3("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer"),
160
+ ...props,
161
+ classNames: mx3("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer", classNames),
164
162
  onClick: () => onClick?.(),
165
163
  "data-testid": "identity-list-item",
166
164
  labelId,
@@ -168,7 +166,9 @@ var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick
168
166
  }, /* @__PURE__ */ React4.createElement(Avatar.Root, {
169
167
  status: presence === SpaceMember.PresenceState.ONLINE ? "active" : "inactive",
170
168
  labelId
171
- }, /* @__PURE__ */ React4.createElement(Avatar.Frame, null, /* @__PURE__ */ React4.createElement(Avatar.Fallback, {
169
+ }, /* @__PURE__ */ React4.createElement(Avatar.Frame, {
170
+ classNames: "place-self-center"
171
+ }, /* @__PURE__ */ React4.createElement(Avatar.Fallback, {
172
172
  href: jdenticon
173
173
  })), /* @__PURE__ */ React4.createElement(Avatar.Label, {
174
174
  classNames: "text-sm truncate pli-2"
@@ -335,11 +335,11 @@ var avatarProps = {
335
335
  size: 10,
336
336
  variant: "circle"
337
337
  };
338
- var AvatarStackEffect = ({ animation, status }) => {
338
+ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
339
339
  const { tx } = useThemeContext2();
340
340
  return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("span", {
341
341
  role: "none",
342
- className: mx7("absolute inline-start-1 inline-end-auto opacity-20", getSize2(avatarProps.size))
342
+ className: mx7("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1", getSize2(avatarProps.size))
343
343
  }, /* @__PURE__ */ React8.createElement("span", {
344
344
  role: "none",
345
345
  className: tx("avatar.ring", "avatar__ring", {
@@ -352,7 +352,7 @@ var AvatarStackEffect = ({ animation, status }) => {
352
352
  }
353
353
  })), /* @__PURE__ */ React8.createElement("span", {
354
354
  role: "none",
355
- className: mx7("absolute inline-start-2 inline-end-auto opacity-50", getSize2(avatarProps.size))
355
+ className: mx7("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2", getSize2(avatarProps.size))
356
356
  }, /* @__PURE__ */ React8.createElement("span", {
357
357
  role: "none",
358
358
  className: tx("avatar.ring", "avatar__ring", {
@@ -365,7 +365,7 @@ var AvatarStackEffect = ({ animation, status }) => {
365
365
  }
366
366
  })));
367
367
  };
368
- var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl }) => {
368
+ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
369
369
  const { t } = useTranslation4("os");
370
370
  const { cancel, status: invitationStatus, invitationCode, authCode, type } = propsInvitationStatus;
371
371
  const isCancellable = !([
@@ -406,12 +406,17 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
406
406
  const avatarStatus = avatarError ? "error" : avatarGreen ? "active" : "inactive";
407
407
  return /* @__PURE__ */ React8.createElement(ListItem2.Root, {
408
408
  id: invitationCode,
409
- classNames: "flex gap-2 pis-3 pie-1 items-center relative"
409
+ ...props,
410
+ classNames: [
411
+ "flex gap-2 pis-3 pie-1 items-center relative",
412
+ props.classNames
413
+ ]
410
414
  }, /* @__PURE__ */ React8.createElement(ListItem2.Heading, {
411
415
  classNames: "sr-only"
412
416
  }, t(type === Invitation2.Type.MULTIUSE ? "invite many list item label" : "invite one list item label")), type === Invitation2.Type.MULTIUSE && /* @__PURE__ */ React8.createElement(AvatarStackEffect, {
413
417
  status: avatarStatus,
414
- animation: avatarAnimation
418
+ animation: avatarAnimation,
419
+ reverseEffects
415
420
  }), /* @__PURE__ */ React8.createElement(Tooltip2.Root, null, /* @__PURE__ */ React8.createElement(Avatar2.Root, {
416
421
  ...avatarProps,
417
422
  animation: avatarAnimation,
@@ -422,7 +427,7 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
422
427
  tabIndex: 0,
423
428
  classNames: [
424
429
  focusRing,
425
- "relative rounded-full"
430
+ "relative rounded-full place-self-center"
426
431
  ]
427
432
  }, /* @__PURE__ */ React8.createElement(Avatar2.Fallback, {
428
433
  text: toEmoji(invitationId)
@@ -457,24 +462,22 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
457
462
  className: "grow"
458
463
  }, " "), isCancellable ? /* @__PURE__ */ React8.createElement(Button2, {
459
464
  variant: "ghost",
460
- classNames: "flex gap-1",
465
+ classNames: "flex gap-1 pli-0",
461
466
  onClick: cancel,
462
467
  "data-testid": "cancel-invitation"
463
468
  }, /* @__PURE__ */ React8.createElement("span", {
464
469
  className: "sr-only"
465
470
  }, t("cancel invitation label")), /* @__PURE__ */ React8.createElement(X, {
466
- className: getSize2(5),
467
- weight: "bold"
471
+ className: getSize2(4)
468
472
  })) : /* @__PURE__ */ React8.createElement(Button2, {
469
473
  variant: "ghost",
470
- classNames: "flex gap-1",
474
+ classNames: "flex gap-1 pli-0",
471
475
  onClick: handleClickRemove,
472
476
  "data-testid": "remove-invitation"
473
477
  }, /* @__PURE__ */ React8.createElement("span", {
474
478
  className: "sr-only"
475
479
  }, t("remove invitation label")), /* @__PURE__ */ React8.createElement(X, {
476
- className: getSize2(5),
477
- weight: "bold"
480
+ className: getSize2(4)
478
481
  })));
479
482
  };
480
483
 
@@ -554,7 +557,9 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
554
557
  ref: forwardedRef,
555
558
  variant,
556
559
  onClick: activeAction.onClick
557
- }, activeAction.icon && /* @__PURE__ */ React11.createElement(activeAction.icon, null), /* @__PURE__ */ React11.createElement("span", null, activeAction.label)), /* @__PURE__ */ React11.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu.Trigger, {
560
+ }, activeAction.icon && /* @__PURE__ */ React11.createElement(activeAction.icon, {
561
+ className: getSize3(5)
562
+ }), /* @__PURE__ */ React11.createElement("span", null, activeAction.label)), /* @__PURE__ */ React11.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu.Trigger, {
558
563
  asChild: true
559
564
  }, /* @__PURE__ */ React11.createElement(Button3, {
560
565
  classNames: [
@@ -563,7 +568,9 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
563
568
  ]
564
569
  }, /* @__PURE__ */ React11.createElement("span", {
565
570
  className: "sr-only"
566
- }, t("invite options label")), /* @__PURE__ */ React11.createElement(CaretDown, null))), /* @__PURE__ */ React11.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu.Viewport, null, Object.entries(actions).map(([id, action]) => {
571
+ }, t("invite options label")), /* @__PURE__ */ React11.createElement(CaretDown, {
572
+ className: getSize3(4)
573
+ }))), /* @__PURE__ */ React11.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu.Viewport, null, Object.entries(actions).map(([id, action]) => {
567
574
  return /* @__PURE__ */ React11.createElement(DropdownMenu.CheckboxItem, {
568
575
  key: id,
569
576
  "aria-labelledby": `${id}__label`,
@@ -583,7 +590,10 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
583
590
  className: descriptionText4
584
591
  }, action.description)), /* @__PURE__ */ React11.createElement(DropdownMenu.ItemIndicator, {
585
592
  asChild: true
586
- }, /* @__PURE__ */ React11.createElement(Check2, null)));
593
+ }, /* @__PURE__ */ React11.createElement(Check2, {
594
+ weight: "bold",
595
+ className: getSize3(4)
596
+ })));
587
597
  })), /* @__PURE__ */ React11.createElement(DropdownMenu.Arrow, null))));
588
598
  });
589
599
  var Action = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
@@ -2610,26 +2620,30 @@ var ResetIdentity = ({ send, active }) => {
2610
2620
  const client = useClient5();
2611
2621
  const { t } = useTranslation22("os");
2612
2622
  const [validationMessage, setValidationMessage] = useState8("");
2623
+ const [pending, setPending] = useState8(false);
2613
2624
  const resetIdentity = () => {
2625
+ setPending(true);
2614
2626
  void client.reset().then(() => send?.({
2615
2627
  type: "resetIdentity"
2616
2628
  }), (error) => {
2617
2629
  log7.catch(error, void 0, {
2618
2630
  F: __dxlog_file8,
2619
- L: 32,
2631
+ L: 35,
2620
2632
  S: void 0,
2621
2633
  C: (f, a) => f(...a)
2622
2634
  });
2623
2635
  setValidationMessage(t("failed to reset identity message"));
2636
+ setPending(false);
2624
2637
  });
2625
2638
  };
2626
2639
  return /* @__PURE__ */ React36.createElement(ResetIdentityImpl, {
2627
2640
  disabled: !active,
2641
+ pending,
2628
2642
  validationMessage,
2629
2643
  onConfirm: () => resetIdentity()
2630
2644
  });
2631
2645
  };
2632
- var ResetIdentityImpl = ({ disabled, validationMessage, onConfirm }) => {
2646
+ var ResetIdentityImpl = ({ disabled, pending, validationMessage, onConfirm }) => {
2633
2647
  const { t } = useTranslation22("os");
2634
2648
  const confirmationValue = t("confirmation value");
2635
2649
  const [inputValue, setInputValue] = useState8("");
@@ -2648,10 +2662,10 @@ var ResetIdentityImpl = ({ disabled, validationMessage, onConfirm }) => {
2648
2662
  })), /* @__PURE__ */ React36.createElement(Actions, null, /* @__PURE__ */ React36.createElement(Action, {
2649
2663
  // TODO(wittjosiah): Probably make this red?
2650
2664
  variant: "primary",
2651
- disabled: disabled || inputValue !== confirmationValue,
2665
+ disabled: disabled || pending || inputValue !== confirmationValue,
2652
2666
  onClick: () => onConfirm?.(),
2653
2667
  "data-testid": "reset-identity-input-confirm"
2654
- }, t("confirm label"))));
2668
+ }, pending ? t("reset in progress label") : t("confirm label"))));
2655
2669
  };
2656
2670
 
2657
2671
  // packages/sdk/shell/src/styles/panelStyles.ts
@@ -3288,7 +3302,8 @@ var SpacePanelHeading = ({ titleId, space, onDone }) => {
3288
3302
  role: "none",
3289
3303
  className: "flex gap-4 items-center justify-center mlb-4"
3290
3304
  }, /* @__PURE__ */ React39.createElement(Planet, {
3291
- size: 32
3305
+ size: 32,
3306
+ weight: "light"
3292
3307
  }), /* @__PURE__ */ React39.createElement("div", {
3293
3308
  className: "block text-start font-light text-xl"
3294
3309
  }, name ?? space.key.truncate())));
@@ -3675,6 +3690,7 @@ var os = {
3675
3690
  "invite many qr label": "Multiple-use",
3676
3691
  "invite many list item label": "Active multiple-use invitation",
3677
3692
  "invite options label": "Change the active invite option.",
3693
+ "reset in progress label": "Resetting...",
3678
3694
  "confirm label": "Confirm",
3679
3695
  "reset identity input label": "This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.",
3680
3696
  "failed to reset identity message": "Failed to reset identity.",
@@ -3892,6 +3908,7 @@ export {
3892
3908
  InvitationListContainer,
3893
3909
  InvitationListItem,
3894
3910
  InvitationListItemImpl,
3911
+ InvitationManager,
3895
3912
  JoinDialog,
3896
3913
  JoinPanel,
3897
3914
  JoinPanelImpl,