@dxos/shell 0.7.3-staging.971cd8d → 0.7.3-staging.d887a4b
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 +71384 -71355
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +123 -123
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +641 -758
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react.cjs +732 -848
- package/dist/lib/node/react.cjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react.mjs +641 -758
- package/dist/lib/node-esm/react.mjs.map +4 -4
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +1 -2
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/components/StorybookDialog.d.ts.map +1 -1
- package/dist/types/src/components/StorybookDialog.js +1 -2
- package/dist/types/src/components/StorybookDialog.js.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/index.js +0 -1
- package/dist/types/src/components/index.js.map +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts.map +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +1 -2
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +1 -2
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -1
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js +1 -2
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +2 -18
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +0 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +5 -5
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts +2 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +14 -9
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +1 -3
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +1 -1
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +2 -2
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +4 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +8 -4
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +25 -25
- package/src/components/InvitationList/InvitationListItem.tsx +2 -2
- package/src/components/StorybookDialog.tsx +3 -5
- package/src/components/index.ts +0 -1
- package/src/composites/IdentityDialog/IdentityDialog.tsx +3 -4
- package/src/composites/Shell/run-shell.tsx +3 -4
- package/src/composites/SpaceDialog/SpaceDialog.tsx +3 -4
- package/src/panels/IdentityPanel/IdentityPanel.tsx +4 -37
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +0 -1
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +3 -11
- package/src/panels/JoinPanel/JoinPanel.tsx +2 -2
- package/src/panels/JoinPanel/steps/IdentityInput.tsx +23 -13
- package/src/panels/JoinPanel/steps/InvitationInput.tsx +1 -2
- package/src/steps/InvitationManager.tsx +3 -13
- package/src/stories/Invitations.e2e-stories.tsx +5 -5
- package/src/translations/locales/en-US.ts +8 -4
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts +0 -9
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +0 -1
- package/dist/types/src/components/Clipboard/ClipboardProvider.js +0 -46
- package/dist/types/src/components/Clipboard/ClipboardProvider.js.map +0 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +0 -10
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +0 -1
- package/dist/types/src/components/Clipboard/CopyButton.js +0 -65
- package/dist/types/src/components/Clipboard/CopyButton.js.map +0 -1
- package/dist/types/src/components/Clipboard/index.d.ts +0 -3
- package/dist/types/src/components/Clipboard/index.d.ts.map +0 -1
- package/dist/types/src/components/Clipboard/index.js +0 -22
- package/dist/types/src/components/Clipboard/index.js.map +0 -1
- package/src/components/Clipboard/ClipboardProvider.tsx +0 -26
- package/src/components/Clipboard/CopyButton.tsx +0 -70
- package/src/components/Clipboard/index.ts +0 -6
|
@@ -92,102 +92,10 @@ var AgentConfig = ({ agentStatus, validationMessage, onAgentDestroy, onAgentCrea
|
|
|
92
92
|
}, t("create agent description")))));
|
|
93
93
|
};
|
|
94
94
|
|
|
95
|
-
// packages/sdk/shell/src/components/Clipboard/CopyButton.tsx
|
|
96
|
-
import { Check, Copy } from "@phosphor-icons/react";
|
|
97
|
-
import React3, { useState as useState2 } from "react";
|
|
98
|
-
import { Button as Button2, Tooltip as Tooltip2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
99
|
-
import { getSize as getSize2, mx as mx2 } from "@dxos/react-ui-theme";
|
|
100
|
-
|
|
101
|
-
// packages/sdk/shell/src/components/Clipboard/ClipboardProvider.tsx
|
|
102
|
-
import React2, { createContext, useCallback, useContext, useState } from "react";
|
|
103
|
-
var ClipboardContext = /* @__PURE__ */ createContext({
|
|
104
|
-
textValue: "",
|
|
105
|
-
setTextValue: async (_) => {
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
var useClipboardContext = () => useContext(ClipboardContext);
|
|
109
|
-
var ClipboardProvider = ({ children }) => {
|
|
110
|
-
const [textValue, setInternalTextValue] = useState("");
|
|
111
|
-
const setTextValue = useCallback(async (nextValue) => {
|
|
112
|
-
await navigator.clipboard.writeText(nextValue);
|
|
113
|
-
return setInternalTextValue(nextValue);
|
|
114
|
-
}, []);
|
|
115
|
-
return /* @__PURE__ */ React2.createElement(ClipboardContext.Provider, {
|
|
116
|
-
value: {
|
|
117
|
-
textValue,
|
|
118
|
-
setTextValue
|
|
119
|
-
}
|
|
120
|
-
}, children);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
// packages/sdk/shell/src/components/Clipboard/CopyButton.tsx
|
|
124
|
-
var inactiveLabelStyles = "invisible bs-px -mbe-px overflow-hidden";
|
|
125
|
-
var CopyButton = ({ value, classNames, iconProps: iconProps2, ...props }) => {
|
|
126
|
-
const { t } = useTranslation2("os");
|
|
127
|
-
const { textValue, setTextValue } = useClipboardContext();
|
|
128
|
-
const isCopied = textValue === value;
|
|
129
|
-
return /* @__PURE__ */ React3.createElement(Button2, {
|
|
130
|
-
...props,
|
|
131
|
-
classNames: [
|
|
132
|
-
"inline-flex flex-col justify-center",
|
|
133
|
-
classNames
|
|
134
|
-
],
|
|
135
|
-
onClick: () => setTextValue(value),
|
|
136
|
-
"data-testid": "copy-invitation"
|
|
137
|
-
}, /* @__PURE__ */ React3.createElement("div", {
|
|
138
|
-
role: "none",
|
|
139
|
-
className: mx2("flex gap-1 items-center", isCopied && inactiveLabelStyles)
|
|
140
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
141
|
-
className: "pli-1"
|
|
142
|
-
}, t("copy invitation code label")), /* @__PURE__ */ React3.createElement(Copy, {
|
|
143
|
-
className: getSize2(5),
|
|
144
|
-
...iconProps2
|
|
145
|
-
})), /* @__PURE__ */ React3.createElement("div", {
|
|
146
|
-
role: "none",
|
|
147
|
-
className: mx2("flex gap-1 items-center", !isCopied && inactiveLabelStyles)
|
|
148
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
149
|
-
className: "pli-1"
|
|
150
|
-
}, t("copy success label")), /* @__PURE__ */ React3.createElement(Check, {
|
|
151
|
-
className: getSize2(5),
|
|
152
|
-
...iconProps2
|
|
153
|
-
})));
|
|
154
|
-
};
|
|
155
|
-
var CopyButtonIconOnly = ({ value, classNames, iconProps: iconProps2, variant, ...props }) => {
|
|
156
|
-
const { t } = useTranslation2("os");
|
|
157
|
-
const { textValue, setTextValue } = useClipboardContext();
|
|
158
|
-
const isCopied = textValue === value;
|
|
159
|
-
const label = isCopied ? t("copy success label") : t("copy invitation code label");
|
|
160
|
-
const [open, setOpen] = useState2(false);
|
|
161
|
-
return /* @__PURE__ */ React3.createElement(Tooltip2.Root, {
|
|
162
|
-
delayDuration: 1500,
|
|
163
|
-
open,
|
|
164
|
-
onOpenChange: setOpen
|
|
165
|
-
}, /* @__PURE__ */ React3.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React3.createElement(Tooltip2.Content, {
|
|
166
|
-
side: "bottom",
|
|
167
|
-
sideOffset: 12,
|
|
168
|
-
classNames: "z-30"
|
|
169
|
-
}, /* @__PURE__ */ React3.createElement("span", null, label), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
170
|
-
"aria-label": label,
|
|
171
|
-
...props,
|
|
172
|
-
onClick: () => setTextValue(value).then(() => setOpen(true)),
|
|
173
|
-
"data-testid": "copy-invitation",
|
|
174
|
-
asChild: true
|
|
175
|
-
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
176
|
-
variant,
|
|
177
|
-
classNames: [
|
|
178
|
-
"inline-flex flex-col justify-center",
|
|
179
|
-
classNames
|
|
180
|
-
]
|
|
181
|
-
}, /* @__PURE__ */ React3.createElement(Copy, {
|
|
182
|
-
className: getSize2(5),
|
|
183
|
-
...iconProps2
|
|
184
|
-
}))));
|
|
185
|
-
};
|
|
186
|
-
|
|
187
95
|
// packages/sdk/shell/src/components/CompoundButton/CompoundButton.tsx
|
|
188
|
-
import
|
|
96
|
+
import React2 from "react";
|
|
189
97
|
import { useId, useThemeContext, useElevationContext } from "@dxos/react-ui";
|
|
190
|
-
import { descriptionText as descriptionText2, descriptionTextPrimary, mx as
|
|
98
|
+
import { descriptionText as descriptionText2, descriptionTextPrimary, mx as mx2 } from "@dxos/react-ui-theme";
|
|
191
99
|
var CompoundButton = ({ children, description, before, after, variant = "default", elevation: propsElevation, slots = {}, ...buttonProps }) => {
|
|
192
100
|
const labelId = useId("compoundButton-label");
|
|
193
101
|
const descriptionId = useId("compoundButton-description");
|
|
@@ -200,7 +108,7 @@ var CompoundButton = ({ children, description, before, after, variant = "default
|
|
|
200
108
|
textWrap: true
|
|
201
109
|
};
|
|
202
110
|
const buttonClassName = tx("button.root", "button button--compound", styleProps, "flex items-center gap-4 plb-2.5", slots.root?.className);
|
|
203
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ React2.createElement("button", {
|
|
204
112
|
...buttonProps,
|
|
205
113
|
...slots.root,
|
|
206
114
|
className: buttonClassName,
|
|
@@ -208,22 +116,22 @@ var CompoundButton = ({ children, description, before, after, variant = "default
|
|
|
208
116
|
...description && {
|
|
209
117
|
"aria-describedby": descriptionId
|
|
210
118
|
}
|
|
211
|
-
}, before && /* @__PURE__ */
|
|
119
|
+
}, before && /* @__PURE__ */ React2.createElement("div", {
|
|
212
120
|
role: "none",
|
|
213
121
|
className: "grow-0"
|
|
214
|
-
}, before), /* @__PURE__ */
|
|
122
|
+
}, before), /* @__PURE__ */ React2.createElement("div", {
|
|
215
123
|
role: "none",
|
|
216
124
|
...slots.middle,
|
|
217
|
-
className:
|
|
218
|
-
}, /* @__PURE__ */
|
|
125
|
+
className: mx2("grow whitespace-normal flex flex-col gap-1 text-left", slots.middle?.className)
|
|
126
|
+
}, /* @__PURE__ */ React2.createElement("p", {
|
|
219
127
|
...slots.label,
|
|
220
128
|
id: labelId,
|
|
221
|
-
className:
|
|
222
|
-
}, children), description && /* @__PURE__ */
|
|
129
|
+
className: mx2(slots.label?.className)
|
|
130
|
+
}, children), description && /* @__PURE__ */ React2.createElement("p", {
|
|
223
131
|
id: descriptionId,
|
|
224
132
|
...slots.description,
|
|
225
|
-
className:
|
|
226
|
-
}, description)), after && /* @__PURE__ */
|
|
133
|
+
className: mx2("text-xs mbe-1 font-normal", variant === "primary" ? descriptionTextPrimary : descriptionText2, slots.description?.className)
|
|
134
|
+
}, description)), after && /* @__PURE__ */ React2.createElement("div", {
|
|
227
135
|
role: "none",
|
|
228
136
|
className: "grow-0"
|
|
229
137
|
}, after));
|
|
@@ -234,21 +142,21 @@ import emojiData from "@emoji-mart/data";
|
|
|
234
142
|
import EmojiMart from "@emoji-mart/react";
|
|
235
143
|
import { ArrowCounterClockwise, CaretDown, UserCircle } from "@phosphor-icons/react";
|
|
236
144
|
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
237
|
-
import
|
|
238
|
-
import { Button as
|
|
239
|
-
import { getSize as
|
|
145
|
+
import React3, { useRef, useState } from "react";
|
|
146
|
+
import { Button as Button2, Popover, Toolbar, Tooltip as Tooltip2, useMediaQuery, useThemeContext as useThemeContext2, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
147
|
+
import { getSize as getSize2 } from "@dxos/react-ui-theme";
|
|
240
148
|
var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji, classNames }) => {
|
|
241
|
-
const { t } =
|
|
149
|
+
const { t } = useTranslation2("os");
|
|
242
150
|
const { themeMode } = useThemeContext2();
|
|
243
151
|
const [_emojiValue, setEmojiValue] = useControllableState({
|
|
244
152
|
prop: emoji,
|
|
245
153
|
onChange: onChangeEmoji,
|
|
246
154
|
defaultProp: defaultEmoji
|
|
247
155
|
});
|
|
248
|
-
const [emojiPickerOpen, setEmojiPickerOpen] =
|
|
156
|
+
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
249
157
|
const suppressNextTooltip = useRef(false);
|
|
250
|
-
const [triggerTooltipOpen, setTriggerTooltipOpen] =
|
|
251
|
-
return /* @__PURE__ */
|
|
158
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState(false);
|
|
159
|
+
return /* @__PURE__ */ React3.createElement(Tooltip2.Root, {
|
|
252
160
|
open: triggerTooltipOpen,
|
|
253
161
|
onOpenChange: (nextOpen) => {
|
|
254
162
|
if (suppressNextTooltip.current) {
|
|
@@ -258,30 +166,30 @@ var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji,
|
|
|
258
166
|
setTriggerTooltipOpen(nextOpen);
|
|
259
167
|
}
|
|
260
168
|
}
|
|
261
|
-
}, /* @__PURE__ */
|
|
169
|
+
}, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
262
170
|
open: emojiPickerOpen,
|
|
263
171
|
onOpenChange: (nextOpen) => {
|
|
264
172
|
setEmojiPickerOpen(nextOpen);
|
|
265
173
|
suppressNextTooltip.current = true;
|
|
266
174
|
}
|
|
267
|
-
}, /* @__PURE__ */
|
|
175
|
+
}, /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
268
176
|
asChild: true
|
|
269
|
-
}, /* @__PURE__ */
|
|
177
|
+
}, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
|
|
270
178
|
asChild: true
|
|
271
|
-
}, /* @__PURE__ */
|
|
179
|
+
}, /* @__PURE__ */ React3.createElement(Toolbar.Button, {
|
|
272
180
|
classNames: [
|
|
273
181
|
"gap-2 text-2xl plb-1",
|
|
274
182
|
classNames
|
|
275
183
|
],
|
|
276
184
|
disabled
|
|
277
|
-
}, /* @__PURE__ */
|
|
185
|
+
}, /* @__PURE__ */ React3.createElement("span", {
|
|
278
186
|
className: "sr-only"
|
|
279
|
-
}, t("select emoji label")), /* @__PURE__ */
|
|
280
|
-
className:
|
|
281
|
-
})))), /* @__PURE__ */
|
|
187
|
+
}, t("select emoji label")), /* @__PURE__ */ React3.createElement(UserCircle, {
|
|
188
|
+
className: getSize2(5)
|
|
189
|
+
})))), /* @__PURE__ */ React3.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React3.createElement(Tooltip2.Content, {
|
|
282
190
|
side: "bottom",
|
|
283
191
|
classNames: "z-50"
|
|
284
|
-
}, t("select emoji label"), /* @__PURE__ */
|
|
192
|
+
}, t("select emoji label"), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null))), /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
285
193
|
side: "bottom",
|
|
286
194
|
onKeyDownCapture: (event) => {
|
|
287
195
|
if (event.key === "Escape") {
|
|
@@ -290,7 +198,7 @@ var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji,
|
|
|
290
198
|
suppressNextTooltip.current = true;
|
|
291
199
|
}
|
|
292
200
|
}
|
|
293
|
-
}, /* @__PURE__ */
|
|
201
|
+
}, /* @__PURE__ */ React3.createElement(EmojiMart, {
|
|
294
202
|
data: emojiData,
|
|
295
203
|
onEmojiSelect: ({ native }) => {
|
|
296
204
|
if (native) {
|
|
@@ -302,10 +210,10 @@ var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji,
|
|
|
302
210
|
maxFrequentRows: 0,
|
|
303
211
|
noCountryFlags: true,
|
|
304
212
|
theme: themeMode
|
|
305
|
-
}), /* @__PURE__ */
|
|
213
|
+
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))));
|
|
306
214
|
};
|
|
307
215
|
var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }) => {
|
|
308
|
-
const { t } =
|
|
216
|
+
const { t } = useTranslation2("os");
|
|
309
217
|
const [isMd] = useMediaQuery("md", {
|
|
310
218
|
ssr: false
|
|
311
219
|
});
|
|
@@ -314,23 +222,23 @@ var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickC
|
|
|
314
222
|
onChange: onChangeEmoji,
|
|
315
223
|
defaultProp: defaultEmoji
|
|
316
224
|
});
|
|
317
|
-
const [emojiPickerOpen, setEmojiPickerOpen] =
|
|
318
|
-
return /* @__PURE__ */
|
|
225
|
+
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
226
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
319
227
|
open: emojiPickerOpen,
|
|
320
228
|
onOpenChange: setEmojiPickerOpen
|
|
321
|
-
}, /* @__PURE__ */
|
|
229
|
+
}, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
|
|
322
230
|
asChild: true
|
|
323
|
-
}, /* @__PURE__ */
|
|
231
|
+
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
324
232
|
variant: "ghost",
|
|
325
233
|
classNames: "gap-2 text-2xl plb-1",
|
|
326
234
|
disabled
|
|
327
|
-
}, /* @__PURE__ */
|
|
235
|
+
}, /* @__PURE__ */ React3.createElement("span", {
|
|
328
236
|
className: "sr-only"
|
|
329
|
-
}, t("select emoji label")), /* @__PURE__ */
|
|
237
|
+
}, t("select emoji label")), /* @__PURE__ */ React3.createElement("span", {
|
|
330
238
|
className: "grow pis-14"
|
|
331
|
-
}, emojiValue), /* @__PURE__ */
|
|
332
|
-
className:
|
|
333
|
-
}))), /* @__PURE__ */
|
|
239
|
+
}, emojiValue), /* @__PURE__ */ React3.createElement(CaretDown, {
|
|
240
|
+
className: getSize2(4)
|
|
241
|
+
}))), /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
334
242
|
side: "right",
|
|
335
243
|
sideOffset: isMd ? 0 : -310,
|
|
336
244
|
onKeyDownCapture: (event) => {
|
|
@@ -339,7 +247,7 @@ var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickC
|
|
|
339
247
|
setEmojiPickerOpen(false);
|
|
340
248
|
}
|
|
341
249
|
}
|
|
342
|
-
}, /* @__PURE__ */
|
|
250
|
+
}, /* @__PURE__ */ React3.createElement(EmojiMart, {
|
|
343
251
|
data: emojiData,
|
|
344
252
|
onEmojiSelect: ({ native }) => {
|
|
345
253
|
if (native) {
|
|
@@ -350,36 +258,36 @@ var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickC
|
|
|
350
258
|
autoFocus: true,
|
|
351
259
|
maxFrequentRows: 0,
|
|
352
260
|
noCountryFlags: true
|
|
353
|
-
}), /* @__PURE__ */
|
|
261
|
+
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Root, null, /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
354
262
|
asChild: true
|
|
355
|
-
}, /* @__PURE__ */
|
|
263
|
+
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
356
264
|
variant: "ghost",
|
|
357
265
|
onClick: onClickClear,
|
|
358
266
|
disabled
|
|
359
|
-
}, /* @__PURE__ */
|
|
267
|
+
}, /* @__PURE__ */ React3.createElement("span", {
|
|
360
268
|
className: "sr-only"
|
|
361
|
-
}, t("clear label")), /* @__PURE__ */
|
|
269
|
+
}, t("clear label")), /* @__PURE__ */ React3.createElement(ArrowCounterClockwise, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React3.createElement(Tooltip2.Content, {
|
|
362
270
|
style: {
|
|
363
271
|
zIndex: 70
|
|
364
272
|
},
|
|
365
273
|
side: "right"
|
|
366
|
-
}, t("clear label"), /* @__PURE__ */
|
|
274
|
+
}, t("clear label"), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null)))));
|
|
367
275
|
};
|
|
368
276
|
|
|
369
277
|
// packages/sdk/shell/src/components/HuePicker.tsx
|
|
370
|
-
import { ArrowCounterClockwise as ArrowCounterClockwise2, CaretDown as CaretDown2, Check
|
|
278
|
+
import { ArrowCounterClockwise as ArrowCounterClockwise2, CaretDown as CaretDown2, Check, Palette } from "@phosphor-icons/react";
|
|
371
279
|
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
372
|
-
import
|
|
373
|
-
import { Button as
|
|
374
|
-
import { getSize as
|
|
280
|
+
import React4, { useRef as useRef2, useState as useState2 } from "react";
|
|
281
|
+
import { Button as Button3, DropdownMenu, Toolbar as Toolbar2, Tooltip as Tooltip3, useThemeContext as useThemeContext3, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
282
|
+
import { getSize as getSize3, hueTokenThemes, mx as mx3 } from "@dxos/react-ui-theme";
|
|
375
283
|
var HuePreview = ({ hue }) => {
|
|
376
284
|
const { tx } = useThemeContext3();
|
|
377
285
|
const size = 20;
|
|
378
|
-
return /* @__PURE__ */
|
|
286
|
+
return /* @__PURE__ */ React4.createElement("svg", {
|
|
379
287
|
width: size,
|
|
380
288
|
height: size,
|
|
381
289
|
viewBox: `0 0 ${size} ${size}`
|
|
382
|
-
}, /* @__PURE__ */
|
|
290
|
+
}, /* @__PURE__ */ React4.createElement("rect", {
|
|
383
291
|
x: 0,
|
|
384
292
|
y: 0,
|
|
385
293
|
width: size,
|
|
@@ -391,16 +299,16 @@ var HuePreview = ({ hue }) => {
|
|
|
391
299
|
};
|
|
392
300
|
var hueTokens = Object.keys(hueTokenThemes).slice(0, 16);
|
|
393
301
|
var HuePickerToolbarButton = ({ disabled, hue, onChangeHue, classNames, defaultHue }) => {
|
|
394
|
-
const { t } =
|
|
302
|
+
const { t } = useTranslation3("os");
|
|
395
303
|
const [hueValue, setHueValue] = useControllableState2({
|
|
396
304
|
prop: hue,
|
|
397
305
|
onChange: onChangeHue,
|
|
398
306
|
defaultProp: defaultHue
|
|
399
307
|
});
|
|
400
|
-
const [huePickerOpen, setHuePickerOpen] =
|
|
308
|
+
const [huePickerOpen, setHuePickerOpen] = useState2(false);
|
|
401
309
|
const suppressNextTooltip = useRef2(false);
|
|
402
|
-
const [triggerTooltipOpen, setTriggerTooltipOpen] =
|
|
403
|
-
return /* @__PURE__ */
|
|
310
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState2(false);
|
|
311
|
+
return /* @__PURE__ */ React4.createElement(Tooltip3.Root, {
|
|
404
312
|
open: triggerTooltipOpen,
|
|
405
313
|
onOpenChange: (nextOpen) => {
|
|
406
314
|
if (suppressNextTooltip.current) {
|
|
@@ -410,178 +318,178 @@ var HuePickerToolbarButton = ({ disabled, hue, onChangeHue, classNames, defaultH
|
|
|
410
318
|
setTriggerTooltipOpen(nextOpen);
|
|
411
319
|
}
|
|
412
320
|
}
|
|
413
|
-
}, /* @__PURE__ */
|
|
321
|
+
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
|
|
414
322
|
modal: false,
|
|
415
323
|
open: huePickerOpen,
|
|
416
324
|
onOpenChange: (nextOpen) => {
|
|
417
325
|
setHuePickerOpen(nextOpen);
|
|
418
326
|
suppressNextTooltip.current = true;
|
|
419
327
|
}
|
|
420
|
-
}, /* @__PURE__ */
|
|
328
|
+
}, /* @__PURE__ */ React4.createElement(Tooltip3.Trigger, {
|
|
421
329
|
asChild: true
|
|
422
|
-
}, /* @__PURE__ */
|
|
330
|
+
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
423
331
|
asChild: true
|
|
424
|
-
}, /* @__PURE__ */
|
|
425
|
-
classNames:
|
|
332
|
+
}, /* @__PURE__ */ React4.createElement(Toolbar2.Button, {
|
|
333
|
+
classNames: mx3("gap-2 plb-1", classNames),
|
|
426
334
|
disabled
|
|
427
|
-
}, /* @__PURE__ */
|
|
335
|
+
}, /* @__PURE__ */ React4.createElement("span", {
|
|
428
336
|
className: "sr-only"
|
|
429
|
-
}, t("select hue label")), /* @__PURE__ */
|
|
430
|
-
className:
|
|
431
|
-
})))), /* @__PURE__ */
|
|
337
|
+
}, t("select hue label")), /* @__PURE__ */ React4.createElement(Palette, {
|
|
338
|
+
className: getSize3(5)
|
|
339
|
+
})))), /* @__PURE__ */ React4.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip3.Content, {
|
|
432
340
|
side: "bottom",
|
|
433
341
|
classNames: "z-50"
|
|
434
|
-
}, t("select hue label"), /* @__PURE__ */
|
|
342
|
+
}, t("select hue label"), /* @__PURE__ */ React4.createElement(Tooltip3.Arrow, null))), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
|
|
435
343
|
side: "bottom",
|
|
436
344
|
classNames: "!w-40"
|
|
437
|
-
}, /* @__PURE__ */
|
|
345
|
+
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, {
|
|
438
346
|
classNames: "grid grid-cols-4"
|
|
439
347
|
}, hueTokens.map((hue2) => {
|
|
440
|
-
return /* @__PURE__ */
|
|
348
|
+
return /* @__PURE__ */ React4.createElement(DropdownMenu.CheckboxItem, {
|
|
441
349
|
key: hue2,
|
|
442
350
|
checked: hue2 === hueValue,
|
|
443
351
|
onCheckedChange: () => setHueValue(hue2),
|
|
444
352
|
classNames: "px-0 py-2 items-center justify-center"
|
|
445
|
-
}, /* @__PURE__ */
|
|
353
|
+
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
446
354
|
hue: hue2
|
|
447
355
|
}));
|
|
448
356
|
})))));
|
|
449
357
|
};
|
|
450
358
|
var HuePickerBlock = ({ disabled, hue, onChangeHue, defaultHue, onClickClear }) => {
|
|
451
|
-
const { t } =
|
|
359
|
+
const { t } = useTranslation3("os");
|
|
452
360
|
const [hueValue, setHueValue] = useControllableState2({
|
|
453
361
|
prop: hue,
|
|
454
362
|
onChange: onChangeHue,
|
|
455
363
|
defaultProp: defaultHue
|
|
456
364
|
});
|
|
457
|
-
return /* @__PURE__ */
|
|
365
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
|
|
458
366
|
modal: false
|
|
459
|
-
}, /* @__PURE__ */
|
|
367
|
+
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
460
368
|
asChild: true
|
|
461
|
-
}, /* @__PURE__ */
|
|
369
|
+
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
462
370
|
variant: "ghost",
|
|
463
371
|
classNames: "gap-2 plb-1",
|
|
464
372
|
disabled
|
|
465
|
-
}, /* @__PURE__ */
|
|
373
|
+
}, /* @__PURE__ */ React4.createElement("span", {
|
|
466
374
|
className: "sr-only"
|
|
467
|
-
}, t("select hue label")), /* @__PURE__ */
|
|
375
|
+
}, t("select hue label")), /* @__PURE__ */ React4.createElement("div", {
|
|
468
376
|
role: "none",
|
|
469
377
|
className: "pis-14 grow flex items-center justify-center gap-2"
|
|
470
|
-
}, /* @__PURE__ */
|
|
378
|
+
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
471
379
|
hue: hueValue
|
|
472
|
-
}), /* @__PURE__ */
|
|
473
|
-
className:
|
|
474
|
-
}))), /* @__PURE__ */
|
|
380
|
+
}), /* @__PURE__ */ React4.createElement("span", null, t(`${hueValue} label`))), /* @__PURE__ */ React4.createElement(CaretDown2, {
|
|
381
|
+
className: getSize3(4)
|
|
382
|
+
}))), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
|
|
475
383
|
side: "right"
|
|
476
|
-
}, /* @__PURE__ */
|
|
477
|
-
return /* @__PURE__ */
|
|
384
|
+
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, null, Object.keys(hueTokenThemes).map((hue2) => {
|
|
385
|
+
return /* @__PURE__ */ React4.createElement(DropdownMenu.CheckboxItem, {
|
|
478
386
|
key: hue2,
|
|
479
387
|
checked: hue2 === hueValue,
|
|
480
388
|
onCheckedChange: () => setHueValue(hue2)
|
|
481
|
-
}, /* @__PURE__ */
|
|
389
|
+
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
482
390
|
hue: hue2
|
|
483
|
-
}), /* @__PURE__ */
|
|
391
|
+
}), /* @__PURE__ */ React4.createElement("span", {
|
|
484
392
|
className: "grow"
|
|
485
|
-
}, t(`${hue2} label`)), /* @__PURE__ */
|
|
486
|
-
})), /* @__PURE__ */
|
|
393
|
+
}, t(`${hue2} label`)), /* @__PURE__ */ React4.createElement(DropdownMenu.ItemIndicator, null, /* @__PURE__ */ React4.createElement(Check, null)));
|
|
394
|
+
})), /* @__PURE__ */ React4.createElement(DropdownMenu.Arrow, null))), /* @__PURE__ */ React4.createElement(Tooltip3.Root, null, /* @__PURE__ */ React4.createElement(Tooltip3.Trigger, {
|
|
487
395
|
asChild: true
|
|
488
|
-
}, /* @__PURE__ */
|
|
396
|
+
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
489
397
|
variant: "ghost",
|
|
490
398
|
onClick: onClickClear,
|
|
491
399
|
disabled
|
|
492
|
-
}, /* @__PURE__ */
|
|
400
|
+
}, /* @__PURE__ */ React4.createElement("span", {
|
|
493
401
|
className: "sr-only"
|
|
494
|
-
}, t("clear label")), /* @__PURE__ */
|
|
402
|
+
}, t("clear label")), /* @__PURE__ */ React4.createElement(ArrowCounterClockwise2, null))), /* @__PURE__ */ React4.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip3.Content, {
|
|
495
403
|
style: {
|
|
496
404
|
zIndex: 70
|
|
497
405
|
},
|
|
498
406
|
side: "right"
|
|
499
|
-
}, t("clear label"), /* @__PURE__ */
|
|
407
|
+
}, t("clear label"), /* @__PURE__ */ React4.createElement(Tooltip3.Arrow, null)))));
|
|
500
408
|
};
|
|
501
409
|
|
|
502
410
|
// packages/sdk/shell/src/components/IdentityList/IdentityListItem.tsx
|
|
503
|
-
import
|
|
411
|
+
import React5, { forwardRef } from "react";
|
|
504
412
|
import { generateName } from "@dxos/display-name";
|
|
505
413
|
import { SpaceMember } from "@dxos/react-client/echo";
|
|
506
414
|
import { ListItem, Avatar as Avatar2, useId as useId2 } from "@dxos/react-ui";
|
|
507
|
-
import { mx as
|
|
415
|
+
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
508
416
|
import { keyToFallback } from "@dxos/util";
|
|
509
417
|
var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick, classNames, ...props }, forwardedRef) => {
|
|
510
418
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
511
419
|
const labelId = useId2("identityListItem__label");
|
|
512
420
|
const displayName = identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
513
|
-
return /* @__PURE__ */
|
|
421
|
+
return /* @__PURE__ */ React5.createElement(ListItem.Root, {
|
|
514
422
|
...props,
|
|
515
|
-
classNames:
|
|
423
|
+
classNames: mx4("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer", classNames),
|
|
516
424
|
onClick: () => onClick?.(),
|
|
517
425
|
"data-testid": "identity-list-item",
|
|
518
426
|
labelId,
|
|
519
427
|
ref: forwardedRef
|
|
520
|
-
}, /* @__PURE__ */
|
|
428
|
+
}, /* @__PURE__ */ React5.createElement(Avatar2.Root, {
|
|
521
429
|
status: presence === SpaceMember.PresenceState.ONLINE ? "active" : "inactive",
|
|
522
430
|
labelId,
|
|
523
431
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
524
|
-
}, /* @__PURE__ */
|
|
432
|
+
}, /* @__PURE__ */ React5.createElement(Avatar2.Frame, {
|
|
525
433
|
classNames: "place-self-center"
|
|
526
|
-
}, /* @__PURE__ */
|
|
434
|
+
}, /* @__PURE__ */ React5.createElement(Avatar2.Fallback, {
|
|
527
435
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
528
|
-
})), /* @__PURE__ */
|
|
436
|
+
})), /* @__PURE__ */ React5.createElement(Avatar2.Label, {
|
|
529
437
|
classNames: "text-sm truncate pli-2"
|
|
530
438
|
}, displayName)));
|
|
531
439
|
});
|
|
532
440
|
|
|
533
441
|
// packages/sdk/shell/src/components/IdentityList/SpaceMemberList.tsx
|
|
534
|
-
import
|
|
442
|
+
import React6, { useMemo } from "react";
|
|
535
443
|
import { useClient } from "@dxos/react-client";
|
|
536
444
|
import { useMembers } from "@dxos/react-client/echo";
|
|
537
|
-
import { useTranslation as
|
|
538
|
-
import { descriptionText as descriptionText3, mx as
|
|
445
|
+
import { useTranslation as useTranslation4, List } from "@dxos/react-ui";
|
|
446
|
+
import { descriptionText as descriptionText3, mx as mx5 } from "@dxos/react-ui-theme";
|
|
539
447
|
var SpaceMemberList = ({ spaceKey, includeSelf, onSelect }) => {
|
|
540
448
|
const client = useClient();
|
|
541
449
|
const allUnsortedMembers = useMembers(spaceKey);
|
|
542
450
|
const members = 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)), [
|
|
543
451
|
allUnsortedMembers
|
|
544
452
|
]);
|
|
545
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ React6.createElement(SpaceMemberListImpl, {
|
|
546
454
|
members,
|
|
547
455
|
onSelect
|
|
548
456
|
});
|
|
549
457
|
};
|
|
550
458
|
var SpaceMemberListImpl = ({ members, onSelect }) => {
|
|
551
|
-
const { t } =
|
|
459
|
+
const { t } = useTranslation4("os");
|
|
552
460
|
const visibleMembers = members.filter((member) => member.identity);
|
|
553
|
-
return visibleMembers.length > 0 ? /* @__PURE__ */
|
|
461
|
+
return visibleMembers.length > 0 ? /* @__PURE__ */ React6.createElement(List, {
|
|
554
462
|
classNames: "flex flex-col gap-2",
|
|
555
463
|
"data-testid": "space-members-list"
|
|
556
464
|
}, visibleMembers.map((member) => {
|
|
557
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ React6.createElement(IdentityListItem, {
|
|
558
466
|
key: member.identity.identityKey.toHex(),
|
|
559
467
|
identity: member.identity,
|
|
560
468
|
presence: member.presence,
|
|
561
469
|
onClick: onSelect && (() => onSelect(member))
|
|
562
470
|
});
|
|
563
|
-
})) : /* @__PURE__ */
|
|
471
|
+
})) : /* @__PURE__ */ React6.createElement("div", {
|
|
564
472
|
role: "none",
|
|
565
473
|
className: "grow flex items-center p-2"
|
|
566
|
-
}, /* @__PURE__ */
|
|
567
|
-
className:
|
|
474
|
+
}, /* @__PURE__ */ React6.createElement("p", {
|
|
475
|
+
className: mx5(descriptionText3, "text-center is-full mlb-2")
|
|
568
476
|
}, t("empty space members message")));
|
|
569
477
|
};
|
|
570
478
|
|
|
571
479
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
572
480
|
import { CaretRight, Plus as Plus2 } from "@phosphor-icons/react";
|
|
573
|
-
import
|
|
574
|
-
import { Button as
|
|
575
|
-
import { descriptionText as descriptionText4, getSize as
|
|
481
|
+
import React8 from "react";
|
|
482
|
+
import { Button as Button5, List as List2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
483
|
+
import { descriptionText as descriptionText4, getSize as getSize5, mx as mx6 } from "@dxos/react-ui-theme";
|
|
576
484
|
|
|
577
485
|
// packages/sdk/shell/src/components/DeviceList/DeviceListItem.tsx
|
|
578
486
|
import { Compass, Desktop, DeviceMobile, Devices, DotsThree, ShareFat, Power as Power2, Robot, Database as Database2, FirstAidKit } from "@phosphor-icons/react";
|
|
579
|
-
import
|
|
487
|
+
import React7, { forwardRef as forwardRef2 } from "react";
|
|
580
488
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
581
489
|
import { Device, DeviceType, DeviceKind } from "@dxos/react-client/halo";
|
|
582
490
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
583
|
-
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as
|
|
584
|
-
import { getSize as
|
|
491
|
+
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as useTranslation5, DropdownMenu as DropdownMenu2, Button as Button4 } from "@dxos/react-ui";
|
|
492
|
+
import { getSize as getSize4 } from "@dxos/react-ui-theme";
|
|
585
493
|
import { keyToFallback as keyToFallback2 } from "@dxos/util";
|
|
586
494
|
var iconProps = {
|
|
587
495
|
weight: "duotone",
|
|
@@ -591,7 +499,7 @@ var iconProps = {
|
|
|
591
499
|
y: 8
|
|
592
500
|
};
|
|
593
501
|
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy: _, ...props }, forwardedRef) => {
|
|
594
|
-
const { t } =
|
|
502
|
+
const { t } = useTranslation5("os");
|
|
595
503
|
const fallbackValue = keyToFallback2(device.deviceKey);
|
|
596
504
|
const labelId = useId3("identityListItem__label");
|
|
597
505
|
const displayName = device.profile ? t("device name placeholder", {
|
|
@@ -599,7 +507,7 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
599
507
|
platform: device.profile.platform
|
|
600
508
|
}) : generateName2(device.deviceKey.toHex());
|
|
601
509
|
const isCurrent = device.kind === DeviceKind.CURRENT;
|
|
602
|
-
return /* @__PURE__ */
|
|
510
|
+
return /* @__PURE__ */ React7.createElement(ListItem2.Root, {
|
|
603
511
|
...props,
|
|
604
512
|
classNames: [
|
|
605
513
|
"flex gap-2 items-center mlb-2",
|
|
@@ -608,60 +516,60 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
608
516
|
"data-testid": `device-list-item${isCurrent ? "-current" : ""}`,
|
|
609
517
|
labelId,
|
|
610
518
|
ref: forwardedRef
|
|
611
|
-
}, /* @__PURE__ */
|
|
519
|
+
}, /* @__PURE__ */ React7.createElement(Avatar3.Root, {
|
|
612
520
|
status: isCurrent && connectionState === ConnectionState.OFFLINE ? "error" : device.presence === Device.PresenceState.ONLINE ? "active" : "inactive",
|
|
613
521
|
labelId,
|
|
614
522
|
hue: fallbackValue.hue,
|
|
615
523
|
variant: "square"
|
|
616
|
-
}, /* @__PURE__ */
|
|
524
|
+
}, /* @__PURE__ */ React7.createElement(Avatar3.Frame, {
|
|
617
525
|
classNames: "place-self-center"
|
|
618
|
-
}, device.profile?.type ? device.profile.type === DeviceType.AGENT_MANAGED ? /* @__PURE__ */
|
|
526
|
+
}, device.profile?.type ? device.profile.type === DeviceType.AGENT_MANAGED ? /* @__PURE__ */ React7.createElement(Database2, iconProps) : device.profile.type === DeviceType.BROWSER ? /* @__PURE__ */ React7.createElement(Compass, iconProps) : device.profile.type === DeviceType.NATIVE ? /* @__PURE__ */ React7.createElement(Desktop, iconProps) : [
|
|
619
527
|
DeviceType.AGENT,
|
|
620
528
|
DeviceType.AGENT_MANAGED
|
|
621
|
-
].includes(device.profile.type) ? /* @__PURE__ */
|
|
529
|
+
].includes(device.profile.type) ? /* @__PURE__ */ React7.createElement(Robot, iconProps) : device.profile.type === DeviceType.MOBILE ? /* @__PURE__ */ React7.createElement(DeviceMobile, iconProps) : /* @__PURE__ */ React7.createElement(Devices, iconProps) : /* @__PURE__ */ React7.createElement(Avatar3.Fallback, {
|
|
622
530
|
text: fallbackValue.emoji
|
|
623
|
-
})), /* @__PURE__ */
|
|
531
|
+
})), /* @__PURE__ */ React7.createElement(Avatar3.Label, {
|
|
624
532
|
classNames: "flex-1 text-sm truncate"
|
|
625
|
-
}, displayName), isCurrent && /* @__PURE__ */
|
|
533
|
+
}, displayName), isCurrent && /* @__PURE__ */ React7.createElement(Tag, {
|
|
626
534
|
color: "primary"
|
|
627
|
-
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */
|
|
535
|
+
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React7.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React7.createElement(DropdownMenu2.Trigger, {
|
|
628
536
|
asChild: true
|
|
629
|
-
}, /* @__PURE__ */
|
|
537
|
+
}, /* @__PURE__ */ React7.createElement(Button4, {
|
|
630
538
|
variant: "ghost",
|
|
631
539
|
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
632
540
|
"data-testid": `device-list-item${isCurrent ? "-current" : ""}.options`
|
|
633
|
-
}, /* @__PURE__ */
|
|
541
|
+
}, /* @__PURE__ */ React7.createElement("span", {
|
|
634
542
|
className: "sr-only"
|
|
635
|
-
}, t("more options label")), /* @__PURE__ */
|
|
636
|
-
className:
|
|
637
|
-
}))), /* @__PURE__ */
|
|
543
|
+
}, t("more options label")), /* @__PURE__ */ React7.createElement(DotsThree, {
|
|
544
|
+
className: getSize4(5)
|
|
545
|
+
}))), /* @__PURE__ */ React7.createElement(DropdownMenu2.Content, null, /* @__PURE__ */ React7.createElement(DropdownMenu2.Viewport, null, /* @__PURE__ */ React7.createElement(DropdownMenu2.Item, {
|
|
638
546
|
"data-testid": "device-list-item-current.join-existing",
|
|
639
547
|
onClick: onClickJoinExisting
|
|
640
|
-
}, /* @__PURE__ */
|
|
641
|
-
className:
|
|
642
|
-
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */
|
|
548
|
+
}, /* @__PURE__ */ React7.createElement(ShareFat, {
|
|
549
|
+
className: getSize4(5)
|
|
550
|
+
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */ React7.createElement(DropdownMenu2.Item, {
|
|
643
551
|
"data-testid": "device-list-item-current.recover",
|
|
644
552
|
onClick: onClickRecover
|
|
645
|
-
}, /* @__PURE__ */
|
|
646
|
-
className:
|
|
647
|
-
}), t("choose recover identity label")), /* @__PURE__ */
|
|
553
|
+
}, /* @__PURE__ */ React7.createElement(FirstAidKit, {
|
|
554
|
+
className: getSize4(5)
|
|
555
|
+
}), t("choose recover identity label")), /* @__PURE__ */ React7.createElement(DropdownMenu2.Item, {
|
|
648
556
|
"data-testid": "device-list-item-current.reset",
|
|
649
557
|
onClick: onClickReset
|
|
650
|
-
}, /* @__PURE__ */
|
|
651
|
-
className:
|
|
558
|
+
}, /* @__PURE__ */ React7.createElement(Power2, {
|
|
559
|
+
className: getSize4(5)
|
|
652
560
|
}), t("reset device label")))))));
|
|
653
561
|
});
|
|
654
562
|
|
|
655
563
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
656
564
|
var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, onAgentDestroy }) => {
|
|
657
|
-
const { t } =
|
|
658
|
-
return /* @__PURE__ */
|
|
565
|
+
const { t } = useTranslation6("os");
|
|
566
|
+
return /* @__PURE__ */ React8.createElement("div", {
|
|
659
567
|
role: "none",
|
|
660
568
|
className: "p-1"
|
|
661
|
-
}, /* @__PURE__ */
|
|
662
|
-
className:
|
|
663
|
-
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */
|
|
664
|
-
return /* @__PURE__ */
|
|
569
|
+
}, /* @__PURE__ */ React8.createElement("h2", {
|
|
570
|
+
className: mx6(descriptionText4, "text-center mbs-2")
|
|
571
|
+
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */ React8.createElement(List2, null, devices.map((device) => {
|
|
572
|
+
return /* @__PURE__ */ React8.createElement(DeviceListItem, {
|
|
665
573
|
key: device.deviceKey.toHex(),
|
|
666
574
|
device,
|
|
667
575
|
onClickEdit: () => onClickEdit?.(device),
|
|
@@ -671,37 +579,37 @@ var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickRe
|
|
|
671
579
|
connectionState,
|
|
672
580
|
onAgentDestroy
|
|
673
581
|
});
|
|
674
|
-
})), /* @__PURE__ */
|
|
582
|
+
})), /* @__PURE__ */ React8.createElement(Button5, {
|
|
675
583
|
variant: "ghost",
|
|
676
584
|
classNames: "justify-start gap-2 !pis-0 !pie-3 is-full",
|
|
677
585
|
"data-testid": "devices-panel.create-invitation",
|
|
678
586
|
onClick: onClickAdd
|
|
679
|
-
}, /* @__PURE__ */
|
|
587
|
+
}, /* @__PURE__ */ React8.createElement("div", {
|
|
680
588
|
role: "img",
|
|
681
|
-
className:
|
|
682
|
-
}, /* @__PURE__ */
|
|
589
|
+
className: mx6(getSize5(8), "m-1 rounded-sm bg-input grid place-items-center")
|
|
590
|
+
}, /* @__PURE__ */ React8.createElement(Plus2, {
|
|
683
591
|
weight: "light",
|
|
684
|
-
className:
|
|
685
|
-
})), /* @__PURE__ */
|
|
592
|
+
className: getSize5(6)
|
|
593
|
+
})), /* @__PURE__ */ React8.createElement("span", {
|
|
686
594
|
className: "grow font-medium text-start"
|
|
687
|
-
}, t("choose add device label")), /* @__PURE__ */
|
|
595
|
+
}, t("choose add device label")), /* @__PURE__ */ React8.createElement(CaretRight, {
|
|
688
596
|
weight: "bold",
|
|
689
|
-
className:
|
|
597
|
+
className: getSize5(4)
|
|
690
598
|
})));
|
|
691
599
|
};
|
|
692
600
|
|
|
693
601
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
694
602
|
import { X } from "@phosphor-icons/react";
|
|
695
603
|
import { formatDistanceToNow } from "date-fns";
|
|
696
|
-
import
|
|
604
|
+
import React10, { useCallback } from "react";
|
|
697
605
|
import { Invitation, useInvitationStatus } from "@dxos/react-client/invitations";
|
|
698
|
-
import { Button as
|
|
699
|
-
import { focusRing, getSize as
|
|
606
|
+
import { Button as Button6, Clipboard, ListItem as ListItem3, useTranslation as useTranslation7, Avatar as Avatar4, useThemeContext as useThemeContext4, Tooltip as Tooltip4 } from "@dxos/react-ui";
|
|
607
|
+
import { focusRing, getSize as getSize6, mx as mx8 } from "@dxos/react-ui-theme";
|
|
700
608
|
import { hexToEmoji } from "@dxos/util";
|
|
701
609
|
|
|
702
610
|
// packages/sdk/shell/src/components/AuthCode.tsx
|
|
703
|
-
import
|
|
704
|
-
import { mx as
|
|
611
|
+
import React9, { useRef as useRef3 } from "react";
|
|
612
|
+
import { mx as mx7 } from "@dxos/react-ui-theme";
|
|
705
613
|
var AuthCode = (props) => {
|
|
706
614
|
const { code, large, classNames } = props;
|
|
707
615
|
const l = code?.length ?? 0;
|
|
@@ -718,20 +626,20 @@ var AuthCode = (props) => {
|
|
|
718
626
|
}
|
|
719
627
|
void navigator.clipboard.writeText(code ?? "");
|
|
720
628
|
};
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
-
className:
|
|
629
|
+
return /* @__PURE__ */ React9.createElement("span", {
|
|
630
|
+
className: mx7(large ? "text-6xl" : "text-2xl", "font-mono pli-2.5 rounded cursor-pointer", classNames),
|
|
723
631
|
onClick: handleClick,
|
|
724
632
|
ref: codeRef
|
|
725
|
-
}, /* @__PURE__ */
|
|
633
|
+
}, /* @__PURE__ */ React9.createElement("span", {
|
|
726
634
|
className: "mie-[0.4em]"
|
|
727
|
-
}, left), /* @__PURE__ */
|
|
635
|
+
}, left), /* @__PURE__ */ React9.createElement("span", null, right));
|
|
728
636
|
};
|
|
729
637
|
|
|
730
638
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
731
639
|
var InvitationListItem = (props) => {
|
|
732
640
|
const { invitation } = props;
|
|
733
641
|
const invitationStatus = useInvitationStatus(invitation);
|
|
734
|
-
return /* @__PURE__ */
|
|
642
|
+
return /* @__PURE__ */ React10.createElement(InvitationListItemImpl, {
|
|
735
643
|
...props,
|
|
736
644
|
invitationStatus
|
|
737
645
|
});
|
|
@@ -742,10 +650,10 @@ var avatarProps = {
|
|
|
742
650
|
};
|
|
743
651
|
var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
744
652
|
const { tx } = useThemeContext4();
|
|
745
|
-
return /* @__PURE__ */
|
|
653
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement("span", {
|
|
746
654
|
role: "none",
|
|
747
|
-
className:
|
|
748
|
-
}, /* @__PURE__ */
|
|
655
|
+
className: mx8("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1", getSize6(avatarProps.size))
|
|
656
|
+
}, /* @__PURE__ */ React10.createElement("span", {
|
|
749
657
|
role: "none",
|
|
750
658
|
className: tx("avatar.ring", "avatar__ring", {
|
|
751
659
|
...avatarProps,
|
|
@@ -755,10 +663,10 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
755
663
|
style: {
|
|
756
664
|
animationDelay: "400ms"
|
|
757
665
|
}
|
|
758
|
-
})), /* @__PURE__ */
|
|
666
|
+
})), /* @__PURE__ */ React10.createElement("span", {
|
|
759
667
|
role: "none",
|
|
760
|
-
className:
|
|
761
|
-
}, /* @__PURE__ */
|
|
668
|
+
className: mx8("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2", getSize6(avatarProps.size))
|
|
669
|
+
}, /* @__PURE__ */ React10.createElement("span", {
|
|
762
670
|
role: "none",
|
|
763
671
|
className: tx("avatar.ring", "avatar__ring", {
|
|
764
672
|
...avatarProps,
|
|
@@ -771,7 +679,7 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
771
679
|
})));
|
|
772
680
|
};
|
|
773
681
|
var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
|
|
774
|
-
const { t } =
|
|
682
|
+
const { t } = useTranslation7("os");
|
|
775
683
|
const { cancel, status: invitationStatus, invitationCode, authCode, multiUse, shareable } = propsInvitationStatus;
|
|
776
684
|
const isCancellable = !([
|
|
777
685
|
Invitation.State.ERROR,
|
|
@@ -784,7 +692,7 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
784
692
|
Invitation.State.CONNECTED
|
|
785
693
|
].indexOf(invitationStatus) >= 0);
|
|
786
694
|
const showAuthCode = invitationStatus === Invitation.State.READY_FOR_AUTHENTICATION;
|
|
787
|
-
const handleClickRemove =
|
|
695
|
+
const handleClickRemove = useCallback(() => onClickRemove?.(invitation), [
|
|
788
696
|
invitation,
|
|
789
697
|
onClickRemove
|
|
790
698
|
]);
|
|
@@ -813,39 +721,39 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
813
721
|
Invitation.State.SUCCESS
|
|
814
722
|
].includes(invitationStatus);
|
|
815
723
|
const avatarStatus = avatarError ? "error" : avatarGreen ? "active" : "inactive";
|
|
816
|
-
return /* @__PURE__ */
|
|
724
|
+
return /* @__PURE__ */ React10.createElement(ListItem3.Root, {
|
|
817
725
|
id: invitationCode,
|
|
818
726
|
...props,
|
|
819
727
|
classNames: [
|
|
820
728
|
"flex gap-2 pis-3 pie-1 items-center relative",
|
|
821
729
|
props.classNames
|
|
822
730
|
]
|
|
823
|
-
}, /* @__PURE__ */
|
|
731
|
+
}, /* @__PURE__ */ React10.createElement(ListItem3.Heading, {
|
|
824
732
|
classNames: "sr-only"
|
|
825
|
-
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */
|
|
733
|
+
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */ React10.createElement(AvatarStackEffect, {
|
|
826
734
|
status: avatarStatus,
|
|
827
735
|
animation: avatarAnimation,
|
|
828
736
|
reverseEffects
|
|
829
|
-
}), /* @__PURE__ */
|
|
737
|
+
}), /* @__PURE__ */ React10.createElement(Tooltip4.Root, null, /* @__PURE__ */ React10.createElement(Avatar4.Root, {
|
|
830
738
|
...avatarProps,
|
|
831
739
|
animation: avatarAnimation,
|
|
832
740
|
status: avatarStatus
|
|
833
|
-
}, /* @__PURE__ */
|
|
741
|
+
}, /* @__PURE__ */ React10.createElement(Tooltip4.Trigger, {
|
|
834
742
|
asChild: true
|
|
835
|
-
}, /* @__PURE__ */
|
|
743
|
+
}, /* @__PURE__ */ React10.createElement(Avatar4.Frame, {
|
|
836
744
|
tabIndex: 0,
|
|
837
745
|
classNames: [
|
|
838
746
|
focusRing,
|
|
839
747
|
"relative rounded-full place-self-center"
|
|
840
748
|
]
|
|
841
|
-
}, /* @__PURE__ */
|
|
749
|
+
}, /* @__PURE__ */ React10.createElement(Avatar4.Fallback, {
|
|
842
750
|
text: hexToEmoji(invitationId)
|
|
843
|
-
})))), /* @__PURE__ */
|
|
751
|
+
})))), /* @__PURE__ */ React10.createElement(Tooltip4.Portal, null, /* @__PURE__ */ React10.createElement(Tooltip4.Content, {
|
|
844
752
|
side: "left",
|
|
845
753
|
classNames: "z-[70]"
|
|
846
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */
|
|
754
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React10.createElement(Tooltip4.Arrow, null)))), showShare && invitationUrl ? /* @__PURE__ */ React10.createElement(Tooltip4.Root, null, /* @__PURE__ */ React10.createElement(React10.Fragment, null, /* @__PURE__ */ React10.createElement(Tooltip4.Trigger, {
|
|
847
755
|
asChild: true
|
|
848
|
-
}, /* @__PURE__ */
|
|
756
|
+
}, /* @__PURE__ */ React10.createElement(Button6, {
|
|
849
757
|
variant: "ghost",
|
|
850
758
|
classNames: "grow justify-start font-medium",
|
|
851
759
|
onClick: () => send({
|
|
@@ -853,65 +761,65 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
853
761
|
invitation
|
|
854
762
|
}),
|
|
855
763
|
"data-testid": "show-qrcode"
|
|
856
|
-
}, /* @__PURE__ */
|
|
764
|
+
}, /* @__PURE__ */ React10.createElement("span", null, t("open share panel label")))), /* @__PURE__ */ React10.createElement(Clipboard.IconButton, {
|
|
857
765
|
variant: "ghost",
|
|
858
766
|
value: invitationUrl
|
|
859
|
-
})), /* @__PURE__ */
|
|
767
|
+
})), /* @__PURE__ */ React10.createElement(Tooltip4.Portal, null, /* @__PURE__ */ React10.createElement(Tooltip4.Content, {
|
|
860
768
|
side: "left",
|
|
861
769
|
classNames: "z-[70]"
|
|
862
|
-
}, invitationHasLifetime && /* @__PURE__ */
|
|
770
|
+
}, invitationHasLifetime && /* @__PURE__ */ React10.createElement("span", null, "Expires ", invitationTimeLeft)))) : showAuthCode ? /* @__PURE__ */ React10.createElement(AuthCode, {
|
|
863
771
|
code: authCode,
|
|
864
772
|
classNames: "grow"
|
|
865
|
-
}) : invitationStatus === Invitation.State.CONNECTING ? /* @__PURE__ */
|
|
773
|
+
}) : invitationStatus === Invitation.State.CONNECTING ? /* @__PURE__ */ React10.createElement("span", {
|
|
866
774
|
className: "pli-2 grow text-neutral-500"
|
|
867
|
-
}, "Connecting...") : invitationStatus === Invitation.State.AUTHENTICATING ? /* @__PURE__ */
|
|
775
|
+
}, "Connecting...") : invitationStatus === Invitation.State.AUTHENTICATING ? /* @__PURE__ */ React10.createElement("span", {
|
|
868
776
|
className: "pli-2 grow text-neutral-500"
|
|
869
|
-
}, "Authenticating...") : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? /* @__PURE__ */
|
|
777
|
+
}, "Authenticating...") : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? /* @__PURE__ */ React10.createElement("span", {
|
|
870
778
|
className: "pli-2 grow text-neutral-500"
|
|
871
|
-
}, "Failed") : invitationStatus === Invitation.State.CANCELLED ? /* @__PURE__ */
|
|
779
|
+
}, "Failed") : invitationStatus === Invitation.State.CANCELLED ? /* @__PURE__ */ React10.createElement("span", {
|
|
872
780
|
className: "pli-2 grow text-neutral-500"
|
|
873
|
-
}, "Cancelled") : invitationStatus === Invitation.State.SUCCESS ? /* @__PURE__ */
|
|
781
|
+
}, "Cancelled") : invitationStatus === Invitation.State.SUCCESS ? /* @__PURE__ */ React10.createElement("span", {
|
|
874
782
|
className: "pli-2 grow truncate"
|
|
875
|
-
}, "User joined") : !shareable ? /* @__PURE__ */
|
|
783
|
+
}, "User joined") : !shareable ? /* @__PURE__ */ React10.createElement("span", {
|
|
876
784
|
className: "pli-2 grow text-neutral-500"
|
|
877
|
-
}, "Pending Invitation") : /* @__PURE__ */
|
|
785
|
+
}, "Pending Invitation") : /* @__PURE__ */ React10.createElement("span", {
|
|
878
786
|
className: "grow"
|
|
879
|
-
}, " "), isCancellable ? /* @__PURE__ */
|
|
787
|
+
}, " "), isCancellable ? /* @__PURE__ */ React10.createElement(Button6, {
|
|
880
788
|
variant: "ghost",
|
|
881
789
|
classNames: "flex gap-1 pli-0",
|
|
882
790
|
onClick: cancel,
|
|
883
791
|
"data-testid": "cancel-invitation"
|
|
884
|
-
}, /* @__PURE__ */
|
|
792
|
+
}, /* @__PURE__ */ React10.createElement("span", {
|
|
885
793
|
className: "sr-only"
|
|
886
|
-
}, t("cancel invitation label")), /* @__PURE__ */
|
|
887
|
-
className:
|
|
888
|
-
})) : /* @__PURE__ */
|
|
794
|
+
}, t("cancel invitation label")), /* @__PURE__ */ React10.createElement(X, {
|
|
795
|
+
className: getSize6(4)
|
|
796
|
+
})) : /* @__PURE__ */ React10.createElement(Button6, {
|
|
889
797
|
variant: "ghost",
|
|
890
798
|
classNames: "flex gap-1 pli-0",
|
|
891
799
|
onClick: handleClickRemove,
|
|
892
800
|
"data-testid": "remove-invitation"
|
|
893
|
-
}, /* @__PURE__ */
|
|
801
|
+
}, /* @__PURE__ */ React10.createElement("span", {
|
|
894
802
|
className: "sr-only"
|
|
895
|
-
}, t("remove invitation label")), /* @__PURE__ */
|
|
896
|
-
className:
|
|
803
|
+
}, t("remove invitation label")), /* @__PURE__ */ React10.createElement(X, {
|
|
804
|
+
className: getSize6(4)
|
|
897
805
|
})));
|
|
898
806
|
};
|
|
899
807
|
|
|
900
808
|
// packages/sdk/shell/src/components/InvitationList/InvitationListContainer.tsx
|
|
901
|
-
import
|
|
809
|
+
import React12, { useCallback as useCallback2 } from "react";
|
|
902
810
|
import { useSpace, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
903
811
|
|
|
904
812
|
// packages/sdk/shell/src/components/InvitationList/InvitationList.tsx
|
|
905
|
-
import
|
|
813
|
+
import React11 from "react";
|
|
906
814
|
import { List as List3 } from "@dxos/react-ui";
|
|
907
|
-
import { mx as
|
|
815
|
+
import { mx as mx9 } from "@dxos/react-ui-theme";
|
|
908
816
|
var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
909
817
|
const { className, InvitationListItem: Item = InvitationListItem } = invitationProps;
|
|
910
|
-
return /* @__PURE__ */
|
|
911
|
-
classNames:
|
|
818
|
+
return /* @__PURE__ */ React11.createElement(List3, {
|
|
819
|
+
classNames: mx9("flex flex-col gap-2", className)
|
|
912
820
|
}, invitations.map((invitation) => {
|
|
913
821
|
const value = invitation.get().invitationId;
|
|
914
|
-
return /* @__PURE__ */
|
|
822
|
+
return /* @__PURE__ */ React11.createElement(Item, {
|
|
915
823
|
key: value,
|
|
916
824
|
send,
|
|
917
825
|
invitation,
|
|
@@ -924,12 +832,12 @@ var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
|
924
832
|
var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
925
833
|
const space = useSpace(spaceKey);
|
|
926
834
|
const invitations = useSpaceInvitations(spaceKey);
|
|
927
|
-
const handleClickRemove =
|
|
835
|
+
const handleClickRemove = useCallback2((invitation) => {
|
|
928
836
|
void invitation.cancel();
|
|
929
837
|
}, [
|
|
930
838
|
space
|
|
931
839
|
]);
|
|
932
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ React12.createElement(InvitationList, {
|
|
933
841
|
invitations,
|
|
934
842
|
onClickRemove: handleClickRemove,
|
|
935
843
|
createInvitationUrl,
|
|
@@ -938,11 +846,11 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
938
846
|
};
|
|
939
847
|
|
|
940
848
|
// packages/sdk/shell/src/components/Panel/Action.tsx
|
|
941
|
-
import { CaretDown as CaretDown3, Check as
|
|
849
|
+
import { CaretDown as CaretDown3, Check as Check2, Placeholder } from "@phosphor-icons/react";
|
|
942
850
|
import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
|
|
943
|
-
import
|
|
944
|
-
import { Button as
|
|
945
|
-
import { descriptionText as descriptionText5, getSize as
|
|
851
|
+
import React13, { forwardRef as forwardRef3 } from "react";
|
|
852
|
+
import { Button as Button7, DropdownMenu as DropdownMenu3, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
853
|
+
import { descriptionText as descriptionText5, getSize as getSize7, mx as mx10 } from "@dxos/react-ui-theme";
|
|
946
854
|
var defaultActions = {
|
|
947
855
|
noopAction: {
|
|
948
856
|
label: "No-op",
|
|
@@ -961,11 +869,11 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
961
869
|
defaultProp: defaultActiveAction
|
|
962
870
|
});
|
|
963
871
|
const activeAction = actions[activeActionKey2] ?? {};
|
|
964
|
-
const { t } =
|
|
965
|
-
return /* @__PURE__ */
|
|
872
|
+
const { t } = useTranslation8("os");
|
|
873
|
+
return /* @__PURE__ */ React13.createElement("div", {
|
|
966
874
|
role: "none",
|
|
967
|
-
className:
|
|
968
|
-
}, /* @__PURE__ */
|
|
875
|
+
className: mx10("mbs-2 flex gap-px items-center", isFull && "is-full")
|
|
876
|
+
}, /* @__PURE__ */ React13.createElement(Button7, {
|
|
969
877
|
...rest,
|
|
970
878
|
classNames: [
|
|
971
879
|
"bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none",
|
|
@@ -975,22 +883,22 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
975
883
|
variant,
|
|
976
884
|
"data-testid": testId,
|
|
977
885
|
onClick: activeAction.onClick
|
|
978
|
-
}, activeAction.icon && /* @__PURE__ */
|
|
979
|
-
className:
|
|
980
|
-
}), /* @__PURE__ */
|
|
886
|
+
}, activeAction.icon && /* @__PURE__ */ React13.createElement(activeAction.icon, {
|
|
887
|
+
className: getSize7(5)
|
|
888
|
+
}), /* @__PURE__ */ React13.createElement("span", null, activeAction.label)), /* @__PURE__ */ React13.createElement(DropdownMenu3.Root, null, /* @__PURE__ */ React13.createElement(DropdownMenu3.Trigger, {
|
|
981
889
|
asChild: true
|
|
982
|
-
}, /* @__PURE__ */
|
|
890
|
+
}, /* @__PURE__ */ React13.createElement(Button7, {
|
|
983
891
|
classNames: [
|
|
984
892
|
"bs-11 flex-none rounded-is-none",
|
|
985
893
|
classNames
|
|
986
894
|
],
|
|
987
895
|
"data-testid": dropdownTestId
|
|
988
|
-
}, /* @__PURE__ */
|
|
896
|
+
}, /* @__PURE__ */ React13.createElement("span", {
|
|
989
897
|
className: "sr-only"
|
|
990
|
-
}, t("invite options label")), /* @__PURE__ */
|
|
991
|
-
className:
|
|
992
|
-
}))), /* @__PURE__ */
|
|
993
|
-
return /* @__PURE__ */
|
|
898
|
+
}, t("invite options label")), /* @__PURE__ */ React13.createElement(CaretDown3, {
|
|
899
|
+
className: getSize7(4)
|
|
900
|
+
}))), /* @__PURE__ */ React13.createElement(DropdownMenu3.Portal, null, /* @__PURE__ */ React13.createElement(DropdownMenu3.Content, null, /* @__PURE__ */ React13.createElement(DropdownMenu3.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
901
|
+
return /* @__PURE__ */ React13.createElement(DropdownMenu3.CheckboxItem, {
|
|
994
902
|
key: id,
|
|
995
903
|
"aria-labelledby": `${id}__label`,
|
|
996
904
|
"aria-describedby": `${id}__description`,
|
|
@@ -998,27 +906,27 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
998
906
|
onCheckedChange: (checked) => checked && setActiveAction(id),
|
|
999
907
|
classNames: "gap-2",
|
|
1000
908
|
"data-testid": action.testId
|
|
1001
|
-
}, action.icon && /* @__PURE__ */
|
|
1002
|
-
className:
|
|
1003
|
-
}), /* @__PURE__ */
|
|
909
|
+
}, action.icon && /* @__PURE__ */ React13.createElement(action.icon, {
|
|
910
|
+
className: getSize7(5)
|
|
911
|
+
}), /* @__PURE__ */ React13.createElement("div", {
|
|
1004
912
|
role: "none",
|
|
1005
913
|
className: "flex-1 min-is-0 space-b-1"
|
|
1006
|
-
}, /* @__PURE__ */
|
|
914
|
+
}, /* @__PURE__ */ React13.createElement("p", {
|
|
1007
915
|
id: `${id}__label`
|
|
1008
|
-
}, action.label), action.description && /* @__PURE__ */
|
|
916
|
+
}, action.label), action.description && /* @__PURE__ */ React13.createElement("p", {
|
|
1009
917
|
id: `${id}__description`,
|
|
1010
918
|
className: descriptionText5
|
|
1011
|
-
}, action.description)), /* @__PURE__ */
|
|
919
|
+
}, action.description)), /* @__PURE__ */ React13.createElement(DropdownMenu3.ItemIndicator, {
|
|
1012
920
|
asChild: true
|
|
1013
|
-
}, /* @__PURE__ */
|
|
921
|
+
}, /* @__PURE__ */ React13.createElement(Check2, {
|
|
1014
922
|
weight: "bold",
|
|
1015
|
-
className:
|
|
923
|
+
className: getSize7(4)
|
|
1016
924
|
})));
|
|
1017
|
-
})), /* @__PURE__ */
|
|
925
|
+
})), /* @__PURE__ */ React13.createElement(DropdownMenu3.Arrow, null)))));
|
|
1018
926
|
});
|
|
1019
927
|
var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
1020
928
|
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
1021
|
-
return /* @__PURE__ */
|
|
929
|
+
return /* @__PURE__ */ React13.createElement(Button7, {
|
|
1022
930
|
...rest,
|
|
1023
931
|
classNames: [
|
|
1024
932
|
isFull && "is-full",
|
|
@@ -1031,49 +939,49 @@ var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
1031
939
|
});
|
|
1032
940
|
|
|
1033
941
|
// packages/sdk/shell/src/components/Panel/Actions.tsx
|
|
1034
|
-
import
|
|
1035
|
-
import { mx as
|
|
942
|
+
import React14, { forwardRef as forwardRef4 } from "react";
|
|
943
|
+
import { mx as mx11 } from "@dxos/react-ui-theme";
|
|
1036
944
|
var Actions = /* @__PURE__ */ forwardRef4(({ classNames, children, ...props }, forwardedRef) => {
|
|
1037
|
-
return /* @__PURE__ */
|
|
945
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
1038
946
|
...props,
|
|
1039
|
-
className:
|
|
947
|
+
className: mx11("flex flex-col gap-2 mbs-2", Array.isArray(children) && children.length > 1 ? "justify-between" : "justify-center", classNames),
|
|
1040
948
|
ref: forwardedRef
|
|
1041
949
|
}, children);
|
|
1042
950
|
});
|
|
1043
951
|
|
|
1044
952
|
// packages/sdk/shell/src/components/Panel/CloseButton.tsx
|
|
1045
953
|
import { X as X2 } from "@phosphor-icons/react";
|
|
1046
|
-
import
|
|
1047
|
-
import { Button as
|
|
1048
|
-
import { getSize as
|
|
954
|
+
import React15 from "react";
|
|
955
|
+
import { Button as Button8, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
956
|
+
import { getSize as getSize8, mx as mx12 } from "@dxos/react-ui-theme";
|
|
1049
957
|
var CloseButton = ({ onDone, ...props }) => {
|
|
1050
|
-
const { t } =
|
|
1051
|
-
return /* @__PURE__ */
|
|
958
|
+
const { t } = useTranslation9("os");
|
|
959
|
+
return /* @__PURE__ */ React15.createElement(Button8, {
|
|
1052
960
|
variant: "ghost",
|
|
1053
|
-
classNames:
|
|
961
|
+
classNames: mx12("plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
1054
962
|
onClick: () => onDone?.(),
|
|
1055
963
|
...props
|
|
1056
|
-
}, /* @__PURE__ */
|
|
964
|
+
}, /* @__PURE__ */ React15.createElement(X2, {
|
|
1057
965
|
weight: "bold",
|
|
1058
|
-
className:
|
|
1059
|
-
}), /* @__PURE__ */
|
|
966
|
+
className: getSize8(4)
|
|
967
|
+
}), /* @__PURE__ */ React15.createElement("span", {
|
|
1060
968
|
className: "sr-only"
|
|
1061
969
|
}, t("exit label")));
|
|
1062
970
|
};
|
|
1063
971
|
|
|
1064
972
|
// packages/sdk/shell/src/components/Panel/Emoji.tsx
|
|
1065
|
-
import
|
|
1066
|
-
import { mx as
|
|
973
|
+
import React16 from "react";
|
|
974
|
+
import { mx as mx13, getSize as getSize9 } from "@dxos/react-ui-theme";
|
|
1067
975
|
var Emoji = ({ text, className }) => {
|
|
1068
976
|
const size = 14;
|
|
1069
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1070
978
|
role: "none",
|
|
1071
|
-
className:
|
|
1072
|
-
}, /* @__PURE__ */
|
|
979
|
+
className: mx13(getSize9(size), "rounded relative pointer-events-none", className)
|
|
980
|
+
}, /* @__PURE__ */ React16.createElement("svg", {
|
|
1073
981
|
viewBox: `0 0 ${size * 4} ${size * 4}`,
|
|
1074
982
|
width: size * 4,
|
|
1075
983
|
height: size * 4
|
|
1076
|
-
}, /* @__PURE__ */
|
|
984
|
+
}, /* @__PURE__ */ React16.createElement("text", {
|
|
1077
985
|
x: "50%",
|
|
1078
986
|
y: "50%",
|
|
1079
987
|
textAnchor: "middle",
|
|
@@ -1084,57 +992,57 @@ var Emoji = ({ text, className }) => {
|
|
|
1084
992
|
};
|
|
1085
993
|
var Centered = (props) => {
|
|
1086
994
|
const { children } = props;
|
|
1087
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ React16.createElement("div", {
|
|
1088
996
|
role: "none",
|
|
1089
997
|
className: "absolute inset-0 flex items-center justify-center"
|
|
1090
998
|
}, children);
|
|
1091
999
|
};
|
|
1092
1000
|
|
|
1093
1001
|
// packages/sdk/shell/src/components/Panel/Heading.tsx
|
|
1094
|
-
import
|
|
1095
|
-
import { descriptionText as descriptionText6, mx as
|
|
1002
|
+
import React17, { forwardRef as forwardRef5 } from "react";
|
|
1003
|
+
import { descriptionText as descriptionText6, mx as mx14 } from "@dxos/react-ui-theme";
|
|
1096
1004
|
var Heading = /* @__PURE__ */ forwardRef5(({ titleId, title, titleSrOnly, children, corner }, forwardedRef) => {
|
|
1097
|
-
return /* @__PURE__ */
|
|
1005
|
+
return /* @__PURE__ */ React17.createElement("div", {
|
|
1098
1006
|
role: "none",
|
|
1099
1007
|
className: "pbe-2 relative",
|
|
1100
1008
|
ref: forwardedRef
|
|
1101
|
-
}, corner, /* @__PURE__ */
|
|
1009
|
+
}, corner, /* @__PURE__ */ React17.createElement("h1", {
|
|
1102
1010
|
...!titleSrOnly && {
|
|
1103
1011
|
id: titleId
|
|
1104
1012
|
},
|
|
1105
|
-
className:
|
|
1106
|
-
}, title), titleSrOnly && /* @__PURE__ */
|
|
1013
|
+
className: mx14(descriptionText6, "text-center mlb-2", titleSrOnly && "invisible")
|
|
1014
|
+
}, title), titleSrOnly && /* @__PURE__ */ React17.createElement("span", {
|
|
1107
1015
|
id: titleId
|
|
1108
1016
|
}, title), children);
|
|
1109
1017
|
});
|
|
1110
1018
|
|
|
1111
1019
|
// packages/sdk/shell/src/components/Panel/Label.tsx
|
|
1112
|
-
import
|
|
1113
|
-
import { descriptionText as descriptionText7, mx as
|
|
1020
|
+
import React18 from "react";
|
|
1021
|
+
import { descriptionText as descriptionText7, mx as mx15 } from "@dxos/react-ui-theme";
|
|
1114
1022
|
var Label = (props) => {
|
|
1115
1023
|
const { children } = props;
|
|
1116
|
-
return /* @__PURE__ */
|
|
1117
|
-
className:
|
|
1024
|
+
return /* @__PURE__ */ React18.createElement("span", {
|
|
1025
|
+
className: mx15(descriptionText7, "text-center mli-6 whitespace-normal")
|
|
1118
1026
|
}, children);
|
|
1119
1027
|
};
|
|
1120
1028
|
|
|
1121
1029
|
// packages/sdk/shell/src/components/Panel/Input.tsx
|
|
1122
|
-
import
|
|
1030
|
+
import React19 from "react";
|
|
1123
1031
|
import { Input as UiInput } from "@dxos/react-ui";
|
|
1124
1032
|
var Input = ({ validationMessage, label, ...props }) => {
|
|
1125
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ React19.createElement(UiInput.Root, null, /* @__PURE__ */ React19.createElement(UiInput.Label, null, label), /* @__PURE__ */ React19.createElement(UiInput.TextInput, {
|
|
1126
1034
|
...props,
|
|
1127
1035
|
classNames: "plb-3 mbs-2 text-center"
|
|
1128
|
-
}), /* @__PURE__ */
|
|
1036
|
+
}), /* @__PURE__ */ React19.createElement(UiInput.DescriptionAndValidation, null, validationMessage && /* @__PURE__ */ React19.createElement(UiInput.Validation, null, validationMessage)));
|
|
1129
1037
|
};
|
|
1130
1038
|
|
|
1131
1039
|
// packages/sdk/shell/src/components/Panel/StepHeading.tsx
|
|
1132
|
-
import
|
|
1133
|
-
import { mx as
|
|
1040
|
+
import React20, { forwardRef as forwardRef6 } from "react";
|
|
1041
|
+
import { mx as mx16 } from "@dxos/react-ui-theme";
|
|
1134
1042
|
var StepHeading = /* @__PURE__ */ forwardRef6(({ children, className, ...props }, forwardedRef) => {
|
|
1135
|
-
return /* @__PURE__ */
|
|
1043
|
+
return /* @__PURE__ */ React20.createElement("h2", {
|
|
1136
1044
|
...props,
|
|
1137
|
-
className:
|
|
1045
|
+
className: mx16("font-normal text-sm mbe-4 mli-1 text-center", className),
|
|
1138
1046
|
ref: forwardedRef
|
|
1139
1047
|
}, children);
|
|
1140
1048
|
});
|
|
@@ -1143,9 +1051,9 @@ var StepHeading = /* @__PURE__ */ forwardRef6(({ children, className, ...props }
|
|
|
1143
1051
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
1144
1052
|
import { createContextScope } from "@radix-ui/react-context";
|
|
1145
1053
|
import { useControllableState as useControllableState4 } from "@radix-ui/react-use-controllable-state";
|
|
1146
|
-
import
|
|
1054
|
+
import React21, { forwardRef as forwardRef7, useEffect } from "react";
|
|
1147
1055
|
import { useForwardedRef } from "@dxos/react-ui";
|
|
1148
|
-
import { mx as
|
|
1056
|
+
import { mx as mx17 } from "@dxos/react-ui-theme";
|
|
1149
1057
|
var VIEWPORT_NAME = "Viewport";
|
|
1150
1058
|
var VIEWS_NAME = "ViewportViews";
|
|
1151
1059
|
var VIEW_NAME = "ViewportView";
|
|
@@ -1157,16 +1065,16 @@ var ViewportRoot = ({ __viewportScope, classNames, children, defaultActiveView,
|
|
|
1157
1065
|
defaultProp: defaultActiveView,
|
|
1158
1066
|
onChange: onActiveViewChange
|
|
1159
1067
|
});
|
|
1160
|
-
return /* @__PURE__ */
|
|
1068
|
+
return /* @__PURE__ */ React21.createElement(ViewportProvider, {
|
|
1161
1069
|
focusManaged,
|
|
1162
1070
|
activeView,
|
|
1163
1071
|
setActiveView,
|
|
1164
1072
|
scope: __viewportScope
|
|
1165
|
-
}, /* @__PURE__ */
|
|
1073
|
+
}, /* @__PURE__ */ React21.createElement("div", {
|
|
1166
1074
|
role: "region",
|
|
1167
1075
|
"aria-live": "polite",
|
|
1168
1076
|
...props,
|
|
1169
|
-
className:
|
|
1077
|
+
className: mx17("is-full overflow-hidden", classNames)
|
|
1170
1078
|
}, children));
|
|
1171
1079
|
};
|
|
1172
1080
|
ViewportRoot.displayName = VIEWPORT_NAME;
|
|
@@ -1174,11 +1082,11 @@ var ViewportViews = ({ classNames, children, ...props }) => {
|
|
|
1174
1082
|
const size = {
|
|
1175
1083
|
inlineSize: `${Math.ceil(children.length) * 100}%`
|
|
1176
1084
|
};
|
|
1177
|
-
return /* @__PURE__ */
|
|
1085
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1178
1086
|
role: "none",
|
|
1179
1087
|
style: size,
|
|
1180
1088
|
...props,
|
|
1181
|
-
className:
|
|
1089
|
+
className: mx17("flex", classNames)
|
|
1182
1090
|
}, children);
|
|
1183
1091
|
};
|
|
1184
1092
|
ViewportViews.displayName = VIEWS_NAME;
|
|
@@ -1196,12 +1104,12 @@ var ViewportView = /* @__PURE__ */ forwardRef7(({ __viewportScope, classNames, c
|
|
|
1196
1104
|
ref.current,
|
|
1197
1105
|
isActive
|
|
1198
1106
|
]);
|
|
1199
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ React21.createElement("section", {
|
|
1200
1108
|
...props,
|
|
1201
1109
|
...!isActive && {
|
|
1202
1110
|
"aria-hidden": true
|
|
1203
1111
|
},
|
|
1204
|
-
className:
|
|
1112
|
+
className: mx17("min-is-0 flex-1 flex flex-col", isActive ? "order-2" : "order-4 invisible", classNames),
|
|
1205
1113
|
ref
|
|
1206
1114
|
}, children);
|
|
1207
1115
|
});
|
|
@@ -1213,44 +1121,43 @@ var Viewport = {
|
|
|
1213
1121
|
};
|
|
1214
1122
|
|
|
1215
1123
|
// packages/sdk/shell/src/components/SpaceListItem.tsx
|
|
1216
|
-
import
|
|
1124
|
+
import React22, { forwardRef as forwardRef8 } from "react";
|
|
1217
1125
|
import { Avatar as Avatar5, useId as useId4 } from "@dxos/react-ui";
|
|
1218
|
-
import { mx as
|
|
1126
|
+
import { mx as mx18 } from "@dxos/react-ui-theme";
|
|
1219
1127
|
import { humanize, keyToEmoji } from "@dxos/util";
|
|
1220
1128
|
var SpaceListItem = /* @__PURE__ */ forwardRef8(({ space, onClick }, ref) => {
|
|
1221
1129
|
const fallbackValue = keyToEmoji(space.key);
|
|
1222
1130
|
const labelId = useId4("identityListItem__label");
|
|
1223
1131
|
const displayName = space.properties.name ?? humanize(space.key.toHex());
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
className:
|
|
1132
|
+
return /* @__PURE__ */ React22.createElement("li", {
|
|
1133
|
+
className: mx18("flex gap-2 items-center mbe-2", onClick && "cursor-pointer"),
|
|
1226
1134
|
onClick: () => onClick?.(),
|
|
1227
1135
|
ref,
|
|
1228
1136
|
"data-testid": "space-list-item"
|
|
1229
|
-
}, /* @__PURE__ */
|
|
1137
|
+
}, /* @__PURE__ */ React22.createElement(Avatar5.Root, {
|
|
1230
1138
|
labelId
|
|
1231
|
-
}, /* @__PURE__ */
|
|
1139
|
+
}, /* @__PURE__ */ React22.createElement(Avatar5.Frame, null, /* @__PURE__ */ React22.createElement(Avatar5.Fallback, {
|
|
1232
1140
|
text: fallbackValue
|
|
1233
|
-
})), /* @__PURE__ */
|
|
1141
|
+
})), /* @__PURE__ */ React22.createElement(Avatar5.Label, {
|
|
1234
1142
|
classNames: "text-sm truncate"
|
|
1235
1143
|
}, displayName)));
|
|
1236
1144
|
});
|
|
1237
1145
|
|
|
1238
1146
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
1239
|
-
import
|
|
1240
|
-
import { Dialog, useId as useId10 } from "@dxos/react-ui";
|
|
1147
|
+
import React40 from "react";
|
|
1148
|
+
import { Clipboard as Clipboard3, Dialog, useId as useId10 } from "@dxos/react-ui";
|
|
1241
1149
|
|
|
1242
1150
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1243
|
-
import {
|
|
1244
|
-
import
|
|
1151
|
+
import { Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1152
|
+
import React27, { useEffect as useEffect4, useMemo as useMemo3, useState as useState7 } from "react";
|
|
1245
1153
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1246
|
-
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1247
1154
|
import { log as log7 } from "@dxos/log";
|
|
1248
1155
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1249
1156
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1250
1157
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1251
1158
|
import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
|
|
1252
|
-
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as
|
|
1253
|
-
import { getSize as
|
|
1159
|
+
import { Avatar as Avatar6, Input as Input2, Toolbar as Toolbar3, Tooltip as Tooltip5, useClipboard as useClipboard2, useId as useId6, useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
1160
|
+
import { getSize as getSize12 } from "@dxos/react-ui-theme";
|
|
1254
1161
|
import { hexToEmoji as hexToEmoji4, hexToHue as hexToHue2, keyToFallback as keyToFallback3 } from "@dxos/util";
|
|
1255
1162
|
|
|
1256
1163
|
// packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts
|
|
@@ -1366,7 +1273,7 @@ var useIdentityMachine = (client, options) => {
|
|
|
1366
1273
|
};
|
|
1367
1274
|
|
|
1368
1275
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1369
|
-
import
|
|
1276
|
+
import React23 from "react";
|
|
1370
1277
|
import { log as log2 } from "@dxos/log";
|
|
1371
1278
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
1372
1279
|
import { useHaloInvitations, DeviceType as DeviceType2 } from "@dxos/react-client/halo";
|
|
@@ -1402,7 +1309,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1402
1309
|
});
|
|
1403
1310
|
};
|
|
1404
1311
|
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1405
|
-
return /* @__PURE__ */
|
|
1312
|
+
return /* @__PURE__ */ React23.createElement(IdentityActionChooserImpl, {
|
|
1406
1313
|
...props,
|
|
1407
1314
|
onClickAdd: createInvitation,
|
|
1408
1315
|
onClickJoinExisting: () => send?.({
|
|
@@ -1418,10 +1325,10 @@ var IdentityActionChooser = (props) => {
|
|
|
1418
1325
|
};
|
|
1419
1326
|
var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
1420
1327
|
const edgeDeviceAvailable = devices.find((device) => device.profile?.type === DeviceType2.AGENT_MANAGED && device.profile?.os?.toUpperCase() === "EDGE");
|
|
1421
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ React23.createElement("div", {
|
|
1422
1329
|
role: "none",
|
|
1423
1330
|
className: "bs-40 grow overflow-y-auto"
|
|
1424
|
-
}, /* @__PURE__ */
|
|
1331
|
+
}, /* @__PURE__ */ React23.createElement(DeviceList, {
|
|
1425
1332
|
devices,
|
|
1426
1333
|
connectionState,
|
|
1427
1334
|
onClickAdd,
|
|
@@ -1429,20 +1336,20 @@ var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled
|
|
|
1429
1336
|
onClickRecover: agentProps.agentStatus === "created" ? onClickRecover : void 0,
|
|
1430
1337
|
onClickReset,
|
|
1431
1338
|
onAgentDestroy: agentProps.onAgentDestroy
|
|
1432
|
-
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */
|
|
1339
|
+
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ React23.createElement(AgentConfig, agentProps));
|
|
1433
1340
|
};
|
|
1434
1341
|
|
|
1435
1342
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
1436
|
-
import
|
|
1343
|
+
import React24, { useState as useState3 } from "react";
|
|
1437
1344
|
import { log as log3 } from "@dxos/log";
|
|
1438
|
-
import { useTranslation as
|
|
1345
|
+
import { useClipboard, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
1439
1346
|
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
1440
1347
|
|
|
1441
1348
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1442
1349
|
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1443
1350
|
|
|
1444
1351
|
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1445
|
-
import { useEffect as useEffect2, useState as
|
|
1352
|
+
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
1446
1353
|
import { invariant } from "@dxos/invariant";
|
|
1447
1354
|
import { log as log4 } from "@dxos/log";
|
|
1448
1355
|
import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1450,9 +1357,9 @@ import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata
|
|
|
1450
1357
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
1451
1358
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1452
1359
|
var useEdgeAgentHandlers = ({ identity }) => {
|
|
1453
|
-
const [validationMessage, setValidationMessage] =
|
|
1454
|
-
const [lastReceivedStatus, setLastReceivedStatus] =
|
|
1455
|
-
const [agentStatus, setAgentStatus] =
|
|
1360
|
+
const [validationMessage, setValidationMessage] = useState4("");
|
|
1361
|
+
const [lastReceivedStatus, setLastReceivedStatus] = useState4(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1362
|
+
const [agentStatus, setAgentStatus] = useState4("getting");
|
|
1456
1363
|
const client = useClient3();
|
|
1457
1364
|
const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1458
1365
|
const handleStatus = (status) => {
|
|
@@ -1538,15 +1445,15 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1538
1445
|
};
|
|
1539
1446
|
|
|
1540
1447
|
// packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
|
|
1541
|
-
import { useCallback as
|
|
1448
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useState as useState5 } from "react";
|
|
1542
1449
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1543
1450
|
import { log as log5 } from "@dxos/log";
|
|
1544
1451
|
import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
|
|
1545
1452
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1546
1453
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
1547
1454
|
var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
1548
|
-
const [validationMessage, setValidationMessage] =
|
|
1549
|
-
const [agentStatus, setAgentStatus] =
|
|
1455
|
+
const [validationMessage, setValidationMessage] = useState5("");
|
|
1456
|
+
const [agentStatus, setAgentStatus] = useState5("getting");
|
|
1550
1457
|
const agentHostingProviderClient = useAgentHostingClient();
|
|
1551
1458
|
const client = useClient4();
|
|
1552
1459
|
const updateAgentStatus = async () => {
|
|
@@ -1626,7 +1533,7 @@ var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
|
1626
1533
|
useEffect3(() => {
|
|
1627
1534
|
void updateAgentStatus();
|
|
1628
1535
|
}, []);
|
|
1629
|
-
const handleAgentCreate =
|
|
1536
|
+
const handleAgentCreate = useCallback3(async (invitation) => {
|
|
1630
1537
|
const invitationCode = InvitationEncoder2.encode(invitation);
|
|
1631
1538
|
if (invitation.state === Invitation3.State.CONNECTING) {
|
|
1632
1539
|
log5.info(JSON.stringify({
|
|
@@ -1675,11 +1582,11 @@ var useAgentHandlers = (params) => {
|
|
|
1675
1582
|
};
|
|
1676
1583
|
|
|
1677
1584
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1678
|
-
import { Check as
|
|
1679
|
-
import
|
|
1585
|
+
import { Check as Check3, X as X3 } from "@phosphor-icons/react";
|
|
1586
|
+
import React25, { useMemo as useMemo2 } from "react";
|
|
1680
1587
|
import { QR } from "react-qr-rounded";
|
|
1681
|
-
import { useId as useId5, useTranslation as
|
|
1682
|
-
import { descriptionText as descriptionText8, getSize as
|
|
1588
|
+
import { Clipboard as Clipboard2, useId as useId5, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
1589
|
+
import { descriptionText as descriptionText8, getSize as getSize10, mx as mx19 } from "@dxos/react-ui-theme";
|
|
1683
1590
|
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1684
1591
|
|
|
1685
1592
|
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
@@ -1725,13 +1632,13 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
1725
1632
|
|
|
1726
1633
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1727
1634
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1728
|
-
return /* @__PURE__ */
|
|
1635
|
+
return /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1729
1636
|
...props,
|
|
1730
1637
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1731
1638
|
}, children);
|
|
1732
1639
|
};
|
|
1733
1640
|
var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCode, id = "0" }) => {
|
|
1734
|
-
const { t } =
|
|
1641
|
+
const { t } = useTranslation11("os");
|
|
1735
1642
|
const qrLabel = useId5("invitation-manager__qr-code");
|
|
1736
1643
|
const statusValue = multiUse ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1737
1644
|
const showAuthCode = statusValue === 3;
|
|
@@ -1752,50 +1659,50 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1752
1659
|
}, [
|
|
1753
1660
|
statusValue
|
|
1754
1661
|
]);
|
|
1755
|
-
return /* @__PURE__ */
|
|
1662
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(Viewport.Root, {
|
|
1756
1663
|
activeView,
|
|
1757
1664
|
classNames: "grow plb-1"
|
|
1758
|
-
}, /* @__PURE__ */
|
|
1665
|
+
}, /* @__PURE__ */ React25.createElement(Viewport.Views, null, /* @__PURE__ */ React25.createElement(InvitationManagerView, {
|
|
1759
1666
|
id: "showing qr",
|
|
1760
1667
|
emoji
|
|
1761
|
-
}, /* @__PURE__ */
|
|
1668
|
+
}, /* @__PURE__ */ React25.createElement("p", {
|
|
1762
1669
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1763
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1670
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React25.createElement("div", {
|
|
1764
1671
|
role: "none",
|
|
1765
|
-
className:
|
|
1766
|
-
}, /* @__PURE__ */
|
|
1672
|
+
className: mx19(descriptionText8, "is-full max-is-[14rem] relative")
|
|
1673
|
+
}, /* @__PURE__ */ React25.createElement(QR, {
|
|
1767
1674
|
rounding: 100,
|
|
1768
1675
|
backgroundColor: "transparent",
|
|
1769
1676
|
color: "currentColor",
|
|
1770
|
-
className:
|
|
1677
|
+
className: mx19("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1771
1678
|
"aria-labelledby": qrLabel,
|
|
1772
1679
|
errorCorrectionLevel: "Q",
|
|
1773
1680
|
cutout: true
|
|
1774
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1681
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React25.createElement(Centered, null, /* @__PURE__ */ React25.createElement(Emoji, {
|
|
1775
1682
|
text: emoji
|
|
1776
|
-
}))), /* @__PURE__ */
|
|
1683
|
+
}))), /* @__PURE__ */ React25.createElement("span", {
|
|
1777
1684
|
id: qrLabel,
|
|
1778
1685
|
className: "sr-only"
|
|
1779
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1686
|
+
}, t("qr label")), /* @__PURE__ */ React25.createElement(Clipboard2.Button, {
|
|
1780
1687
|
variant: "ghost",
|
|
1781
1688
|
value: invitationUrl ?? "never"
|
|
1782
|
-
})), /* @__PURE__ */
|
|
1689
|
+
})), /* @__PURE__ */ React25.createElement(InvitationManagerView, {
|
|
1783
1690
|
id: "showing auth code"
|
|
1784
|
-
}, /* @__PURE__ */
|
|
1691
|
+
}, /* @__PURE__ */ React25.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React25.createElement(AuthCode, {
|
|
1785
1692
|
code: authCode,
|
|
1786
1693
|
large: true,
|
|
1787
1694
|
classNames: "text-black dark:text-white"
|
|
1788
|
-
}), /* @__PURE__ */
|
|
1695
|
+
}), /* @__PURE__ */ React25.createElement(Label, null, t("auth other device emoji message")), emoji && /* @__PURE__ */ React25.createElement(Emoji, {
|
|
1789
1696
|
text: emoji
|
|
1790
|
-
})), /* @__PURE__ */
|
|
1697
|
+
})), /* @__PURE__ */ React25.createElement(InvitationManagerView, {
|
|
1791
1698
|
id: "showing final"
|
|
1792
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1793
|
-
className:
|
|
1794
|
-
}) : /* @__PURE__ */
|
|
1795
|
-
className:
|
|
1796
|
-
})))), /* @__PURE__ */
|
|
1699
|
+
}, statusValue > 0 ? /* @__PURE__ */ React25.createElement(Check3, {
|
|
1700
|
+
className: mx19("m-1.5", getSize10(6))
|
|
1701
|
+
}) : /* @__PURE__ */ React25.createElement(X3, {
|
|
1702
|
+
className: mx19("m-1.5", getSize10(6))
|
|
1703
|
+
})))), /* @__PURE__ */ React25.createElement(Actions, {
|
|
1797
1704
|
classNames: "mbs-4"
|
|
1798
|
-
}, /* @__PURE__ */
|
|
1705
|
+
}, /* @__PURE__ */ React25.createElement(Action, {
|
|
1799
1706
|
disabled: !active,
|
|
1800
1707
|
onClick: () => send?.({
|
|
1801
1708
|
type: "deselectInvitation"
|
|
@@ -1805,15 +1712,15 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1805
1712
|
|
|
1806
1713
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1807
1714
|
import { Warning } from "@phosphor-icons/react";
|
|
1808
|
-
import
|
|
1715
|
+
import React26, { useState as useState6 } from "react";
|
|
1809
1716
|
import { log as log6 } from "@dxos/log";
|
|
1810
|
-
import { Message, useTranslation as
|
|
1811
|
-
import { getSize as
|
|
1717
|
+
import { Message, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1718
|
+
import { getSize as getSize11, mx as mx20 } from "@dxos/react-ui-theme";
|
|
1812
1719
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1813
1720
|
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1814
|
-
const { t } =
|
|
1815
|
-
const [validationMessage, setValidationMessage] =
|
|
1816
|
-
const [pending, setPending] =
|
|
1721
|
+
const { t } = useTranslation12("os");
|
|
1722
|
+
const [validationMessage, setValidationMessage] = useState6("");
|
|
1723
|
+
const [pending, setPending] = useState6(false);
|
|
1817
1724
|
const processReset = async () => {
|
|
1818
1725
|
setPending(true);
|
|
1819
1726
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
@@ -1827,7 +1734,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1827
1734
|
setPending(false);
|
|
1828
1735
|
});
|
|
1829
1736
|
};
|
|
1830
|
-
return /* @__PURE__ */
|
|
1737
|
+
return /* @__PURE__ */ React26.createElement(ConfirmResetImpl, {
|
|
1831
1738
|
disabled: !active,
|
|
1832
1739
|
pending,
|
|
1833
1740
|
validationMessage,
|
|
@@ -1837,20 +1744,20 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1837
1744
|
});
|
|
1838
1745
|
};
|
|
1839
1746
|
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1840
|
-
const { t } =
|
|
1747
|
+
const { t } = useTranslation12("os");
|
|
1841
1748
|
const confirmationValue = t("confirmation value");
|
|
1842
|
-
const [inputValue, setInputValue] =
|
|
1749
|
+
const [inputValue, setInputValue] = useState6("");
|
|
1843
1750
|
const testIdAffix = mode === "join new identity" ? "join-new-identity" : mode === "recover" ? "recover" : "reset-storage";
|
|
1844
|
-
return /* @__PURE__ */
|
|
1751
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement("div", {
|
|
1845
1752
|
role: "none",
|
|
1846
1753
|
className: "grow flex flex-col gap-2 justify-center"
|
|
1847
|
-
}, /* @__PURE__ */
|
|
1754
|
+
}, /* @__PURE__ */ React26.createElement(Message.Root, {
|
|
1848
1755
|
valence: "error"
|
|
1849
|
-
}, /* @__PURE__ */
|
|
1850
|
-
className:
|
|
1851
|
-
}), t("sign out chooser title")), /* @__PURE__ */
|
|
1756
|
+
}, /* @__PURE__ */ React26.createElement(Message.Title, null, /* @__PURE__ */ React26.createElement(Warning, {
|
|
1757
|
+
className: mx20(getSize11(6), "inline mie-2")
|
|
1758
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React26.createElement(Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ React26.createElement(Input, {
|
|
1852
1759
|
validationMessage,
|
|
1853
|
-
label: /* @__PURE__ */
|
|
1760
|
+
label: /* @__PURE__ */ React26.createElement(StepHeading, {
|
|
1854
1761
|
className: "text-start mlb-2"
|
|
1855
1762
|
}, t(mode === "join new identity" ? "join new identity input label" : mode === "recover" ? "recover reset input label" : "reset storage input label", {
|
|
1856
1763
|
confirmationValue
|
|
@@ -1861,11 +1768,11 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1861
1768
|
confirmationValue
|
|
1862
1769
|
}),
|
|
1863
1770
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1864
|
-
})), /* @__PURE__ */
|
|
1771
|
+
})), /* @__PURE__ */ React26.createElement(Actions, null, onCancel && /* @__PURE__ */ React26.createElement(Action, {
|
|
1865
1772
|
disabled,
|
|
1866
1773
|
onClick: onCancel,
|
|
1867
1774
|
"data-testid": `${testIdAffix}.reset-identity-cancel`
|
|
1868
|
-
}, t("cancel label")), onConfirm && /* @__PURE__ */
|
|
1775
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ React26.createElement(Action, {
|
|
1869
1776
|
variant: "destructive",
|
|
1870
1777
|
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1871
1778
|
onClick: onConfirm,
|
|
@@ -1878,14 +1785,13 @@ var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/I
|
|
|
1878
1785
|
var viewStyles = "pbs-1 pbe-3 pli-3";
|
|
1879
1786
|
var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identity?.identityKey.toHex() ?? "0");
|
|
1880
1787
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1881
|
-
var IdentityHeading = ({ titleId, title, identity,
|
|
1882
|
-
const client = useClient6();
|
|
1788
|
+
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1883
1789
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1884
|
-
const { t } =
|
|
1885
|
-
const [displayName, setDisplayName] =
|
|
1886
|
-
const [emoji, setEmojiDirectly] =
|
|
1887
|
-
const [hue, setHueDirectly] =
|
|
1888
|
-
const { textValue, setTextValue } =
|
|
1790
|
+
const { t } = useTranslation13("os");
|
|
1791
|
+
const [displayName, setDisplayName] = useState7(identity.profile?.displayName ?? "");
|
|
1792
|
+
const [emoji, setEmojiDirectly] = useState7(getEmojiValue(identity));
|
|
1793
|
+
const [hue, setHueDirectly] = useState7(getHueValue(identity));
|
|
1794
|
+
const { textValue, setTextValue } = useClipboard2();
|
|
1889
1795
|
const identityHex = identity.identityKey.toHex();
|
|
1890
1796
|
const publicKeyCopied = textValue === identityHex;
|
|
1891
1797
|
const setEmoji = (nextEmoji) => {
|
|
@@ -1908,43 +1814,30 @@ var IdentityHeading = ({ titleId, title, identity, hideRecover, onDone, onUpdate
|
|
|
1908
1814
|
}
|
|
1909
1815
|
});
|
|
1910
1816
|
};
|
|
1911
|
-
const handleRecoveryCode = async () => {
|
|
1912
|
-
invariant3(client.services.services.IdentityService, "IdentityService not available", {
|
|
1913
|
-
F: __dxlog_file6,
|
|
1914
|
-
L: 77,
|
|
1915
|
-
S: void 0,
|
|
1916
|
-
A: [
|
|
1917
|
-
"client.services.services.IdentityService",
|
|
1918
|
-
"'IdentityService not available'"
|
|
1919
|
-
]
|
|
1920
|
-
});
|
|
1921
|
-
const { seedphrase } = await client.services.services.IdentityService.createRecoveryPhrase();
|
|
1922
|
-
void setTextValue(seedphrase);
|
|
1923
|
-
};
|
|
1924
1817
|
const isConnected = connectionState === ConnectionState2.ONLINE;
|
|
1925
|
-
return /* @__PURE__ */
|
|
1818
|
+
return /* @__PURE__ */ React27.createElement(Heading, {
|
|
1926
1819
|
titleId,
|
|
1927
1820
|
title,
|
|
1928
|
-
corner: /* @__PURE__ */
|
|
1821
|
+
corner: /* @__PURE__ */ React27.createElement(CloseButton, {
|
|
1929
1822
|
onDone
|
|
1930
1823
|
})
|
|
1931
|
-
}, /* @__PURE__ */
|
|
1824
|
+
}, /* @__PURE__ */ React27.createElement(Avatar6.Root, {
|
|
1932
1825
|
size: 16,
|
|
1933
1826
|
variant: "circle",
|
|
1934
1827
|
status: isConnected ? "active" : "error",
|
|
1935
1828
|
hue: hue || fallbackValue.hue
|
|
1936
|
-
}, /* @__PURE__ */
|
|
1829
|
+
}, /* @__PURE__ */ React27.createElement(Toolbar3.Root, {
|
|
1937
1830
|
classNames: "flex justify-center"
|
|
1938
|
-
}, /* @__PURE__ */
|
|
1831
|
+
}, /* @__PURE__ */ React27.createElement(Avatar6.Frame, {
|
|
1939
1832
|
classNames: "relative z-[2] -mli-4 chromatic-ignore"
|
|
1940
|
-
}, /* @__PURE__ */
|
|
1833
|
+
}, /* @__PURE__ */ React27.createElement(Avatar6.Fallback, {
|
|
1941
1834
|
text: emoji || fallbackValue.emoji
|
|
1942
|
-
}))), /* @__PURE__ */
|
|
1835
|
+
}))), /* @__PURE__ */ React27.createElement(Avatar6.Label, {
|
|
1943
1836
|
classNames: "sr-only",
|
|
1944
1837
|
"data-testid": "identityHeading.displayName"
|
|
1945
|
-
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */
|
|
1838
|
+
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */ React27.createElement(Input2.Root, null, /* @__PURE__ */ React27.createElement(Input2.Label, {
|
|
1946
1839
|
srOnly: true
|
|
1947
|
-
}, t("display name input label")), /* @__PURE__ */
|
|
1840
|
+
}, t("display name input label")), /* @__PURE__ */ React27.createElement(Input2.TextInput, {
|
|
1948
1841
|
variant: "subdued",
|
|
1949
1842
|
"data-testid": "display-name-input",
|
|
1950
1843
|
placeholder: t("display name input placeholder"),
|
|
@@ -1955,61 +1848,51 @@ var IdentityHeading = ({ titleId, title, identity, hideRecover, onDone, onUpdate
|
|
|
1955
1848
|
...identity.profile,
|
|
1956
1849
|
displayName: value
|
|
1957
1850
|
})
|
|
1958
|
-
})), /* @__PURE__ */
|
|
1851
|
+
})), /* @__PURE__ */ React27.createElement(Toolbar3.Root, {
|
|
1959
1852
|
classNames: "flex justify-center items-center gap-1 pt-3"
|
|
1960
|
-
}, /* @__PURE__ */
|
|
1853
|
+
}, /* @__PURE__ */ React27.createElement(EmojiPickerToolbarButton, {
|
|
1961
1854
|
emoji,
|
|
1962
1855
|
onChangeEmoji: setEmoji,
|
|
1963
1856
|
classNames: "bs-[--rail-action]"
|
|
1964
|
-
}), /* @__PURE__ */
|
|
1857
|
+
}), /* @__PURE__ */ React27.createElement(HuePickerToolbarButton, {
|
|
1965
1858
|
hue,
|
|
1966
1859
|
onChangeHue: setHue,
|
|
1967
1860
|
classNames: "bs-[--rail-action]"
|
|
1968
|
-
}), /* @__PURE__ */
|
|
1861
|
+
}), /* @__PURE__ */ React27.createElement(Tooltip5.Root, null, /* @__PURE__ */ React27.createElement(Tooltip5.Trigger, {
|
|
1969
1862
|
asChild: true
|
|
1970
|
-
}, /* @__PURE__ */
|
|
1863
|
+
}, /* @__PURE__ */ React27.createElement(Toolbar3.Button, {
|
|
1971
1864
|
classNames: "bs-[--rail-action]",
|
|
1972
1865
|
"data-testid": "update-profile-form-copy-key",
|
|
1973
1866
|
onClick: () => setTextValue(identityHex)
|
|
1974
|
-
}, /* @__PURE__ */
|
|
1867
|
+
}, /* @__PURE__ */ React27.createElement("span", {
|
|
1975
1868
|
className: "sr-only"
|
|
1976
|
-
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */
|
|
1977
|
-
className:
|
|
1978
|
-
}))), /* @__PURE__ */
|
|
1869
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React27.createElement(Key, {
|
|
1870
|
+
className: getSize12(5)
|
|
1871
|
+
}))), /* @__PURE__ */ React27.createElement(Tooltip5.Portal, null, /* @__PURE__ */ React27.createElement(Tooltip5.Content, {
|
|
1979
1872
|
side: "bottom",
|
|
1980
1873
|
classNames: "z-50"
|
|
1981
|
-
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */
|
|
1874
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ React27.createElement(Tooltip5.Arrow, null)))), /* @__PURE__ */ React27.createElement(Tooltip5.Root, null, /* @__PURE__ */ React27.createElement(Tooltip5.Trigger, {
|
|
1982
1875
|
asChild: true
|
|
1983
|
-
}, /* @__PURE__ */
|
|
1984
|
-
classNames: "bs-[--rail-action]",
|
|
1985
|
-
onClick: handleRecoveryCode
|
|
1986
|
-
}, /* @__PURE__ */ React29.createElement(FirstAidKit2, {
|
|
1987
|
-
className: getSize13(5)
|
|
1988
|
-
}))), /* @__PURE__ */ React29.createElement(Tooltip6.Portal, null, /* @__PURE__ */ React29.createElement(Tooltip6.Content, {
|
|
1989
|
-
side: "bottom",
|
|
1990
|
-
classNames: "z-50"
|
|
1991
|
-
}, t("create recovery code label"), /* @__PURE__ */ React29.createElement(Tooltip6.Arrow, null)))), /* @__PURE__ */ React29.createElement(Tooltip6.Root, null, /* @__PURE__ */ React29.createElement(Tooltip6.Trigger, {
|
|
1992
|
-
asChild: true
|
|
1993
|
-
}, /* @__PURE__ */ React29.createElement(Toolbar3.Button, {
|
|
1876
|
+
}, /* @__PURE__ */ React27.createElement(Toolbar3.Button, {
|
|
1994
1877
|
classNames: [
|
|
1995
1878
|
"bs-[--rail-action]",
|
|
1996
1879
|
!isConnected && "text-error-500"
|
|
1997
1880
|
],
|
|
1998
1881
|
onClick: () => onChangeConnectionState?.(isConnected ? ConnectionState2.OFFLINE : ConnectionState2.ONLINE)
|
|
1999
|
-
}, /* @__PURE__ */
|
|
1882
|
+
}, /* @__PURE__ */ React27.createElement("span", {
|
|
2000
1883
|
className: "sr-only"
|
|
2001
|
-
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */
|
|
2002
|
-
className:
|
|
2003
|
-
}) : /* @__PURE__ */
|
|
2004
|
-
className:
|
|
2005
|
-
}))), /* @__PURE__ */
|
|
1884
|
+
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */ React27.createElement(PlugsConnected, {
|
|
1885
|
+
className: getSize12(5)
|
|
1886
|
+
}) : /* @__PURE__ */ React27.createElement(Plugs, {
|
|
1887
|
+
className: getSize12(5)
|
|
1888
|
+
}))), /* @__PURE__ */ React27.createElement(Tooltip5.Portal, null, /* @__PURE__ */ React27.createElement(Tooltip5.Content, {
|
|
2006
1889
|
side: "bottom",
|
|
2007
1890
|
classNames: "z-50"
|
|
2008
|
-
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */
|
|
1891
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React27.createElement(Tooltip5.Arrow, null)))))));
|
|
2009
1892
|
};
|
|
2010
1893
|
var IdentityPanelImpl = (props) => {
|
|
2011
1894
|
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
2012
|
-
const { t } =
|
|
1895
|
+
const { t } = useTranslation13("os");
|
|
2013
1896
|
const title = useMemo3(() => {
|
|
2014
1897
|
switch (activeView) {
|
|
2015
1898
|
case "device invitation manager":
|
|
@@ -2023,7 +1906,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
2023
1906
|
]);
|
|
2024
1907
|
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
2025
1908
|
const hideRecover = rest.agentStatus !== "created";
|
|
2026
|
-
return /* @__PURE__ */
|
|
1909
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(IdentityHeading, {
|
|
2027
1910
|
identity,
|
|
2028
1911
|
titleId,
|
|
2029
1912
|
title,
|
|
@@ -2032,44 +1915,44 @@ var IdentityPanelImpl = (props) => {
|
|
|
2032
1915
|
onUpdateProfile,
|
|
2033
1916
|
connectionState,
|
|
2034
1917
|
onChangeConnectionState
|
|
2035
|
-
}), /* @__PURE__ */
|
|
1918
|
+
}), /* @__PURE__ */ React27.createElement(Viewport.Root, {
|
|
2036
1919
|
activeView
|
|
2037
|
-
}, /* @__PURE__ */
|
|
1920
|
+
}, /* @__PURE__ */ React27.createElement(Viewport.Views, null, /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
2038
1921
|
id: "identity action chooser",
|
|
2039
1922
|
classNames: viewStyles
|
|
2040
|
-
}, /* @__PURE__ */
|
|
1923
|
+
}, /* @__PURE__ */ React27.createElement(IdentityActionChooserComponent, {
|
|
2041
1924
|
active: activeView === "identity action chooser",
|
|
2042
1925
|
...rest,
|
|
2043
1926
|
connectionState
|
|
2044
|
-
})), /* @__PURE__ */
|
|
1927
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
2045
1928
|
id: "device invitation manager",
|
|
2046
1929
|
classNames: viewStyles
|
|
2047
|
-
}, /* @__PURE__ */
|
|
1930
|
+
}, /* @__PURE__ */ React27.createElement(InvitationManagerComponent, {
|
|
2048
1931
|
active: activeView === "device invitation manager",
|
|
2049
1932
|
...rest,
|
|
2050
1933
|
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
2051
|
-
})), /* @__PURE__ */
|
|
1934
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
2052
1935
|
classNames: viewStyles,
|
|
2053
1936
|
id: "confirm join new identity"
|
|
2054
|
-
}, /* @__PURE__ */
|
|
1937
|
+
}, /* @__PURE__ */ React27.createElement(ConfirmReset, {
|
|
2055
1938
|
active: activeView === "confirm join new identity",
|
|
2056
1939
|
...rest,
|
|
2057
1940
|
mode: "join new identity",
|
|
2058
1941
|
onConfirm: onJoinNewIdentity,
|
|
2059
1942
|
onCancel: onCancelReset
|
|
2060
|
-
})), /* @__PURE__ */
|
|
1943
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
2061
1944
|
classNames: viewStyles,
|
|
2062
1945
|
id: "confirm recover"
|
|
2063
|
-
}, /* @__PURE__ */
|
|
1946
|
+
}, /* @__PURE__ */ React27.createElement(ConfirmReset, {
|
|
2064
1947
|
active: activeView === "confirm recover",
|
|
2065
1948
|
...rest,
|
|
2066
1949
|
mode: "recover",
|
|
2067
1950
|
onConfirm: onRecover,
|
|
2068
1951
|
onCancel: onCancelReset
|
|
2069
|
-
})), /* @__PURE__ */
|
|
1952
|
+
})), /* @__PURE__ */ React27.createElement(Viewport.View, {
|
|
2070
1953
|
classNames: viewStyles,
|
|
2071
1954
|
id: "confirm reset storage"
|
|
2072
|
-
}, /* @__PURE__ */
|
|
1955
|
+
}, /* @__PURE__ */ React27.createElement(ConfirmReset, {
|
|
2073
1956
|
active: activeView === "confirm reset storage",
|
|
2074
1957
|
...rest,
|
|
2075
1958
|
mode: "reset storage",
|
|
@@ -2079,7 +1962,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
2079
1962
|
};
|
|
2080
1963
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
2081
1964
|
const invitationStatus = useInvitationStatus2(invitation);
|
|
2082
|
-
return /* @__PURE__ */
|
|
1965
|
+
return /* @__PURE__ */ React27.createElement(IdentityPanelImpl, {
|
|
2083
1966
|
...props,
|
|
2084
1967
|
...invitationStatus
|
|
2085
1968
|
});
|
|
@@ -2097,7 +1980,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2097
1980
|
if (!identity) {
|
|
2098
1981
|
log7.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
2099
1982
|
F: __dxlog_file6,
|
|
2100
|
-
L:
|
|
1983
|
+
L: 255,
|
|
2101
1984
|
S: void 0,
|
|
2102
1985
|
C: (f, a) => f(...a)
|
|
2103
1986
|
});
|
|
@@ -2114,7 +1997,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2114
1997
|
const subscription = identityService.subscribe((state) => {
|
|
2115
1998
|
log7("[state]", state, {
|
|
2116
1999
|
F: __dxlog_file6,
|
|
2117
|
-
L:
|
|
2000
|
+
L: 268,
|
|
2118
2001
|
S: void 0,
|
|
2119
2002
|
C: (f, a) => f(...a)
|
|
2120
2003
|
});
|
|
@@ -2160,14 +2043,14 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2160
2043
|
onChangeConnectionState: handleChangeConnectionState,
|
|
2161
2044
|
...agentProps
|
|
2162
2045
|
};
|
|
2163
|
-
return identityState.context.invitation ? /* @__PURE__ */
|
|
2046
|
+
return identityState.context.invitation ? /* @__PURE__ */ React27.createElement(IdentityPanelWithInvitationImpl, {
|
|
2164
2047
|
...implProps,
|
|
2165
2048
|
invitation: identityState.context.invitation
|
|
2166
|
-
}) : /* @__PURE__ */
|
|
2049
|
+
}) : /* @__PURE__ */ React27.createElement(IdentityPanelImpl, implProps);
|
|
2167
2050
|
};
|
|
2168
2051
|
|
|
2169
2052
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2170
|
-
import
|
|
2053
|
+
import React36, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
2171
2054
|
import { log as log11 } from "@dxos/log";
|
|
2172
2055
|
import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
|
|
2173
2056
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
@@ -2175,25 +2058,25 @@ import { useId as useId8, useThemeContext as useThemeContext5 } from "@dxos/reac
|
|
|
2175
2058
|
|
|
2176
2059
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
2177
2060
|
import { X as X4 } from "@phosphor-icons/react";
|
|
2178
|
-
import
|
|
2179
|
-
import { Button as
|
|
2180
|
-
import { descriptionText as descriptionText9, getSize as
|
|
2061
|
+
import React28, { cloneElement, forwardRef as forwardRef9 } from "react";
|
|
2062
|
+
import { Button as Button9, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
2063
|
+
import { descriptionText as descriptionText9, getSize as getSize13, mx as mx21 } from "@dxos/react-ui-theme";
|
|
2181
2064
|
var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent, onExit }, forwardedRef) => {
|
|
2182
|
-
const { t } =
|
|
2183
|
-
const exitButton = /* @__PURE__ */
|
|
2065
|
+
const { t } = useTranslation14("os");
|
|
2066
|
+
const exitButton = /* @__PURE__ */ React28.createElement(Button9, {
|
|
2184
2067
|
variant: "ghost",
|
|
2185
2068
|
...onExit && {
|
|
2186
2069
|
onClick: onExit
|
|
2187
2070
|
},
|
|
2188
|
-
classNames:
|
|
2071
|
+
classNames: mx21(descriptionText9, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
2189
2072
|
"data-testid": "join-exit"
|
|
2190
|
-
}, /* @__PURE__ */
|
|
2073
|
+
}, /* @__PURE__ */ React28.createElement(X4, {
|
|
2191
2074
|
weight: "bold",
|
|
2192
|
-
className:
|
|
2193
|
-
}), /* @__PURE__ */
|
|
2075
|
+
className: getSize13(4)
|
|
2076
|
+
}), /* @__PURE__ */ React28.createElement("span", {
|
|
2194
2077
|
className: "sr-only"
|
|
2195
2078
|
}, t("exit label")));
|
|
2196
|
-
return /* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ React28.createElement(Heading, {
|
|
2197
2080
|
ref: forwardedRef,
|
|
2198
2081
|
titleId,
|
|
2199
2082
|
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
@@ -2208,7 +2091,7 @@ var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent
|
|
|
2208
2091
|
|
|
2209
2092
|
// packages/sdk/shell/src/panels/JoinPanel/joinMachine.ts
|
|
2210
2093
|
import { useMachine as useMachine2 } from "@xstate/react";
|
|
2211
|
-
import { useCallback as
|
|
2094
|
+
import { useCallback as useCallback4 } from "react";
|
|
2212
2095
|
import { assign as assign2, createMachine as createMachine2 } from "xstate";
|
|
2213
2096
|
import { log as log8 } from "@dxos/log";
|
|
2214
2097
|
import { AlreadyJoinedError } from "@dxos/react-client";
|
|
@@ -2713,7 +2596,7 @@ var defaultCodeFromUrl = (invitationType, text) => {
|
|
|
2713
2596
|
}
|
|
2714
2597
|
};
|
|
2715
2598
|
var useJoinMachine = (client, options) => {
|
|
2716
|
-
const redeemHaloInvitationCode =
|
|
2599
|
+
const redeemHaloInvitationCode = useCallback4(({ halo }) => {
|
|
2717
2600
|
if (halo.unredeemedCode) {
|
|
2718
2601
|
try {
|
|
2719
2602
|
const invitation = InvitationEncoder3.decode(defaultCodeFromUrl("halo", halo.unredeemedCode));
|
|
@@ -2738,7 +2621,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2738
2621
|
}, [
|
|
2739
2622
|
client
|
|
2740
2623
|
]);
|
|
2741
|
-
const redeemSpaceInvitationCode =
|
|
2624
|
+
const redeemSpaceInvitationCode = useCallback4(({ space }) => {
|
|
2742
2625
|
if (space.unredeemedCode) {
|
|
2743
2626
|
try {
|
|
2744
2627
|
const invitation = InvitationEncoder3.decode(defaultCodeFromUrl("space", space.unredeemedCode));
|
|
@@ -2763,7 +2646,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2763
2646
|
}, [
|
|
2764
2647
|
client
|
|
2765
2648
|
]);
|
|
2766
|
-
const invalidateHaloInvitationCode =
|
|
2649
|
+
const invalidateHaloInvitationCode = useCallback4(({ halo }) => {
|
|
2767
2650
|
if (halo.unredeemedCode) {
|
|
2768
2651
|
options?.onInvalidateInvitationCode?.(halo.unredeemedCode);
|
|
2769
2652
|
return {
|
|
@@ -2776,7 +2659,7 @@ var useJoinMachine = (client, options) => {
|
|
|
2776
2659
|
}, [
|
|
2777
2660
|
options?.onInvalidateInvitationCode
|
|
2778
2661
|
]);
|
|
2779
|
-
const invalidateSpaceInvitationCode =
|
|
2662
|
+
const invalidateSpaceInvitationCode = useCallback4(({ space }) => {
|
|
2780
2663
|
if (space.unredeemedCode) {
|
|
2781
2664
|
options?.onInvalidateInvitationCode?.(space.unredeemedCode);
|
|
2782
2665
|
return {
|
|
@@ -2811,17 +2694,17 @@ var useJoinMachine = (client, options) => {
|
|
|
2811
2694
|
|
|
2812
2695
|
// packages/sdk/shell/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx
|
|
2813
2696
|
import { CaretRight as CaretRight2, Plus as Plus3, QrCode, Textbox } from "@phosphor-icons/react";
|
|
2814
|
-
import
|
|
2815
|
-
import { useTranslation as
|
|
2816
|
-
import { getSize as
|
|
2697
|
+
import React29 from "react";
|
|
2698
|
+
import { useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
2699
|
+
import { getSize as getSize14 } from "@dxos/react-ui-theme";
|
|
2817
2700
|
var AdditionMethodChooser = (viewStateProps) => {
|
|
2818
2701
|
const disabled = !viewStateProps.active;
|
|
2819
2702
|
const { send } = viewStateProps;
|
|
2820
|
-
const { t } =
|
|
2703
|
+
const { t } = useTranslation15("os");
|
|
2821
2704
|
const sharedButtonProps = {
|
|
2822
2705
|
disabled,
|
|
2823
|
-
after: /* @__PURE__ */
|
|
2824
|
-
className:
|
|
2706
|
+
after: /* @__PURE__ */ React29.createElement(CaretRight2, {
|
|
2707
|
+
className: getSize14(4),
|
|
2825
2708
|
weight: "bold"
|
|
2826
2709
|
}),
|
|
2827
2710
|
slots: {
|
|
@@ -2830,35 +2713,35 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2830
2713
|
}
|
|
2831
2714
|
}
|
|
2832
2715
|
};
|
|
2833
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ React29.createElement("div", {
|
|
2834
2717
|
role: "none",
|
|
2835
2718
|
className: "flex flex-col gap-1 grow"
|
|
2836
|
-
}, /* @__PURE__ */
|
|
2719
|
+
}, /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2837
2720
|
...sharedButtonProps,
|
|
2838
2721
|
description: t("create identity description"),
|
|
2839
|
-
before: /* @__PURE__ */
|
|
2840
|
-
className:
|
|
2722
|
+
before: /* @__PURE__ */ React29.createElement(Plus3, {
|
|
2723
|
+
className: getSize14(6)
|
|
2841
2724
|
}),
|
|
2842
2725
|
onClick: () => send({
|
|
2843
2726
|
type: "createIdentity"
|
|
2844
2727
|
}),
|
|
2845
2728
|
"data-autofocus": "choosingAuthMethod",
|
|
2846
2729
|
"data-testid": "identity-chooser.create-identity"
|
|
2847
|
-
}, t("create identity label")), /* @__PURE__ */
|
|
2730
|
+
}, t("create identity label")), /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2848
2731
|
...sharedButtonProps,
|
|
2849
2732
|
description: t("join identity description"),
|
|
2850
|
-
before: /* @__PURE__ */
|
|
2851
|
-
className:
|
|
2733
|
+
before: /* @__PURE__ */ React29.createElement(QrCode, {
|
|
2734
|
+
className: getSize14(6)
|
|
2852
2735
|
}),
|
|
2853
2736
|
onClick: () => send({
|
|
2854
2737
|
type: "acceptHaloInvitation"
|
|
2855
2738
|
}),
|
|
2856
2739
|
"data-testid": "identity-chooser.join-identity"
|
|
2857
|
-
}, t("join identity label")), /* @__PURE__ */
|
|
2740
|
+
}, t("join identity label")), /* @__PURE__ */ React29.createElement(CompoundButton, {
|
|
2858
2741
|
...sharedButtonProps,
|
|
2859
2742
|
description: t("recover identity description"),
|
|
2860
|
-
before: /* @__PURE__ */
|
|
2861
|
-
className:
|
|
2743
|
+
before: /* @__PURE__ */ React29.createElement(Textbox, {
|
|
2744
|
+
className: getSize14(6)
|
|
2862
2745
|
}),
|
|
2863
2746
|
onClick: () => send({
|
|
2864
2747
|
type: "recoverIdentity"
|
|
@@ -2868,39 +2751,39 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2868
2751
|
};
|
|
2869
2752
|
|
|
2870
2753
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityAdded.tsx
|
|
2871
|
-
import
|
|
2754
|
+
import React30, { cloneElement as cloneElement2 } from "react";
|
|
2872
2755
|
import { generateName as generateName4 } from "@dxos/display-name";
|
|
2873
|
-
import { Avatar as Avatar7, useId as useId7, useTranslation as
|
|
2874
|
-
import { mx as
|
|
2756
|
+
import { Avatar as Avatar7, useId as useId7, useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
2757
|
+
import { mx as mx22 } from "@dxos/react-ui-theme";
|
|
2875
2758
|
import { hexToFallback } from "@dxos/util";
|
|
2876
2759
|
var IdentityAdded = (props) => {
|
|
2877
2760
|
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2878
2761
|
const disabled = !active;
|
|
2879
|
-
const { t } =
|
|
2762
|
+
const { t } = useTranslation16("os");
|
|
2880
2763
|
const addedIdentityHex = addedIdentity?.identityKey.toHex() ?? "0";
|
|
2881
2764
|
const fallbackValue = hexToFallback(addedIdentityHex);
|
|
2882
2765
|
const labelId = useId7("identityListItem__label");
|
|
2883
2766
|
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName4(addedIdentityHex));
|
|
2884
|
-
const doneAction = /* @__PURE__ */
|
|
2767
|
+
const doneAction = /* @__PURE__ */ React30.createElement(Action, {
|
|
2885
2768
|
...onDone && {
|
|
2886
2769
|
onClick: () => onDone(null)
|
|
2887
2770
|
},
|
|
2888
2771
|
disabled,
|
|
2889
2772
|
"data-autofocus": "confirmingAddedIdentity",
|
|
2890
2773
|
"data-testid": "identity-added-done"
|
|
2891
|
-
}, /* @__PURE__ */
|
|
2892
|
-
return /* @__PURE__ */
|
|
2774
|
+
}, /* @__PURE__ */ React30.createElement("span", null, t("done label")));
|
|
2775
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ React30.createElement("div", {
|
|
2893
2776
|
role: "none",
|
|
2894
2777
|
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2895
|
-
}, /* @__PURE__ */
|
|
2778
|
+
}, /* @__PURE__ */ React30.createElement(Avatar7.Root, {
|
|
2896
2779
|
status: "active",
|
|
2897
2780
|
labelId,
|
|
2898
2781
|
hue: addedIdentity?.profile?.data?.hue || fallbackValue.hue
|
|
2899
|
-
}, /* @__PURE__ */
|
|
2782
|
+
}, /* @__PURE__ */ React30.createElement(Avatar7.Frame, null, /* @__PURE__ */ React30.createElement(Avatar7.Fallback, {
|
|
2900
2783
|
text: addedIdentity?.profile?.data?.emoji || fallbackValue.emoji
|
|
2901
|
-
})), /* @__PURE__ */
|
|
2902
|
-
classNames:
|
|
2903
|
-
}, displayName))), /* @__PURE__ */
|
|
2784
|
+
})), /* @__PURE__ */ React30.createElement(Avatar7.Label, {
|
|
2785
|
+
classNames: mx22("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2786
|
+
}, displayName))), /* @__PURE__ */ React30.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ React30.createElement(Action, {
|
|
2904
2787
|
variant: "primary",
|
|
2905
2788
|
disabled: disabled || !addedIdentity,
|
|
2906
2789
|
onClick: () => addedIdentity && send({
|
|
@@ -2912,20 +2795,20 @@ var IdentityAdded = (props) => {
|
|
|
2912
2795
|
};
|
|
2913
2796
|
|
|
2914
2797
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2915
|
-
import
|
|
2798
|
+
import React31, { useCallback as useCallback5, useState as useState8 } from "react";
|
|
2916
2799
|
import { log as log9 } from "@dxos/log";
|
|
2917
2800
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
2918
|
-
import { useTranslation as
|
|
2801
|
+
import { useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
2919
2802
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2920
2803
|
var IdentityInput = (props) => {
|
|
2921
2804
|
const { send, method } = props;
|
|
2922
2805
|
const isRecover = method === "recover identity";
|
|
2923
2806
|
const client = useClient7();
|
|
2924
|
-
const { t } =
|
|
2925
|
-
const [validationMessage, setValidationMessage] =
|
|
2926
|
-
const
|
|
2807
|
+
const { t } = useTranslation17("os");
|
|
2808
|
+
const [validationMessage, setValidationMessage] = useState8("");
|
|
2809
|
+
const handleConfirm = async (value) => {
|
|
2927
2810
|
if (isRecover) {
|
|
2928
|
-
|
|
2811
|
+
await client.halo.recoverIdentity({
|
|
2929
2812
|
seedphrase: value
|
|
2930
2813
|
}).then((identity) => {
|
|
2931
2814
|
send?.({
|
|
@@ -2935,14 +2818,14 @@ var IdentityInput = (props) => {
|
|
|
2935
2818
|
}, (error) => {
|
|
2936
2819
|
log9.catch(error, void 0, {
|
|
2937
2820
|
F: __dxlog_file8,
|
|
2938
|
-
L:
|
|
2821
|
+
L: 39,
|
|
2939
2822
|
S: void 0,
|
|
2940
2823
|
C: (f, a) => f(...a)
|
|
2941
2824
|
});
|
|
2942
2825
|
setValidationMessage(t("failed to recover identity message"));
|
|
2943
2826
|
});
|
|
2944
2827
|
} else {
|
|
2945
|
-
|
|
2828
|
+
await client.halo.createIdentity({
|
|
2946
2829
|
displayName: value
|
|
2947
2830
|
}).then((identity) => {
|
|
2948
2831
|
send?.({
|
|
@@ -2952,7 +2835,7 @@ var IdentityInput = (props) => {
|
|
|
2952
2835
|
}, (error) => {
|
|
2953
2836
|
log9.catch(error, void 0, {
|
|
2954
2837
|
F: __dxlog_file8,
|
|
2955
|
-
L:
|
|
2838
|
+
L: 49,
|
|
2956
2839
|
S: void 0,
|
|
2957
2840
|
C: (f, a) => f(...a)
|
|
2958
2841
|
});
|
|
@@ -2960,51 +2843,53 @@ var IdentityInput = (props) => {
|
|
|
2960
2843
|
});
|
|
2961
2844
|
}
|
|
2962
2845
|
};
|
|
2963
|
-
return /* @__PURE__ */
|
|
2846
|
+
return /* @__PURE__ */ React31.createElement(IdentityInputImpl, {
|
|
2964
2847
|
...props,
|
|
2965
|
-
|
|
2848
|
+
onConfirm: handleConfirm,
|
|
2966
2849
|
validationMessage
|
|
2967
2850
|
});
|
|
2968
2851
|
};
|
|
2969
2852
|
var IdentityInputImpl = (props) => {
|
|
2970
|
-
const { method,
|
|
2971
|
-
const
|
|
2972
|
-
const
|
|
2973
|
-
const [
|
|
2853
|
+
const { method, active, onConfirm, validationMessage } = props;
|
|
2854
|
+
const { t } = useTranslation17("os");
|
|
2855
|
+
const [inputValue, setInputValue] = useState8("");
|
|
2856
|
+
const [pending, setPending] = useState8(false);
|
|
2857
|
+
const disabled = !active || pending;
|
|
2974
2858
|
const isRecover = method === "recover identity";
|
|
2975
|
-
|
|
2859
|
+
const handleConfirm = useCallback5(async () => {
|
|
2860
|
+
setPending(true);
|
|
2861
|
+
await onConfirm?.(inputValue);
|
|
2862
|
+
setPending(false);
|
|
2863
|
+
}, [
|
|
2864
|
+
onConfirm,
|
|
2865
|
+
inputValue
|
|
2866
|
+
]);
|
|
2867
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", {
|
|
2976
2868
|
role: "none",
|
|
2977
2869
|
className: "grow flex flex-col justify-center"
|
|
2978
|
-
}, /* @__PURE__ */
|
|
2870
|
+
}, /* @__PURE__ */ React31.createElement(Input, {
|
|
2979
2871
|
validationMessage,
|
|
2980
|
-
label: /* @__PURE__ */
|
|
2872
|
+
label: /* @__PURE__ */ React31.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
2981
2873
|
disabled,
|
|
2982
2874
|
"data-testid": "identity-input",
|
|
2983
|
-
placeholder: isRecover ? "
|
|
2875
|
+
placeholder: isRecover ? t("recovery code placeholder") : t("display name placeholder"),
|
|
2984
2876
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2985
|
-
})), /* @__PURE__ */
|
|
2986
|
-
variant: "ghost",
|
|
2987
|
-
disabled,
|
|
2988
|
-
onClick: () => send?.({
|
|
2989
|
-
type: "deselectAuthMethod"
|
|
2990
|
-
}),
|
|
2991
|
-
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-back`
|
|
2992
|
-
}, t("back label")), /* @__PURE__ */ React33.createElement(Action, {
|
|
2877
|
+
})), /* @__PURE__ */ React31.createElement(Actions, null, /* @__PURE__ */ React31.createElement(Action, {
|
|
2993
2878
|
variant: "primary",
|
|
2994
|
-
disabled,
|
|
2995
|
-
onClick:
|
|
2879
|
+
disabled: disabled || inputValue.trim().length === 0,
|
|
2880
|
+
onClick: handleConfirm,
|
|
2996
2881
|
"data-testid": `${method === "recover identity" ? "recover" : "create"}-identity-input-continue`
|
|
2997
|
-
}, t("continue label"))));
|
|
2882
|
+
}, pending ? t("continue label") : t("pending label"))));
|
|
2998
2883
|
};
|
|
2999
2884
|
|
|
3000
2885
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
3001
|
-
import
|
|
3002
|
-
import { useTranslation as
|
|
2886
|
+
import React32, { cloneElement as cloneElement3 } from "react";
|
|
2887
|
+
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
3003
2888
|
|
|
3004
2889
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
3005
|
-
import
|
|
2890
|
+
import React33, { useState as useState9, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
|
|
3006
2891
|
import { log as log10 } from "@dxos/log";
|
|
3007
|
-
import { useTranslation as
|
|
2892
|
+
import { useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
3008
2893
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
3009
2894
|
var invitationCodeFromUrl = (text) => {
|
|
3010
2895
|
try {
|
|
@@ -3024,8 +2909,8 @@ var invitationCodeFromUrl = (text) => {
|
|
|
3024
2909
|
var InvitationInput = (props) => {
|
|
3025
2910
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
3026
2911
|
const disabled = !active;
|
|
3027
|
-
const { t } =
|
|
3028
|
-
const [inputValue, setInputValue] =
|
|
2912
|
+
const { t } = useTranslation19("os");
|
|
2913
|
+
const [inputValue, setInputValue] = useState9(unredeemedCode ?? "");
|
|
3029
2914
|
useEffect5(() => {
|
|
3030
2915
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
3031
2916
|
}, [
|
|
@@ -3043,7 +2928,7 @@ var InvitationInput = (props) => {
|
|
|
3043
2928
|
}
|
|
3044
2929
|
});
|
|
3045
2930
|
};
|
|
3046
|
-
const exitAction = /* @__PURE__ */
|
|
2931
|
+
const exitAction = /* @__PURE__ */ React33.createElement(Action, {
|
|
3047
2932
|
variant: "ghost",
|
|
3048
2933
|
disabled,
|
|
3049
2934
|
...onExit ? {
|
|
@@ -3053,20 +2938,19 @@ var InvitationInput = (props) => {
|
|
|
3053
2938
|
},
|
|
3054
2939
|
"data-testid": "join-exit"
|
|
3055
2940
|
}, t("cancel label"));
|
|
3056
|
-
return /* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
3057
2942
|
role: "none",
|
|
3058
2943
|
className: "grow flex flex-col justify-center"
|
|
3059
|
-
}, /* @__PURE__ */
|
|
3060
|
-
label: /* @__PURE__ */
|
|
3061
|
-
|
|
3062
|
-
placeholder: "Type an invitation code",
|
|
2944
|
+
}, /* @__PURE__ */ React33.createElement(Input, {
|
|
2945
|
+
label: /* @__PURE__ */ React33.createElement(StepHeading, null, t("invitation input label")),
|
|
2946
|
+
placeholder: t("invitation input placeholder"),
|
|
3063
2947
|
disabled,
|
|
3064
2948
|
value: inputValue,
|
|
3065
2949
|
onChange: ({ target: { value } }) => setInputValue(value),
|
|
3066
2950
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
3067
2951
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
3068
2952
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
3069
|
-
})), /* @__PURE__ */
|
|
2953
|
+
})), /* @__PURE__ */ React33.createElement(Actions, null, Kind === "Halo" ? null : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React33.createElement(Action, {
|
|
3070
2954
|
variant: "primary",
|
|
3071
2955
|
disabled: disabled || inputValue.trim().length === 0,
|
|
3072
2956
|
onClick: handleNext,
|
|
@@ -3075,8 +2959,8 @@ var InvitationInput = (props) => {
|
|
|
3075
2959
|
};
|
|
3076
2960
|
|
|
3077
2961
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationRescuer.tsx
|
|
3078
|
-
import
|
|
3079
|
-
import { useTranslation as
|
|
2962
|
+
import React34 from "react";
|
|
2963
|
+
import { useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
3080
2964
|
import { descriptionText as descriptionText10 } from "@dxos/react-ui-theme";
|
|
3081
2965
|
var InvitationActions = ({
|
|
3082
2966
|
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
@@ -3088,14 +2972,14 @@ var InvitationActions = ({
|
|
|
3088
2972
|
Kind,
|
|
3089
2973
|
failReason
|
|
3090
2974
|
}) => {
|
|
3091
|
-
const { t } =
|
|
2975
|
+
const { t } = useTranslation20("os");
|
|
3092
2976
|
if (failReason) {
|
|
3093
|
-
return /* @__PURE__ */
|
|
2977
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
3094
2978
|
className: descriptionText10
|
|
3095
|
-
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */
|
|
2979
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ React34.createElement("div", {
|
|
3096
2980
|
role: "none",
|
|
3097
2981
|
className: "grow"
|
|
3098
|
-
}), /* @__PURE__ */
|
|
2982
|
+
}), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
3099
2983
|
disabled: !active,
|
|
3100
2984
|
onClick: () => send({
|
|
3101
2985
|
type: `reset${Kind}Invitation`
|
|
@@ -3103,16 +2987,16 @@ var InvitationActions = ({
|
|
|
3103
2987
|
"data-testid": "invitation-rescuer-reset"
|
|
3104
2988
|
}, t("reset label"))));
|
|
3105
2989
|
} else {
|
|
3106
|
-
return /* @__PURE__ */
|
|
2990
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
3107
2991
|
className: descriptionText10
|
|
3108
|
-
}, t("connecting status label")), /* @__PURE__ */
|
|
2992
|
+
}, t("connecting status label")), /* @__PURE__ */ React34.createElement("div", {
|
|
3109
2993
|
role: "none",
|
|
3110
2994
|
className: "grow"
|
|
3111
|
-
}), /* @__PURE__ */
|
|
2995
|
+
}), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
3112
2996
|
disabled: true,
|
|
3113
2997
|
classNames: "order-2",
|
|
3114
2998
|
"data-testid": "next"
|
|
3115
|
-
}, t("next label")), /* @__PURE__ */
|
|
2999
|
+
}, t("next label")), /* @__PURE__ */ React34.createElement(Action, {
|
|
3116
3000
|
disabled: !active,
|
|
3117
3001
|
onClick: onInvitationCancel,
|
|
3118
3002
|
"data-testid": "invitation-rescuer-cancel"
|
|
@@ -3121,52 +3005,52 @@ var InvitationActions = ({
|
|
|
3121
3005
|
};
|
|
3122
3006
|
var InvitationRescuer = (props) => {
|
|
3123
3007
|
const { Kind, invitationState, active, send } = props;
|
|
3124
|
-
const { t } =
|
|
3125
|
-
return /* @__PURE__ */
|
|
3008
|
+
const { t } = useTranslation20("os");
|
|
3009
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement("div", {
|
|
3126
3010
|
role: "none",
|
|
3127
3011
|
className: "grow flex flex-col justify-center"
|
|
3128
|
-
}, /* @__PURE__ */
|
|
3012
|
+
}, /* @__PURE__ */ React34.createElement(StepHeading, {
|
|
3129
3013
|
className: descriptionText10
|
|
3130
|
-
}, "There was a problem joining the space")), /* @__PURE__ */
|
|
3014
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ React34.createElement(Actions, null, /* @__PURE__ */ React34.createElement(Action, {
|
|
3131
3015
|
disabled: !active,
|
|
3132
3016
|
"data-testid": "invitation-rescuer-blank-reset",
|
|
3133
3017
|
onClick: () => send({
|
|
3134
3018
|
type: `reset${Kind}Invitation`
|
|
3135
3019
|
})
|
|
3136
|
-
}, t("reset label")))) : /* @__PURE__ */
|
|
3020
|
+
}, t("reset label")))) : /* @__PURE__ */ React34.createElement(InvitationActions, props));
|
|
3137
3021
|
};
|
|
3138
3022
|
|
|
3139
3023
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
3140
|
-
import
|
|
3024
|
+
import React35, { useState as useState10 } from "react";
|
|
3141
3025
|
import { Invitation as Invitation6 } from "@dxos/react-client/invitations";
|
|
3142
|
-
import { Input as Input3, useTranslation as
|
|
3026
|
+
import { Input as Input3, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
3143
3027
|
import { descriptionText as descriptionText11 } from "@dxos/react-ui-theme";
|
|
3144
3028
|
import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
|
|
3145
3029
|
var pinLength = 6;
|
|
3146
3030
|
var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
3147
3031
|
const disabled = !active || pending;
|
|
3148
|
-
const { t } =
|
|
3032
|
+
const { t } = useTranslation21("os");
|
|
3149
3033
|
const invitationType = Kind.toLowerCase();
|
|
3150
|
-
const [authCode, setAuthCode] =
|
|
3034
|
+
const [authCode, setAuthCode] = useState10("");
|
|
3151
3035
|
const onChange = ({ target: { value } }) => {
|
|
3152
3036
|
setAuthCode(value);
|
|
3153
3037
|
if (value.length === pinLength) {
|
|
3154
3038
|
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
3155
3039
|
}
|
|
3156
3040
|
};
|
|
3157
|
-
return /* @__PURE__ */
|
|
3041
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("div", {
|
|
3158
3042
|
role: "none",
|
|
3159
3043
|
className: "grow flex flex-col justify-center gap-4"
|
|
3160
|
-
}, /* @__PURE__ */
|
|
3044
|
+
}, /* @__PURE__ */ React35.createElement(Input3.Root, failed && {
|
|
3161
3045
|
validationValence: "error"
|
|
3162
|
-
}, /* @__PURE__ */
|
|
3046
|
+
}, /* @__PURE__ */ React35.createElement(Input3.Label, {
|
|
3163
3047
|
asChild: true
|
|
3164
|
-
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */
|
|
3048
|
+
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */ React35.createElement(StepHeading, null, t("auth code input label")) : /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(StepHeading, {
|
|
3165
3049
|
className: descriptionText11
|
|
3166
|
-
}, t("authenticating label")), /* @__PURE__ */
|
|
3050
|
+
}, t("authenticating label")), /* @__PURE__ */ React35.createElement("div", {
|
|
3167
3051
|
role: "none",
|
|
3168
3052
|
className: "grow"
|
|
3169
|
-
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */
|
|
3053
|
+
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React35.createElement(Input3.PinInput, {
|
|
3170
3054
|
disabled,
|
|
3171
3055
|
length: pinLength,
|
|
3172
3056
|
onChange,
|
|
@@ -3177,18 +3061,18 @@ var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invi
|
|
|
3177
3061
|
"data-prevent-ios-autofocus": true,
|
|
3178
3062
|
"data-testid": `${invitationType}-auth-code-input`,
|
|
3179
3063
|
"data-1p-ignore": true
|
|
3180
|
-
}), failed && /* @__PURE__ */
|
|
3064
|
+
}), failed && /* @__PURE__ */ React35.createElement(Input3.DescriptionAndValidation, {
|
|
3181
3065
|
classNames: "text-center"
|
|
3182
|
-
}, /* @__PURE__ */
|
|
3066
|
+
}, /* @__PURE__ */ React35.createElement(Input3.Validation, null, t("failed to authenticate message")))), invitationId && authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Label, null, t("auth other device emoji message")), /* @__PURE__ */ React35.createElement("div", {
|
|
3183
3067
|
className: "flex justify-center"
|
|
3184
|
-
}, /* @__PURE__ */
|
|
3068
|
+
}, /* @__PURE__ */ React35.createElement(Emoji, {
|
|
3185
3069
|
text: hexToEmoji5(invitationId)
|
|
3186
|
-
})))), /* @__PURE__ */
|
|
3070
|
+
})))), /* @__PURE__ */ React35.createElement(Actions, null, /* @__PURE__ */ React35.createElement(Action, {
|
|
3187
3071
|
variant: "ghost",
|
|
3188
3072
|
disabled,
|
|
3189
3073
|
onClick: () => onInvitationCancel?.(),
|
|
3190
3074
|
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
3191
|
-
}, t("cancel label")), /* @__PURE__ */
|
|
3075
|
+
}, t("cancel label")), /* @__PURE__ */ React35.createElement(Action, {
|
|
3192
3076
|
variant: "primary",
|
|
3193
3077
|
disabled,
|
|
3194
3078
|
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
@@ -3250,46 +3134,46 @@ var JoinPanelImpl = (props) => {
|
|
|
3250
3134
|
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
3251
3135
|
ConfirmReset: ConfirmResetComponent = ConfirmReset
|
|
3252
3136
|
} = props;
|
|
3253
|
-
return /* @__PURE__ */
|
|
3137
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, mode !== "halo-only" && /* @__PURE__ */ React36.createElement(JoinHeading, {
|
|
3254
3138
|
titleId,
|
|
3255
3139
|
mode,
|
|
3256
3140
|
onExit,
|
|
3257
3141
|
exitActionParent
|
|
3258
|
-
}), /* @__PURE__ */
|
|
3142
|
+
}), /* @__PURE__ */ React36.createElement(Viewport.Root, {
|
|
3259
3143
|
focusManaged: true,
|
|
3260
3144
|
activeView
|
|
3261
|
-
}, /* @__PURE__ */
|
|
3145
|
+
}, /* @__PURE__ */ React36.createElement(Viewport.Views, null, /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3262
3146
|
classNames: stepStyles,
|
|
3263
3147
|
id: "addition method chooser"
|
|
3264
|
-
}, /* @__PURE__ */
|
|
3148
|
+
}, /* @__PURE__ */ React36.createElement(AdditionMethodChooser, {
|
|
3265
3149
|
send,
|
|
3266
3150
|
active: activeView === "addition method chooser"
|
|
3267
|
-
})), /* @__PURE__ */
|
|
3151
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3268
3152
|
classNames: stepStyles,
|
|
3269
3153
|
id: "reset storage confirmation"
|
|
3270
|
-
}, /* @__PURE__ */
|
|
3154
|
+
}, /* @__PURE__ */ React36.createElement(ConfirmResetComponent, {
|
|
3271
3155
|
send,
|
|
3272
3156
|
active: activeView === "reset storage confirmation",
|
|
3273
3157
|
onCancel: onCancelResetStorage,
|
|
3274
3158
|
onConfirm: onConfirmResetStorage
|
|
3275
|
-
})), /* @__PURE__ */
|
|
3159
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3276
3160
|
classNames: stepStyles,
|
|
3277
3161
|
id: "create identity input"
|
|
3278
|
-
}, /* @__PURE__ */
|
|
3162
|
+
}, /* @__PURE__ */ React36.createElement(IdentityInputComponent, {
|
|
3279
3163
|
send,
|
|
3280
3164
|
method: "create identity",
|
|
3281
3165
|
active: activeView === "create identity input"
|
|
3282
|
-
})), /* @__PURE__ */
|
|
3166
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3283
3167
|
classNames: stepStyles,
|
|
3284
3168
|
id: "recover identity input"
|
|
3285
|
-
}, /* @__PURE__ */
|
|
3169
|
+
}, /* @__PURE__ */ React36.createElement(IdentityInputComponent, {
|
|
3286
3170
|
send,
|
|
3287
3171
|
method: "recover identity",
|
|
3288
3172
|
active: activeView === "recover identity input"
|
|
3289
|
-
})), /* @__PURE__ */
|
|
3173
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3290
3174
|
classNames: stepStyles,
|
|
3291
3175
|
id: "halo invitation input"
|
|
3292
|
-
}, /* @__PURE__ */
|
|
3176
|
+
}, /* @__PURE__ */ React36.createElement(InvitationInput, {
|
|
3293
3177
|
send,
|
|
3294
3178
|
Kind: "Halo",
|
|
3295
3179
|
active: activeView === "halo invitation input",
|
|
@@ -3299,20 +3183,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3299
3183
|
...succeededKeys?.Halo && {
|
|
3300
3184
|
succeededKeys: succeededKeys.Halo
|
|
3301
3185
|
}
|
|
3302
|
-
})), /* @__PURE__ */
|
|
3186
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3303
3187
|
classNames: stepStyles,
|
|
3304
3188
|
id: "halo invitation rescuer"
|
|
3305
|
-
}, /* @__PURE__ */
|
|
3189
|
+
}, /* @__PURE__ */ React36.createElement(InvitationRescuer, {
|
|
3306
3190
|
send,
|
|
3307
3191
|
Kind: "Halo",
|
|
3308
3192
|
active: activeView === "halo invitation rescuer",
|
|
3309
3193
|
invitationState: invitationStates?.Halo,
|
|
3310
3194
|
onInvitationCancel: onHaloInvitationCancel,
|
|
3311
3195
|
failReason: failReasons?.Halo
|
|
3312
|
-
})), /* @__PURE__ */
|
|
3196
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3313
3197
|
classNames: stepStyles,
|
|
3314
3198
|
id: "halo invitation authenticator"
|
|
3315
|
-
}, /* @__PURE__ */
|
|
3199
|
+
}, /* @__PURE__ */ React36.createElement(InvitationAuthenticator, {
|
|
3316
3200
|
send,
|
|
3317
3201
|
Kind: "Halo",
|
|
3318
3202
|
invitationId: invitationIds?.Halo,
|
|
@@ -3323,19 +3207,19 @@ var JoinPanelImpl = (props) => {
|
|
|
3323
3207
|
...failed.has("Halo") && {
|
|
3324
3208
|
failed: true
|
|
3325
3209
|
}
|
|
3326
|
-
})), /* @__PURE__ */
|
|
3210
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3327
3211
|
classNames: stepStyles,
|
|
3328
3212
|
id: "identity added"
|
|
3329
|
-
}, /* @__PURE__ */
|
|
3213
|
+
}, /* @__PURE__ */ React36.createElement(IdentityAdded, {
|
|
3330
3214
|
send,
|
|
3331
3215
|
mode,
|
|
3332
3216
|
active: activeView === "identity added",
|
|
3333
3217
|
doneActionParent,
|
|
3334
3218
|
onDone: onHaloDone
|
|
3335
|
-
})), /* @__PURE__ */
|
|
3219
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3336
3220
|
classNames: stepStyles,
|
|
3337
3221
|
id: "space invitation input"
|
|
3338
|
-
}, /* @__PURE__ */
|
|
3222
|
+
}, /* @__PURE__ */ React36.createElement(InvitationInput, {
|
|
3339
3223
|
send,
|
|
3340
3224
|
Kind: "Space",
|
|
3341
3225
|
active: activeView === "space invitation input",
|
|
@@ -3347,20 +3231,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3347
3231
|
},
|
|
3348
3232
|
onExit,
|
|
3349
3233
|
exitActionParent
|
|
3350
|
-
})), /* @__PURE__ */
|
|
3234
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3351
3235
|
classNames: stepStyles,
|
|
3352
3236
|
id: "space invitation rescuer"
|
|
3353
|
-
}, /* @__PURE__ */
|
|
3237
|
+
}, /* @__PURE__ */ React36.createElement(InvitationRescuer, {
|
|
3354
3238
|
send,
|
|
3355
3239
|
Kind: "Space",
|
|
3356
3240
|
active: activeView === "space invitation rescuer",
|
|
3357
3241
|
invitationState: invitationStates?.Space,
|
|
3358
3242
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3359
3243
|
failReason: failReasons?.Space
|
|
3360
|
-
})), /* @__PURE__ */
|
|
3244
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3361
3245
|
classNames: stepStyles,
|
|
3362
3246
|
id: "space invitation authenticator"
|
|
3363
|
-
}, /* @__PURE__ */
|
|
3247
|
+
}, /* @__PURE__ */ React36.createElement(InvitationAuthenticator, {
|
|
3364
3248
|
send,
|
|
3365
3249
|
Kind: "Space",
|
|
3366
3250
|
invitationId: invitationIds?.Space,
|
|
@@ -3610,9 +3494,9 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3610
3494
|
]);
|
|
3611
3495
|
const onHaloDone = useCallback6(() => {
|
|
3612
3496
|
propsOnDone?.({
|
|
3613
|
-
identityKey: joinState.context.halo.invitation?.identityKey ?? null,
|
|
3497
|
+
identityKey: joinState.context.identity?.identityKey ?? joinState.context.halo.invitation?.identityKey ?? null,
|
|
3614
3498
|
swarmKey: joinState.context.halo.invitation?.swarmKey ?? null,
|
|
3615
|
-
spaceKey: joinState.context.halo.invitation?.spaceKey ?? null,
|
|
3499
|
+
spaceKey: joinState.context.identity?.spaceKey ?? joinState.context.halo.invitation?.spaceKey ?? null,
|
|
3616
3500
|
target: joinState.context.halo.invitation?.target ?? null
|
|
3617
3501
|
});
|
|
3618
3502
|
}, [
|
|
@@ -3638,7 +3522,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3638
3522
|
client,
|
|
3639
3523
|
joinSend
|
|
3640
3524
|
]);
|
|
3641
|
-
return /* @__PURE__ */
|
|
3525
|
+
return /* @__PURE__ */ React36.createElement(JoinPanelImpl, {
|
|
3642
3526
|
titleId,
|
|
3643
3527
|
mode,
|
|
3644
3528
|
send: joinSend,
|
|
@@ -3681,10 +3565,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3681
3565
|
|
|
3682
3566
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3683
3567
|
import { Planet } from "@phosphor-icons/react";
|
|
3684
|
-
import
|
|
3568
|
+
import React38, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
|
|
3685
3569
|
import { log as log14 } from "@dxos/log";
|
|
3686
3570
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3687
|
-
import { useId as useId9, useTranslation as
|
|
3571
|
+
import { useId as useId9, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3688
3572
|
|
|
3689
3573
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3690
3574
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3750,13 +3634,13 @@ var useSpaceMachine = (options) => {
|
|
|
3750
3634
|
|
|
3751
3635
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3752
3636
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3753
|
-
import
|
|
3637
|
+
import React37, { useCallback as useCallback7, useState as useState11 } from "react";
|
|
3754
3638
|
import { log as log13 } from "@dxos/log";
|
|
3755
3639
|
import { useConfig } from "@dxos/react-client";
|
|
3756
3640
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3757
3641
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3758
|
-
import { ScrollArea, useTranslation as
|
|
3759
|
-
import { descriptionText as descriptionText12, mx as
|
|
3642
|
+
import { ScrollArea, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
3643
|
+
import { descriptionText as descriptionText12, mx as mx23 } from "@dxos/react-ui-theme";
|
|
3760
3644
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3761
3645
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3762
3646
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
@@ -3776,7 +3660,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
3776
3660
|
};
|
|
3777
3661
|
var SpaceManager = (props) => {
|
|
3778
3662
|
const { space, target } = props;
|
|
3779
|
-
const { t } =
|
|
3663
|
+
const { t } = useTranslation22("os");
|
|
3780
3664
|
const config = useConfig();
|
|
3781
3665
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3782
3666
|
const inviteActions = {
|
|
@@ -3821,7 +3705,7 @@ var SpaceManager = (props) => {
|
|
|
3821
3705
|
])
|
|
3822
3706
|
}
|
|
3823
3707
|
};
|
|
3824
|
-
return /* @__PURE__ */
|
|
3708
|
+
return /* @__PURE__ */ React37.createElement(SpaceManagerImpl, {
|
|
3825
3709
|
...props,
|
|
3826
3710
|
invitations,
|
|
3827
3711
|
inviteActions
|
|
@@ -3830,7 +3714,7 @@ var SpaceManager = (props) => {
|
|
|
3830
3714
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3831
3715
|
var SpaceManagerImpl = (props) => {
|
|
3832
3716
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3833
|
-
const { t } =
|
|
3717
|
+
const { t } = useTranslation22("os");
|
|
3834
3718
|
const inviteActions = propsInviteActions ?? {
|
|
3835
3719
|
noopInvite: {
|
|
3836
3720
|
label: t("create space invitation label"),
|
|
@@ -3840,7 +3724,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3840
3724
|
}
|
|
3841
3725
|
}
|
|
3842
3726
|
};
|
|
3843
|
-
const [activeAction, setInternalActiveAction] =
|
|
3727
|
+
const [activeAction, setInternalActiveAction] = useState11(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
3844
3728
|
const setActiveAction = (nextAction) => {
|
|
3845
3729
|
setInternalActiveAction(nextAction);
|
|
3846
3730
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3848,26 +3732,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3848
3732
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3849
3733
|
Invitation8.State.CANCELLED
|
|
3850
3734
|
].includes(invitation.get().state));
|
|
3851
|
-
return /* @__PURE__ */
|
|
3735
|
+
return /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement(ScrollArea.Root, {
|
|
3852
3736
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3853
|
-
}, /* @__PURE__ */
|
|
3737
|
+
}, /* @__PURE__ */ React37.createElement(ScrollArea.Viewport, {
|
|
3854
3738
|
classNames: "is-full pie-2"
|
|
3855
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3856
|
-
className:
|
|
3857
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3739
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React37.createElement(React37.Fragment, null, /* @__PURE__ */ React37.createElement("h3", {
|
|
3740
|
+
className: mx23(headingFragment, descriptionText12)
|
|
3741
|
+
}, t("invitation list heading")), /* @__PURE__ */ React37.createElement(InvitationListComponent, {
|
|
3858
3742
|
className: "mb-2",
|
|
3859
3743
|
send,
|
|
3860
3744
|
invitations: visibleInvitations ?? [],
|
|
3861
3745
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3862
3746
|
createInvitationUrl
|
|
3863
|
-
}), /* @__PURE__ */
|
|
3864
|
-
className:
|
|
3865
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3747
|
+
}), /* @__PURE__ */ React37.createElement("h3", {
|
|
3748
|
+
className: mx23(headingFragment, descriptionText12, "mbs-2")
|
|
3749
|
+
}, t("space member list heading"))), /* @__PURE__ */ React37.createElement(SpaceMemberListComponent, {
|
|
3866
3750
|
spaceKey: space.key,
|
|
3867
3751
|
includeSelf: true
|
|
3868
|
-
})), /* @__PURE__ */
|
|
3752
|
+
})), /* @__PURE__ */ React37.createElement(ScrollArea.Scrollbar, {
|
|
3869
3753
|
orientation: "vertical"
|
|
3870
|
-
}, /* @__PURE__ */
|
|
3754
|
+
}, /* @__PURE__ */ React37.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React37.createElement(Actions, null, /* @__PURE__ */ React37.createElement(BifurcatedAction, {
|
|
3871
3755
|
disabled: !active,
|
|
3872
3756
|
actions: inviteActions,
|
|
3873
3757
|
activeAction,
|
|
@@ -3879,45 +3763,45 @@ var SpaceManagerImpl = (props) => {
|
|
|
3879
3763
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3880
3764
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3881
3765
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3882
|
-
const { t } =
|
|
3766
|
+
const { t } = useTranslation23("os");
|
|
3883
3767
|
const name = space.properties.name;
|
|
3884
|
-
return /* @__PURE__ */
|
|
3768
|
+
return /* @__PURE__ */ React38.createElement(Heading, {
|
|
3885
3769
|
titleId,
|
|
3886
3770
|
title: t("space panel heading"),
|
|
3887
|
-
corner: /* @__PURE__ */
|
|
3771
|
+
corner: /* @__PURE__ */ React38.createElement(CloseButton, {
|
|
3888
3772
|
"data-testid": "identity-panel-done",
|
|
3889
3773
|
onDone
|
|
3890
3774
|
})
|
|
3891
|
-
}, /* @__PURE__ */
|
|
3775
|
+
}, /* @__PURE__ */ React38.createElement("div", {
|
|
3892
3776
|
role: "none",
|
|
3893
3777
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3894
|
-
}, /* @__PURE__ */
|
|
3778
|
+
}, /* @__PURE__ */ React38.createElement(Planet, {
|
|
3895
3779
|
size: 32,
|
|
3896
3780
|
weight: "light"
|
|
3897
|
-
}), /* @__PURE__ */
|
|
3781
|
+
}), /* @__PURE__ */ React38.createElement("div", {
|
|
3898
3782
|
className: "block text-start font-light text-xl"
|
|
3899
3783
|
}, name ?? space.key.truncate())));
|
|
3900
3784
|
};
|
|
3901
3785
|
var SpacePanelImpl = (props) => {
|
|
3902
3786
|
const { titleId, activeView, space, hideHeading, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3903
|
-
return /* @__PURE__ */
|
|
3787
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, !hideHeading && /* @__PURE__ */ React38.createElement(SpacePanelHeading, {
|
|
3904
3788
|
...rest,
|
|
3905
3789
|
titleId,
|
|
3906
3790
|
space
|
|
3907
|
-
}), /* @__PURE__ */
|
|
3791
|
+
}), /* @__PURE__ */ React38.createElement(Viewport.Root, {
|
|
3908
3792
|
activeView
|
|
3909
|
-
}, /* @__PURE__ */
|
|
3793
|
+
}, /* @__PURE__ */ React38.createElement(Viewport.Views, null, /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3910
3794
|
id: "space manager",
|
|
3911
3795
|
classNames: stepStyles
|
|
3912
|
-
}, /* @__PURE__ */
|
|
3796
|
+
}, /* @__PURE__ */ React38.createElement(SpaceManagerComponent, {
|
|
3913
3797
|
active: activeView === "space manager",
|
|
3914
3798
|
space,
|
|
3915
3799
|
target,
|
|
3916
3800
|
...rest
|
|
3917
|
-
})), /* @__PURE__ */
|
|
3801
|
+
})), /* @__PURE__ */ React38.createElement(Viewport.View, {
|
|
3918
3802
|
id: "space invitation manager",
|
|
3919
3803
|
classNames: stepStyles
|
|
3920
|
-
}, /* @__PURE__ */
|
|
3804
|
+
}, /* @__PURE__ */ React38.createElement(InvitationManagerComponent, {
|
|
3921
3805
|
active: activeView === "space invitation manager",
|
|
3922
3806
|
...rest,
|
|
3923
3807
|
invitationUrl: props.invitationUrl
|
|
@@ -3925,7 +3809,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3925
3809
|
};
|
|
3926
3810
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3927
3811
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3928
|
-
return /* @__PURE__ */
|
|
3812
|
+
return /* @__PURE__ */ React38.createElement(SpacePanelImpl, {
|
|
3929
3813
|
...props,
|
|
3930
3814
|
...invitationStatus,
|
|
3931
3815
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3972,24 +3856,24 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3972
3856
|
};
|
|
3973
3857
|
return spaceState.context.invitation ? (
|
|
3974
3858
|
// TODO(wittjosiah): Unused? Remove?
|
|
3975
|
-
/* @__PURE__ */
|
|
3859
|
+
/* @__PURE__ */ React38.createElement(SpacePanelWithInvitationImpl, {
|
|
3976
3860
|
...implProps,
|
|
3977
3861
|
invitation: spaceState.context.invitation
|
|
3978
3862
|
})
|
|
3979
|
-
) : /* @__PURE__ */
|
|
3863
|
+
) : /* @__PURE__ */ React38.createElement(SpacePanelImpl, implProps);
|
|
3980
3864
|
};
|
|
3981
3865
|
|
|
3982
3866
|
// packages/sdk/shell/src/panels/StatusPanel/StatusPanel.tsx
|
|
3983
|
-
import
|
|
3984
|
-
import { Status, useTranslation as
|
|
3867
|
+
import React39 from "react";
|
|
3868
|
+
import { Status, useTranslation as useTranslation24 } from "@dxos/react-ui";
|
|
3985
3869
|
var StatusPanel = ({ titleId }) => {
|
|
3986
|
-
const { t } =
|
|
3987
|
-
return /* @__PURE__ */
|
|
3870
|
+
const { t } = useTranslation24("os");
|
|
3871
|
+
return /* @__PURE__ */ React39.createElement("div", {
|
|
3988
3872
|
className: "grid place-items-center p-2 gap-2"
|
|
3989
|
-
}, /* @__PURE__ */
|
|
3873
|
+
}, /* @__PURE__ */ React39.createElement("p", {
|
|
3990
3874
|
id: titleId,
|
|
3991
3875
|
className: "font-medium text-center"
|
|
3992
|
-
}, t("resetting message")), /* @__PURE__ */
|
|
3876
|
+
}, t("resetting message")), /* @__PURE__ */ React39.createElement(Status, {
|
|
3993
3877
|
indeterminate: true
|
|
3994
3878
|
}, t("resetting message")));
|
|
3995
3879
|
};
|
|
@@ -3997,96 +3881,96 @@ var StatusPanel = ({ titleId }) => {
|
|
|
3997
3881
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3998
3882
|
var IdentityDialog = (props) => {
|
|
3999
3883
|
const titleId = useId10("identityDialog__title", props.title);
|
|
4000
|
-
return /* @__PURE__ */
|
|
3884
|
+
return /* @__PURE__ */ React40.createElement(Dialog.Root, {
|
|
4001
3885
|
defaultOpen: true,
|
|
4002
3886
|
onOpenChange: (open) => open || props.onDone?.()
|
|
4003
|
-
}, /* @__PURE__ */
|
|
3887
|
+
}, /* @__PURE__ */ React40.createElement(Dialog.Portal, null, /* @__PURE__ */ React40.createElement(Dialog.Overlay, null, /* @__PURE__ */ React40.createElement(Dialog.Content, {
|
|
4004
3888
|
"aria-labelledby": titleId,
|
|
4005
3889
|
onOpenAutoFocus: (e) => e.preventDefault()
|
|
4006
|
-
}, /* @__PURE__ */
|
|
3890
|
+
}, /* @__PURE__ */ React40.createElement(Clipboard3.Provider, null, /* @__PURE__ */ React40.createElement(IdentityPanel, {
|
|
4007
3891
|
...props,
|
|
4008
3892
|
titleId,
|
|
4009
|
-
doneActionParent: /* @__PURE__ */
|
|
3893
|
+
doneActionParent: /* @__PURE__ */ React40.createElement(Dialog.Close, {
|
|
4010
3894
|
asChild: true
|
|
4011
3895
|
})
|
|
4012
3896
|
}))))));
|
|
4013
3897
|
};
|
|
4014
3898
|
|
|
4015
3899
|
// packages/sdk/shell/src/composites/JoinDialog/JoinDialog.tsx
|
|
4016
|
-
import
|
|
3900
|
+
import React41 from "react";
|
|
4017
3901
|
import { AlertDialog, useId as useId11, useVisualViewport } from "@dxos/react-ui";
|
|
4018
3902
|
var JoinDialog = (joinPanelProps) => {
|
|
4019
3903
|
const titleId = useId11("joinDialog__title");
|
|
4020
3904
|
const { height } = useVisualViewport();
|
|
4021
|
-
return /* @__PURE__ */
|
|
3905
|
+
return /* @__PURE__ */ React41.createElement(AlertDialog.Root, {
|
|
4022
3906
|
defaultOpen: true,
|
|
4023
3907
|
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
4024
|
-
}, /* @__PURE__ */
|
|
3908
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog.Portal, null, /* @__PURE__ */ React41.createElement(AlertDialog.Overlay, {
|
|
4025
3909
|
classNames: "backdrop-blur",
|
|
4026
3910
|
...height && {
|
|
4027
3911
|
style: {
|
|
4028
3912
|
blockSize: `${height}px`
|
|
4029
3913
|
}
|
|
4030
3914
|
}
|
|
4031
|
-
}, /* @__PURE__ */
|
|
3915
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog.Content, {
|
|
4032
3916
|
"aria-labelledby": titleId
|
|
4033
|
-
}, /* @__PURE__ */
|
|
3917
|
+
}, /* @__PURE__ */ React41.createElement(JoinPanel, {
|
|
4034
3918
|
...joinPanelProps,
|
|
4035
3919
|
titleId,
|
|
4036
|
-
exitActionParent: /* @__PURE__ */
|
|
3920
|
+
exitActionParent: /* @__PURE__ */ React41.createElement(AlertDialog.Cancel, {
|
|
4037
3921
|
asChild: true
|
|
4038
3922
|
}),
|
|
4039
|
-
doneActionParent: /* @__PURE__ */
|
|
3923
|
+
doneActionParent: /* @__PURE__ */ React41.createElement(AlertDialog.Action, {
|
|
4040
3924
|
asChild: true
|
|
4041
3925
|
})
|
|
4042
3926
|
})))));
|
|
4043
3927
|
};
|
|
4044
3928
|
|
|
4045
3929
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
4046
|
-
import
|
|
3930
|
+
import React45, { StrictMode } from "react";
|
|
4047
3931
|
import { createRoot } from "react-dom/client";
|
|
4048
3932
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
4049
3933
|
import { AgentHostingProvider, ClientProvider, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2 } from "@dxos/react-client";
|
|
4050
|
-
import { Button as
|
|
3934
|
+
import { Button as Button10, Clipboard as Clipboard5, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip6, useTranslation as useTranslation25 } from "@dxos/react-ui";
|
|
4051
3935
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
4052
3936
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
4053
3937
|
|
|
4054
3938
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
4055
|
-
import
|
|
3939
|
+
import React44, { useEffect as useEffect8, useState as useState12 } from "react";
|
|
4056
3940
|
import { log as log15 } from "@dxos/log";
|
|
4057
3941
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
4058
3942
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
4059
3943
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
4060
3944
|
|
|
4061
3945
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
4062
|
-
import
|
|
4063
|
-
import { Dialog as Dialog2, useId as useId12 } from "@dxos/react-ui";
|
|
3946
|
+
import React42 from "react";
|
|
3947
|
+
import { Clipboard as Clipboard4, Dialog as Dialog2, useId as useId12 } from "@dxos/react-ui";
|
|
4064
3948
|
var SpaceDialog = (spacePanelProps) => {
|
|
4065
3949
|
const titleId = useId12("spaceDialog__title");
|
|
4066
|
-
return /* @__PURE__ */
|
|
3950
|
+
return /* @__PURE__ */ React42.createElement(Dialog2.Root, {
|
|
4067
3951
|
defaultOpen: true,
|
|
4068
3952
|
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
4069
|
-
}, /* @__PURE__ */
|
|
3953
|
+
}, /* @__PURE__ */ React42.createElement(Dialog2.Portal, null, /* @__PURE__ */ React42.createElement(Dialog2.Overlay, null, /* @__PURE__ */ React42.createElement(Dialog2.Content, {
|
|
4070
3954
|
"aria-labelledby": titleId
|
|
4071
|
-
}, /* @__PURE__ */
|
|
3955
|
+
}, /* @__PURE__ */ React42.createElement(Clipboard4.Provider, null, /* @__PURE__ */ React42.createElement(SpacePanel, {
|
|
4072
3956
|
...spacePanelProps,
|
|
4073
3957
|
titleId,
|
|
4074
|
-
doneActionParent: /* @__PURE__ */
|
|
3958
|
+
doneActionParent: /* @__PURE__ */ React42.createElement(Dialog2.Close, {
|
|
4075
3959
|
asChild: true
|
|
4076
3960
|
})
|
|
4077
3961
|
}))))));
|
|
4078
3962
|
};
|
|
4079
3963
|
|
|
4080
3964
|
// packages/sdk/shell/src/composites/StatusDialog/StatusDialog.tsx
|
|
4081
|
-
import
|
|
3965
|
+
import React43 from "react";
|
|
4082
3966
|
import { AlertDialog as AlertDialog2, useId as useId13 } from "@dxos/react-ui";
|
|
4083
3967
|
var StatusDialog = () => {
|
|
4084
3968
|
const titleId = useId13("statusDialog__title");
|
|
4085
|
-
return /* @__PURE__ */
|
|
3969
|
+
return /* @__PURE__ */ React43.createElement(AlertDialog2.Root, {
|
|
4086
3970
|
open: true
|
|
4087
|
-
}, /* @__PURE__ */
|
|
3971
|
+
}, /* @__PURE__ */ React43.createElement(AlertDialog2.Portal, null, /* @__PURE__ */ React43.createElement(AlertDialog2.Overlay, null, /* @__PURE__ */ React43.createElement(AlertDialog2.Content, {
|
|
4088
3972
|
"aria-labelledby": titleId
|
|
4089
|
-
}, /* @__PURE__ */
|
|
3973
|
+
}, /* @__PURE__ */ React43.createElement(StatusPanel, {
|
|
4090
3974
|
titleId
|
|
4091
3975
|
})))));
|
|
4092
3976
|
};
|
|
@@ -4095,14 +3979,14 @@ var StatusDialog = () => {
|
|
|
4095
3979
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
4096
3980
|
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
4097
3981
|
var Shell = ({ runtime }) => {
|
|
4098
|
-
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] =
|
|
3982
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState12({
|
|
4099
3983
|
layout: runtime.layout,
|
|
4100
3984
|
invitationCode: runtime.invitationCode,
|
|
4101
3985
|
spaceKey: runtime.spaceKey,
|
|
4102
3986
|
spaceId: runtime.spaceId,
|
|
4103
3987
|
target: runtime.target
|
|
4104
3988
|
});
|
|
4105
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
3989
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState12({
|
|
4106
3990
|
invitationUrl: runtime.invitationUrl,
|
|
4107
3991
|
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
4108
3992
|
spaceInvitationParam: runtime.spaceInvitationParam
|
|
@@ -4154,11 +4038,11 @@ var Shell = ({ runtime }) => {
|
|
|
4154
4038
|
]);
|
|
4155
4039
|
switch (layout) {
|
|
4156
4040
|
case ShellLayout.STATUS:
|
|
4157
|
-
return /* @__PURE__ */
|
|
4041
|
+
return /* @__PURE__ */ React44.createElement(StatusDialog, null);
|
|
4158
4042
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
4159
4043
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
4160
4044
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY:
|
|
4161
|
-
return /* @__PURE__ */
|
|
4045
|
+
return /* @__PURE__ */ React44.createElement(JoinDialog, {
|
|
4162
4046
|
mode: "halo-only",
|
|
4163
4047
|
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY ? "recover-identity" : layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
4164
4048
|
initialInvitationCode: invitationCode,
|
|
@@ -4178,7 +4062,7 @@ var Shell = ({ runtime }) => {
|
|
|
4178
4062
|
case ShellLayout.IDENTITY:
|
|
4179
4063
|
case ShellLayout.SHARE_IDENTITY:
|
|
4180
4064
|
case ShellLayout.EDIT_PROFILE:
|
|
4181
|
-
return /* @__PURE__ */
|
|
4065
|
+
return /* @__PURE__ */ React44.createElement(IdentityDialog, {
|
|
4182
4066
|
createInvitationUrl: createDeviceInvitationUrl,
|
|
4183
4067
|
onResetStorage: async () => {
|
|
4184
4068
|
runtime.setLayout({
|
|
@@ -4224,7 +4108,7 @@ var Shell = ({ runtime }) => {
|
|
|
4224
4108
|
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : "default"
|
|
4225
4109
|
});
|
|
4226
4110
|
case ShellLayout.SPACE:
|
|
4227
|
-
return space ? /* @__PURE__ */
|
|
4111
|
+
return space ? /* @__PURE__ */ React44.createElement(SpaceDialog, {
|
|
4228
4112
|
space,
|
|
4229
4113
|
target,
|
|
4230
4114
|
createInvitationUrl: createSpaceInvitationUrl,
|
|
@@ -4239,7 +4123,7 @@ var Shell = ({ runtime }) => {
|
|
|
4239
4123
|
}
|
|
4240
4124
|
}) : null;
|
|
4241
4125
|
case ShellLayout.JOIN_SPACE:
|
|
4242
|
-
return /* @__PURE__ */
|
|
4126
|
+
return /* @__PURE__ */ React44.createElement(JoinDialog, {
|
|
4243
4127
|
initialInvitationCode: invitationCode,
|
|
4244
4128
|
onDone: async (result) => {
|
|
4245
4129
|
blurActiveElement();
|
|
@@ -4271,7 +4155,7 @@ var Shell = ({ runtime }) => {
|
|
|
4271
4155
|
// packages/sdk/shell/src/composites/Shell/shell-runtime.ts
|
|
4272
4156
|
import { Event } from "@dxos/async";
|
|
4273
4157
|
import { appServiceBundle, shellServiceBundle } from "@dxos/client-protocol";
|
|
4274
|
-
import { invariant as
|
|
4158
|
+
import { invariant as invariant3 } from "@dxos/invariant";
|
|
4275
4159
|
import { ShellLayout as ShellLayout2 } from "@dxos/protocols/proto/dxos/iframe";
|
|
4276
4160
|
import { createProtoRpcPeer } from "@dxos/rpc";
|
|
4277
4161
|
var __dxlog_file15 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/shell-runtime.ts";
|
|
@@ -4330,7 +4214,7 @@ var ShellRuntimeImpl = class {
|
|
|
4330
4214
|
});
|
|
4331
4215
|
}
|
|
4332
4216
|
async setAppContext(context) {
|
|
4333
|
-
|
|
4217
|
+
invariant3(this._appRpc, "runtime not open", {
|
|
4334
4218
|
F: __dxlog_file15,
|
|
4335
4219
|
L: 83,
|
|
4336
4220
|
S: this,
|
|
@@ -4393,22 +4277,26 @@ var os = {
|
|
|
4393
4277
|
"identity radio group title": "Select an identity you\u2019ve associated with this device already",
|
|
4394
4278
|
"add identity label": "Add",
|
|
4395
4279
|
"continue label": "Continue",
|
|
4280
|
+
"pending label": "Pending",
|
|
4396
4281
|
"back label": "Back",
|
|
4397
4282
|
"next label": "Next",
|
|
4398
4283
|
"close label": "Close",
|
|
4399
4284
|
"auth choices label": "Choose an identity",
|
|
4400
4285
|
"create identity label": "Create an identity",
|
|
4401
4286
|
"create identity description": "Create a new identity.",
|
|
4402
|
-
"recover identity label": "Use a
|
|
4403
|
-
"recover identity description": "Enter your
|
|
4287
|
+
"recover identity label": "Use a recovery code",
|
|
4288
|
+
"recover identity description": "Enter your recovery code to log in manually.",
|
|
4289
|
+
"invitation input placeholder": "Invitation code",
|
|
4290
|
+
"recovery code placeholder": "Recovery code",
|
|
4291
|
+
"display name placeholder": "Display name",
|
|
4404
4292
|
"join identity label": "Use another device",
|
|
4405
4293
|
"join identity description": "Add this device to an identity you\u2019re already logged into on another device.",
|
|
4406
4294
|
"deselect identity label": "Back to identities",
|
|
4407
4295
|
"addition method chooser title": "An identity is required to continue",
|
|
4408
4296
|
"new identity input label": "Set display name",
|
|
4409
|
-
"recover identity input label": "Type or paste your
|
|
4297
|
+
"recover identity input label": "Type or paste your recovery code",
|
|
4410
4298
|
"failed to create identity message": "Failed to create an identity.",
|
|
4411
|
-
"failed to recover identity message": "Failed to recover an identity from the provided
|
|
4299
|
+
"failed to recover identity message": "Failed to recover an identity from the provided recovery code.",
|
|
4412
4300
|
"failed to authenticate message": "Incorrect code.",
|
|
4413
4301
|
"identity added label": "Created identity & added to this device:",
|
|
4414
4302
|
"join space as identity heading": "<part>as </part><part><icon/><label>{{labelValue}}</label></part>",
|
|
@@ -4542,25 +4430,25 @@ var runShell = async (config = new Config()) => {
|
|
|
4542
4430
|
const services = new ClientServicesProxy(createIFramePort({
|
|
4543
4431
|
channel: DEFAULT_CLIENT_CHANNEL
|
|
4544
4432
|
}));
|
|
4545
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4433
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React45.createElement(StrictMode, null, /* @__PURE__ */ React45.createElement(ThemeProvider, {
|
|
4546
4434
|
tx: defaultTx,
|
|
4547
4435
|
resourceExtensions: [
|
|
4548
4436
|
osTranslations
|
|
4549
4437
|
]
|
|
4550
|
-
}, /* @__PURE__ */
|
|
4438
|
+
}, /* @__PURE__ */ React45.createElement(ClientProvider, {
|
|
4551
4439
|
config,
|
|
4552
4440
|
services,
|
|
4553
4441
|
noBanner: true
|
|
4554
|
-
}, /* @__PURE__ */
|
|
4442
|
+
}, /* @__PURE__ */ React45.createElement(Clipboard5.Provider, null, /* @__PURE__ */ React45.createElement(Tooltip6.Provider, null, /* @__PURE__ */ React45.createElement(AgentHostingProvider, null, /* @__PURE__ */ React45.createElement(Shell, {
|
|
4555
4443
|
runtime
|
|
4556
4444
|
}))))))));
|
|
4557
4445
|
} catch {
|
|
4558
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4446
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React45.createElement(StrictMode, null, /* @__PURE__ */ React45.createElement(ThemeProvider, {
|
|
4559
4447
|
tx: defaultTx,
|
|
4560
4448
|
resourceExtensions: [
|
|
4561
4449
|
osTranslations
|
|
4562
4450
|
]
|
|
4563
|
-
}, /* @__PURE__ */
|
|
4451
|
+
}, /* @__PURE__ */ React45.createElement(Fallback, {
|
|
4564
4452
|
onClose: () => runtime.setAppContext({
|
|
4565
4453
|
display: ShellDisplay2.NONE
|
|
4566
4454
|
})
|
|
@@ -4568,24 +4456,24 @@ var runShell = async (config = new Config()) => {
|
|
|
4568
4456
|
}
|
|
4569
4457
|
};
|
|
4570
4458
|
var Fallback = ({ onClose }) => {
|
|
4571
|
-
const { t } =
|
|
4572
|
-
return /* @__PURE__ */
|
|
4459
|
+
const { t } = useTranslation25("os");
|
|
4460
|
+
return /* @__PURE__ */ React45.createElement(Dialog3.Root, {
|
|
4573
4461
|
modal: true,
|
|
4574
4462
|
open: true,
|
|
4575
4463
|
onOpenChange: () => onClose?.()
|
|
4576
|
-
}, /* @__PURE__ */
|
|
4464
|
+
}, /* @__PURE__ */ React45.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React45.createElement(Dialog3.Content, null, /* @__PURE__ */ React45.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React45.createElement(Dialog3.Close, {
|
|
4577
4465
|
asChild: true,
|
|
4578
4466
|
onClick: () => onClose?.()
|
|
4579
|
-
}, /* @__PURE__ */
|
|
4467
|
+
}, /* @__PURE__ */ React45.createElement(Button10, {
|
|
4580
4468
|
variant: "primary"
|
|
4581
4469
|
}, t("close label"))))));
|
|
4582
4470
|
};
|
|
4583
4471
|
|
|
4584
4472
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4585
|
-
import
|
|
4473
|
+
import React46, { createContext, useCallback as useCallback8, useContext, useEffect as useEffect9, useMemo as useMemo6, useState as useState13 } from "react";
|
|
4586
4474
|
import { useClient as useClient10, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
|
|
4587
4475
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4588
|
-
import { mx as
|
|
4476
|
+
import { mx as mx24 } from "@dxos/react-ui-theme";
|
|
4589
4477
|
|
|
4590
4478
|
// packages/sdk/shell/src/composites/Shell/memory-shell-runtime.ts
|
|
4591
4479
|
import { Event as Event2 } from "@dxos/async";
|
|
@@ -4638,10 +4526,10 @@ var MemoryShellRuntime = class {
|
|
|
4638
4526
|
};
|
|
4639
4527
|
|
|
4640
4528
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4641
|
-
var ShellContext = /* @__PURE__ */
|
|
4529
|
+
var ShellContext = /* @__PURE__ */ createContext({});
|
|
4642
4530
|
var useShell = () => {
|
|
4643
4531
|
const client = useClient10();
|
|
4644
|
-
const { runtime, setDisplay } =
|
|
4532
|
+
const { runtime, setDisplay } = useContext(ShellContext);
|
|
4645
4533
|
const setLayout = async (layout, options) => {
|
|
4646
4534
|
if (runtime) {
|
|
4647
4535
|
if (layout === ShellLayout4.DEFAULT) {
|
|
@@ -4663,7 +4551,7 @@ var useShell = () => {
|
|
|
4663
4551
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4664
4552
|
const client = useClient10();
|
|
4665
4553
|
const identity = useIdentity3();
|
|
4666
|
-
const [display, setDisplay] =
|
|
4554
|
+
const [display, setDisplay] = useState13(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4667
4555
|
const shellRuntime = useMemo6(() => {
|
|
4668
4556
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4669
4557
|
return;
|
|
@@ -4733,11 +4621,11 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4733
4621
|
}, [
|
|
4734
4622
|
shellRuntime
|
|
4735
4623
|
]);
|
|
4736
|
-
return /* @__PURE__ */
|
|
4737
|
-
className:
|
|
4738
|
-
}, /* @__PURE__ */
|
|
4624
|
+
return /* @__PURE__ */ React46.createElement(React46.Fragment, null, shellRuntime && /* @__PURE__ */ React46.createElement("div", {
|
|
4625
|
+
className: mx24(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4626
|
+
}, /* @__PURE__ */ React46.createElement(Shell, {
|
|
4739
4627
|
runtime: shellRuntime
|
|
4740
|
-
})), /* @__PURE__ */
|
|
4628
|
+
})), /* @__PURE__ */ React46.createElement(ShellContext.Provider, {
|
|
4741
4629
|
value: {
|
|
4742
4630
|
runtime: shellRuntime,
|
|
4743
4631
|
setDisplay
|
|
@@ -4751,14 +4639,10 @@ export {
|
|
|
4751
4639
|
AuthCode,
|
|
4752
4640
|
BifurcatedAction,
|
|
4753
4641
|
Centered,
|
|
4754
|
-
ClipboardContext,
|
|
4755
|
-
ClipboardProvider,
|
|
4756
4642
|
CloseButton,
|
|
4757
4643
|
CompoundButton,
|
|
4758
4644
|
ConfirmReset,
|
|
4759
4645
|
ConfirmResetImpl,
|
|
4760
|
-
CopyButton,
|
|
4761
|
-
CopyButtonIconOnly,
|
|
4762
4646
|
DeviceList,
|
|
4763
4647
|
Emoji,
|
|
4764
4648
|
EmojiPickerBlock,
|
|
@@ -4814,7 +4698,6 @@ export {
|
|
|
4814
4698
|
successBgColor,
|
|
4815
4699
|
successStrokeColor,
|
|
4816
4700
|
successTextColor,
|
|
4817
|
-
useClipboardContext,
|
|
4818
4701
|
useShell,
|
|
4819
4702
|
useViewportContext
|
|
4820
4703
|
};
|