@dxos/shell 0.4.10-main.b9b4602 → 0.4.10-main.bf49328
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/{index-D-K0uxrm.mjs → index-C918bSpS.mjs} +38 -22
- package/dist/bundle/index-C918bSpS.mjs.map +1 -0
- package/dist/bundle/{index-DRtLjStG.mjs → index-MwaMRd0G.mjs} +595 -523
- package/dist/bundle/index-MwaMRd0G.mjs.map +1 -0
- package/dist/bundle/shell.mjs +2 -3
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +22 -22
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +33 -31
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/lib/browser/testing/index.mjs +3 -2
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/types/src/components/InvitationList/InvitationListItem.js +5 -5
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +5 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +3 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +3 -1
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +3 -4
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +5 -2
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +3 -2
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/package.json +22 -21
- package/src/components/InvitationList/InvitationListItem.tsx +5 -5
- package/src/panels/IdentityPanel/useAgentHandlers.ts +5 -1
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +3 -1
- package/src/playwright/invitations.spec.ts +3 -1
- package/src/steps/InvitationManager.tsx +4 -4
- package/src/stories/Invitations.e2e-stories.tsx +6 -3
- package/src/testing/shell-manager.ts +3 -2
- package/dist/bundle/index-D-K0uxrm.mjs.map +0 -1
- package/dist/bundle/index-DRtLjStG.mjs.map +0 -1
|
@@ -712,13 +712,13 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
712
712
|
};
|
|
713
713
|
var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
|
|
714
714
|
const { t } = useTranslation8("os");
|
|
715
|
-
const { cancel, status: invitationStatus, invitationCode, authCode,
|
|
715
|
+
const { cancel, status: invitationStatus, invitationCode, authCode, multiUse } = propsInvitationStatus;
|
|
716
716
|
const isCancellable = !([
|
|
717
717
|
Invitation.State.ERROR,
|
|
718
718
|
Invitation.State.TIMEOUT,
|
|
719
719
|
Invitation.State.CANCELLED
|
|
720
720
|
].indexOf(invitationStatus) >= 0);
|
|
721
|
-
const showShare =
|
|
721
|
+
const showShare = multiUse || [
|
|
722
722
|
Invitation.State.INIT,
|
|
723
723
|
Invitation.State.CONNECTING,
|
|
724
724
|
Invitation.State.CONNECTED
|
|
@@ -762,7 +762,7 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
762
762
|
]
|
|
763
763
|
}, /* @__PURE__ */ React12.createElement(ListItem3.Heading, {
|
|
764
764
|
classNames: "sr-only"
|
|
765
|
-
}, t(
|
|
765
|
+
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */ React12.createElement(AvatarStackEffect, {
|
|
766
766
|
status: avatarStatus,
|
|
767
767
|
animation: avatarAnimation,
|
|
768
768
|
reverseEffects
|
|
@@ -783,7 +783,7 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
783
783
|
})))), /* @__PURE__ */ React12.createElement(Tooltip5.Portal, null, /* @__PURE__ */ React12.createElement(Tooltip5.Content, {
|
|
784
784
|
side: "left",
|
|
785
785
|
classNames: "z-[70]"
|
|
786
|
-
}, t(
|
|
786
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React12.createElement(Tooltip5.Arrow, null)))), showShare && invitationUrl ? /* @__PURE__ */ React12.createElement(Tooltip5.Root, null, /* @__PURE__ */ React12.createElement(React12.Fragment, null, /* @__PURE__ */ React12.createElement(Tooltip5.Trigger, {
|
|
787
787
|
asChild: true
|
|
788
788
|
}, /* @__PURE__ */ React12.createElement(Button7, {
|
|
789
789
|
variant: "ghost",
|
|
@@ -1425,8 +1425,9 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1425
1425
|
const onAgentCreate = async () => {
|
|
1426
1426
|
invitations.forEach((invitation2) => invitation2.cancel());
|
|
1427
1427
|
const invitation = client.halo.share({
|
|
1428
|
-
type: Invitation3.Type.
|
|
1429
|
-
authMethod: Invitation3.AuthMethod.NONE
|
|
1428
|
+
type: Invitation3.Type.INTERACTIVE,
|
|
1429
|
+
authMethod: Invitation3.AuthMethod.NONE,
|
|
1430
|
+
multiUse: true
|
|
1430
1431
|
});
|
|
1431
1432
|
invitation.subscribe(handleAgentCreate);
|
|
1432
1433
|
};
|
|
@@ -1434,7 +1435,7 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1434
1435
|
const identity2 = client.halo.identity.get();
|
|
1435
1436
|
invariant(identity2, "Identity not found", {
|
|
1436
1437
|
F: __dxlog_file3,
|
|
1437
|
-
L:
|
|
1438
|
+
L: 81,
|
|
1438
1439
|
S: void 0,
|
|
1439
1440
|
A: [
|
|
1440
1441
|
"identity",
|
|
@@ -1463,7 +1464,6 @@ var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
|
1463
1464
|
import { Check as Check4, X as X3 } from "@phosphor-icons/react";
|
|
1464
1465
|
import React27, { useMemo as useMemo2 } from "react";
|
|
1465
1466
|
import { QR } from "react-qr-rounded";
|
|
1466
|
-
import { Invitation as Invitation5 } from "@dxos/react-client/invitations";
|
|
1467
1467
|
import { useId as useId5, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1468
1468
|
import { descriptionText as descriptionText8, getSize as getSize11, mx as mx20 } from "@dxos/react-ui-theme";
|
|
1469
1469
|
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
@@ -1516,10 +1516,10 @@ var InvitationManagerView = ({ children, ...props }) => {
|
|
|
1516
1516
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1517
1517
|
}, children);
|
|
1518
1518
|
};
|
|
1519
|
-
var InvitationManager = ({ invitationUrl, active, send, status,
|
|
1519
|
+
var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCode, id = "0" }) => {
|
|
1520
1520
|
const { t } = useTranslation12("os");
|
|
1521
1521
|
const qrLabel = useId5("invitation-manager__qr-code");
|
|
1522
|
-
const statusValue =
|
|
1522
|
+
const statusValue = multiUse ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1523
1523
|
const showAuthCode = statusValue === 3;
|
|
1524
1524
|
const emoji = hexToEmoji3(id);
|
|
1525
1525
|
const activeView = useMemo2(() => {
|
|
@@ -1543,7 +1543,7 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1543
1543
|
emoji
|
|
1544
1544
|
}, /* @__PURE__ */ React27.createElement("p", {
|
|
1545
1545
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1546
|
-
}, t(
|
|
1546
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React27.createElement("div", {
|
|
1547
1547
|
role: "none",
|
|
1548
1548
|
className: mx20(descriptionText8, "is-full max-is-[14rem] relative")
|
|
1549
1549
|
}, /* @__PURE__ */ React27.createElement(QR, {
|
|
@@ -1956,7 +1956,7 @@ import { useCallback as useCallback6 } from "react";
|
|
|
1956
1956
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
1957
1957
|
import { log as log7 } from "@dxos/log";
|
|
1958
1958
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
1959
|
-
import { Invitation as
|
|
1959
|
+
import { Invitation as Invitation5, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
1960
1960
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
1961
1961
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
1962
1962
|
log7("[subscribing to invitation]", invitation, {
|
|
@@ -1968,7 +1968,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1968
1968
|
return {
|
|
1969
1969
|
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
1970
1970
|
switch (invitation2.state) {
|
|
1971
|
-
case
|
|
1971
|
+
case Invitation5.State.CONNECTING: {
|
|
1972
1972
|
log7("[invitation connecting]", {
|
|
1973
1973
|
Kind,
|
|
1974
1974
|
invitation: invitation2
|
|
@@ -1983,7 +1983,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1983
1983
|
invitation: invitation2
|
|
1984
1984
|
});
|
|
1985
1985
|
}
|
|
1986
|
-
case
|
|
1986
|
+
case Invitation5.State.CONNECTED: {
|
|
1987
1987
|
log7("[invitation connected]", {
|
|
1988
1988
|
Kind,
|
|
1989
1989
|
invitation: invitation2
|
|
@@ -1998,7 +1998,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
1998
1998
|
invitation: invitation2
|
|
1999
1999
|
});
|
|
2000
2000
|
}
|
|
2001
|
-
case
|
|
2001
|
+
case Invitation5.State.READY_FOR_AUTHENTICATION: {
|
|
2002
2002
|
log7("[invitation ready for authentication]", {
|
|
2003
2003
|
Kind,
|
|
2004
2004
|
invitation: invitation2
|
|
@@ -2013,7 +2013,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2013
2013
|
invitation: invitation2
|
|
2014
2014
|
});
|
|
2015
2015
|
}
|
|
2016
|
-
case
|
|
2016
|
+
case Invitation5.State.AUTHENTICATING: {
|
|
2017
2017
|
log7("[invitation authenticating]", {
|
|
2018
2018
|
Kind,
|
|
2019
2019
|
invitation: invitation2
|
|
@@ -2028,7 +2028,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2028
2028
|
invitation: invitation2
|
|
2029
2029
|
});
|
|
2030
2030
|
}
|
|
2031
|
-
case
|
|
2031
|
+
case Invitation5.State.SUCCESS: {
|
|
2032
2032
|
log7("[invitation success]", {
|
|
2033
2033
|
Kind,
|
|
2034
2034
|
invitation: invitation2
|
|
@@ -2044,7 +2044,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2044
2044
|
});
|
|
2045
2045
|
return complete?.();
|
|
2046
2046
|
}
|
|
2047
|
-
case
|
|
2047
|
+
case Invitation5.State.CANCELLED: {
|
|
2048
2048
|
log7.warn("[invitation cancelled]", {
|
|
2049
2049
|
Kind
|
|
2050
2050
|
}, {
|
|
@@ -2058,7 +2058,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2058
2058
|
reason: "cancelled"
|
|
2059
2059
|
});
|
|
2060
2060
|
}
|
|
2061
|
-
case
|
|
2061
|
+
case Invitation5.State.TIMEOUT: {
|
|
2062
2062
|
log7.error("[invitation timeout]", {
|
|
2063
2063
|
Kind
|
|
2064
2064
|
}, {
|
|
@@ -2157,7 +2157,7 @@ var acceptingInvitationTemplate = (Kind, successTarget) => {
|
|
|
2157
2157
|
{
|
|
2158
2158
|
cond: (context) => {
|
|
2159
2159
|
const invitation = context[Kind.toLowerCase()].invitation;
|
|
2160
|
-
return !invitation || invitation?.state ===
|
|
2160
|
+
return !invitation || invitation?.state === Invitation5.State.CONNECTING;
|
|
2161
2161
|
},
|
|
2162
2162
|
target: `connecting${Kind}Invitation`,
|
|
2163
2163
|
actions: "log"
|
|
@@ -2936,7 +2936,7 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2936
2936
|
var stepStyles = "pbs-1 pbe-3 pli-3";
|
|
2937
2937
|
|
|
2938
2938
|
// packages/sdk/shell/src/styles/invitationStatusStyles.ts
|
|
2939
|
-
import { Invitation as
|
|
2939
|
+
import { Invitation as Invitation6 } from "@dxos/react-client/invitations";
|
|
2940
2940
|
var inactiveBgColor = "bg-neutral-100 dark:bg-neutral-600";
|
|
2941
2941
|
var activeBgColor = "bg-primary-500 dark:bg-primary-400";
|
|
2942
2942
|
var successBgColor = "bg-success-500 dark:bg-success-400";
|
|
@@ -2952,9 +2952,9 @@ var activeStrokeColor = "stroke-primary-400 dark:stroke-primary-150";
|
|
|
2952
2952
|
var successStrokeColor = "stroke-success-300 dark:stroke-primary-400";
|
|
2953
2953
|
var errorStrokeColor = "stroke-error-300 dark:stroke-error-500";
|
|
2954
2954
|
var cancelledStrokeColor = "stroke-warning-300 dark:stroke-warning-500";
|
|
2955
|
-
var resolvedStrokeColor = (status) => status ===
|
|
2956
|
-
var resolvedBgColor = (status) => status ===
|
|
2957
|
-
var resolvedTextColor = (status) => status ===
|
|
2955
|
+
var resolvedStrokeColor = (status) => status === Invitation6.State.ERROR ? errorStrokeColor : status === Invitation6.State.CANCELLED || status === Invitation6.State.TIMEOUT ? cancelledStrokeColor : successStrokeColor;
|
|
2956
|
+
var resolvedBgColor = (status) => status === Invitation6.State.ERROR ? errorBgColor : status === Invitation6.State.CANCELLED || status === Invitation6.State.TIMEOUT ? cancelledBgColor : successBgColor;
|
|
2957
|
+
var resolvedTextColor = (status) => status === Invitation6.State.ERROR ? errorTextColor : status === Invitation6.State.CANCELLED || status === Invitation6.State.TIMEOUT ? cancelledTextColor : successTextColor;
|
|
2958
2958
|
|
|
2959
2959
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2960
2960
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
@@ -3454,7 +3454,7 @@ import React39, { useCallback as useCallback8, useState as useState12 } from "re
|
|
|
3454
3454
|
import { log as log12 } from "@dxos/log";
|
|
3455
3455
|
import { useConfig } from "@dxos/react-client";
|
|
3456
3456
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3457
|
-
import { Invitation as
|
|
3457
|
+
import { Invitation as Invitation7, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3458
3458
|
import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3459
3459
|
import { descriptionText as descriptionText11, mx as mx24 } from "@dxos/react-ui-theme";
|
|
3460
3460
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
@@ -3466,7 +3466,7 @@ var SpaceManager = (props) => {
|
|
|
3466
3466
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3467
3467
|
const onInvitationEvent = useCallback8((invitation) => {
|
|
3468
3468
|
const invitationCode = InvitationEncoder4.encode(invitation);
|
|
3469
|
-
if (invitation.state ===
|
|
3469
|
+
if (invitation.state === Invitation7.State.CONNECTING) {
|
|
3470
3470
|
log12.info(JSON.stringify({
|
|
3471
3471
|
invitationCode,
|
|
3472
3472
|
authCode: invitation.authCode
|
|
@@ -3485,8 +3485,9 @@ var SpaceManager = (props) => {
|
|
|
3485
3485
|
icon: UserPlus,
|
|
3486
3486
|
onClick: useCallback8(() => {
|
|
3487
3487
|
const invitation = space.share?.({
|
|
3488
|
-
type:
|
|
3489
|
-
authMethod:
|
|
3488
|
+
type: Invitation7.Type.INTERACTIVE,
|
|
3489
|
+
authMethod: Invitation7.AuthMethod.SHARED_SECRET,
|
|
3490
|
+
multiUse: false,
|
|
3490
3491
|
target
|
|
3491
3492
|
});
|
|
3492
3493
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
@@ -3502,8 +3503,9 @@ var SpaceManager = (props) => {
|
|
|
3502
3503
|
icon: UsersThree,
|
|
3503
3504
|
onClick: useCallback8(() => {
|
|
3504
3505
|
const invitation = space.share?.({
|
|
3505
|
-
type:
|
|
3506
|
-
authMethod:
|
|
3506
|
+
type: Invitation7.Type.INTERACTIVE,
|
|
3507
|
+
authMethod: Invitation7.AuthMethod.NONE,
|
|
3508
|
+
multiUse: true,
|
|
3507
3509
|
target
|
|
3508
3510
|
});
|
|
3509
3511
|
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
@@ -3539,7 +3541,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3539
3541
|
localStorage.setItem(activeActionKey, nextAction);
|
|
3540
3542
|
};
|
|
3541
3543
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3542
|
-
|
|
3544
|
+
Invitation7.State.CANCELLED
|
|
3543
3545
|
].includes(invitation.get().state));
|
|
3544
3546
|
return /* @__PURE__ */ React39.createElement(React39.Fragment, null, /* @__PURE__ */ React39.createElement(ScrollArea.Root, {
|
|
3545
3547
|
classNames: "grow shrink basis-28 -mli-2"
|