@dxos/shell 0.6.14-main.f49f251 → 0.6.14-staging.e15392e
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 +10 -10
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +1 -1
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -39
- package/dist/lib/browser/testing/index.mjs.map +4 -4
- package/dist/lib/node/chunk-Q7SFCCGT.cjs +33 -0
- package/dist/lib/node/chunk-Q7SFCCGT.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/react.cjs +4763 -0
- package/dist/lib/node/react.cjs.map +7 -0
- package/dist/lib/node/react.css +7 -0
- package/dist/lib/node/react.css.map +7 -0
- package/dist/lib/node/testing/index.cjs +181 -0
- package/dist/lib/node/testing/index.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/react.css +7 -0
- package/dist/lib/node-esm/react.css.map +7 -0
- package/dist/lib/node-esm/react.mjs +4809 -0
- package/dist/lib/node-esm/react.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +161 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +2 -2
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +10 -10
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +15 -15
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts +1 -2
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +2 -3
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +13 -9
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/testing/index.d.ts +0 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- package/dist/types/src/testing/index.js +1 -1
- package/dist/types/src/testing/index.js.map +1 -1
- package/package.json +38 -27
- package/src/components/IdentityList/SpaceMemberList.stories.tsx +1 -1
- package/src/components/InvitationList/InvitationList.stories.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +1 -1
- package/src/playwright/invitations-manager.ts +2 -3
- package/src/playwright/invitations.spec.ts +14 -9
- package/src/testing/index.ts +2 -1
|
@@ -0,0 +1,4763 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var react_exports = {};
|
|
30
|
+
__export(react_exports, {
|
|
31
|
+
Action: () => Action,
|
|
32
|
+
Actions: () => Actions,
|
|
33
|
+
AgentConfig: () => AgentConfig,
|
|
34
|
+
AuthCode: () => AuthCode,
|
|
35
|
+
BifurcatedAction: () => BifurcatedAction,
|
|
36
|
+
Centered: () => Centered,
|
|
37
|
+
ClipboardContext: () => ClipboardContext,
|
|
38
|
+
ClipboardProvider: () => ClipboardProvider,
|
|
39
|
+
CloseButton: () => CloseButton,
|
|
40
|
+
CompoundButton: () => CompoundButton,
|
|
41
|
+
ConfirmReset: () => ConfirmReset,
|
|
42
|
+
ConfirmResetImpl: () => ConfirmResetImpl,
|
|
43
|
+
CopyButton: () => CopyButton,
|
|
44
|
+
CopyButtonIconOnly: () => CopyButtonIconOnly,
|
|
45
|
+
DeviceList: () => DeviceList,
|
|
46
|
+
Emoji: () => Emoji,
|
|
47
|
+
EmojiPickerBlock: () => EmojiPickerBlock,
|
|
48
|
+
EmojiPickerToolbarButton: () => EmojiPickerToolbarButton,
|
|
49
|
+
Heading: () => Heading,
|
|
50
|
+
HuePickerBlock: () => HuePickerBlock,
|
|
51
|
+
HuePickerToolbarButton: () => HuePickerToolbarButton,
|
|
52
|
+
IdentityDialog: () => IdentityDialog,
|
|
53
|
+
IdentityListItem: () => IdentityListItem,
|
|
54
|
+
IdentityPanel: () => IdentityPanel,
|
|
55
|
+
IdentityPanelImpl: () => IdentityPanelImpl,
|
|
56
|
+
Input: () => Input,
|
|
57
|
+
InvitationList: () => InvitationList,
|
|
58
|
+
InvitationListContainer: () => InvitationListContainer,
|
|
59
|
+
InvitationListItem: () => InvitationListItem,
|
|
60
|
+
InvitationListItemImpl: () => InvitationListItemImpl,
|
|
61
|
+
InvitationManager: () => InvitationManager,
|
|
62
|
+
JoinDialog: () => JoinDialog,
|
|
63
|
+
JoinPanel: () => JoinPanel,
|
|
64
|
+
JoinPanelImpl: () => JoinPanelImpl,
|
|
65
|
+
Label: () => Label,
|
|
66
|
+
Shell: () => Shell,
|
|
67
|
+
ShellContext: () => ShellContext,
|
|
68
|
+
ShellProvider: () => ShellProvider,
|
|
69
|
+
SpaceDialog: () => SpaceDialog,
|
|
70
|
+
SpaceListItem: () => SpaceListItem,
|
|
71
|
+
SpaceMemberList: () => SpaceMemberList,
|
|
72
|
+
SpaceMemberListImpl: () => SpaceMemberListImpl,
|
|
73
|
+
SpacePanel: () => SpacePanel,
|
|
74
|
+
SpacePanelImpl: () => SpacePanelImpl,
|
|
75
|
+
StatusPanel: () => StatusPanel,
|
|
76
|
+
StepHeading: () => StepHeading,
|
|
77
|
+
Viewport: () => Viewport,
|
|
78
|
+
activeBgColor: () => activeBgColor,
|
|
79
|
+
activeStrokeColor: () => activeStrokeColor,
|
|
80
|
+
activeTextColor: () => activeTextColor,
|
|
81
|
+
cancelledBgColor: () => cancelledBgColor,
|
|
82
|
+
cancelledStrokeColor: () => cancelledStrokeColor,
|
|
83
|
+
cancelledTextColor: () => cancelledTextColor,
|
|
84
|
+
createViewportScope: () => createViewportScope,
|
|
85
|
+
errorBgColor: () => errorBgColor,
|
|
86
|
+
errorStrokeColor: () => errorStrokeColor,
|
|
87
|
+
errorTextColor: () => errorTextColor,
|
|
88
|
+
inactiveBgColor: () => inactiveBgColor,
|
|
89
|
+
inactiveStrokeColor: () => inactiveStrokeColor,
|
|
90
|
+
inactiveTextColor: () => inactiveTextColor,
|
|
91
|
+
osTranslations: () => osTranslations,
|
|
92
|
+
resolvedBgColor: () => resolvedBgColor,
|
|
93
|
+
resolvedStrokeColor: () => resolvedStrokeColor,
|
|
94
|
+
resolvedTextColor: () => resolvedTextColor,
|
|
95
|
+
runShell: () => runShell,
|
|
96
|
+
stepStyles: () => stepStyles,
|
|
97
|
+
successBgColor: () => successBgColor,
|
|
98
|
+
successStrokeColor: () => successStrokeColor,
|
|
99
|
+
successTextColor: () => successTextColor,
|
|
100
|
+
useClipboardContext: () => useClipboardContext,
|
|
101
|
+
useShell: () => useShell,
|
|
102
|
+
useViewportContext: () => useViewportContext
|
|
103
|
+
});
|
|
104
|
+
module.exports = __toCommonJS(react_exports);
|
|
105
|
+
var import_chunk_Q7SFCCGT = require("./chunk-Q7SFCCGT.cjs");
|
|
106
|
+
var import_react = require("@phosphor-icons/react");
|
|
107
|
+
var import_react2 = __toESM(require("react"));
|
|
108
|
+
var import_react_ui = require("@dxos/react-ui");
|
|
109
|
+
var import_react_ui_theme = require("@dxos/react-ui-theme");
|
|
110
|
+
var import_react3 = require("@phosphor-icons/react");
|
|
111
|
+
var import_react4 = __toESM(require("react"));
|
|
112
|
+
var import_react_ui2 = require("@dxos/react-ui");
|
|
113
|
+
var import_react_ui_theme2 = require("@dxos/react-ui-theme");
|
|
114
|
+
var import_react5 = __toESM(require("react"));
|
|
115
|
+
var import_react6 = __toESM(require("react"));
|
|
116
|
+
var import_react_ui3 = require("@dxos/react-ui");
|
|
117
|
+
var import_react_ui_theme3 = require("@dxos/react-ui-theme");
|
|
118
|
+
var import_data = __toESM(require("@emoji-mart/data"));
|
|
119
|
+
var import_react7 = __toESM(require("@emoji-mart/react"));
|
|
120
|
+
var import_react8 = require("@phosphor-icons/react");
|
|
121
|
+
var import_react_use_controllable_state = require("@radix-ui/react-use-controllable-state");
|
|
122
|
+
var import_react9 = __toESM(require("react"));
|
|
123
|
+
var import_react_ui4 = require("@dxos/react-ui");
|
|
124
|
+
var import_react_ui_theme4 = require("@dxos/react-ui-theme");
|
|
125
|
+
var import_react10 = require("@phosphor-icons/react");
|
|
126
|
+
var import_react_use_controllable_state2 = require("@radix-ui/react-use-controllable-state");
|
|
127
|
+
var import_react11 = __toESM(require("react"));
|
|
128
|
+
var import_react_ui5 = require("@dxos/react-ui");
|
|
129
|
+
var import_react_ui_theme5 = require("@dxos/react-ui-theme");
|
|
130
|
+
var import_react12 = __toESM(require("react"));
|
|
131
|
+
var import_display_name = require("@dxos/display-name");
|
|
132
|
+
var import_echo = require("@dxos/react-client/echo");
|
|
133
|
+
var import_react_ui6 = require("@dxos/react-ui");
|
|
134
|
+
var import_react_ui_theme6 = require("@dxos/react-ui-theme");
|
|
135
|
+
var import_util = require("@dxos/util");
|
|
136
|
+
var import_react13 = __toESM(require("react"));
|
|
137
|
+
var import_react_client = require("@dxos/react-client");
|
|
138
|
+
var import_echo2 = require("@dxos/react-client/echo");
|
|
139
|
+
var import_react_ui7 = require("@dxos/react-ui");
|
|
140
|
+
var import_react_ui_theme7 = require("@dxos/react-ui-theme");
|
|
141
|
+
var import_react14 = require("@phosphor-icons/react");
|
|
142
|
+
var import_react15 = __toESM(require("react"));
|
|
143
|
+
var import_react_ui8 = require("@dxos/react-ui");
|
|
144
|
+
var import_react_ui_theme8 = require("@dxos/react-ui-theme");
|
|
145
|
+
var import_react16 = require("@phosphor-icons/react");
|
|
146
|
+
var import_react17 = __toESM(require("react"));
|
|
147
|
+
var import_display_name2 = require("@dxos/display-name");
|
|
148
|
+
var import_halo = require("@dxos/react-client/halo");
|
|
149
|
+
var import_mesh = require("@dxos/react-client/mesh");
|
|
150
|
+
var import_react_ui9 = require("@dxos/react-ui");
|
|
151
|
+
var import_react_ui_theme9 = require("@dxos/react-ui-theme");
|
|
152
|
+
var import_util2 = require("@dxos/util");
|
|
153
|
+
var import_react18 = require("@phosphor-icons/react");
|
|
154
|
+
var import_date_fns = require("date-fns");
|
|
155
|
+
var import_react19 = __toESM(require("react"));
|
|
156
|
+
var import_invitations = require("@dxos/react-client/invitations");
|
|
157
|
+
var import_react_ui10 = require("@dxos/react-ui");
|
|
158
|
+
var import_react_ui_theme10 = require("@dxos/react-ui-theme");
|
|
159
|
+
var import_util3 = require("@dxos/util");
|
|
160
|
+
var import_react20 = __toESM(require("react"));
|
|
161
|
+
var import_react_ui_theme11 = require("@dxos/react-ui-theme");
|
|
162
|
+
var import_react21 = __toESM(require("react"));
|
|
163
|
+
var import_echo3 = require("@dxos/react-client/echo");
|
|
164
|
+
var import_react22 = __toESM(require("react"));
|
|
165
|
+
var import_react_ui11 = require("@dxos/react-ui");
|
|
166
|
+
var import_react_ui_theme12 = require("@dxos/react-ui-theme");
|
|
167
|
+
var import_react23 = require("@phosphor-icons/react");
|
|
168
|
+
var import_react_use_controllable_state3 = require("@radix-ui/react-use-controllable-state");
|
|
169
|
+
var import_react24 = __toESM(require("react"));
|
|
170
|
+
var import_react_ui12 = require("@dxos/react-ui");
|
|
171
|
+
var import_react_ui_theme13 = require("@dxos/react-ui-theme");
|
|
172
|
+
var import_react25 = __toESM(require("react"));
|
|
173
|
+
var import_react_ui_theme14 = require("@dxos/react-ui-theme");
|
|
174
|
+
var import_react26 = require("@phosphor-icons/react");
|
|
175
|
+
var import_react27 = __toESM(require("react"));
|
|
176
|
+
var import_react_ui13 = require("@dxos/react-ui");
|
|
177
|
+
var import_react_ui_theme15 = require("@dxos/react-ui-theme");
|
|
178
|
+
var import_react28 = __toESM(require("react"));
|
|
179
|
+
var import_react_ui_theme16 = require("@dxos/react-ui-theme");
|
|
180
|
+
var import_react29 = __toESM(require("react"));
|
|
181
|
+
var import_react_ui_theme17 = require("@dxos/react-ui-theme");
|
|
182
|
+
var import_react30 = __toESM(require("react"));
|
|
183
|
+
var import_react_ui_theme18 = require("@dxos/react-ui-theme");
|
|
184
|
+
var import_react31 = __toESM(require("react"));
|
|
185
|
+
var import_react_ui14 = require("@dxos/react-ui");
|
|
186
|
+
var import_react32 = __toESM(require("react"));
|
|
187
|
+
var import_react_ui_theme19 = require("@dxos/react-ui-theme");
|
|
188
|
+
var import_react_tabster = require("@fluentui/react-tabster");
|
|
189
|
+
var import_react_context = require("@radix-ui/react-context");
|
|
190
|
+
var import_react_use_controllable_state4 = require("@radix-ui/react-use-controllable-state");
|
|
191
|
+
var import_react33 = __toESM(require("react"));
|
|
192
|
+
var import_react_ui15 = require("@dxos/react-ui");
|
|
193
|
+
var import_react_ui_theme20 = require("@dxos/react-ui-theme");
|
|
194
|
+
var import_react34 = __toESM(require("react"));
|
|
195
|
+
var import_react_ui16 = require("@dxos/react-ui");
|
|
196
|
+
var import_react_ui_theme21 = require("@dxos/react-ui-theme");
|
|
197
|
+
var import_util4 = require("@dxos/util");
|
|
198
|
+
var import_react35 = __toESM(require("react"));
|
|
199
|
+
var import_react_ui17 = require("@dxos/react-ui");
|
|
200
|
+
var import_react36 = require("@phosphor-icons/react");
|
|
201
|
+
var import_react37 = __toESM(require("react"));
|
|
202
|
+
var import_display_name3 = require("@dxos/display-name");
|
|
203
|
+
var import_invariant = require("@dxos/invariant");
|
|
204
|
+
var import_log = require("@dxos/log");
|
|
205
|
+
var import_react_client2 = require("@dxos/react-client");
|
|
206
|
+
var import_halo2 = require("@dxos/react-client/halo");
|
|
207
|
+
var import_invitations2 = require("@dxos/react-client/invitations");
|
|
208
|
+
var import_mesh2 = require("@dxos/react-client/mesh");
|
|
209
|
+
var import_react_ui18 = require("@dxos/react-ui");
|
|
210
|
+
var import_react_ui_theme22 = require("@dxos/react-ui-theme");
|
|
211
|
+
var import_util5 = require("@dxos/util");
|
|
212
|
+
var import_react38 = require("@xstate/react");
|
|
213
|
+
var import_xstate = require("xstate");
|
|
214
|
+
var import_log2 = require("@dxos/log");
|
|
215
|
+
var import_react39 = __toESM(require("react"));
|
|
216
|
+
var import_log3 = require("@dxos/log");
|
|
217
|
+
var import_react_client3 = require("@dxos/react-client");
|
|
218
|
+
var import_halo3 = require("@dxos/react-client/halo");
|
|
219
|
+
var import_invitations3 = require("@dxos/react-client/invitations");
|
|
220
|
+
var import_react40 = __toESM(require("react"));
|
|
221
|
+
var import_log4 = require("@dxos/log");
|
|
222
|
+
var import_react_ui19 = require("@dxos/react-ui");
|
|
223
|
+
var import_util6 = require("@dxos/util");
|
|
224
|
+
var import_react_client4 = require("@dxos/react-client");
|
|
225
|
+
var import_react41 = require("react");
|
|
226
|
+
var import_invariant2 = require("@dxos/invariant");
|
|
227
|
+
var import_services = require("@dxos/protocols/proto/dxos/client/services");
|
|
228
|
+
var import_react_client5 = require("@dxos/react-client");
|
|
229
|
+
var import_react42 = require("react");
|
|
230
|
+
var import_invariant3 = require("@dxos/invariant");
|
|
231
|
+
var import_log5 = require("@dxos/log");
|
|
232
|
+
var import_react_client6 = require("@dxos/react-client");
|
|
233
|
+
var import_invitations4 = require("@dxos/react-client/invitations");
|
|
234
|
+
var import_react43 = require("@phosphor-icons/react");
|
|
235
|
+
var import_react44 = __toESM(require("react"));
|
|
236
|
+
var import_react_qr_rounded = require("react-qr-rounded");
|
|
237
|
+
var import_react_ui20 = require("@dxos/react-ui");
|
|
238
|
+
var import_react_ui_theme23 = require("@dxos/react-ui-theme");
|
|
239
|
+
var import_util7 = require("@dxos/util");
|
|
240
|
+
var import_invitations5 = require("@dxos/react-client/invitations");
|
|
241
|
+
var import_react45 = require("@phosphor-icons/react");
|
|
242
|
+
var import_react46 = __toESM(require("react"));
|
|
243
|
+
var import_log6 = require("@dxos/log");
|
|
244
|
+
var import_react_ui21 = require("@dxos/react-ui");
|
|
245
|
+
var import_react_ui_theme24 = require("@dxos/react-ui-theme");
|
|
246
|
+
var import_react47 = __toESM(require("react"));
|
|
247
|
+
var import_log7 = require("@dxos/log");
|
|
248
|
+
var import_react_client7 = require("@dxos/react-client");
|
|
249
|
+
var import_halo4 = require("@dxos/react-client/halo");
|
|
250
|
+
var import_react_ui22 = require("@dxos/react-ui");
|
|
251
|
+
var import_react48 = require("@phosphor-icons/react");
|
|
252
|
+
var import_react49 = __toESM(require("react"));
|
|
253
|
+
var import_react_ui23 = require("@dxos/react-ui");
|
|
254
|
+
var import_react_ui_theme25 = require("@dxos/react-ui-theme");
|
|
255
|
+
var import_react50 = require("@xstate/react");
|
|
256
|
+
var import_react51 = require("react");
|
|
257
|
+
var import_xstate2 = require("xstate");
|
|
258
|
+
var import_log8 = require("@dxos/log");
|
|
259
|
+
var import_react_client8 = require("@dxos/react-client");
|
|
260
|
+
var import_invitations6 = require("@dxos/react-client/invitations");
|
|
261
|
+
var import_react52 = require("@phosphor-icons/react");
|
|
262
|
+
var import_react53 = __toESM(require("react"));
|
|
263
|
+
var import_react_ui24 = require("@dxos/react-ui");
|
|
264
|
+
var import_react_ui_theme26 = require("@dxos/react-ui-theme");
|
|
265
|
+
var import_react54 = __toESM(require("react"));
|
|
266
|
+
var import_display_name4 = require("@dxos/display-name");
|
|
267
|
+
var import_react_ui25 = require("@dxos/react-ui");
|
|
268
|
+
var import_react_ui_theme27 = require("@dxos/react-ui-theme");
|
|
269
|
+
var import_util8 = require("@dxos/util");
|
|
270
|
+
var import_react55 = __toESM(require("react"));
|
|
271
|
+
var import_log9 = require("@dxos/log");
|
|
272
|
+
var import_react_client9 = require("@dxos/react-client");
|
|
273
|
+
var import_react_ui26 = require("@dxos/react-ui");
|
|
274
|
+
var import_react56 = __toESM(require("react"));
|
|
275
|
+
var import_react_ui27 = require("@dxos/react-ui");
|
|
276
|
+
var import_react57 = __toESM(require("react"));
|
|
277
|
+
var import_log10 = require("@dxos/log");
|
|
278
|
+
var import_react_ui28 = require("@dxos/react-ui");
|
|
279
|
+
var import_react58 = __toESM(require("react"));
|
|
280
|
+
var import_react_ui29 = require("@dxos/react-ui");
|
|
281
|
+
var import_react_ui_theme28 = require("@dxos/react-ui-theme");
|
|
282
|
+
var import_react59 = __toESM(require("react"));
|
|
283
|
+
var import_invitations7 = require("@dxos/react-client/invitations");
|
|
284
|
+
var import_react_ui30 = require("@dxos/react-ui");
|
|
285
|
+
var import_react_ui_theme29 = require("@dxos/react-ui-theme");
|
|
286
|
+
var import_util9 = require("@dxos/util");
|
|
287
|
+
var import_invitations8 = require("@dxos/react-client/invitations");
|
|
288
|
+
var import_react60 = require("@phosphor-icons/react");
|
|
289
|
+
var import_react61 = __toESM(require("react"));
|
|
290
|
+
var import_log11 = require("@dxos/log");
|
|
291
|
+
var import_invitations9 = require("@dxos/react-client/invitations");
|
|
292
|
+
var import_react_ui31 = require("@dxos/react-ui");
|
|
293
|
+
var import_react62 = require("@xstate/react");
|
|
294
|
+
var import_xstate3 = require("xstate");
|
|
295
|
+
var import_log12 = require("@dxos/log");
|
|
296
|
+
var import_react63 = require("@phosphor-icons/react");
|
|
297
|
+
var import_react64 = __toESM(require("react"));
|
|
298
|
+
var import_log13 = require("@dxos/log");
|
|
299
|
+
var import_react_client10 = require("@dxos/react-client");
|
|
300
|
+
var import_echo4 = require("@dxos/react-client/echo");
|
|
301
|
+
var import_invitations10 = require("@dxos/react-client/invitations");
|
|
302
|
+
var import_react_ui32 = require("@dxos/react-ui");
|
|
303
|
+
var import_react_ui_theme30 = require("@dxos/react-ui-theme");
|
|
304
|
+
var import_react65 = __toESM(require("react"));
|
|
305
|
+
var import_react_ui33 = require("@dxos/react-ui");
|
|
306
|
+
var import_react66 = __toESM(require("react"));
|
|
307
|
+
var import_react_ui34 = require("@dxos/react-ui");
|
|
308
|
+
var import_react67 = __toESM(require("react"));
|
|
309
|
+
var import_client = require("react-dom/client");
|
|
310
|
+
var import_client_protocol = require("@dxos/client-protocol");
|
|
311
|
+
var import_react_client11 = require("@dxos/react-client");
|
|
312
|
+
var import_react_ui35 = require("@dxos/react-ui");
|
|
313
|
+
var import_react_ui_theme31 = require("@dxos/react-ui-theme");
|
|
314
|
+
var import_rpc_tunnel = require("@dxos/rpc-tunnel");
|
|
315
|
+
var import_react68 = __toESM(require("react"));
|
|
316
|
+
var import_log14 = require("@dxos/log");
|
|
317
|
+
var import_react_client12 = require("@dxos/react-client");
|
|
318
|
+
var import_react_client13 = require("@dxos/react-client");
|
|
319
|
+
var import_echo5 = require("@dxos/react-client/echo");
|
|
320
|
+
var import_react69 = __toESM(require("react"));
|
|
321
|
+
var import_react_ui36 = require("@dxos/react-ui");
|
|
322
|
+
var import_react70 = __toESM(require("react"));
|
|
323
|
+
var import_react_ui37 = require("@dxos/react-ui");
|
|
324
|
+
var import_async = require("@dxos/async");
|
|
325
|
+
var import_client_protocol2 = require("@dxos/client-protocol");
|
|
326
|
+
var import_invariant4 = require("@dxos/invariant");
|
|
327
|
+
var import_iframe = require("@dxos/protocols/proto/dxos/iframe");
|
|
328
|
+
var import_rpc = require("@dxos/rpc");
|
|
329
|
+
var import_react71 = __toESM(require("react"));
|
|
330
|
+
var import_react_client14 = require("@dxos/react-client");
|
|
331
|
+
var import_halo5 = require("@dxos/react-client/halo");
|
|
332
|
+
var import_react_ui_theme32 = require("@dxos/react-ui-theme");
|
|
333
|
+
var import_async2 = require("@dxos/async");
|
|
334
|
+
var import_react_client15 = require("@dxos/react-client");
|
|
335
|
+
var AgentConfig = ({ agentStatus, validationMessage, onAgentDestroy, onAgentCreate, onAgentRefresh }) => {
|
|
336
|
+
const { t } = (0, import_react_ui.useTranslation)("os");
|
|
337
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("h2", {
|
|
338
|
+
className: (0, import_react_ui_theme.mx)(import_react_ui_theme.descriptionText, "text-center mbs-4")
|
|
339
|
+
}, t("agent heading")), validationMessage && /* @__PURE__ */ import_react2.default.createElement("p", {
|
|
340
|
+
role: "alert",
|
|
341
|
+
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.valenceColorText)("error"), "mlb-2")
|
|
342
|
+
}, validationMessage), agentStatus === "created" || agentStatus === "creating" || agentStatus === "getting" || agentStatus === "destroying" ? /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
343
|
+
role: "group",
|
|
344
|
+
className: "mlb-2 flex gap-2 items-center",
|
|
345
|
+
"aria-describedby": "devices-panel.create-agent.description"
|
|
346
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Avatar.Root, {
|
|
347
|
+
status: agentStatus === "created" ? "warning" : "inactive",
|
|
348
|
+
variant: "square"
|
|
349
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Avatar.Frame, {
|
|
350
|
+
classNames: "place-self-center"
|
|
351
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react.Database, {
|
|
352
|
+
weight: "duotone",
|
|
353
|
+
width: 24,
|
|
354
|
+
height: 24,
|
|
355
|
+
x: 8,
|
|
356
|
+
y: 8,
|
|
357
|
+
...agentStatus !== "created" && {
|
|
358
|
+
className: "opacity-50"
|
|
359
|
+
}
|
|
360
|
+
})), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Avatar.Label, {
|
|
361
|
+
classNames: "flex-1 text-sm truncate"
|
|
362
|
+
}, t(agentStatus === "created" ? "agent requested label" : agentStatus === "creating" ? "creating agent label" : agentStatus === "destroying" ? "destroying agent label" : "getting agent label"))), agentStatus === "created" && /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Tooltip.Root, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Tooltip.Trigger, {
|
|
363
|
+
asChild: true
|
|
364
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Button, {
|
|
365
|
+
variant: "ghost",
|
|
366
|
+
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
367
|
+
"data-testid": "agent.destroy",
|
|
368
|
+
onClick: onAgentDestroy
|
|
369
|
+
}, /* @__PURE__ */ import_react2.default.createElement("span", {
|
|
370
|
+
className: "sr-only"
|
|
371
|
+
}, t("destroy agent label")), /* @__PURE__ */ import_react2.default.createElement(import_react.Power, {
|
|
372
|
+
className: (0, import_react_ui_theme.getSize)(5)
|
|
373
|
+
}))), /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Tooltip.Portal, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Tooltip.Content, {
|
|
374
|
+
side: "bottom",
|
|
375
|
+
classNames: "z-50"
|
|
376
|
+
}, t("destroy agent label"))))), agentStatus === "created" && /* @__PURE__ */ import_react2.default.createElement("p", {
|
|
377
|
+
id: "devices-panel.create-agent.description",
|
|
378
|
+
className: (0, import_react_ui_theme.mx)(import_react_ui_theme.descriptionText, "mlb-2")
|
|
379
|
+
}, t("agent requested description"))) : /* @__PURE__ */ import_react2.default.createElement(import_react2.default.Fragment, null, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Button, {
|
|
380
|
+
variant: "ghost",
|
|
381
|
+
classNames: "mlb-2 is-full justify-start gap-2 !pis-0 !pie-3",
|
|
382
|
+
"data-testid": agentStatus === "creatable" ? "devices-panel.create-agent" : "devices-panel.agent-error",
|
|
383
|
+
onClick: agentStatus === "creatable" ? onAgentCreate : onAgentRefresh,
|
|
384
|
+
"aria-describedby": "devices-panel.create-agent.description"
|
|
385
|
+
}, /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
386
|
+
role: "img",
|
|
387
|
+
className: (0, import_react_ui_theme.mx)((0, import_react_ui_theme.getSize)(8), "m-1 rounded-sm bg-input grid place-items-center")
|
|
388
|
+
}, agentStatus === "creatable" ? /* @__PURE__ */ import_react2.default.createElement(import_react.Plus, {
|
|
389
|
+
weight: "light",
|
|
390
|
+
className: (0, import_react_ui_theme.getSize)(6)
|
|
391
|
+
}) : /* @__PURE__ */ import_react2.default.createElement(import_react.ArrowsClockwise, {
|
|
392
|
+
weight: "light",
|
|
393
|
+
className: (0, import_react_ui_theme.getSize)(6)
|
|
394
|
+
})), /* @__PURE__ */ import_react2.default.createElement("span", {
|
|
395
|
+
className: "grow font-medium text-start"
|
|
396
|
+
}, t(agentStatus === "creatable" ? "create agent label" : ""))), agentStatus === "creatable" && /* @__PURE__ */ import_react2.default.createElement("div", {
|
|
397
|
+
role: "none",
|
|
398
|
+
className: "space-y-2",
|
|
399
|
+
id: "devices-panel.create-agent.description"
|
|
400
|
+
}, /* @__PURE__ */ import_react2.default.createElement("p", {
|
|
401
|
+
className: import_react_ui_theme.descriptionText
|
|
402
|
+
}, /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Trans, {
|
|
403
|
+
t,
|
|
404
|
+
i18nKey: "create agent clickwrap",
|
|
405
|
+
components: {
|
|
406
|
+
tosLink: /* @__PURE__ */ import_react2.default.createElement(import_react_ui.Link, {
|
|
407
|
+
target: "_blank",
|
|
408
|
+
rel: "noreferrer"
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
})), /* @__PURE__ */ import_react2.default.createElement("p", {
|
|
412
|
+
className: import_react_ui_theme.descriptionText
|
|
413
|
+
}, t("create agent description")))));
|
|
414
|
+
};
|
|
415
|
+
var ClipboardContext = /* @__PURE__ */ (0, import_react5.createContext)({
|
|
416
|
+
textValue: "",
|
|
417
|
+
setTextValue: async (_) => {
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
var useClipboardContext = () => (0, import_react5.useContext)(ClipboardContext);
|
|
421
|
+
var ClipboardProvider = ({ children }) => {
|
|
422
|
+
const [textValue, setInternalTextValue] = (0, import_react5.useState)("");
|
|
423
|
+
const setTextValue = (0, import_react5.useCallback)(async (nextValue) => {
|
|
424
|
+
await navigator.clipboard.writeText(nextValue);
|
|
425
|
+
return setInternalTextValue(nextValue);
|
|
426
|
+
}, []);
|
|
427
|
+
return /* @__PURE__ */ import_react5.default.createElement(ClipboardContext.Provider, {
|
|
428
|
+
value: {
|
|
429
|
+
textValue,
|
|
430
|
+
setTextValue
|
|
431
|
+
}
|
|
432
|
+
}, children);
|
|
433
|
+
};
|
|
434
|
+
var inactiveLabelStyles = "invisible bs-px -mbe-px overflow-hidden";
|
|
435
|
+
var CopyButton = ({ value, classNames, iconProps: iconProps2, ...props }) => {
|
|
436
|
+
const { t } = (0, import_react_ui2.useTranslation)("os");
|
|
437
|
+
const { textValue, setTextValue } = useClipboardContext();
|
|
438
|
+
const isCopied = textValue === value;
|
|
439
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
|
|
440
|
+
...props,
|
|
441
|
+
classNames: [
|
|
442
|
+
"inline-flex flex-col justify-center",
|
|
443
|
+
classNames
|
|
444
|
+
],
|
|
445
|
+
onClick: () => setTextValue(value),
|
|
446
|
+
"data-testid": "copy-invitation"
|
|
447
|
+
}, /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
448
|
+
role: "none",
|
|
449
|
+
className: (0, import_react_ui_theme2.mx)("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
450
|
+
}, /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
451
|
+
className: "pli-1"
|
|
452
|
+
}, t("copy invitation code label")), /* @__PURE__ */ import_react4.default.createElement(import_react3.Copy, {
|
|
453
|
+
className: (0, import_react_ui_theme2.getSize)(5),
|
|
454
|
+
...iconProps2
|
|
455
|
+
})), /* @__PURE__ */ import_react4.default.createElement("div", {
|
|
456
|
+
role: "none",
|
|
457
|
+
className: (0, import_react_ui_theme2.mx)("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
458
|
+
}, /* @__PURE__ */ import_react4.default.createElement("span", {
|
|
459
|
+
className: "pli-1"
|
|
460
|
+
}, t("copy success label")), /* @__PURE__ */ import_react4.default.createElement(import_react3.Check, {
|
|
461
|
+
className: (0, import_react_ui_theme2.getSize)(5),
|
|
462
|
+
...iconProps2
|
|
463
|
+
})));
|
|
464
|
+
};
|
|
465
|
+
var CopyButtonIconOnly = ({ value, classNames, iconProps: iconProps2, variant, ...props }) => {
|
|
466
|
+
const { t } = (0, import_react_ui2.useTranslation)("os");
|
|
467
|
+
const { textValue, setTextValue } = useClipboardContext();
|
|
468
|
+
const isCopied = textValue === value;
|
|
469
|
+
const label = isCopied ? t("copy success label") : t("copy invitation code label");
|
|
470
|
+
const [open, setOpen] = (0, import_react4.useState)(false);
|
|
471
|
+
return /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Tooltip.Root, {
|
|
472
|
+
delayDuration: 1500,
|
|
473
|
+
open,
|
|
474
|
+
onOpenChange: setOpen
|
|
475
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Tooltip.Portal, null, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Tooltip.Content, {
|
|
476
|
+
side: "bottom",
|
|
477
|
+
sideOffset: 12,
|
|
478
|
+
classNames: "z-30"
|
|
479
|
+
}, /* @__PURE__ */ import_react4.default.createElement("span", null, label), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Tooltip.Arrow, null))), /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Tooltip.Trigger, {
|
|
480
|
+
"aria-label": label,
|
|
481
|
+
...props,
|
|
482
|
+
onClick: () => setTextValue(value).then(() => setOpen(true)),
|
|
483
|
+
"data-testid": "copy-invitation",
|
|
484
|
+
asChild: true
|
|
485
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react_ui2.Button, {
|
|
486
|
+
variant,
|
|
487
|
+
classNames: [
|
|
488
|
+
"inline-flex flex-col justify-center",
|
|
489
|
+
classNames
|
|
490
|
+
]
|
|
491
|
+
}, /* @__PURE__ */ import_react4.default.createElement(import_react3.Copy, {
|
|
492
|
+
className: (0, import_react_ui_theme2.getSize)(5),
|
|
493
|
+
...iconProps2
|
|
494
|
+
}))));
|
|
495
|
+
};
|
|
496
|
+
var CompoundButton = ({ children, description, before, after, variant = "default", elevation: propsElevation, slots = {}, ...buttonProps }) => {
|
|
497
|
+
const labelId = (0, import_react_ui3.useId)("compoundButton-label");
|
|
498
|
+
const descriptionId = (0, import_react_ui3.useId)("compoundButton-description");
|
|
499
|
+
const { tx } = (0, import_react_ui3.useThemeContext)();
|
|
500
|
+
const elevation = (0, import_react_ui3.useElevationContext)(propsElevation);
|
|
501
|
+
const styleProps = {
|
|
502
|
+
...buttonProps,
|
|
503
|
+
variant,
|
|
504
|
+
elevation,
|
|
505
|
+
textWrap: true
|
|
506
|
+
};
|
|
507
|
+
const buttonClassName = tx("button.root", "button button--compound", styleProps, "flex items-center gap-4 plb-2.5", slots.root?.className);
|
|
508
|
+
return /* @__PURE__ */ import_react6.default.createElement("button", {
|
|
509
|
+
...buttonProps,
|
|
510
|
+
...slots.root,
|
|
511
|
+
className: buttonClassName,
|
|
512
|
+
"aria-labelledby": labelId,
|
|
513
|
+
...description && {
|
|
514
|
+
"aria-describedby": descriptionId
|
|
515
|
+
}
|
|
516
|
+
}, before && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
517
|
+
role: "none",
|
|
518
|
+
className: "grow-0"
|
|
519
|
+
}, before), /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
520
|
+
role: "none",
|
|
521
|
+
...slots.middle,
|
|
522
|
+
className: (0, import_react_ui_theme3.mx)("grow whitespace-normal flex flex-col gap-1 text-left", slots.middle?.className)
|
|
523
|
+
}, /* @__PURE__ */ import_react6.default.createElement("p", {
|
|
524
|
+
...slots.label,
|
|
525
|
+
id: labelId,
|
|
526
|
+
className: (0, import_react_ui_theme3.mx)(slots.label?.className)
|
|
527
|
+
}, children), description && /* @__PURE__ */ import_react6.default.createElement("p", {
|
|
528
|
+
id: descriptionId,
|
|
529
|
+
...slots.description,
|
|
530
|
+
className: (0, import_react_ui_theme3.mx)("text-xs mbe-1 font-normal", variant === "primary" ? import_react_ui_theme3.descriptionTextPrimary : import_react_ui_theme3.descriptionText, slots.description?.className)
|
|
531
|
+
}, description)), after && /* @__PURE__ */ import_react6.default.createElement("div", {
|
|
532
|
+
role: "none",
|
|
533
|
+
className: "grow-0"
|
|
534
|
+
}, after));
|
|
535
|
+
};
|
|
536
|
+
var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji, classNames }) => {
|
|
537
|
+
const { t } = (0, import_react_ui4.useTranslation)("os");
|
|
538
|
+
const { themeMode } = (0, import_react_ui4.useThemeContext)();
|
|
539
|
+
const [_emojiValue, setEmojiValue] = (0, import_react_use_controllable_state.useControllableState)({
|
|
540
|
+
prop: emoji,
|
|
541
|
+
onChange: onChangeEmoji,
|
|
542
|
+
defaultProp: defaultEmoji
|
|
543
|
+
});
|
|
544
|
+
const [emojiPickerOpen, setEmojiPickerOpen] = (0, import_react9.useState)(false);
|
|
545
|
+
const suppressNextTooltip = (0, import_react9.useRef)(false);
|
|
546
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = (0, import_react9.useState)(false);
|
|
547
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Root, {
|
|
548
|
+
open: triggerTooltipOpen,
|
|
549
|
+
onOpenChange: (nextOpen) => {
|
|
550
|
+
if (suppressNextTooltip.current) {
|
|
551
|
+
setTriggerTooltipOpen(false);
|
|
552
|
+
suppressNextTooltip.current = false;
|
|
553
|
+
} else {
|
|
554
|
+
setTriggerTooltipOpen(nextOpen);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Root, {
|
|
558
|
+
open: emojiPickerOpen,
|
|
559
|
+
onOpenChange: (nextOpen) => {
|
|
560
|
+
setEmojiPickerOpen(nextOpen);
|
|
561
|
+
suppressNextTooltip.current = true;
|
|
562
|
+
}
|
|
563
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Trigger, {
|
|
564
|
+
asChild: true
|
|
565
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Trigger, {
|
|
566
|
+
asChild: true
|
|
567
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Toolbar.Button, {
|
|
568
|
+
classNames: [
|
|
569
|
+
"gap-2 text-2xl plb-1",
|
|
570
|
+
classNames
|
|
571
|
+
],
|
|
572
|
+
disabled
|
|
573
|
+
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
574
|
+
className: "sr-only"
|
|
575
|
+
}, t("select emoji label")), /* @__PURE__ */ import_react9.default.createElement(import_react8.UserCircle, {
|
|
576
|
+
className: (0, import_react_ui_theme4.getSize)(5)
|
|
577
|
+
})))), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Portal, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Content, {
|
|
578
|
+
side: "bottom",
|
|
579
|
+
classNames: "z-50"
|
|
580
|
+
}, t("select emoji label"), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Arrow, null))), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Content, {
|
|
581
|
+
side: "bottom",
|
|
582
|
+
onKeyDownCapture: (event) => {
|
|
583
|
+
if (event.key === "Escape") {
|
|
584
|
+
event.stopPropagation();
|
|
585
|
+
setEmojiPickerOpen(false);
|
|
586
|
+
suppressNextTooltip.current = true;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react7.default, {
|
|
590
|
+
data: import_data.default,
|
|
591
|
+
onEmojiSelect: ({ native }) => {
|
|
592
|
+
if (native) {
|
|
593
|
+
setEmojiValue(native);
|
|
594
|
+
setEmojiPickerOpen(false);
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
autoFocus: true,
|
|
598
|
+
maxFrequentRows: 0,
|
|
599
|
+
noCountryFlags: true,
|
|
600
|
+
theme: themeMode
|
|
601
|
+
}), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Arrow, null))));
|
|
602
|
+
};
|
|
603
|
+
var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }) => {
|
|
604
|
+
const { t } = (0, import_react_ui4.useTranslation)("os");
|
|
605
|
+
const [isMd] = (0, import_react_ui4.useMediaQuery)("md", {
|
|
606
|
+
ssr: false
|
|
607
|
+
});
|
|
608
|
+
const [emojiValue, setEmojiValue] = (0, import_react_use_controllable_state.useControllableState)({
|
|
609
|
+
prop: emoji,
|
|
610
|
+
onChange: onChangeEmoji,
|
|
611
|
+
defaultProp: defaultEmoji
|
|
612
|
+
});
|
|
613
|
+
const [emojiPickerOpen, setEmojiPickerOpen] = (0, import_react9.useState)(false);
|
|
614
|
+
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Root, {
|
|
615
|
+
open: emojiPickerOpen,
|
|
616
|
+
onOpenChange: setEmojiPickerOpen
|
|
617
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Trigger, {
|
|
618
|
+
asChild: true
|
|
619
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Button, {
|
|
620
|
+
variant: "ghost",
|
|
621
|
+
classNames: "gap-2 text-2xl plb-1",
|
|
622
|
+
disabled
|
|
623
|
+
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
624
|
+
className: "sr-only"
|
|
625
|
+
}, t("select emoji label")), /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
626
|
+
className: "grow pis-14"
|
|
627
|
+
}, emojiValue), /* @__PURE__ */ import_react9.default.createElement(import_react8.CaretDown, {
|
|
628
|
+
className: (0, import_react_ui_theme4.getSize)(4)
|
|
629
|
+
}))), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Content, {
|
|
630
|
+
side: "right",
|
|
631
|
+
sideOffset: isMd ? 0 : -310,
|
|
632
|
+
onKeyDownCapture: (event) => {
|
|
633
|
+
if (event.key === "Escape") {
|
|
634
|
+
event.stopPropagation();
|
|
635
|
+
setEmojiPickerOpen(false);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react7.default, {
|
|
639
|
+
data: import_data.default,
|
|
640
|
+
onEmojiSelect: ({ native }) => {
|
|
641
|
+
if (native) {
|
|
642
|
+
setEmojiValue(native);
|
|
643
|
+
setEmojiPickerOpen(false);
|
|
644
|
+
}
|
|
645
|
+
},
|
|
646
|
+
autoFocus: true,
|
|
647
|
+
maxFrequentRows: 0,
|
|
648
|
+
noCountryFlags: true
|
|
649
|
+
}), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Popover.Arrow, null))), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Root, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Trigger, {
|
|
650
|
+
asChild: true
|
|
651
|
+
}, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Button, {
|
|
652
|
+
variant: "ghost",
|
|
653
|
+
onClick: onClickClear,
|
|
654
|
+
disabled
|
|
655
|
+
}, /* @__PURE__ */ import_react9.default.createElement("span", {
|
|
656
|
+
className: "sr-only"
|
|
657
|
+
}, t("clear label")), /* @__PURE__ */ import_react9.default.createElement(import_react8.ArrowCounterClockwise, null))), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Portal, null, /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Content, {
|
|
658
|
+
style: {
|
|
659
|
+
zIndex: 70
|
|
660
|
+
},
|
|
661
|
+
side: "right"
|
|
662
|
+
}, t("clear label"), /* @__PURE__ */ import_react9.default.createElement(import_react_ui4.Tooltip.Arrow, null)))));
|
|
663
|
+
};
|
|
664
|
+
var HuePreview = ({ hue }) => {
|
|
665
|
+
const { tx } = (0, import_react_ui5.useThemeContext)();
|
|
666
|
+
const size = 20;
|
|
667
|
+
return /* @__PURE__ */ import_react11.default.createElement("svg", {
|
|
668
|
+
width: size,
|
|
669
|
+
height: size,
|
|
670
|
+
viewBox: `0 0 ${size} ${size}`
|
|
671
|
+
}, /* @__PURE__ */ import_react11.default.createElement("rect", {
|
|
672
|
+
x: 0,
|
|
673
|
+
y: 0,
|
|
674
|
+
width: size,
|
|
675
|
+
height: size,
|
|
676
|
+
className: tx("hue.fill", "select--hue__preview", {
|
|
677
|
+
hue
|
|
678
|
+
})
|
|
679
|
+
}));
|
|
680
|
+
};
|
|
681
|
+
var hueTokens = Object.keys(import_react_ui_theme5.hueTokenThemes).slice(0, 16);
|
|
682
|
+
var HuePickerToolbarButton = ({ disabled, hue, onChangeHue, classNames, defaultHue }) => {
|
|
683
|
+
const { t } = (0, import_react_ui5.useTranslation)("os");
|
|
684
|
+
const [hueValue, setHueValue] = (0, import_react_use_controllable_state2.useControllableState)({
|
|
685
|
+
prop: hue,
|
|
686
|
+
onChange: onChangeHue,
|
|
687
|
+
defaultProp: defaultHue
|
|
688
|
+
});
|
|
689
|
+
const [huePickerOpen, setHuePickerOpen] = (0, import_react11.useState)(false);
|
|
690
|
+
const suppressNextTooltip = (0, import_react11.useRef)(false);
|
|
691
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = (0, import_react11.useState)(false);
|
|
692
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Root, {
|
|
693
|
+
open: triggerTooltipOpen,
|
|
694
|
+
onOpenChange: (nextOpen) => {
|
|
695
|
+
if (suppressNextTooltip.current) {
|
|
696
|
+
setTriggerTooltipOpen(false);
|
|
697
|
+
suppressNextTooltip.current = false;
|
|
698
|
+
} else {
|
|
699
|
+
setTriggerTooltipOpen(nextOpen);
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Root, {
|
|
703
|
+
modal: false,
|
|
704
|
+
open: huePickerOpen,
|
|
705
|
+
onOpenChange: (nextOpen) => {
|
|
706
|
+
setHuePickerOpen(nextOpen);
|
|
707
|
+
suppressNextTooltip.current = true;
|
|
708
|
+
}
|
|
709
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Trigger, {
|
|
710
|
+
asChild: true
|
|
711
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Trigger, {
|
|
712
|
+
asChild: true
|
|
713
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Toolbar.Button, {
|
|
714
|
+
classNames: (0, import_react_ui_theme5.mx)("gap-2 plb-1", classNames),
|
|
715
|
+
disabled
|
|
716
|
+
}, /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
717
|
+
className: "sr-only"
|
|
718
|
+
}, t("select hue label")), /* @__PURE__ */ import_react11.default.createElement(import_react10.Palette, {
|
|
719
|
+
className: (0, import_react_ui_theme5.getSize)(5)
|
|
720
|
+
})))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Portal, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Content, {
|
|
721
|
+
side: "bottom",
|
|
722
|
+
classNames: "z-50"
|
|
723
|
+
}, t("select hue label"), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Arrow, null))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Content, {
|
|
724
|
+
side: "bottom",
|
|
725
|
+
classNames: "!w-40"
|
|
726
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Viewport, {
|
|
727
|
+
classNames: "grid grid-cols-4"
|
|
728
|
+
}, hueTokens.map((hue2) => {
|
|
729
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.CheckboxItem, {
|
|
730
|
+
key: hue2,
|
|
731
|
+
checked: hue2 === hueValue,
|
|
732
|
+
onCheckedChange: () => setHueValue(hue2),
|
|
733
|
+
classNames: "px-0 py-2 items-center justify-center"
|
|
734
|
+
}, /* @__PURE__ */ import_react11.default.createElement(HuePreview, {
|
|
735
|
+
hue: hue2
|
|
736
|
+
}));
|
|
737
|
+
})))));
|
|
738
|
+
};
|
|
739
|
+
var HuePickerBlock = ({ disabled, hue, onChangeHue, defaultHue, onClickClear }) => {
|
|
740
|
+
const { t } = (0, import_react_ui5.useTranslation)("os");
|
|
741
|
+
const [hueValue, setHueValue] = (0, import_react_use_controllable_state2.useControllableState)({
|
|
742
|
+
prop: hue,
|
|
743
|
+
onChange: onChangeHue,
|
|
744
|
+
defaultProp: defaultHue
|
|
745
|
+
});
|
|
746
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Root, {
|
|
747
|
+
modal: false
|
|
748
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Trigger, {
|
|
749
|
+
asChild: true
|
|
750
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Button, {
|
|
751
|
+
variant: "ghost",
|
|
752
|
+
classNames: "gap-2 plb-1",
|
|
753
|
+
disabled
|
|
754
|
+
}, /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
755
|
+
className: "sr-only"
|
|
756
|
+
}, t("select hue label")), /* @__PURE__ */ import_react11.default.createElement("div", {
|
|
757
|
+
role: "none",
|
|
758
|
+
className: "pis-14 grow flex items-center justify-center gap-2"
|
|
759
|
+
}, /* @__PURE__ */ import_react11.default.createElement(HuePreview, {
|
|
760
|
+
hue: hueValue
|
|
761
|
+
}), /* @__PURE__ */ import_react11.default.createElement("span", null, t(`${hueValue} label`))), /* @__PURE__ */ import_react11.default.createElement(import_react10.CaretDown, {
|
|
762
|
+
className: (0, import_react_ui_theme5.getSize)(4)
|
|
763
|
+
}))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Content, {
|
|
764
|
+
side: "right"
|
|
765
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Viewport, null, Object.keys(import_react_ui_theme5.hueTokenThemes).map((hue2) => {
|
|
766
|
+
return /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.CheckboxItem, {
|
|
767
|
+
key: hue2,
|
|
768
|
+
checked: hue2 === hueValue,
|
|
769
|
+
onCheckedChange: () => setHueValue(hue2)
|
|
770
|
+
}, /* @__PURE__ */ import_react11.default.createElement(HuePreview, {
|
|
771
|
+
hue: hue2
|
|
772
|
+
}), /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
773
|
+
className: "grow"
|
|
774
|
+
}, t(`${hue2} label`)), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.ItemIndicator, null, /* @__PURE__ */ import_react11.default.createElement(import_react10.Check, null)));
|
|
775
|
+
})), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.DropdownMenu.Arrow, null))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Root, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Trigger, {
|
|
776
|
+
asChild: true
|
|
777
|
+
}, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Button, {
|
|
778
|
+
variant: "ghost",
|
|
779
|
+
onClick: onClickClear,
|
|
780
|
+
disabled
|
|
781
|
+
}, /* @__PURE__ */ import_react11.default.createElement("span", {
|
|
782
|
+
className: "sr-only"
|
|
783
|
+
}, t("clear label")), /* @__PURE__ */ import_react11.default.createElement(import_react10.ArrowCounterClockwise, null))), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Portal, null, /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Content, {
|
|
784
|
+
style: {
|
|
785
|
+
zIndex: 70
|
|
786
|
+
},
|
|
787
|
+
side: "right"
|
|
788
|
+
}, t("clear label"), /* @__PURE__ */ import_react11.default.createElement(import_react_ui5.Tooltip.Arrow, null)))));
|
|
789
|
+
};
|
|
790
|
+
var IdentityListItem = /* @__PURE__ */ (0, import_react12.forwardRef)(({ identity, presence, onClick, classNames, ...props }, forwardedRef) => {
|
|
791
|
+
const fallbackValue = (0, import_util.keyToFallback)(identity.identityKey);
|
|
792
|
+
const labelId = (0, import_react_ui6.useId)("identityListItem__label");
|
|
793
|
+
const displayName = identity.profile?.displayName ?? (0, import_display_name.generateName)(identity.identityKey.toHex());
|
|
794
|
+
return /* @__PURE__ */ import_react12.default.createElement(import_react_ui6.ListItem.Root, {
|
|
795
|
+
...props,
|
|
796
|
+
classNames: (0, import_react_ui_theme6.mx)("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer", classNames),
|
|
797
|
+
onClick: () => onClick?.(),
|
|
798
|
+
"data-testid": "identity-list-item",
|
|
799
|
+
labelId,
|
|
800
|
+
ref: forwardedRef
|
|
801
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react_ui6.Avatar.Root, {
|
|
802
|
+
status: presence === import_echo.SpaceMember.PresenceState.ONLINE ? "active" : "inactive",
|
|
803
|
+
labelId,
|
|
804
|
+
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
805
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react_ui6.Avatar.Frame, {
|
|
806
|
+
classNames: "place-self-center"
|
|
807
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_react_ui6.Avatar.Fallback, {
|
|
808
|
+
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
809
|
+
})), /* @__PURE__ */ import_react12.default.createElement(import_react_ui6.Avatar.Label, {
|
|
810
|
+
classNames: "text-sm truncate pli-2"
|
|
811
|
+
}, displayName)));
|
|
812
|
+
});
|
|
813
|
+
var SpaceMemberList = ({ spaceKey, includeSelf, onSelect }) => {
|
|
814
|
+
const client = (0, import_react_client.useClient)();
|
|
815
|
+
const allUnsortedMembers = (0, import_echo2.useMembers)(spaceKey);
|
|
816
|
+
const members = (0, import_react13.useMemo)(() => includeSelf ? allUnsortedMembers.sort((member) => member.identity.identityKey.equals(client.halo.identity.get().identityKey) ? -1 : 1) : allUnsortedMembers.filter((member) => !member.identity.identityKey.equals(client.halo.identity.get().identityKey)), [
|
|
817
|
+
allUnsortedMembers
|
|
818
|
+
]);
|
|
819
|
+
return /* @__PURE__ */ import_react13.default.createElement(SpaceMemberListImpl, {
|
|
820
|
+
members,
|
|
821
|
+
onSelect
|
|
822
|
+
});
|
|
823
|
+
};
|
|
824
|
+
var SpaceMemberListImpl = ({ members, onSelect }) => {
|
|
825
|
+
const { t } = (0, import_react_ui7.useTranslation)("os");
|
|
826
|
+
const visibleMembers = members.filter((member) => member.identity);
|
|
827
|
+
return visibleMembers.length > 0 ? /* @__PURE__ */ import_react13.default.createElement(import_react_ui7.List, {
|
|
828
|
+
classNames: "flex flex-col gap-2",
|
|
829
|
+
"data-testid": "space-members-list"
|
|
830
|
+
}, visibleMembers.map((member) => {
|
|
831
|
+
return /* @__PURE__ */ import_react13.default.createElement(IdentityListItem, {
|
|
832
|
+
key: member.identity.identityKey.toHex(),
|
|
833
|
+
identity: member.identity,
|
|
834
|
+
presence: member.presence,
|
|
835
|
+
onClick: onSelect && (() => onSelect(member))
|
|
836
|
+
});
|
|
837
|
+
})) : /* @__PURE__ */ import_react13.default.createElement("div", {
|
|
838
|
+
role: "none",
|
|
839
|
+
className: "grow flex items-center p-2"
|
|
840
|
+
}, /* @__PURE__ */ import_react13.default.createElement("p", {
|
|
841
|
+
className: (0, import_react_ui_theme7.mx)(import_react_ui_theme7.descriptionText, "text-center is-full mlb-2")
|
|
842
|
+
}, t("empty space members message")));
|
|
843
|
+
};
|
|
844
|
+
var iconProps = {
|
|
845
|
+
weight: "duotone",
|
|
846
|
+
width: 24,
|
|
847
|
+
height: 24,
|
|
848
|
+
x: 8,
|
|
849
|
+
y: 8
|
|
850
|
+
};
|
|
851
|
+
var DeviceListItem = /* @__PURE__ */ (0, import_react17.forwardRef)(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy, ...props }, forwardedRef) => {
|
|
852
|
+
const { t } = (0, import_react_ui9.useTranslation)("os");
|
|
853
|
+
const fallbackValue = (0, import_util2.keyToFallback)(device.deviceKey);
|
|
854
|
+
const labelId = (0, import_react_ui9.useId)("identityListItem__label");
|
|
855
|
+
const displayName = device.profile ? t("device name placeholder", {
|
|
856
|
+
os: device.profile.os,
|
|
857
|
+
platform: device.profile.platform
|
|
858
|
+
}) : (0, import_display_name2.generateName)(device.deviceKey.toHex());
|
|
859
|
+
const isCurrent = device.kind === import_halo.DeviceKind.CURRENT;
|
|
860
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.ListItem.Root, {
|
|
861
|
+
...props,
|
|
862
|
+
classNames: [
|
|
863
|
+
"flex gap-2 items-center mlb-2",
|
|
864
|
+
classNames
|
|
865
|
+
],
|
|
866
|
+
"data-testid": `device-list-item${isCurrent ? "-current" : ""}`,
|
|
867
|
+
labelId,
|
|
868
|
+
ref: forwardedRef
|
|
869
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Avatar.Root, {
|
|
870
|
+
status: isCurrent && connectionState === import_mesh.ConnectionState.OFFLINE ? "error" : device.presence === import_halo.Device.PresenceState.ONLINE ? "active" : "inactive",
|
|
871
|
+
labelId,
|
|
872
|
+
hue: fallbackValue.hue,
|
|
873
|
+
variant: "square"
|
|
874
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Avatar.Frame, {
|
|
875
|
+
classNames: "place-self-center"
|
|
876
|
+
}, device.profile?.type ? device.profile.type === import_halo.DeviceType.AGENT_MANAGED ? /* @__PURE__ */ import_react17.default.createElement(import_react16.Database, iconProps) : device.profile.type === import_halo.DeviceType.BROWSER ? /* @__PURE__ */ import_react17.default.createElement(import_react16.Compass, iconProps) : device.profile.type === import_halo.DeviceType.NATIVE ? /* @__PURE__ */ import_react17.default.createElement(import_react16.Desktop, iconProps) : [
|
|
877
|
+
import_halo.DeviceType.AGENT,
|
|
878
|
+
import_halo.DeviceType.AGENT_MANAGED
|
|
879
|
+
].includes(device.profile.type) ? /* @__PURE__ */ import_react17.default.createElement(import_react16.Robot, iconProps) : device.profile.type === import_halo.DeviceType.MOBILE ? /* @__PURE__ */ import_react17.default.createElement(import_react16.DeviceMobile, iconProps) : /* @__PURE__ */ import_react17.default.createElement(import_react16.Devices, iconProps) : /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Avatar.Fallback, {
|
|
880
|
+
text: fallbackValue.emoji
|
|
881
|
+
})), /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Avatar.Label, {
|
|
882
|
+
classNames: "flex-1 text-sm truncate"
|
|
883
|
+
}, displayName), isCurrent && /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tag, {
|
|
884
|
+
color: "primary"
|
|
885
|
+
}, t("current device tag label")), device.profile?.type === import_halo.DeviceType.AGENT_MANAGED ? /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Trigger, {
|
|
886
|
+
asChild: true
|
|
887
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Button, {
|
|
888
|
+
variant: "ghost",
|
|
889
|
+
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
890
|
+
"data-testid": "agent.destroy",
|
|
891
|
+
onClick: onAgentDestroy
|
|
892
|
+
}, /* @__PURE__ */ import_react17.default.createElement("span", {
|
|
893
|
+
className: "sr-only"
|
|
894
|
+
}, t("destroy agent label")), /* @__PURE__ */ import_react17.default.createElement(import_react16.Power, {
|
|
895
|
+
className: (0, import_react_ui_theme9.getSize)(5)
|
|
896
|
+
}))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Portal, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Tooltip.Content, {
|
|
897
|
+
side: "bottom",
|
|
898
|
+
classNames: "z-50"
|
|
899
|
+
}, t("destroy agent label")))) : device.kind === import_halo.DeviceKind.CURRENT && /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Root, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Trigger, {
|
|
900
|
+
asChild: true
|
|
901
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.Button, {
|
|
902
|
+
variant: "ghost",
|
|
903
|
+
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
904
|
+
"data-testid": `device-list-item${isCurrent ? "-current" : ""}.options`
|
|
905
|
+
}, /* @__PURE__ */ import_react17.default.createElement("span", {
|
|
906
|
+
className: "sr-only"
|
|
907
|
+
}, t("more options label")), /* @__PURE__ */ import_react17.default.createElement(import_react16.DotsThree, {
|
|
908
|
+
className: (0, import_react_ui_theme9.getSize)(5)
|
|
909
|
+
}))), /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Content, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Viewport, null, /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Item, {
|
|
910
|
+
"data-testid": "device-list-item-current.join-existing",
|
|
911
|
+
onClick: onClickJoinExisting
|
|
912
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react16.ShareFat, {
|
|
913
|
+
className: (0, import_react_ui_theme9.getSize)(5)
|
|
914
|
+
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Item, {
|
|
915
|
+
"data-testid": "device-list-item-current.recover",
|
|
916
|
+
onClick: onClickRecover
|
|
917
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react16.FirstAidKit, {
|
|
918
|
+
className: (0, import_react_ui_theme9.getSize)(5)
|
|
919
|
+
}), t("choose recover identity label")), /* @__PURE__ */ import_react17.default.createElement(import_react_ui9.DropdownMenu.Item, {
|
|
920
|
+
"data-testid": "device-list-item-current.reset",
|
|
921
|
+
onClick: onClickReset
|
|
922
|
+
}, /* @__PURE__ */ import_react17.default.createElement(import_react16.Power, {
|
|
923
|
+
className: (0, import_react_ui_theme9.getSize)(5)
|
|
924
|
+
}), t("reset device label")))))));
|
|
925
|
+
});
|
|
926
|
+
var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, onAgentDestroy }) => {
|
|
927
|
+
const { t } = (0, import_react_ui8.useTranslation)("os");
|
|
928
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_react15.default.Fragment, null, /* @__PURE__ */ import_react15.default.createElement("h2", {
|
|
929
|
+
className: (0, import_react_ui_theme8.mx)(import_react_ui_theme8.descriptionText, "text-center mbs-4")
|
|
930
|
+
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */ import_react15.default.createElement(import_react_ui8.List, null, devices.map((device) => {
|
|
931
|
+
return /* @__PURE__ */ import_react15.default.createElement(DeviceListItem, {
|
|
932
|
+
key: device.deviceKey.toHex(),
|
|
933
|
+
device,
|
|
934
|
+
onClickEdit: () => onClickEdit?.(device),
|
|
935
|
+
onClickReset,
|
|
936
|
+
onClickRecover,
|
|
937
|
+
onClickJoinExisting,
|
|
938
|
+
connectionState,
|
|
939
|
+
onAgentDestroy
|
|
940
|
+
});
|
|
941
|
+
})), /* @__PURE__ */ import_react15.default.createElement(import_react_ui8.Button, {
|
|
942
|
+
variant: "ghost",
|
|
943
|
+
classNames: "justify-start gap-2 !pis-0 !pie-3 is-full",
|
|
944
|
+
"data-testid": "devices-panel.create-invitation",
|
|
945
|
+
onClick: onClickAdd
|
|
946
|
+
}, /* @__PURE__ */ import_react15.default.createElement("div", {
|
|
947
|
+
role: "img",
|
|
948
|
+
className: (0, import_react_ui_theme8.mx)((0, import_react_ui_theme8.getSize)(8), "m-1 rounded-sm bg-input grid place-items-center")
|
|
949
|
+
}, /* @__PURE__ */ import_react15.default.createElement(import_react14.Plus, {
|
|
950
|
+
weight: "light",
|
|
951
|
+
className: (0, import_react_ui_theme8.getSize)(6)
|
|
952
|
+
})), /* @__PURE__ */ import_react15.default.createElement("span", {
|
|
953
|
+
className: "grow font-medium text-start"
|
|
954
|
+
}, t("choose add device label")), /* @__PURE__ */ import_react15.default.createElement(import_react14.CaretRight, {
|
|
955
|
+
weight: "bold",
|
|
956
|
+
className: (0, import_react_ui_theme8.getSize)(4)
|
|
957
|
+
})));
|
|
958
|
+
};
|
|
959
|
+
var AuthCode = (props) => {
|
|
960
|
+
const { code, large, classNames } = props;
|
|
961
|
+
const l = code?.length ?? 0;
|
|
962
|
+
const left = code?.slice(0, l / 2);
|
|
963
|
+
const right = code?.slice(l / 2);
|
|
964
|
+
const codeRef = (0, import_react20.useRef)(null);
|
|
965
|
+
const handleClick = () => {
|
|
966
|
+
if (codeRef.current) {
|
|
967
|
+
const selection = window.getSelection();
|
|
968
|
+
selection?.removeAllRanges();
|
|
969
|
+
const range = document.createRange();
|
|
970
|
+
range.selectNodeContents(codeRef.current);
|
|
971
|
+
selection?.addRange(range);
|
|
972
|
+
}
|
|
973
|
+
void navigator.clipboard.writeText(code ?? "");
|
|
974
|
+
};
|
|
975
|
+
return /* @__PURE__ */ import_react20.default.createElement("span", {
|
|
976
|
+
className: (0, import_react_ui_theme11.mx)(large ? "text-6xl" : "text-2xl", "font-mono pli-2.5 rounded cursor-pointer", classNames),
|
|
977
|
+
onClick: handleClick,
|
|
978
|
+
ref: codeRef
|
|
979
|
+
}, /* @__PURE__ */ import_react20.default.createElement("span", {
|
|
980
|
+
className: "mie-[0.4em]"
|
|
981
|
+
}, left), /* @__PURE__ */ import_react20.default.createElement("span", null, right));
|
|
982
|
+
};
|
|
983
|
+
var InvitationListItem = (props) => {
|
|
984
|
+
const { invitation } = props;
|
|
985
|
+
const invitationStatus = (0, import_invitations.useInvitationStatus)(invitation);
|
|
986
|
+
return /* @__PURE__ */ import_react19.default.createElement(InvitationListItemImpl, {
|
|
987
|
+
...props,
|
|
988
|
+
invitationStatus
|
|
989
|
+
});
|
|
990
|
+
};
|
|
991
|
+
var avatarProps = {
|
|
992
|
+
size: 10,
|
|
993
|
+
variant: "circle"
|
|
994
|
+
};
|
|
995
|
+
var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
996
|
+
const { tx } = (0, import_react_ui10.useThemeContext)();
|
|
997
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
998
|
+
role: "none",
|
|
999
|
+
className: (0, import_react_ui_theme10.mx)("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1", (0, import_react_ui_theme10.getSize)(avatarProps.size))
|
|
1000
|
+
}, /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1001
|
+
role: "none",
|
|
1002
|
+
className: tx("avatar.ring", "avatar__ring", {
|
|
1003
|
+
...avatarProps,
|
|
1004
|
+
status,
|
|
1005
|
+
animation
|
|
1006
|
+
}),
|
|
1007
|
+
style: {
|
|
1008
|
+
animationDelay: "400ms"
|
|
1009
|
+
}
|
|
1010
|
+
})), /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1011
|
+
role: "none",
|
|
1012
|
+
className: (0, import_react_ui_theme10.mx)("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2", (0, import_react_ui_theme10.getSize)(avatarProps.size))
|
|
1013
|
+
}, /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1014
|
+
role: "none",
|
|
1015
|
+
className: tx("avatar.ring", "avatar__ring", {
|
|
1016
|
+
...avatarProps,
|
|
1017
|
+
status,
|
|
1018
|
+
animation
|
|
1019
|
+
}),
|
|
1020
|
+
style: {
|
|
1021
|
+
animationDelay: "200ms"
|
|
1022
|
+
}
|
|
1023
|
+
})));
|
|
1024
|
+
};
|
|
1025
|
+
var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
|
|
1026
|
+
const { t } = (0, import_react_ui10.useTranslation)("os");
|
|
1027
|
+
const { cancel, status: invitationStatus, invitationCode, authCode, multiUse, shareable } = propsInvitationStatus;
|
|
1028
|
+
const isCancellable = !([
|
|
1029
|
+
import_invitations.Invitation.State.ERROR,
|
|
1030
|
+
import_invitations.Invitation.State.TIMEOUT,
|
|
1031
|
+
import_invitations.Invitation.State.CANCELLED
|
|
1032
|
+
].indexOf(invitationStatus) >= 0);
|
|
1033
|
+
const showShare = shareable && (multiUse || [
|
|
1034
|
+
import_invitations.Invitation.State.INIT,
|
|
1035
|
+
import_invitations.Invitation.State.CONNECTING,
|
|
1036
|
+
import_invitations.Invitation.State.CONNECTED
|
|
1037
|
+
].indexOf(invitationStatus) >= 0);
|
|
1038
|
+
const showAuthCode = invitationStatus === import_invitations.Invitation.State.READY_FOR_AUTHENTICATION;
|
|
1039
|
+
const handleClickRemove = (0, import_react19.useCallback)(() => onClickRemove?.(invitation), [
|
|
1040
|
+
invitation,
|
|
1041
|
+
onClickRemove
|
|
1042
|
+
]);
|
|
1043
|
+
const invitationUrl = invitationCode && createInvitationUrl(invitationCode);
|
|
1044
|
+
const invitationId = invitation?.get().invitationId;
|
|
1045
|
+
const invitationHasLifetime = invitation?.get().lifetime;
|
|
1046
|
+
const invitationTimeLeft = invitation?.expiry ? (0, import_date_fns.formatDistanceToNow)(invitation?.expiry, {
|
|
1047
|
+
addSuffix: true
|
|
1048
|
+
}) : void 0;
|
|
1049
|
+
const avatarAnimation = [
|
|
1050
|
+
import_invitations.Invitation.State.INIT,
|
|
1051
|
+
import_invitations.Invitation.State.CONNECTING,
|
|
1052
|
+
import_invitations.Invitation.State.CONNECTED,
|
|
1053
|
+
import_invitations.Invitation.State.READY_FOR_AUTHENTICATION,
|
|
1054
|
+
import_invitations.Invitation.State.AUTHENTICATING
|
|
1055
|
+
].includes(invitationStatus) ? "pulse" : "none";
|
|
1056
|
+
const avatarError = [
|
|
1057
|
+
import_invitations.Invitation.State.ERROR,
|
|
1058
|
+
import_invitations.Invitation.State.TIMEOUT,
|
|
1059
|
+
import_invitations.Invitation.State.CANCELLED
|
|
1060
|
+
].includes(invitationStatus);
|
|
1061
|
+
const avatarGreen = [
|
|
1062
|
+
import_invitations.Invitation.State.CONNECTED,
|
|
1063
|
+
import_invitations.Invitation.State.READY_FOR_AUTHENTICATION,
|
|
1064
|
+
import_invitations.Invitation.State.AUTHENTICATING,
|
|
1065
|
+
import_invitations.Invitation.State.SUCCESS
|
|
1066
|
+
].includes(invitationStatus);
|
|
1067
|
+
const avatarStatus = avatarError ? "error" : avatarGreen ? "active" : "inactive";
|
|
1068
|
+
return /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.ListItem.Root, {
|
|
1069
|
+
id: invitationCode,
|
|
1070
|
+
...props,
|
|
1071
|
+
classNames: [
|
|
1072
|
+
"flex gap-2 pis-3 pie-1 items-center relative",
|
|
1073
|
+
props.classNames
|
|
1074
|
+
]
|
|
1075
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.ListItem.Heading, {
|
|
1076
|
+
classNames: "sr-only"
|
|
1077
|
+
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */ import_react19.default.createElement(AvatarStackEffect, {
|
|
1078
|
+
status: avatarStatus,
|
|
1079
|
+
animation: avatarAnimation,
|
|
1080
|
+
reverseEffects
|
|
1081
|
+
}), /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Root, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Avatar.Root, {
|
|
1082
|
+
...avatarProps,
|
|
1083
|
+
animation: avatarAnimation,
|
|
1084
|
+
status: avatarStatus
|
|
1085
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Trigger, {
|
|
1086
|
+
asChild: true
|
|
1087
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Avatar.Frame, {
|
|
1088
|
+
tabIndex: 0,
|
|
1089
|
+
classNames: [
|
|
1090
|
+
import_react_ui_theme10.focusRing,
|
|
1091
|
+
"relative rounded-full place-self-center"
|
|
1092
|
+
]
|
|
1093
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Avatar.Fallback, {
|
|
1094
|
+
text: (0, import_util3.hexToEmoji)(invitationId)
|
|
1095
|
+
})))), /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Portal, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Content, {
|
|
1096
|
+
side: "left",
|
|
1097
|
+
classNames: "z-[70]"
|
|
1098
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Arrow, null)))), showShare && invitationUrl ? /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Root, null, /* @__PURE__ */ import_react19.default.createElement(import_react19.default.Fragment, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Trigger, {
|
|
1099
|
+
asChild: true
|
|
1100
|
+
}, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Button, {
|
|
1101
|
+
variant: "ghost",
|
|
1102
|
+
classNames: "grow justify-start font-medium",
|
|
1103
|
+
onClick: () => send({
|
|
1104
|
+
type: "selectInvitation",
|
|
1105
|
+
invitation
|
|
1106
|
+
}),
|
|
1107
|
+
"data-testid": "show-qrcode"
|
|
1108
|
+
}, /* @__PURE__ */ import_react19.default.createElement("span", null, t("open share panel label")))), /* @__PURE__ */ import_react19.default.createElement(CopyButtonIconOnly, {
|
|
1109
|
+
variant: "ghost",
|
|
1110
|
+
value: invitationUrl
|
|
1111
|
+
})), /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Portal, null, /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Tooltip.Content, {
|
|
1112
|
+
side: "left",
|
|
1113
|
+
classNames: "z-[70]"
|
|
1114
|
+
}, invitationHasLifetime && /* @__PURE__ */ import_react19.default.createElement("span", null, "Expires ", invitationTimeLeft)))) : showAuthCode ? /* @__PURE__ */ import_react19.default.createElement(AuthCode, {
|
|
1115
|
+
code: authCode,
|
|
1116
|
+
classNames: "grow"
|
|
1117
|
+
}) : invitationStatus === import_invitations.Invitation.State.CONNECTING ? /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1118
|
+
className: "pli-2 grow text-neutral-500"
|
|
1119
|
+
}, "Connecting...") : invitationStatus === import_invitations.Invitation.State.AUTHENTICATING ? /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1120
|
+
className: "pli-2 grow text-neutral-500"
|
|
1121
|
+
}, "Authenticating...") : invitationStatus === import_invitations.Invitation.State.ERROR || invitationStatus === import_invitations.Invitation.State.TIMEOUT ? /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1122
|
+
className: "pli-2 grow text-neutral-500"
|
|
1123
|
+
}, "Failed") : invitationStatus === import_invitations.Invitation.State.CANCELLED ? /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1124
|
+
className: "pli-2 grow text-neutral-500"
|
|
1125
|
+
}, "Cancelled") : invitationStatus === import_invitations.Invitation.State.SUCCESS ? /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1126
|
+
className: "pli-2 grow truncate"
|
|
1127
|
+
}, "User joined") : !shareable ? /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1128
|
+
className: "pli-2 grow text-neutral-500"
|
|
1129
|
+
}, "Pending Invitation") : /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1130
|
+
className: "grow"
|
|
1131
|
+
}, " "), isCancellable ? /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Button, {
|
|
1132
|
+
variant: "ghost",
|
|
1133
|
+
classNames: "flex gap-1 pli-0",
|
|
1134
|
+
onClick: cancel,
|
|
1135
|
+
"data-testid": "cancel-invitation"
|
|
1136
|
+
}, /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1137
|
+
className: "sr-only"
|
|
1138
|
+
}, t("cancel invitation label")), /* @__PURE__ */ import_react19.default.createElement(import_react18.X, {
|
|
1139
|
+
className: (0, import_react_ui_theme10.getSize)(4)
|
|
1140
|
+
})) : /* @__PURE__ */ import_react19.default.createElement(import_react_ui10.Button, {
|
|
1141
|
+
variant: "ghost",
|
|
1142
|
+
classNames: "flex gap-1 pli-0",
|
|
1143
|
+
onClick: handleClickRemove,
|
|
1144
|
+
"data-testid": "remove-invitation"
|
|
1145
|
+
}, /* @__PURE__ */ import_react19.default.createElement("span", {
|
|
1146
|
+
className: "sr-only"
|
|
1147
|
+
}, t("remove invitation label")), /* @__PURE__ */ import_react19.default.createElement(import_react18.X, {
|
|
1148
|
+
className: (0, import_react_ui_theme10.getSize)(4)
|
|
1149
|
+
})));
|
|
1150
|
+
};
|
|
1151
|
+
var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
1152
|
+
const { className, InvitationListItem: Item = InvitationListItem } = invitationProps;
|
|
1153
|
+
return /* @__PURE__ */ import_react22.default.createElement(import_react_ui11.List, {
|
|
1154
|
+
classNames: (0, import_react_ui_theme12.mx)("flex flex-col gap-2", className)
|
|
1155
|
+
}, invitations.map((invitation) => {
|
|
1156
|
+
const value = invitation.get().invitationId;
|
|
1157
|
+
return /* @__PURE__ */ import_react22.default.createElement(Item, {
|
|
1158
|
+
key: value,
|
|
1159
|
+
send,
|
|
1160
|
+
invitation,
|
|
1161
|
+
...invitationProps
|
|
1162
|
+
});
|
|
1163
|
+
}));
|
|
1164
|
+
};
|
|
1165
|
+
var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
1166
|
+
const space = (0, import_echo3.useSpace)(spaceKey);
|
|
1167
|
+
const invitations = (0, import_echo3.useSpaceInvitations)(spaceKey);
|
|
1168
|
+
const handleClickRemove = (0, import_react21.useCallback)((invitation) => {
|
|
1169
|
+
void invitation.cancel();
|
|
1170
|
+
}, [
|
|
1171
|
+
space
|
|
1172
|
+
]);
|
|
1173
|
+
return /* @__PURE__ */ import_react21.default.createElement(InvitationList, {
|
|
1174
|
+
invitations,
|
|
1175
|
+
onClickRemove: handleClickRemove,
|
|
1176
|
+
createInvitationUrl,
|
|
1177
|
+
send
|
|
1178
|
+
});
|
|
1179
|
+
};
|
|
1180
|
+
var defaultActions = {
|
|
1181
|
+
noopAction: {
|
|
1182
|
+
label: "No-op",
|
|
1183
|
+
description: "",
|
|
1184
|
+
icon: import_react23.Placeholder,
|
|
1185
|
+
onClick: () => {
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
var BifurcatedAction = /* @__PURE__ */ (0, import_react24.forwardRef)((props, forwardedRef) => {
|
|
1190
|
+
const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, ...rest } = props;
|
|
1191
|
+
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] = (0, import_react_use_controllable_state3.useControllableState)({
|
|
1192
|
+
prop: propsActiveAction,
|
|
1193
|
+
onChange: onChangeActiveAction,
|
|
1194
|
+
defaultProp: defaultActiveAction
|
|
1195
|
+
});
|
|
1196
|
+
const activeAction = actions[activeActionKey2] ?? {};
|
|
1197
|
+
const { t } = (0, import_react_ui12.useTranslation)("os");
|
|
1198
|
+
return /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1199
|
+
role: "none",
|
|
1200
|
+
className: (0, import_react_ui_theme13.mx)("mbs-2 flex gap-px items-center", isFull && "is-full")
|
|
1201
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.Button, {
|
|
1202
|
+
...rest,
|
|
1203
|
+
classNames: [
|
|
1204
|
+
"bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none",
|
|
1205
|
+
classNames
|
|
1206
|
+
],
|
|
1207
|
+
ref: forwardedRef,
|
|
1208
|
+
variant,
|
|
1209
|
+
onClick: activeAction.onClick
|
|
1210
|
+
}, activeAction.icon && /* @__PURE__ */ import_react24.default.createElement(activeAction.icon, {
|
|
1211
|
+
className: (0, import_react_ui_theme13.getSize)(5)
|
|
1212
|
+
}), /* @__PURE__ */ import_react24.default.createElement("span", null, activeAction.label)), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Root, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Trigger, {
|
|
1213
|
+
asChild: true
|
|
1214
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.Button, {
|
|
1215
|
+
classNames: [
|
|
1216
|
+
"bs-11 flex-none rounded-is-none",
|
|
1217
|
+
classNames
|
|
1218
|
+
]
|
|
1219
|
+
}, /* @__PURE__ */ import_react24.default.createElement("span", {
|
|
1220
|
+
className: "sr-only"
|
|
1221
|
+
}, t("invite options label")), /* @__PURE__ */ import_react24.default.createElement(import_react23.CaretDown, {
|
|
1222
|
+
className: (0, import_react_ui_theme13.getSize)(4)
|
|
1223
|
+
}))), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Content, null, /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
1224
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.CheckboxItem, {
|
|
1225
|
+
key: id,
|
|
1226
|
+
"aria-labelledby": `${id}__label`,
|
|
1227
|
+
"aria-describedby": `${id}__description`,
|
|
1228
|
+
checked: activeActionKey2 === id,
|
|
1229
|
+
onCheckedChange: (checked) => checked && setActiveAction(id),
|
|
1230
|
+
classNames: "gap-2"
|
|
1231
|
+
}, action.icon && /* @__PURE__ */ import_react24.default.createElement(action.icon, {
|
|
1232
|
+
className: (0, import_react_ui_theme13.getSize)(5)
|
|
1233
|
+
}), /* @__PURE__ */ import_react24.default.createElement("div", {
|
|
1234
|
+
role: "none",
|
|
1235
|
+
className: "flex-1 min-is-0 space-b-1"
|
|
1236
|
+
}, /* @__PURE__ */ import_react24.default.createElement("p", {
|
|
1237
|
+
id: `${id}__label`
|
|
1238
|
+
}, action.label), action.description && /* @__PURE__ */ import_react24.default.createElement("p", {
|
|
1239
|
+
id: `${id}__description`,
|
|
1240
|
+
className: import_react_ui_theme13.descriptionText
|
|
1241
|
+
}, action.description)), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.ItemIndicator, {
|
|
1242
|
+
asChild: true
|
|
1243
|
+
}, /* @__PURE__ */ import_react24.default.createElement(import_react23.Check, {
|
|
1244
|
+
weight: "bold",
|
|
1245
|
+
className: (0, import_react_ui_theme13.getSize)(4)
|
|
1246
|
+
})));
|
|
1247
|
+
})), /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.DropdownMenu.Arrow, null))));
|
|
1248
|
+
});
|
|
1249
|
+
var Action = /* @__PURE__ */ (0, import_react24.forwardRef)((props, forwardedRef) => {
|
|
1250
|
+
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
1251
|
+
return /* @__PURE__ */ import_react24.default.createElement(import_react_ui12.Button, {
|
|
1252
|
+
...rest,
|
|
1253
|
+
classNames: [
|
|
1254
|
+
isFull && "is-full",
|
|
1255
|
+
"bs-11 flex gap-2 mbs-2",
|
|
1256
|
+
classNames
|
|
1257
|
+
],
|
|
1258
|
+
ref: forwardedRef,
|
|
1259
|
+
variant
|
|
1260
|
+
}, children);
|
|
1261
|
+
});
|
|
1262
|
+
var Actions = /* @__PURE__ */ (0, import_react25.forwardRef)(({ classNames, children, ...props }, forwardedRef) => {
|
|
1263
|
+
return /* @__PURE__ */ import_react25.default.createElement("div", {
|
|
1264
|
+
...props,
|
|
1265
|
+
className: (0, import_react_ui_theme14.mx)("flex flex-col gap-2 mbs-2", Array.isArray(children) && children.length > 1 ? "justify-between" : "justify-center", classNames),
|
|
1266
|
+
ref: forwardedRef
|
|
1267
|
+
}, children);
|
|
1268
|
+
});
|
|
1269
|
+
var CloseButton = ({ onDone, ...props }) => {
|
|
1270
|
+
const { t } = (0, import_react_ui13.useTranslation)("os");
|
|
1271
|
+
return /* @__PURE__ */ import_react27.default.createElement(import_react_ui13.Button, {
|
|
1272
|
+
variant: "ghost",
|
|
1273
|
+
classNames: (0, import_react_ui_theme15.mx)("plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
1274
|
+
onClick: () => onDone?.(),
|
|
1275
|
+
...props
|
|
1276
|
+
}, /* @__PURE__ */ import_react27.default.createElement(import_react26.X, {
|
|
1277
|
+
weight: "bold",
|
|
1278
|
+
className: (0, import_react_ui_theme15.getSize)(4)
|
|
1279
|
+
}), /* @__PURE__ */ import_react27.default.createElement("span", {
|
|
1280
|
+
className: "sr-only"
|
|
1281
|
+
}, t("exit label")));
|
|
1282
|
+
};
|
|
1283
|
+
var Emoji = ({ text, className }) => {
|
|
1284
|
+
const size = 14;
|
|
1285
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1286
|
+
role: "none",
|
|
1287
|
+
className: (0, import_react_ui_theme16.mx)((0, import_react_ui_theme16.getSize)(size), "rounded relative pointer-events-none", className)
|
|
1288
|
+
}, /* @__PURE__ */ import_react28.default.createElement("svg", {
|
|
1289
|
+
viewBox: `0 0 ${size * 4} ${size * 4}`,
|
|
1290
|
+
width: size * 4,
|
|
1291
|
+
height: size * 4
|
|
1292
|
+
}, /* @__PURE__ */ import_react28.default.createElement("text", {
|
|
1293
|
+
x: "50%",
|
|
1294
|
+
y: "50%",
|
|
1295
|
+
textAnchor: "middle",
|
|
1296
|
+
dominantBaseline: "middle",
|
|
1297
|
+
baselineShift: "-0.25rem",
|
|
1298
|
+
fontSize: "2.25rem"
|
|
1299
|
+
}, text)));
|
|
1300
|
+
};
|
|
1301
|
+
var Centered = (props) => {
|
|
1302
|
+
const { children } = props;
|
|
1303
|
+
return /* @__PURE__ */ import_react28.default.createElement("div", {
|
|
1304
|
+
role: "none",
|
|
1305
|
+
className: "absolute inset-0 flex items-center justify-center"
|
|
1306
|
+
}, children);
|
|
1307
|
+
};
|
|
1308
|
+
var Heading = /* @__PURE__ */ (0, import_react29.forwardRef)(({ titleId, title, titleSrOnly, children, corner }, forwardedRef) => {
|
|
1309
|
+
return /* @__PURE__ */ import_react29.default.createElement("div", {
|
|
1310
|
+
role: "none",
|
|
1311
|
+
className: "pbe-2 relative",
|
|
1312
|
+
ref: forwardedRef
|
|
1313
|
+
}, corner, /* @__PURE__ */ import_react29.default.createElement("h1", {
|
|
1314
|
+
...!titleSrOnly && {
|
|
1315
|
+
id: titleId
|
|
1316
|
+
},
|
|
1317
|
+
className: (0, import_react_ui_theme17.mx)(import_react_ui_theme17.descriptionText, "text-center mlb-2", titleSrOnly && "invisible")
|
|
1318
|
+
}, title), titleSrOnly && /* @__PURE__ */ import_react29.default.createElement("span", {
|
|
1319
|
+
id: titleId
|
|
1320
|
+
}, title), children);
|
|
1321
|
+
});
|
|
1322
|
+
var Label = (props) => {
|
|
1323
|
+
const { children } = props;
|
|
1324
|
+
return /* @__PURE__ */ import_react30.default.createElement("span", {
|
|
1325
|
+
className: (0, import_react_ui_theme18.mx)(import_react_ui_theme18.descriptionText, "text-center mli-6 whitespace-normal")
|
|
1326
|
+
}, children);
|
|
1327
|
+
};
|
|
1328
|
+
var Input = ({ validationMessage, label, ...props }) => {
|
|
1329
|
+
return /* @__PURE__ */ import_react31.default.createElement(import_react_ui14.Input.Root, null, /* @__PURE__ */ import_react31.default.createElement(import_react_ui14.Input.Label, null, label), /* @__PURE__ */ import_react31.default.createElement(import_react_ui14.Input.TextInput, {
|
|
1330
|
+
...props,
|
|
1331
|
+
classNames: "plb-3 mbs-2 text-center"
|
|
1332
|
+
}), /* @__PURE__ */ import_react31.default.createElement(import_react_ui14.Input.DescriptionAndValidation, null, validationMessage && /* @__PURE__ */ import_react31.default.createElement(import_react_ui14.Input.Validation, null, validationMessage)));
|
|
1333
|
+
};
|
|
1334
|
+
var StepHeading = /* @__PURE__ */ (0, import_react32.forwardRef)(({ children, className, ...props }, forwardedRef) => {
|
|
1335
|
+
return /* @__PURE__ */ import_react32.default.createElement("h2", {
|
|
1336
|
+
...props,
|
|
1337
|
+
className: (0, import_react_ui_theme19.mx)("font-normal text-sm mbe-4 mli-1 text-center", className),
|
|
1338
|
+
ref: forwardedRef
|
|
1339
|
+
}, children);
|
|
1340
|
+
});
|
|
1341
|
+
var VIEWPORT_NAME = "Viewport";
|
|
1342
|
+
var VIEWS_NAME = "ViewportViews";
|
|
1343
|
+
var VIEW_NAME = "ViewportView";
|
|
1344
|
+
var [createViewportContext, createViewportScope] = (0, import_react_context.createContextScope)(VIEWPORT_NAME, []);
|
|
1345
|
+
var [ViewportProvider, useViewportContext] = createViewportContext(VIEWPORT_NAME);
|
|
1346
|
+
var ViewportRoot = ({ __viewportScope, classNames, children, defaultActiveView, activeView: propsActiveView, focusManaged = false, onActiveViewChange, ...props }) => {
|
|
1347
|
+
const [activeView = "never", setActiveView] = (0, import_react_use_controllable_state4.useControllableState)({
|
|
1348
|
+
prop: propsActiveView,
|
|
1349
|
+
defaultProp: defaultActiveView,
|
|
1350
|
+
onChange: onActiveViewChange
|
|
1351
|
+
});
|
|
1352
|
+
return /* @__PURE__ */ import_react33.default.createElement(ViewportProvider, {
|
|
1353
|
+
focusManaged,
|
|
1354
|
+
activeView,
|
|
1355
|
+
setActiveView,
|
|
1356
|
+
scope: __viewportScope
|
|
1357
|
+
}, /* @__PURE__ */ import_react33.default.createElement("div", {
|
|
1358
|
+
role: "region",
|
|
1359
|
+
"aria-live": "polite",
|
|
1360
|
+
...props,
|
|
1361
|
+
className: (0, import_react_ui_theme20.mx)("is-full overflow-hidden", classNames)
|
|
1362
|
+
}, children));
|
|
1363
|
+
};
|
|
1364
|
+
ViewportRoot.displayName = VIEWPORT_NAME;
|
|
1365
|
+
var ViewportViews = ({ classNames, children, ...props }) => {
|
|
1366
|
+
const size = {
|
|
1367
|
+
inlineSize: `${Math.ceil(children.length) * 100}%`
|
|
1368
|
+
};
|
|
1369
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", {
|
|
1370
|
+
role: "none",
|
|
1371
|
+
style: size,
|
|
1372
|
+
...props,
|
|
1373
|
+
className: (0, import_react_ui_theme20.mx)("flex", classNames)
|
|
1374
|
+
}, children);
|
|
1375
|
+
};
|
|
1376
|
+
ViewportViews.displayName = VIEWS_NAME;
|
|
1377
|
+
var ViewportView = /* @__PURE__ */ (0, import_react33.forwardRef)(({ __viewportScope, classNames, children, id, ...props }, forwardedRef) => {
|
|
1378
|
+
const { activeView, focusManaged } = useViewportContext(VIEW_NAME, __viewportScope);
|
|
1379
|
+
const isActive = id === activeView;
|
|
1380
|
+
const ref = (0, import_react_ui15.useForwardedRef)(forwardedRef);
|
|
1381
|
+
const { findFirstFocusable } = (0, import_react_tabster.useFocusFinders)();
|
|
1382
|
+
(0, import_react33.useEffect)(() => {
|
|
1383
|
+
if (!focusManaged && isActive && document.body.hasAttribute("data-is-keyboard") && ref.current) {
|
|
1384
|
+
findFirstFocusable(ref.current)?.focus();
|
|
1385
|
+
}
|
|
1386
|
+
}, [
|
|
1387
|
+
focusManaged,
|
|
1388
|
+
ref.current,
|
|
1389
|
+
isActive
|
|
1390
|
+
]);
|
|
1391
|
+
return /* @__PURE__ */ import_react33.default.createElement("section", {
|
|
1392
|
+
...props,
|
|
1393
|
+
...!isActive && {
|
|
1394
|
+
"aria-hidden": true
|
|
1395
|
+
},
|
|
1396
|
+
className: (0, import_react_ui_theme20.mx)("min-is-0 flex-1 flex flex-col", isActive ? "order-2" : "order-4 invisible", classNames),
|
|
1397
|
+
ref
|
|
1398
|
+
}, children);
|
|
1399
|
+
});
|
|
1400
|
+
ViewportView.displayName = VIEW_NAME;
|
|
1401
|
+
var Viewport = {
|
|
1402
|
+
Root: ViewportRoot,
|
|
1403
|
+
Views: ViewportViews,
|
|
1404
|
+
View: ViewportView
|
|
1405
|
+
};
|
|
1406
|
+
var SpaceListItem = /* @__PURE__ */ (0, import_react34.forwardRef)(({ space, onClick }, ref) => {
|
|
1407
|
+
const fallbackValue = (0, import_util4.keyToEmoji)(space.key);
|
|
1408
|
+
const labelId = (0, import_react_ui16.useId)("identityListItem__label");
|
|
1409
|
+
const displayName = space.properties.name ?? (0, import_util4.humanize)(space.key.toHex());
|
|
1410
|
+
return /* @__PURE__ */ import_react34.default.createElement("li", {
|
|
1411
|
+
className: (0, import_react_ui_theme21.mx)("flex gap-2 items-center mbe-2", onClick && "cursor-pointer"),
|
|
1412
|
+
onClick: () => onClick?.(),
|
|
1413
|
+
ref,
|
|
1414
|
+
"data-testid": "space-list-item"
|
|
1415
|
+
}, /* @__PURE__ */ import_react34.default.createElement(import_react_ui16.Avatar.Root, {
|
|
1416
|
+
labelId
|
|
1417
|
+
}, /* @__PURE__ */ import_react34.default.createElement(import_react_ui16.Avatar.Frame, null, /* @__PURE__ */ import_react34.default.createElement(import_react_ui16.Avatar.Fallback, {
|
|
1418
|
+
text: fallbackValue
|
|
1419
|
+
})), /* @__PURE__ */ import_react34.default.createElement(import_react_ui16.Avatar.Label, {
|
|
1420
|
+
classNames: "text-sm truncate"
|
|
1421
|
+
}, displayName)));
|
|
1422
|
+
});
|
|
1423
|
+
var __dxlog_file = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts";
|
|
1424
|
+
var identityMachine = (0, import_xstate.createMachine)({
|
|
1425
|
+
id: "identity",
|
|
1426
|
+
predictableActionArguments: true,
|
|
1427
|
+
context: {
|
|
1428
|
+
identity: null,
|
|
1429
|
+
identitySubscribable: null
|
|
1430
|
+
},
|
|
1431
|
+
initial: "choosingAction",
|
|
1432
|
+
invoke: {
|
|
1433
|
+
src: (context) => context.identitySubscribable
|
|
1434
|
+
},
|
|
1435
|
+
states: {
|
|
1436
|
+
unknown: {
|
|
1437
|
+
always: [
|
|
1438
|
+
{
|
|
1439
|
+
cond: "initiallyManagingDeviceInvitation",
|
|
1440
|
+
target: "managingDeviceInvitation",
|
|
1441
|
+
actions: "log"
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
target: "choosingAction",
|
|
1445
|
+
actions: "log"
|
|
1446
|
+
}
|
|
1447
|
+
]
|
|
1448
|
+
},
|
|
1449
|
+
choosingAction: {},
|
|
1450
|
+
managingDeviceInvitation: {},
|
|
1451
|
+
confirmingResetStorage: {},
|
|
1452
|
+
confirmingRecover: {},
|
|
1453
|
+
confirmingJoinNewIdentity: {}
|
|
1454
|
+
},
|
|
1455
|
+
on: {
|
|
1456
|
+
unchooseAction: {
|
|
1457
|
+
target: ".choosingAction",
|
|
1458
|
+
actions: [
|
|
1459
|
+
"unsetInvitation",
|
|
1460
|
+
"log"
|
|
1461
|
+
]
|
|
1462
|
+
},
|
|
1463
|
+
deselectInvitation: {
|
|
1464
|
+
target: ".choosingAction",
|
|
1465
|
+
actions: [
|
|
1466
|
+
"unsetInvitation",
|
|
1467
|
+
"log"
|
|
1468
|
+
]
|
|
1469
|
+
},
|
|
1470
|
+
selectInvitation: {
|
|
1471
|
+
target: ".managingDeviceInvitation",
|
|
1472
|
+
actions: [
|
|
1473
|
+
"setInvitation",
|
|
1474
|
+
"log"
|
|
1475
|
+
]
|
|
1476
|
+
},
|
|
1477
|
+
chooseJoinNewIdentity: {
|
|
1478
|
+
target: ".confirmingJoinNewIdentity",
|
|
1479
|
+
actions: "log"
|
|
1480
|
+
},
|
|
1481
|
+
chooseRecoverIdentity: {
|
|
1482
|
+
target: ".confirmingRecover",
|
|
1483
|
+
actions: "log"
|
|
1484
|
+
},
|
|
1485
|
+
chooseResetStorage: {
|
|
1486
|
+
target: ".confirmingResetStorage",
|
|
1487
|
+
actions: "log"
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
}, {
|
|
1491
|
+
guards: {
|
|
1492
|
+
initiallyManagingDeviceInvitation: ({ initialDisposition }, _event) => initialDisposition === "manage-device-invitation"
|
|
1493
|
+
},
|
|
1494
|
+
actions: {
|
|
1495
|
+
setIdentity: (0, import_xstate.assign)({
|
|
1496
|
+
identity: (context, event) => event?.identity ?? null
|
|
1497
|
+
}),
|
|
1498
|
+
setInvitation: (0, import_xstate.assign)({
|
|
1499
|
+
invitation: (context, event) => event?.invitation ?? null
|
|
1500
|
+
}),
|
|
1501
|
+
unsetInvitation: (0, import_xstate.assign)({
|
|
1502
|
+
invitation: () => void 0
|
|
1503
|
+
}),
|
|
1504
|
+
log: (context, event) => {
|
|
1505
|
+
(0, import_log2.log)("[transition]", {
|
|
1506
|
+
event,
|
|
1507
|
+
context
|
|
1508
|
+
}, {
|
|
1509
|
+
F: __dxlog_file,
|
|
1510
|
+
L: 98,
|
|
1511
|
+
S: void 0,
|
|
1512
|
+
C: (f, a) => f(...a)
|
|
1513
|
+
});
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
});
|
|
1517
|
+
var useIdentityMachine = (client, options) => {
|
|
1518
|
+
return (0, import_react38.useMachine)(identityMachine, {
|
|
1519
|
+
...options,
|
|
1520
|
+
context: {
|
|
1521
|
+
...options?.context,
|
|
1522
|
+
identity: client.halo.identity.get(),
|
|
1523
|
+
identitySubscribable: client.halo.identity.map((identity) => ({
|
|
1524
|
+
type: "setIdentity",
|
|
1525
|
+
identity
|
|
1526
|
+
}))
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
};
|
|
1530
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx";
|
|
1531
|
+
var IdentityActionChooser = (props) => {
|
|
1532
|
+
const { send } = props;
|
|
1533
|
+
const client = (0, import_react_client3.useClient)();
|
|
1534
|
+
const invitations = (0, import_halo3.useHaloInvitations)();
|
|
1535
|
+
const createInvitation = () => {
|
|
1536
|
+
invitations.forEach((invitation2) => invitation2.cancel());
|
|
1537
|
+
const invitation = client.halo.share();
|
|
1538
|
+
if (client.config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
1539
|
+
const subscription = invitation.subscribe((invitation2) => {
|
|
1540
|
+
const invitationCode = import_invitations3.InvitationEncoder.encode(invitation2);
|
|
1541
|
+
if (invitation2.state === import_invitations3.Invitation.State.CONNECTING) {
|
|
1542
|
+
import_log3.log.info(JSON.stringify({
|
|
1543
|
+
invitationCode,
|
|
1544
|
+
authCode: invitation2.authCode
|
|
1545
|
+
}), void 0, {
|
|
1546
|
+
F: __dxlog_file2,
|
|
1547
|
+
L: 29,
|
|
1548
|
+
S: void 0,
|
|
1549
|
+
C: (f, a) => f(...a)
|
|
1550
|
+
});
|
|
1551
|
+
subscription.unsubscribe();
|
|
1552
|
+
}
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
send?.({
|
|
1556
|
+
type: "selectInvitation",
|
|
1557
|
+
invitation
|
|
1558
|
+
});
|
|
1559
|
+
};
|
|
1560
|
+
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1561
|
+
return /* @__PURE__ */ import_react39.default.createElement(IdentityActionChooserImpl, {
|
|
1562
|
+
...props,
|
|
1563
|
+
onClickAdd: createInvitation,
|
|
1564
|
+
onClickJoinExisting: () => send?.({
|
|
1565
|
+
type: "chooseJoinNewIdentity"
|
|
1566
|
+
}),
|
|
1567
|
+
onClickRecover: isProduction ? void 0 : () => send?.({
|
|
1568
|
+
type: "chooseRecoverIdentity"
|
|
1569
|
+
}),
|
|
1570
|
+
onClickReset: () => send?.({
|
|
1571
|
+
type: "chooseResetStorage"
|
|
1572
|
+
})
|
|
1573
|
+
});
|
|
1574
|
+
};
|
|
1575
|
+
var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
1576
|
+
const managedDeviceAvailable = devices.find((device) => device.profile?.type === import_halo3.DeviceType.AGENT_MANAGED);
|
|
1577
|
+
return /* @__PURE__ */ import_react39.default.createElement("div", {
|
|
1578
|
+
role: "none",
|
|
1579
|
+
className: "bs-40 grow overflow-y-auto overflow-x-hidden"
|
|
1580
|
+
}, /* @__PURE__ */ import_react39.default.createElement(DeviceList, {
|
|
1581
|
+
devices,
|
|
1582
|
+
connectionState,
|
|
1583
|
+
onClickAdd,
|
|
1584
|
+
onClickJoinExisting,
|
|
1585
|
+
onClickRecover,
|
|
1586
|
+
onClickReset,
|
|
1587
|
+
onAgentDestroy: agentProps.onAgentDestroy
|
|
1588
|
+
}), !managedDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ import_react39.default.createElement(AgentConfig, agentProps));
|
|
1589
|
+
};
|
|
1590
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1591
|
+
var useEdgeAgentHandlers = ({ identity }) => {
|
|
1592
|
+
const [validationMessage, setValidationMessage] = (0, import_react41.useState)("");
|
|
1593
|
+
const [lastReceivedStatus, setLastReceivedStatus] = (0, import_react41.useState)(import_services.QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1594
|
+
const [agentStatus, setAgentStatus] = (0, import_react41.useState)("getting");
|
|
1595
|
+
const client = (0, import_react_client5.useClient)();
|
|
1596
|
+
const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1597
|
+
const handleStatus = (status) => {
|
|
1598
|
+
switch (status) {
|
|
1599
|
+
case import_services.QueryAgentStatusResponse.AgentStatus.ACTIVE:
|
|
1600
|
+
case import_services.QueryAgentStatusResponse.AgentStatus.INACTIVE:
|
|
1601
|
+
setAgentStatus("created");
|
|
1602
|
+
break;
|
|
1603
|
+
case import_services.QueryAgentStatusResponse.AgentStatus.NOT_FOUND:
|
|
1604
|
+
setAgentStatus("creatable");
|
|
1605
|
+
break;
|
|
1606
|
+
case import_services.QueryAgentStatusResponse.AgentStatus.UNKNOWN:
|
|
1607
|
+
setAgentStatus("getting");
|
|
1608
|
+
break;
|
|
1609
|
+
}
|
|
1610
|
+
};
|
|
1611
|
+
(0, import_react41.useEffect)(() => {
|
|
1612
|
+
const stream = client.services.services.EdgeAgentService?.queryAgentStatus();
|
|
1613
|
+
stream?.subscribe(({ status }) => {
|
|
1614
|
+
setLastReceivedStatus(status);
|
|
1615
|
+
handleStatus(status);
|
|
1616
|
+
});
|
|
1617
|
+
return () => {
|
|
1618
|
+
void stream?.close().catch(() => {
|
|
1619
|
+
});
|
|
1620
|
+
};
|
|
1621
|
+
}, []);
|
|
1622
|
+
const onAgentCreate = async () => {
|
|
1623
|
+
(0, import_invariant2.invariant)(identity, "Identity not found", {
|
|
1624
|
+
F: __dxlog_file3,
|
|
1625
|
+
L: 56,
|
|
1626
|
+
S: void 0,
|
|
1627
|
+
A: [
|
|
1628
|
+
"identity",
|
|
1629
|
+
"'Identity not found'"
|
|
1630
|
+
]
|
|
1631
|
+
});
|
|
1632
|
+
const service = client.services.services.EdgeAgentService;
|
|
1633
|
+
if (!service) {
|
|
1634
|
+
setAgentStatus("error");
|
|
1635
|
+
setValidationMessage("Agent service not initialized.");
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
if (!agentHostingEnabled) {
|
|
1639
|
+
setAgentStatus("error");
|
|
1640
|
+
setValidationMessage("Edge agents are disabled in config.");
|
|
1641
|
+
return;
|
|
1642
|
+
}
|
|
1643
|
+
setAgentStatus("creating");
|
|
1644
|
+
setValidationMessage("");
|
|
1645
|
+
try {
|
|
1646
|
+
await service.createAgent();
|
|
1647
|
+
setAgentStatus("created");
|
|
1648
|
+
} catch (err) {
|
|
1649
|
+
setAgentStatus("error");
|
|
1650
|
+
setValidationMessage(`Error creating an agent: ${err.message}`);
|
|
1651
|
+
}
|
|
1652
|
+
};
|
|
1653
|
+
const onAgentDestroy = async () => {
|
|
1654
|
+
setValidationMessage("Agents are non-destructible.");
|
|
1655
|
+
};
|
|
1656
|
+
const onAgentRefresh = async () => {
|
|
1657
|
+
setValidationMessage("");
|
|
1658
|
+
handleStatus(lastReceivedStatus);
|
|
1659
|
+
};
|
|
1660
|
+
return {
|
|
1661
|
+
onAgentCreate,
|
|
1662
|
+
onAgentDestroy,
|
|
1663
|
+
onAgentRefresh,
|
|
1664
|
+
validationMessage,
|
|
1665
|
+
agentStatus,
|
|
1666
|
+
agentHostingEnabled
|
|
1667
|
+
};
|
|
1668
|
+
};
|
|
1669
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
1670
|
+
var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
1671
|
+
const [validationMessage, setValidationMessage] = (0, import_react42.useState)("");
|
|
1672
|
+
const [agentStatus, setAgentStatus] = (0, import_react42.useState)("getting");
|
|
1673
|
+
const agentHostingProviderClient = (0, import_react_client6.useAgentHostingClient)();
|
|
1674
|
+
const client = (0, import_react_client6.useClient)();
|
|
1675
|
+
const updateAgentStatus = async () => {
|
|
1676
|
+
if (agentHostingProviderClient) {
|
|
1677
|
+
setAgentStatus("getting");
|
|
1678
|
+
try {
|
|
1679
|
+
const agentId = await agentHostingProviderClient?.getAgent(identity?.identityKey.truncate() ?? "never");
|
|
1680
|
+
if (agentId) {
|
|
1681
|
+
setAgentStatus("created");
|
|
1682
|
+
} else {
|
|
1683
|
+
setAgentStatus("creatable");
|
|
1684
|
+
}
|
|
1685
|
+
} catch (err) {
|
|
1686
|
+
setAgentStatus("error");
|
|
1687
|
+
setValidationMessage(`Couldn\u2019t check agent status: ${err.message}`);
|
|
1688
|
+
}
|
|
1689
|
+
} else {
|
|
1690
|
+
setAgentStatus("error");
|
|
1691
|
+
setValidationMessage("No agent provider configured.");
|
|
1692
|
+
}
|
|
1693
|
+
};
|
|
1694
|
+
const createAgent = async (invitationCode) => {
|
|
1695
|
+
(0, import_invariant3.invariant)(identity, "Identity not found", {
|
|
1696
|
+
F: __dxlog_file4,
|
|
1697
|
+
L: 50,
|
|
1698
|
+
S: void 0,
|
|
1699
|
+
A: [
|
|
1700
|
+
"identity",
|
|
1701
|
+
"'Identity not found'"
|
|
1702
|
+
]
|
|
1703
|
+
});
|
|
1704
|
+
if (agentHostingProviderClient) {
|
|
1705
|
+
setAgentStatus("creating");
|
|
1706
|
+
setValidationMessage("");
|
|
1707
|
+
try {
|
|
1708
|
+
const agentId = await agentHostingProviderClient?.createAgent(invitationCode, identity.identityKey.truncate());
|
|
1709
|
+
if (agentId) {
|
|
1710
|
+
setAgentStatus("created");
|
|
1711
|
+
} else {
|
|
1712
|
+
setAgentStatus("creatable");
|
|
1713
|
+
setValidationMessage("Error creating agent.");
|
|
1714
|
+
}
|
|
1715
|
+
} catch (err) {
|
|
1716
|
+
setValidationMessage(`Error creating agent: ${err.message}`);
|
|
1717
|
+
return updateAgentStatus();
|
|
1718
|
+
}
|
|
1719
|
+
} else {
|
|
1720
|
+
setAgentStatus("error");
|
|
1721
|
+
setValidationMessage("No agent provider configured.");
|
|
1722
|
+
}
|
|
1723
|
+
};
|
|
1724
|
+
const destroyAgent = async () => {
|
|
1725
|
+
(0, import_invariant3.invariant)(identity, "Identity not found", {
|
|
1726
|
+
F: __dxlog_file4,
|
|
1727
|
+
L: 73,
|
|
1728
|
+
S: void 0,
|
|
1729
|
+
A: [
|
|
1730
|
+
"identity",
|
|
1731
|
+
"'Identity not found'"
|
|
1732
|
+
]
|
|
1733
|
+
});
|
|
1734
|
+
if (agentHostingProviderClient) {
|
|
1735
|
+
setAgentStatus("destroying");
|
|
1736
|
+
setValidationMessage("");
|
|
1737
|
+
try {
|
|
1738
|
+
await agentHostingProviderClient?.destroyAgent(identity.identityKey.truncate());
|
|
1739
|
+
setAgentStatus("creatable");
|
|
1740
|
+
} catch (err) {
|
|
1741
|
+
setValidationMessage(`Error destroying agent: ${err.message}`);
|
|
1742
|
+
return updateAgentStatus();
|
|
1743
|
+
}
|
|
1744
|
+
} else {
|
|
1745
|
+
setAgentStatus("error");
|
|
1746
|
+
setValidationMessage("No agent provider configured.");
|
|
1747
|
+
}
|
|
1748
|
+
};
|
|
1749
|
+
(0, import_react42.useEffect)(() => {
|
|
1750
|
+
void updateAgentStatus();
|
|
1751
|
+
}, []);
|
|
1752
|
+
const handleAgentCreate = (0, import_react42.useCallback)(async (invitation) => {
|
|
1753
|
+
const invitationCode = import_invitations4.InvitationEncoder.encode(invitation);
|
|
1754
|
+
if (invitation.state === import_invitations4.Invitation.State.CONNECTING) {
|
|
1755
|
+
import_log5.log.info(JSON.stringify({
|
|
1756
|
+
invitationCode,
|
|
1757
|
+
authCode: invitation.authCode
|
|
1758
|
+
}), void 0, {
|
|
1759
|
+
F: __dxlog_file4,
|
|
1760
|
+
L: 97,
|
|
1761
|
+
S: void 0,
|
|
1762
|
+
C: (f, a) => f(...a)
|
|
1763
|
+
});
|
|
1764
|
+
return createAgent(invitationCode);
|
|
1765
|
+
}
|
|
1766
|
+
}, []);
|
|
1767
|
+
const onAgentCreate = async () => {
|
|
1768
|
+
invitations.forEach((invitation2) => invitation2.cancel());
|
|
1769
|
+
const invitation = client.halo.share({
|
|
1770
|
+
type: import_invitations4.Invitation.Type.INTERACTIVE,
|
|
1771
|
+
authMethod: import_invitations4.Invitation.AuthMethod.NONE,
|
|
1772
|
+
multiUse: true
|
|
1773
|
+
});
|
|
1774
|
+
invitation.subscribe(handleAgentCreate);
|
|
1775
|
+
};
|
|
1776
|
+
const onAgentRefresh = async () => {
|
|
1777
|
+
setValidationMessage("");
|
|
1778
|
+
await updateAgentStatus();
|
|
1779
|
+
};
|
|
1780
|
+
return {
|
|
1781
|
+
onAgentCreate,
|
|
1782
|
+
onAgentDestroy: destroyAgent,
|
|
1783
|
+
onAgentRefresh,
|
|
1784
|
+
validationMessage,
|
|
1785
|
+
agentStatus,
|
|
1786
|
+
agentHostingEnabled: !!agentHostingProviderClient
|
|
1787
|
+
};
|
|
1788
|
+
};
|
|
1789
|
+
var useAgentHandlers = (params) => {
|
|
1790
|
+
const client = (0, import_react_client4.useClient)();
|
|
1791
|
+
if (client.config.values?.runtime?.client?.edgeFeatures?.agents) {
|
|
1792
|
+
return useEdgeAgentHandlers(params);
|
|
1793
|
+
} else {
|
|
1794
|
+
return useKubeAgentHandlers(params);
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
1798
|
+
[
|
|
1799
|
+
import_invitations5.Invitation.State.ERROR,
|
|
1800
|
+
-3
|
|
1801
|
+
],
|
|
1802
|
+
[
|
|
1803
|
+
import_invitations5.Invitation.State.TIMEOUT,
|
|
1804
|
+
-2
|
|
1805
|
+
],
|
|
1806
|
+
[
|
|
1807
|
+
import_invitations5.Invitation.State.CANCELLED,
|
|
1808
|
+
-1
|
|
1809
|
+
],
|
|
1810
|
+
[
|
|
1811
|
+
import_invitations5.Invitation.State.INIT,
|
|
1812
|
+
0
|
|
1813
|
+
],
|
|
1814
|
+
[
|
|
1815
|
+
import_invitations5.Invitation.State.CONNECTING,
|
|
1816
|
+
1
|
|
1817
|
+
],
|
|
1818
|
+
[
|
|
1819
|
+
import_invitations5.Invitation.State.CONNECTED,
|
|
1820
|
+
2
|
|
1821
|
+
],
|
|
1822
|
+
[
|
|
1823
|
+
import_invitations5.Invitation.State.READY_FOR_AUTHENTICATION,
|
|
1824
|
+
3
|
|
1825
|
+
],
|
|
1826
|
+
[
|
|
1827
|
+
import_invitations5.Invitation.State.AUTHENTICATING,
|
|
1828
|
+
4
|
|
1829
|
+
],
|
|
1830
|
+
[
|
|
1831
|
+
import_invitations5.Invitation.State.SUCCESS,
|
|
1832
|
+
5
|
|
1833
|
+
]
|
|
1834
|
+
]);
|
|
1835
|
+
var InvitationManagerView = ({ children, ...props }) => {
|
|
1836
|
+
return /* @__PURE__ */ import_react44.default.createElement(Viewport.View, {
|
|
1837
|
+
...props,
|
|
1838
|
+
classNames: "grow flex flex-col justify-around items-center"
|
|
1839
|
+
}, children);
|
|
1840
|
+
};
|
|
1841
|
+
var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCode, id = "0" }) => {
|
|
1842
|
+
const { t } = (0, import_react_ui20.useTranslation)("os");
|
|
1843
|
+
const qrLabel = (0, import_react_ui20.useId)("invitation-manager__qr-code");
|
|
1844
|
+
const statusValue = multiUse ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1845
|
+
const showAuthCode = statusValue === 3;
|
|
1846
|
+
const emoji = (0, import_util7.hexToEmoji)(id);
|
|
1847
|
+
const activeView = (0, import_react44.useMemo)(() => {
|
|
1848
|
+
if (multiUse) {
|
|
1849
|
+
return "showing qr";
|
|
1850
|
+
}
|
|
1851
|
+
switch (true) {
|
|
1852
|
+
case statusValue === 5:
|
|
1853
|
+
case statusValue < 0:
|
|
1854
|
+
return "showing final";
|
|
1855
|
+
case statusValue === 3:
|
|
1856
|
+
return "showing auth code";
|
|
1857
|
+
default:
|
|
1858
|
+
return "showing qr";
|
|
1859
|
+
}
|
|
1860
|
+
}, [
|
|
1861
|
+
statusValue
|
|
1862
|
+
]);
|
|
1863
|
+
return /* @__PURE__ */ import_react44.default.createElement(import_react44.default.Fragment, null, /* @__PURE__ */ import_react44.default.createElement(Viewport.Root, {
|
|
1864
|
+
activeView,
|
|
1865
|
+
classNames: "grow plb-1"
|
|
1866
|
+
}, /* @__PURE__ */ import_react44.default.createElement(Viewport.Views, null, /* @__PURE__ */ import_react44.default.createElement(InvitationManagerView, {
|
|
1867
|
+
id: "showing qr",
|
|
1868
|
+
emoji
|
|
1869
|
+
}, /* @__PURE__ */ import_react44.default.createElement("p", {
|
|
1870
|
+
className: "text-sm mlb-1 font-normal text-center"
|
|
1871
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ import_react44.default.createElement("div", {
|
|
1872
|
+
role: "none",
|
|
1873
|
+
className: (0, import_react_ui_theme23.mx)(import_react_ui_theme23.descriptionText, "is-full max-is-[14rem] relative")
|
|
1874
|
+
}, /* @__PURE__ */ import_react44.default.createElement(import_react_qr_rounded.QR, {
|
|
1875
|
+
rounding: 100,
|
|
1876
|
+
backgroundColor: "transparent",
|
|
1877
|
+
color: "currentColor",
|
|
1878
|
+
className: (0, import_react_ui_theme23.mx)("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1879
|
+
"aria-labelledby": qrLabel,
|
|
1880
|
+
errorCorrectionLevel: "Q",
|
|
1881
|
+
cutout: true
|
|
1882
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ import_react44.default.createElement(Centered, null, /* @__PURE__ */ import_react44.default.createElement(Emoji, {
|
|
1883
|
+
text: emoji
|
|
1884
|
+
}))), /* @__PURE__ */ import_react44.default.createElement("span", {
|
|
1885
|
+
id: qrLabel,
|
|
1886
|
+
className: "sr-only"
|
|
1887
|
+
}, t("qr label")), /* @__PURE__ */ import_react44.default.createElement(CopyButton, {
|
|
1888
|
+
variant: "ghost",
|
|
1889
|
+
value: invitationUrl ?? "never"
|
|
1890
|
+
})), /* @__PURE__ */ import_react44.default.createElement(InvitationManagerView, {
|
|
1891
|
+
id: "showing auth code"
|
|
1892
|
+
}, /* @__PURE__ */ import_react44.default.createElement(Label, null, t("auth code message")), /* @__PURE__ */ import_react44.default.createElement(AuthCode, {
|
|
1893
|
+
code: authCode,
|
|
1894
|
+
large: true,
|
|
1895
|
+
classNames: "text-black dark:text-white"
|
|
1896
|
+
}), /* @__PURE__ */ import_react44.default.createElement(Label, null, t("auth other device emoji message")), emoji && /* @__PURE__ */ import_react44.default.createElement(Emoji, {
|
|
1897
|
+
text: emoji
|
|
1898
|
+
})), /* @__PURE__ */ import_react44.default.createElement(InvitationManagerView, {
|
|
1899
|
+
id: "showing final"
|
|
1900
|
+
}, statusValue > 0 ? /* @__PURE__ */ import_react44.default.createElement(import_react43.Check, {
|
|
1901
|
+
className: (0, import_react_ui_theme23.mx)("m-1.5", (0, import_react_ui_theme23.getSize)(6))
|
|
1902
|
+
}) : /* @__PURE__ */ import_react44.default.createElement(import_react43.X, {
|
|
1903
|
+
className: (0, import_react_ui_theme23.mx)("m-1.5", (0, import_react_ui_theme23.getSize)(6))
|
|
1904
|
+
})))), /* @__PURE__ */ import_react44.default.createElement(Actions, {
|
|
1905
|
+
classNames: "mbs-4"
|
|
1906
|
+
}, /* @__PURE__ */ import_react44.default.createElement(Action, {
|
|
1907
|
+
disabled: !active,
|
|
1908
|
+
onClick: () => send?.({
|
|
1909
|
+
type: "deselectInvitation"
|
|
1910
|
+
})
|
|
1911
|
+
}, t("back label"))));
|
|
1912
|
+
};
|
|
1913
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1914
|
+
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1915
|
+
const { t } = (0, import_react_ui21.useTranslation)("os");
|
|
1916
|
+
const [validationMessage, setValidationMessage] = (0, import_react46.useState)("");
|
|
1917
|
+
const [pending, setPending] = (0, import_react46.useState)(false);
|
|
1918
|
+
const processReset = async () => {
|
|
1919
|
+
setPending(true);
|
|
1920
|
+
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
1921
|
+
import_log6.log.catch(error, void 0, {
|
|
1922
|
+
F: __dxlog_file5,
|
|
1923
|
+
L: 38,
|
|
1924
|
+
S: void 0,
|
|
1925
|
+
C: (f, a) => f(...a)
|
|
1926
|
+
});
|
|
1927
|
+
setValidationMessage(t("failed to reset identity message"));
|
|
1928
|
+
setPending(false);
|
|
1929
|
+
});
|
|
1930
|
+
};
|
|
1931
|
+
return /* @__PURE__ */ import_react46.default.createElement(ConfirmResetImpl, {
|
|
1932
|
+
disabled: !active,
|
|
1933
|
+
pending,
|
|
1934
|
+
validationMessage,
|
|
1935
|
+
onConfirm: processReset,
|
|
1936
|
+
onCancel,
|
|
1937
|
+
mode
|
|
1938
|
+
});
|
|
1939
|
+
};
|
|
1940
|
+
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1941
|
+
const { t } = (0, import_react_ui21.useTranslation)("os");
|
|
1942
|
+
const confirmationValue = t("confirmation value");
|
|
1943
|
+
const [inputValue, setInputValue] = (0, import_react46.useState)("");
|
|
1944
|
+
const testIdAffix = mode === "join new identity" ? "join-new-identity" : mode === "recover" ? "recover" : "reset-storage";
|
|
1945
|
+
return /* @__PURE__ */ import_react46.default.createElement(import_react46.default.Fragment, null, /* @__PURE__ */ import_react46.default.createElement("div", {
|
|
1946
|
+
role: "none",
|
|
1947
|
+
className: "grow flex flex-col gap-2 justify-center"
|
|
1948
|
+
}, /* @__PURE__ */ import_react46.default.createElement(import_react_ui21.Message.Root, {
|
|
1949
|
+
valence: "error"
|
|
1950
|
+
}, /* @__PURE__ */ import_react46.default.createElement(import_react_ui21.Message.Title, null, /* @__PURE__ */ import_react46.default.createElement(import_react45.Warning, {
|
|
1951
|
+
className: (0, import_react_ui_theme24.mx)((0, import_react_ui_theme24.getSize)(6), "inline mie-2")
|
|
1952
|
+
}), t("sign out chooser title")), /* @__PURE__ */ import_react46.default.createElement(import_react_ui21.Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ import_react46.default.createElement(Input, {
|
|
1953
|
+
validationMessage,
|
|
1954
|
+
label: /* @__PURE__ */ import_react46.default.createElement(StepHeading, {
|
|
1955
|
+
className: "text-start mlb-2"
|
|
1956
|
+
}, t(mode === "join new identity" ? "join new identity input label" : mode === "recover" ? "recover reset input label" : "reset storage input label", {
|
|
1957
|
+
confirmationValue
|
|
1958
|
+
})),
|
|
1959
|
+
disabled,
|
|
1960
|
+
"data-testid": `${testIdAffix}.reset-identity-input`,
|
|
1961
|
+
placeholder: t("confirmation placeholder", {
|
|
1962
|
+
confirmationValue
|
|
1963
|
+
}),
|
|
1964
|
+
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1965
|
+
})), /* @__PURE__ */ import_react46.default.createElement(Actions, null, onCancel && /* @__PURE__ */ import_react46.default.createElement(Action, {
|
|
1966
|
+
disabled,
|
|
1967
|
+
onClick: onCancel,
|
|
1968
|
+
"data-testid": `${testIdAffix}.reset-identity-cancel`
|
|
1969
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ import_react46.default.createElement(Action, {
|
|
1970
|
+
variant: "destructive",
|
|
1971
|
+
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1972
|
+
onClick: onConfirm,
|
|
1973
|
+
"data-testid": `${testIdAffix}.reset-identity-confirm`
|
|
1974
|
+
}, pending ? t("reset in progress label") : t("reset device label"))));
|
|
1975
|
+
};
|
|
1976
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx";
|
|
1977
|
+
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1978
|
+
var getHueValue = (identity) => identity?.profile?.data?.hue || (0, import_util5.hexToHue)(identity?.identityKey.toHex() ?? "0");
|
|
1979
|
+
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || (0, import_util5.hexToEmoji)(identity?.identityKey.toHex() ?? "0");
|
|
1980
|
+
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1981
|
+
const client = (0, import_react_client2.useClient)();
|
|
1982
|
+
const fallbackValue = (0, import_util5.keyToFallback)(identity.identityKey);
|
|
1983
|
+
const { t } = (0, import_react_ui18.useTranslation)("os");
|
|
1984
|
+
const [displayName, setDisplayName] = (0, import_react37.useState)(identity.profile?.displayName ?? "");
|
|
1985
|
+
const [emoji, setEmojiDirectly] = (0, import_react37.useState)(getEmojiValue(identity));
|
|
1986
|
+
const [hue, setHueDirectly] = (0, import_react37.useState)(getHueValue(identity));
|
|
1987
|
+
const { textValue, setTextValue } = useClipboardContext();
|
|
1988
|
+
const identityHex = identity.identityKey.toHex();
|
|
1989
|
+
const publicKeyCopied = textValue === identityHex;
|
|
1990
|
+
const setEmoji = (nextEmoji) => {
|
|
1991
|
+
setEmojiDirectly(nextEmoji);
|
|
1992
|
+
void onUpdateProfile?.({
|
|
1993
|
+
...identity.profile,
|
|
1994
|
+
data: {
|
|
1995
|
+
...identity.profile?.data,
|
|
1996
|
+
emoji: nextEmoji
|
|
1997
|
+
}
|
|
1998
|
+
});
|
|
1999
|
+
};
|
|
2000
|
+
const setHue = (nextHue) => {
|
|
2001
|
+
setHueDirectly(nextHue);
|
|
2002
|
+
void onUpdateProfile?.({
|
|
2003
|
+
...identity.profile,
|
|
2004
|
+
data: {
|
|
2005
|
+
...identity.profile?.data,
|
|
2006
|
+
hue: nextHue
|
|
2007
|
+
}
|
|
2008
|
+
});
|
|
2009
|
+
};
|
|
2010
|
+
const handleRecoveryCode = async () => {
|
|
2011
|
+
(0, import_invariant.invariant)(client.services.services.IdentityService, "IdentityService not available", {
|
|
2012
|
+
F: __dxlog_file6,
|
|
2013
|
+
L: 76,
|
|
2014
|
+
S: void 0,
|
|
2015
|
+
A: [
|
|
2016
|
+
"client.services.services.IdentityService",
|
|
2017
|
+
"'IdentityService not available'"
|
|
2018
|
+
]
|
|
2019
|
+
});
|
|
2020
|
+
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
2021
|
+
void setTextValue(seedphrase);
|
|
2022
|
+
};
|
|
2023
|
+
const isConnected = connectionState === import_mesh2.ConnectionState.ONLINE;
|
|
2024
|
+
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
2025
|
+
return /* @__PURE__ */ import_react37.default.createElement(Heading, {
|
|
2026
|
+
titleId,
|
|
2027
|
+
title,
|
|
2028
|
+
corner: /* @__PURE__ */ import_react37.default.createElement(CloseButton, {
|
|
2029
|
+
onDone
|
|
2030
|
+
})
|
|
2031
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Avatar.Root, {
|
|
2032
|
+
size: 16,
|
|
2033
|
+
variant: "circle",
|
|
2034
|
+
status: isConnected ? "active" : "error",
|
|
2035
|
+
hue: hue || fallbackValue.hue
|
|
2036
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Toolbar.Root, {
|
|
2037
|
+
classNames: "flex justify-center"
|
|
2038
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Avatar.Frame, {
|
|
2039
|
+
classNames: "relative z-[2] -mli-4 chromatic-ignore"
|
|
2040
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Avatar.Fallback, {
|
|
2041
|
+
text: emoji || fallbackValue.emoji
|
|
2042
|
+
}))), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Avatar.Label, {
|
|
2043
|
+
classNames: "sr-only",
|
|
2044
|
+
"data-testid": "identityHeading.displayName"
|
|
2045
|
+
}, identity.profile?.displayName ?? (0, import_display_name3.generateName)(identity.identityKey.toHex())), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Input.Root, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Input.Label, {
|
|
2046
|
+
srOnly: true
|
|
2047
|
+
}, t("display name input label")), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Input.TextInput, {
|
|
2048
|
+
variant: "subdued",
|
|
2049
|
+
"data-testid": "display-name-input",
|
|
2050
|
+
placeholder: t("display name input placeholder"),
|
|
2051
|
+
classNames: "mbs-2 text-center font-light text-xl",
|
|
2052
|
+
value: displayName,
|
|
2053
|
+
onChange: ({ target: { value } }) => setDisplayName(value),
|
|
2054
|
+
onBlur: ({ target: { value } }) => onUpdateProfile?.({
|
|
2055
|
+
...identity.profile,
|
|
2056
|
+
displayName: value
|
|
2057
|
+
})
|
|
2058
|
+
})), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Toolbar.Root, {
|
|
2059
|
+
classNames: "flex justify-center items-center gap-1 pt-3"
|
|
2060
|
+
}, /* @__PURE__ */ import_react37.default.createElement(EmojiPickerToolbarButton, {
|
|
2061
|
+
emoji,
|
|
2062
|
+
onChangeEmoji: setEmoji,
|
|
2063
|
+
classNames: "bs-[--rail-action]"
|
|
2064
|
+
}), /* @__PURE__ */ import_react37.default.createElement(HuePickerToolbarButton, {
|
|
2065
|
+
hue,
|
|
2066
|
+
onChangeHue: setHue,
|
|
2067
|
+
classNames: "bs-[--rail-action]"
|
|
2068
|
+
}), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Trigger, {
|
|
2069
|
+
asChild: true
|
|
2070
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Toolbar.Button, {
|
|
2071
|
+
classNames: "bs-[--rail-action]",
|
|
2072
|
+
"data-testid": "update-profile-form-copy-key",
|
|
2073
|
+
onClick: () => setTextValue(identityHex)
|
|
2074
|
+
}, /* @__PURE__ */ import_react37.default.createElement("span", {
|
|
2075
|
+
className: "sr-only"
|
|
2076
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ import_react37.default.createElement(import_react36.Key, {
|
|
2077
|
+
className: (0, import_react_ui_theme22.getSize)(5)
|
|
2078
|
+
}))), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Portal, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Content, {
|
|
2079
|
+
side: "bottom",
|
|
2080
|
+
classNames: "z-50"
|
|
2081
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Arrow, null)))), !isProduction && /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Trigger, {
|
|
2082
|
+
asChild: true
|
|
2083
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Toolbar.Button, {
|
|
2084
|
+
classNames: "bs-[--rail-action]",
|
|
2085
|
+
onClick: handleRecoveryCode
|
|
2086
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react36.FirstAidKit, {
|
|
2087
|
+
className: (0, import_react_ui_theme22.getSize)(5)
|
|
2088
|
+
}))), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Portal, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Content, {
|
|
2089
|
+
side: "bottom",
|
|
2090
|
+
classNames: "z-50"
|
|
2091
|
+
}, t("create recovery code label"), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Arrow, null)))), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Root, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Trigger, {
|
|
2092
|
+
asChild: true
|
|
2093
|
+
}, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Toolbar.Button, {
|
|
2094
|
+
classNames: [
|
|
2095
|
+
"bs-[--rail-action]",
|
|
2096
|
+
!isConnected && "text-error-500"
|
|
2097
|
+
],
|
|
2098
|
+
onClick: () => onChangeConnectionState?.(isConnected ? import_mesh2.ConnectionState.OFFLINE : import_mesh2.ConnectionState.ONLINE)
|
|
2099
|
+
}, /* @__PURE__ */ import_react37.default.createElement("span", {
|
|
2100
|
+
className: "sr-only"
|
|
2101
|
+
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */ import_react37.default.createElement(import_react36.PlugsConnected, {
|
|
2102
|
+
className: (0, import_react_ui_theme22.getSize)(5)
|
|
2103
|
+
}) : /* @__PURE__ */ import_react37.default.createElement(import_react36.Plugs, {
|
|
2104
|
+
className: (0, import_react_ui_theme22.getSize)(5)
|
|
2105
|
+
}))), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Portal, null, /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Content, {
|
|
2106
|
+
side: "bottom",
|
|
2107
|
+
classNames: "z-50"
|
|
2108
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ import_react37.default.createElement(import_react_ui18.Tooltip.Arrow, null)))))));
|
|
2109
|
+
};
|
|
2110
|
+
var IdentityPanelImpl = (props) => {
|
|
2111
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
2112
|
+
const { t } = (0, import_react_ui18.useTranslation)("os");
|
|
2113
|
+
const title = (0, import_react37.useMemo)(() => {
|
|
2114
|
+
switch (activeView) {
|
|
2115
|
+
case "device invitation manager":
|
|
2116
|
+
return t("choose add device label");
|
|
2117
|
+
default:
|
|
2118
|
+
return t("identity heading");
|
|
2119
|
+
}
|
|
2120
|
+
}, [
|
|
2121
|
+
activeView,
|
|
2122
|
+
t
|
|
2123
|
+
]);
|
|
2124
|
+
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
2125
|
+
return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, /* @__PURE__ */ import_react37.default.createElement(IdentityHeading, {
|
|
2126
|
+
identity,
|
|
2127
|
+
titleId,
|
|
2128
|
+
title,
|
|
2129
|
+
onDone,
|
|
2130
|
+
onUpdateProfile,
|
|
2131
|
+
connectionState,
|
|
2132
|
+
onChangeConnectionState
|
|
2133
|
+
}), /* @__PURE__ */ import_react37.default.createElement(Viewport.Root, {
|
|
2134
|
+
activeView
|
|
2135
|
+
}, /* @__PURE__ */ import_react37.default.createElement(Viewport.Views, null, /* @__PURE__ */ import_react37.default.createElement(Viewport.View, {
|
|
2136
|
+
id: "identity action chooser",
|
|
2137
|
+
classNames: viewStyles
|
|
2138
|
+
}, /* @__PURE__ */ import_react37.default.createElement(IdentityActionChooserComponent, {
|
|
2139
|
+
active: activeView === "identity action chooser",
|
|
2140
|
+
...rest,
|
|
2141
|
+
connectionState
|
|
2142
|
+
})), /* @__PURE__ */ import_react37.default.createElement(Viewport.View, {
|
|
2143
|
+
id: "device invitation manager",
|
|
2144
|
+
classNames: viewStyles
|
|
2145
|
+
}, /* @__PURE__ */ import_react37.default.createElement(InvitationManagerComponent, {
|
|
2146
|
+
active: activeView === "device invitation manager",
|
|
2147
|
+
...rest,
|
|
2148
|
+
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
2149
|
+
})), /* @__PURE__ */ import_react37.default.createElement(Viewport.View, {
|
|
2150
|
+
classNames: viewStyles,
|
|
2151
|
+
id: "confirm join new identity"
|
|
2152
|
+
}, /* @__PURE__ */ import_react37.default.createElement(ConfirmReset, {
|
|
2153
|
+
active: activeView === "confirm join new identity",
|
|
2154
|
+
...rest,
|
|
2155
|
+
mode: "join new identity",
|
|
2156
|
+
onConfirm: onJoinNewIdentity,
|
|
2157
|
+
onCancel: onCancelReset
|
|
2158
|
+
})), /* @__PURE__ */ import_react37.default.createElement(Viewport.View, {
|
|
2159
|
+
classNames: viewStyles,
|
|
2160
|
+
id: "confirm recover"
|
|
2161
|
+
}, /* @__PURE__ */ import_react37.default.createElement(ConfirmReset, {
|
|
2162
|
+
active: activeView === "confirm recover",
|
|
2163
|
+
...rest,
|
|
2164
|
+
mode: "recover",
|
|
2165
|
+
onConfirm: onRecover,
|
|
2166
|
+
onCancel: onCancelReset
|
|
2167
|
+
})), /* @__PURE__ */ import_react37.default.createElement(Viewport.View, {
|
|
2168
|
+
classNames: viewStyles,
|
|
2169
|
+
id: "confirm reset storage"
|
|
2170
|
+
}, /* @__PURE__ */ import_react37.default.createElement(ConfirmReset, {
|
|
2171
|
+
active: activeView === "confirm reset storage",
|
|
2172
|
+
...rest,
|
|
2173
|
+
mode: "reset storage",
|
|
2174
|
+
onConfirm: onResetStorage,
|
|
2175
|
+
onCancel: onCancelReset
|
|
2176
|
+
})))));
|
|
2177
|
+
};
|
|
2178
|
+
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
2179
|
+
const invitationStatus = (0, import_invitations2.useInvitationStatus)(invitation);
|
|
2180
|
+
return /* @__PURE__ */ import_react37.default.createElement(IdentityPanelImpl, {
|
|
2181
|
+
...props,
|
|
2182
|
+
...invitationStatus
|
|
2183
|
+
});
|
|
2184
|
+
};
|
|
2185
|
+
var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, initialDisposition = "default", ...props }) => {
|
|
2186
|
+
const titleId = (0, import_react_ui18.useId)("identityPanel__heading", propsTitleId);
|
|
2187
|
+
const client = (0, import_react_client2.useClient)();
|
|
2188
|
+
const devices = (0, import_halo2.useDevices)();
|
|
2189
|
+
const identity = (0, import_halo2.useIdentity)();
|
|
2190
|
+
const invitations = (0, import_halo2.useHaloInvitations)();
|
|
2191
|
+
const agentProps = useAgentHandlers({
|
|
2192
|
+
identity,
|
|
2193
|
+
invitations
|
|
2194
|
+
});
|
|
2195
|
+
if (!identity) {
|
|
2196
|
+
import_log.log.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
2197
|
+
F: __dxlog_file6,
|
|
2198
|
+
L: 278,
|
|
2199
|
+
S: void 0,
|
|
2200
|
+
C: (f, a) => f(...a)
|
|
2201
|
+
});
|
|
2202
|
+
return null;
|
|
2203
|
+
}
|
|
2204
|
+
const [identityState, identitySend, identityService] = useIdentityMachine(client, {
|
|
2205
|
+
context: {
|
|
2206
|
+
initialDisposition
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2209
|
+
const { swarm: connectionState } = (0, import_mesh2.useNetworkStatus)();
|
|
2210
|
+
const handleChangeConnectionState = async (nextState) => client?.mesh.updateConfig(nextState);
|
|
2211
|
+
(0, import_react37.useEffect)(() => {
|
|
2212
|
+
const subscription = identityService.subscribe((state) => {
|
|
2213
|
+
(0, import_log.log)("[state]", state, {
|
|
2214
|
+
F: __dxlog_file6,
|
|
2215
|
+
L: 291,
|
|
2216
|
+
S: void 0,
|
|
2217
|
+
C: (f, a) => f(...a)
|
|
2218
|
+
});
|
|
2219
|
+
});
|
|
2220
|
+
return subscription.unsubscribe;
|
|
2221
|
+
}, [
|
|
2222
|
+
identityService
|
|
2223
|
+
]);
|
|
2224
|
+
const activeView = (0, import_react37.useMemo)(() => {
|
|
2225
|
+
switch (true) {
|
|
2226
|
+
case identityState.matches("choosingAction"):
|
|
2227
|
+
return "identity action chooser";
|
|
2228
|
+
case identityState.matches("managingDeviceInvitation"):
|
|
2229
|
+
return "device invitation manager";
|
|
2230
|
+
case identityState.matches("confirmingResetStorage"):
|
|
2231
|
+
return "confirm reset storage";
|
|
2232
|
+
case identityState.matches("confirmingRecover"):
|
|
2233
|
+
return "confirm recover";
|
|
2234
|
+
case identityState.matches("confirmingJoinNewIdentity"):
|
|
2235
|
+
return "confirm join new identity";
|
|
2236
|
+
default:
|
|
2237
|
+
return "identity action chooser";
|
|
2238
|
+
}
|
|
2239
|
+
}, [
|
|
2240
|
+
identityState
|
|
2241
|
+
]);
|
|
2242
|
+
const onUpdateProfile = async (profile) => {
|
|
2243
|
+
identitySend({
|
|
2244
|
+
type: "updateProfile"
|
|
2245
|
+
});
|
|
2246
|
+
await client.halo.updateProfile(profile);
|
|
2247
|
+
};
|
|
2248
|
+
const implProps = {
|
|
2249
|
+
...props,
|
|
2250
|
+
identity,
|
|
2251
|
+
devices,
|
|
2252
|
+
activeView,
|
|
2253
|
+
send: identitySend,
|
|
2254
|
+
titleId,
|
|
2255
|
+
createInvitationUrl,
|
|
2256
|
+
onUpdateProfile,
|
|
2257
|
+
connectionState,
|
|
2258
|
+
onChangeConnectionState: handleChangeConnectionState,
|
|
2259
|
+
...agentProps
|
|
2260
|
+
};
|
|
2261
|
+
return identityState.context.invitation ? /* @__PURE__ */ import_react37.default.createElement(IdentityPanelWithInvitationImpl, {
|
|
2262
|
+
...implProps,
|
|
2263
|
+
invitation: identityState.context.invitation
|
|
2264
|
+
}) : /* @__PURE__ */ import_react37.default.createElement(IdentityPanelImpl, implProps);
|
|
2265
|
+
};
|
|
2266
|
+
var JoinHeading = /* @__PURE__ */ (0, import_react49.forwardRef)(({ mode, titleId, exitActionParent, onExit }, forwardedRef) => {
|
|
2267
|
+
const { t } = (0, import_react_ui23.useTranslation)("os");
|
|
2268
|
+
const exitButton = /* @__PURE__ */ import_react49.default.createElement(import_react_ui23.Button, {
|
|
2269
|
+
variant: "ghost",
|
|
2270
|
+
...onExit && {
|
|
2271
|
+
onClick: onExit
|
|
2272
|
+
},
|
|
2273
|
+
classNames: (0, import_react_ui_theme25.mx)(import_react_ui_theme25.descriptionText, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
2274
|
+
"data-testid": "join-exit"
|
|
2275
|
+
}, /* @__PURE__ */ import_react49.default.createElement(import_react48.X, {
|
|
2276
|
+
weight: "bold",
|
|
2277
|
+
className: (0, import_react_ui_theme25.getSize)(4)
|
|
2278
|
+
}), /* @__PURE__ */ import_react49.default.createElement("span", {
|
|
2279
|
+
className: "sr-only"
|
|
2280
|
+
}, t("exit label")));
|
|
2281
|
+
return /* @__PURE__ */ import_react49.default.createElement(Heading, {
|
|
2282
|
+
ref: forwardedRef,
|
|
2283
|
+
titleId,
|
|
2284
|
+
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
2285
|
+
...mode === "halo-only" ? {
|
|
2286
|
+
titleSrOnly: true
|
|
2287
|
+
} : {
|
|
2288
|
+
corner: exitActionParent ? /* @__PURE__ */ (0, import_react49.cloneElement)(exitActionParent, {}, exitButton) : exitButton
|
|
2289
|
+
},
|
|
2290
|
+
titleSrOnly: mode === "halo-only"
|
|
2291
|
+
});
|
|
2292
|
+
});
|
|
2293
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts";
|
|
2294
|
+
var getInvitationSubscribable = (Kind, invitation) => {
|
|
2295
|
+
(0, import_log8.log)("[subscribing to invitation]", invitation, {
|
|
2296
|
+
F: __dxlog_file7,
|
|
2297
|
+
L: 90,
|
|
2298
|
+
S: void 0,
|
|
2299
|
+
C: (f, a) => f(...a)
|
|
2300
|
+
});
|
|
2301
|
+
return {
|
|
2302
|
+
subscribe: (next, onError, complete) => invitation.subscribe((invitation2) => {
|
|
2303
|
+
switch (invitation2.state) {
|
|
2304
|
+
case import_invitations6.Invitation.State.CONNECTING: {
|
|
2305
|
+
(0, import_log8.log)("[invitation connecting]", {
|
|
2306
|
+
Kind,
|
|
2307
|
+
invitation: invitation2
|
|
2308
|
+
}, {
|
|
2309
|
+
F: __dxlog_file7,
|
|
2310
|
+
L: 101,
|
|
2311
|
+
S: void 0,
|
|
2312
|
+
C: (f, a) => f(...a)
|
|
2313
|
+
});
|
|
2314
|
+
return next({
|
|
2315
|
+
type: `connecting${Kind}Invitation`,
|
|
2316
|
+
invitation: invitation2
|
|
2317
|
+
});
|
|
2318
|
+
}
|
|
2319
|
+
case import_invitations6.Invitation.State.CONNECTED: {
|
|
2320
|
+
(0, import_log8.log)("[invitation connected]", {
|
|
2321
|
+
Kind,
|
|
2322
|
+
invitation: invitation2
|
|
2323
|
+
}, {
|
|
2324
|
+
F: __dxlog_file7,
|
|
2325
|
+
L: 106,
|
|
2326
|
+
S: void 0,
|
|
2327
|
+
C: (f, a) => f(...a)
|
|
2328
|
+
});
|
|
2329
|
+
return next({
|
|
2330
|
+
type: `connected${Kind}Invitation`,
|
|
2331
|
+
invitation: invitation2
|
|
2332
|
+
});
|
|
2333
|
+
}
|
|
2334
|
+
case import_invitations6.Invitation.State.READY_FOR_AUTHENTICATION: {
|
|
2335
|
+
(0, import_log8.log)("[invitation ready for authentication]", {
|
|
2336
|
+
Kind,
|
|
2337
|
+
invitation: invitation2
|
|
2338
|
+
}, {
|
|
2339
|
+
F: __dxlog_file7,
|
|
2340
|
+
L: 111,
|
|
2341
|
+
S: void 0,
|
|
2342
|
+
C: (f, a) => f(...a)
|
|
2343
|
+
});
|
|
2344
|
+
return next({
|
|
2345
|
+
type: `readyForAuthentication${Kind}Invitation`,
|
|
2346
|
+
invitation: invitation2
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
case import_invitations6.Invitation.State.AUTHENTICATING: {
|
|
2350
|
+
(0, import_log8.log)("[invitation authenticating]", {
|
|
2351
|
+
Kind,
|
|
2352
|
+
invitation: invitation2
|
|
2353
|
+
}, {
|
|
2354
|
+
F: __dxlog_file7,
|
|
2355
|
+
L: 116,
|
|
2356
|
+
S: void 0,
|
|
2357
|
+
C: (f, a) => f(...a)
|
|
2358
|
+
});
|
|
2359
|
+
return next({
|
|
2360
|
+
type: `authenticating${Kind}Invitation`,
|
|
2361
|
+
invitation: invitation2
|
|
2362
|
+
});
|
|
2363
|
+
}
|
|
2364
|
+
case import_invitations6.Invitation.State.SUCCESS: {
|
|
2365
|
+
(0, import_log8.log)("[invitation success]", {
|
|
2366
|
+
Kind,
|
|
2367
|
+
invitation: invitation2
|
|
2368
|
+
}, {
|
|
2369
|
+
F: __dxlog_file7,
|
|
2370
|
+
L: 121,
|
|
2371
|
+
S: void 0,
|
|
2372
|
+
C: (f, a) => f(...a)
|
|
2373
|
+
});
|
|
2374
|
+
next({
|
|
2375
|
+
type: `success${Kind}Invitation`,
|
|
2376
|
+
invitation: invitation2
|
|
2377
|
+
});
|
|
2378
|
+
return complete?.();
|
|
2379
|
+
}
|
|
2380
|
+
case import_invitations6.Invitation.State.CANCELLED: {
|
|
2381
|
+
import_log8.log.warn("[invitation cancelled]", {
|
|
2382
|
+
Kind
|
|
2383
|
+
}, {
|
|
2384
|
+
F: __dxlog_file7,
|
|
2385
|
+
L: 127,
|
|
2386
|
+
S: void 0,
|
|
2387
|
+
C: (f, a) => f(...a)
|
|
2388
|
+
});
|
|
2389
|
+
return next({
|
|
2390
|
+
type: `fail${Kind}Invitation`,
|
|
2391
|
+
reason: "cancelled"
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2394
|
+
case import_invitations6.Invitation.State.TIMEOUT: {
|
|
2395
|
+
import_log8.log.error("[invitation timeout]", {
|
|
2396
|
+
Kind
|
|
2397
|
+
}, {
|
|
2398
|
+
F: __dxlog_file7,
|
|
2399
|
+
L: 132,
|
|
2400
|
+
S: void 0,
|
|
2401
|
+
C: (f, a) => f(...a)
|
|
2402
|
+
});
|
|
2403
|
+
return next({
|
|
2404
|
+
type: `fail${Kind}Invitation`,
|
|
2405
|
+
reason: "timeout"
|
|
2406
|
+
});
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
}, (error) => {
|
|
2410
|
+
if (error instanceof import_react_client8.AlreadyJoinedError) {
|
|
2411
|
+
(0, import_log8.log)("[already joined]", {
|
|
2412
|
+
Kind,
|
|
2413
|
+
error
|
|
2414
|
+
}, {
|
|
2415
|
+
F: __dxlog_file7,
|
|
2416
|
+
L: 139,
|
|
2417
|
+
S: void 0,
|
|
2418
|
+
C: (f, a) => f(...a)
|
|
2419
|
+
});
|
|
2420
|
+
next({
|
|
2421
|
+
type: `success${Kind}Invitation`,
|
|
2422
|
+
invitation: invitation.get()
|
|
2423
|
+
});
|
|
2424
|
+
return complete?.();
|
|
2425
|
+
}
|
|
2426
|
+
import_log8.log.error("[invitation errored]", {
|
|
2427
|
+
Kind,
|
|
2428
|
+
error
|
|
2429
|
+
}, {
|
|
2430
|
+
F: __dxlog_file7,
|
|
2431
|
+
L: 144,
|
|
2432
|
+
S: void 0,
|
|
2433
|
+
C: (f, a) => f(...a)
|
|
2434
|
+
});
|
|
2435
|
+
next({
|
|
2436
|
+
type: `fail${Kind}Invitation`,
|
|
2437
|
+
reason: "error"
|
|
2438
|
+
});
|
|
2439
|
+
return onError?.(error);
|
|
2440
|
+
})
|
|
2441
|
+
};
|
|
2442
|
+
};
|
|
2443
|
+
var acceptingInvitationTemplate = (Kind, successTarget) => {
|
|
2444
|
+
const config = {
|
|
2445
|
+
initial: `unknown${Kind}`,
|
|
2446
|
+
states: {
|
|
2447
|
+
[`unknown${Kind}`]: {
|
|
2448
|
+
always: [
|
|
2449
|
+
{
|
|
2450
|
+
cond: ({ mode }) => mode === "halo-only" && Kind === "Space",
|
|
2451
|
+
target: "#join.finishingJoiningHalo"
|
|
2452
|
+
},
|
|
2453
|
+
{
|
|
2454
|
+
cond: (context) => !!context[Kind.toLowerCase()].unredeemedCode,
|
|
2455
|
+
target: `acceptingRedeemed${Kind}Invitation`,
|
|
2456
|
+
actions: [
|
|
2457
|
+
`redeem${Kind}InvitationCode`,
|
|
2458
|
+
`invalidate${Kind}InvitationCode`,
|
|
2459
|
+
"log"
|
|
2460
|
+
]
|
|
2461
|
+
},
|
|
2462
|
+
{
|
|
2463
|
+
target: `inputting${Kind}InvitationCode`,
|
|
2464
|
+
actions: "log"
|
|
2465
|
+
}
|
|
2466
|
+
]
|
|
2467
|
+
},
|
|
2468
|
+
[`inputting${Kind}InvitationCode`]: {},
|
|
2469
|
+
[`acceptingRedeemed${Kind}Invitation`]: {
|
|
2470
|
+
invoke: {
|
|
2471
|
+
src: (context) => context[Kind.toLowerCase()].invitationSubscribable
|
|
2472
|
+
},
|
|
2473
|
+
initial: `unknown${Kind}Invitation`,
|
|
2474
|
+
states: {
|
|
2475
|
+
[`unknown${Kind}Invitation`]: {
|
|
2476
|
+
always: [
|
|
2477
|
+
{
|
|
2478
|
+
cond: (context) => {
|
|
2479
|
+
if (Kind !== "Space") {
|
|
2480
|
+
return false;
|
|
2481
|
+
} else {
|
|
2482
|
+
const spaceKey = context.space.invitation?.spaceKey?.toHex();
|
|
2483
|
+
const succeededKeys = context.space.succeededKeys;
|
|
2484
|
+
return spaceKey ? !!succeededKeys?.has(spaceKey) : false;
|
|
2485
|
+
}
|
|
2486
|
+
},
|
|
2487
|
+
target: successTarget,
|
|
2488
|
+
actions: "log"
|
|
2489
|
+
},
|
|
2490
|
+
{
|
|
2491
|
+
cond: (context) => {
|
|
2492
|
+
const invitation = context[Kind.toLowerCase()].invitation;
|
|
2493
|
+
return !invitation || invitation?.state === import_invitations6.Invitation.State.CONNECTING;
|
|
2494
|
+
},
|
|
2495
|
+
target: `connecting${Kind}Invitation`,
|
|
2496
|
+
actions: "log"
|
|
2497
|
+
},
|
|
2498
|
+
{
|
|
2499
|
+
target: `inputting${Kind}VerificationCode`,
|
|
2500
|
+
actions: "log"
|
|
2501
|
+
}
|
|
2502
|
+
]
|
|
2503
|
+
},
|
|
2504
|
+
[`connecting${Kind}Invitation`]: {},
|
|
2505
|
+
[`inputting${Kind}VerificationCode`]: {},
|
|
2506
|
+
[`authenticating${Kind}VerificationCode`]: {
|
|
2507
|
+
on: {
|
|
2508
|
+
[`readyForAuthentication${Kind}Invitation`]: {
|
|
2509
|
+
target: `authenticationFailing${Kind}VerificationCode`,
|
|
2510
|
+
actions: [
|
|
2511
|
+
"setInvitation",
|
|
2512
|
+
"log"
|
|
2513
|
+
]
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
},
|
|
2517
|
+
[`authenticationFailing${Kind}VerificationCode`]: {},
|
|
2518
|
+
[`failing${Kind}Invitation`]: {},
|
|
2519
|
+
[`success${Kind}Invitation`]: {}
|
|
2520
|
+
},
|
|
2521
|
+
on: {
|
|
2522
|
+
[`reset${Kind}Invitation`]: {
|
|
2523
|
+
target: `#join${Kind === "Halo" ? ".choosingIdentity" : ""}.accepting${Kind}Invitation.unknown${Kind}`,
|
|
2524
|
+
actions: [
|
|
2525
|
+
"resetInvitation",
|
|
2526
|
+
"log"
|
|
2527
|
+
]
|
|
2528
|
+
},
|
|
2529
|
+
[`connecting${Kind}Invitation`]: {
|
|
2530
|
+
target: `.connecting${Kind}Invitation`,
|
|
2531
|
+
actions: [
|
|
2532
|
+
"setInvitation",
|
|
2533
|
+
"log"
|
|
2534
|
+
]
|
|
2535
|
+
},
|
|
2536
|
+
[`connected${Kind}Invitation`]: {
|
|
2537
|
+
target: `.connecting${Kind}Invitation`,
|
|
2538
|
+
actions: [
|
|
2539
|
+
"setInvitation",
|
|
2540
|
+
"log"
|
|
2541
|
+
]
|
|
2542
|
+
},
|
|
2543
|
+
[`readyForAuthentication${Kind}Invitation`]: {
|
|
2544
|
+
target: `.inputting${Kind}VerificationCode`,
|
|
2545
|
+
actions: [
|
|
2546
|
+
"setInvitation",
|
|
2547
|
+
"log"
|
|
2548
|
+
]
|
|
2549
|
+
},
|
|
2550
|
+
[`authenticating${Kind}Invitation`]: {
|
|
2551
|
+
target: `.authenticating${Kind}VerificationCode`,
|
|
2552
|
+
actions: [
|
|
2553
|
+
"setInvitation",
|
|
2554
|
+
"log"
|
|
2555
|
+
]
|
|
2556
|
+
},
|
|
2557
|
+
[`success${Kind}Invitation`]: {
|
|
2558
|
+
target: successTarget,
|
|
2559
|
+
actions: [
|
|
2560
|
+
"setInvitation",
|
|
2561
|
+
"log"
|
|
2562
|
+
]
|
|
2563
|
+
},
|
|
2564
|
+
[`fail${Kind}Invitation`]: {
|
|
2565
|
+
target: `.failing${Kind}Invitation`,
|
|
2566
|
+
actions: [
|
|
2567
|
+
(0, import_xstate2.assign)({
|
|
2568
|
+
[Kind.toLowerCase()]: (context, event) => ({
|
|
2569
|
+
...context[Kind.toLowerCase()],
|
|
2570
|
+
failReason: event.reason
|
|
2571
|
+
})
|
|
2572
|
+
}),
|
|
2573
|
+
"log"
|
|
2574
|
+
]
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
},
|
|
2579
|
+
on: {
|
|
2580
|
+
[`set${Kind}InvitationCode`]: {
|
|
2581
|
+
target: `.acceptingRedeemed${Kind}Invitation`,
|
|
2582
|
+
actions: [
|
|
2583
|
+
(0, import_xstate2.assign)({
|
|
2584
|
+
[Kind.toLowerCase()]: (context, event) => ({
|
|
2585
|
+
...context[Kind.toLowerCase()],
|
|
2586
|
+
unredeemedCode: event.code,
|
|
2587
|
+
succeededKeys: event.succeededKeys
|
|
2588
|
+
})
|
|
2589
|
+
}),
|
|
2590
|
+
`redeem${Kind}InvitationCode`,
|
|
2591
|
+
`invalidate${Kind}InvitationCode`,
|
|
2592
|
+
"log"
|
|
2593
|
+
]
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2596
|
+
};
|
|
2597
|
+
return config;
|
|
2598
|
+
};
|
|
2599
|
+
var joinMachine = (0, import_xstate2.createMachine)({
|
|
2600
|
+
id: "join",
|
|
2601
|
+
predictableActionArguments: true,
|
|
2602
|
+
context: {
|
|
2603
|
+
initialDisposition: "default",
|
|
2604
|
+
mode: "default",
|
|
2605
|
+
identity: null,
|
|
2606
|
+
halo: {},
|
|
2607
|
+
space: {}
|
|
2608
|
+
},
|
|
2609
|
+
initial: "unknown",
|
|
2610
|
+
states: {
|
|
2611
|
+
unknown: {
|
|
2612
|
+
always: [
|
|
2613
|
+
{
|
|
2614
|
+
cond: "existingIdentity",
|
|
2615
|
+
target: "resettingIdentity",
|
|
2616
|
+
actions: "log"
|
|
2617
|
+
},
|
|
2618
|
+
{
|
|
2619
|
+
cond: "initiallyAcceptingHaloInvitation",
|
|
2620
|
+
target: "#join.choosingIdentity.acceptingHaloInvitation",
|
|
2621
|
+
actions: "log"
|
|
2622
|
+
},
|
|
2623
|
+
{
|
|
2624
|
+
cond: "initiallyRecoveringIdentity",
|
|
2625
|
+
target: "#join.choosingIdentity.recoveringIdentity",
|
|
2626
|
+
actions: "log"
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
cond: "noSelectedIdentity",
|
|
2630
|
+
target: "choosingIdentity",
|
|
2631
|
+
actions: "log"
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
target: "acceptingSpaceInvitation",
|
|
2635
|
+
actions: "log"
|
|
2636
|
+
}
|
|
2637
|
+
]
|
|
2638
|
+
},
|
|
2639
|
+
// TODO(wittjosiah): Remove.
|
|
2640
|
+
choosingIdentity: {
|
|
2641
|
+
initial: "unknownAuthMethod",
|
|
2642
|
+
states: {
|
|
2643
|
+
unknownAuthMethod: {
|
|
2644
|
+
always: [
|
|
2645
|
+
{
|
|
2646
|
+
cond: "hasHaloUnredeemedCode",
|
|
2647
|
+
target: "acceptingHaloInvitation",
|
|
2648
|
+
actions: "log"
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
target: "choosingAuthMethod",
|
|
2652
|
+
actions: "log"
|
|
2653
|
+
}
|
|
2654
|
+
]
|
|
2655
|
+
},
|
|
2656
|
+
choosingAuthMethod: {},
|
|
2657
|
+
recoveringIdentity: {},
|
|
2658
|
+
creatingIdentity: {},
|
|
2659
|
+
acceptingHaloInvitation: acceptingInvitationTemplate("Halo", "#join.acceptingSpaceInvitation"),
|
|
2660
|
+
confirmingAddedIdentity: {}
|
|
2661
|
+
},
|
|
2662
|
+
on: {
|
|
2663
|
+
recoverIdentity: {
|
|
2664
|
+
target: ".recoveringIdentity",
|
|
2665
|
+
actions: "log"
|
|
2666
|
+
},
|
|
2667
|
+
createIdentity: {
|
|
2668
|
+
target: ".creatingIdentity",
|
|
2669
|
+
actions: "log"
|
|
2670
|
+
},
|
|
2671
|
+
acceptHaloInvitation: {
|
|
2672
|
+
target: ".acceptingHaloInvitation",
|
|
2673
|
+
actions: "log"
|
|
2674
|
+
},
|
|
2675
|
+
addIdentity: {
|
|
2676
|
+
target: ".confirmingAddedIdentity",
|
|
2677
|
+
actions: "log"
|
|
2678
|
+
},
|
|
2679
|
+
selectIdentity: {
|
|
2680
|
+
target: "acceptingSpaceInvitation",
|
|
2681
|
+
actions: [
|
|
2682
|
+
"setIdentity",
|
|
2683
|
+
"log"
|
|
2684
|
+
]
|
|
2685
|
+
},
|
|
2686
|
+
deselectAuthMethod: {
|
|
2687
|
+
target: ".choosingAuthMethod",
|
|
2688
|
+
actions: "log"
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
},
|
|
2692
|
+
// TODO(wittjosiah): Factor out to a machine handling recovery and device invitations.
|
|
2693
|
+
resettingIdentity: {},
|
|
2694
|
+
acceptingSpaceInvitation: acceptingInvitationTemplate("Space", "#join.finishingJoiningSpace"),
|
|
2695
|
+
finishingJoiningSpace: {
|
|
2696
|
+
type: "final"
|
|
2697
|
+
},
|
|
2698
|
+
finishingJoiningHalo: {
|
|
2699
|
+
type: "final"
|
|
2700
|
+
}
|
|
2701
|
+
},
|
|
2702
|
+
on: {
|
|
2703
|
+
resetIdentity: {
|
|
2704
|
+
target: "choosingIdentity",
|
|
2705
|
+
actions: "unsetIdentity"
|
|
2706
|
+
}
|
|
2707
|
+
}
|
|
2708
|
+
}, {
|
|
2709
|
+
guards: {
|
|
2710
|
+
existingIdentity: ({ identity, mode }, _event) => mode === "halo-only" && !!identity,
|
|
2711
|
+
noSelectedIdentity: ({ identity }, _event) => !identity,
|
|
2712
|
+
initiallyAcceptingHaloInvitation: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "accept-halo-invitation",
|
|
2713
|
+
initiallyRecoveringIdentity: ({ identity, initialDisposition }, _event) => !identity && initialDisposition === "recover-identity",
|
|
2714
|
+
hasHaloUnredeemedCode: ({ halo }, _event) => !!halo.unredeemedCode,
|
|
2715
|
+
noSpaceInvitation: ({ space }, _event) => !space.invitation && !space.unredeemedCode
|
|
2716
|
+
},
|
|
2717
|
+
actions: {
|
|
2718
|
+
setIdentity: (0, import_xstate2.assign)({
|
|
2719
|
+
identity: (context, event) => event.identity
|
|
2720
|
+
}),
|
|
2721
|
+
unsetIdentity: (0, import_xstate2.assign)({
|
|
2722
|
+
identity: () => null
|
|
2723
|
+
}),
|
|
2724
|
+
resetInvitation: (0, import_xstate2.assign)({
|
|
2725
|
+
halo: (context, event) => {
|
|
2726
|
+
if (event.type !== "resetHaloInvitation") {
|
|
2727
|
+
return context.halo;
|
|
2728
|
+
}
|
|
2729
|
+
if (context.halo.invitationObservable) {
|
|
2730
|
+
void context.halo.invitationObservable.cancel();
|
|
2731
|
+
}
|
|
2732
|
+
return {
|
|
2733
|
+
...context.halo,
|
|
2734
|
+
invitation: void 0,
|
|
2735
|
+
invitationObservable: void 0,
|
|
2736
|
+
invitationSubscribable: void 0
|
|
2737
|
+
};
|
|
2738
|
+
},
|
|
2739
|
+
space: (context, event) => {
|
|
2740
|
+
if (event.type !== "resetSpaceInvitation") {
|
|
2741
|
+
return context.space;
|
|
2742
|
+
}
|
|
2743
|
+
if (context.space.invitationObservable) {
|
|
2744
|
+
void context.space.invitationObservable.cancel();
|
|
2745
|
+
}
|
|
2746
|
+
return {
|
|
2747
|
+
...context.space,
|
|
2748
|
+
invitation: void 0,
|
|
2749
|
+
invitationObservable: void 0,
|
|
2750
|
+
invitationSubscribable: void 0
|
|
2751
|
+
};
|
|
2752
|
+
}
|
|
2753
|
+
}),
|
|
2754
|
+
setInvitation: (0, import_xstate2.assign)({
|
|
2755
|
+
halo: (context, event) => event.type.includes("Halo") ? {
|
|
2756
|
+
...context.halo,
|
|
2757
|
+
invitation: event.invitation
|
|
2758
|
+
} : context.halo,
|
|
2759
|
+
space: (context, event) => event.type.includes("Space") ? {
|
|
2760
|
+
...context.space,
|
|
2761
|
+
invitation: event.invitation
|
|
2762
|
+
} : context.space
|
|
2763
|
+
}),
|
|
2764
|
+
log: (context, event) => {
|
|
2765
|
+
(0, import_log8.log)("[transition]", {
|
|
2766
|
+
event,
|
|
2767
|
+
haloInvitation: context.halo.invitation,
|
|
2768
|
+
spaceInvitation: context.space.invitation
|
|
2769
|
+
}, {
|
|
2770
|
+
F: __dxlog_file7,
|
|
2771
|
+
L: 425,
|
|
2772
|
+
S: void 0,
|
|
2773
|
+
C: (f, a) => f(...a)
|
|
2774
|
+
});
|
|
2775
|
+
}
|
|
2776
|
+
}
|
|
2777
|
+
});
|
|
2778
|
+
var defaultCodeFromUrl = (invitationType, text) => {
|
|
2779
|
+
try {
|
|
2780
|
+
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
2781
|
+
return searchParams.get(`${invitationType}InvitationCode`) ?? searchParams.get(`${invitationType}Invitation`) ?? searchParams.get("invitationCode") ?? searchParams.get("invitation") ?? text;
|
|
2782
|
+
} catch (err) {
|
|
2783
|
+
import_log8.log.catch(err, void 0, {
|
|
2784
|
+
F: __dxlog_file7,
|
|
2785
|
+
L: 452,
|
|
2786
|
+
S: void 0,
|
|
2787
|
+
C: (f, a) => f(...a)
|
|
2788
|
+
});
|
|
2789
|
+
return text;
|
|
2790
|
+
}
|
|
2791
|
+
};
|
|
2792
|
+
var useJoinMachine = (client, options) => {
|
|
2793
|
+
const redeemHaloInvitationCode = (0, import_react51.useCallback)(({ halo }) => {
|
|
2794
|
+
if (halo.unredeemedCode) {
|
|
2795
|
+
try {
|
|
2796
|
+
const invitation = import_invitations6.InvitationEncoder.decode(defaultCodeFromUrl("halo", halo.unredeemedCode));
|
|
2797
|
+
const invitationObservable = client.halo.join(invitation);
|
|
2798
|
+
return {
|
|
2799
|
+
...halo,
|
|
2800
|
+
invitationObservable,
|
|
2801
|
+
invitationSubscribable: getInvitationSubscribable("Halo", invitationObservable)
|
|
2802
|
+
};
|
|
2803
|
+
} catch (err) {
|
|
2804
|
+
import_log8.log.error("Could not redeem device invitation code", err, {
|
|
2805
|
+
F: __dxlog_file7,
|
|
2806
|
+
L: 473,
|
|
2807
|
+
S: void 0,
|
|
2808
|
+
C: (f, a) => f(...a)
|
|
2809
|
+
});
|
|
2810
|
+
return halo;
|
|
2811
|
+
}
|
|
2812
|
+
} else {
|
|
2813
|
+
return halo;
|
|
2814
|
+
}
|
|
2815
|
+
}, [
|
|
2816
|
+
client
|
|
2817
|
+
]);
|
|
2818
|
+
const redeemSpaceInvitationCode = (0, import_react51.useCallback)(({ space }) => {
|
|
2819
|
+
if (space.unredeemedCode) {
|
|
2820
|
+
try {
|
|
2821
|
+
const invitation = import_invitations6.InvitationEncoder.decode(defaultCodeFromUrl("space", space.unredeemedCode));
|
|
2822
|
+
const invitationObservable = client.spaces.join(invitation);
|
|
2823
|
+
return {
|
|
2824
|
+
...space,
|
|
2825
|
+
invitationObservable,
|
|
2826
|
+
invitationSubscribable: getInvitationSubscribable("Space", invitationObservable)
|
|
2827
|
+
};
|
|
2828
|
+
} catch (err) {
|
|
2829
|
+
import_log8.log.error("Could not redeem space invitation code", err, {
|
|
2830
|
+
F: __dxlog_file7,
|
|
2831
|
+
L: 495,
|
|
2832
|
+
S: void 0,
|
|
2833
|
+
C: (f, a) => f(...a)
|
|
2834
|
+
});
|
|
2835
|
+
return space;
|
|
2836
|
+
}
|
|
2837
|
+
} else {
|
|
2838
|
+
return space;
|
|
2839
|
+
}
|
|
2840
|
+
}, [
|
|
2841
|
+
client
|
|
2842
|
+
]);
|
|
2843
|
+
const invalidateHaloInvitationCode = (0, import_react51.useCallback)(({ halo }) => {
|
|
2844
|
+
if (halo.unredeemedCode) {
|
|
2845
|
+
options?.onInvalidateInvitationCode?.(halo.unredeemedCode);
|
|
2846
|
+
return {
|
|
2847
|
+
...halo,
|
|
2848
|
+
unredeemedCode: void 0
|
|
2849
|
+
};
|
|
2850
|
+
} else {
|
|
2851
|
+
return halo;
|
|
2852
|
+
}
|
|
2853
|
+
}, [
|
|
2854
|
+
options?.onInvalidateInvitationCode
|
|
2855
|
+
]);
|
|
2856
|
+
const invalidateSpaceInvitationCode = (0, import_react51.useCallback)(({ space }) => {
|
|
2857
|
+
if (space.unredeemedCode) {
|
|
2858
|
+
options?.onInvalidateInvitationCode?.(space.unredeemedCode);
|
|
2859
|
+
return {
|
|
2860
|
+
...space,
|
|
2861
|
+
unredeemedCode: void 0
|
|
2862
|
+
};
|
|
2863
|
+
} else {
|
|
2864
|
+
return space;
|
|
2865
|
+
}
|
|
2866
|
+
}, [
|
|
2867
|
+
options?.onInvalidateInvitationCode
|
|
2868
|
+
]);
|
|
2869
|
+
return (0, import_react50.useMachine)(joinMachine, {
|
|
2870
|
+
...options,
|
|
2871
|
+
actions: {
|
|
2872
|
+
...options?.actions,
|
|
2873
|
+
redeemHaloInvitationCode: (0, import_xstate2.assign)({
|
|
2874
|
+
halo: redeemHaloInvitationCode
|
|
2875
|
+
}),
|
|
2876
|
+
redeemSpaceInvitationCode: (0, import_xstate2.assign)({
|
|
2877
|
+
space: redeemSpaceInvitationCode
|
|
2878
|
+
}),
|
|
2879
|
+
invalidateHaloInvitationCode: (0, import_xstate2.assign)({
|
|
2880
|
+
halo: invalidateHaloInvitationCode
|
|
2881
|
+
}),
|
|
2882
|
+
invalidateSpaceInvitationCode: (0, import_xstate2.assign)({
|
|
2883
|
+
space: invalidateSpaceInvitationCode
|
|
2884
|
+
})
|
|
2885
|
+
}
|
|
2886
|
+
});
|
|
2887
|
+
};
|
|
2888
|
+
var AdditionMethodChooser = (viewStateProps) => {
|
|
2889
|
+
const disabled = !viewStateProps.active;
|
|
2890
|
+
const { send } = viewStateProps;
|
|
2891
|
+
const { t } = (0, import_react_ui24.useTranslation)("os");
|
|
2892
|
+
const sharedButtonProps = {
|
|
2893
|
+
disabled,
|
|
2894
|
+
after: /* @__PURE__ */ import_react53.default.createElement(import_react52.CaretRight, {
|
|
2895
|
+
className: (0, import_react_ui_theme26.getSize)(4),
|
|
2896
|
+
weight: "bold"
|
|
2897
|
+
}),
|
|
2898
|
+
slots: {
|
|
2899
|
+
label: {
|
|
2900
|
+
className: "text-sm"
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
};
|
|
2904
|
+
return /* @__PURE__ */ import_react53.default.createElement(import_react53.default.Fragment, null, /* @__PURE__ */ import_react53.default.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ import_react53.default.createElement("div", {
|
|
2905
|
+
role: "none",
|
|
2906
|
+
className: "flex flex-col gap-1 grow"
|
|
2907
|
+
}, /* @__PURE__ */ import_react53.default.createElement(CompoundButton, {
|
|
2908
|
+
...sharedButtonProps,
|
|
2909
|
+
description: t("create identity description"),
|
|
2910
|
+
before: /* @__PURE__ */ import_react53.default.createElement(import_react52.Plus, {
|
|
2911
|
+
className: (0, import_react_ui_theme26.getSize)(6)
|
|
2912
|
+
}),
|
|
2913
|
+
onClick: () => send({
|
|
2914
|
+
type: "createIdentity"
|
|
2915
|
+
}),
|
|
2916
|
+
"data-autofocus": "choosingAuthMethod",
|
|
2917
|
+
"data-testid": "identity-chooser.create-identity"
|
|
2918
|
+
}, t("create identity label")), /* @__PURE__ */ import_react53.default.createElement(CompoundButton, {
|
|
2919
|
+
...sharedButtonProps,
|
|
2920
|
+
description: t("join identity description"),
|
|
2921
|
+
before: /* @__PURE__ */ import_react53.default.createElement(import_react52.QrCode, {
|
|
2922
|
+
className: (0, import_react_ui_theme26.getSize)(6)
|
|
2923
|
+
}),
|
|
2924
|
+
onClick: () => send({
|
|
2925
|
+
type: "acceptHaloInvitation"
|
|
2926
|
+
}),
|
|
2927
|
+
"data-testid": "identity-chooser.join-identity"
|
|
2928
|
+
}, t("join identity label")), /* @__PURE__ */ import_react53.default.createElement(CompoundButton, {
|
|
2929
|
+
...sharedButtonProps,
|
|
2930
|
+
description: t("recover identity description"),
|
|
2931
|
+
before: /* @__PURE__ */ import_react53.default.createElement(import_react52.Textbox, {
|
|
2932
|
+
className: (0, import_react_ui_theme26.getSize)(6)
|
|
2933
|
+
}),
|
|
2934
|
+
onClick: () => send({
|
|
2935
|
+
type: "recoverIdentity"
|
|
2936
|
+
}),
|
|
2937
|
+
"data-testid": "identity-chooser.recover-identity"
|
|
2938
|
+
}, t("recover identity label"))));
|
|
2939
|
+
};
|
|
2940
|
+
var IdentityAdded = (props) => {
|
|
2941
|
+
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2942
|
+
const disabled = !active;
|
|
2943
|
+
const { t } = (0, import_react_ui25.useTranslation)("os");
|
|
2944
|
+
const addedIdentityHex = addedIdentity?.identityKey.toHex() ?? "0";
|
|
2945
|
+
const fallbackValue = (0, import_util8.hexToFallback)(addedIdentityHex);
|
|
2946
|
+
const labelId = (0, import_react_ui25.useId)("identityListItem__label");
|
|
2947
|
+
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && (0, import_display_name4.generateName)(addedIdentityHex));
|
|
2948
|
+
const doneAction = /* @__PURE__ */ import_react54.default.createElement(Action, {
|
|
2949
|
+
...onDone && {
|
|
2950
|
+
onClick: () => onDone(null)
|
|
2951
|
+
},
|
|
2952
|
+
disabled,
|
|
2953
|
+
"data-autofocus": "confirmingAddedIdentity",
|
|
2954
|
+
"data-testid": "identity-added-done"
|
|
2955
|
+
}, /* @__PURE__ */ import_react54.default.createElement("span", null, t("done label")));
|
|
2956
|
+
return /* @__PURE__ */ import_react54.default.createElement(import_react54.default.Fragment, null, /* @__PURE__ */ import_react54.default.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ import_react54.default.createElement("div", {
|
|
2957
|
+
role: "none",
|
|
2958
|
+
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2959
|
+
}, /* @__PURE__ */ import_react54.default.createElement(import_react_ui25.Avatar.Root, {
|
|
2960
|
+
status: "active",
|
|
2961
|
+
labelId,
|
|
2962
|
+
hue: addedIdentity?.profile?.data?.hue || fallbackValue.hue
|
|
2963
|
+
}, /* @__PURE__ */ import_react54.default.createElement(import_react_ui25.Avatar.Frame, null, /* @__PURE__ */ import_react54.default.createElement(import_react_ui25.Avatar.Fallback, {
|
|
2964
|
+
text: addedIdentity?.profile?.data?.emoji || fallbackValue.emoji
|
|
2965
|
+
})), /* @__PURE__ */ import_react54.default.createElement(import_react_ui25.Avatar.Label, {
|
|
2966
|
+
classNames: (0, import_react_ui_theme27.mx)("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2967
|
+
}, displayName))), /* @__PURE__ */ import_react54.default.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ (0, import_react54.cloneElement)(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ import_react54.default.createElement(Action, {
|
|
2968
|
+
variant: "primary",
|
|
2969
|
+
disabled: disabled || !addedIdentity,
|
|
2970
|
+
onClick: () => addedIdentity && send({
|
|
2971
|
+
type: "selectIdentity",
|
|
2972
|
+
identity: addedIdentity
|
|
2973
|
+
}),
|
|
2974
|
+
"data-autofocus": "confirmingAddedIdentity"
|
|
2975
|
+
}, t("continue label"))));
|
|
2976
|
+
};
|
|
2977
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2978
|
+
var IdentityInput = (props) => {
|
|
2979
|
+
const { send, method } = props;
|
|
2980
|
+
const isRecover = method === "recover identity";
|
|
2981
|
+
const client = (0, import_react_client9.useClient)();
|
|
2982
|
+
const { t } = (0, import_react_ui26.useTranslation)("os");
|
|
2983
|
+
const [validationMessage, setValidationMessage] = (0, import_react55.useState)("");
|
|
2984
|
+
const createIdentity = (value) => {
|
|
2985
|
+
if (isRecover) {
|
|
2986
|
+
void client.halo.recoverIdentity({
|
|
2987
|
+
seedphrase: value
|
|
2988
|
+
}).then((identity) => {
|
|
2989
|
+
send?.({
|
|
2990
|
+
type: "selectIdentity",
|
|
2991
|
+
identity
|
|
2992
|
+
});
|
|
2993
|
+
}, (error) => {
|
|
2994
|
+
import_log9.log.catch(error, void 0, {
|
|
2995
|
+
F: __dxlog_file8,
|
|
2996
|
+
L: 38,
|
|
2997
|
+
S: void 0,
|
|
2998
|
+
C: (f, a) => f(...a)
|
|
2999
|
+
});
|
|
3000
|
+
setValidationMessage(t("failed to recover identity message"));
|
|
3001
|
+
});
|
|
3002
|
+
} else {
|
|
3003
|
+
void client.halo.createIdentity({
|
|
3004
|
+
displayName: value
|
|
3005
|
+
}).then((identity) => {
|
|
3006
|
+
send?.({
|
|
3007
|
+
type: "selectIdentity",
|
|
3008
|
+
identity
|
|
3009
|
+
});
|
|
3010
|
+
}, (error) => {
|
|
3011
|
+
import_log9.log.catch(error, void 0, {
|
|
3012
|
+
F: __dxlog_file8,
|
|
3013
|
+
L: 48,
|
|
3014
|
+
S: void 0,
|
|
3015
|
+
C: (f, a) => f(...a)
|
|
3016
|
+
});
|
|
3017
|
+
setValidationMessage(t("failed to create identity message"));
|
|
3018
|
+
});
|
|
3019
|
+
}
|
|
3020
|
+
};
|
|
3021
|
+
return /* @__PURE__ */ import_react55.default.createElement(IdentityInputImpl, {
|
|
3022
|
+
...props,
|
|
3023
|
+
onDisplayNameConfirm: createIdentity,
|
|
3024
|
+
validationMessage
|
|
3025
|
+
});
|
|
3026
|
+
};
|
|
3027
|
+
var IdentityInputImpl = (props) => {
|
|
3028
|
+
const { method, send, active, onDisplayNameConfirm, validationMessage } = props;
|
|
3029
|
+
const disabled = !active;
|
|
3030
|
+
const { t } = (0, import_react_ui26.useTranslation)("os");
|
|
3031
|
+
const [inputValue, setInputValue] = (0, import_react55.useState)("");
|
|
3032
|
+
const isRecover = method === "recover identity";
|
|
3033
|
+
return /* @__PURE__ */ import_react55.default.createElement(import_react55.default.Fragment, null, /* @__PURE__ */ import_react55.default.createElement("div", {
|
|
3034
|
+
role: "none",
|
|
3035
|
+
className: "grow flex flex-col justify-center"
|
|
3036
|
+
}, /* @__PURE__ */ import_react55.default.createElement(Input, {
|
|
3037
|
+
validationMessage,
|
|
3038
|
+
label: /* @__PURE__ */ import_react55.default.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
3039
|
+
disabled,
|
|
3040
|
+
"data-testid": "identity-input",
|
|
3041
|
+
placeholder: isRecover ? "Type your recovery phrase" : "Type a display name",
|
|
3042
|
+
onChange: ({ target: { value } }) => setInputValue(value)
|
|
3043
|
+
})), /* @__PURE__ */ import_react55.default.createElement(Actions, null, /* @__PURE__ */ import_react55.default.createElement(Action, {
|
|
3044
|
+
variant: "ghost",
|
|
3045
|
+
disabled,
|
|
3046
|
+
onClick: () => send?.({
|
|
3047
|
+
type: "deselectAuthMethod"
|
|
3048
|
+
}),
|
|
3049
|
+
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-back`
|
|
3050
|
+
}, t("back label")), /* @__PURE__ */ import_react55.default.createElement(Action, {
|
|
3051
|
+
variant: "primary",
|
|
3052
|
+
disabled,
|
|
3053
|
+
onClick: () => onDisplayNameConfirm?.(inputValue),
|
|
3054
|
+
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-continue`
|
|
3055
|
+
}, t("continue label"))));
|
|
3056
|
+
};
|
|
3057
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
3058
|
+
var invitationCodeFromUrl = (text) => {
|
|
3059
|
+
try {
|
|
3060
|
+
const searchParams = new URLSearchParams(text.substring(text.lastIndexOf("?")));
|
|
3061
|
+
const invitation = searchParams.get("spaceInvitationCode") ?? searchParams.get("deviceInvitationCode");
|
|
3062
|
+
return invitation ?? text;
|
|
3063
|
+
} catch (err) {
|
|
3064
|
+
import_log10.log.catch(err, void 0, {
|
|
3065
|
+
F: __dxlog_file9,
|
|
3066
|
+
L: 25,
|
|
3067
|
+
S: void 0,
|
|
3068
|
+
C: (f, a) => f(...a)
|
|
3069
|
+
});
|
|
3070
|
+
return text;
|
|
3071
|
+
}
|
|
3072
|
+
};
|
|
3073
|
+
var InvitationInput = (props) => {
|
|
3074
|
+
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
3075
|
+
const disabled = !active;
|
|
3076
|
+
const { t } = (0, import_react_ui28.useTranslation)("os");
|
|
3077
|
+
const [inputValue, setInputValue] = (0, import_react57.useState)(unredeemedCode ?? "");
|
|
3078
|
+
(0, import_react57.useEffect)(() => {
|
|
3079
|
+
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
3080
|
+
}, [
|
|
3081
|
+
unredeemedCode
|
|
3082
|
+
]);
|
|
3083
|
+
const handleNext = () => {
|
|
3084
|
+
if (inputValue.trim().length === 0) {
|
|
3085
|
+
return;
|
|
3086
|
+
}
|
|
3087
|
+
send({
|
|
3088
|
+
type: `set${Kind}InvitationCode`,
|
|
3089
|
+
code: invitationCodeFromUrl(inputValue),
|
|
3090
|
+
...Kind === "Space" && {
|
|
3091
|
+
succeededKeys
|
|
3092
|
+
}
|
|
3093
|
+
});
|
|
3094
|
+
};
|
|
3095
|
+
const exitAction = /* @__PURE__ */ import_react57.default.createElement(Action, {
|
|
3096
|
+
variant: "ghost",
|
|
3097
|
+
disabled,
|
|
3098
|
+
...onExit ? {
|
|
3099
|
+
onClick: () => onExit()
|
|
3100
|
+
} : {
|
|
3101
|
+
onClick: () => onDone?.(null)
|
|
3102
|
+
},
|
|
3103
|
+
"data-testid": "join-exit"
|
|
3104
|
+
}, t("cancel label"));
|
|
3105
|
+
return /* @__PURE__ */ import_react57.default.createElement(import_react57.default.Fragment, null, /* @__PURE__ */ import_react57.default.createElement("div", {
|
|
3106
|
+
role: "none",
|
|
3107
|
+
className: "grow flex flex-col justify-center"
|
|
3108
|
+
}, /* @__PURE__ */ import_react57.default.createElement(Input, {
|
|
3109
|
+
label: /* @__PURE__ */ import_react57.default.createElement(StepHeading, null, t("invitation input label")),
|
|
3110
|
+
// TODO(burdon): Translation.
|
|
3111
|
+
placeholder: "Type an invitation code",
|
|
3112
|
+
disabled,
|
|
3113
|
+
value: inputValue,
|
|
3114
|
+
onChange: ({ target: { value } }) => setInputValue(value),
|
|
3115
|
+
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
3116
|
+
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
3117
|
+
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
3118
|
+
})), /* @__PURE__ */ import_react57.default.createElement(Actions, null, Kind === "Halo" ? null : exitActionParent ? /* @__PURE__ */ (0, import_react57.cloneElement)(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ (0, import_react57.cloneElement)(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ import_react57.default.createElement(Action, {
|
|
3119
|
+
variant: "primary",
|
|
3120
|
+
disabled: disabled || inputValue.trim().length === 0,
|
|
3121
|
+
onClick: handleNext,
|
|
3122
|
+
"data-testid": `${Kind.toLowerCase()}-invitation-input-continue`
|
|
3123
|
+
}, t("continue label"))));
|
|
3124
|
+
};
|
|
3125
|
+
var InvitationActions = ({
|
|
3126
|
+
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
3127
|
+
// for the UI in particular.
|
|
3128
|
+
invitationState,
|
|
3129
|
+
onInvitationCancel,
|
|
3130
|
+
active,
|
|
3131
|
+
send,
|
|
3132
|
+
Kind,
|
|
3133
|
+
failReason
|
|
3134
|
+
}) => {
|
|
3135
|
+
const { t } = (0, import_react_ui29.useTranslation)("os");
|
|
3136
|
+
if (failReason) {
|
|
3137
|
+
return /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, /* @__PURE__ */ import_react58.default.createElement(StepHeading, {
|
|
3138
|
+
className: import_react_ui_theme28.descriptionText
|
|
3139
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ import_react58.default.createElement("div", {
|
|
3140
|
+
role: "none",
|
|
3141
|
+
className: "grow"
|
|
3142
|
+
}), /* @__PURE__ */ import_react58.default.createElement(Actions, null, /* @__PURE__ */ import_react58.default.createElement(Action, {
|
|
3143
|
+
disabled: !active,
|
|
3144
|
+
onClick: () => send({
|
|
3145
|
+
type: `reset${Kind}Invitation`
|
|
3146
|
+
}),
|
|
3147
|
+
"data-testid": "invitation-rescuer-reset"
|
|
3148
|
+
}, t("reset label"))));
|
|
3149
|
+
} else {
|
|
3150
|
+
return /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, /* @__PURE__ */ import_react58.default.createElement(StepHeading, {
|
|
3151
|
+
className: import_react_ui_theme28.descriptionText
|
|
3152
|
+
}, t("connecting status label")), /* @__PURE__ */ import_react58.default.createElement("div", {
|
|
3153
|
+
role: "none",
|
|
3154
|
+
className: "grow"
|
|
3155
|
+
}), /* @__PURE__ */ import_react58.default.createElement(Actions, null, /* @__PURE__ */ import_react58.default.createElement(Action, {
|
|
3156
|
+
disabled: true,
|
|
3157
|
+
classNames: "order-2",
|
|
3158
|
+
"data-testid": "next"
|
|
3159
|
+
}, t("next label")), /* @__PURE__ */ import_react58.default.createElement(Action, {
|
|
3160
|
+
disabled: !active,
|
|
3161
|
+
onClick: onInvitationCancel,
|
|
3162
|
+
"data-testid": "invitation-rescuer-cancel"
|
|
3163
|
+
}, t("cancel label"))));
|
|
3164
|
+
}
|
|
3165
|
+
};
|
|
3166
|
+
var InvitationRescuer = (props) => {
|
|
3167
|
+
const { Kind, invitationState, active, send } = props;
|
|
3168
|
+
const { t } = (0, import_react_ui29.useTranslation)("os");
|
|
3169
|
+
return /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ import_react58.default.createElement(import_react58.default.Fragment, null, /* @__PURE__ */ import_react58.default.createElement("div", {
|
|
3170
|
+
role: "none",
|
|
3171
|
+
className: "grow flex flex-col justify-center"
|
|
3172
|
+
}, /* @__PURE__ */ import_react58.default.createElement(StepHeading, {
|
|
3173
|
+
className: import_react_ui_theme28.descriptionText
|
|
3174
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ import_react58.default.createElement(Actions, null, /* @__PURE__ */ import_react58.default.createElement(Action, {
|
|
3175
|
+
disabled: !active,
|
|
3176
|
+
"data-testid": "invitation-rescuer-blank-reset",
|
|
3177
|
+
onClick: () => send({
|
|
3178
|
+
type: `reset${Kind}Invitation`
|
|
3179
|
+
})
|
|
3180
|
+
}, t("reset label")))) : /* @__PURE__ */ import_react58.default.createElement(InvitationActions, props));
|
|
3181
|
+
};
|
|
3182
|
+
var pinLength = 6;
|
|
3183
|
+
var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
3184
|
+
const disabled = !active || pending;
|
|
3185
|
+
const { t } = (0, import_react_ui30.useTranslation)("os");
|
|
3186
|
+
const invitationType = Kind.toLowerCase();
|
|
3187
|
+
const [authCode, setAuthCode] = (0, import_react59.useState)("");
|
|
3188
|
+
const onChange = ({ target: { value } }) => {
|
|
3189
|
+
setAuthCode(value);
|
|
3190
|
+
if (value.length === pinLength) {
|
|
3191
|
+
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
3192
|
+
}
|
|
3193
|
+
};
|
|
3194
|
+
return /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement("div", {
|
|
3195
|
+
role: "none",
|
|
3196
|
+
className: "grow flex flex-col justify-center gap-4"
|
|
3197
|
+
}, /* @__PURE__ */ import_react59.default.createElement(import_react_ui30.Input.Root, failed && {
|
|
3198
|
+
validationValence: "error"
|
|
3199
|
+
}, /* @__PURE__ */ import_react59.default.createElement(import_react_ui30.Input.Label, {
|
|
3200
|
+
asChild: true
|
|
3201
|
+
}, authMethod === import_invitations7.Invitation.AuthMethod.SHARED_SECRET ? /* @__PURE__ */ import_react59.default.createElement(StepHeading, null, t("auth code input label")) : /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement(StepHeading, {
|
|
3202
|
+
className: import_react_ui_theme29.descriptionText
|
|
3203
|
+
}, t("authenticating label")), /* @__PURE__ */ import_react59.default.createElement("div", {
|
|
3204
|
+
role: "none",
|
|
3205
|
+
className: "grow"
|
|
3206
|
+
}))), authMethod === import_invitations7.Invitation.AuthMethod.SHARED_SECRET && /* @__PURE__ */ import_react59.default.createElement(import_react_ui30.Input.PinInput, {
|
|
3207
|
+
disabled,
|
|
3208
|
+
length: pinLength,
|
|
3209
|
+
onChange,
|
|
3210
|
+
inputMode: "numeric",
|
|
3211
|
+
autoComplete: "off",
|
|
3212
|
+
pattern: "\\d*",
|
|
3213
|
+
"data-autofocus": `connecting${Kind}Invitation inputting${Kind}VerificationCode authenticationFailing${Kind}VerificationCode authenticating${Kind}VerificationCode`,
|
|
3214
|
+
"data-prevent-ios-autofocus": true,
|
|
3215
|
+
"data-testid": `${invitationType}-auth-code-input`,
|
|
3216
|
+
"data-1p-ignore": true
|
|
3217
|
+
}), failed && /* @__PURE__ */ import_react59.default.createElement(import_react_ui30.Input.DescriptionAndValidation, {
|
|
3218
|
+
classNames: "text-center"
|
|
3219
|
+
}, /* @__PURE__ */ import_react59.default.createElement(import_react_ui30.Input.Validation, null, t("failed to authenticate message")))), invitationId && authMethod === import_invitations7.Invitation.AuthMethod.SHARED_SECRET && /* @__PURE__ */ import_react59.default.createElement(import_react59.default.Fragment, null, /* @__PURE__ */ import_react59.default.createElement(Label, null, t("auth other device emoji message")), /* @__PURE__ */ import_react59.default.createElement("div", {
|
|
3220
|
+
className: "flex justify-center"
|
|
3221
|
+
}, /* @__PURE__ */ import_react59.default.createElement(Emoji, {
|
|
3222
|
+
text: (0, import_util9.hexToEmoji)(invitationId)
|
|
3223
|
+
})))), /* @__PURE__ */ import_react59.default.createElement(Actions, null, /* @__PURE__ */ import_react59.default.createElement(Action, {
|
|
3224
|
+
variant: "ghost",
|
|
3225
|
+
disabled,
|
|
3226
|
+
onClick: () => onInvitationCancel?.(),
|
|
3227
|
+
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
3228
|
+
}, t("cancel label")), /* @__PURE__ */ import_react59.default.createElement(Action, {
|
|
3229
|
+
variant: "primary",
|
|
3230
|
+
disabled,
|
|
3231
|
+
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
3232
|
+
"data-autofocus-pinlength": invitationType,
|
|
3233
|
+
"data-testid": `${invitationType}-invitation-authenticator-next`
|
|
3234
|
+
}, t("next label"))));
|
|
3235
|
+
};
|
|
3236
|
+
var stepStyles = "pbs-1 pbe-3 pli-3";
|
|
3237
|
+
var inactiveBgColor = "bg-neutral-100 dark:bg-neutral-600";
|
|
3238
|
+
var activeBgColor = "bg-primary-500 dark:bg-primary-400";
|
|
3239
|
+
var successBgColor = "bg-success-500 dark:bg-success-400";
|
|
3240
|
+
var errorBgColor = "bg-error-500 dark:bg-error-400";
|
|
3241
|
+
var cancelledBgColor = "bg-warning-500 dark:bg-warning-400";
|
|
3242
|
+
var inactiveTextColor = "text-neutral-100 dark:text-neutral-600";
|
|
3243
|
+
var activeTextColor = "text-primary-400 dark:text-primary-500";
|
|
3244
|
+
var successTextColor = "text-success-400 dark:text-success-500";
|
|
3245
|
+
var errorTextColor = "text-error-400 dark:text-error-500";
|
|
3246
|
+
var cancelledTextColor = "text-warning-400 dark:text-warning-500";
|
|
3247
|
+
var inactiveStrokeColor = "stroke-neutral-100 dark:stroke-neutral-700";
|
|
3248
|
+
var activeStrokeColor = "stroke-primary-400 dark:stroke-primary-150";
|
|
3249
|
+
var successStrokeColor = "stroke-success-300 dark:stroke-primary-400";
|
|
3250
|
+
var errorStrokeColor = "stroke-error-300 dark:stroke-error-500";
|
|
3251
|
+
var cancelledStrokeColor = "stroke-warning-300 dark:stroke-warning-500";
|
|
3252
|
+
var resolvedStrokeColor = (status) => status === import_invitations8.Invitation.State.ERROR ? errorStrokeColor : status === import_invitations8.Invitation.State.CANCELLED || status === import_invitations8.Invitation.State.TIMEOUT ? cancelledStrokeColor : successStrokeColor;
|
|
3253
|
+
var resolvedBgColor = (status) => status === import_invitations8.Invitation.State.ERROR ? errorBgColor : status === import_invitations8.Invitation.State.CANCELLED || status === import_invitations8.Invitation.State.TIMEOUT ? cancelledBgColor : successBgColor;
|
|
3254
|
+
var resolvedTextColor = (status) => status === import_invitations8.Invitation.State.ERROR ? errorTextColor : status === import_invitations8.Invitation.State.CANCELLED || status === import_invitations8.Invitation.State.TIMEOUT ? cancelledTextColor : successTextColor;
|
|
3255
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx";
|
|
3256
|
+
var JoinPanelImpl = (props) => {
|
|
3257
|
+
const {
|
|
3258
|
+
titleId,
|
|
3259
|
+
send,
|
|
3260
|
+
activeView,
|
|
3261
|
+
failed,
|
|
3262
|
+
mode,
|
|
3263
|
+
unredeemedCodes,
|
|
3264
|
+
invitationIds,
|
|
3265
|
+
invitationStates,
|
|
3266
|
+
invitationAuthMethods,
|
|
3267
|
+
succeededKeys,
|
|
3268
|
+
failReasons,
|
|
3269
|
+
onExit,
|
|
3270
|
+
onHaloDone,
|
|
3271
|
+
// onSpaceDone,
|
|
3272
|
+
exitActionParent,
|
|
3273
|
+
doneActionParent,
|
|
3274
|
+
onHaloInvitationCancel,
|
|
3275
|
+
onSpaceInvitationCancel,
|
|
3276
|
+
onHaloInvitationAuthenticate,
|
|
3277
|
+
onSpaceInvitationAuthenticate,
|
|
3278
|
+
onCancelResetStorage,
|
|
3279
|
+
onConfirmResetStorage,
|
|
3280
|
+
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
3281
|
+
ConfirmReset: ConfirmResetComponent = ConfirmReset
|
|
3282
|
+
} = props;
|
|
3283
|
+
return /* @__PURE__ */ import_react47.default.createElement(import_react47.default.Fragment, null, mode !== "halo-only" && /* @__PURE__ */ import_react47.default.createElement(JoinHeading, {
|
|
3284
|
+
titleId,
|
|
3285
|
+
mode,
|
|
3286
|
+
onExit,
|
|
3287
|
+
exitActionParent
|
|
3288
|
+
}), /* @__PURE__ */ import_react47.default.createElement(Viewport.Root, {
|
|
3289
|
+
focusManaged: true,
|
|
3290
|
+
activeView
|
|
3291
|
+
}, /* @__PURE__ */ import_react47.default.createElement(Viewport.Views, null, /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3292
|
+
classNames: stepStyles,
|
|
3293
|
+
id: "addition method chooser"
|
|
3294
|
+
}, /* @__PURE__ */ import_react47.default.createElement(AdditionMethodChooser, {
|
|
3295
|
+
send,
|
|
3296
|
+
active: activeView === "addition method chooser"
|
|
3297
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3298
|
+
classNames: stepStyles,
|
|
3299
|
+
id: "reset storage confirmation"
|
|
3300
|
+
}, /* @__PURE__ */ import_react47.default.createElement(ConfirmResetComponent, {
|
|
3301
|
+
send,
|
|
3302
|
+
active: activeView === "reset storage confirmation",
|
|
3303
|
+
onCancel: onCancelResetStorage,
|
|
3304
|
+
onConfirm: onConfirmResetStorage
|
|
3305
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3306
|
+
classNames: stepStyles,
|
|
3307
|
+
id: "create identity input"
|
|
3308
|
+
}, /* @__PURE__ */ import_react47.default.createElement(IdentityInputComponent, {
|
|
3309
|
+
send,
|
|
3310
|
+
method: "create identity",
|
|
3311
|
+
active: activeView === "create identity input"
|
|
3312
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3313
|
+
classNames: stepStyles,
|
|
3314
|
+
id: "recover identity input"
|
|
3315
|
+
}, /* @__PURE__ */ import_react47.default.createElement(IdentityInputComponent, {
|
|
3316
|
+
send,
|
|
3317
|
+
method: "recover identity",
|
|
3318
|
+
active: activeView === "recover identity input"
|
|
3319
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3320
|
+
classNames: stepStyles,
|
|
3321
|
+
id: "halo invitation input"
|
|
3322
|
+
}, /* @__PURE__ */ import_react47.default.createElement(InvitationInput, {
|
|
3323
|
+
send,
|
|
3324
|
+
Kind: "Halo",
|
|
3325
|
+
active: activeView === "halo invitation input",
|
|
3326
|
+
...unredeemedCodes?.Halo && {
|
|
3327
|
+
unredeemedCode: unredeemedCodes.Halo
|
|
3328
|
+
},
|
|
3329
|
+
...succeededKeys?.Halo && {
|
|
3330
|
+
succeededKeys: succeededKeys.Halo
|
|
3331
|
+
}
|
|
3332
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3333
|
+
classNames: stepStyles,
|
|
3334
|
+
id: "halo invitation rescuer"
|
|
3335
|
+
}, /* @__PURE__ */ import_react47.default.createElement(InvitationRescuer, {
|
|
3336
|
+
send,
|
|
3337
|
+
Kind: "Halo",
|
|
3338
|
+
active: activeView === "halo invitation rescuer",
|
|
3339
|
+
invitationState: invitationStates?.Halo,
|
|
3340
|
+
onInvitationCancel: onHaloInvitationCancel,
|
|
3341
|
+
failReason: failReasons?.Halo
|
|
3342
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3343
|
+
classNames: stepStyles,
|
|
3344
|
+
id: "halo invitation authenticator"
|
|
3345
|
+
}, /* @__PURE__ */ import_react47.default.createElement(InvitationAuthenticator, {
|
|
3346
|
+
send,
|
|
3347
|
+
Kind: "Halo",
|
|
3348
|
+
invitationId: invitationIds?.Halo,
|
|
3349
|
+
authMethod: invitationAuthMethods?.Halo,
|
|
3350
|
+
active: activeView === "halo invitation authenticator",
|
|
3351
|
+
onInvitationCancel: onHaloInvitationCancel,
|
|
3352
|
+
onInvitationAuthenticate: onHaloInvitationAuthenticate,
|
|
3353
|
+
...failed.has("Halo") && {
|
|
3354
|
+
failed: true
|
|
3355
|
+
}
|
|
3356
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3357
|
+
classNames: stepStyles,
|
|
3358
|
+
id: "identity added"
|
|
3359
|
+
}, /* @__PURE__ */ import_react47.default.createElement(IdentityAdded, {
|
|
3360
|
+
send,
|
|
3361
|
+
mode,
|
|
3362
|
+
active: activeView === "identity added",
|
|
3363
|
+
doneActionParent,
|
|
3364
|
+
onDone: onHaloDone
|
|
3365
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3366
|
+
classNames: stepStyles,
|
|
3367
|
+
id: "space invitation input"
|
|
3368
|
+
}, /* @__PURE__ */ import_react47.default.createElement(InvitationInput, {
|
|
3369
|
+
send,
|
|
3370
|
+
Kind: "Space",
|
|
3371
|
+
active: activeView === "space invitation input",
|
|
3372
|
+
...unredeemedCodes?.Space && {
|
|
3373
|
+
unredeemedCode: unredeemedCodes.Space
|
|
3374
|
+
},
|
|
3375
|
+
...succeededKeys?.Space && {
|
|
3376
|
+
succeededKeys: succeededKeys.Space
|
|
3377
|
+
},
|
|
3378
|
+
onExit,
|
|
3379
|
+
exitActionParent
|
|
3380
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3381
|
+
classNames: stepStyles,
|
|
3382
|
+
id: "space invitation rescuer"
|
|
3383
|
+
}, /* @__PURE__ */ import_react47.default.createElement(InvitationRescuer, {
|
|
3384
|
+
send,
|
|
3385
|
+
Kind: "Space",
|
|
3386
|
+
active: activeView === "space invitation rescuer",
|
|
3387
|
+
invitationState: invitationStates?.Space,
|
|
3388
|
+
onInvitationCancel: onSpaceInvitationCancel,
|
|
3389
|
+
failReason: failReasons?.Space
|
|
3390
|
+
})), /* @__PURE__ */ import_react47.default.createElement(Viewport.View, {
|
|
3391
|
+
classNames: stepStyles,
|
|
3392
|
+
id: "space invitation authenticator"
|
|
3393
|
+
}, /* @__PURE__ */ import_react47.default.createElement(InvitationAuthenticator, {
|
|
3394
|
+
send,
|
|
3395
|
+
Kind: "Space",
|
|
3396
|
+
invitationId: invitationIds?.Space,
|
|
3397
|
+
authMethod: invitationAuthMethods?.Space,
|
|
3398
|
+
active: activeView === "space invitation authenticator",
|
|
3399
|
+
onInvitationCancel: onSpaceInvitationCancel,
|
|
3400
|
+
onInvitationAuthenticate: onSpaceInvitationAuthenticate,
|
|
3401
|
+
...failed.has("Space") && {
|
|
3402
|
+
failed: true
|
|
3403
|
+
}
|
|
3404
|
+
})))));
|
|
3405
|
+
};
|
|
3406
|
+
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3407
|
+
const client = (0, import_react_client7.useClient)();
|
|
3408
|
+
const identity = (0, import_halo4.useIdentity)();
|
|
3409
|
+
const { hasIosKeyboard } = (0, import_react_ui22.useThemeContext)();
|
|
3410
|
+
const titleId = (0, import_react_ui22.useId)("joinPanel__heading", propsTitleId);
|
|
3411
|
+
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3412
|
+
context: {
|
|
3413
|
+
mode,
|
|
3414
|
+
initialDisposition,
|
|
3415
|
+
identity,
|
|
3416
|
+
...initialInvitationCode && {
|
|
3417
|
+
[mode === "halo-only" ? "halo" : "space"]: {
|
|
3418
|
+
unredeemedCode: initialInvitationCode
|
|
3419
|
+
}
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
});
|
|
3423
|
+
(0, import_react47.useEffect)(() => {
|
|
3424
|
+
const subscription = joinService.subscribe((state) => {
|
|
3425
|
+
(0, import_log7.log)("[state]", state, {
|
|
3426
|
+
F: __dxlog_file10,
|
|
3427
|
+
L: 210,
|
|
3428
|
+
S: void 0,
|
|
3429
|
+
C: (f, a) => f(...a)
|
|
3430
|
+
});
|
|
3431
|
+
});
|
|
3432
|
+
return subscription.unsubscribe;
|
|
3433
|
+
}, [
|
|
3434
|
+
joinService
|
|
3435
|
+
]);
|
|
3436
|
+
(0, import_react47.useEffect)(() => {
|
|
3437
|
+
const stateStack = joinState.configuration[0].id.split(".");
|
|
3438
|
+
const innermostState = stateStack[stateStack.length - 1];
|
|
3439
|
+
const autoFocusValue = innermostState === "finishingJoining" ? "successSpaceInvitation" : innermostState;
|
|
3440
|
+
const $nextAutofocus = document.querySelector(`[data-autofocus~="${autoFocusValue}"]`);
|
|
3441
|
+
if ($nextAutofocus && !(hasIosKeyboard && $nextAutofocus.hasAttribute("data-prevent-ios-autofocus"))) {
|
|
3442
|
+
$nextAutofocus.focus();
|
|
3443
|
+
}
|
|
3444
|
+
}, [
|
|
3445
|
+
joinState.value,
|
|
3446
|
+
hasIosKeyboard
|
|
3447
|
+
]);
|
|
3448
|
+
const activeView = (0, import_react47.useMemo)(() => {
|
|
3449
|
+
switch (true) {
|
|
3450
|
+
case joinState.matches({
|
|
3451
|
+
choosingIdentity: "choosingAuthMethod"
|
|
3452
|
+
}):
|
|
3453
|
+
return "addition method chooser";
|
|
3454
|
+
case joinState.matches("resettingIdentity"):
|
|
3455
|
+
return "reset storage confirmation";
|
|
3456
|
+
case joinState.matches({
|
|
3457
|
+
choosingIdentity: "creatingIdentity"
|
|
3458
|
+
}):
|
|
3459
|
+
return "create identity input";
|
|
3460
|
+
case joinState.matches({
|
|
3461
|
+
choosingIdentity: "recoveringIdentity"
|
|
3462
|
+
}):
|
|
3463
|
+
return "recover identity input";
|
|
3464
|
+
case joinState.matches({
|
|
3465
|
+
choosingIdentity: {
|
|
3466
|
+
acceptingHaloInvitation: "inputtingHaloInvitationCode"
|
|
3467
|
+
}
|
|
3468
|
+
}):
|
|
3469
|
+
return "halo invitation input";
|
|
3470
|
+
case [
|
|
3471
|
+
{
|
|
3472
|
+
choosingIdentity: {
|
|
3473
|
+
acceptingHaloInvitation: {
|
|
3474
|
+
acceptingRedeemedHaloInvitation: "connectingHaloInvitation"
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
},
|
|
3478
|
+
{
|
|
3479
|
+
choosingIdentity: {
|
|
3480
|
+
acceptingHaloInvitation: {
|
|
3481
|
+
acceptingRedeemedHaloInvitation: "failingHaloInvitation"
|
|
3482
|
+
}
|
|
3483
|
+
}
|
|
3484
|
+
}
|
|
3485
|
+
].some(joinState.matches):
|
|
3486
|
+
return "halo invitation rescuer";
|
|
3487
|
+
case [
|
|
3488
|
+
{
|
|
3489
|
+
choosingIdentity: {
|
|
3490
|
+
acceptingHaloInvitation: {
|
|
3491
|
+
acceptingRedeemedHaloInvitation: "inputtingHaloVerificationCode"
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
},
|
|
3495
|
+
{
|
|
3496
|
+
choosingIdentity: {
|
|
3497
|
+
acceptingHaloInvitation: {
|
|
3498
|
+
acceptingRedeemedHaloInvitation: "authenticatingHaloVerificationCode"
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
},
|
|
3502
|
+
{
|
|
3503
|
+
choosingIdentity: {
|
|
3504
|
+
acceptingHaloInvitation: {
|
|
3505
|
+
acceptingRedeemedHaloInvitation: "authenticationFailingHaloVerificationCode"
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
}
|
|
3509
|
+
].some(joinState.matches):
|
|
3510
|
+
return "halo invitation authenticator";
|
|
3511
|
+
case [
|
|
3512
|
+
{
|
|
3513
|
+
choosingIdentity: {
|
|
3514
|
+
acceptingHaloInvitation: {
|
|
3515
|
+
acceptingRedeemedHaloInvitation: "successHaloInvitation"
|
|
3516
|
+
}
|
|
3517
|
+
}
|
|
3518
|
+
},
|
|
3519
|
+
"finishingJoiningHalo"
|
|
3520
|
+
].some(joinState.matches):
|
|
3521
|
+
return "halo invitation accepted";
|
|
3522
|
+
case joinState.matches({
|
|
3523
|
+
choosingIdentity: "confirmingAddedIdentity"
|
|
3524
|
+
}):
|
|
3525
|
+
return "identity added";
|
|
3526
|
+
case joinState.matches({
|
|
3527
|
+
acceptingSpaceInvitation: "inputtingSpaceInvitationCode"
|
|
3528
|
+
}):
|
|
3529
|
+
return "space invitation input";
|
|
3530
|
+
case [
|
|
3531
|
+
{
|
|
3532
|
+
acceptingSpaceInvitation: {
|
|
3533
|
+
acceptingRedeemedSpaceInvitation: "connectingSpaceInvitation"
|
|
3534
|
+
}
|
|
3535
|
+
},
|
|
3536
|
+
{
|
|
3537
|
+
acceptingSpaceInvitation: {
|
|
3538
|
+
acceptingRedeemedSpaceInvitation: "failingSpaceInvitation"
|
|
3539
|
+
}
|
|
3540
|
+
}
|
|
3541
|
+
].some(joinState.matches):
|
|
3542
|
+
return "space invitation rescuer";
|
|
3543
|
+
case [
|
|
3544
|
+
{
|
|
3545
|
+
acceptingSpaceInvitation: {
|
|
3546
|
+
acceptingRedeemedSpaceInvitation: "inputtingSpaceVerificationCode"
|
|
3547
|
+
}
|
|
3548
|
+
},
|
|
3549
|
+
{
|
|
3550
|
+
acceptingSpaceInvitation: {
|
|
3551
|
+
acceptingRedeemedSpaceInvitation: "authenticatingSpaceVerificationCode"
|
|
3552
|
+
}
|
|
3553
|
+
},
|
|
3554
|
+
{
|
|
3555
|
+
acceptingSpaceInvitation: {
|
|
3556
|
+
acceptingRedeemedSpaceInvitation: "authenticationFailingSpaceVerificationCode"
|
|
3557
|
+
}
|
|
3558
|
+
}
|
|
3559
|
+
].some(joinState.matches):
|
|
3560
|
+
return "space invitation authenticator";
|
|
3561
|
+
case joinState.matches("finishingJoiningSpace"):
|
|
3562
|
+
return "space invitation accepted";
|
|
3563
|
+
default:
|
|
3564
|
+
return "never";
|
|
3565
|
+
}
|
|
3566
|
+
}, [
|
|
3567
|
+
joinState
|
|
3568
|
+
]);
|
|
3569
|
+
(0, import_react47.useEffect)(() => {
|
|
3570
|
+
switch (activeView) {
|
|
3571
|
+
case "halo invitation accepted":
|
|
3572
|
+
onHaloDone();
|
|
3573
|
+
break;
|
|
3574
|
+
case "space invitation accepted":
|
|
3575
|
+
onSpaceDone();
|
|
3576
|
+
break;
|
|
3577
|
+
}
|
|
3578
|
+
}, [
|
|
3579
|
+
activeView
|
|
3580
|
+
]);
|
|
3581
|
+
const failed = (0, import_react47.useMemo)(() => {
|
|
3582
|
+
const result = /* @__PURE__ */ new Set();
|
|
3583
|
+
switch (true) {
|
|
3584
|
+
case joinState.matches({
|
|
3585
|
+
choosingIdentity: {
|
|
3586
|
+
acceptingHaloInvitation: {
|
|
3587
|
+
acceptingRedeemedHaloInvitation: "authenticationFailingHaloVerificationCode"
|
|
3588
|
+
}
|
|
3589
|
+
}
|
|
3590
|
+
}):
|
|
3591
|
+
result.add("Halo");
|
|
3592
|
+
break;
|
|
3593
|
+
case joinState.matches({
|
|
3594
|
+
acceptingSpaceInvitation: {
|
|
3595
|
+
acceptingRedeemedSpaceInvitation: "authenticationFailingSpaceVerificationCode"
|
|
3596
|
+
}
|
|
3597
|
+
}):
|
|
3598
|
+
result.add("Space");
|
|
3599
|
+
break;
|
|
3600
|
+
}
|
|
3601
|
+
return result;
|
|
3602
|
+
}, [
|
|
3603
|
+
joinState
|
|
3604
|
+
]);
|
|
3605
|
+
const unredeemedCodes = (0, import_react47.useMemo)(() => ({
|
|
3606
|
+
Halo: joinState.context.halo.unredeemedCode,
|
|
3607
|
+
Space: joinState.context.space.unredeemedCode
|
|
3608
|
+
}), [
|
|
3609
|
+
joinState
|
|
3610
|
+
]);
|
|
3611
|
+
const spaces = (0, import_react_client7.useMulticastObservable)(client.spaces);
|
|
3612
|
+
const succeededKeys = (0, import_react47.useMemo)(() => ({
|
|
3613
|
+
Space: spaces ? new Set(spaces.map(({ key }) => key.toHex())) : void 0
|
|
3614
|
+
}), [
|
|
3615
|
+
spaces
|
|
3616
|
+
]);
|
|
3617
|
+
const invitationStates = (0, import_react47.useMemo)(() => ({
|
|
3618
|
+
Halo: joinState.context.halo.invitationObservable?.get().state,
|
|
3619
|
+
Space: joinState.context.space.invitationObservable?.get().state
|
|
3620
|
+
}), [
|
|
3621
|
+
joinState
|
|
3622
|
+
]);
|
|
3623
|
+
const invitationAuthMethods = (0, import_react47.useMemo)(() => ({
|
|
3624
|
+
Halo: joinState.context.halo.invitationObservable?.get().authMethod,
|
|
3625
|
+
Space: joinState.context.space.invitationObservable?.get().authMethod
|
|
3626
|
+
}), [
|
|
3627
|
+
joinState
|
|
3628
|
+
]);
|
|
3629
|
+
const invitationIds = (0, import_react47.useMemo)(() => ({
|
|
3630
|
+
Halo: joinState.context.halo.invitationObservable?.get().invitationId,
|
|
3631
|
+
Space: joinState.context.space.invitationObservable?.get().invitationId
|
|
3632
|
+
}), [
|
|
3633
|
+
joinState
|
|
3634
|
+
]);
|
|
3635
|
+
const failReasons = (0, import_react47.useMemo)(() => ({
|
|
3636
|
+
Halo: joinState.context.halo.failReason,
|
|
3637
|
+
Space: joinState.context.space.failReason
|
|
3638
|
+
}), [
|
|
3639
|
+
joinState
|
|
3640
|
+
]);
|
|
3641
|
+
const onHaloDone = (0, import_react47.useCallback)(() => {
|
|
3642
|
+
propsOnDone?.({
|
|
3643
|
+
identityKey: joinState.context.halo.invitation?.identityKey ?? null,
|
|
3644
|
+
swarmKey: joinState.context.halo.invitation?.swarmKey ?? null,
|
|
3645
|
+
spaceKey: joinState.context.halo.invitation?.spaceKey ?? null,
|
|
3646
|
+
target: joinState.context.halo.invitation?.target ?? null
|
|
3647
|
+
});
|
|
3648
|
+
}, [
|
|
3649
|
+
joinState,
|
|
3650
|
+
propsOnDone
|
|
3651
|
+
]);
|
|
3652
|
+
const onSpaceDone = (0, import_react47.useCallback)(() => {
|
|
3653
|
+
propsOnDone?.({
|
|
3654
|
+
identityKey: joinState.context.space.invitation?.identityKey ?? null,
|
|
3655
|
+
swarmKey: joinState.context.space.invitation?.swarmKey ?? null,
|
|
3656
|
+
spaceKey: joinState.context.space.invitation?.spaceKey ?? null,
|
|
3657
|
+
target: joinState.context.space.invitation?.target ?? null
|
|
3658
|
+
});
|
|
3659
|
+
}, [
|
|
3660
|
+
joinState,
|
|
3661
|
+
propsOnDone
|
|
3662
|
+
]);
|
|
3663
|
+
const onConfirmResetStorage = (0, import_react47.useCallback)(() => client.reset().then(() => {
|
|
3664
|
+
joinSend({
|
|
3665
|
+
type: "resetIdentity"
|
|
3666
|
+
});
|
|
3667
|
+
}), [
|
|
3668
|
+
client,
|
|
3669
|
+
joinSend
|
|
3670
|
+
]);
|
|
3671
|
+
return /* @__PURE__ */ import_react47.default.createElement(JoinPanelImpl, {
|
|
3672
|
+
titleId,
|
|
3673
|
+
mode,
|
|
3674
|
+
send: joinSend,
|
|
3675
|
+
activeView,
|
|
3676
|
+
failed,
|
|
3677
|
+
failReasons,
|
|
3678
|
+
pending: [
|
|
3679
|
+
"connecting",
|
|
3680
|
+
"authenticating"
|
|
3681
|
+
].some((str) => joinState?.configuration[0].id.includes(str)),
|
|
3682
|
+
unredeemedCodes,
|
|
3683
|
+
invitationIds,
|
|
3684
|
+
invitationStates,
|
|
3685
|
+
invitationAuthMethods,
|
|
3686
|
+
succeededKeys,
|
|
3687
|
+
identity,
|
|
3688
|
+
onExit,
|
|
3689
|
+
exitActionParent,
|
|
3690
|
+
doneActionParent,
|
|
3691
|
+
onHaloDone,
|
|
3692
|
+
onSpaceDone,
|
|
3693
|
+
onHaloInvitationCancel: () => joinState.context.halo.invitationObservable?.cancel(),
|
|
3694
|
+
onSpaceInvitationCancel: () => joinState.context.space.invitationObservable?.cancel(),
|
|
3695
|
+
onHaloInvitationAuthenticate: (authCode) => {
|
|
3696
|
+
joinSend({
|
|
3697
|
+
type: "authenticateHaloVerificationCode"
|
|
3698
|
+
});
|
|
3699
|
+
return joinState.context.halo.invitationObservable?.authenticate(authCode);
|
|
3700
|
+
},
|
|
3701
|
+
onSpaceInvitationAuthenticate: (authCode) => {
|
|
3702
|
+
joinSend({
|
|
3703
|
+
type: "authenticateSpaceVerificationCode"
|
|
3704
|
+
});
|
|
3705
|
+
return joinState.context.space.invitationObservable?.authenticate(authCode);
|
|
3706
|
+
},
|
|
3707
|
+
onConfirmResetStorage,
|
|
3708
|
+
onCancelResetStorage
|
|
3709
|
+
});
|
|
3710
|
+
};
|
|
3711
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts";
|
|
3712
|
+
var spaceMachine = (0, import_xstate3.createMachine)({
|
|
3713
|
+
id: "space",
|
|
3714
|
+
predictableActionArguments: true,
|
|
3715
|
+
context: {
|
|
3716
|
+
space: null
|
|
3717
|
+
},
|
|
3718
|
+
initial: "managingSpace",
|
|
3719
|
+
states: {
|
|
3720
|
+
managingSpace: {},
|
|
3721
|
+
managingSpaceInvitation: {}
|
|
3722
|
+
},
|
|
3723
|
+
on: {
|
|
3724
|
+
deselectInvitation: {
|
|
3725
|
+
target: ".managingSpace",
|
|
3726
|
+
actions: [
|
|
3727
|
+
"unsetInvitation",
|
|
3728
|
+
"log"
|
|
3729
|
+
]
|
|
3730
|
+
},
|
|
3731
|
+
selectInvitation: {
|
|
3732
|
+
target: ".managingSpaceInvitation",
|
|
3733
|
+
actions: [
|
|
3734
|
+
"setInvitation",
|
|
3735
|
+
"log"
|
|
3736
|
+
]
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
}, {
|
|
3740
|
+
actions: {
|
|
3741
|
+
setInvitation: (0, import_xstate3.assign)({
|
|
3742
|
+
invitation: (context, event) => event?.invitation ?? null
|
|
3743
|
+
}),
|
|
3744
|
+
unsetInvitation: (0, import_xstate3.assign)({
|
|
3745
|
+
invitation: () => void 0
|
|
3746
|
+
}),
|
|
3747
|
+
log: (context, event) => {
|
|
3748
|
+
(0, import_log12.log)("[transition]", {
|
|
3749
|
+
event,
|
|
3750
|
+
context
|
|
3751
|
+
}, {
|
|
3752
|
+
F: __dxlog_file11,
|
|
3753
|
+
L: 53,
|
|
3754
|
+
S: void 0,
|
|
3755
|
+
C: (f, a) => f(...a)
|
|
3756
|
+
});
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
});
|
|
3760
|
+
var useSpaceMachine = (options) => {
|
|
3761
|
+
return (0, import_react62.useMachine)(spaceMachine, {
|
|
3762
|
+
...options,
|
|
3763
|
+
context: {
|
|
3764
|
+
...options?.context
|
|
3765
|
+
}
|
|
3766
|
+
});
|
|
3767
|
+
};
|
|
3768
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3769
|
+
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3770
|
+
var handleInvitationEvent = (invitation, subscription) => {
|
|
3771
|
+
const invitationCode = import_invitations10.InvitationEncoder.encode(invitation);
|
|
3772
|
+
if (invitation.state === import_invitations10.Invitation.State.CONNECTING) {
|
|
3773
|
+
import_log13.log.info(JSON.stringify({
|
|
3774
|
+
invitationCode,
|
|
3775
|
+
authCode: invitation.authCode
|
|
3776
|
+
}), void 0, {
|
|
3777
|
+
F: __dxlog_file12,
|
|
3778
|
+
L: 40,
|
|
3779
|
+
S: void 0,
|
|
3780
|
+
C: (f, a) => f(...a)
|
|
3781
|
+
});
|
|
3782
|
+
subscription.unsubscribe();
|
|
3783
|
+
}
|
|
3784
|
+
};
|
|
3785
|
+
var SpaceManager = (props) => {
|
|
3786
|
+
const { space, target } = props;
|
|
3787
|
+
const { t } = (0, import_react_ui32.useTranslation)("os");
|
|
3788
|
+
const config = (0, import_react_client10.useConfig)();
|
|
3789
|
+
const invitations = (0, import_echo4.useSpaceInvitations)(space?.key);
|
|
3790
|
+
const inviteActions = {
|
|
3791
|
+
inviteOne: {
|
|
3792
|
+
label: t("invite one label"),
|
|
3793
|
+
description: t("invite one description"),
|
|
3794
|
+
icon: import_react63.UserPlus,
|
|
3795
|
+
onClick: (0, import_react64.useCallback)(() => {
|
|
3796
|
+
const invitation = space.share?.({
|
|
3797
|
+
type: import_invitations10.Invitation.Type.INTERACTIVE,
|
|
3798
|
+
authMethod: import_invitations10.Invitation.AuthMethod.SHARED_SECRET,
|
|
3799
|
+
multiUse: false,
|
|
3800
|
+
target
|
|
3801
|
+
});
|
|
3802
|
+
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
3803
|
+
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
3804
|
+
}
|
|
3805
|
+
}, [
|
|
3806
|
+
space
|
|
3807
|
+
])
|
|
3808
|
+
},
|
|
3809
|
+
inviteMany: {
|
|
3810
|
+
label: t("invite many label"),
|
|
3811
|
+
description: t("invite many description"),
|
|
3812
|
+
icon: import_react63.UsersThree,
|
|
3813
|
+
onClick: (0, import_react64.useCallback)(() => {
|
|
3814
|
+
const invitation = space.share?.({
|
|
3815
|
+
type: import_invitations10.Invitation.Type.DELEGATED,
|
|
3816
|
+
authMethod: import_invitations10.Invitation.AuthMethod.KNOWN_PUBLIC_KEY,
|
|
3817
|
+
multiUse: true,
|
|
3818
|
+
target
|
|
3819
|
+
});
|
|
3820
|
+
if (invitation && config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
3821
|
+
const subscription = invitation.subscribe((invitation2) => handleInvitationEvent(invitation2, subscription));
|
|
3822
|
+
}
|
|
3823
|
+
}, [
|
|
3824
|
+
space
|
|
3825
|
+
])
|
|
3826
|
+
}
|
|
3827
|
+
};
|
|
3828
|
+
return /* @__PURE__ */ import_react64.default.createElement(SpaceManagerImpl, {
|
|
3829
|
+
...props,
|
|
3830
|
+
invitations,
|
|
3831
|
+
inviteActions
|
|
3832
|
+
});
|
|
3833
|
+
};
|
|
3834
|
+
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3835
|
+
var SpaceManagerImpl = (props) => {
|
|
3836
|
+
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3837
|
+
const { t } = (0, import_react_ui32.useTranslation)("os");
|
|
3838
|
+
const inviteActions = propsInviteActions ?? {
|
|
3839
|
+
noopInvite: {
|
|
3840
|
+
label: t("create space invitation label"),
|
|
3841
|
+
description: "",
|
|
3842
|
+
icon: import_react63.Placeholder,
|
|
3843
|
+
onClick: () => {
|
|
3844
|
+
}
|
|
3845
|
+
}
|
|
3846
|
+
};
|
|
3847
|
+
const [activeAction, setInternalActiveAction] = (0, import_react64.useState)(localStorage.getItem(activeActionKey) ?? "inviteOne");
|
|
3848
|
+
const setActiveAction = (nextAction) => {
|
|
3849
|
+
setInternalActiveAction(nextAction);
|
|
3850
|
+
localStorage.setItem(activeActionKey, nextAction);
|
|
3851
|
+
};
|
|
3852
|
+
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3853
|
+
import_invitations10.Invitation.State.CANCELLED
|
|
3854
|
+
].includes(invitation.get().state));
|
|
3855
|
+
return /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement(import_react_ui32.ScrollArea.Root, {
|
|
3856
|
+
classNames: "grow shrink basis-28 -mli-2"
|
|
3857
|
+
}, /* @__PURE__ */ import_react64.default.createElement(import_react_ui32.ScrollArea.Viewport, {
|
|
3858
|
+
classNames: "is-full pie-2"
|
|
3859
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ import_react64.default.createElement(import_react64.default.Fragment, null, /* @__PURE__ */ import_react64.default.createElement("h3", {
|
|
3860
|
+
className: (0, import_react_ui_theme30.mx)(headingFragment, import_react_ui_theme30.descriptionText)
|
|
3861
|
+
}, t("invitation list heading")), /* @__PURE__ */ import_react64.default.createElement(InvitationListComponent, {
|
|
3862
|
+
className: "mb-2",
|
|
3863
|
+
send,
|
|
3864
|
+
invitations: visibleInvitations ?? [],
|
|
3865
|
+
onClickRemove: (invitation) => invitation.cancel(),
|
|
3866
|
+
createInvitationUrl
|
|
3867
|
+
}), /* @__PURE__ */ import_react64.default.createElement("h3", {
|
|
3868
|
+
className: (0, import_react_ui_theme30.mx)(headingFragment, import_react_ui_theme30.descriptionText, "mbs-2")
|
|
3869
|
+
}, t("space member list heading"))), /* @__PURE__ */ import_react64.default.createElement(SpaceMemberListComponent, {
|
|
3870
|
+
spaceKey: space.key,
|
|
3871
|
+
includeSelf: true
|
|
3872
|
+
})), /* @__PURE__ */ import_react64.default.createElement(import_react_ui32.ScrollArea.Scrollbar, {
|
|
3873
|
+
orientation: "vertical"
|
|
3874
|
+
}, /* @__PURE__ */ import_react64.default.createElement(import_react_ui32.ScrollArea.Thumb, null))), /* @__PURE__ */ import_react64.default.createElement(Actions, null, /* @__PURE__ */ import_react64.default.createElement(BifurcatedAction, {
|
|
3875
|
+
disabled: !active,
|
|
3876
|
+
actions: inviteActions,
|
|
3877
|
+
activeAction,
|
|
3878
|
+
onChangeActiveAction: setActiveAction,
|
|
3879
|
+
"data-testid": "spaces-panel.create-invitation"
|
|
3880
|
+
})));
|
|
3881
|
+
};
|
|
3882
|
+
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3883
|
+
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3884
|
+
const { t } = (0, import_react_ui31.useTranslation)("os");
|
|
3885
|
+
const name = space.properties.name;
|
|
3886
|
+
return /* @__PURE__ */ import_react61.default.createElement(Heading, {
|
|
3887
|
+
titleId,
|
|
3888
|
+
title: t("space panel heading"),
|
|
3889
|
+
corner: /* @__PURE__ */ import_react61.default.createElement(CloseButton, {
|
|
3890
|
+
"data-testid": "identity-panel-done",
|
|
3891
|
+
onDone
|
|
3892
|
+
})
|
|
3893
|
+
}, /* @__PURE__ */ import_react61.default.createElement("div", {
|
|
3894
|
+
role: "none",
|
|
3895
|
+
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3896
|
+
}, /* @__PURE__ */ import_react61.default.createElement(import_react60.Planet, {
|
|
3897
|
+
size: 32,
|
|
3898
|
+
weight: "light"
|
|
3899
|
+
}), /* @__PURE__ */ import_react61.default.createElement("div", {
|
|
3900
|
+
className: "block text-start font-light text-xl"
|
|
3901
|
+
}, name ?? space.key.truncate())));
|
|
3902
|
+
};
|
|
3903
|
+
var SpacePanelImpl = (props) => {
|
|
3904
|
+
const { titleId, activeView, space, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3905
|
+
return /* @__PURE__ */ import_react61.default.createElement(import_react61.default.Fragment, null, /* @__PURE__ */ import_react61.default.createElement(SpacePanelHeading, {
|
|
3906
|
+
...rest,
|
|
3907
|
+
titleId,
|
|
3908
|
+
space
|
|
3909
|
+
}), /* @__PURE__ */ import_react61.default.createElement(Viewport.Root, {
|
|
3910
|
+
activeView
|
|
3911
|
+
}, /* @__PURE__ */ import_react61.default.createElement(Viewport.Views, null, /* @__PURE__ */ import_react61.default.createElement(Viewport.View, {
|
|
3912
|
+
id: "space manager",
|
|
3913
|
+
classNames: stepStyles
|
|
3914
|
+
}, /* @__PURE__ */ import_react61.default.createElement(SpaceManagerComponent, {
|
|
3915
|
+
active: activeView === "space manager",
|
|
3916
|
+
space,
|
|
3917
|
+
target,
|
|
3918
|
+
...rest
|
|
3919
|
+
})), /* @__PURE__ */ import_react61.default.createElement(Viewport.View, {
|
|
3920
|
+
id: "space invitation manager",
|
|
3921
|
+
classNames: stepStyles
|
|
3922
|
+
}, /* @__PURE__ */ import_react61.default.createElement(InvitationManagerComponent, {
|
|
3923
|
+
active: activeView === "space invitation manager",
|
|
3924
|
+
...rest,
|
|
3925
|
+
invitationUrl: props.invitationUrl
|
|
3926
|
+
})))));
|
|
3927
|
+
};
|
|
3928
|
+
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3929
|
+
const invitationStatus = (0, import_invitations9.useInvitationStatus)(invitation);
|
|
3930
|
+
return /* @__PURE__ */ import_react61.default.createElement(SpacePanelImpl, {
|
|
3931
|
+
...props,
|
|
3932
|
+
...invitationStatus,
|
|
3933
|
+
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
3934
|
+
});
|
|
3935
|
+
};
|
|
3936
|
+
var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code, ...props }) => {
|
|
3937
|
+
const titleId = (0, import_react_ui31.useId)("spacePanel__heading", propsTitleId);
|
|
3938
|
+
const [spaceState, spaceSend, spaceService] = useSpaceMachine({
|
|
3939
|
+
context: {
|
|
3940
|
+
space: props.space
|
|
3941
|
+
}
|
|
3942
|
+
});
|
|
3943
|
+
(0, import_react61.useEffect)(() => {
|
|
3944
|
+
const subscription = spaceService.subscribe((state) => {
|
|
3945
|
+
(0, import_log11.log)("[state]", state, {
|
|
3946
|
+
F: __dxlog_file13,
|
|
3947
|
+
L: 94,
|
|
3948
|
+
S: void 0,
|
|
3949
|
+
C: (f, a) => f(...a)
|
|
3950
|
+
});
|
|
3951
|
+
});
|
|
3952
|
+
return subscription.unsubscribe;
|
|
3953
|
+
}, [
|
|
3954
|
+
spaceService
|
|
3955
|
+
]);
|
|
3956
|
+
const activeView = (0, import_react61.useMemo)(() => {
|
|
3957
|
+
switch (true) {
|
|
3958
|
+
case spaceState.matches("managingSpace"):
|
|
3959
|
+
return "space manager";
|
|
3960
|
+
case spaceState.matches("managingSpaceInvitation"):
|
|
3961
|
+
return "space invitation manager";
|
|
3962
|
+
default:
|
|
3963
|
+
return "never";
|
|
3964
|
+
}
|
|
3965
|
+
}, [
|
|
3966
|
+
spaceState
|
|
3967
|
+
]);
|
|
3968
|
+
const implProps = {
|
|
3969
|
+
...props,
|
|
3970
|
+
activeView,
|
|
3971
|
+
send: spaceSend,
|
|
3972
|
+
titleId,
|
|
3973
|
+
createInvitationUrl
|
|
3974
|
+
};
|
|
3975
|
+
return spaceState.context.invitation ? (
|
|
3976
|
+
// TODO(wittjosiah): Unused? Remove?
|
|
3977
|
+
/* @__PURE__ */ import_react61.default.createElement(SpacePanelWithInvitationImpl, {
|
|
3978
|
+
...implProps,
|
|
3979
|
+
invitation: spaceState.context.invitation
|
|
3980
|
+
})
|
|
3981
|
+
) : /* @__PURE__ */ import_react61.default.createElement(SpacePanelImpl, implProps);
|
|
3982
|
+
};
|
|
3983
|
+
var StatusPanel = ({ titleId }) => {
|
|
3984
|
+
const { t } = (0, import_react_ui33.useTranslation)("os");
|
|
3985
|
+
return /* @__PURE__ */ import_react65.default.createElement("div", {
|
|
3986
|
+
className: "grid place-items-center p-2 gap-2"
|
|
3987
|
+
}, /* @__PURE__ */ import_react65.default.createElement("p", {
|
|
3988
|
+
id: titleId,
|
|
3989
|
+
className: "font-medium text-center"
|
|
3990
|
+
}, t("resetting message")), /* @__PURE__ */ import_react65.default.createElement(import_react_ui33.Status, {
|
|
3991
|
+
indeterminate: true
|
|
3992
|
+
}, t("resetting message")));
|
|
3993
|
+
};
|
|
3994
|
+
var IdentityDialog = (props) => {
|
|
3995
|
+
const titleId = (0, import_react_ui17.useId)("identityDialog__title", props.title);
|
|
3996
|
+
return /* @__PURE__ */ import_react35.default.createElement(import_react_ui17.Dialog.Root, {
|
|
3997
|
+
defaultOpen: true,
|
|
3998
|
+
onOpenChange: (open) => open || props.onDone?.()
|
|
3999
|
+
}, /* @__PURE__ */ import_react35.default.createElement(import_react_ui17.Dialog.Portal, null, /* @__PURE__ */ import_react35.default.createElement(import_react_ui17.Dialog.Overlay, null, /* @__PURE__ */ import_react35.default.createElement(import_react_ui17.Dialog.Content, {
|
|
4000
|
+
"aria-labelledby": titleId,
|
|
4001
|
+
onOpenAutoFocus: (e) => e.preventDefault()
|
|
4002
|
+
}, /* @__PURE__ */ import_react35.default.createElement(ClipboardProvider, null, /* @__PURE__ */ import_react35.default.createElement(IdentityPanel, {
|
|
4003
|
+
...props,
|
|
4004
|
+
titleId,
|
|
4005
|
+
doneActionParent: /* @__PURE__ */ import_react35.default.createElement(import_react_ui17.Dialog.Close, {
|
|
4006
|
+
asChild: true
|
|
4007
|
+
})
|
|
4008
|
+
}))))));
|
|
4009
|
+
};
|
|
4010
|
+
var JoinDialog = (joinPanelProps) => {
|
|
4011
|
+
const titleId = (0, import_react_ui34.useId)("joinDialog__title");
|
|
4012
|
+
const { height } = (0, import_react_ui34.useVisualViewport)();
|
|
4013
|
+
return /* @__PURE__ */ import_react66.default.createElement(import_react_ui34.AlertDialog.Root, {
|
|
4014
|
+
defaultOpen: true,
|
|
4015
|
+
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
4016
|
+
}, /* @__PURE__ */ import_react66.default.createElement(import_react_ui34.AlertDialog.Portal, null, /* @__PURE__ */ import_react66.default.createElement(import_react_ui34.AlertDialog.Overlay, {
|
|
4017
|
+
classNames: "backdrop-blur",
|
|
4018
|
+
...height && {
|
|
4019
|
+
style: {
|
|
4020
|
+
blockSize: `${height}px`
|
|
4021
|
+
}
|
|
4022
|
+
}
|
|
4023
|
+
}, /* @__PURE__ */ import_react66.default.createElement(import_react_ui34.AlertDialog.Content, {
|
|
4024
|
+
"aria-labelledby": titleId
|
|
4025
|
+
}, /* @__PURE__ */ import_react66.default.createElement(JoinPanel, {
|
|
4026
|
+
...joinPanelProps,
|
|
4027
|
+
titleId,
|
|
4028
|
+
exitActionParent: /* @__PURE__ */ import_react66.default.createElement(import_react_ui34.AlertDialog.Cancel, {
|
|
4029
|
+
asChild: true
|
|
4030
|
+
}),
|
|
4031
|
+
doneActionParent: /* @__PURE__ */ import_react66.default.createElement(import_react_ui34.AlertDialog.Action, {
|
|
4032
|
+
asChild: true
|
|
4033
|
+
})
|
|
4034
|
+
})))));
|
|
4035
|
+
};
|
|
4036
|
+
var SpaceDialog = (spacePanelProps) => {
|
|
4037
|
+
const titleId = (0, import_react_ui36.useId)("spaceDialog__title");
|
|
4038
|
+
return /* @__PURE__ */ import_react69.default.createElement(import_react_ui36.Dialog.Root, {
|
|
4039
|
+
defaultOpen: true,
|
|
4040
|
+
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
4041
|
+
}, /* @__PURE__ */ import_react69.default.createElement(import_react_ui36.Dialog.Portal, null, /* @__PURE__ */ import_react69.default.createElement(import_react_ui36.Dialog.Overlay, null, /* @__PURE__ */ import_react69.default.createElement(import_react_ui36.Dialog.Content, {
|
|
4042
|
+
"aria-labelledby": titleId
|
|
4043
|
+
}, /* @__PURE__ */ import_react69.default.createElement(ClipboardProvider, null, /* @__PURE__ */ import_react69.default.createElement(SpacePanel, {
|
|
4044
|
+
...spacePanelProps,
|
|
4045
|
+
titleId,
|
|
4046
|
+
doneActionParent: /* @__PURE__ */ import_react69.default.createElement(import_react_ui36.Dialog.Close, {
|
|
4047
|
+
asChild: true
|
|
4048
|
+
})
|
|
4049
|
+
}))))));
|
|
4050
|
+
};
|
|
4051
|
+
var StatusDialog = () => {
|
|
4052
|
+
const titleId = (0, import_react_ui37.useId)("statusDialog__title");
|
|
4053
|
+
return /* @__PURE__ */ import_react70.default.createElement(import_react_ui37.AlertDialog.Root, {
|
|
4054
|
+
open: true
|
|
4055
|
+
}, /* @__PURE__ */ import_react70.default.createElement(import_react_ui37.AlertDialog.Portal, null, /* @__PURE__ */ import_react70.default.createElement(import_react_ui37.AlertDialog.Overlay, null, /* @__PURE__ */ import_react70.default.createElement(import_react_ui37.AlertDialog.Content, {
|
|
4056
|
+
"aria-labelledby": titleId
|
|
4057
|
+
}, /* @__PURE__ */ import_react70.default.createElement(StatusPanel, {
|
|
4058
|
+
titleId
|
|
4059
|
+
})))));
|
|
4060
|
+
};
|
|
4061
|
+
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
4062
|
+
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
4063
|
+
var Shell = ({ runtime }) => {
|
|
4064
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = (0, import_react68.useState)({
|
|
4065
|
+
layout: runtime.layout,
|
|
4066
|
+
invitationCode: runtime.invitationCode,
|
|
4067
|
+
spaceKey: runtime.spaceKey,
|
|
4068
|
+
spaceId: runtime.spaceId,
|
|
4069
|
+
target: runtime.target
|
|
4070
|
+
});
|
|
4071
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = (0, import_react68.useState)({
|
|
4072
|
+
invitationUrl: runtime.invitationUrl,
|
|
4073
|
+
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
4074
|
+
spaceInvitationParam: runtime.spaceInvitationParam
|
|
4075
|
+
});
|
|
4076
|
+
const client = (0, import_react_client12.useClient)();
|
|
4077
|
+
const space = (0, import_echo5.useSpace)(spaceId ?? spaceKey);
|
|
4078
|
+
const createDeviceInvitationUrl = (invitationCode2) => {
|
|
4079
|
+
const baseUrl = new URL(invitationUrl);
|
|
4080
|
+
baseUrl.searchParams.set(deviceInvitationParam, invitationCode2);
|
|
4081
|
+
return baseUrl.toString();
|
|
4082
|
+
};
|
|
4083
|
+
const createSpaceInvitationUrl = (invitationCode2) => {
|
|
4084
|
+
const baseUrl = new URL(invitationUrl);
|
|
4085
|
+
baseUrl.searchParams.set(spaceInvitationParam, invitationCode2);
|
|
4086
|
+
return baseUrl.toString();
|
|
4087
|
+
};
|
|
4088
|
+
(0, import_react68.useEffect)(() => {
|
|
4089
|
+
const unsubscribeLayout = runtime.layoutUpdate.on((request) => setLayout(request));
|
|
4090
|
+
const unsubscribeInvitationUrl = runtime.invitationUrlUpdate.on((request) => setInvitationUrl(request));
|
|
4091
|
+
return () => {
|
|
4092
|
+
unsubscribeLayout();
|
|
4093
|
+
unsubscribeInvitationUrl();
|
|
4094
|
+
};
|
|
4095
|
+
}, [
|
|
4096
|
+
runtime
|
|
4097
|
+
]);
|
|
4098
|
+
(0, import_react68.useEffect)(() => {
|
|
4099
|
+
if (layout === import_react_client13.ShellLayout.SPACE && !space) {
|
|
4100
|
+
import_log14.log.warn("No space found for shell space invitations.", void 0, {
|
|
4101
|
+
F: __dxlog_file14,
|
|
4102
|
+
L: 67,
|
|
4103
|
+
S: void 0,
|
|
4104
|
+
C: (f, a) => f(...a)
|
|
4105
|
+
});
|
|
4106
|
+
const timeout = setTimeout(async () => {
|
|
4107
|
+
await runtime.setAppContext({
|
|
4108
|
+
display: import_react_client13.ShellDisplay.NONE
|
|
4109
|
+
});
|
|
4110
|
+
runtime.setLayout({
|
|
4111
|
+
layout: import_react_client13.ShellLayout.DEFAULT
|
|
4112
|
+
});
|
|
4113
|
+
});
|
|
4114
|
+
return () => clearTimeout(timeout);
|
|
4115
|
+
}
|
|
4116
|
+
}, [
|
|
4117
|
+
runtime,
|
|
4118
|
+
layout,
|
|
4119
|
+
space
|
|
4120
|
+
]);
|
|
4121
|
+
switch (layout) {
|
|
4122
|
+
case import_react_client13.ShellLayout.STATUS:
|
|
4123
|
+
return /* @__PURE__ */ import_react68.default.createElement(StatusDialog, null);
|
|
4124
|
+
case import_react_client13.ShellLayout.INITIALIZE_IDENTITY:
|
|
4125
|
+
case import_react_client13.ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
4126
|
+
case import_react_client13.ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY:
|
|
4127
|
+
return /* @__PURE__ */ import_react68.default.createElement(JoinDialog, {
|
|
4128
|
+
mode: "halo-only",
|
|
4129
|
+
initialDisposition: layout === import_react_client13.ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY ? "recover-identity" : layout === import_react_client13.ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
4130
|
+
initialInvitationCode: invitationCode,
|
|
4131
|
+
onCancelResetStorage: () => runtime.setLayout({
|
|
4132
|
+
layout: import_react_client13.ShellLayout.IDENTITY
|
|
4133
|
+
}),
|
|
4134
|
+
onDone: async () => {
|
|
4135
|
+
blurActiveElement();
|
|
4136
|
+
await runtime.setAppContext({
|
|
4137
|
+
display: import_react_client13.ShellDisplay.NONE
|
|
4138
|
+
});
|
|
4139
|
+
runtime.setLayout({
|
|
4140
|
+
layout: import_react_client13.ShellLayout.DEFAULT
|
|
4141
|
+
});
|
|
4142
|
+
}
|
|
4143
|
+
});
|
|
4144
|
+
case import_react_client13.ShellLayout.IDENTITY:
|
|
4145
|
+
case import_react_client13.ShellLayout.SHARE_IDENTITY:
|
|
4146
|
+
case import_react_client13.ShellLayout.EDIT_PROFILE:
|
|
4147
|
+
return /* @__PURE__ */ import_react68.default.createElement(IdentityDialog, {
|
|
4148
|
+
createInvitationUrl: createDeviceInvitationUrl,
|
|
4149
|
+
onResetStorage: async () => {
|
|
4150
|
+
runtime.setLayout({
|
|
4151
|
+
layout: import_react_client13.ShellLayout.STATUS
|
|
4152
|
+
});
|
|
4153
|
+
await client.reset();
|
|
4154
|
+
return runtime.setAppContext({
|
|
4155
|
+
display: import_react_client13.ShellDisplay.NONE,
|
|
4156
|
+
reset: true
|
|
4157
|
+
});
|
|
4158
|
+
},
|
|
4159
|
+
onRecover: async () => {
|
|
4160
|
+
runtime.setLayout({
|
|
4161
|
+
layout: import_react_client13.ShellLayout.STATUS
|
|
4162
|
+
});
|
|
4163
|
+
await client.reset();
|
|
4164
|
+
return runtime.setAppContext({
|
|
4165
|
+
display: import_react_client13.ShellDisplay.NONE,
|
|
4166
|
+
reset: true,
|
|
4167
|
+
target: "recoverIdentity"
|
|
4168
|
+
});
|
|
4169
|
+
},
|
|
4170
|
+
onJoinNewIdentity: async () => {
|
|
4171
|
+
runtime.setLayout({
|
|
4172
|
+
layout: import_react_client13.ShellLayout.STATUS
|
|
4173
|
+
});
|
|
4174
|
+
await client.reset();
|
|
4175
|
+
return runtime.setAppContext({
|
|
4176
|
+
display: import_react_client13.ShellDisplay.NONE,
|
|
4177
|
+
reset: true,
|
|
4178
|
+
target: "deviceInvitation"
|
|
4179
|
+
});
|
|
4180
|
+
},
|
|
4181
|
+
onDone: async () => {
|
|
4182
|
+
blurActiveElement();
|
|
4183
|
+
await runtime.setAppContext({
|
|
4184
|
+
display: import_react_client13.ShellDisplay.NONE
|
|
4185
|
+
});
|
|
4186
|
+
runtime.setLayout({
|
|
4187
|
+
layout: import_react_client13.ShellLayout.DEFAULT
|
|
4188
|
+
});
|
|
4189
|
+
},
|
|
4190
|
+
initialDisposition: layout === import_react_client13.ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : "default"
|
|
4191
|
+
});
|
|
4192
|
+
case import_react_client13.ShellLayout.SPACE:
|
|
4193
|
+
return space ? /* @__PURE__ */ import_react68.default.createElement(SpaceDialog, {
|
|
4194
|
+
space,
|
|
4195
|
+
target,
|
|
4196
|
+
createInvitationUrl: createSpaceInvitationUrl,
|
|
4197
|
+
onDone: async () => {
|
|
4198
|
+
blurActiveElement();
|
|
4199
|
+
await runtime.setAppContext({
|
|
4200
|
+
display: import_react_client13.ShellDisplay.NONE
|
|
4201
|
+
});
|
|
4202
|
+
runtime.setLayout({
|
|
4203
|
+
layout: import_react_client13.ShellLayout.DEFAULT
|
|
4204
|
+
});
|
|
4205
|
+
}
|
|
4206
|
+
}) : null;
|
|
4207
|
+
case import_react_client13.ShellLayout.JOIN_SPACE:
|
|
4208
|
+
return /* @__PURE__ */ import_react68.default.createElement(JoinDialog, {
|
|
4209
|
+
initialInvitationCode: invitationCode,
|
|
4210
|
+
onDone: async (result) => {
|
|
4211
|
+
blurActiveElement();
|
|
4212
|
+
const target2 = result?.target ?? void 0;
|
|
4213
|
+
await runtime.setAppContext({
|
|
4214
|
+
display: import_react_client13.ShellDisplay.NONE,
|
|
4215
|
+
spaceKey: result?.spaceKey ?? void 0,
|
|
4216
|
+
target: target2
|
|
4217
|
+
});
|
|
4218
|
+
runtime.setLayout({
|
|
4219
|
+
layout: import_react_client13.ShellLayout.DEFAULT
|
|
4220
|
+
});
|
|
4221
|
+
},
|
|
4222
|
+
onExit: async () => {
|
|
4223
|
+
blurActiveElement();
|
|
4224
|
+
await runtime.setAppContext({
|
|
4225
|
+
display: import_react_client13.ShellDisplay.NONE
|
|
4226
|
+
});
|
|
4227
|
+
runtime.setLayout({
|
|
4228
|
+
layout: import_react_client13.ShellLayout.DEFAULT
|
|
4229
|
+
});
|
|
4230
|
+
}
|
|
4231
|
+
});
|
|
4232
|
+
default:
|
|
4233
|
+
return null;
|
|
4234
|
+
}
|
|
4235
|
+
};
|
|
4236
|
+
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
|
|
4237
|
+
var ShellRuntimeImpl = class {
|
|
4238
|
+
constructor(_port) {
|
|
4239
|
+
this._port = _port;
|
|
4240
|
+
this.layoutUpdate = new import_async.Event();
|
|
4241
|
+
this.invitationUrlUpdate = new import_async.Event();
|
|
4242
|
+
this._layout = import_iframe.ShellLayout.DEFAULT;
|
|
4243
|
+
this._invitationUrl = typeof window !== "undefined" ? window.location.origin : void 0;
|
|
4244
|
+
this._deviceInvitationParam = "deviceInvitationCode";
|
|
4245
|
+
this._spaceInvitationParam = "spaceInvitationCode";
|
|
4246
|
+
}
|
|
4247
|
+
get layout() {
|
|
4248
|
+
return this._layout;
|
|
4249
|
+
}
|
|
4250
|
+
get invitationCode() {
|
|
4251
|
+
return this._invitationCode;
|
|
4252
|
+
}
|
|
4253
|
+
/** @deprecated Use spaceId. */
|
|
4254
|
+
get spaceKey() {
|
|
4255
|
+
return this._spaceKey;
|
|
4256
|
+
}
|
|
4257
|
+
get spaceId() {
|
|
4258
|
+
return this._spaceId;
|
|
4259
|
+
}
|
|
4260
|
+
get invitationUrl() {
|
|
4261
|
+
return this._invitationUrl;
|
|
4262
|
+
}
|
|
4263
|
+
get deviceInvitationParam() {
|
|
4264
|
+
return this._deviceInvitationParam;
|
|
4265
|
+
}
|
|
4266
|
+
get spaceInvitationParam() {
|
|
4267
|
+
return this._spaceInvitationParam;
|
|
4268
|
+
}
|
|
4269
|
+
setLayout({ layout, invitationCode, spaceKey, spaceId }) {
|
|
4270
|
+
this._layout = layout;
|
|
4271
|
+
this._invitationCode = invitationCode;
|
|
4272
|
+
this._spaceKey = spaceKey;
|
|
4273
|
+
this._spaceId = spaceId;
|
|
4274
|
+
this.layoutUpdate.emit({
|
|
4275
|
+
layout,
|
|
4276
|
+
invitationCode,
|
|
4277
|
+
spaceKey,
|
|
4278
|
+
spaceId
|
|
4279
|
+
});
|
|
4280
|
+
}
|
|
4281
|
+
setInvitationUrl({ invitationUrl, deviceInvitationParam, spaceInvitationParam }) {
|
|
4282
|
+
this._invitationUrl = invitationUrl;
|
|
4283
|
+
this._deviceInvitationParam = deviceInvitationParam;
|
|
4284
|
+
this._spaceInvitationParam = spaceInvitationParam;
|
|
4285
|
+
this.invitationUrlUpdate.emit({
|
|
4286
|
+
invitationUrl,
|
|
4287
|
+
deviceInvitationParam,
|
|
4288
|
+
spaceInvitationParam
|
|
4289
|
+
});
|
|
4290
|
+
}
|
|
4291
|
+
async setAppContext(context) {
|
|
4292
|
+
(0, import_invariant4.invariant)(this._appRpc, "runtime not open", {
|
|
4293
|
+
F: __dxlog_file15,
|
|
4294
|
+
L: 83,
|
|
4295
|
+
S: this,
|
|
4296
|
+
A: [
|
|
4297
|
+
"this._appRpc",
|
|
4298
|
+
"'runtime not open'"
|
|
4299
|
+
]
|
|
4300
|
+
});
|
|
4301
|
+
await this._appRpc.rpc.AppService.setContext(context);
|
|
4302
|
+
}
|
|
4303
|
+
async open() {
|
|
4304
|
+
this._appRpc = (0, import_rpc.createProtoRpcPeer)({
|
|
4305
|
+
requested: import_client_protocol2.appServiceBundle,
|
|
4306
|
+
exposed: import_client_protocol2.shellServiceBundle,
|
|
4307
|
+
handlers: {
|
|
4308
|
+
ShellService: {
|
|
4309
|
+
setLayout: async (request) => {
|
|
4310
|
+
this._layout = request.layout;
|
|
4311
|
+
this._invitationCode = request.invitationCode;
|
|
4312
|
+
this._spaceKey = request.spaceKey;
|
|
4313
|
+
this._spaceId = request.spaceId;
|
|
4314
|
+
this.layoutUpdate.emit(request);
|
|
4315
|
+
},
|
|
4316
|
+
setInvitationUrl: async (request) => {
|
|
4317
|
+
this._invitationUrl = request.invitationUrl;
|
|
4318
|
+
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
4319
|
+
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
4320
|
+
this.invitationUrlUpdate.emit(request);
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
},
|
|
4324
|
+
port: this._port
|
|
4325
|
+
});
|
|
4326
|
+
await this._appRpc.open();
|
|
4327
|
+
}
|
|
4328
|
+
async close() {
|
|
4329
|
+
await this._appRpc?.close();
|
|
4330
|
+
this._appRpc = void 0;
|
|
4331
|
+
}
|
|
4332
|
+
};
|
|
4333
|
+
var en_US_exports = {};
|
|
4334
|
+
(0, import_chunk_Q7SFCCGT.__export)(en_US_exports, {
|
|
4335
|
+
os: () => os
|
|
4336
|
+
});
|
|
4337
|
+
var os = {
|
|
4338
|
+
"manage profile label": "Manage identity",
|
|
4339
|
+
"identity offline description": "Offline",
|
|
4340
|
+
"sidebar label": "DXOS sidebar",
|
|
4341
|
+
"copy invitation code label": "Copy URL",
|
|
4342
|
+
"copy success label": "Copied",
|
|
4343
|
+
"copy self public key label": "Copy public key",
|
|
4344
|
+
"open share panel label": "View QR code",
|
|
4345
|
+
"joining space heading": "Joining space",
|
|
4346
|
+
"join space heading": "Enter space invitation",
|
|
4347
|
+
"halo heading": "Initialize device identity",
|
|
4348
|
+
"exit label": "Exit",
|
|
4349
|
+
"identity selector title": "Join as",
|
|
4350
|
+
"identity radio group title": "Select an identity you\u2019ve associated with this device already",
|
|
4351
|
+
"add identity label": "Add",
|
|
4352
|
+
"continue label": "Continue",
|
|
4353
|
+
"back label": "Back",
|
|
4354
|
+
"next label": "Next",
|
|
4355
|
+
"close label": "Close",
|
|
4356
|
+
"auth choices label": "Choose an identity",
|
|
4357
|
+
"create identity label": "Create an identity",
|
|
4358
|
+
"create identity description": "Create a new identity.",
|
|
4359
|
+
"recover identity label": "Use a seed phrase",
|
|
4360
|
+
"recover identity description": "Enter your seed phrase to log in manually.",
|
|
4361
|
+
"join identity label": "Use another device",
|
|
4362
|
+
"join identity description": "Add this device to an identity you\u2019re already logged into on another device.",
|
|
4363
|
+
"deselect identity label": "Back to identities",
|
|
4364
|
+
"addition method chooser title": "An identity is required to continue",
|
|
4365
|
+
"new identity input label": "Set display name",
|
|
4366
|
+
"recover identity input label": "Type or paste your seed phrase",
|
|
4367
|
+
"failed to create identity message": "Failed to create an identity.",
|
|
4368
|
+
"failed to recover identity message": "Failed to recover an identity from the provided seed phrase.",
|
|
4369
|
+
"failed to authenticate message": "Incorrect code.",
|
|
4370
|
+
"identity added label": "Created identity & added to this device:",
|
|
4371
|
+
"join space as identity heading": "<part>as </part><part><icon/><label>{{labelValue}}</label></part>",
|
|
4372
|
+
"error status label": "Failed",
|
|
4373
|
+
"timeout status label": "Timed out",
|
|
4374
|
+
"cancelled status label": "Cancelled",
|
|
4375
|
+
"init status label": "Ready to connect",
|
|
4376
|
+
"connecting status label": "Connecting\u2026",
|
|
4377
|
+
"connected status label": "Enter authentication code",
|
|
4378
|
+
"authenticating status label": "Enter authentication code",
|
|
4379
|
+
"success status label": "Success",
|
|
4380
|
+
"cancel label": "Cancel",
|
|
4381
|
+
"done label": "Done",
|
|
4382
|
+
"reset label": "Start over",
|
|
4383
|
+
"auth code input label": "Enter the verification code",
|
|
4384
|
+
"invitation input label": "Paste an invitation code or URL",
|
|
4385
|
+
"create device invitation label": "Add device",
|
|
4386
|
+
"create space invitation label": "Invite",
|
|
4387
|
+
"qr label": "Scan to accept invitation",
|
|
4388
|
+
"empty invitations message": "No pending invitations",
|
|
4389
|
+
"empty device list message": "No devices authenticated other than this device.",
|
|
4390
|
+
"show all spaces label": "All spaces",
|
|
4391
|
+
"all spaces label": "All spaces",
|
|
4392
|
+
"create space label": "Create a new space",
|
|
4393
|
+
"join space label": "Join a space",
|
|
4394
|
+
"show current space label": "Current space",
|
|
4395
|
+
"view space invitations label": "View space invitations",
|
|
4396
|
+
"toggle sidebar label": "Open/close sidebar",
|
|
4397
|
+
"open sidebar label": "Open sidebar",
|
|
4398
|
+
"close sidebar label": "Close sidebar",
|
|
4399
|
+
"welcome message": "Welcome",
|
|
4400
|
+
"selecting identity heading": "Selecting identity",
|
|
4401
|
+
"devices heading": "Devices",
|
|
4402
|
+
"identity heading": "Profile settings",
|
|
4403
|
+
"choose add device label": "Add device",
|
|
4404
|
+
"choose devices label": "Manage devices",
|
|
4405
|
+
"choose profile label": "Edit profile",
|
|
4406
|
+
"choose sign out label": "Reset storage",
|
|
4407
|
+
"choose join new identity label": "Join existing device",
|
|
4408
|
+
"empty space members message": "There is nobody in this space yet.",
|
|
4409
|
+
"back to all invitations label": "Back to all invitations",
|
|
4410
|
+
"invitation heading": "Invitation",
|
|
4411
|
+
"invitation list heading": "Invitations",
|
|
4412
|
+
"device invitation list heading": "Pending device invitations",
|
|
4413
|
+
"space invitation list heading": "Pending invitations",
|
|
4414
|
+
"device list heading": "Devices",
|
|
4415
|
+
"space member list heading": "Members",
|
|
4416
|
+
"space panel heading": "Space membership",
|
|
4417
|
+
"auth code message": "Enter the following auth code on the joining device.",
|
|
4418
|
+
"auth other device emoji message": "Be sure the other device shows the following symbol:",
|
|
4419
|
+
"display name input label": "Display name",
|
|
4420
|
+
"display name input placeholder": "Enter a display name",
|
|
4421
|
+
"invite one label": "Single-use invitation",
|
|
4422
|
+
"invite one description": "Only one user may join.",
|
|
4423
|
+
"invite one qr label": "Single-use invitation",
|
|
4424
|
+
"invite one list item label": "Active single-use invitation",
|
|
4425
|
+
"invite many label": "Multi-use invitation",
|
|
4426
|
+
"invite many description": "Anyone with the link can join.",
|
|
4427
|
+
"invite many qr label": "Multi-use invitation",
|
|
4428
|
+
"invite many list item label": "Active multi-use invitation",
|
|
4429
|
+
"invite options label": "Change the active invite option.",
|
|
4430
|
+
"reset in progress label": "Resetting...",
|
|
4431
|
+
"confirm label": "Confirm",
|
|
4432
|
+
"reset storage input label": "WARNING: This will delete all data on this device. Type {{confirmationValue}} to continue.",
|
|
4433
|
+
"join new identity input label": "WARNING: To join an existing device all data on this device will be deleted. Type {{confirmationValue}} to continue.",
|
|
4434
|
+
"failed to reset identity message": "Failed to reset identity.",
|
|
4435
|
+
"confirmation value": "RESET",
|
|
4436
|
+
"confirmation placeholder": "Enter {{confirmationValue}} to continue.",
|
|
4437
|
+
"sign out chooser title": "Danger zone",
|
|
4438
|
+
"sign out chooser message": "Proceeding with the action below will erase all data on this device.",
|
|
4439
|
+
"join new identity label": "Join a new identity",
|
|
4440
|
+
"reset device label": "Reset storage",
|
|
4441
|
+
"reset device confirm message": "Are you sure you want to reset your device? All data will be lost.",
|
|
4442
|
+
"emoji and color label": "Emoji and color",
|
|
4443
|
+
"clear label": "Use default",
|
|
4444
|
+
"select emoji label": "Avatar emoji",
|
|
4445
|
+
"select hue label": "Avatar background color",
|
|
4446
|
+
"resetting message": "One moment while the device is reset\u2026",
|
|
4447
|
+
"red label": "Red",
|
|
4448
|
+
"orange label": "Orange",
|
|
4449
|
+
"amber label": "Amber",
|
|
4450
|
+
"yellow label": "Yellow",
|
|
4451
|
+
"lime label": "Lime",
|
|
4452
|
+
"green label": "Green",
|
|
4453
|
+
"emerald label": "Emerald",
|
|
4454
|
+
"teal label": "Teal",
|
|
4455
|
+
"cyan label": "Cyan",
|
|
4456
|
+
"sky label": "Sky",
|
|
4457
|
+
"blue label": "Blue",
|
|
4458
|
+
"indigo label": "Indigo",
|
|
4459
|
+
"violet label": "Violet",
|
|
4460
|
+
"purple label": "Purple",
|
|
4461
|
+
"fuchsia label": "Fuchsia",
|
|
4462
|
+
"pink label": "Pink",
|
|
4463
|
+
"rose label": "Rose",
|
|
4464
|
+
"current device tag label": "This device",
|
|
4465
|
+
"device name placeholder": "{{platform}} on {{os}}",
|
|
4466
|
+
"more options label": "More options",
|
|
4467
|
+
"disconnect label": "Go offline.",
|
|
4468
|
+
"connect label": "Go online.",
|
|
4469
|
+
"edit device label": "Edit device name & avatar",
|
|
4470
|
+
"agent heading": "Agent",
|
|
4471
|
+
"create agent clickwrap": 'By creating an agent, you agree to our <tosLink href="https://dxos.org/tos">Terms of\xA0Service</tosLink>.',
|
|
4472
|
+
"create agent description": "Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it\u2019s always online your changes will sync even when all your physical devices are\xA0asleep.",
|
|
4473
|
+
"create agent label": "Start an agent",
|
|
4474
|
+
"destroy agent label": "Shut down agent",
|
|
4475
|
+
"agent device label": "Your agent",
|
|
4476
|
+
"shell fallback title": "Shell failed to connect",
|
|
4477
|
+
"creating agent label": "Starting agent\u2026",
|
|
4478
|
+
"destroying agent label": "Stopping agent\u2026",
|
|
4479
|
+
"getting agent label": "Checking agent status\u2026",
|
|
4480
|
+
"agent requested label": "Agent requested",
|
|
4481
|
+
"agent requested description": "The agent service is creating an agent for you. Once the agent connects, it will display in the devices list.",
|
|
4482
|
+
"authenticating label": "Authenticating\u2026",
|
|
4483
|
+
"create recovery code label": "Create recovery code",
|
|
4484
|
+
"choose recover identity label": "Recover identity"
|
|
4485
|
+
};
|
|
4486
|
+
var osTranslations = {
|
|
4487
|
+
"en-US": en_US_exports
|
|
4488
|
+
};
|
|
4489
|
+
var runShell = async (config = new import_react_client11.Config()) => {
|
|
4490
|
+
const runtime = new ShellRuntimeImpl((0, import_rpc_tunnel.createIFramePort)({
|
|
4491
|
+
channel: import_client_protocol.DEFAULT_SHELL_CHANNEL
|
|
4492
|
+
}));
|
|
4493
|
+
await runtime.open();
|
|
4494
|
+
try {
|
|
4495
|
+
const services = new import_react_client11.ClientServicesProxy((0, import_rpc_tunnel.createIFramePort)({
|
|
4496
|
+
channel: import_client_protocol.DEFAULT_CLIENT_CHANNEL
|
|
4497
|
+
}));
|
|
4498
|
+
(0, import_client.createRoot)(document.getElementById("root")).render(/* @__PURE__ */ import_react67.default.createElement(import_react67.StrictMode, null, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.ThemeProvider, {
|
|
4499
|
+
tx: import_react_ui_theme31.defaultTx,
|
|
4500
|
+
resourceExtensions: [
|
|
4501
|
+
osTranslations
|
|
4502
|
+
]
|
|
4503
|
+
}, /* @__PURE__ */ import_react67.default.createElement(import_react_client11.ClientProvider, {
|
|
4504
|
+
config,
|
|
4505
|
+
services,
|
|
4506
|
+
noBanner: true
|
|
4507
|
+
}, /* @__PURE__ */ import_react67.default.createElement(ClipboardProvider, null, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Tooltip.Provider, null, /* @__PURE__ */ import_react67.default.createElement(import_react_client11.AgentHostingProvider, null, /* @__PURE__ */ import_react67.default.createElement(Shell, {
|
|
4508
|
+
runtime
|
|
4509
|
+
}))))))));
|
|
4510
|
+
} catch {
|
|
4511
|
+
(0, import_client.createRoot)(document.getElementById("root")).render(/* @__PURE__ */ import_react67.default.createElement(import_react67.StrictMode, null, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.ThemeProvider, {
|
|
4512
|
+
tx: import_react_ui_theme31.defaultTx,
|
|
4513
|
+
resourceExtensions: [
|
|
4514
|
+
osTranslations
|
|
4515
|
+
]
|
|
4516
|
+
}, /* @__PURE__ */ import_react67.default.createElement(Fallback, {
|
|
4517
|
+
onClose: () => runtime.setAppContext({
|
|
4518
|
+
display: import_react_client11.ShellDisplay.NONE
|
|
4519
|
+
})
|
|
4520
|
+
}))));
|
|
4521
|
+
}
|
|
4522
|
+
};
|
|
4523
|
+
var Fallback = ({ onClose }) => {
|
|
4524
|
+
const { t } = (0, import_react_ui35.useTranslation)("os");
|
|
4525
|
+
return /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Dialog.Root, {
|
|
4526
|
+
modal: true,
|
|
4527
|
+
open: true,
|
|
4528
|
+
onOpenChange: () => onClose?.()
|
|
4529
|
+
}, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Dialog.Overlay, null, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Dialog.Content, null, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Dialog.Title, null, t("shell fallback title")), /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Dialog.Close, {
|
|
4530
|
+
asChild: true,
|
|
4531
|
+
onClick: () => onClose?.()
|
|
4532
|
+
}, /* @__PURE__ */ import_react67.default.createElement(import_react_ui35.Button, {
|
|
4533
|
+
variant: "primary"
|
|
4534
|
+
}, t("close label"))))));
|
|
4535
|
+
};
|
|
4536
|
+
var MemoryShellRuntime = class {
|
|
4537
|
+
constructor({ layout, invitationCode, spaceKey, invitationUrl, deviceInvitationParam, spaceInvitationParam } = {}) {
|
|
4538
|
+
this.layoutUpdate = new import_async2.Event();
|
|
4539
|
+
this.invitationUrlUpdate = new import_async2.Event();
|
|
4540
|
+
this.contextUpdate = new import_async2.Event();
|
|
4541
|
+
this._layout = layout ?? import_react_client15.ShellLayout.DEFAULT;
|
|
4542
|
+
this._invitationCode = invitationCode;
|
|
4543
|
+
this._spaceKey = spaceKey;
|
|
4544
|
+
this._invitationUrl = invitationUrl ?? window.location.origin;
|
|
4545
|
+
this._deviceInvitationParam = deviceInvitationParam ?? "deviceInvitationCode";
|
|
4546
|
+
this._spaceInvitationParam = spaceInvitationParam ?? "spaceInvitationCode";
|
|
4547
|
+
}
|
|
4548
|
+
get layout() {
|
|
4549
|
+
return this._layout;
|
|
4550
|
+
}
|
|
4551
|
+
get invitationCode() {
|
|
4552
|
+
return this._invitationCode;
|
|
4553
|
+
}
|
|
4554
|
+
get spaceKey() {
|
|
4555
|
+
return this._spaceKey;
|
|
4556
|
+
}
|
|
4557
|
+
get invitationUrl() {
|
|
4558
|
+
return this._invitationUrl;
|
|
4559
|
+
}
|
|
4560
|
+
get deviceInvitationParam() {
|
|
4561
|
+
return this._deviceInvitationParam;
|
|
4562
|
+
}
|
|
4563
|
+
get spaceInvitationParam() {
|
|
4564
|
+
return this._spaceInvitationParam;
|
|
4565
|
+
}
|
|
4566
|
+
setLayout(request) {
|
|
4567
|
+
this._layout = request.layout;
|
|
4568
|
+
this._invitationCode = request.invitationCode;
|
|
4569
|
+
this._spaceKey = request.spaceKey;
|
|
4570
|
+
this.layoutUpdate.emit(request);
|
|
4571
|
+
}
|
|
4572
|
+
setInvitationUrl(request) {
|
|
4573
|
+
this._invitationUrl = request.invitationUrl;
|
|
4574
|
+
this._deviceInvitationParam = request.deviceInvitationParam;
|
|
4575
|
+
this._spaceInvitationParam = request.spaceInvitationParam;
|
|
4576
|
+
this.invitationUrlUpdate.emit(request);
|
|
4577
|
+
}
|
|
4578
|
+
async setAppContext(context) {
|
|
4579
|
+
this.contextUpdate.emit(context);
|
|
4580
|
+
}
|
|
4581
|
+
};
|
|
4582
|
+
var ShellContext = /* @__PURE__ */ (0, import_react71.createContext)({});
|
|
4583
|
+
var useShell = () => {
|
|
4584
|
+
const client = (0, import_react_client14.useClient)();
|
|
4585
|
+
const { runtime, setDisplay } = (0, import_react71.useContext)(ShellContext);
|
|
4586
|
+
const setLayout = async (layout, options) => {
|
|
4587
|
+
if (runtime) {
|
|
4588
|
+
if (layout === import_react_client14.ShellLayout.DEFAULT) {
|
|
4589
|
+
setDisplay?.(import_react_client14.ShellDisplay.NONE);
|
|
4590
|
+
} else {
|
|
4591
|
+
setDisplay?.(import_react_client14.ShellDisplay.FULLSCREEN);
|
|
4592
|
+
}
|
|
4593
|
+
runtime.setLayout({
|
|
4594
|
+
layout,
|
|
4595
|
+
...options
|
|
4596
|
+
});
|
|
4597
|
+
}
|
|
4598
|
+
await client.shell.open(layout, options);
|
|
4599
|
+
};
|
|
4600
|
+
return {
|
|
4601
|
+
setLayout
|
|
4602
|
+
};
|
|
4603
|
+
};
|
|
4604
|
+
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4605
|
+
const client = (0, import_react_client14.useClient)();
|
|
4606
|
+
const identity = (0, import_halo5.useIdentity)();
|
|
4607
|
+
const [display, setDisplay] = (0, import_react71.useState)(!identity || spaceInvitationCode || deviceInvitationCode ? import_react_client14.ShellDisplay.FULLSCREEN : import_react_client14.ShellDisplay.NONE);
|
|
4608
|
+
const shellRuntime = (0, import_react71.useMemo)(() => {
|
|
4609
|
+
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4610
|
+
return;
|
|
4611
|
+
}
|
|
4612
|
+
if (spaceInvitationCode) {
|
|
4613
|
+
return new MemoryShellRuntime({
|
|
4614
|
+
layout: import_react_client14.ShellLayout.JOIN_SPACE,
|
|
4615
|
+
invitationCode: spaceInvitationCode
|
|
4616
|
+
});
|
|
4617
|
+
}
|
|
4618
|
+
if (deviceInvitationCode) {
|
|
4619
|
+
return new MemoryShellRuntime({
|
|
4620
|
+
layout: import_react_client14.ShellLayout.INITIALIZE_IDENTITY,
|
|
4621
|
+
invitationCode: deviceInvitationCode
|
|
4622
|
+
});
|
|
4623
|
+
}
|
|
4624
|
+
return new MemoryShellRuntime({
|
|
4625
|
+
layout: identity ? import_react_client14.ShellLayout.DEFAULT : import_react_client14.ShellLayout.INITIALIZE_IDENTITY
|
|
4626
|
+
});
|
|
4627
|
+
}, [
|
|
4628
|
+
client,
|
|
4629
|
+
identity,
|
|
4630
|
+
spaceInvitationCode,
|
|
4631
|
+
deviceInvitationCode
|
|
4632
|
+
]);
|
|
4633
|
+
const handleKeyDown = (0, import_react71.useCallback)((event) => {
|
|
4634
|
+
if (!space || !shellRuntime) {
|
|
4635
|
+
return;
|
|
4636
|
+
}
|
|
4637
|
+
const modifier = event.ctrlKey || event.metaKey;
|
|
4638
|
+
if (event.key === ">" && event.shiftKey && modifier) {
|
|
4639
|
+
shellRuntime.setLayout({
|
|
4640
|
+
layout: import_react_client14.ShellLayout.SHARE_IDENTITY
|
|
4641
|
+
});
|
|
4642
|
+
setDisplay(import_react_client14.ShellDisplay.FULLSCREEN);
|
|
4643
|
+
} else if (event.key === "." && modifier) {
|
|
4644
|
+
shellRuntime.setLayout({
|
|
4645
|
+
layout: import_react_client14.ShellLayout.SPACE,
|
|
4646
|
+
spaceKey: space.key
|
|
4647
|
+
});
|
|
4648
|
+
setDisplay(import_react_client14.ShellDisplay.FULLSCREEN);
|
|
4649
|
+
}
|
|
4650
|
+
}, [
|
|
4651
|
+
space,
|
|
4652
|
+
shellRuntime
|
|
4653
|
+
]);
|
|
4654
|
+
(0, import_react71.useEffect)(() => {
|
|
4655
|
+
if (!shellRuntime) {
|
|
4656
|
+
return;
|
|
4657
|
+
}
|
|
4658
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
4659
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4660
|
+
}, [
|
|
4661
|
+
shellRuntime,
|
|
4662
|
+
handleKeyDown
|
|
4663
|
+
]);
|
|
4664
|
+
(0, import_react71.useEffect)(() => {
|
|
4665
|
+
if (!shellRuntime) {
|
|
4666
|
+
return;
|
|
4667
|
+
}
|
|
4668
|
+
return shellRuntime.contextUpdate.on(({ display: display2, spaceKey }) => {
|
|
4669
|
+
if (display2) {
|
|
4670
|
+
setDisplay(display2);
|
|
4671
|
+
}
|
|
4672
|
+
onJoinedSpace?.(spaceKey);
|
|
4673
|
+
});
|
|
4674
|
+
}, [
|
|
4675
|
+
shellRuntime
|
|
4676
|
+
]);
|
|
4677
|
+
return /* @__PURE__ */ import_react71.default.createElement(import_react71.default.Fragment, null, shellRuntime && /* @__PURE__ */ import_react71.default.createElement("div", {
|
|
4678
|
+
className: (0, import_react_ui_theme32.mx)(display === import_react_client14.ShellDisplay.NONE ? "hidden" : "")
|
|
4679
|
+
}, /* @__PURE__ */ import_react71.default.createElement(Shell, {
|
|
4680
|
+
runtime: shellRuntime
|
|
4681
|
+
})), /* @__PURE__ */ import_react71.default.createElement(ShellContext.Provider, {
|
|
4682
|
+
value: {
|
|
4683
|
+
runtime: shellRuntime,
|
|
4684
|
+
setDisplay
|
|
4685
|
+
}
|
|
4686
|
+
}, children));
|
|
4687
|
+
};
|
|
4688
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4689
|
+
0 && (module.exports = {
|
|
4690
|
+
Action,
|
|
4691
|
+
Actions,
|
|
4692
|
+
AgentConfig,
|
|
4693
|
+
AuthCode,
|
|
4694
|
+
BifurcatedAction,
|
|
4695
|
+
Centered,
|
|
4696
|
+
ClipboardContext,
|
|
4697
|
+
ClipboardProvider,
|
|
4698
|
+
CloseButton,
|
|
4699
|
+
CompoundButton,
|
|
4700
|
+
ConfirmReset,
|
|
4701
|
+
ConfirmResetImpl,
|
|
4702
|
+
CopyButton,
|
|
4703
|
+
CopyButtonIconOnly,
|
|
4704
|
+
DeviceList,
|
|
4705
|
+
Emoji,
|
|
4706
|
+
EmojiPickerBlock,
|
|
4707
|
+
EmojiPickerToolbarButton,
|
|
4708
|
+
Heading,
|
|
4709
|
+
HuePickerBlock,
|
|
4710
|
+
HuePickerToolbarButton,
|
|
4711
|
+
IdentityDialog,
|
|
4712
|
+
IdentityListItem,
|
|
4713
|
+
IdentityPanel,
|
|
4714
|
+
IdentityPanelImpl,
|
|
4715
|
+
Input,
|
|
4716
|
+
InvitationList,
|
|
4717
|
+
InvitationListContainer,
|
|
4718
|
+
InvitationListItem,
|
|
4719
|
+
InvitationListItemImpl,
|
|
4720
|
+
InvitationManager,
|
|
4721
|
+
JoinDialog,
|
|
4722
|
+
JoinPanel,
|
|
4723
|
+
JoinPanelImpl,
|
|
4724
|
+
Label,
|
|
4725
|
+
Shell,
|
|
4726
|
+
ShellContext,
|
|
4727
|
+
ShellProvider,
|
|
4728
|
+
SpaceDialog,
|
|
4729
|
+
SpaceListItem,
|
|
4730
|
+
SpaceMemberList,
|
|
4731
|
+
SpaceMemberListImpl,
|
|
4732
|
+
SpacePanel,
|
|
4733
|
+
SpacePanelImpl,
|
|
4734
|
+
StatusPanel,
|
|
4735
|
+
StepHeading,
|
|
4736
|
+
Viewport,
|
|
4737
|
+
activeBgColor,
|
|
4738
|
+
activeStrokeColor,
|
|
4739
|
+
activeTextColor,
|
|
4740
|
+
cancelledBgColor,
|
|
4741
|
+
cancelledStrokeColor,
|
|
4742
|
+
cancelledTextColor,
|
|
4743
|
+
createViewportScope,
|
|
4744
|
+
errorBgColor,
|
|
4745
|
+
errorStrokeColor,
|
|
4746
|
+
errorTextColor,
|
|
4747
|
+
inactiveBgColor,
|
|
4748
|
+
inactiveStrokeColor,
|
|
4749
|
+
inactiveTextColor,
|
|
4750
|
+
osTranslations,
|
|
4751
|
+
resolvedBgColor,
|
|
4752
|
+
resolvedStrokeColor,
|
|
4753
|
+
resolvedTextColor,
|
|
4754
|
+
runShell,
|
|
4755
|
+
stepStyles,
|
|
4756
|
+
successBgColor,
|
|
4757
|
+
successStrokeColor,
|
|
4758
|
+
successTextColor,
|
|
4759
|
+
useClipboardContext,
|
|
4760
|
+
useShell,
|
|
4761
|
+
useViewportContext
|
|
4762
|
+
});
|
|
4763
|
+
//# sourceMappingURL=react.cjs.map
|