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