@dxos/shell 0.6.14-staging.e15392e → 0.7.1-staging.599df14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/shell.mjs +5291 -5188
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +57 -57
- 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 +97 -91
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/lib/browser/testing/index.mjs +2 -0
- package/dist/lib/browser/testing/index.mjs.map +2 -2
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react.cjs +78 -72
- package/dist/lib/node/react.cjs.map +3 -3
- package/dist/lib/node/testing/index.cjs +2 -0
- package/dist/lib/node/testing/index.cjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react.mjs +97 -91
- package/dist/lib/node-esm/react.mjs.map +3 -3
- package/dist/lib/node-esm/testing/index.mjs +2 -0
- package/dist/lib/node-esm/testing/index.mjs.map +2 -2
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.js +4 -10
- package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -1
- package/dist/types/src/components/Panel/Action.d.ts +2 -0
- package/dist/types/src/components/Panel/Action.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Action.js +16 -14
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +13 -6
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +3 -3
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js +8 -1
- package/dist/types/src/panels/IdentityPanel/useEdgeAgentsHandlers.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +2 -2
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.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 +5 -3
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +9 -1
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +2 -0
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/package.json +25 -25
- package/src/components/DeviceList/DeviceListItem.tsx +38 -42
- package/src/components/Panel/Action.tsx +40 -31
- package/src/panels/IdentityPanel/IdentityPanel.tsx +13 -3
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +1 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +5 -3
- package/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts +10 -1
- package/src/panels/SpacePanel/SpacePanel.tsx +2 -1
- package/src/panels/SpacePanel/SpacePanelProps.ts +1 -0
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +5 -3
- package/src/playwright/invitations-manager.ts +8 -1
- package/src/testing/shell-manager.ts +2 -0
|
@@ -577,7 +577,7 @@ import React9, { forwardRef as forwardRef2 } from "react";
|
|
|
577
577
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
578
578
|
import { Device, DeviceType, DeviceKind } from "@dxos/react-client/halo";
|
|
579
579
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
580
|
-
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as useTranslation6, DropdownMenu as DropdownMenu2, Button as Button5
|
|
580
|
+
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as useTranslation6, DropdownMenu as DropdownMenu2, Button as Button5 } from "@dxos/react-ui";
|
|
581
581
|
import { getSize as getSize5 } from "@dxos/react-ui-theme";
|
|
582
582
|
import { keyToFallback as keyToFallback2 } from "@dxos/util";
|
|
583
583
|
var iconProps = {
|
|
@@ -587,7 +587,7 @@ var iconProps = {
|
|
|
587
587
|
x: 8,
|
|
588
588
|
y: 8
|
|
589
589
|
};
|
|
590
|
-
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy, ...props }, forwardedRef) => {
|
|
590
|
+
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy: _, ...props }, forwardedRef) => {
|
|
591
591
|
const { t } = useTranslation6("os");
|
|
592
592
|
const fallbackValue = keyToFallback2(device.deviceKey);
|
|
593
593
|
const labelId = useId3("identityListItem__label");
|
|
@@ -621,21 +621,7 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
621
621
|
classNames: "flex-1 text-sm truncate"
|
|
622
622
|
}, displayName), isCurrent && /* @__PURE__ */ React9.createElement(Tag, {
|
|
623
623
|
color: "primary"
|
|
624
|
-
}, t("current device tag label")), device.
|
|
625
|
-
asChild: true
|
|
626
|
-
}, /* @__PURE__ */ React9.createElement(Button5, {
|
|
627
|
-
variant: "ghost",
|
|
628
|
-
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
629
|
-
"data-testid": "agent.destroy",
|
|
630
|
-
onClick: onAgentDestroy
|
|
631
|
-
}, /* @__PURE__ */ React9.createElement("span", {
|
|
632
|
-
className: "sr-only"
|
|
633
|
-
}, t("destroy agent label")), /* @__PURE__ */ React9.createElement(Power2, {
|
|
634
|
-
className: getSize5(5)
|
|
635
|
-
}))), /* @__PURE__ */ React9.createElement(Tooltip5.Portal, null, /* @__PURE__ */ React9.createElement(Tooltip5.Content, {
|
|
636
|
-
side: "bottom",
|
|
637
|
-
classNames: "z-50"
|
|
638
|
-
}, t("destroy agent label")))) : device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React9.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React9.createElement(DropdownMenu2.Trigger, {
|
|
624
|
+
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React9.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React9.createElement(DropdownMenu2.Trigger, {
|
|
639
625
|
asChild: true
|
|
640
626
|
}, /* @__PURE__ */ React9.createElement(Button5, {
|
|
641
627
|
variant: "ghost",
|
|
@@ -703,7 +689,7 @@ import { X } from "@phosphor-icons/react";
|
|
|
703
689
|
import { formatDistanceToNow } from "date-fns";
|
|
704
690
|
import React12, { useCallback as useCallback2 } from "react";
|
|
705
691
|
import { Invitation, useInvitationStatus } from "@dxos/react-client/invitations";
|
|
706
|
-
import { Button as Button7, ListItem as ListItem3, useTranslation as useTranslation8, Avatar as Avatar4, useThemeContext as useThemeContext4, Tooltip as
|
|
692
|
+
import { Button as Button7, ListItem as ListItem3, useTranslation as useTranslation8, Avatar as Avatar4, useThemeContext as useThemeContext4, Tooltip as Tooltip5 } from "@dxos/react-ui";
|
|
707
693
|
import { focusRing, getSize as getSize7, mx as mx9 } from "@dxos/react-ui-theme";
|
|
708
694
|
import { hexToEmoji } from "@dxos/util";
|
|
709
695
|
|
|
@@ -834,11 +820,11 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
834
820
|
status: avatarStatus,
|
|
835
821
|
animation: avatarAnimation,
|
|
836
822
|
reverseEffects
|
|
837
|
-
}), /* @__PURE__ */ React12.createElement(
|
|
823
|
+
}), /* @__PURE__ */ React12.createElement(Tooltip5.Root, null, /* @__PURE__ */ React12.createElement(Avatar4.Root, {
|
|
838
824
|
...avatarProps,
|
|
839
825
|
animation: avatarAnimation,
|
|
840
826
|
status: avatarStatus
|
|
841
|
-
}, /* @__PURE__ */ React12.createElement(
|
|
827
|
+
}, /* @__PURE__ */ React12.createElement(Tooltip5.Trigger, {
|
|
842
828
|
asChild: true
|
|
843
829
|
}, /* @__PURE__ */ React12.createElement(Avatar4.Frame, {
|
|
844
830
|
tabIndex: 0,
|
|
@@ -848,10 +834,10 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
848
834
|
]
|
|
849
835
|
}, /* @__PURE__ */ React12.createElement(Avatar4.Fallback, {
|
|
850
836
|
text: hexToEmoji(invitationId)
|
|
851
|
-
})))), /* @__PURE__ */ React12.createElement(
|
|
837
|
+
})))), /* @__PURE__ */ React12.createElement(Tooltip5.Portal, null, /* @__PURE__ */ React12.createElement(Tooltip5.Content, {
|
|
852
838
|
side: "left",
|
|
853
839
|
classNames: "z-[70]"
|
|
854
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React12.createElement(
|
|
840
|
+
}, 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, {
|
|
855
841
|
asChild: true
|
|
856
842
|
}, /* @__PURE__ */ React12.createElement(Button7, {
|
|
857
843
|
variant: "ghost",
|
|
@@ -864,7 +850,7 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
864
850
|
}, /* @__PURE__ */ React12.createElement("span", null, t("open share panel label")))), /* @__PURE__ */ React12.createElement(CopyButtonIconOnly, {
|
|
865
851
|
variant: "ghost",
|
|
866
852
|
value: invitationUrl
|
|
867
|
-
})), /* @__PURE__ */ React12.createElement(
|
|
853
|
+
})), /* @__PURE__ */ React12.createElement(Tooltip5.Portal, null, /* @__PURE__ */ React12.createElement(Tooltip5.Content, {
|
|
868
854
|
side: "left",
|
|
869
855
|
classNames: "z-[70]"
|
|
870
856
|
}, invitationHasLifetime && /* @__PURE__ */ React12.createElement("span", null, "Expires ", invitationTimeLeft)))) : showAuthCode ? /* @__PURE__ */ React12.createElement(AuthCode, {
|
|
@@ -961,7 +947,8 @@ var defaultActions = {
|
|
|
961
947
|
}
|
|
962
948
|
};
|
|
963
949
|
var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
964
|
-
const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, ...rest } = props;
|
|
950
|
+
const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, "data-testid": testId, ...rest } = props;
|
|
951
|
+
const dropdownTestId = testId && `${testId}.more`;
|
|
965
952
|
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] = useControllableState3({
|
|
966
953
|
prop: propsActiveAction,
|
|
967
954
|
onChange: onChangeActiveAction,
|
|
@@ -980,6 +967,7 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
980
967
|
],
|
|
981
968
|
ref: forwardedRef,
|
|
982
969
|
variant,
|
|
970
|
+
"data-testid": testId,
|
|
983
971
|
onClick: activeAction.onClick
|
|
984
972
|
}, activeAction.icon && /* @__PURE__ */ React15.createElement(activeAction.icon, {
|
|
985
973
|
className: getSize8(5)
|
|
@@ -989,19 +977,21 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
989
977
|
classNames: [
|
|
990
978
|
"bs-11 flex-none rounded-is-none",
|
|
991
979
|
classNames
|
|
992
|
-
]
|
|
980
|
+
],
|
|
981
|
+
"data-testid": dropdownTestId
|
|
993
982
|
}, /* @__PURE__ */ React15.createElement("span", {
|
|
994
983
|
className: "sr-only"
|
|
995
984
|
}, t("invite options label")), /* @__PURE__ */ React15.createElement(CaretDown3, {
|
|
996
985
|
className: getSize8(4)
|
|
997
|
-
}))), /* @__PURE__ */ React15.createElement(DropdownMenu3.Content, null, /* @__PURE__ */ React15.createElement(DropdownMenu3.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
986
|
+
}))), /* @__PURE__ */ React15.createElement(DropdownMenu3.Portal, null, /* @__PURE__ */ React15.createElement(DropdownMenu3.Content, null, /* @__PURE__ */ React15.createElement(DropdownMenu3.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
998
987
|
return /* @__PURE__ */ React15.createElement(DropdownMenu3.CheckboxItem, {
|
|
999
988
|
key: id,
|
|
1000
989
|
"aria-labelledby": `${id}__label`,
|
|
1001
990
|
"aria-describedby": `${id}__description`,
|
|
1002
991
|
checked: activeActionKey2 === id,
|
|
1003
992
|
onCheckedChange: (checked) => checked && setActiveAction(id),
|
|
1004
|
-
classNames: "gap-2"
|
|
993
|
+
classNames: "gap-2",
|
|
994
|
+
"data-testid": action.testId
|
|
1005
995
|
}, action.icon && /* @__PURE__ */ React15.createElement(action.icon, {
|
|
1006
996
|
className: getSize8(5)
|
|
1007
997
|
}), /* @__PURE__ */ React15.createElement("div", {
|
|
@@ -1018,7 +1008,7 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
1018
1008
|
weight: "bold",
|
|
1019
1009
|
className: getSize8(4)
|
|
1020
1010
|
})));
|
|
1021
|
-
})), /* @__PURE__ */ React15.createElement(DropdownMenu3.Arrow, null))));
|
|
1011
|
+
})), /* @__PURE__ */ React15.createElement(DropdownMenu3.Arrow, null)))));
|
|
1022
1012
|
});
|
|
1023
1013
|
var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
1024
1014
|
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
@@ -1248,12 +1238,12 @@ import { FirstAidKit as FirstAidKit2, Key, Plugs, PlugsConnected } from "@phosph
|
|
|
1248
1238
|
import React29, { useEffect as useEffect4, useMemo as useMemo3, useState as useState9 } from "react";
|
|
1249
1239
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1250
1240
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1251
|
-
import { log as
|
|
1241
|
+
import { log as log7 } from "@dxos/log";
|
|
1252
1242
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1253
1243
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1254
1244
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1255
1245
|
import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
|
|
1256
|
-
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as
|
|
1246
|
+
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as Tooltip6, useId as useId6, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1257
1247
|
import { getSize as getSize13 } from "@dxos/react-ui-theme";
|
|
1258
1248
|
import { hexToEmoji as hexToEmoji4, hexToHue as hexToHue2, keyToFallback as keyToFallback3 } from "@dxos/util";
|
|
1259
1249
|
|
|
@@ -1421,7 +1411,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1421
1411
|
});
|
|
1422
1412
|
};
|
|
1423
1413
|
var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
1424
|
-
const
|
|
1414
|
+
const edgeDeviceAvailable = devices.find((device) => device.profile?.type === DeviceType2.AGENT_MANAGED && device.profile?.os?.toUpperCase() === "EDGE");
|
|
1425
1415
|
return /* @__PURE__ */ React25.createElement("div", {
|
|
1426
1416
|
role: "none",
|
|
1427
1417
|
className: "bs-40 grow overflow-y-auto overflow-x-hidden"
|
|
@@ -1430,10 +1420,10 @@ var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled
|
|
|
1430
1420
|
connectionState,
|
|
1431
1421
|
onClickAdd,
|
|
1432
1422
|
onClickJoinExisting,
|
|
1433
|
-
onClickRecover,
|
|
1423
|
+
onClickRecover: agentProps.agentStatus === "created" ? onClickRecover : void 0,
|
|
1434
1424
|
onClickReset,
|
|
1435
1425
|
onAgentDestroy: agentProps.onAgentDestroy
|
|
1436
|
-
}), !
|
|
1426
|
+
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ React25.createElement(AgentConfig, agentProps));
|
|
1437
1427
|
};
|
|
1438
1428
|
|
|
1439
1429
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
@@ -1448,7 +1438,9 @@ import { useClient as useClient5 } from "@dxos/react-client";
|
|
|
1448
1438
|
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1449
1439
|
import { useEffect as useEffect2, useState as useState6 } from "react";
|
|
1450
1440
|
import { invariant } from "@dxos/invariant";
|
|
1441
|
+
import { log as log4 } from "@dxos/log";
|
|
1451
1442
|
import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
1443
|
+
import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata";
|
|
1452
1444
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
1453
1445
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1454
1446
|
var useEdgeAgentHandlers = ({ identity }) => {
|
|
@@ -1485,7 +1477,7 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1485
1477
|
const onAgentCreate = async () => {
|
|
1486
1478
|
invariant(identity, "Identity not found", {
|
|
1487
1479
|
F: __dxlog_file3,
|
|
1488
|
-
L:
|
|
1480
|
+
L: 59,
|
|
1489
1481
|
S: void 0,
|
|
1490
1482
|
A: [
|
|
1491
1483
|
"identity",
|
|
@@ -1506,9 +1498,18 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1506
1498
|
setAgentStatus("creating");
|
|
1507
1499
|
setValidationMessage("");
|
|
1508
1500
|
try {
|
|
1509
|
-
await service.createAgent(
|
|
1501
|
+
await service.createAgent(null, {
|
|
1502
|
+
timeout: 7500
|
|
1503
|
+
});
|
|
1504
|
+
await Promise.all(client.spaces.get().map((space) => space?.internal.setEdgeReplicationPreference(EdgeReplicationSetting.ENABLED)));
|
|
1510
1505
|
setAgentStatus("created");
|
|
1511
1506
|
} catch (err) {
|
|
1507
|
+
log4.catch(err, void 0, {
|
|
1508
|
+
F: __dxlog_file3,
|
|
1509
|
+
L: 82,
|
|
1510
|
+
S: void 0,
|
|
1511
|
+
C: (f, a) => f(...a)
|
|
1512
|
+
});
|
|
1512
1513
|
setAgentStatus("error");
|
|
1513
1514
|
setValidationMessage(`Error creating an agent: ${err.message}`);
|
|
1514
1515
|
}
|
|
@@ -1533,7 +1534,7 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1533
1534
|
// packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
|
|
1534
1535
|
import { useCallback as useCallback4, useEffect as useEffect3, useState as useState7 } from "react";
|
|
1535
1536
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1536
|
-
import { log as
|
|
1537
|
+
import { log as log5 } from "@dxos/log";
|
|
1537
1538
|
import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
|
|
1538
1539
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1539
1540
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
@@ -1622,7 +1623,7 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1622
1623
|
const handleAgentCreate = useCallback4(async (invitation) => {
|
|
1623
1624
|
const invitationCode = InvitationEncoder2.encode(invitation);
|
|
1624
1625
|
if (invitation.state === Invitation3.State.CONNECTING) {
|
|
1625
|
-
|
|
1626
|
+
log5.info(JSON.stringify({
|
|
1626
1627
|
invitationCode,
|
|
1627
1628
|
authCode: invitation.authCode
|
|
1628
1629
|
}), void 0, {
|
|
@@ -1799,7 +1800,7 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1799
1800
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1800
1801
|
import { Warning } from "@phosphor-icons/react";
|
|
1801
1802
|
import React28, { useState as useState8 } from "react";
|
|
1802
|
-
import { log as
|
|
1803
|
+
import { log as log6 } from "@dxos/log";
|
|
1803
1804
|
import { Message, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1804
1805
|
import { getSize as getSize12, mx as mx21 } from "@dxos/react-ui-theme";
|
|
1805
1806
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
@@ -1810,7 +1811,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1810
1811
|
const processReset = async () => {
|
|
1811
1812
|
setPending(true);
|
|
1812
1813
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
1813
|
-
|
|
1814
|
+
log6.catch(error, void 0, {
|
|
1814
1815
|
F: __dxlog_file5,
|
|
1815
1816
|
L: 38,
|
|
1816
1817
|
S: void 0,
|
|
@@ -1871,7 +1872,7 @@ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/I
|
|
|
1871
1872
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1872
1873
|
var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
|
|
1873
1874
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1874
|
-
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1875
|
+
var IdentityHeading = ({ titleId, title, identity, hideRecover, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1875
1876
|
const client = useClient6();
|
|
1876
1877
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1877
1878
|
const { t } = useTranslation14("os");
|
|
@@ -1904,7 +1905,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1904
1905
|
const handleRecoveryCode = async () => {
|
|
1905
1906
|
invariant3(client.services.services.IdentityService, "IdentityService not available", {
|
|
1906
1907
|
F: __dxlog_file6,
|
|
1907
|
-
L:
|
|
1908
|
+
L: 77,
|
|
1908
1909
|
S: void 0,
|
|
1909
1910
|
A: [
|
|
1910
1911
|
"client.services.services.IdentityService",
|
|
@@ -1915,7 +1916,6 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1915
1916
|
void setTextValue(seedphrase);
|
|
1916
1917
|
};
|
|
1917
1918
|
const isConnected = connectionState === ConnectionState2.ONLINE;
|
|
1918
|
-
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1919
1919
|
return /* @__PURE__ */ React29.createElement(Heading, {
|
|
1920
1920
|
titleId,
|
|
1921
1921
|
title,
|
|
@@ -1959,7 +1959,7 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1959
1959
|
hue,
|
|
1960
1960
|
onChangeHue: setHue,
|
|
1961
1961
|
classNames: "bs-[--rail-action]"
|
|
1962
|
-
}), /* @__PURE__ */ React29.createElement(
|
|
1962
|
+
}), /* @__PURE__ */ React29.createElement(Tooltip6.Root, null, /* @__PURE__ */ React29.createElement(Tooltip6.Trigger, {
|
|
1963
1963
|
asChild: true
|
|
1964
1964
|
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1965
1965
|
classNames: "bs-[--rail-action]",
|
|
@@ -1969,20 +1969,20 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1969
1969
|
className: "sr-only"
|
|
1970
1970
|
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React29.createElement(Key, {
|
|
1971
1971
|
className: getSize13(5)
|
|
1972
|
-
}))), /* @__PURE__ */ React29.createElement(
|
|
1972
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip6.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip6.Content, {
|
|
1973
1973
|
side: "bottom",
|
|
1974
1974
|
classNames: "z-50"
|
|
1975
|
-
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ React29.createElement(
|
|
1975
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ React29.createElement(Tooltip6.Arrow, null)))), !hideRecover && /* @__PURE__ */ React29.createElement(Tooltip6.Root, null, /* @__PURE__ */ React29.createElement(Tooltip6.Trigger, {
|
|
1976
1976
|
asChild: true
|
|
1977
1977
|
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1978
1978
|
classNames: "bs-[--rail-action]",
|
|
1979
1979
|
onClick: handleRecoveryCode
|
|
1980
1980
|
}, /* @__PURE__ */ React29.createElement(FirstAidKit2, {
|
|
1981
1981
|
className: getSize13(5)
|
|
1982
|
-
}))), /* @__PURE__ */ React29.createElement(
|
|
1982
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip6.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip6.Content, {
|
|
1983
1983
|
side: "bottom",
|
|
1984
1984
|
classNames: "z-50"
|
|
1985
|
-
}, t("create recovery code label"), /* @__PURE__ */ React29.createElement(
|
|
1985
|
+
}, t("create recovery code label"), /* @__PURE__ */ React29.createElement(Tooltip6.Arrow, null)))), /* @__PURE__ */ React29.createElement(Tooltip6.Root, null, /* @__PURE__ */ React29.createElement(Tooltip6.Trigger, {
|
|
1986
1986
|
asChild: true
|
|
1987
1987
|
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1988
1988
|
classNames: [
|
|
@@ -1996,10 +1996,10 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1996
1996
|
className: getSize13(5)
|
|
1997
1997
|
}) : /* @__PURE__ */ React29.createElement(Plugs, {
|
|
1998
1998
|
className: getSize13(5)
|
|
1999
|
-
}))), /* @__PURE__ */ React29.createElement(
|
|
1999
|
+
}))), /* @__PURE__ */ React29.createElement(Tooltip6.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip6.Content, {
|
|
2000
2000
|
side: "bottom",
|
|
2001
2001
|
classNames: "z-50"
|
|
2002
|
-
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React29.createElement(
|
|
2002
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React29.createElement(Tooltip6.Arrow, null)))))));
|
|
2003
2003
|
};
|
|
2004
2004
|
var IdentityPanelImpl = (props) => {
|
|
2005
2005
|
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
@@ -2016,10 +2016,12 @@ var IdentityPanelImpl = (props) => {
|
|
|
2016
2016
|
t
|
|
2017
2017
|
]);
|
|
2018
2018
|
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
2019
|
+
const hideRecover = rest.agentStatus !== "created";
|
|
2019
2020
|
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(IdentityHeading, {
|
|
2020
2021
|
identity,
|
|
2021
2022
|
titleId,
|
|
2022
2023
|
title,
|
|
2024
|
+
hideRecover,
|
|
2023
2025
|
onDone,
|
|
2024
2026
|
onUpdateProfile,
|
|
2025
2027
|
connectionState,
|
|
@@ -2087,9 +2089,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2087
2089
|
invitations
|
|
2088
2090
|
});
|
|
2089
2091
|
if (!identity) {
|
|
2090
|
-
|
|
2092
|
+
log7.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
2091
2093
|
F: __dxlog_file6,
|
|
2092
|
-
L:
|
|
2094
|
+
L: 288,
|
|
2093
2095
|
S: void 0,
|
|
2094
2096
|
C: (f, a) => f(...a)
|
|
2095
2097
|
});
|
|
@@ -2104,9 +2106,9 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2104
2106
|
const handleChangeConnectionState = async (nextState) => client?.mesh.updateConfig(nextState);
|
|
2105
2107
|
useEffect4(() => {
|
|
2106
2108
|
const subscription = identityService.subscribe((state) => {
|
|
2107
|
-
|
|
2109
|
+
log7("[state]", state, {
|
|
2108
2110
|
F: __dxlog_file6,
|
|
2109
|
-
L:
|
|
2111
|
+
L: 301,
|
|
2110
2112
|
S: void 0,
|
|
2111
2113
|
C: (f, a) => f(...a)
|
|
2112
2114
|
});
|
|
@@ -2160,7 +2162,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2160
2162
|
|
|
2161
2163
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2162
2164
|
import React38, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
2163
|
-
import { log as
|
|
2165
|
+
import { log as log11 } from "@dxos/log";
|
|
2164
2166
|
import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
|
|
2165
2167
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
2166
2168
|
import { useId as useId8, useThemeContext as useThemeContext5 } from "@dxos/react-ui";
|
|
@@ -2202,12 +2204,12 @@ var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent
|
|
|
2202
2204
|
import { useMachine as useMachine2 } from "@xstate/react";
|
|
2203
2205
|
import { useCallback as useCallback5 } from "react";
|
|
2204
2206
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
2205
|
-
import { log as
|
|
2207
|
+
import { log as log8 } from "@dxos/log";
|
|
2206
2208
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
2207
2209
|
import { Invitation as Invitation5, InvitationEncoder as InvitationEncoder3 } from "@dxos/react-client/invitations";
|
|
2208
2210
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
2209
2211
|
var getInvitationSubscribable = (Kind, invitation) => {
|
|
2210
|
-
|
|
2212
|
+
log8("[subscribing to invitation]", invitation, {
|
|
2211
2213
|
F: __dxlog_file7,
|
|
2212
2214
|
L: 90,
|
|
2213
2215
|
S: void 0,
|
|
@@ -2217,7 +2219,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2217
2219
|
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
2218
2220
|
switch (invitation2.state) {
|
|
2219
2221
|
case Invitation5.State.CONNECTING: {
|
|
2220
|
-
|
|
2222
|
+
log8("[invitation connecting]", {
|
|
2221
2223
|
Kind,
|
|
2222
2224
|
invitation: invitation2
|
|
2223
2225
|
}, {
|
|
@@ -2232,7 +2234,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2232
2234
|
});
|
|
2233
2235
|
}
|
|
2234
2236
|
case Invitation5.State.CONNECTED: {
|
|
2235
|
-
|
|
2237
|
+
log8("[invitation connected]", {
|
|
2236
2238
|
Kind,
|
|
2237
2239
|
invitation: invitation2
|
|
2238
2240
|
}, {
|
|
@@ -2247,7 +2249,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2247
2249
|
});
|
|
2248
2250
|
}
|
|
2249
2251
|
case Invitation5.State.READY_FOR_AUTHENTICATION: {
|
|
2250
|
-
|
|
2252
|
+
log8("[invitation ready for authentication]", {
|
|
2251
2253
|
Kind,
|
|
2252
2254
|
invitation: invitation2
|
|
2253
2255
|
}, {
|
|
@@ -2262,7 +2264,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2262
2264
|
});
|
|
2263
2265
|
}
|
|
2264
2266
|
case Invitation5.State.AUTHENTICATING: {
|
|
2265
|
-
|
|
2267
|
+
log8("[invitation authenticating]", {
|
|
2266
2268
|
Kind,
|
|
2267
2269
|
invitation: invitation2
|
|
2268
2270
|
}, {
|
|
@@ -2277,7 +2279,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2277
2279
|
});
|
|
2278
2280
|
}
|
|
2279
2281
|
case Invitation5.State.SUCCESS: {
|
|
2280
|
-
|
|
2282
|
+
log8("[invitation success]", {
|
|
2281
2283
|
Kind,
|
|
2282
2284
|
invitation: invitation2
|
|
2283
2285
|
}, {
|
|
@@ -2293,7 +2295,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2293
2295
|
return complete?.();
|
|
2294
2296
|
}
|
|
2295
2297
|
case Invitation5.State.CANCELLED: {
|
|
2296
|
-
|
|
2298
|
+
log8.warn("[invitation cancelled]", {
|
|
2297
2299
|
Kind
|
|
2298
2300
|
}, {
|
|
2299
2301
|
F: __dxlog_file7,
|
|
@@ -2307,7 +2309,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2307
2309
|
});
|
|
2308
2310
|
}
|
|
2309
2311
|
case Invitation5.State.TIMEOUT: {
|
|
2310
|
-
|
|
2312
|
+
log8.error("[invitation timeout]", {
|
|
2311
2313
|
Kind
|
|
2312
2314
|
}, {
|
|
2313
2315
|
F: __dxlog_file7,
|
|
@@ -2323,7 +2325,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2323
2325
|
}
|
|
2324
2326
|
}, (error) => {
|
|
2325
2327
|
if (error instanceof AlreadyJoinedError) {
|
|
2326
|
-
|
|
2328
|
+
log8("[already joined]", {
|
|
2327
2329
|
Kind,
|
|
2328
2330
|
error
|
|
2329
2331
|
}, {
|
|
@@ -2338,7 +2340,7 @@ var getInvitationSubscribable = (Kind, invitation) => {
|
|
|
2338
2340
|
});
|
|
2339
2341
|
return complete?.();
|
|
2340
2342
|
}
|
|
2341
|
-
|
|
2343
|
+
log8.error("[invitation errored]", {
|
|
2342
2344
|
Kind,
|
|
2343
2345
|
error
|
|
2344
2346
|
}, {
|
|
@@ -2677,7 +2679,7 @@ var joinMachine = createMachine2({
|
|
|
2677
2679
|
} : context.space
|
|
2678
2680
|
}),
|
|
2679
2681
|
log: (context, event) => {
|
|
2680
|
-
|
|
2682
|
+
log8("[transition]", {
|
|
2681
2683
|
event,
|
|
2682
2684
|
haloInvitation: context.halo.invitation,
|
|
2683
2685
|
spaceInvitation: context.space.invitation
|
|
@@ -2695,7 +2697,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2695
2697
|
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2696
2698
|
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2697
2699
|
} catch (err) {
|
|
2698
|
-
|
|
2700
|
+
log8.catch(err, void 0, {
|
|
2699
2701
|
F: __dxlog_file7,
|
|
2700
2702
|
L: 452,
|
|
2701
2703
|
S: void 0,
|
|
@@ -2716,7 +2718,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2716
2718
|
invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
|
|
2717
2719
|
};
|
|
2718
2720
|
} catch (err) {
|
|
2719
|
-
|
|
2721
|
+
log8.error("Could not redeem device invitation code", err, {
|
|
2720
2722
|
F: __dxlog_file7,
|
|
2721
2723
|
L: 473,
|
|
2722
2724
|
S: void 0,
|
|
@@ -2741,7 +2743,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2741
2743
|
invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
|
|
2742
2744
|
};
|
|
2743
2745
|
} catch (err) {
|
|
2744
|
-
|
|
2746
|
+
log8.error("Could not redeem space invitation code", err, {
|
|
2745
2747
|
F: __dxlog_file7,
|
|
2746
2748
|
L: 495,
|
|
2747
2749
|
S: void 0,
|
|
@@ -2905,7 +2907,7 @@ var IdentityAdded = (props) => {
|
|
|
2905
2907
|
|
|
2906
2908
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2907
2909
|
import React33, { useState as useState10 } from "react";
|
|
2908
|
-
import { log as
|
|
2910
|
+
import { log as log9 } from "@dxos/log";
|
|
2909
2911
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
2910
2912
|
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2911
2913
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
@@ -2925,7 +2927,7 @@ var IdentityInput = (props) => {
|
|
|
2925
2927
|
identity
|
|
2926
2928
|
});
|
|
2927
2929
|
}, (error) => {
|
|
2928
|
-
|
|
2930
|
+
log9.catch(error, void 0, {
|
|
2929
2931
|
F: __dxlog_file8,
|
|
2930
2932
|
L: 38,
|
|
2931
2933
|
S: void 0,
|
|
@@ -2942,7 +2944,7 @@ var IdentityInput = (props) => {
|
|
|
2942
2944
|
identity
|
|
2943
2945
|
});
|
|
2944
2946
|
}, (error) => {
|
|
2945
|
-
|
|
2947
|
+
log9.catch(error, void 0, {
|
|
2946
2948
|
F: __dxlog_file8,
|
|
2947
2949
|
L: 48,
|
|
2948
2950
|
S: void 0,
|
|
@@ -2995,7 +2997,7 @@ import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
|
2995
2997
|
|
|
2996
2998
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2997
2999
|
import React35, { useState as useState11, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
|
|
2998
|
-
import { log as
|
|
3000
|
+
import { log as log10 } from "@dxos/log";
|
|
2999
3001
|
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
3000
3002
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
3001
3003
|
var invitationCodeFromUrl = (text) => {
|
|
@@ -3004,7 +3006,7 @@ var invitationCodeFromUrl = (text) => {
|
|
|
3004
3006
|
const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
|
|
3005
3007
|
return invitation ?? text;
|
|
3006
3008
|
} catch (err) {
|
|
3007
|
-
|
|
3009
|
+
log10.catch(err, void 0, {
|
|
3008
3010
|
F: __dxlog_file9,
|
|
3009
3011
|
L: 25,
|
|
3010
3012
|
S: void 0,
|
|
@@ -3384,7 +3386,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3384
3386
|
});
|
|
3385
3387
|
useEffect6(() => {
|
|
3386
3388
|
const subscription = joinService.subscribe((state) => {
|
|
3387
|
-
|
|
3389
|
+
log11("[state]", state, {
|
|
3388
3390
|
F: __dxlog_file10,
|
|
3389
3391
|
L: 210,
|
|
3390
3392
|
S: void 0,
|
|
@@ -3674,14 +3676,14 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3674
3676
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3675
3677
|
import { Planet } from "@phosphor-icons/react";
|
|
3676
3678
|
import React40, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
|
|
3677
|
-
import { log as
|
|
3679
|
+
import { log as log14 } from "@dxos/log";
|
|
3678
3680
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3679
3681
|
import { useId as useId9, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3680
3682
|
|
|
3681
3683
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3682
3684
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
3683
3685
|
import { assign as assign3, createMachine as createMachine3 } from "xstate";
|
|
3684
|
-
import { log as
|
|
3686
|
+
import { log as log12 } from "@dxos/log";
|
|
3685
3687
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
|
|
3686
3688
|
var spaceMachine = createMachine3({
|
|
3687
3689
|
id: "space",
|
|
@@ -3719,7 +3721,7 @@ var spaceMachine = createMachine3({
|
|
|
3719
3721
|
invitation: () => void 0
|
|
3720
3722
|
}),
|
|
3721
3723
|
log: (context, event) => {
|
|
3722
|
-
|
|
3724
|
+
log12("[transition]", {
|
|
3723
3725
|
event,
|
|
3724
3726
|
context
|
|
3725
3727
|
}, {
|
|
@@ -3743,7 +3745,7 @@ var useSpaceMachine = (options) => {
|
|
|
3743
3745
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3744
3746
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3745
3747
|
import React39, { useCallback as useCallback7, useState as useState13 } from "react";
|
|
3746
|
-
import { log as
|
|
3748
|
+
import { log as log13 } from "@dxos/log";
|
|
3747
3749
|
import { useConfig } from "@dxos/react-client";
|
|
3748
3750
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3749
3751
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
@@ -3754,7 +3756,7 @@ var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
|
3754
3756
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
3755
3757
|
const invitationCode = InvitationEncoder4.encode(invitation);
|
|
3756
3758
|
if (invitation.state === Invitation8.State.CONNECTING) {
|
|
3757
|
-
|
|
3759
|
+
log13.info(JSON.stringify({
|
|
3758
3760
|
invitationCode,
|
|
3759
3761
|
authCode: invitation.authCode
|
|
3760
3762
|
}), void 0, {
|
|
@@ -3776,6 +3778,7 @@ var SpaceManager = (props) => {
|
|
|
3776
3778
|
label: t("invite one label"),
|
|
3777
3779
|
description: t("invite one description"),
|
|
3778
3780
|
icon: UserPlus,
|
|
3781
|
+
testId: "spaces-panel.invite-one",
|
|
3779
3782
|
onClick: useCallback7(() => {
|
|
3780
3783
|
const invitation = space.share?.({
|
|
3781
3784
|
type: Invitation8.Type.INTERACTIVE,
|
|
@@ -3787,13 +3790,15 @@ var SpaceManager = (props) => {
|
|
|
3787
3790
|
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
3788
3791
|
}
|
|
3789
3792
|
}, [
|
|
3790
|
-
space
|
|
3793
|
+
space,
|
|
3794
|
+
target
|
|
3791
3795
|
])
|
|
3792
3796
|
},
|
|
3793
3797
|
inviteMany: {
|
|
3794
3798
|
label: t("invite many label"),
|
|
3795
3799
|
description: t("invite many description"),
|
|
3796
3800
|
icon: UsersThree,
|
|
3801
|
+
testId: "spaces-panel.invite-many",
|
|
3797
3802
|
onClick: useCallback7(() => {
|
|
3798
3803
|
const invitation = space.share?.({
|
|
3799
3804
|
type: Invitation8.Type.DELEGATED,
|
|
@@ -3805,7 +3810,8 @@ var SpaceManager = (props) => {
|
|
|
3805
3810
|
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
3806
3811
|
}
|
|
3807
3812
|
}, [
|
|
3808
|
-
space
|
|
3813
|
+
space,
|
|
3814
|
+
target
|
|
3809
3815
|
])
|
|
3810
3816
|
}
|
|
3811
3817
|
};
|
|
@@ -3828,7 +3834,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3828
3834
|
}
|
|
3829
3835
|
}
|
|
3830
3836
|
};
|
|
3831
|
-
const [activeAction, setInternalActiveAction] = useState13(localStorage.getItem(activeActionKey) ?? "
|
|
3837
|
+
const [activeAction, setInternalActiveAction] = useState13(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
3832
3838
|
const setActiveAction = (nextAction) => {
|
|
3833
3839
|
setInternalActiveAction(nextAction);
|
|
3834
3840
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3887,8 +3893,8 @@ var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
|
3887
3893
|
}, name ?? space.key.truncate())));
|
|
3888
3894
|
};
|
|
3889
3895
|
var SpacePanelImpl = (props) => {
|
|
3890
|
-
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3891
|
-
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3896
|
+
const { titleId, activeView, space, hideHeading, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3897
|
+
return /* @__PURE__ */ React40.createElement(React40.Fragment, null, !hideHeading && /* @__PURE__ */ React40.createElement(SpacePanelHeading, {
|
|
3892
3898
|
...rest,
|
|
3893
3899
|
titleId,
|
|
3894
3900
|
space
|
|
@@ -3928,9 +3934,9 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3928
3934
|
});
|
|
3929
3935
|
useEffect7(() => {
|
|
3930
3936
|
const subscription = spaceService.subscribe((state) => {
|
|
3931
|
-
|
|
3937
|
+
log14("[state]", state, {
|
|
3932
3938
|
F: __dxlog_file13,
|
|
3933
|
-
L:
|
|
3939
|
+
L: 95,
|
|
3934
3940
|
S: void 0,
|
|
3935
3941
|
C: (f, a) => f(...a)
|
|
3936
3942
|
});
|
|
@@ -4035,13 +4041,13 @@ import React47, { StrictMode } from "react";
|
|
|
4035
4041
|
import { createRoot } from "react-dom/client";
|
|
4036
4042
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
4037
4043
|
import { AgentHostingProvider, ClientProvider, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2 } from "@dxos/react-client";
|
|
4038
|
-
import { Button as Button11, Dialog as Dialog3, ThemeProvider, Tooltip as
|
|
4044
|
+
import { Button as Button11, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip7, useTranslation as useTranslation26 } from "@dxos/react-ui";
|
|
4039
4045
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
4040
4046
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
4041
4047
|
|
|
4042
4048
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
4043
4049
|
import React46, { useEffect as useEffect8, useState as useState14 } from "react";
|
|
4044
|
-
import { log as
|
|
4050
|
+
import { log as log15 } from "@dxos/log";
|
|
4045
4051
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
4046
4052
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
4047
4053
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
@@ -4119,7 +4125,7 @@ var Shell = ({ runtime }) => {
|
|
|
4119
4125
|
]);
|
|
4120
4126
|
useEffect8(() => {
|
|
4121
4127
|
if (layout === ShellLayout.SPACE && !space) {
|
|
4122
|
-
|
|
4128
|
+
log15.warn("No space found for shell space invitations.", void 0, {
|
|
4123
4129
|
F: __dxlog_file14,
|
|
4124
4130
|
L: 67,
|
|
4125
4131
|
S: void 0,
|
|
@@ -4539,7 +4545,7 @@ var runShell = async (config = new Config()) => {
|
|
|
4539
4545
|
config,
|
|
4540
4546
|
services,
|
|
4541
4547
|
noBanner: true
|
|
4542
|
-
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(
|
|
4548
|
+
}, /* @__PURE__ */ React47.createElement(ClipboardProvider, null, /* @__PURE__ */ React47.createElement(Tooltip7.Provider, null, /* @__PURE__ */ React47.createElement(AgentHostingProvider, null, /* @__PURE__ */ React47.createElement(Shell, {
|
|
4543
4549
|
runtime
|
|
4544
4550
|
}))))))));
|
|
4545
4551
|
} catch {
|