@dxos/shell 0.3.11-main.cf6cc01 → 0.3.11-main.d56f337
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 +6281 -6166
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +69 -69
- 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 +443 -369
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs.map +1 -1
- package/dist/types/src/components/Panel/Action.js +1 -1
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +5 -1
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +10 -6
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +12 -2
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +2 -2
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js +26 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts +16 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js +40 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +2 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +2 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts +15 -0
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +78 -0
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -0
- package/dist/types/src/translations/locales/en-US.d.ts +5 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +5 -0
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +21 -21
- package/src/components/Panel/Action.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +7 -1
- package/src/panels/IdentityPanel/IdentityPanel.tsx +20 -9
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +15 -2
- package/src/panels/IdentityPanel/identityMachine.ts +3 -3
- package/src/panels/IdentityPanel/steps/AgentForm.tsx +61 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +1 -6
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +82 -0
- package/src/panels/IdentityPanel/steps/index.ts +2 -1
- package/src/panels/IdentityPanel/useAgentHandlers.ts +88 -0
- package/src/translations/locales/en-US.ts +5 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.d.ts +0 -19
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.js +0 -122
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.js.map +0 -1
- package/src/panels/IdentityPanel/steps/AgentPanel.tsx +0 -165
|
@@ -598,8 +598,8 @@ var Action = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
|
|
|
598
598
|
classNames: [
|
|
599
599
|
isFull && "is-full",
|
|
600
600
|
"bs-11 flex gap-2 mbs-2",
|
|
601
|
-
|
|
602
|
-
|
|
601
|
+
...buttonColorFragment(props),
|
|
602
|
+
classNames
|
|
603
603
|
],
|
|
604
604
|
ref: forwardedRef,
|
|
605
605
|
variant
|
|
@@ -813,17 +813,17 @@ var SpaceListItem = /* @__PURE__ */ forwardRef7(({ space, onClick }, ref) => {
|
|
|
813
813
|
});
|
|
814
814
|
|
|
815
815
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
816
|
-
import
|
|
816
|
+
import React40 from "react";
|
|
817
817
|
import { Dialog, useId as useId9 } from "@dxos/react-ui";
|
|
818
818
|
|
|
819
819
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
820
|
-
import
|
|
820
|
+
import React27, { useEffect as useEffect3, useMemo as useMemo3 } from "react";
|
|
821
821
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
822
822
|
import { log as log3 } from "@dxos/log";
|
|
823
|
-
import { useClient as
|
|
824
|
-
import { useIdentity, useDevices } from "@dxos/react-client/halo";
|
|
823
|
+
import { useClient as useClient3 } from "@dxos/react-client";
|
|
824
|
+
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
825
825
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
826
|
-
import { Avatar as Avatar4, DensityProvider as DensityProvider2, useId as useId5, useJdenticonHref as useJdenticonHref3, useTranslation as
|
|
826
|
+
import { Avatar as Avatar4, DensityProvider as DensityProvider2, useId as useId5, useJdenticonHref as useJdenticonHref3, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
827
827
|
|
|
828
828
|
// packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts
|
|
829
829
|
import { useMachine } from "@xstate/react";
|
|
@@ -871,7 +871,8 @@ var identityMachine = createMachine({
|
|
|
871
871
|
actions: "log"
|
|
872
872
|
}
|
|
873
873
|
}
|
|
874
|
-
}
|
|
874
|
+
},
|
|
875
|
+
signingOut: {}
|
|
875
876
|
},
|
|
876
877
|
on: {
|
|
877
878
|
unchooseAction: {
|
|
@@ -903,6 +904,10 @@ var identityMachine = createMachine({
|
|
|
903
904
|
target: ".managingProfile",
|
|
904
905
|
actions: "log"
|
|
905
906
|
},
|
|
907
|
+
chooseSignOut: {
|
|
908
|
+
target: ".signingOut",
|
|
909
|
+
actions: "log"
|
|
910
|
+
},
|
|
906
911
|
chooseAgent: {
|
|
907
912
|
target: ".managingAgent",
|
|
908
913
|
actions: "log"
|
|
@@ -946,18 +951,51 @@ var useIdentityMachine = (client, options) => {
|
|
|
946
951
|
});
|
|
947
952
|
};
|
|
948
953
|
|
|
949
|
-
// packages/sdk/shell/src/panels/IdentityPanel/steps/
|
|
954
|
+
// packages/sdk/shell/src/panels/IdentityPanel/steps/AgentForm.tsx
|
|
950
955
|
import React21 from "react";
|
|
951
956
|
import { useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
952
|
-
var
|
|
953
|
-
const {
|
|
957
|
+
var AgentForm = (props) => {
|
|
958
|
+
const { active, onAgentCreate, onAgentDestroy, send, validationMessage, agentStatus, agentActive, agentProviderDisabled } = props;
|
|
954
959
|
const disabled = !active;
|
|
960
|
+
const { t } = useTranslation7("os");
|
|
955
961
|
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("div", {
|
|
962
|
+
role: "none",
|
|
963
|
+
className: "grow flex flex-col justify-center"
|
|
964
|
+
}, /* @__PURE__ */ React21.createElement(Input, {
|
|
965
|
+
validationMessage,
|
|
966
|
+
label: /* @__PURE__ */ React21.createElement(StepHeading, null, "Agent Status"),
|
|
967
|
+
disabled,
|
|
968
|
+
"data-testid": "agent-status",
|
|
969
|
+
value: agentStatus
|
|
970
|
+
})), /* @__PURE__ */ React21.createElement(Actions, null, /* @__PURE__ */ React21.createElement(Action, {
|
|
971
|
+
disabled: agentActive || agentProviderDisabled,
|
|
972
|
+
onClick: () => onAgentCreate?.(),
|
|
973
|
+
"data-testid": "create-agent"
|
|
974
|
+
}, "Create Agent"), /* @__PURE__ */ React21.createElement(Action, {
|
|
975
|
+
disabled: !agentActive || agentProviderDisabled,
|
|
976
|
+
onClick: () => onAgentDestroy?.(),
|
|
977
|
+
"data-testid": "destroy-agent"
|
|
978
|
+
}, "Destroy Agent"), /* @__PURE__ */ React21.createElement(Action, {
|
|
979
|
+
disabled,
|
|
980
|
+
onClick: () => send?.({
|
|
981
|
+
type: "unchooseAction"
|
|
982
|
+
}),
|
|
983
|
+
"data-testid": "update-profile-form-back"
|
|
984
|
+
}, t("back label"))));
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
// packages/sdk/shell/src/panels/IdentityPanel/steps/DeviceManager.tsx
|
|
988
|
+
import React22 from "react";
|
|
989
|
+
import { useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
990
|
+
var DeviceManager = ({ devices, active, send }) => {
|
|
991
|
+
const { t } = useTranslation8("os");
|
|
992
|
+
const disabled = !active;
|
|
993
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement("div", {
|
|
956
994
|
role: "none",
|
|
957
995
|
className: "grow"
|
|
958
|
-
}, /* @__PURE__ */
|
|
996
|
+
}, /* @__PURE__ */ React22.createElement(DeviceList, {
|
|
959
997
|
devices
|
|
960
|
-
})), /* @__PURE__ */
|
|
998
|
+
})), /* @__PURE__ */ React22.createElement(Actions, null, /* @__PURE__ */ React22.createElement(Action, {
|
|
961
999
|
variant: "ghost",
|
|
962
1000
|
disabled,
|
|
963
1001
|
onClick: () => send?.({
|
|
@@ -969,11 +1007,11 @@ var DeviceManager = ({ devices, active, send }) => {
|
|
|
969
1007
|
|
|
970
1008
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
971
1009
|
import { CaretRight, Devices, Plus, Power, UserGear, HardDrive } from "@phosphor-icons/react";
|
|
972
|
-
import
|
|
1010
|
+
import React23, { useCallback as useCallback4 } from "react";
|
|
973
1011
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
974
1012
|
import { useHaloInvitations } from "@dxos/react-client/halo";
|
|
975
1013
|
import { Invitation as Invitation3, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
976
|
-
import { DensityProvider, useTranslation as
|
|
1014
|
+
import { DensityProvider, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
977
1015
|
import { getSize as getSize6 } from "@dxos/react-ui-theme";
|
|
978
1016
|
var IdentityActionChooser = (props) => {
|
|
979
1017
|
const { send } = props;
|
|
@@ -1003,95 +1041,95 @@ var IdentityActionChooser = (props) => {
|
|
|
1003
1041
|
invitation
|
|
1004
1042
|
});
|
|
1005
1043
|
};
|
|
1006
|
-
return /* @__PURE__ */
|
|
1044
|
+
return /* @__PURE__ */ React23.createElement(IdentityActionChooserImpl, {
|
|
1007
1045
|
...props,
|
|
1008
1046
|
onCreateInvitationClick: (e) => createInvitation(e)
|
|
1009
1047
|
});
|
|
1010
1048
|
};
|
|
1011
1049
|
var IdentityActionChooserImpl = ({ onCreateInvitationClick, active, send, onDone, doneActionParent }) => {
|
|
1012
|
-
const { t } =
|
|
1013
|
-
return /* @__PURE__ */
|
|
1050
|
+
const { t } = useTranslation9("os");
|
|
1051
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1014
1052
|
role: "none",
|
|
1015
1053
|
className: "grow flex flex-col gap-1"
|
|
1016
|
-
}, /* @__PURE__ */
|
|
1054
|
+
}, /* @__PURE__ */ React23.createElement(DensityProvider, {
|
|
1017
1055
|
density: "coarse"
|
|
1018
|
-
}, /* @__PURE__ */
|
|
1056
|
+
}, /* @__PURE__ */ React23.createElement("div", {
|
|
1019
1057
|
className: "grow justify-center flex flex-col gap-1"
|
|
1020
|
-
}, /* @__PURE__ */
|
|
1058
|
+
}, /* @__PURE__ */ React23.createElement(Action, {
|
|
1021
1059
|
"data-testid": "manage-agent",
|
|
1022
1060
|
onClick: () => send?.({
|
|
1023
1061
|
type: "chooseAgent"
|
|
1024
1062
|
}),
|
|
1025
1063
|
classNames: "plb-4"
|
|
1026
|
-
}, /* @__PURE__ */
|
|
1064
|
+
}, /* @__PURE__ */ React23.createElement(HardDrive, {
|
|
1027
1065
|
className: getSize6(6)
|
|
1028
|
-
}), /* @__PURE__ */
|
|
1066
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1029
1067
|
className: "grow mli-3"
|
|
1030
|
-
}, "Manage Agent"), /* @__PURE__ */
|
|
1068
|
+
}, "Manage Agent"), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1031
1069
|
weight: "bold",
|
|
1032
1070
|
className: getSize6(4)
|
|
1033
|
-
})), /* @__PURE__ */
|
|
1071
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1034
1072
|
disabled: !active,
|
|
1035
1073
|
"data-testid": "devices-panel.create-invitation",
|
|
1036
1074
|
onClick: onCreateInvitationClick,
|
|
1037
1075
|
classNames: "plb-4"
|
|
1038
|
-
}, /* @__PURE__ */
|
|
1076
|
+
}, /* @__PURE__ */ React23.createElement(Plus, {
|
|
1039
1077
|
className: getSize6(6)
|
|
1040
|
-
}), /* @__PURE__ */
|
|
1078
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1041
1079
|
className: "grow mli-3"
|
|
1042
|
-
}, t("choose add device label")), /* @__PURE__ */
|
|
1080
|
+
}, t("choose add device label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1043
1081
|
weight: "bold",
|
|
1044
1082
|
className: getSize6(4)
|
|
1045
|
-
})), /* @__PURE__ */
|
|
1083
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1046
1084
|
"data-testid": "manage-devices",
|
|
1047
1085
|
onClick: () => send?.({
|
|
1048
1086
|
type: "chooseDevices"
|
|
1049
1087
|
}),
|
|
1050
1088
|
classNames: "plb-4"
|
|
1051
|
-
}, /* @__PURE__ */
|
|
1089
|
+
}, /* @__PURE__ */ React23.createElement(Devices, {
|
|
1052
1090
|
className: getSize6(6)
|
|
1053
|
-
}), /* @__PURE__ */
|
|
1091
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1054
1092
|
className: "grow mli-3"
|
|
1055
|
-
}, t("choose devices label")), /* @__PURE__ */
|
|
1093
|
+
}, t("choose devices label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1056
1094
|
weight: "bold",
|
|
1057
1095
|
className: getSize6(4)
|
|
1058
|
-
})), /* @__PURE__ */
|
|
1096
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1059
1097
|
"data-testid": "manage-profile",
|
|
1060
1098
|
onClick: () => send?.({
|
|
1061
1099
|
type: "chooseProfile"
|
|
1062
1100
|
}),
|
|
1063
1101
|
classNames: "plb-4"
|
|
1064
|
-
}, /* @__PURE__ */
|
|
1102
|
+
}, /* @__PURE__ */ React23.createElement(UserGear, {
|
|
1065
1103
|
className: getSize6(6)
|
|
1066
|
-
}), /* @__PURE__ */
|
|
1104
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1067
1105
|
className: "grow mli-3"
|
|
1068
|
-
}, t("choose profile label")), /* @__PURE__ */
|
|
1106
|
+
}, t("choose profile label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1069
1107
|
weight: "bold",
|
|
1070
1108
|
className: getSize6(4)
|
|
1071
|
-
})), /* @__PURE__ */
|
|
1072
|
-
disabled: true,
|
|
1109
|
+
})), /* @__PURE__ */ React23.createElement(Action, {
|
|
1073
1110
|
"data-testid": "sign-out",
|
|
1074
|
-
onClick: () => {
|
|
1075
|
-
|
|
1111
|
+
onClick: () => send?.({
|
|
1112
|
+
type: "chooseSignOut"
|
|
1113
|
+
}),
|
|
1076
1114
|
classNames: "plb-4"
|
|
1077
|
-
}, /* @__PURE__ */
|
|
1115
|
+
}, /* @__PURE__ */ React23.createElement(Power, {
|
|
1078
1116
|
className: getSize6(6)
|
|
1079
|
-
}), /* @__PURE__ */
|
|
1117
|
+
}), /* @__PURE__ */ React23.createElement("span", {
|
|
1080
1118
|
className: "grow mli-3"
|
|
1081
|
-
}, t("choose sign out label")), /* @__PURE__ */
|
|
1119
|
+
}, t("choose sign out label")), /* @__PURE__ */ React23.createElement(CaretRight, {
|
|
1082
1120
|
weight: "bold",
|
|
1083
1121
|
className: getSize6(4)
|
|
1084
1122
|
})))));
|
|
1085
1123
|
};
|
|
1086
1124
|
|
|
1087
1125
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
1088
|
-
import
|
|
1126
|
+
import React24, { useState as useState3 } from "react";
|
|
1089
1127
|
import { log as log2 } from "@dxos/log";
|
|
1090
|
-
import { useTranslation as
|
|
1128
|
+
import { useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
1091
1129
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx";
|
|
1092
1130
|
var ProfileForm = (props) => {
|
|
1093
1131
|
const { onUpdateProfile } = props;
|
|
1094
|
-
const { t } =
|
|
1132
|
+
const { t } = useTranslation10("os");
|
|
1095
1133
|
const [validationMessage, setValidationMessage] = useState3("");
|
|
1096
1134
|
const handleUpdateProfile = async (profile) => {
|
|
1097
1135
|
await onUpdateProfile?.(profile).catch((error) => {
|
|
@@ -1104,7 +1142,7 @@ var ProfileForm = (props) => {
|
|
|
1104
1142
|
setValidationMessage(t("failed to update profile message"));
|
|
1105
1143
|
});
|
|
1106
1144
|
};
|
|
1107
|
-
return /* @__PURE__ */
|
|
1145
|
+
return /* @__PURE__ */ React24.createElement(ProfileFormImpl, {
|
|
1108
1146
|
...props,
|
|
1109
1147
|
onUpdateProfile: handleUpdateProfile,
|
|
1110
1148
|
validationMessage
|
|
@@ -1113,14 +1151,14 @@ var ProfileForm = (props) => {
|
|
|
1113
1151
|
var ProfileFormImpl = (props) => {
|
|
1114
1152
|
const { active, profile, send, onUpdateProfile, validationMessage } = props;
|
|
1115
1153
|
const disabled = !active;
|
|
1116
|
-
const { t } =
|
|
1154
|
+
const { t } = useTranslation10("os");
|
|
1117
1155
|
const [inputValue, setInputValue] = useState3(profile?.displayName ?? "");
|
|
1118
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", {
|
|
1119
1157
|
role: "none",
|
|
1120
1158
|
className: "grow flex flex-col justify-center"
|
|
1121
|
-
}, /* @__PURE__ */
|
|
1159
|
+
}, /* @__PURE__ */ React24.createElement(Input, {
|
|
1122
1160
|
validationMessage,
|
|
1123
|
-
label: /* @__PURE__ */
|
|
1161
|
+
label: /* @__PURE__ */ React24.createElement(StepHeading, null, t("display name input label")),
|
|
1124
1162
|
disabled,
|
|
1125
1163
|
"data-testid": "display-name-input",
|
|
1126
1164
|
placeholder: t("display name input placeholder"),
|
|
@@ -1129,14 +1167,14 @@ var ProfileFormImpl = (props) => {
|
|
|
1129
1167
|
onKeyDown: ({ key }) => key === "Enter" && onUpdateProfile?.({
|
|
1130
1168
|
displayName: inputValue
|
|
1131
1169
|
})
|
|
1132
|
-
})), /* @__PURE__ */
|
|
1170
|
+
})), /* @__PURE__ */ React24.createElement(Actions, null, /* @__PURE__ */ React24.createElement(Action, {
|
|
1133
1171
|
variant: "ghost",
|
|
1134
1172
|
disabled,
|
|
1135
1173
|
onClick: () => send?.({
|
|
1136
1174
|
type: "unchooseAction"
|
|
1137
1175
|
}),
|
|
1138
1176
|
"data-testid": "update-profile-form-back"
|
|
1139
|
-
}, t("back label")), /* @__PURE__ */
|
|
1177
|
+
}, t("back label")), /* @__PURE__ */ React24.createElement(Action, {
|
|
1140
1178
|
variant: "primary",
|
|
1141
1179
|
disabled,
|
|
1142
1180
|
onClick: () => onUpdateProfile?.({
|
|
@@ -1146,21 +1184,62 @@ var ProfileFormImpl = (props) => {
|
|
|
1146
1184
|
}, t("done label"))));
|
|
1147
1185
|
};
|
|
1148
1186
|
|
|
1149
|
-
// packages/sdk/shell/src/panels/IdentityPanel/steps/
|
|
1150
|
-
import
|
|
1187
|
+
// packages/sdk/shell/src/panels/IdentityPanel/steps/SignOutChooser.tsx
|
|
1188
|
+
import { Warning } from "@phosphor-icons/react";
|
|
1189
|
+
import React25 from "react";
|
|
1190
|
+
import { Message, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1191
|
+
import { getSize as getSize7, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1192
|
+
var SignOutChooser = (props) => {
|
|
1193
|
+
const { t } = useTranslation11("os");
|
|
1194
|
+
const onResetDevice = () => {
|
|
1195
|
+
if (window.confirm(t("reset device confirm message"))) {
|
|
1196
|
+
void props.onResetDevice?.();
|
|
1197
|
+
}
|
|
1198
|
+
};
|
|
1199
|
+
return /* @__PURE__ */ React25.createElement(SignOutChooserImpl, {
|
|
1200
|
+
disabled: !props.active,
|
|
1201
|
+
onBack: () => props.send?.({
|
|
1202
|
+
type: "unchooseAction"
|
|
1203
|
+
}),
|
|
1204
|
+
onResetDevice,
|
|
1205
|
+
onJoinNewIdentity: props.onJoinNewIdentity
|
|
1206
|
+
});
|
|
1207
|
+
};
|
|
1208
|
+
var SignOutChooserImpl = ({ disabled, onResetDevice, onJoinNewIdentity, onBack }) => {
|
|
1209
|
+
const { t } = useTranslation11("os");
|
|
1210
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement("div", {
|
|
1211
|
+
role: "none",
|
|
1212
|
+
className: "grow flex flex-col justify-center"
|
|
1213
|
+
}, /* @__PURE__ */ React25.createElement(Message.Root, {
|
|
1214
|
+
valence: "error"
|
|
1215
|
+
}, /* @__PURE__ */ React25.createElement(Message.Title, null, /* @__PURE__ */ React25.createElement(Warning, {
|
|
1216
|
+
className: mx18(getSize7(6), "inline mie-2")
|
|
1217
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React25.createElement(Message.Body, null, t("sign out chooser message")))), /* @__PURE__ */ React25.createElement(Actions, null, /* @__PURE__ */ React25.createElement(Action, {
|
|
1218
|
+
disabled,
|
|
1219
|
+
onClick: onBack
|
|
1220
|
+
}, t("back label")), /* @__PURE__ */ React25.createElement(Action, {
|
|
1221
|
+
variant: "primary",
|
|
1222
|
+
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1223
|
+
disabled,
|
|
1224
|
+
onClick: onJoinNewIdentity
|
|
1225
|
+
}, t("join new identity label")), /* @__PURE__ */ React25.createElement(Action, {
|
|
1226
|
+
variant: "primary",
|
|
1227
|
+
classNames: "!bg-error-500 hover:!bg-error-550",
|
|
1228
|
+
disabled,
|
|
1229
|
+
onClick: onResetDevice
|
|
1230
|
+
}, t("reset device label"))));
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1234
|
+
import { useCallback as useCallback5, useEffect as useEffect2, useState as useState4 } from "react";
|
|
1151
1235
|
import { invariant } from "@dxos/invariant";
|
|
1152
|
-
import {
|
|
1153
|
-
import { useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1236
|
+
import { useAgentHostingProviderClient } from "@dxos/react-client";
|
|
1154
1237
|
import { Invitation as Invitation4, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1155
|
-
|
|
1156
|
-
var
|
|
1157
|
-
var AgentForm = (props) => {
|
|
1158
|
-
const { identity } = props;
|
|
1238
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts";
|
|
1239
|
+
var useAgentHandlers = ({ client, invitations, identity }) => {
|
|
1159
1240
|
const [validationMessage, setValidationMessage] = useState4("");
|
|
1160
1241
|
const [agentStatus, setAgentStatus] = useState4("");
|
|
1161
1242
|
const [agentActive, setAgentActive] = useState4(false);
|
|
1162
|
-
const client = useClient3();
|
|
1163
|
-
const invitations = useHaloInvitations2();
|
|
1164
1243
|
const agentHostingProviderClient = useAgentHostingProviderClient(client.config);
|
|
1165
1244
|
useEffect2(() => {
|
|
1166
1245
|
const fetchAgentStatus = async () => {
|
|
@@ -1179,7 +1258,7 @@ var AgentForm = (props) => {
|
|
|
1179
1258
|
};
|
|
1180
1259
|
void fetchAgentStatus();
|
|
1181
1260
|
}, []);
|
|
1182
|
-
const
|
|
1261
|
+
const handleAgentCreate = useCallback5(async (invitation) => {
|
|
1183
1262
|
const invitationCode = InvitationEncoder2.encode(invitation);
|
|
1184
1263
|
if (invitation.state === Invitation4.State.CONNECTING) {
|
|
1185
1264
|
console.log(JSON.stringify({
|
|
@@ -1188,7 +1267,7 @@ var AgentForm = (props) => {
|
|
|
1188
1267
|
}));
|
|
1189
1268
|
invariant(identity, "Identity not found", {
|
|
1190
1269
|
F: __dxlog_file3,
|
|
1191
|
-
L:
|
|
1270
|
+
L: 50,
|
|
1192
1271
|
S: void 0,
|
|
1193
1272
|
A: [
|
|
1194
1273
|
"identity",
|
|
@@ -1207,19 +1286,19 @@ var AgentForm = (props) => {
|
|
|
1207
1286
|
}
|
|
1208
1287
|
}
|
|
1209
1288
|
}, []);
|
|
1210
|
-
const
|
|
1289
|
+
const onAgentCreate = async () => {
|
|
1211
1290
|
invitations.forEach((invitation2) => invitation2.cancel());
|
|
1212
1291
|
const invitation = client.halo.share({
|
|
1213
1292
|
type: Invitation4.Type.MULTIUSE,
|
|
1214
1293
|
authMethod: Invitation4.AuthMethod.NONE
|
|
1215
1294
|
});
|
|
1216
|
-
invitation.subscribe(
|
|
1295
|
+
invitation.subscribe(handleAgentCreate);
|
|
1217
1296
|
};
|
|
1218
|
-
const
|
|
1297
|
+
const onAgentDestroy = async () => {
|
|
1219
1298
|
const identity2 = client.halo.identity.get();
|
|
1220
1299
|
invariant(identity2, "Identity not found", {
|
|
1221
1300
|
F: __dxlog_file3,
|
|
1222
|
-
L:
|
|
1301
|
+
L: 76,
|
|
1223
1302
|
S: void 0,
|
|
1224
1303
|
A: [
|
|
1225
1304
|
"identity",
|
|
@@ -1235,61 +1314,30 @@ var AgentForm = (props) => {
|
|
|
1235
1314
|
setValidationMessage(`error destroying agent: ${err.message}`);
|
|
1236
1315
|
}
|
|
1237
1316
|
};
|
|
1238
|
-
return
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
onAgentDestroy: handleAgentDestroy,
|
|
1317
|
+
return {
|
|
1318
|
+
onAgentCreate,
|
|
1319
|
+
onAgentDestroy,
|
|
1242
1320
|
validationMessage,
|
|
1243
1321
|
agentStatus,
|
|
1244
|
-
agentActive
|
|
1245
|
-
|
|
1246
|
-
});
|
|
1247
|
-
};
|
|
1248
|
-
var AgentFormImpl = (props) => {
|
|
1249
|
-
const { active, onAgentCreate, onAgentDestroy, send, validationMessage, agentStatus, agentActive, agentProviderDisabled } = props;
|
|
1250
|
-
const disabled = !active;
|
|
1251
|
-
const { t } = useTranslation10("os");
|
|
1252
|
-
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", {
|
|
1253
|
-
role: "none",
|
|
1254
|
-
className: "grow flex flex-col justify-center"
|
|
1255
|
-
}, /* @__PURE__ */ React24.createElement(Input, {
|
|
1256
|
-
validationMessage,
|
|
1257
|
-
label: /* @__PURE__ */ React24.createElement(StepHeading, null, "Agent Status"),
|
|
1258
|
-
disabled,
|
|
1259
|
-
"data-testid": "agent-status",
|
|
1260
|
-
value: agentStatus
|
|
1261
|
-
})), /* @__PURE__ */ React24.createElement(Actions, null, /* @__PURE__ */ React24.createElement(Action, {
|
|
1262
|
-
disabled: agentActive || agentProviderDisabled,
|
|
1263
|
-
onClick: () => onAgentCreate?.(),
|
|
1264
|
-
"data-testid": "create-agent"
|
|
1265
|
-
}, "Create Agent"), /* @__PURE__ */ React24.createElement(Action, {
|
|
1266
|
-
disabled: !agentActive || agentProviderDisabled,
|
|
1267
|
-
onClick: () => onAgentDestroy?.(),
|
|
1268
|
-
"data-testid": "destroy-agent"
|
|
1269
|
-
}, "Destroy Agent"), /* @__PURE__ */ React24.createElement(Action, {
|
|
1270
|
-
disabled,
|
|
1271
|
-
onClick: () => send?.({
|
|
1272
|
-
type: "unchooseAction"
|
|
1273
|
-
}),
|
|
1274
|
-
"data-testid": "update-profile-form-back"
|
|
1275
|
-
}, t("back label"))));
|
|
1322
|
+
agentActive
|
|
1323
|
+
};
|
|
1276
1324
|
};
|
|
1277
1325
|
|
|
1278
1326
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1279
1327
|
import { Check as Check3, X as X3 } from "@phosphor-icons/react";
|
|
1280
|
-
import
|
|
1328
|
+
import React26, { useMemo as useMemo2 } from "react";
|
|
1281
1329
|
import { QR } from "react-qr-rounded";
|
|
1282
1330
|
import { Invitation as Invitation5 } from "@dxos/react-client/invitations";
|
|
1283
|
-
import { useId as useId4, useTranslation as
|
|
1284
|
-
import { descriptionText as descriptionText7, getSize as
|
|
1331
|
+
import { useId as useId4, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1332
|
+
import { descriptionText as descriptionText7, getSize as getSize8, mx as mx19 } from "@dxos/react-ui-theme";
|
|
1285
1333
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1286
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ React26.createElement(Viewport.View, {
|
|
1287
1335
|
...props,
|
|
1288
1336
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1289
1337
|
}, children);
|
|
1290
1338
|
};
|
|
1291
1339
|
var InvitationManager = ({ invitationUrl, active, send, status, type, authCode, id }) => {
|
|
1292
|
-
const { t } =
|
|
1340
|
+
const { t } = useTranslation12("os");
|
|
1293
1341
|
const qrLabel = useId4("invitation-manager__qr-code");
|
|
1294
1342
|
const statusValue = type === Invitation5.Type.MULTIUSE ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1295
1343
|
const showAuthCode = statusValue === 3;
|
|
@@ -1307,50 +1355,50 @@ var InvitationManager = ({ invitationUrl, active, send, status, type, authCode,
|
|
|
1307
1355
|
}, [
|
|
1308
1356
|
statusValue
|
|
1309
1357
|
]);
|
|
1310
|
-
return /* @__PURE__ */
|
|
1358
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Viewport.Root, {
|
|
1311
1359
|
activeView,
|
|
1312
1360
|
classNames: "grow plb-1"
|
|
1313
|
-
}, /* @__PURE__ */
|
|
1361
|
+
}, /* @__PURE__ */ React26.createElement(Viewport.Views, null, /* @__PURE__ */ React26.createElement(InvitationManagerView, {
|
|
1314
1362
|
id: "showing qr",
|
|
1315
1363
|
emoji: emoji2
|
|
1316
|
-
}, /* @__PURE__ */
|
|
1364
|
+
}, /* @__PURE__ */ React26.createElement("p", {
|
|
1317
1365
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1318
|
-
}, t(type === Invitation5.Type.MULTIUSE ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1366
|
+
}, t(type === Invitation5.Type.MULTIUSE ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React26.createElement("div", {
|
|
1319
1367
|
role: "none",
|
|
1320
|
-
className:
|
|
1321
|
-
}, /* @__PURE__ */
|
|
1368
|
+
className: mx19(descriptionText7, "is-full max-is-[14rem] relative")
|
|
1369
|
+
}, /* @__PURE__ */ React26.createElement(QR, {
|
|
1322
1370
|
rounding: 100,
|
|
1323
1371
|
backgroundColor: "transparent",
|
|
1324
1372
|
color: "currentColor",
|
|
1325
|
-
className:
|
|
1373
|
+
className: mx19("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1326
1374
|
"aria-labelledby": qrLabel,
|
|
1327
1375
|
errorCorrectionLevel: "Q",
|
|
1328
1376
|
cutout: true
|
|
1329
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1377
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React26.createElement(Centered, null, /* @__PURE__ */ React26.createElement(Emoji, {
|
|
1330
1378
|
text: emoji2
|
|
1331
|
-
}))), /* @__PURE__ */
|
|
1379
|
+
}))), /* @__PURE__ */ React26.createElement("span", {
|
|
1332
1380
|
id: qrLabel,
|
|
1333
1381
|
className: "sr-only"
|
|
1334
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1382
|
+
}, t("qr label")), /* @__PURE__ */ React26.createElement(CopyButton, {
|
|
1335
1383
|
variant: "ghost",
|
|
1336
1384
|
value: invitationUrl ?? "never"
|
|
1337
|
-
})), /* @__PURE__ */
|
|
1385
|
+
})), /* @__PURE__ */ React26.createElement(InvitationManagerView, {
|
|
1338
1386
|
id: "showing auth code"
|
|
1339
|
-
}, /* @__PURE__ */
|
|
1387
|
+
}, /* @__PURE__ */ React26.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React26.createElement(AuthCode, {
|
|
1340
1388
|
code: authCode,
|
|
1341
1389
|
large: true,
|
|
1342
1390
|
classNames: "text-black dark:text-white"
|
|
1343
|
-
}), /* @__PURE__ */
|
|
1391
|
+
}), /* @__PURE__ */ React26.createElement(Label, null, "Be sure the other device is showing this symbol:"), emoji2 && /* @__PURE__ */ React26.createElement(Emoji, {
|
|
1344
1392
|
text: emoji2
|
|
1345
|
-
})), /* @__PURE__ */
|
|
1393
|
+
})), /* @__PURE__ */ React26.createElement(InvitationManagerView, {
|
|
1346
1394
|
id: "showing final"
|
|
1347
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1348
|
-
className:
|
|
1349
|
-
}) : /* @__PURE__ */
|
|
1350
|
-
className:
|
|
1351
|
-
})))), /* @__PURE__ */
|
|
1395
|
+
}, statusValue > 0 ? /* @__PURE__ */ React26.createElement(Check3, {
|
|
1396
|
+
className: mx19("m-1.5", getSize8(6))
|
|
1397
|
+
}) : /* @__PURE__ */ React26.createElement(X3, {
|
|
1398
|
+
className: mx19("m-1.5", getSize8(6))
|
|
1399
|
+
})))), /* @__PURE__ */ React26.createElement(Actions, {
|
|
1352
1400
|
classNames: "mbs-4"
|
|
1353
|
-
}, /* @__PURE__ */
|
|
1401
|
+
}, /* @__PURE__ */ React26.createElement(Action, {
|
|
1354
1402
|
disabled: !active,
|
|
1355
1403
|
onClick: () => send?.({
|
|
1356
1404
|
type: "deselectInvitation"
|
|
@@ -1363,27 +1411,27 @@ var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/I
|
|
|
1363
1411
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1364
1412
|
var IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
1365
1413
|
const fallbackHref = useJdenticonHref3(identity.identityKey.toHex(), 12);
|
|
1366
|
-
return /* @__PURE__ */
|
|
1414
|
+
return /* @__PURE__ */ React27.createElement(Heading, {
|
|
1367
1415
|
titleId,
|
|
1368
1416
|
title,
|
|
1369
|
-
corner: /* @__PURE__ */
|
|
1417
|
+
corner: /* @__PURE__ */ React27.createElement(CloseButton, {
|
|
1370
1418
|
onDone
|
|
1371
1419
|
})
|
|
1372
|
-
}, /* @__PURE__ */
|
|
1420
|
+
}, /* @__PURE__ */ React27.createElement(Avatar4.Root, {
|
|
1373
1421
|
size: 12,
|
|
1374
1422
|
variant: "circle",
|
|
1375
1423
|
status: "active"
|
|
1376
|
-
}, /* @__PURE__ */
|
|
1424
|
+
}, /* @__PURE__ */ React27.createElement(Avatar4.Frame, {
|
|
1377
1425
|
classNames: "block mbs-4 mbe-2 mli-auto chromatic-ignore"
|
|
1378
|
-
}, /* @__PURE__ */
|
|
1426
|
+
}, /* @__PURE__ */ React27.createElement(Avatar4.Fallback, {
|
|
1379
1427
|
href: fallbackHref
|
|
1380
|
-
})), /* @__PURE__ */
|
|
1428
|
+
})), /* @__PURE__ */ React27.createElement(Avatar4.Label, {
|
|
1381
1429
|
classNames: "block text-center font-light text-xl"
|
|
1382
1430
|
}, identity.profile?.displayName ?? generateName2(identity.identityKey.toHex()))));
|
|
1383
1431
|
};
|
|
1384
1432
|
var IdentityPanelImpl = (props) => {
|
|
1385
|
-
const { identity, titleId, activeView, onUpdateProfile, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, onDone, ...rest } = props;
|
|
1386
|
-
const { t } =
|
|
1433
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetDevice, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, onDone, ...rest } = props;
|
|
1434
|
+
const { t } = useTranslation13("os");
|
|
1387
1435
|
const title = useMemo3(() => {
|
|
1388
1436
|
switch (activeView) {
|
|
1389
1437
|
case "agent manager":
|
|
@@ -1397,66 +1445,77 @@ var IdentityPanelImpl = (props) => {
|
|
|
1397
1445
|
activeView,
|
|
1398
1446
|
t
|
|
1399
1447
|
]);
|
|
1400
|
-
|
|
1401
|
-
activeView
|
|
1402
|
-
});
|
|
1403
|
-
return /* @__PURE__ */ React26.createElement(DensityProvider2, {
|
|
1448
|
+
return /* @__PURE__ */ React27.createElement(DensityProvider2, {
|
|
1404
1449
|
density: "fine"
|
|
1405
|
-
}, /* @__PURE__ */
|
|
1450
|
+
}, /* @__PURE__ */ React27.createElement(IdentityHeading, {
|
|
1406
1451
|
identity,
|
|
1407
1452
|
titleId,
|
|
1408
1453
|
title,
|
|
1409
1454
|
onDone
|
|
1410
|
-
}), /* @__PURE__ */
|
|
1455
|
+
}), /* @__PURE__ */ React27.createElement(Viewport.Root, {
|
|
1411
1456
|
activeView
|
|
1412
|
-
}, /* @__PURE__ */
|
|
1457
|
+
}, /* @__PURE__ */ React27.createElement(Viewport.Views, null, /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1413
1458
|
id: "identity action chooser",
|
|
1414
1459
|
classNames: viewStyles
|
|
1415
|
-
}, /* @__PURE__ */
|
|
1460
|
+
}, /* @__PURE__ */ React27.createElement(IdentityActionChooserComponent, {
|
|
1416
1461
|
active: activeView === "identity action chooser",
|
|
1417
1462
|
...rest
|
|
1418
|
-
})), /* @__PURE__ */
|
|
1463
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1419
1464
|
id: "device invitation manager",
|
|
1420
1465
|
classNames: viewStyles
|
|
1421
|
-
}, /* @__PURE__ */
|
|
1466
|
+
}, /* @__PURE__ */ React27.createElement(InvitationManagerComponent, {
|
|
1422
1467
|
active: activeView === "device invitation manager",
|
|
1423
1468
|
...rest,
|
|
1424
1469
|
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
1425
|
-
})), /* @__PURE__ */
|
|
1470
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1426
1471
|
id: "device manager",
|
|
1427
1472
|
classNames: viewStyles
|
|
1428
|
-
}, /* @__PURE__ */
|
|
1473
|
+
}, /* @__PURE__ */ React27.createElement(DeviceManager, {
|
|
1429
1474
|
active: activeView === "device manager",
|
|
1430
1475
|
...rest
|
|
1431
|
-
})), /* @__PURE__ */
|
|
1476
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1432
1477
|
classNames: viewStyles,
|
|
1433
1478
|
id: "update profile form"
|
|
1434
|
-
}, /* @__PURE__ */
|
|
1479
|
+
}, /* @__PURE__ */ React27.createElement(ProfileForm, {
|
|
1435
1480
|
send: rest.send,
|
|
1436
1481
|
active: activeView === "update profile form",
|
|
1437
1482
|
profile: identity.profile,
|
|
1438
1483
|
onUpdateProfile
|
|
1439
|
-
})), /* @__PURE__ */
|
|
1484
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1485
|
+
classNames: viewStyles,
|
|
1486
|
+
id: "signing out"
|
|
1487
|
+
}, /* @__PURE__ */ React27.createElement(SignOutChooser, {
|
|
1488
|
+
send: rest.send,
|
|
1489
|
+
active: activeView === "signing out",
|
|
1490
|
+
onResetDevice,
|
|
1491
|
+
onJoinNewIdentity
|
|
1492
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
1440
1493
|
classNames: viewStyles,
|
|
1441
1494
|
id: "agent manager"
|
|
1442
|
-
}, /* @__PURE__ */
|
|
1495
|
+
}, /* @__PURE__ */ React27.createElement(AgentForm, {
|
|
1443
1496
|
send: rest.send,
|
|
1444
1497
|
active: activeView === "agent manager",
|
|
1445
|
-
|
|
1498
|
+
...rest
|
|
1446
1499
|
})))));
|
|
1447
1500
|
};
|
|
1448
1501
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
1449
1502
|
const invitationStatus = useInvitationStatus2(invitation);
|
|
1450
|
-
return /* @__PURE__ */
|
|
1503
|
+
return /* @__PURE__ */ React27.createElement(IdentityPanelImpl, {
|
|
1451
1504
|
...props,
|
|
1452
1505
|
...invitationStatus
|
|
1453
1506
|
});
|
|
1454
1507
|
};
|
|
1455
1508
|
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, ...props }) => {
|
|
1456
1509
|
const titleId = useId5("identityPanel__heading", propsTitleId);
|
|
1457
|
-
const client =
|
|
1510
|
+
const client = useClient3();
|
|
1458
1511
|
const devices = useDevices();
|
|
1459
1512
|
const identity = useIdentity();
|
|
1513
|
+
const invitations = useHaloInvitations2();
|
|
1514
|
+
const agentProps = useAgentHandlers({
|
|
1515
|
+
client,
|
|
1516
|
+
identity,
|
|
1517
|
+
invitations
|
|
1518
|
+
});
|
|
1460
1519
|
if (!identity) {
|
|
1461
1520
|
console.error("IdentityPanel rendered with no active identity.");
|
|
1462
1521
|
return null;
|
|
@@ -1466,7 +1525,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1466
1525
|
const subscription = identityService.subscribe((state) => {
|
|
1467
1526
|
log3("[state]", state, {
|
|
1468
1527
|
F: __dxlog_file4,
|
|
1469
|
-
L:
|
|
1528
|
+
L: 138,
|
|
1470
1529
|
S: void 0,
|
|
1471
1530
|
C: (f, a) => f(...a)
|
|
1472
1531
|
});
|
|
@@ -1492,6 +1551,8 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1492
1551
|
}
|
|
1493
1552
|
].some(identityState.matches):
|
|
1494
1553
|
return "update profile form";
|
|
1554
|
+
case identityState.matches("signingOut"):
|
|
1555
|
+
return "signing out";
|
|
1495
1556
|
case [
|
|
1496
1557
|
{
|
|
1497
1558
|
managingAgent: "idle"
|
|
@@ -1507,10 +1568,6 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1507
1568
|
}, [
|
|
1508
1569
|
identityState
|
|
1509
1570
|
]);
|
|
1510
|
-
console.log({
|
|
1511
|
-
activeView,
|
|
1512
|
-
identityState
|
|
1513
|
-
});
|
|
1514
1571
|
const onUpdateProfile = async (profile) => {
|
|
1515
1572
|
identitySend({
|
|
1516
1573
|
type: "updateProfile"
|
|
@@ -1525,42 +1582,43 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1525
1582
|
send: identitySend,
|
|
1526
1583
|
titleId,
|
|
1527
1584
|
createInvitationUrl,
|
|
1528
|
-
onUpdateProfile
|
|
1585
|
+
onUpdateProfile,
|
|
1586
|
+
...agentProps
|
|
1529
1587
|
};
|
|
1530
|
-
return identityState.context.invitation ? /* @__PURE__ */
|
|
1588
|
+
return identityState.context.invitation ? /* @__PURE__ */ React27.createElement(IdentityPanelWithInvitationImpl, {
|
|
1531
1589
|
...implProps,
|
|
1532
1590
|
invitation: identityState.context.invitation
|
|
1533
|
-
}) : /* @__PURE__ */
|
|
1591
|
+
}) : /* @__PURE__ */ React27.createElement(IdentityPanelImpl, implProps);
|
|
1534
1592
|
};
|
|
1535
1593
|
|
|
1536
1594
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
1537
|
-
import
|
|
1595
|
+
import React37, { useCallback as useCallback7, useEffect as useEffect5, useMemo as useMemo4 } from "react";
|
|
1538
1596
|
import { log as log8 } from "@dxos/log";
|
|
1539
|
-
import { useClient as
|
|
1597
|
+
import { useClient as useClient6, useMulticastObservable } from "@dxos/react-client";
|
|
1540
1598
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
1541
1599
|
import { DensityProvider as DensityProvider3, useId as useId7, useThemeContext as useThemeContext3 } from "@dxos/react-ui";
|
|
1542
1600
|
|
|
1543
1601
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
1544
1602
|
import { X as X4 } from "@phosphor-icons/react";
|
|
1545
|
-
import
|
|
1546
|
-
import { Button as Button5, useTranslation as
|
|
1547
|
-
import { descriptionText as descriptionText8, getSize as
|
|
1603
|
+
import React28, { cloneElement, forwardRef as forwardRef8 } from "react";
|
|
1604
|
+
import { Button as Button5, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
1605
|
+
import { descriptionText as descriptionText8, getSize as getSize9, mx as mx20 } from "@dxos/react-ui-theme";
|
|
1548
1606
|
var JoinHeading = /* @__PURE__ */ forwardRef8(({ mode, titleId, onExit, exitActionParent }, forwardedRef) => {
|
|
1549
|
-
const { t } =
|
|
1550
|
-
const exitButton = /* @__PURE__ */
|
|
1607
|
+
const { t } = useTranslation14("os");
|
|
1608
|
+
const exitButton = /* @__PURE__ */ React28.createElement(Button5, {
|
|
1551
1609
|
variant: "ghost",
|
|
1552
1610
|
...onExit && {
|
|
1553
1611
|
onClick: onExit
|
|
1554
1612
|
},
|
|
1555
|
-
classNames:
|
|
1613
|
+
classNames: mx20(descriptionText8, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
1556
1614
|
"data-testid": "join-exit"
|
|
1557
|
-
}, /* @__PURE__ */
|
|
1615
|
+
}, /* @__PURE__ */ React28.createElement(X4, {
|
|
1558
1616
|
weight: "bold",
|
|
1559
|
-
className:
|
|
1560
|
-
}), /* @__PURE__ */
|
|
1617
|
+
className: getSize9(4)
|
|
1618
|
+
}), /* @__PURE__ */ React28.createElement("span", {
|
|
1561
1619
|
className: "sr-only"
|
|
1562
1620
|
}, t("exit label")));
|
|
1563
|
-
return /* @__PURE__ */
|
|
1621
|
+
return /* @__PURE__ */ React28.createElement(Heading, {
|
|
1564
1622
|
ref: forwardedRef,
|
|
1565
1623
|
titleId,
|
|
1566
1624
|
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
@@ -2152,17 +2210,17 @@ var useJoinMachine = (client, options) => {
|
|
|
2152
2210
|
|
|
2153
2211
|
// packages/sdk/shell/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx
|
|
2154
2212
|
import { CaretRight as CaretRight2, Plus as Plus2, QrCode, Textbox } from "@phosphor-icons/react";
|
|
2155
|
-
import
|
|
2156
|
-
import { useTranslation as
|
|
2157
|
-
import { getSize as
|
|
2213
|
+
import React29 from "react";
|
|
2214
|
+
import { useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
2215
|
+
import { getSize as getSize10 } from "@dxos/react-ui-theme";
|
|
2158
2216
|
var AdditionMethodChooser = (viewStateProps) => {
|
|
2159
2217
|
const disabled = !viewStateProps.active;
|
|
2160
2218
|
const { send } = viewStateProps;
|
|
2161
|
-
const { t } =
|
|
2219
|
+
const { t } = useTranslation15("os");
|
|
2162
2220
|
const sharedButtonProps = {
|
|
2163
2221
|
disabled,
|
|
2164
|
-
after: /* @__PURE__ */
|
|
2165
|
-
className:
|
|
2222
|
+
after: /* @__PURE__ */ React29.createElement(CaretRight2, {
|
|
2223
|
+
className: getSize10(4),
|
|
2166
2224
|
weight: "bold"
|
|
2167
2225
|
}),
|
|
2168
2226
|
slots: {
|
|
@@ -2171,37 +2229,37 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2171
2229
|
}
|
|
2172
2230
|
}
|
|
2173
2231
|
};
|
|
2174
|
-
return /* @__PURE__ */
|
|
2232
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ React29.createElement("div", {
|
|
2175
2233
|
role: "none",
|
|
2176
2234
|
className: "flex flex-col gap-1 grow"
|
|
2177
|
-
}, /* @__PURE__ */
|
|
2235
|
+
}, /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2178
2236
|
...sharedButtonProps,
|
|
2179
2237
|
description: t("create identity description"),
|
|
2180
|
-
before: /* @__PURE__ */
|
|
2181
|
-
className:
|
|
2238
|
+
before: /* @__PURE__ */ React29.createElement(Plus2, {
|
|
2239
|
+
className: getSize10(6)
|
|
2182
2240
|
}),
|
|
2183
2241
|
onClick: () => send({
|
|
2184
2242
|
type: "createIdentity"
|
|
2185
2243
|
}),
|
|
2186
2244
|
"data-autofocus": "choosingAuthMethod",
|
|
2187
2245
|
"data-testid": "create-identity"
|
|
2188
|
-
}, t("create identity label")), /* @__PURE__ */
|
|
2246
|
+
}, t("create identity label")), /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2189
2247
|
...sharedButtonProps,
|
|
2190
2248
|
description: t("join identity description"),
|
|
2191
|
-
before: /* @__PURE__ */
|
|
2192
|
-
className:
|
|
2249
|
+
before: /* @__PURE__ */ React29.createElement(QrCode, {
|
|
2250
|
+
className: getSize10(6)
|
|
2193
2251
|
}),
|
|
2194
2252
|
onClick: () => send({
|
|
2195
2253
|
type: "acceptHaloInvitation"
|
|
2196
2254
|
}),
|
|
2197
2255
|
"data-testid": "join-identity"
|
|
2198
|
-
}, t("join identity label")), /* @__PURE__ */
|
|
2256
|
+
}, t("join identity label")), /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2199
2257
|
...sharedButtonProps,
|
|
2200
2258
|
// TODO(mykola): Implement recover.
|
|
2201
2259
|
disabled: true,
|
|
2202
2260
|
description: t("recover identity description"),
|
|
2203
|
-
before: /* @__PURE__ */
|
|
2204
|
-
className:
|
|
2261
|
+
before: /* @__PURE__ */ React29.createElement(Textbox, {
|
|
2262
|
+
className: getSize10(6)
|
|
2205
2263
|
}),
|
|
2206
2264
|
onClick: () => send({
|
|
2207
2265
|
type: "recoverIdentity"
|
|
@@ -2211,37 +2269,37 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2211
2269
|
};
|
|
2212
2270
|
|
|
2213
2271
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityAdded.tsx
|
|
2214
|
-
import
|
|
2272
|
+
import React30, { cloneElement as cloneElement2 } from "react";
|
|
2215
2273
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
2216
|
-
import { Avatar as Avatar5, useId as useId6, useJdenticonHref as useJdenticonHref4, useTranslation as
|
|
2217
|
-
import { mx as
|
|
2274
|
+
import { Avatar as Avatar5, useId as useId6, useJdenticonHref as useJdenticonHref4, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
2275
|
+
import { mx as mx21 } from "@dxos/react-ui-theme";
|
|
2218
2276
|
var IdentityAdded = (props) => {
|
|
2219
2277
|
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2220
2278
|
const disabled = !active;
|
|
2221
|
-
const { t } =
|
|
2279
|
+
const { t } = useTranslation16("os");
|
|
2222
2280
|
const fallbackValue = addedIdentity?.identityKey.toHex();
|
|
2223
2281
|
const labelId = useId6("identityListItem__label");
|
|
2224
2282
|
const jdenticon = useJdenticonHref4(fallbackValue ?? "", 12);
|
|
2225
2283
|
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName3(addedIdentity?.identityKey.toHex()));
|
|
2226
|
-
const doneAction = /* @__PURE__ */
|
|
2284
|
+
const doneAction = /* @__PURE__ */ React30.createElement(Action, {
|
|
2227
2285
|
...onDone && {
|
|
2228
2286
|
onClick: () => onDone(null)
|
|
2229
2287
|
},
|
|
2230
2288
|
disabled,
|
|
2231
2289
|
"data-autofocus": "confirmingAddedIdentity",
|
|
2232
2290
|
"data-testid": "identity-added-done"
|
|
2233
|
-
}, /* @__PURE__ */
|
|
2234
|
-
return /* @__PURE__ */
|
|
2291
|
+
}, /* @__PURE__ */ React30.createElement("span", null, t("done label")));
|
|
2292
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ React30.createElement("div", {
|
|
2235
2293
|
role: "none",
|
|
2236
2294
|
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2237
|
-
}, /* @__PURE__ */
|
|
2295
|
+
}, /* @__PURE__ */ React30.createElement(Avatar5.Root, {
|
|
2238
2296
|
status: "active",
|
|
2239
2297
|
labelId
|
|
2240
|
-
}, /* @__PURE__ */
|
|
2298
|
+
}, /* @__PURE__ */ React30.createElement(Avatar5.Frame, null, /* @__PURE__ */ React30.createElement(Avatar5.Fallback, {
|
|
2241
2299
|
href: jdenticon
|
|
2242
|
-
})), /* @__PURE__ */
|
|
2243
|
-
classNames:
|
|
2244
|
-
}, displayName))), /* @__PURE__ */
|
|
2300
|
+
})), /* @__PURE__ */ React30.createElement(Avatar5.Label, {
|
|
2301
|
+
classNames: mx21("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2302
|
+
}, displayName))), /* @__PURE__ */ React30.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ React30.createElement(Action, {
|
|
2245
2303
|
variant: "primary",
|
|
2246
2304
|
disabled: disabled || !addedIdentity,
|
|
2247
2305
|
onClick: () => addedIdentity && send({
|
|
@@ -2253,16 +2311,16 @@ var IdentityAdded = (props) => {
|
|
|
2253
2311
|
};
|
|
2254
2312
|
|
|
2255
2313
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2256
|
-
import
|
|
2314
|
+
import React31, { useState as useState5 } from "react";
|
|
2257
2315
|
import { log as log5 } from "@dxos/log";
|
|
2258
|
-
import { useClient as
|
|
2259
|
-
import { useTranslation as
|
|
2316
|
+
import { useClient as useClient4 } from "@dxos/react-client";
|
|
2317
|
+
import { useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
2260
2318
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2261
2319
|
var IdentityInput = (props) => {
|
|
2262
2320
|
const { send, method } = props;
|
|
2263
2321
|
const isRecover = method === "recover identity";
|
|
2264
|
-
const client =
|
|
2265
|
-
const { t } =
|
|
2322
|
+
const client = useClient4();
|
|
2323
|
+
const { t } = useTranslation17("os");
|
|
2266
2324
|
const [validationMessage, setValidationMessage] = useState5("");
|
|
2267
2325
|
const createIdentity = (displayName) => {
|
|
2268
2326
|
void client.halo.createIdentity({
|
|
@@ -2282,7 +2340,7 @@ var IdentityInput = (props) => {
|
|
|
2282
2340
|
setValidationMessage(t(isRecover ? "failed to recover identity message" : "failed to create identity message"));
|
|
2283
2341
|
});
|
|
2284
2342
|
};
|
|
2285
|
-
return /* @__PURE__ */
|
|
2343
|
+
return /* @__PURE__ */ React31.createElement(IdentityInputImpl, {
|
|
2286
2344
|
...props,
|
|
2287
2345
|
onDisplayNameConfirm: createIdentity,
|
|
2288
2346
|
validationMessage
|
|
@@ -2291,27 +2349,27 @@ var IdentityInput = (props) => {
|
|
|
2291
2349
|
var IdentityInputImpl = (props) => {
|
|
2292
2350
|
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
2293
2351
|
const disabled = !active;
|
|
2294
|
-
const { t } =
|
|
2352
|
+
const { t } = useTranslation17("os");
|
|
2295
2353
|
const [inputValue, setInputValue] = useState5("");
|
|
2296
2354
|
const isRecover = method === "recover identity";
|
|
2297
|
-
return /* @__PURE__ */
|
|
2355
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", {
|
|
2298
2356
|
role: "none",
|
|
2299
2357
|
className: "grow flex flex-col justify-center"
|
|
2300
|
-
}, /* @__PURE__ */
|
|
2358
|
+
}, /* @__PURE__ */ React31.createElement(Input, {
|
|
2301
2359
|
validationMessage,
|
|
2302
|
-
label: /* @__PURE__ */
|
|
2360
|
+
label: /* @__PURE__ */ React31.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
2303
2361
|
disabled,
|
|
2304
2362
|
"data-testid": "identity-input",
|
|
2305
2363
|
placeholder: isRecover ? "Type your recovery phrase" : "Type a display name",
|
|
2306
2364
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2307
|
-
})), /* @__PURE__ */
|
|
2365
|
+
})), /* @__PURE__ */ React31.createElement(Actions, null, /* @__PURE__ */ React31.createElement(Action, {
|
|
2308
2366
|
variant: "ghost",
|
|
2309
2367
|
disabled,
|
|
2310
2368
|
onClick: () => send?.({
|
|
2311
2369
|
type: "deselectAuthMethod"
|
|
2312
2370
|
}),
|
|
2313
2371
|
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-back`
|
|
2314
|
-
}, t("back label")), /* @__PURE__ */
|
|
2372
|
+
}, t("back label")), /* @__PURE__ */ React31.createElement(Action, {
|
|
2315
2373
|
variant: "primary",
|
|
2316
2374
|
disabled,
|
|
2317
2375
|
onClick: () => onDisplayNameConfirm?.(inputValue),
|
|
@@ -2320,31 +2378,31 @@ var IdentityInputImpl = (props) => {
|
|
|
2320
2378
|
};
|
|
2321
2379
|
|
|
2322
2380
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
2323
|
-
import
|
|
2324
|
-
import { useTranslation as
|
|
2381
|
+
import React32, { cloneElement as cloneElement3 } from "react";
|
|
2382
|
+
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2325
2383
|
var InvitationAccepted = (props) => {
|
|
2326
2384
|
const { active, Kind, doneActionParent, onDone } = props;
|
|
2327
2385
|
const disabled = !active;
|
|
2328
|
-
const { t } =
|
|
2329
|
-
const doneAction = /* @__PURE__ */
|
|
2386
|
+
const { t } = useTranslation18("os");
|
|
2387
|
+
const doneAction = /* @__PURE__ */ React32.createElement(Action, {
|
|
2330
2388
|
variant: "primary",
|
|
2331
2389
|
onClick: onDone,
|
|
2332
2390
|
disabled,
|
|
2333
2391
|
"data-autofocus": `success${Kind}Invitation finishingJoining${Kind}`,
|
|
2334
2392
|
"data-testid": `${Kind.toLowerCase()}-invitation-accepted-done`
|
|
2335
2393
|
}, t("done label"));
|
|
2336
|
-
return /* @__PURE__ */
|
|
2394
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement("div", {
|
|
2337
2395
|
role: "none",
|
|
2338
2396
|
className: "grow flex flex-col justify-center"
|
|
2339
|
-
}, /* @__PURE__ */
|
|
2397
|
+
}, /* @__PURE__ */ React32.createElement("p", {
|
|
2340
2398
|
className: "text-center text-sm font-normal"
|
|
2341
|
-
}, t("welcome message"))), /* @__PURE__ */
|
|
2399
|
+
}, t("welcome message"))), /* @__PURE__ */ React32.createElement(Actions, null, doneActionParent ? /* @__PURE__ */ cloneElement3(doneActionParent, {}, doneAction) : doneAction));
|
|
2342
2400
|
};
|
|
2343
2401
|
|
|
2344
2402
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2345
|
-
import
|
|
2403
|
+
import React33, { useState as useState6, useEffect as useEffect4, cloneElement as cloneElement4 } from "react";
|
|
2346
2404
|
import { log as log6 } from "@dxos/log";
|
|
2347
|
-
import { useTranslation as
|
|
2405
|
+
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
2348
2406
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2349
2407
|
var invitationCodeFromUrl = (text) => {
|
|
2350
2408
|
try {
|
|
@@ -2364,7 +2422,7 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2364
2422
|
var InvitationInput = (props) => {
|
|
2365
2423
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2366
2424
|
const disabled = !active;
|
|
2367
|
-
const { t } =
|
|
2425
|
+
const { t } = useTranslation19("os");
|
|
2368
2426
|
const [inputValue, setInputValue] = useState6(unredeemedCode ?? "");
|
|
2369
2427
|
useEffect4(() => {
|
|
2370
2428
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
@@ -2378,7 +2436,7 @@ var InvitationInput = (props) => {
|
|
|
2378
2436
|
succeededKeys
|
|
2379
2437
|
}
|
|
2380
2438
|
});
|
|
2381
|
-
const exitAction = /* @__PURE__ */
|
|
2439
|
+
const exitAction = /* @__PURE__ */ React33.createElement(Action, {
|
|
2382
2440
|
variant: "ghost",
|
|
2383
2441
|
disabled,
|
|
2384
2442
|
...onExit ? {
|
|
@@ -2388,11 +2446,11 @@ var InvitationInput = (props) => {
|
|
|
2388
2446
|
},
|
|
2389
2447
|
"data-testid": "join-exit"
|
|
2390
2448
|
}, t("cancel label"));
|
|
2391
|
-
return /* @__PURE__ */
|
|
2449
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
2392
2450
|
role: "none",
|
|
2393
2451
|
className: "grow flex flex-col justify-center"
|
|
2394
|
-
}, /* @__PURE__ */
|
|
2395
|
-
label: /* @__PURE__ */
|
|
2452
|
+
}, /* @__PURE__ */ React33.createElement(Input, {
|
|
2453
|
+
label: /* @__PURE__ */ React33.createElement(StepHeading, null, t("invitation input label")),
|
|
2396
2454
|
placeholder: "Type an invitation code",
|
|
2397
2455
|
disabled,
|
|
2398
2456
|
value: inputValue,
|
|
@@ -2400,14 +2458,14 @@ var InvitationInput = (props) => {
|
|
|
2400
2458
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
2401
2459
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
2402
2460
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
2403
|
-
})), /* @__PURE__ */
|
|
2461
|
+
})), /* @__PURE__ */ React33.createElement(Actions, null, Kind === "Halo" ? /* @__PURE__ */ React33.createElement(Action, {
|
|
2404
2462
|
variant: "ghost",
|
|
2405
2463
|
disabled,
|
|
2406
2464
|
onClick: () => send({
|
|
2407
2465
|
type: "deselectAuthMethod"
|
|
2408
2466
|
}),
|
|
2409
2467
|
"data-testid": `${Kind.toLowerCase()}-invitation-input-back`
|
|
2410
|
-
}, t("back label")) : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */
|
|
2468
|
+
}, t("back label")) : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React33.createElement(Action, {
|
|
2411
2469
|
variant: "primary",
|
|
2412
2470
|
disabled,
|
|
2413
2471
|
onClick: handleNext,
|
|
@@ -2416,8 +2474,8 @@ var InvitationInput = (props) => {
|
|
|
2416
2474
|
};
|
|
2417
2475
|
|
|
2418
2476
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationRescuer.tsx
|
|
2419
|
-
import
|
|
2420
|
-
import { useTranslation as
|
|
2477
|
+
import React34 from "react";
|
|
2478
|
+
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
2421
2479
|
import { descriptionText as descriptionText9 } from "@dxos/react-ui-theme";
|
|
2422
2480
|
var InvitationActions = ({
|
|
2423
2481
|
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
@@ -2429,14 +2487,14 @@ var InvitationActions = ({
|
|
|
2429
2487
|
Kind,
|
|
2430
2488
|
failReason
|
|
2431
2489
|
}) => {
|
|
2432
|
-
const { t } =
|
|
2490
|
+
const { t } = useTranslation20("os");
|
|
2433
2491
|
if (failReason) {
|
|
2434
|
-
return /* @__PURE__ */
|
|
2492
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
2435
2493
|
className: descriptionText9
|
|
2436
|
-
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */
|
|
2494
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ React34.createElement("div", {
|
|
2437
2495
|
role: "none",
|
|
2438
2496
|
className: "grow"
|
|
2439
|
-
}), /* @__PURE__ */
|
|
2497
|
+
}), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
2440
2498
|
disabled: !active,
|
|
2441
2499
|
onClick: () => send({
|
|
2442
2500
|
type: `reset${Kind}Invitation`
|
|
@@ -2444,16 +2502,16 @@ var InvitationActions = ({
|
|
|
2444
2502
|
"data-testid": "invitation-rescuer-reset"
|
|
2445
2503
|
}, t("reset label"))));
|
|
2446
2504
|
} else {
|
|
2447
|
-
return /* @__PURE__ */
|
|
2505
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
2448
2506
|
className: descriptionText9
|
|
2449
|
-
}, t("connecting status label")), /* @__PURE__ */
|
|
2507
|
+
}, t("connecting status label")), /* @__PURE__ */ React34.createElement("div", {
|
|
2450
2508
|
role: "none",
|
|
2451
2509
|
className: "grow"
|
|
2452
|
-
}), /* @__PURE__ */
|
|
2510
|
+
}), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
2453
2511
|
disabled: true,
|
|
2454
2512
|
classNames: "order-2",
|
|
2455
2513
|
"data-testid": "next"
|
|
2456
|
-
}, t("next label")), /* @__PURE__ */
|
|
2514
|
+
}, t("next label")), /* @__PURE__ */ React34.createElement(Action, {
|
|
2457
2515
|
disabled: !active,
|
|
2458
2516
|
onClick: onInvitationCancel,
|
|
2459
2517
|
"data-testid": "invitation-rescuer-cancel"
|
|
@@ -2462,28 +2520,28 @@ var InvitationActions = ({
|
|
|
2462
2520
|
};
|
|
2463
2521
|
var InvitationRescuer = (props) => {
|
|
2464
2522
|
const { Kind, invitationState, active, send } = props;
|
|
2465
|
-
const { t } =
|
|
2466
|
-
return /* @__PURE__ */
|
|
2523
|
+
const { t } = useTranslation20("os");
|
|
2524
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement("div", {
|
|
2467
2525
|
role: "none",
|
|
2468
2526
|
className: "grow flex flex-col justify-center"
|
|
2469
|
-
}, /* @__PURE__ */
|
|
2527
|
+
}, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
2470
2528
|
className: descriptionText9
|
|
2471
|
-
}, "There was a problem joining the space")), /* @__PURE__ */
|
|
2529
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
2472
2530
|
disabled: !active,
|
|
2473
2531
|
"data-testid": "invitation-rescuer-blank-reset",
|
|
2474
2532
|
onClick: () => send({
|
|
2475
2533
|
type: `reset${Kind}Invitation`
|
|
2476
2534
|
})
|
|
2477
|
-
}, t("reset label")))) : /* @__PURE__ */
|
|
2535
|
+
}, t("reset label")))) : /* @__PURE__ */ React34.createElement(InvitationActions, props));
|
|
2478
2536
|
};
|
|
2479
2537
|
|
|
2480
2538
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
2481
|
-
import
|
|
2482
|
-
import { Input as Input2, useTranslation as
|
|
2539
|
+
import React35, { useState as useState7 } from "react";
|
|
2540
|
+
import { Input as Input2, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
2483
2541
|
var pinLength = 6;
|
|
2484
2542
|
var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
2485
2543
|
const disabled = !active || pending;
|
|
2486
|
-
const { t } =
|
|
2544
|
+
const { t } = useTranslation21("os");
|
|
2487
2545
|
const invitationType = Kind.toLowerCase();
|
|
2488
2546
|
const [authCode, setAuthCode] = useState7("");
|
|
2489
2547
|
const onChange = ({ target: { value } }) => {
|
|
@@ -2492,16 +2550,16 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2492
2550
|
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
2493
2551
|
}
|
|
2494
2552
|
};
|
|
2495
|
-
return /* @__PURE__ */
|
|
2553
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("div", {
|
|
2496
2554
|
role: "none",
|
|
2497
2555
|
className: "grow flex flex-col justify-center"
|
|
2498
|
-
}, invitationId && /* @__PURE__ */
|
|
2556
|
+
}, invitationId && /* @__PURE__ */ React35.createElement(Emoji, {
|
|
2499
2557
|
text: toEmoji(invitationId)
|
|
2500
|
-
}), /* @__PURE__ */
|
|
2558
|
+
}), /* @__PURE__ */ React35.createElement(Input2.Root, failed && {
|
|
2501
2559
|
validationValence: "error"
|
|
2502
|
-
}, /* @__PURE__ */
|
|
2560
|
+
}, /* @__PURE__ */ React35.createElement(Input2.Label, {
|
|
2503
2561
|
asChild: true
|
|
2504
|
-
}, /* @__PURE__ */
|
|
2562
|
+
}, /* @__PURE__ */ React35.createElement(StepHeading, null, t("auth code input label"))), /* @__PURE__ */ React35.createElement(Input2.PinInput, {
|
|
2505
2563
|
disabled,
|
|
2506
2564
|
length: pinLength,
|
|
2507
2565
|
onChange,
|
|
@@ -2512,14 +2570,14 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2512
2570
|
"data-prevent-ios-autofocus": true,
|
|
2513
2571
|
"data-testid": `${invitationType}-auth-code-input`,
|
|
2514
2572
|
"data-1p-ignore": true
|
|
2515
|
-
}), failed && /* @__PURE__ */
|
|
2573
|
+
}), failed && /* @__PURE__ */ React35.createElement(Input2.DescriptionAndValidation, {
|
|
2516
2574
|
classNames: "text-center"
|
|
2517
|
-
}, /* @__PURE__ */
|
|
2575
|
+
}, /* @__PURE__ */ React35.createElement(Input2.Validation, null, t("failed to authenticate message"))))), /* @__PURE__ */ React35.createElement(Actions, null, /* @__PURE__ */ React35.createElement(Action, {
|
|
2518
2576
|
variant: "ghost",
|
|
2519
2577
|
disabled,
|
|
2520
2578
|
onClick: () => onInvitationCancel?.(),
|
|
2521
2579
|
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
2522
|
-
}, t("cancel label")), /* @__PURE__ */
|
|
2580
|
+
}, t("cancel label")), /* @__PURE__ */ React35.createElement(Action, {
|
|
2523
2581
|
variant: "primary",
|
|
2524
2582
|
disabled,
|
|
2525
2583
|
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
@@ -2529,14 +2587,14 @@ var InvitationAuthenticator = ({ failed, Kind, active, pending, invitationId, on
|
|
|
2529
2587
|
};
|
|
2530
2588
|
|
|
2531
2589
|
// packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx
|
|
2532
|
-
import
|
|
2590
|
+
import React36, { useState as useState8 } from "react";
|
|
2533
2591
|
import { log as log7 } from "@dxos/log";
|
|
2534
|
-
import { useClient as
|
|
2535
|
-
import { useTranslation as
|
|
2592
|
+
import { useClient as useClient5 } from "@dxos/react-client";
|
|
2593
|
+
import { useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
2536
2594
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/ResetIdentity.tsx";
|
|
2537
2595
|
var ResetIdentity = ({ send, active }) => {
|
|
2538
|
-
const client =
|
|
2539
|
-
const { t } =
|
|
2596
|
+
const client = useClient5();
|
|
2597
|
+
const { t } = useTranslation22("os");
|
|
2540
2598
|
const [validationMessage, setValidationMessage] = useState8("");
|
|
2541
2599
|
const resetIdentity = () => {
|
|
2542
2600
|
void client.reset().then(() => send?.({
|
|
@@ -2551,29 +2609,29 @@ var ResetIdentity = ({ send, active }) => {
|
|
|
2551
2609
|
setValidationMessage(t("failed to reset identity message"));
|
|
2552
2610
|
});
|
|
2553
2611
|
};
|
|
2554
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ React36.createElement(ResetIdentityImpl, {
|
|
2555
2613
|
disabled: !active,
|
|
2556
2614
|
validationMessage,
|
|
2557
2615
|
onConfirm: () => resetIdentity()
|
|
2558
2616
|
});
|
|
2559
2617
|
};
|
|
2560
2618
|
var ResetIdentityImpl = ({ disabled, validationMessage, onConfirm }) => {
|
|
2561
|
-
const { t } =
|
|
2619
|
+
const { t } = useTranslation22("os");
|
|
2562
2620
|
const confirmationValue = t("confirmation value");
|
|
2563
2621
|
const [inputValue, setInputValue] = useState8("");
|
|
2564
|
-
return /* @__PURE__ */
|
|
2622
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, /* @__PURE__ */ React36.createElement("div", {
|
|
2565
2623
|
role: "none",
|
|
2566
2624
|
className: "grow flex flex-col justify-center"
|
|
2567
|
-
}, /* @__PURE__ */
|
|
2625
|
+
}, /* @__PURE__ */ React36.createElement(Input, {
|
|
2568
2626
|
validationMessage,
|
|
2569
|
-
label: /* @__PURE__ */
|
|
2627
|
+
label: /* @__PURE__ */ React36.createElement(StepHeading, null, t("reset identity input label", {
|
|
2570
2628
|
confirmationValue
|
|
2571
2629
|
})),
|
|
2572
2630
|
disabled,
|
|
2573
2631
|
"data-testid": "identity-input",
|
|
2574
2632
|
placeholder: confirmationValue,
|
|
2575
2633
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2576
|
-
})), /* @__PURE__ */
|
|
2634
|
+
})), /* @__PURE__ */ React36.createElement(Actions, null, /* @__PURE__ */ React36.createElement(Action, {
|
|
2577
2635
|
// TODO(wittjosiah): Probably make this red?
|
|
2578
2636
|
variant: "primary",
|
|
2579
2637
|
disabled: disabled || inputValue !== confirmationValue,
|
|
@@ -2610,47 +2668,47 @@ var resolvedTextColor = (status) => status === Invitation7.State.ERROR ? errorTe
|
|
|
2610
2668
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
2611
2669
|
var JoinPanelImpl = (props) => {
|
|
2612
2670
|
const { titleId, send, activeView, failed, mode, unredeemedCodes, invitationStates, succeededKeys, failReasons, onExit, onHaloDone, onSpaceDone, exitActionParent, doneActionParent, onHaloInvitationCancel, onSpaceInvitationCancel, onHaloInvitationAuthenticate, onSpaceInvitationAuthenticate, IdentityInput: IdentityInputComponent = IdentityInput, ResetIdentity: ResetIdentityComponent = ResetIdentity } = props;
|
|
2613
|
-
return /* @__PURE__ */
|
|
2671
|
+
return /* @__PURE__ */ React37.createElement(DensityProvider3, {
|
|
2614
2672
|
density: "fine"
|
|
2615
|
-
}, mode !== "halo-only" && /* @__PURE__ */
|
|
2673
|
+
}, mode !== "halo-only" && /* @__PURE__ */ React37.createElement(JoinHeading, {
|
|
2616
2674
|
titleId,
|
|
2617
2675
|
mode,
|
|
2618
2676
|
onExit,
|
|
2619
2677
|
exitActionParent
|
|
2620
|
-
}), /* @__PURE__ */
|
|
2678
|
+
}), /* @__PURE__ */ React37.createElement(Viewport.Root, {
|
|
2621
2679
|
focusManaged: true,
|
|
2622
2680
|
activeView
|
|
2623
|
-
}, /* @__PURE__ */
|
|
2681
|
+
}, /* @__PURE__ */ React37.createElement(Viewport.Views, null, /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2624
2682
|
classNames: stepStyles,
|
|
2625
2683
|
id: "addition method chooser"
|
|
2626
|
-
}, /* @__PURE__ */
|
|
2684
|
+
}, /* @__PURE__ */ React37.createElement(AdditionMethodChooser, {
|
|
2627
2685
|
send,
|
|
2628
2686
|
active: activeView === "addition method chooser"
|
|
2629
|
-
})), /* @__PURE__ */
|
|
2687
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2630
2688
|
classNames: stepStyles,
|
|
2631
2689
|
id: "reset identity confirmation"
|
|
2632
|
-
}, /* @__PURE__ */
|
|
2690
|
+
}, /* @__PURE__ */ React37.createElement(ResetIdentityComponent, {
|
|
2633
2691
|
send,
|
|
2634
2692
|
method: "reset identity",
|
|
2635
2693
|
active: activeView === "reset identity confirmation"
|
|
2636
|
-
})), /* @__PURE__ */
|
|
2694
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2637
2695
|
classNames: stepStyles,
|
|
2638
2696
|
id: "create identity input"
|
|
2639
|
-
}, /* @__PURE__ */
|
|
2697
|
+
}, /* @__PURE__ */ React37.createElement(IdentityInputComponent, {
|
|
2640
2698
|
send,
|
|
2641
2699
|
method: "create identity",
|
|
2642
2700
|
active: activeView === "create identity input"
|
|
2643
|
-
})), /* @__PURE__ */
|
|
2701
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2644
2702
|
classNames: stepStyles,
|
|
2645
2703
|
id: "recover identity input"
|
|
2646
|
-
}, /* @__PURE__ */
|
|
2704
|
+
}, /* @__PURE__ */ React37.createElement(IdentityInputComponent, {
|
|
2647
2705
|
send,
|
|
2648
2706
|
method: "recover identity",
|
|
2649
2707
|
active: activeView === "recover identity input"
|
|
2650
|
-
})), /* @__PURE__ */
|
|
2708
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2651
2709
|
classNames: stepStyles,
|
|
2652
2710
|
id: "halo invitation input"
|
|
2653
|
-
}, /* @__PURE__ */
|
|
2711
|
+
}, /* @__PURE__ */ React37.createElement(InvitationInput, {
|
|
2654
2712
|
send,
|
|
2655
2713
|
Kind: "Halo",
|
|
2656
2714
|
active: activeView === "halo invitation input",
|
|
@@ -2660,20 +2718,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2660
2718
|
...succeededKeys?.Halo && {
|
|
2661
2719
|
succeededKeys: succeededKeys.Halo
|
|
2662
2720
|
}
|
|
2663
|
-
})), /* @__PURE__ */
|
|
2721
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2664
2722
|
classNames: stepStyles,
|
|
2665
2723
|
id: "halo invitation rescuer"
|
|
2666
|
-
}, /* @__PURE__ */
|
|
2724
|
+
}, /* @__PURE__ */ React37.createElement(InvitationRescuer, {
|
|
2667
2725
|
send,
|
|
2668
2726
|
Kind: "Halo",
|
|
2669
2727
|
active: activeView === "halo invitation rescuer",
|
|
2670
2728
|
invitationState: invitationStates?.Halo,
|
|
2671
2729
|
onInvitationCancel: onHaloInvitationCancel,
|
|
2672
2730
|
failReason: failReasons?.Halo
|
|
2673
|
-
})), /* @__PURE__ */
|
|
2731
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2674
2732
|
classNames: stepStyles,
|
|
2675
2733
|
id: "halo invitation authenticator"
|
|
2676
|
-
}, /* @__PURE__ */
|
|
2734
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAuthenticator, {
|
|
2677
2735
|
send,
|
|
2678
2736
|
Kind: "Halo",
|
|
2679
2737
|
active: activeView === "halo invitation authenticator",
|
|
@@ -2682,28 +2740,28 @@ var JoinPanelImpl = (props) => {
|
|
|
2682
2740
|
...failed.has("Halo") && {
|
|
2683
2741
|
failed: true
|
|
2684
2742
|
}
|
|
2685
|
-
})), /* @__PURE__ */
|
|
2743
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2686
2744
|
classNames: stepStyles,
|
|
2687
2745
|
id: "halo invitation accepted"
|
|
2688
|
-
}, /* @__PURE__ */
|
|
2746
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAccepted, {
|
|
2689
2747
|
send,
|
|
2690
2748
|
Kind: "Halo",
|
|
2691
2749
|
active: activeView === "halo invitation accepted",
|
|
2692
2750
|
doneActionParent,
|
|
2693
2751
|
onDone: onHaloDone
|
|
2694
|
-
})), /* @__PURE__ */
|
|
2752
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2695
2753
|
classNames: stepStyles,
|
|
2696
2754
|
id: "identity added"
|
|
2697
|
-
}, /* @__PURE__ */
|
|
2755
|
+
}, /* @__PURE__ */ React37.createElement(IdentityAdded, {
|
|
2698
2756
|
send,
|
|
2699
2757
|
mode,
|
|
2700
2758
|
active: activeView === "identity added",
|
|
2701
2759
|
doneActionParent,
|
|
2702
2760
|
onDone: onHaloDone
|
|
2703
|
-
})), /* @__PURE__ */
|
|
2761
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2704
2762
|
classNames: stepStyles,
|
|
2705
2763
|
id: "space invitation input"
|
|
2706
|
-
}, /* @__PURE__ */
|
|
2764
|
+
}, /* @__PURE__ */ React37.createElement(InvitationInput, {
|
|
2707
2765
|
send,
|
|
2708
2766
|
Kind: "Space",
|
|
2709
2767
|
active: activeView === "space invitation input",
|
|
@@ -2715,20 +2773,20 @@ var JoinPanelImpl = (props) => {
|
|
|
2715
2773
|
},
|
|
2716
2774
|
onExit,
|
|
2717
2775
|
exitActionParent
|
|
2718
|
-
})), /* @__PURE__ */
|
|
2776
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2719
2777
|
classNames: stepStyles,
|
|
2720
2778
|
id: "space invitation rescuer"
|
|
2721
|
-
}, /* @__PURE__ */
|
|
2779
|
+
}, /* @__PURE__ */ React37.createElement(InvitationRescuer, {
|
|
2722
2780
|
send,
|
|
2723
2781
|
Kind: "Space",
|
|
2724
2782
|
active: activeView === "space invitation rescuer",
|
|
2725
2783
|
invitationState: invitationStates?.Space,
|
|
2726
2784
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
2727
2785
|
failReason: failReasons?.Space
|
|
2728
|
-
})), /* @__PURE__ */
|
|
2786
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2729
2787
|
classNames: stepStyles,
|
|
2730
2788
|
id: "space invitation authenticator"
|
|
2731
|
-
}, /* @__PURE__ */
|
|
2789
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAuthenticator, {
|
|
2732
2790
|
send,
|
|
2733
2791
|
Kind: "Space",
|
|
2734
2792
|
active: activeView === "space invitation authenticator",
|
|
@@ -2737,10 +2795,10 @@ var JoinPanelImpl = (props) => {
|
|
|
2737
2795
|
...failed.has("Space") && {
|
|
2738
2796
|
failed: true
|
|
2739
2797
|
}
|
|
2740
|
-
})), /* @__PURE__ */
|
|
2798
|
+
})), /* @__PURE__ */ React37.createElement(Viewport.View, {
|
|
2741
2799
|
classNames: stepStyles,
|
|
2742
2800
|
id: "space invitation accepted"
|
|
2743
|
-
}, /* @__PURE__ */
|
|
2801
|
+
}, /* @__PURE__ */ React37.createElement(InvitationAccepted, {
|
|
2744
2802
|
send,
|
|
2745
2803
|
Kind: "Space",
|
|
2746
2804
|
active: activeView === "space invitation accepted",
|
|
@@ -2749,7 +2807,7 @@ var JoinPanelImpl = (props) => {
|
|
|
2749
2807
|
})))));
|
|
2750
2808
|
};
|
|
2751
2809
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone }) => {
|
|
2752
|
-
const client =
|
|
2810
|
+
const client = useClient6();
|
|
2753
2811
|
const identity = useIdentity2();
|
|
2754
2812
|
const { hasIosKeyboard } = useThemeContext3();
|
|
2755
2813
|
const titleId = useId7("joinPanel__heading", propsTitleId);
|
|
@@ -2980,7 +3038,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
2980
3038
|
joinState,
|
|
2981
3039
|
propsOnDone
|
|
2982
3040
|
]);
|
|
2983
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ React37.createElement(JoinPanelImpl, {
|
|
2984
3042
|
titleId,
|
|
2985
3043
|
mode,
|
|
2986
3044
|
send: joinSend,
|
|
@@ -3019,10 +3077,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialInvitationCod
|
|
|
3019
3077
|
|
|
3020
3078
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3021
3079
|
import { Planet } from "@phosphor-icons/react";
|
|
3022
|
-
import
|
|
3080
|
+
import React39, { useEffect as useEffect6, useMemo as useMemo5 } from "react";
|
|
3023
3081
|
import { log as log10 } from "@dxos/log";
|
|
3024
3082
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3025
|
-
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as
|
|
3083
|
+
import { DensityProvider as DensityProvider4, useId as useId8, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3026
3084
|
|
|
3027
3085
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3028
3086
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3088,16 +3146,16 @@ var useSpaceMachine = (options) => {
|
|
|
3088
3146
|
|
|
3089
3147
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3090
3148
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3091
|
-
import
|
|
3149
|
+
import React38, { useCallback as useCallback8, useState as useState9 } from "react";
|
|
3092
3150
|
import { useConfig } from "@dxos/react-client";
|
|
3093
3151
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3094
3152
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3095
|
-
import { ScrollArea, useTranslation as
|
|
3096
|
-
import { descriptionText as descriptionText10, mx as
|
|
3153
|
+
import { ScrollArea, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3154
|
+
import { descriptionText as descriptionText10, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3097
3155
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3098
3156
|
var SpaceManager = (props) => {
|
|
3099
3157
|
const { space, target } = props;
|
|
3100
|
-
const { t } =
|
|
3158
|
+
const { t } = useTranslation23("os");
|
|
3101
3159
|
const config = useConfig();
|
|
3102
3160
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3103
3161
|
const onInvitationEvent = useCallback8((invitation) => {
|
|
@@ -3145,7 +3203,7 @@ var SpaceManager = (props) => {
|
|
|
3145
3203
|
])
|
|
3146
3204
|
}
|
|
3147
3205
|
};
|
|
3148
|
-
return /* @__PURE__ */
|
|
3206
|
+
return /* @__PURE__ */ React38.createElement(SpaceManagerImpl, {
|
|
3149
3207
|
...props,
|
|
3150
3208
|
invitations,
|
|
3151
3209
|
inviteActions
|
|
@@ -3154,7 +3212,7 @@ var SpaceManager = (props) => {
|
|
|
3154
3212
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3155
3213
|
var SpaceManagerImpl = (props) => {
|
|
3156
3214
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3157
|
-
const { t } =
|
|
3215
|
+
const { t } = useTranslation23("os");
|
|
3158
3216
|
const inviteActions = propsInviteActions ?? {
|
|
3159
3217
|
noopInvite: {
|
|
3160
3218
|
label: t("create space invitation label"),
|
|
@@ -3172,26 +3230,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3172
3230
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3173
3231
|
Invitation8.State.CANCELLED
|
|
3174
3232
|
].includes(invitation.get().state));
|
|
3175
|
-
return /* @__PURE__ */
|
|
3233
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(ScrollArea.Root, {
|
|
3176
3234
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3177
|
-
}, /* @__PURE__ */
|
|
3235
|
+
}, /* @__PURE__ */ React38.createElement(ScrollArea.Viewport, {
|
|
3178
3236
|
classNames: "is-full pie-2"
|
|
3179
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3180
|
-
className:
|
|
3181
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3237
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement("h3", {
|
|
3238
|
+
className: mx22(headingFragment, descriptionText10)
|
|
3239
|
+
}, t("invitation list heading")), /* @__PURE__ */ React38.createElement(InvitationListComponent, {
|
|
3182
3240
|
className: "mb-2",
|
|
3183
3241
|
send,
|
|
3184
3242
|
invitations: visibleInvitations ?? [],
|
|
3185
3243
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3186
3244
|
createInvitationUrl
|
|
3187
|
-
}), /* @__PURE__ */
|
|
3188
|
-
className:
|
|
3189
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3245
|
+
}), /* @__PURE__ */ React38.createElement("h3", {
|
|
3246
|
+
className: mx22(headingFragment, descriptionText10, "mbs-2")
|
|
3247
|
+
}, t("space member list heading"))), /* @__PURE__ */ React38.createElement(SpaceMemberListComponent, {
|
|
3190
3248
|
spaceKey: space.key,
|
|
3191
3249
|
includeSelf: true
|
|
3192
|
-
})), /* @__PURE__ */
|
|
3250
|
+
})), /* @__PURE__ */ React38.createElement(ScrollArea.Scrollbar, {
|
|
3193
3251
|
orientation: "vertical"
|
|
3194
|
-
}, /* @__PURE__ */
|
|
3252
|
+
}, /* @__PURE__ */ React38.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React38.createElement(Actions, null, /* @__PURE__ */ React38.createElement(BifurcatedAction, {
|
|
3195
3253
|
disabled: !active,
|
|
3196
3254
|
actions: inviteActions,
|
|
3197
3255
|
activeAction,
|
|
@@ -3203,46 +3261,46 @@ var SpaceManagerImpl = (props) => {
|
|
|
3203
3261
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3204
3262
|
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3205
3263
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3206
|
-
const { t } =
|
|
3264
|
+
const { t } = useTranslation24("os");
|
|
3207
3265
|
const name = space.properties.name;
|
|
3208
|
-
return /* @__PURE__ */
|
|
3266
|
+
return /* @__PURE__ */ React39.createElement(Heading, {
|
|
3209
3267
|
titleId,
|
|
3210
3268
|
title: t("space panel heading"),
|
|
3211
|
-
corner: /* @__PURE__ */
|
|
3269
|
+
corner: /* @__PURE__ */ React39.createElement(CloseButton, {
|
|
3212
3270
|
"data-testid": "identity-panel-done",
|
|
3213
3271
|
onDone
|
|
3214
3272
|
})
|
|
3215
|
-
}, /* @__PURE__ */
|
|
3273
|
+
}, /* @__PURE__ */ React39.createElement("div", {
|
|
3216
3274
|
role: "none",
|
|
3217
3275
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3218
|
-
}, /* @__PURE__ */
|
|
3276
|
+
}, /* @__PURE__ */ React39.createElement(Planet, {
|
|
3219
3277
|
size: 32
|
|
3220
|
-
}), /* @__PURE__ */
|
|
3278
|
+
}), /* @__PURE__ */ React39.createElement("div", {
|
|
3221
3279
|
className: "block text-start font-light text-xl"
|
|
3222
3280
|
}, name ?? space.key.truncate())));
|
|
3223
3281
|
};
|
|
3224
3282
|
var SpacePanelImpl = (props) => {
|
|
3225
3283
|
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3226
|
-
return /* @__PURE__ */
|
|
3284
|
+
return /* @__PURE__ */ React39.createElement(DensityProvider4, {
|
|
3227
3285
|
density: "fine"
|
|
3228
|
-
}, /* @__PURE__ */
|
|
3286
|
+
}, /* @__PURE__ */ React39.createElement(SpacePanelHeading, {
|
|
3229
3287
|
...rest,
|
|
3230
3288
|
titleId,
|
|
3231
3289
|
space
|
|
3232
|
-
}), /* @__PURE__ */
|
|
3290
|
+
}), /* @__PURE__ */ React39.createElement(Viewport.Root, {
|
|
3233
3291
|
activeView
|
|
3234
|
-
}, /* @__PURE__ */
|
|
3292
|
+
}, /* @__PURE__ */ React39.createElement(Viewport.Views, null, /* @__PURE__ */ React39.createElement(Viewport.View, {
|
|
3235
3293
|
id: "space manager",
|
|
3236
3294
|
classNames: stepStyles
|
|
3237
|
-
}, /* @__PURE__ */
|
|
3295
|
+
}, /* @__PURE__ */ React39.createElement(SpaceManagerComponent, {
|
|
3238
3296
|
active: activeView === "space manager",
|
|
3239
3297
|
space,
|
|
3240
3298
|
target,
|
|
3241
3299
|
...rest
|
|
3242
|
-
})), /* @__PURE__ */
|
|
3300
|
+
})), /* @__PURE__ */ React39.createElement(Viewport.View, {
|
|
3243
3301
|
id: "space invitation manager",
|
|
3244
3302
|
classNames: stepStyles
|
|
3245
|
-
}, /* @__PURE__ */
|
|
3303
|
+
}, /* @__PURE__ */ React39.createElement(InvitationManagerComponent, {
|
|
3246
3304
|
active: activeView === "space invitation manager",
|
|
3247
3305
|
...rest,
|
|
3248
3306
|
invitationUrl: props.invitationUrl
|
|
@@ -3250,7 +3308,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3250
3308
|
};
|
|
3251
3309
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3252
3310
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3253
|
-
return /* @__PURE__ */
|
|
3311
|
+
return /* @__PURE__ */ React39.createElement(SpacePanelImpl, {
|
|
3254
3312
|
...props,
|
|
3255
3313
|
...invitationStatus,
|
|
3256
3314
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3297,63 +3355,63 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3297
3355
|
};
|
|
3298
3356
|
return spaceState.context.invitation ? (
|
|
3299
3357
|
// TODO(wittjosiah): Unused? Remove?
|
|
3300
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ React39.createElement(SpacePanelWithInvitationImpl, {
|
|
3301
3359
|
...implProps,
|
|
3302
3360
|
invitation: spaceState.context.invitation
|
|
3303
3361
|
})
|
|
3304
|
-
) : /* @__PURE__ */
|
|
3362
|
+
) : /* @__PURE__ */ React39.createElement(SpacePanelImpl, implProps);
|
|
3305
3363
|
};
|
|
3306
3364
|
|
|
3307
3365
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3308
3366
|
var IdentityDialog = (props) => {
|
|
3309
3367
|
const titleId = useId9("spaceDialog__title");
|
|
3310
|
-
return /* @__PURE__ */
|
|
3368
|
+
return /* @__PURE__ */ React40.createElement(Dialog.Root, {
|
|
3311
3369
|
defaultOpen: true,
|
|
3312
3370
|
onOpenChange: (open) => open || props.onDone?.()
|
|
3313
|
-
}, /* @__PURE__ */
|
|
3371
|
+
}, /* @__PURE__ */ React40.createElement(Dialog.Portal, null, /* @__PURE__ */ React40.createElement(Dialog.Overlay, null, /* @__PURE__ */ React40.createElement(Dialog.Content, {
|
|
3314
3372
|
"aria-labelledby": titleId,
|
|
3315
3373
|
onOpenAutoFocus: (e) => e.preventDefault()
|
|
3316
|
-
}, /* @__PURE__ */
|
|
3374
|
+
}, /* @__PURE__ */ React40.createElement(ClipboardProvider, null, /* @__PURE__ */ React40.createElement(IdentityPanel, {
|
|
3317
3375
|
...props,
|
|
3318
3376
|
titleId,
|
|
3319
|
-
doneActionParent: /* @__PURE__ */
|
|
3377
|
+
doneActionParent: /* @__PURE__ */ React40.createElement(Dialog.Close, {
|
|
3320
3378
|
asChild: true
|
|
3321
3379
|
})
|
|
3322
3380
|
}))))));
|
|
3323
3381
|
};
|
|
3324
3382
|
|
|
3325
3383
|
// packages/sdk/shell/src/composites/JoinDialog/JoinDialog.tsx
|
|
3326
|
-
import
|
|
3384
|
+
import React41 from "react";
|
|
3327
3385
|
import { AlertDialog, useId as useId10, useVisualViewport } from "@dxos/react-ui";
|
|
3328
3386
|
var JoinDialog = (joinPanelProps) => {
|
|
3329
3387
|
const titleId = useId10("joinDialog__title");
|
|
3330
3388
|
const { height } = useVisualViewport();
|
|
3331
|
-
return /* @__PURE__ */
|
|
3389
|
+
return /* @__PURE__ */ React41.createElement(AlertDialog.Root, {
|
|
3332
3390
|
defaultOpen: true,
|
|
3333
3391
|
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
3334
|
-
}, /* @__PURE__ */
|
|
3392
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog.Portal, null, /* @__PURE__ */ React41.createElement(AlertDialog.Overlay, {
|
|
3335
3393
|
classNames: "backdrop-blur",
|
|
3336
3394
|
...height && {
|
|
3337
3395
|
style: {
|
|
3338
3396
|
blockSize: `${height}px`
|
|
3339
3397
|
}
|
|
3340
3398
|
}
|
|
3341
|
-
}, /* @__PURE__ */
|
|
3399
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog.Content, {
|
|
3342
3400
|
"aria-labelledby": titleId
|
|
3343
|
-
}, /* @__PURE__ */
|
|
3401
|
+
}, /* @__PURE__ */ React41.createElement(JoinPanel, {
|
|
3344
3402
|
...joinPanelProps,
|
|
3345
3403
|
titleId,
|
|
3346
|
-
exitActionParent: /* @__PURE__ */
|
|
3404
|
+
exitActionParent: /* @__PURE__ */ React41.createElement(AlertDialog.Cancel, {
|
|
3347
3405
|
asChild: true
|
|
3348
3406
|
}),
|
|
3349
|
-
doneActionParent: /* @__PURE__ */
|
|
3407
|
+
doneActionParent: /* @__PURE__ */ React41.createElement(AlertDialog.Action, {
|
|
3350
3408
|
asChild: true
|
|
3351
3409
|
})
|
|
3352
3410
|
})))));
|
|
3353
3411
|
};
|
|
3354
3412
|
|
|
3355
3413
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3356
|
-
import
|
|
3414
|
+
import React44, { StrictMode } from "react";
|
|
3357
3415
|
import { createRoot } from "react-dom/client";
|
|
3358
3416
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3359
3417
|
import { ShellRuntimeImpl } from "@dxos/client-services";
|
|
@@ -3363,25 +3421,25 @@ import { defaultTx } from "@dxos/react-ui-theme";
|
|
|
3363
3421
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3364
3422
|
|
|
3365
3423
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3366
|
-
import
|
|
3424
|
+
import React43, { useEffect as useEffect7, useState as useState10 } from "react";
|
|
3367
3425
|
import { log as log11 } from "@dxos/log";
|
|
3368
|
-
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
3426
|
+
import { ShellDisplay, ShellLayout, useClient as useClient7 } from "@dxos/react-client";
|
|
3369
3427
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3370
3428
|
|
|
3371
3429
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
3372
|
-
import
|
|
3430
|
+
import React42 from "react";
|
|
3373
3431
|
import { Dialog as Dialog2, useId as useId11 } from "@dxos/react-ui";
|
|
3374
3432
|
var SpaceDialog = (spacePanelProps) => {
|
|
3375
3433
|
const titleId = useId11("spaceDialog__title");
|
|
3376
|
-
return /* @__PURE__ */
|
|
3434
|
+
return /* @__PURE__ */ React42.createElement(Dialog2.Root, {
|
|
3377
3435
|
defaultOpen: true,
|
|
3378
3436
|
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
3379
|
-
}, /* @__PURE__ */
|
|
3437
|
+
}, /* @__PURE__ */ React42.createElement(Dialog2.Portal, null, /* @__PURE__ */ React42.createElement(Dialog2.Overlay, null, /* @__PURE__ */ React42.createElement(Dialog2.Content, {
|
|
3380
3438
|
"aria-labelledby": titleId
|
|
3381
|
-
}, /* @__PURE__ */
|
|
3439
|
+
}, /* @__PURE__ */ React42.createElement(ClipboardProvider, null, /* @__PURE__ */ React42.createElement(SpacePanel, {
|
|
3382
3440
|
...spacePanelProps,
|
|
3383
3441
|
titleId,
|
|
3384
|
-
doneActionParent: /* @__PURE__ */
|
|
3442
|
+
doneActionParent: /* @__PURE__ */ React42.createElement(Dialog2.Close, {
|
|
3385
3443
|
asChild: true
|
|
3386
3444
|
})
|
|
3387
3445
|
}))))));
|
|
@@ -3396,6 +3454,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3396
3454
|
spaceKey: runtime.spaceKey,
|
|
3397
3455
|
target: runtime.target
|
|
3398
3456
|
});
|
|
3457
|
+
const client = useClient7();
|
|
3399
3458
|
const space = useSpace2(spaceKey);
|
|
3400
3459
|
useEffect7(() => {
|
|
3401
3460
|
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
@@ -3406,7 +3465,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3406
3465
|
if (layout === ShellLayout.SPACE && !space) {
|
|
3407
3466
|
log11.warn("No space found for shell space invitations.", void 0, {
|
|
3408
3467
|
F: __dxlog_file12,
|
|
3409
|
-
L:
|
|
3468
|
+
L: 32,
|
|
3410
3469
|
S: void 0,
|
|
3411
3470
|
C: (f, a) => f(...a)
|
|
3412
3471
|
});
|
|
@@ -3427,7 +3486,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3427
3486
|
]);
|
|
3428
3487
|
switch (layout) {
|
|
3429
3488
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
3430
|
-
return /* @__PURE__ */
|
|
3489
|
+
return /* @__PURE__ */ React43.createElement(JoinDialog, {
|
|
3431
3490
|
mode: "halo-only",
|
|
3432
3491
|
initialInvitationCode: invitationCode,
|
|
3433
3492
|
onDone: () => {
|
|
@@ -3442,8 +3501,18 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3442
3501
|
case ShellLayout.IDENTITY:
|
|
3443
3502
|
case ShellLayout.SHARE_IDENTITY:
|
|
3444
3503
|
case ShellLayout.EDIT_PROFILE:
|
|
3445
|
-
return /* @__PURE__ */
|
|
3504
|
+
return /* @__PURE__ */ React43.createElement(IdentityDialog, {
|
|
3446
3505
|
createInvitationUrl: (invitationCode2) => `${origin}?deviceInvitationCode=${invitationCode2}`,
|
|
3506
|
+
onResetDevice: async () => {
|
|
3507
|
+
await client.reset();
|
|
3508
|
+
await runtime.setAppContext({
|
|
3509
|
+
display: ShellDisplay.NONE,
|
|
3510
|
+
reload: true
|
|
3511
|
+
});
|
|
3512
|
+
},
|
|
3513
|
+
onJoinNewIdentity: () => runtime.setLayout({
|
|
3514
|
+
layout: ShellLayout.INITIALIZE_IDENTITY
|
|
3515
|
+
}),
|
|
3447
3516
|
onDone: async () => {
|
|
3448
3517
|
await runtime.setAppContext({
|
|
3449
3518
|
display: ShellDisplay.NONE
|
|
@@ -3454,7 +3523,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3454
3523
|
}
|
|
3455
3524
|
});
|
|
3456
3525
|
case ShellLayout.SPACE:
|
|
3457
|
-
return space ? /* @__PURE__ */
|
|
3526
|
+
return space ? /* @__PURE__ */ React43.createElement(SpaceDialog, {
|
|
3458
3527
|
space,
|
|
3459
3528
|
target,
|
|
3460
3529
|
createInvitationUrl: (invitationCode2) => `${origin}?spaceInvitationCode=${invitationCode2}`,
|
|
@@ -3468,7 +3537,7 @@ var Shell = ({ runtime, origin }) => {
|
|
|
3468
3537
|
}
|
|
3469
3538
|
}) : null;
|
|
3470
3539
|
case ShellLayout.JOIN_SPACE:
|
|
3471
|
-
return /* @__PURE__ */
|
|
3540
|
+
return /* @__PURE__ */ React43.createElement(JoinDialog, {
|
|
3472
3541
|
initialInvitationCode: invitationCode,
|
|
3473
3542
|
onDone: async (result) => {
|
|
3474
3543
|
const target2 = result?.target ?? void 0;
|
|
@@ -3595,7 +3664,12 @@ var os = {
|
|
|
3595
3664
|
"confirm label": "Confirm",
|
|
3596
3665
|
"reset identity input label": "This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.",
|
|
3597
3666
|
"failed to reset identity message": "Failed to reset identity.",
|
|
3598
|
-
"confirmation value": "CONFIRM"
|
|
3667
|
+
"confirmation value": "CONFIRM",
|
|
3668
|
+
"sign out chooser title": "DANGER ZONE",
|
|
3669
|
+
"sign out chooser message": "Proceeding with either action below will erase all data on this device.",
|
|
3670
|
+
"join new identity label": "Join a new identity",
|
|
3671
|
+
"reset device label": "Reset device",
|
|
3672
|
+
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost."
|
|
3599
3673
|
};
|
|
3600
3674
|
|
|
3601
3675
|
// packages/sdk/shell/src/translations/index.ts
|
|
@@ -3619,27 +3693,27 @@ var runShell = async (config = new Config()) => {
|
|
|
3619
3693
|
runtime.open(),
|
|
3620
3694
|
client.initialize()
|
|
3621
3695
|
]);
|
|
3622
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
3696
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React44.createElement(StrictMode, null, /* @__PURE__ */ React44.createElement(ThemeProvider, {
|
|
3623
3697
|
tx: defaultTx,
|
|
3624
3698
|
resourceExtensions: [
|
|
3625
3699
|
osTranslations
|
|
3626
3700
|
]
|
|
3627
|
-
}, /* @__PURE__ */
|
|
3701
|
+
}, /* @__PURE__ */ React44.createElement(ClientContext.Provider, {
|
|
3628
3702
|
value: {
|
|
3629
3703
|
client,
|
|
3630
3704
|
status: SystemStatus.ACTIVE
|
|
3631
3705
|
}
|
|
3632
|
-
}, /* @__PURE__ */
|
|
3706
|
+
}, /* @__PURE__ */ React44.createElement(ClipboardProvider, null, /* @__PURE__ */ React44.createElement(Tooltip3.Provider, null, /* @__PURE__ */ React44.createElement(Shell, {
|
|
3633
3707
|
runtime,
|
|
3634
3708
|
origin: location.origin
|
|
3635
3709
|
})))))));
|
|
3636
3710
|
};
|
|
3637
3711
|
|
|
3638
3712
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
3639
|
-
import
|
|
3713
|
+
import React45, { createContext as createContext2, useCallback as useCallback9, useContext as useContext2, useEffect as useEffect8, useMemo as useMemo6, useState as useState11 } from "react";
|
|
3640
3714
|
import { ShellDisplay as ShellDisplay2, ShellLayout as ShellLayout3, useClient as useClient8 } from "@dxos/react-client";
|
|
3641
3715
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
3642
|
-
import { mx as
|
|
3716
|
+
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
3643
3717
|
|
|
3644
3718
|
// packages/sdk/shell/src/composites/Shell/memory-shell-runtime.ts
|
|
3645
3719
|
import { Event } from "@dxos/async";
|
|
@@ -3768,12 +3842,12 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
3768
3842
|
}, [
|
|
3769
3843
|
shellRuntime
|
|
3770
3844
|
]);
|
|
3771
|
-
return /* @__PURE__ */
|
|
3772
|
-
className:
|
|
3773
|
-
}, /* @__PURE__ */
|
|
3845
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, shellRuntime && /* @__PURE__ */ React45.createElement("div", {
|
|
3846
|
+
className: mx23(display === ShellDisplay2.NONE ? "hidden" : "")
|
|
3847
|
+
}, /* @__PURE__ */ React45.createElement(Shell, {
|
|
3774
3848
|
runtime: shellRuntime,
|
|
3775
3849
|
origin: window.location.origin
|
|
3776
|
-
})), /* @__PURE__ */
|
|
3850
|
+
})), /* @__PURE__ */ React45.createElement(ShellContext.Provider, {
|
|
3777
3851
|
value: {
|
|
3778
3852
|
runtime: shellRuntime,
|
|
3779
3853
|
setDisplay
|