@dxos/shell 0.4.4-next.e0df51e → 0.4.5-main.2d76d4e
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 +10469 -10735
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +64 -65
- 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 +27 -11
- package/dist/lib/browser/react.mjs.map +3 -3
- package/dist/types/src/components/Clipboard/CopyButton.js +2 -2
- package/dist/types/src/components/Clipboard/CopyButton.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +1 -1
- 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 +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +5 -4
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +10 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +2 -1
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +2 -1
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +21 -21
- package/src/components/Clipboard/CopyButton.tsx +2 -2
- package/src/panels/IdentityPanel/IdentityPanel.tsx +1 -1
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +1 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +17 -7
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +21 -5
- package/src/translations/locales/en-US.ts +2 -1
|
@@ -57,7 +57,7 @@ var CopyButton = ({ value, classNames, iconProps, ...props }) => {
|
|
|
57
57
|
className: mx("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
58
58
|
}, /* @__PURE__ */ React2.createElement("span", {
|
|
59
59
|
className: "pli-1"
|
|
60
|
-
}, t("copy
|
|
60
|
+
}, t("copy success label")), /* @__PURE__ */ React2.createElement(Check, {
|
|
61
61
|
className: getSize(5),
|
|
62
62
|
...iconProps
|
|
63
63
|
})));
|
|
@@ -66,7 +66,7 @@ var CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }) =
|
|
|
66
66
|
const { t } = useTranslation("os");
|
|
67
67
|
const { textValue, setTextValue } = useClipboardContext();
|
|
68
68
|
const isCopied = textValue === value;
|
|
69
|
-
const label = isCopied ? t("copy
|
|
69
|
+
const label = isCopied ? t("copy success label") : t("copy invitation code label");
|
|
70
70
|
const [open, setOpen] = useState2(false);
|
|
71
71
|
return /* @__PURE__ */ React2.createElement(Tooltip.Root, {
|
|
72
72
|
delayDuration: 1500,
|
|
@@ -1012,7 +1012,7 @@ var DeviceManager = ({ devices, active, send }) => {
|
|
|
1012
1012
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1013
1013
|
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive } from "@phosphor-icons/react";
|
|
1014
1014
|
import React23, { useCallback as useCallback4 } from "react";
|
|
1015
|
-
import { useClient as useClient2 } from "@dxos/react-client";
|
|
1015
|
+
import { useAgentHostingProviderClient, useClient as useClient2 } from "@dxos/react-client";
|
|
1016
1016
|
import { useHaloInvitations } from "@dxos/react-client/halo";
|
|
1017
1017
|
import { Invitation as Invitation3, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
1018
1018
|
import { DensityProvider, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
@@ -1021,6 +1021,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1021
1021
|
const { send } = props;
|
|
1022
1022
|
const client = useClient2();
|
|
1023
1023
|
const invitations = useHaloInvitations();
|
|
1024
|
+
const agentHostingProviderClient = useAgentHostingProviderClient(client.config);
|
|
1024
1025
|
const onInvitationEvent = useCallback4((invitation) => {
|
|
1025
1026
|
const invitationCode = InvitationEncoder.encode(invitation);
|
|
1026
1027
|
if (invitation.state === Invitation3.State.CONNECTING) {
|
|
@@ -1047,10 +1048,11 @@ var IdentityActionChooser = (props) => {
|
|
|
1047
1048
|
};
|
|
1048
1049
|
return /* @__PURE__ */ React23.createElement(IdentityActionChooserImpl, {
|
|
1049
1050
|
...props,
|
|
1050
|
-
onCreateInvitationClick: (e) => createInvitation(e)
|
|
1051
|
+
onCreateInvitationClick: (e) => createInvitation(e),
|
|
1052
|
+
agentHostingEnabled: !!agentHostingProviderClient
|
|
1051
1053
|
});
|
|
1052
1054
|
};
|
|
1053
|
-
var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone, doneActionParent }) => {
|
|
1055
|
+
var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone, doneActionParent, agentHostingEnabled }) => {
|
|
1054
1056
|
const { t } = useTranslation9("os");
|
|
1055
1057
|
return /* @__PURE__ */ React23.createElement("div", {
|
|
1056
1058
|
role: "none",
|
|
@@ -1059,7 +1061,7 @@ var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone
|
|
|
1059
1061
|
density: "coarse"
|
|
1060
1062
|
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1061
1063
|
className: "grow justify-center flex flex-col gap-1"
|
|
1062
|
-
}, /* @__PURE__ */ React23.createElement(Action, {
|
|
1064
|
+
}, agentHostingEnabled && /* @__PURE__ */ React23.createElement(Action, {
|
|
1063
1065
|
"data-testid": "manage-agent",
|
|
1064
1066
|
onClick: () => send?.({
|
|
1065
1067
|
type: "chooseAgent"
|
|
@@ -1153,10 +1155,14 @@ var ProfileForm = (props) => {
|
|
|
1153
1155
|
});
|
|
1154
1156
|
};
|
|
1155
1157
|
var ProfileFormImpl = (props) => {
|
|
1156
|
-
const { active,
|
|
1158
|
+
const { active, identity, send, onUpdateProfile, validationMessage } = props;
|
|
1159
|
+
const profile = identity?.profile;
|
|
1157
1160
|
const disabled = !active;
|
|
1158
1161
|
const { t } = useTranslation10("os");
|
|
1159
1162
|
const [inputValue, setInputValue] = useState3(profile?.displayName ?? "");
|
|
1163
|
+
const { textValue, setTextValue } = useClipboardContext();
|
|
1164
|
+
const identityHex = identity?.identityKey.toHex();
|
|
1165
|
+
const copied = textValue === identityHex;
|
|
1160
1166
|
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", {
|
|
1161
1167
|
role: "none",
|
|
1162
1168
|
className: "grow flex flex-col justify-center"
|
|
@@ -1172,6 +1178,15 @@ var ProfileFormImpl = (props) => {
|
|
|
1172
1178
|
displayName: inputValue
|
|
1173
1179
|
})
|
|
1174
1180
|
})), /* @__PURE__ */ React24.createElement(Actions, null, /* @__PURE__ */ React24.createElement(Action, {
|
|
1181
|
+
variant: "ghost",
|
|
1182
|
+
disabled,
|
|
1183
|
+
onClick: () => {
|
|
1184
|
+
if (identityHex) {
|
|
1185
|
+
void setTextValue(identityHex);
|
|
1186
|
+
}
|
|
1187
|
+
},
|
|
1188
|
+
"data-testid": "update-profile-form-copy-key"
|
|
1189
|
+
}, t(copied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React24.createElement(Action, {
|
|
1175
1190
|
variant: "ghost",
|
|
1176
1191
|
disabled,
|
|
1177
1192
|
onClick: () => send?.({
|
|
@@ -1239,14 +1254,14 @@ var SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }
|
|
|
1239
1254
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1240
1255
|
import { useCallback as useCallback5, useEffect as useEffect2, useState as useState4 } from "react";
|
|
1241
1256
|
import { invariant } from "@dxos/invariant";
|
|
1242
|
-
import { useAgentHostingProviderClient } from "@dxos/react-client";
|
|
1257
|
+
import { useAgentHostingProviderClient as useAgentHostingProviderClient2 } from "@dxos/react-client";
|
|
1243
1258
|
import { Invitation as Invitation4, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1244
1259
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
|
|
1245
1260
|
var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
1246
1261
|
const [validationMessage, setValidationMessage] = useState4("");
|
|
1247
1262
|
const [agentStatus, setAgentStatus] = useState4("");
|
|
1248
1263
|
const [agentActive, setAgentActive] = useState4(false);
|
|
1249
|
-
const agentHostingProviderClient =
|
|
1264
|
+
const agentHostingProviderClient = useAgentHostingProviderClient2(client.config);
|
|
1250
1265
|
useEffect2(() => {
|
|
1251
1266
|
const fetchAgentStatus = async () => {
|
|
1252
1267
|
if (agentHostingProviderClient) {
|
|
@@ -1486,7 +1501,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1486
1501
|
}, /* @__PURE__ */ React27.createElement(ProfileForm, {
|
|
1487
1502
|
send: rest.send,
|
|
1488
1503
|
active: activeView === "update profile form",
|
|
1489
|
-
|
|
1504
|
+
identity,
|
|
1490
1505
|
onUpdateProfile
|
|
1491
1506
|
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1492
1507
|
classNames: viewStyles,
|
|
@@ -3603,7 +3618,8 @@ var os = {
|
|
|
3603
3618
|
"identity offline description": "Offline",
|
|
3604
3619
|
"sidebar label": "DXOS sidebar",
|
|
3605
3620
|
"copy invitation code label": "Copy URL",
|
|
3606
|
-
"copy
|
|
3621
|
+
"copy success label": "Copied",
|
|
3622
|
+
"copy self public key label": "Copy public key",
|
|
3607
3623
|
"open share panel label": "View QR code",
|
|
3608
3624
|
"joining space heading": "Joining space",
|
|
3609
3625
|
"join space heading": "Enter space invitation",
|