@dxos/shell 0.7.4 → 0.7.5-labs.071a3e2
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 +17886 -21578
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +139 -137
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +523 -800
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react.cjs +620 -897
- 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 +523 -800
- package/dist/lib/node-esm/react.mjs.map +4 -4
- package/dist/types/src/components/AgentConfig.d.ts.map +1 -1
- package/dist/types/src/components/AgentConfig.js +2 -2
- package/dist/types/src/components/AgentConfig.js.map +1 -1
- package/dist/types/src/components/AuthCode.js +17 -7
- package/dist/types/src/components/AuthCode.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.js +1 -1
- package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -1
- package/dist/types/src/components/DeviceList/DeviceListItem.js +17 -7
- package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -1
- package/dist/types/src/components/IdentityList/IdentityListItem.js +17 -7
- package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.js +17 -7
- package/dist/types/src/components/IdentityList/SpaceMemberList.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListContainer.js +17 -7
- package/dist/types/src/components/InvitationList/InvitationListContainer.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +19 -9
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/components/Panel/Action.js +17 -7
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/components/Panel/Actions.js +17 -7
- package/dist/types/src/components/Panel/Actions.js.map +1 -1
- package/dist/types/src/components/Panel/Heading.js +17 -7
- package/dist/types/src/components/Panel/Heading.js.map +1 -1
- package/dist/types/src/components/Panel/StepHeading.js +17 -7
- package/dist/types/src/components/Panel/StepHeading.js.map +1 -1
- package/dist/types/src/components/SpaceListItem.js +17 -7
- package/dist/types/src/components/SpaceListItem.js.map +1 -1
- package/dist/types/src/components/StorybookDialog.js +1 -1
- package/dist/types/src/components/Viewport/Viewport.js +17 -7
- package/dist/types/src/components/Viewport/Viewport.js.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/index.js +0 -2
- package/dist/types/src/components/index.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +17 -7
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/Shell/ShellContext.js +17 -7
- package/dist/types/src/composites/Shell/ShellContext.js.map +1 -1
- package/dist/types/src/composites/Shell/run-shell.js +17 -7
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +22 -11
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +2 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.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 +20 -9
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinHeading.js +17 -7
- package/dist/types/src/panels/JoinPanel/JoinHeading.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +17 -7
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +17 -7
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +18 -8
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js +17 -7
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +17 -7
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +17 -7
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -1
- package/dist/types/src/panels/Panels.stories.js +17 -7
- package/dist/types/src/panels/Panels.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +17 -7
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +5 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +17 -7
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/steps/ConfirmReset.js +17 -7
- package/dist/types/src/steps/ConfirmReset.js.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +17 -7
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/stories/Invitations.e2e-stories.js +17 -7
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
- package/dist/types/src/testing/fixtures/identities.d.ts.map +1 -1
- package/dist/types/src/testing/fixtures/identities.js +2 -0
- package/dist/types/src/testing/fixtures/identities.js.map +1 -1
- package/dist/types/src/translations/index.js +17 -7
- package/dist/types/src/translations/index.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +31 -30
- package/src/components/AgentConfig.tsx +2 -4
- package/src/components/DeviceList/DeviceList.tsx +1 -1
- package/src/components/InvitationList/InvitationListItem.tsx +2 -2
- package/src/components/StorybookDialog.tsx +1 -1
- package/src/components/index.ts +0 -2
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +2 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +4 -3
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +2 -1
- package/src/panels/JoinPanel/steps/IdentityInput.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +6 -1
- package/src/testing/fixtures/identities.ts +2 -0
- package/dist/lib/browser/react.css +0 -7
- package/dist/lib/browser/react.css.map +0 -7
- package/dist/lib/node/react.css +0 -7
- package/dist/lib/node/react.css.map +0 -7
- package/dist/lib/node-esm/react.css +0 -7
- package/dist/lib/node-esm/react.css.map +0 -7
- package/dist/types/src/components/EmojiPicker.d.ts +0 -19
- package/dist/types/src/components/EmojiPicker.d.ts.map +0 -1
- package/dist/types/src/components/EmojiPicker.js +0 -136
- package/dist/types/src/components/EmojiPicker.js.map +0 -1
- package/dist/types/src/components/HuePicker.d.ts +0 -18
- package/dist/types/src/components/HuePicker.d.ts.map +0 -1
- package/dist/types/src/components/HuePicker.js +0 -123
- package/dist/types/src/components/HuePicker.js.map +0 -1
- package/src/components/EmojiPicker.tsx +0 -187
- package/src/components/HuePicker.tsx +0 -182
- package/src/components/emoji.css +0 -25
|
@@ -49,14 +49,13 @@ var AgentConfig = ({ agentStatus, validationMessage, onAgentDestroy, onAgentCrea
|
|
|
49
49
|
}, t("destroy agent label")), /* @__PURE__ */ React.createElement(Power, {
|
|
50
50
|
className: getSize(5)
|
|
51
51
|
}))), /* @__PURE__ */ React.createElement(Tooltip.Portal, null, /* @__PURE__ */ React.createElement(Tooltip.Content, {
|
|
52
|
-
side: "bottom"
|
|
53
|
-
classNames: "z-50"
|
|
52
|
+
side: "bottom"
|
|
54
53
|
}, t("destroy agent label"))))), agentStatus === "created" && /* @__PURE__ */ React.createElement("p", {
|
|
55
54
|
id: "devices-panel.create-agent.description",
|
|
56
55
|
className: mx(descriptionText, "mlb-2")
|
|
57
56
|
}, t("agent requested description"))) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Button, {
|
|
58
57
|
variant: "ghost",
|
|
59
|
-
classNames: "mlb-2 is-full justify-start gap-2
|
|
58
|
+
classNames: "mlb-2 is-full justify-start gap-2 pis-0 pie-3",
|
|
60
59
|
"data-testid": agentStatus === "creatable" ? "devices-panel.create-agent" : "devices-panel.agent-error",
|
|
61
60
|
onClick: agentStatus === "creatable" ? onAgentCreate : onAgentRefresh,
|
|
62
61
|
"aria-describedby": "devices-panel.create-agent.description"
|
|
@@ -136,359 +135,89 @@ var CompoundButton = ({ children, description, before, after, variant = "default
|
|
|
136
135
|
}, after));
|
|
137
136
|
};
|
|
138
137
|
|
|
139
|
-
// packages/sdk/shell/src/components/EmojiPicker.tsx
|
|
140
|
-
import emojiData from "@emoji-mart/data";
|
|
141
|
-
import EmojiMart from "@emoji-mart/react";
|
|
142
|
-
import { ArrowCounterClockwise, CaretDown, UserCircle } from "@phosphor-icons/react";
|
|
143
|
-
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
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";
|
|
147
|
-
var EmojiPickerToolbarButton = ({ disabled, defaultEmoji, emoji, onChangeEmoji, classNames }) => {
|
|
148
|
-
const { t } = useTranslation2("os");
|
|
149
|
-
const { themeMode } = useThemeContext2();
|
|
150
|
-
const [_emojiValue, setEmojiValue] = useControllableState({
|
|
151
|
-
prop: emoji,
|
|
152
|
-
onChange: onChangeEmoji,
|
|
153
|
-
defaultProp: defaultEmoji
|
|
154
|
-
});
|
|
155
|
-
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
156
|
-
const suppressNextTooltip = useRef(false);
|
|
157
|
-
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState(false);
|
|
158
|
-
return /* @__PURE__ */ React3.createElement(Tooltip2.Root, {
|
|
159
|
-
open: triggerTooltipOpen,
|
|
160
|
-
onOpenChange: (nextOpen) => {
|
|
161
|
-
if (suppressNextTooltip.current) {
|
|
162
|
-
setTriggerTooltipOpen(false);
|
|
163
|
-
suppressNextTooltip.current = false;
|
|
164
|
-
} else {
|
|
165
|
-
setTriggerTooltipOpen(nextOpen);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
169
|
-
open: emojiPickerOpen,
|
|
170
|
-
onOpenChange: (nextOpen) => {
|
|
171
|
-
setEmojiPickerOpen(nextOpen);
|
|
172
|
-
suppressNextTooltip.current = true;
|
|
173
|
-
}
|
|
174
|
-
}, /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
175
|
-
asChild: true
|
|
176
|
-
}, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
|
|
177
|
-
asChild: true
|
|
178
|
-
}, /* @__PURE__ */ React3.createElement(Toolbar.Button, {
|
|
179
|
-
classNames: [
|
|
180
|
-
"gap-2 text-2xl plb-1",
|
|
181
|
-
classNames
|
|
182
|
-
],
|
|
183
|
-
disabled
|
|
184
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
185
|
-
className: "sr-only"
|
|
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, {
|
|
189
|
-
side: "bottom",
|
|
190
|
-
classNames: "z-50"
|
|
191
|
-
}, t("select emoji label"), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null))), /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
192
|
-
side: "bottom",
|
|
193
|
-
onKeyDownCapture: (event) => {
|
|
194
|
-
if (event.key === "Escape") {
|
|
195
|
-
event.stopPropagation();
|
|
196
|
-
setEmojiPickerOpen(false);
|
|
197
|
-
suppressNextTooltip.current = true;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}, /* @__PURE__ */ React3.createElement(EmojiMart, {
|
|
201
|
-
data: emojiData,
|
|
202
|
-
onEmojiSelect: ({ native }) => {
|
|
203
|
-
if (native) {
|
|
204
|
-
setEmojiValue(native);
|
|
205
|
-
setEmojiPickerOpen(false);
|
|
206
|
-
}
|
|
207
|
-
},
|
|
208
|
-
autoFocus: true,
|
|
209
|
-
maxFrequentRows: 0,
|
|
210
|
-
noCountryFlags: true,
|
|
211
|
-
theme: themeMode
|
|
212
|
-
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))));
|
|
213
|
-
};
|
|
214
|
-
var EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }) => {
|
|
215
|
-
const { t } = useTranslation2("os");
|
|
216
|
-
const [isMd] = useMediaQuery("md", {
|
|
217
|
-
ssr: false
|
|
218
|
-
});
|
|
219
|
-
const [emojiValue, setEmojiValue] = useControllableState({
|
|
220
|
-
prop: emoji,
|
|
221
|
-
onChange: onChangeEmoji,
|
|
222
|
-
defaultProp: defaultEmoji
|
|
223
|
-
});
|
|
224
|
-
const [emojiPickerOpen, setEmojiPickerOpen] = useState(false);
|
|
225
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(Popover.Root, {
|
|
226
|
-
open: emojiPickerOpen,
|
|
227
|
-
onOpenChange: setEmojiPickerOpen
|
|
228
|
-
}, /* @__PURE__ */ React3.createElement(Popover.Trigger, {
|
|
229
|
-
asChild: true
|
|
230
|
-
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
231
|
-
variant: "ghost",
|
|
232
|
-
classNames: "gap-2 text-2xl plb-1",
|
|
233
|
-
disabled
|
|
234
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
235
|
-
className: "sr-only"
|
|
236
|
-
}, t("select emoji label")), /* @__PURE__ */ React3.createElement("span", {
|
|
237
|
-
className: "grow pis-14"
|
|
238
|
-
}, emojiValue), /* @__PURE__ */ React3.createElement(CaretDown, {
|
|
239
|
-
className: getSize2(4)
|
|
240
|
-
}))), /* @__PURE__ */ React3.createElement(Popover.Content, {
|
|
241
|
-
side: "right",
|
|
242
|
-
sideOffset: isMd ? 0 : -310,
|
|
243
|
-
onKeyDownCapture: (event) => {
|
|
244
|
-
if (event.key === "Escape") {
|
|
245
|
-
event.stopPropagation();
|
|
246
|
-
setEmojiPickerOpen(false);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}, /* @__PURE__ */ React3.createElement(EmojiMart, {
|
|
250
|
-
data: emojiData,
|
|
251
|
-
onEmojiSelect: ({ native }) => {
|
|
252
|
-
if (native) {
|
|
253
|
-
setEmojiValue(native);
|
|
254
|
-
setEmojiPickerOpen(false);
|
|
255
|
-
}
|
|
256
|
-
},
|
|
257
|
-
autoFocus: true,
|
|
258
|
-
maxFrequentRows: 0,
|
|
259
|
-
noCountryFlags: true
|
|
260
|
-
}), /* @__PURE__ */ React3.createElement(Popover.Arrow, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Root, null, /* @__PURE__ */ React3.createElement(Tooltip2.Trigger, {
|
|
261
|
-
asChild: true
|
|
262
|
-
}, /* @__PURE__ */ React3.createElement(Button2, {
|
|
263
|
-
variant: "ghost",
|
|
264
|
-
onClick: onClickClear,
|
|
265
|
-
disabled
|
|
266
|
-
}, /* @__PURE__ */ React3.createElement("span", {
|
|
267
|
-
className: "sr-only"
|
|
268
|
-
}, t("clear label")), /* @__PURE__ */ React3.createElement(ArrowCounterClockwise, null))), /* @__PURE__ */ React3.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React3.createElement(Tooltip2.Content, {
|
|
269
|
-
style: {
|
|
270
|
-
zIndex: 70
|
|
271
|
-
},
|
|
272
|
-
side: "right"
|
|
273
|
-
}, t("clear label"), /* @__PURE__ */ React3.createElement(Tooltip2.Arrow, null)))));
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
// packages/sdk/shell/src/components/HuePicker.tsx
|
|
277
|
-
import { ArrowCounterClockwise as ArrowCounterClockwise2, CaretDown as CaretDown2, Check, Palette } from "@phosphor-icons/react";
|
|
278
|
-
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
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";
|
|
282
|
-
var HuePreview = ({ hue }) => {
|
|
283
|
-
const { tx } = useThemeContext3();
|
|
284
|
-
const size = 20;
|
|
285
|
-
return /* @__PURE__ */ React4.createElement("svg", {
|
|
286
|
-
width: size,
|
|
287
|
-
height: size,
|
|
288
|
-
viewBox: `0 0 ${size} ${size}`
|
|
289
|
-
}, /* @__PURE__ */ React4.createElement("rect", {
|
|
290
|
-
x: 0,
|
|
291
|
-
y: 0,
|
|
292
|
-
width: size,
|
|
293
|
-
height: size,
|
|
294
|
-
className: tx("hue.fill", "select--hue__preview", {
|
|
295
|
-
hue
|
|
296
|
-
})
|
|
297
|
-
}));
|
|
298
|
-
};
|
|
299
|
-
var hueTokens = Object.keys(hueTokenThemes).slice(0, 16);
|
|
300
|
-
var HuePickerToolbarButton = ({ disabled, hue, onChangeHue, classNames, defaultHue }) => {
|
|
301
|
-
const { t } = useTranslation3("os");
|
|
302
|
-
const [hueValue, setHueValue] = useControllableState2({
|
|
303
|
-
prop: hue,
|
|
304
|
-
onChange: onChangeHue,
|
|
305
|
-
defaultProp: defaultHue
|
|
306
|
-
});
|
|
307
|
-
const [huePickerOpen, setHuePickerOpen] = useState2(false);
|
|
308
|
-
const suppressNextTooltip = useRef2(false);
|
|
309
|
-
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState2(false);
|
|
310
|
-
return /* @__PURE__ */ React4.createElement(Tooltip3.Root, {
|
|
311
|
-
open: triggerTooltipOpen,
|
|
312
|
-
onOpenChange: (nextOpen) => {
|
|
313
|
-
if (suppressNextTooltip.current) {
|
|
314
|
-
setTriggerTooltipOpen(false);
|
|
315
|
-
suppressNextTooltip.current = false;
|
|
316
|
-
} else {
|
|
317
|
-
setTriggerTooltipOpen(nextOpen);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
|
|
321
|
-
modal: false,
|
|
322
|
-
open: huePickerOpen,
|
|
323
|
-
onOpenChange: (nextOpen) => {
|
|
324
|
-
setHuePickerOpen(nextOpen);
|
|
325
|
-
suppressNextTooltip.current = true;
|
|
326
|
-
}
|
|
327
|
-
}, /* @__PURE__ */ React4.createElement(Tooltip3.Trigger, {
|
|
328
|
-
asChild: true
|
|
329
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
330
|
-
asChild: true
|
|
331
|
-
}, /* @__PURE__ */ React4.createElement(Toolbar2.Button, {
|
|
332
|
-
classNames: mx3("gap-2 plb-1", classNames),
|
|
333
|
-
disabled
|
|
334
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
335
|
-
className: "sr-only"
|
|
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, {
|
|
339
|
-
side: "bottom",
|
|
340
|
-
classNames: "z-50"
|
|
341
|
-
}, t("select hue label"), /* @__PURE__ */ React4.createElement(Tooltip3.Arrow, null))), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
|
|
342
|
-
side: "bottom",
|
|
343
|
-
classNames: "!w-40"
|
|
344
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, {
|
|
345
|
-
classNames: "grid grid-cols-4"
|
|
346
|
-
}, hueTokens.map((hue2) => {
|
|
347
|
-
return /* @__PURE__ */ React4.createElement(DropdownMenu.CheckboxItem, {
|
|
348
|
-
key: hue2,
|
|
349
|
-
checked: hue2 === hueValue,
|
|
350
|
-
onCheckedChange: () => setHueValue(hue2),
|
|
351
|
-
classNames: "px-0 py-2 items-center justify-center"
|
|
352
|
-
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
353
|
-
hue: hue2
|
|
354
|
-
}));
|
|
355
|
-
})))));
|
|
356
|
-
};
|
|
357
|
-
var HuePickerBlock = ({ disabled, hue, onChangeHue, defaultHue, onClickClear }) => {
|
|
358
|
-
const { t } = useTranslation3("os");
|
|
359
|
-
const [hueValue, setHueValue] = useControllableState2({
|
|
360
|
-
prop: hue,
|
|
361
|
-
onChange: onChangeHue,
|
|
362
|
-
defaultProp: defaultHue
|
|
363
|
-
});
|
|
364
|
-
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(DropdownMenu.Root, {
|
|
365
|
-
modal: false
|
|
366
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Trigger, {
|
|
367
|
-
asChild: true
|
|
368
|
-
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
369
|
-
variant: "ghost",
|
|
370
|
-
classNames: "gap-2 plb-1",
|
|
371
|
-
disabled
|
|
372
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
373
|
-
className: "sr-only"
|
|
374
|
-
}, t("select hue label")), /* @__PURE__ */ React4.createElement("div", {
|
|
375
|
-
role: "none",
|
|
376
|
-
className: "pis-14 grow flex items-center justify-center gap-2"
|
|
377
|
-
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
378
|
-
hue: hueValue
|
|
379
|
-
}), /* @__PURE__ */ React4.createElement("span", null, t(`${hueValue} label`))), /* @__PURE__ */ React4.createElement(CaretDown2, {
|
|
380
|
-
className: getSize3(4)
|
|
381
|
-
}))), /* @__PURE__ */ React4.createElement(DropdownMenu.Content, {
|
|
382
|
-
side: "right"
|
|
383
|
-
}, /* @__PURE__ */ React4.createElement(DropdownMenu.Viewport, null, Object.keys(hueTokenThemes).map((hue2) => {
|
|
384
|
-
return /* @__PURE__ */ React4.createElement(DropdownMenu.CheckboxItem, {
|
|
385
|
-
key: hue2,
|
|
386
|
-
checked: hue2 === hueValue,
|
|
387
|
-
onCheckedChange: () => setHueValue(hue2)
|
|
388
|
-
}, /* @__PURE__ */ React4.createElement(HuePreview, {
|
|
389
|
-
hue: hue2
|
|
390
|
-
}), /* @__PURE__ */ React4.createElement("span", {
|
|
391
|
-
className: "grow"
|
|
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, {
|
|
394
|
-
asChild: true
|
|
395
|
-
}, /* @__PURE__ */ React4.createElement(Button3, {
|
|
396
|
-
variant: "ghost",
|
|
397
|
-
onClick: onClickClear,
|
|
398
|
-
disabled
|
|
399
|
-
}, /* @__PURE__ */ React4.createElement("span", {
|
|
400
|
-
className: "sr-only"
|
|
401
|
-
}, t("clear label")), /* @__PURE__ */ React4.createElement(ArrowCounterClockwise2, null))), /* @__PURE__ */ React4.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React4.createElement(Tooltip3.Content, {
|
|
402
|
-
style: {
|
|
403
|
-
zIndex: 70
|
|
404
|
-
},
|
|
405
|
-
side: "right"
|
|
406
|
-
}, t("clear label"), /* @__PURE__ */ React4.createElement(Tooltip3.Arrow, null)))));
|
|
407
|
-
};
|
|
408
|
-
|
|
409
138
|
// packages/sdk/shell/src/components/IdentityList/IdentityListItem.tsx
|
|
410
|
-
import
|
|
139
|
+
import React3, { forwardRef } from "react";
|
|
411
140
|
import { generateName } from "@dxos/display-name";
|
|
412
141
|
import { SpaceMember } from "@dxos/react-client/echo";
|
|
413
142
|
import { ListItem, Avatar as Avatar2, useId as useId2 } from "@dxos/react-ui";
|
|
414
|
-
import { mx as
|
|
143
|
+
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
415
144
|
import { keyToFallback } from "@dxos/util";
|
|
416
145
|
var IdentityListItem = /* @__PURE__ */ forwardRef(({ identity, presence, onClick, classNames, ...props }, forwardedRef) => {
|
|
417
146
|
const fallbackValue = keyToFallback(identity.identityKey);
|
|
418
147
|
const labelId = useId2("identityListItem__label");
|
|
419
148
|
const displayName = identity.profile?.displayName ?? generateName(identity.identityKey.toHex());
|
|
420
|
-
return /* @__PURE__ */
|
|
149
|
+
return /* @__PURE__ */ React3.createElement(ListItem.Root, {
|
|
421
150
|
...props,
|
|
422
|
-
classNames:
|
|
151
|
+
classNames: mx3("flex gap-2 pis-3 pie-1 items-center", onClick && "cursor-pointer", classNames),
|
|
423
152
|
onClick: () => onClick?.(),
|
|
424
153
|
"data-testid": "identity-list-item",
|
|
425
154
|
labelId,
|
|
426
155
|
ref: forwardedRef
|
|
427
|
-
}, /* @__PURE__ */
|
|
156
|
+
}, /* @__PURE__ */ React3.createElement(Avatar2.Root, {
|
|
428
157
|
status: presence === SpaceMember.PresenceState.ONLINE ? "active" : "inactive",
|
|
429
158
|
labelId,
|
|
430
159
|
hue: identity.profile?.data?.hue || fallbackValue.hue
|
|
431
|
-
}, /* @__PURE__ */
|
|
160
|
+
}, /* @__PURE__ */ React3.createElement(Avatar2.Frame, {
|
|
432
161
|
classNames: "place-self-center"
|
|
433
|
-
}, /* @__PURE__ */
|
|
162
|
+
}, /* @__PURE__ */ React3.createElement(Avatar2.Fallback, {
|
|
434
163
|
text: identity.profile?.data?.emoji || fallbackValue.emoji
|
|
435
|
-
})), /* @__PURE__ */
|
|
164
|
+
})), /* @__PURE__ */ React3.createElement(Avatar2.Label, {
|
|
436
165
|
classNames: "text-sm truncate pli-2"
|
|
437
166
|
}, displayName)));
|
|
438
167
|
});
|
|
439
168
|
|
|
440
169
|
// packages/sdk/shell/src/components/IdentityList/SpaceMemberList.tsx
|
|
441
|
-
import
|
|
170
|
+
import React4, { useMemo } from "react";
|
|
442
171
|
import { useClient } from "@dxos/react-client";
|
|
443
172
|
import { useMembers } from "@dxos/react-client/echo";
|
|
444
|
-
import { useTranslation as
|
|
445
|
-
import { descriptionText as descriptionText3, mx as
|
|
173
|
+
import { useTranslation as useTranslation2, List } from "@dxos/react-ui";
|
|
174
|
+
import { descriptionText as descriptionText3, mx as mx4 } from "@dxos/react-ui-theme";
|
|
446
175
|
var SpaceMemberList = ({ spaceKey, includeSelf, onSelect }) => {
|
|
447
176
|
const client = useClient();
|
|
448
177
|
const allUnsortedMembers = useMembers(spaceKey);
|
|
449
178
|
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)), [
|
|
450
179
|
allUnsortedMembers
|
|
451
180
|
]);
|
|
452
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ React4.createElement(SpaceMemberListImpl, {
|
|
453
182
|
members,
|
|
454
183
|
onSelect
|
|
455
184
|
});
|
|
456
185
|
};
|
|
457
186
|
var SpaceMemberListImpl = ({ members, onSelect }) => {
|
|
458
|
-
const { t } =
|
|
187
|
+
const { t } = useTranslation2("os");
|
|
459
188
|
const visibleMembers = members.filter((member) => member.identity);
|
|
460
|
-
return visibleMembers.length > 0 ? /* @__PURE__ */
|
|
189
|
+
return visibleMembers.length > 0 ? /* @__PURE__ */ React4.createElement(List, {
|
|
461
190
|
classNames: "flex flex-col gap-2",
|
|
462
191
|
"data-testid": "space-members-list"
|
|
463
192
|
}, visibleMembers.map((member) => {
|
|
464
|
-
return /* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ React4.createElement(IdentityListItem, {
|
|
465
194
|
key: member.identity.identityKey.toHex(),
|
|
466
195
|
identity: member.identity,
|
|
467
196
|
presence: member.presence,
|
|
468
197
|
onClick: onSelect && (() => onSelect(member))
|
|
469
198
|
});
|
|
470
|
-
})) : /* @__PURE__ */
|
|
199
|
+
})) : /* @__PURE__ */ React4.createElement("div", {
|
|
471
200
|
role: "none",
|
|
472
201
|
className: "grow flex items-center p-2"
|
|
473
|
-
}, /* @__PURE__ */
|
|
474
|
-
className:
|
|
202
|
+
}, /* @__PURE__ */ React4.createElement("p", {
|
|
203
|
+
className: mx4(descriptionText3, "text-center is-full mlb-2")
|
|
475
204
|
}, t("empty space members message")));
|
|
476
205
|
};
|
|
477
206
|
|
|
478
207
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
479
208
|
import { CaretRight, Plus as Plus2 } from "@phosphor-icons/react";
|
|
480
|
-
import
|
|
481
|
-
import { Button as
|
|
482
|
-
import { descriptionText as descriptionText4, getSize as
|
|
209
|
+
import React6 from "react";
|
|
210
|
+
import { Button as Button3, List as List2, useTranslation as useTranslation4 } from "@dxos/react-ui";
|
|
211
|
+
import { descriptionText as descriptionText4, getSize as getSize3, mx as mx5 } from "@dxos/react-ui-theme";
|
|
483
212
|
|
|
484
213
|
// packages/sdk/shell/src/components/DeviceList/DeviceListItem.tsx
|
|
485
214
|
import { Compass, Desktop, DeviceMobile, Devices, DotsThree, ShareFat, Power as Power2, Robot, Database as Database2, FirstAidKit } from "@phosphor-icons/react";
|
|
486
|
-
import
|
|
215
|
+
import React5, { forwardRef as forwardRef2 } from "react";
|
|
487
216
|
import { generateName as generateName2 } from "@dxos/display-name";
|
|
488
217
|
import { Device, DeviceType, DeviceKind } from "@dxos/react-client/halo";
|
|
489
218
|
import { ConnectionState } from "@dxos/react-client/mesh";
|
|
490
|
-
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as
|
|
491
|
-
import { getSize as
|
|
219
|
+
import { ListItem as ListItem2, Avatar as Avatar3, useId as useId3, Tag, useTranslation as useTranslation3, DropdownMenu, Button as Button2 } from "@dxos/react-ui";
|
|
220
|
+
import { getSize as getSize2 } from "@dxos/react-ui-theme";
|
|
492
221
|
import { keyToFallback as keyToFallback2 } from "@dxos/util";
|
|
493
222
|
var iconProps = {
|
|
494
223
|
weight: "duotone",
|
|
@@ -498,7 +227,7 @@ var iconProps = {
|
|
|
498
227
|
y: 8
|
|
499
228
|
};
|
|
500
229
|
var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, classNames, connectionState, onAgentDestroy: _, ...props }, forwardedRef) => {
|
|
501
|
-
const { t } =
|
|
230
|
+
const { t } = useTranslation3("os");
|
|
502
231
|
const fallbackValue = keyToFallback2(device.deviceKey);
|
|
503
232
|
const labelId = useId3("identityListItem__label");
|
|
504
233
|
const displayName = device.profile ? t("device name placeholder", {
|
|
@@ -506,7 +235,7 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
506
235
|
platform: device.profile.platform
|
|
507
236
|
}) : generateName2(device.deviceKey.toHex());
|
|
508
237
|
const isCurrent = device.kind === DeviceKind.CURRENT;
|
|
509
|
-
return /* @__PURE__ */
|
|
238
|
+
return /* @__PURE__ */ React5.createElement(ListItem2.Root, {
|
|
510
239
|
...props,
|
|
511
240
|
classNames: [
|
|
512
241
|
"flex gap-2 items-center mlb-2",
|
|
@@ -515,60 +244,60 @@ var DeviceListItem = /* @__PURE__ */ forwardRef2(({ device, onClickAdd, onClickE
|
|
|
515
244
|
"data-testid": `device-list-item${isCurrent ? "-current" : ""}`,
|
|
516
245
|
labelId,
|
|
517
246
|
ref: forwardedRef
|
|
518
|
-
}, /* @__PURE__ */
|
|
247
|
+
}, /* @__PURE__ */ React5.createElement(Avatar3.Root, {
|
|
519
248
|
status: isCurrent && connectionState === ConnectionState.OFFLINE ? "error" : device.presence === Device.PresenceState.ONLINE ? "active" : "inactive",
|
|
520
249
|
labelId,
|
|
521
250
|
hue: fallbackValue.hue,
|
|
522
251
|
variant: "square"
|
|
523
|
-
}, /* @__PURE__ */
|
|
252
|
+
}, /* @__PURE__ */ React5.createElement(Avatar3.Frame, {
|
|
524
253
|
classNames: "place-self-center"
|
|
525
|
-
}, device.profile?.type ? device.profile.type === DeviceType.AGENT_MANAGED ? /* @__PURE__ */
|
|
254
|
+
}, device.profile?.type ? device.profile.type === DeviceType.AGENT_MANAGED ? /* @__PURE__ */ React5.createElement(Database2, iconProps) : device.profile.type === DeviceType.BROWSER ? /* @__PURE__ */ React5.createElement(Compass, iconProps) : device.profile.type === DeviceType.NATIVE ? /* @__PURE__ */ React5.createElement(Desktop, iconProps) : [
|
|
526
255
|
DeviceType.AGENT,
|
|
527
256
|
DeviceType.AGENT_MANAGED
|
|
528
|
-
].includes(device.profile.type) ? /* @__PURE__ */
|
|
257
|
+
].includes(device.profile.type) ? /* @__PURE__ */ React5.createElement(Robot, iconProps) : device.profile.type === DeviceType.MOBILE ? /* @__PURE__ */ React5.createElement(DeviceMobile, iconProps) : /* @__PURE__ */ React5.createElement(Devices, iconProps) : /* @__PURE__ */ React5.createElement(Avatar3.Fallback, {
|
|
529
258
|
text: fallbackValue.emoji
|
|
530
|
-
})), /* @__PURE__ */
|
|
259
|
+
})), /* @__PURE__ */ React5.createElement(Avatar3.Label, {
|
|
531
260
|
classNames: "flex-1 text-sm truncate"
|
|
532
|
-
}, displayName), isCurrent && /* @__PURE__ */
|
|
261
|
+
}, displayName), isCurrent && /* @__PURE__ */ React5.createElement(Tag, {
|
|
533
262
|
color: "primary"
|
|
534
|
-
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */
|
|
263
|
+
}, t("current device tag label")), device.kind === DeviceKind.CURRENT && /* @__PURE__ */ React5.createElement(DropdownMenu.Root, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Trigger, {
|
|
535
264
|
asChild: true
|
|
536
|
-
}, /* @__PURE__ */
|
|
265
|
+
}, /* @__PURE__ */ React5.createElement(Button2, {
|
|
537
266
|
variant: "ghost",
|
|
538
267
|
classNames: "pli-0 is-[--rail-action] bs-[--rail-action]",
|
|
539
268
|
"data-testid": `device-list-item${isCurrent ? "-current" : ""}.options`
|
|
540
|
-
}, /* @__PURE__ */
|
|
269
|
+
}, /* @__PURE__ */ React5.createElement("span", {
|
|
541
270
|
className: "sr-only"
|
|
542
|
-
}, t("more options label")), /* @__PURE__ */
|
|
543
|
-
className:
|
|
544
|
-
}))), /* @__PURE__ */
|
|
271
|
+
}, t("more options label")), /* @__PURE__ */ React5.createElement(DotsThree, {
|
|
272
|
+
className: getSize2(5)
|
|
273
|
+
}))), /* @__PURE__ */ React5.createElement(DropdownMenu.Content, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
545
274
|
"data-testid": "device-list-item-current.join-existing",
|
|
546
275
|
onClick: onClickJoinExisting
|
|
547
|
-
}, /* @__PURE__ */
|
|
548
|
-
className:
|
|
549
|
-
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */
|
|
276
|
+
}, /* @__PURE__ */ React5.createElement(ShareFat, {
|
|
277
|
+
className: getSize2(5)
|
|
278
|
+
}), t("choose join new identity label")), onClickRecover && /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
550
279
|
"data-testid": "device-list-item-current.recover",
|
|
551
280
|
onClick: onClickRecover
|
|
552
|
-
}, /* @__PURE__ */
|
|
553
|
-
className:
|
|
554
|
-
}), t("choose recover identity label")), /* @__PURE__ */
|
|
281
|
+
}, /* @__PURE__ */ React5.createElement(FirstAidKit, {
|
|
282
|
+
className: getSize2(5)
|
|
283
|
+
}), t("choose recover identity label")), /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
555
284
|
"data-testid": "device-list-item-current.reset",
|
|
556
285
|
onClick: onClickReset
|
|
557
|
-
}, /* @__PURE__ */
|
|
558
|
-
className:
|
|
286
|
+
}, /* @__PURE__ */ React5.createElement(Power2, {
|
|
287
|
+
className: getSize2(5)
|
|
559
288
|
}), t("reset device label")))))));
|
|
560
289
|
});
|
|
561
290
|
|
|
562
291
|
// packages/sdk/shell/src/components/DeviceList/DeviceList.tsx
|
|
563
292
|
var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickReset, onClickRecover, onClickJoinExisting, onAgentDestroy }) => {
|
|
564
|
-
const { t } =
|
|
565
|
-
return /* @__PURE__ */
|
|
293
|
+
const { t } = useTranslation4("os");
|
|
294
|
+
return /* @__PURE__ */ React6.createElement("div", {
|
|
566
295
|
role: "none",
|
|
567
296
|
className: "p-1"
|
|
568
|
-
}, /* @__PURE__ */
|
|
569
|
-
className:
|
|
570
|
-
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */
|
|
571
|
-
return /* @__PURE__ */
|
|
297
|
+
}, /* @__PURE__ */ React6.createElement("h2", {
|
|
298
|
+
className: mx5(descriptionText4, "text-center mbs-2")
|
|
299
|
+
}, t("devices heading")), devices.length > 0 && /* @__PURE__ */ React6.createElement(List2, null, devices.map((device) => {
|
|
300
|
+
return /* @__PURE__ */ React6.createElement(DeviceListItem, {
|
|
572
301
|
key: device.deviceKey.toHex(),
|
|
573
302
|
device,
|
|
574
303
|
onClickEdit: () => onClickEdit?.(device),
|
|
@@ -578,43 +307,43 @@ var DeviceList = ({ devices, connectionState, onClickAdd, onClickEdit, onClickRe
|
|
|
578
307
|
connectionState,
|
|
579
308
|
onAgentDestroy
|
|
580
309
|
});
|
|
581
|
-
})), /* @__PURE__ */
|
|
310
|
+
})), /* @__PURE__ */ React6.createElement(Button3, {
|
|
582
311
|
variant: "ghost",
|
|
583
|
-
classNames: "justify-start gap-2
|
|
312
|
+
classNames: "justify-start gap-2 pis-0 pie-3 is-full",
|
|
584
313
|
"data-testid": "devices-panel.create-invitation",
|
|
585
314
|
onClick: onClickAdd
|
|
586
|
-
}, /* @__PURE__ */
|
|
315
|
+
}, /* @__PURE__ */ React6.createElement("div", {
|
|
587
316
|
role: "img",
|
|
588
|
-
className:
|
|
589
|
-
}, /* @__PURE__ */
|
|
317
|
+
className: mx5(getSize3(8), "m-1 rounded-sm bg-input grid place-items-center")
|
|
318
|
+
}, /* @__PURE__ */ React6.createElement(Plus2, {
|
|
590
319
|
weight: "light",
|
|
591
|
-
className:
|
|
592
|
-
})), /* @__PURE__ */
|
|
320
|
+
className: getSize3(6)
|
|
321
|
+
})), /* @__PURE__ */ React6.createElement("span", {
|
|
593
322
|
className: "grow font-medium text-start"
|
|
594
|
-
}, t("choose add device label")), /* @__PURE__ */
|
|
323
|
+
}, t("choose add device label")), /* @__PURE__ */ React6.createElement(CaretRight, {
|
|
595
324
|
weight: "bold",
|
|
596
|
-
className:
|
|
325
|
+
className: getSize3(4)
|
|
597
326
|
})));
|
|
598
327
|
};
|
|
599
328
|
|
|
600
329
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
601
330
|
import { X } from "@phosphor-icons/react";
|
|
602
331
|
import { formatDistanceToNow } from "date-fns";
|
|
603
|
-
import
|
|
332
|
+
import React8, { useCallback } from "react";
|
|
604
333
|
import { Invitation, useInvitationStatus } from "@dxos/react-client/invitations";
|
|
605
|
-
import { Button as
|
|
606
|
-
import { focusRing, getSize as
|
|
334
|
+
import { Button as Button4, Clipboard, ListItem as ListItem3, useTranslation as useTranslation5, Avatar as Avatar4, useThemeContext as useThemeContext2, Tooltip as Tooltip2 } from "@dxos/react-ui";
|
|
335
|
+
import { focusRing, getSize as getSize4, mx as mx7 } from "@dxos/react-ui-theme";
|
|
607
336
|
import { hexToEmoji } from "@dxos/util";
|
|
608
337
|
|
|
609
338
|
// packages/sdk/shell/src/components/AuthCode.tsx
|
|
610
|
-
import
|
|
611
|
-
import { mx as
|
|
339
|
+
import React7, { useRef } from "react";
|
|
340
|
+
import { mx as mx6 } from "@dxos/react-ui-theme";
|
|
612
341
|
var AuthCode = (props) => {
|
|
613
342
|
const { code, large, classNames } = props;
|
|
614
343
|
const l = code?.length ?? 0;
|
|
615
344
|
const left = code?.slice(0, l / 2);
|
|
616
345
|
const right = code?.slice(l / 2);
|
|
617
|
-
const codeRef =
|
|
346
|
+
const codeRef = useRef(null);
|
|
618
347
|
const handleClick = () => {
|
|
619
348
|
if (codeRef.current) {
|
|
620
349
|
const selection = window.getSelection();
|
|
@@ -625,20 +354,20 @@ var AuthCode = (props) => {
|
|
|
625
354
|
}
|
|
626
355
|
void navigator.clipboard.writeText(code ?? "");
|
|
627
356
|
};
|
|
628
|
-
return /* @__PURE__ */
|
|
629
|
-
className:
|
|
357
|
+
return /* @__PURE__ */ React7.createElement("span", {
|
|
358
|
+
className: mx6(large ? "text-6xl" : "text-2xl", "font-mono pli-2.5 rounded cursor-pointer", classNames),
|
|
630
359
|
onClick: handleClick,
|
|
631
360
|
ref: codeRef
|
|
632
|
-
}, /* @__PURE__ */
|
|
361
|
+
}, /* @__PURE__ */ React7.createElement("span", {
|
|
633
362
|
className: "mie-[0.4em]"
|
|
634
|
-
}, left), /* @__PURE__ */
|
|
363
|
+
}, left), /* @__PURE__ */ React7.createElement("span", null, right));
|
|
635
364
|
};
|
|
636
365
|
|
|
637
366
|
// packages/sdk/shell/src/components/InvitationList/InvitationListItem.tsx
|
|
638
367
|
var InvitationListItem = (props) => {
|
|
639
368
|
const { invitation } = props;
|
|
640
369
|
const invitationStatus = useInvitationStatus(invitation);
|
|
641
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ React8.createElement(InvitationListItemImpl, {
|
|
642
371
|
...props,
|
|
643
372
|
invitationStatus
|
|
644
373
|
});
|
|
@@ -648,11 +377,11 @@ var avatarProps = {
|
|
|
648
377
|
variant: "circle"
|
|
649
378
|
};
|
|
650
379
|
var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
651
|
-
const { tx } =
|
|
652
|
-
return /* @__PURE__ */
|
|
380
|
+
const { tx } = useThemeContext2();
|
|
381
|
+
return /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement("span", {
|
|
653
382
|
role: "none",
|
|
654
|
-
className:
|
|
655
|
-
}, /* @__PURE__ */
|
|
383
|
+
className: mx7("absolute inline-end-auto opacity-20", reverseEffects ? "inline-start-3" : "inline-start-1", getSize4(avatarProps.size))
|
|
384
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
656
385
|
role: "none",
|
|
657
386
|
className: tx("avatar.ring", "avatar__ring", {
|
|
658
387
|
...avatarProps,
|
|
@@ -662,10 +391,10 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
662
391
|
style: {
|
|
663
392
|
animationDelay: "400ms"
|
|
664
393
|
}
|
|
665
|
-
})), /* @__PURE__ */
|
|
394
|
+
})), /* @__PURE__ */ React8.createElement("span", {
|
|
666
395
|
role: "none",
|
|
667
|
-
className:
|
|
668
|
-
}, /* @__PURE__ */
|
|
396
|
+
className: mx7("absolute inline-end-auto opacity-50", reverseEffects ? "inline-start-2" : "inline-start-2", getSize4(avatarProps.size))
|
|
397
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
669
398
|
role: "none",
|
|
670
399
|
className: tx("avatar.ring", "avatar__ring", {
|
|
671
400
|
...avatarProps,
|
|
@@ -678,7 +407,7 @@ var AvatarStackEffect = ({ animation, status, reverseEffects }) => {
|
|
|
678
407
|
})));
|
|
679
408
|
};
|
|
680
409
|
var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationStatus, send, onClickRemove, createInvitationUrl, reverseEffects, ...props }) => {
|
|
681
|
-
const { t } =
|
|
410
|
+
const { t } = useTranslation5("os");
|
|
682
411
|
const { cancel, status: invitationStatus, invitationCode, authCode, multiUse, shareable } = propsInvitationStatus;
|
|
683
412
|
const isCancellable = !([
|
|
684
413
|
Invitation.State.ERROR,
|
|
@@ -720,39 +449,38 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
720
449
|
Invitation.State.SUCCESS
|
|
721
450
|
].includes(invitationStatus);
|
|
722
451
|
const avatarStatus = avatarError ? "error" : avatarGreen ? "active" : "inactive";
|
|
723
|
-
return /* @__PURE__ */
|
|
452
|
+
return /* @__PURE__ */ React8.createElement(ListItem3.Root, {
|
|
724
453
|
id: invitationCode,
|
|
725
454
|
...props,
|
|
726
455
|
classNames: [
|
|
727
456
|
"flex gap-2 pis-3 pie-1 items-center relative",
|
|
728
457
|
props.classNames
|
|
729
458
|
]
|
|
730
|
-
}, /* @__PURE__ */
|
|
459
|
+
}, /* @__PURE__ */ React8.createElement(ListItem3.Heading, {
|
|
731
460
|
classNames: "sr-only"
|
|
732
|
-
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */
|
|
461
|
+
}, t(multiUse ? "invite many list item label" : "invite one list item label")), multiUse && /* @__PURE__ */ React8.createElement(AvatarStackEffect, {
|
|
733
462
|
status: avatarStatus,
|
|
734
463
|
animation: avatarAnimation,
|
|
735
464
|
reverseEffects
|
|
736
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ React8.createElement(Tooltip2.Root, null, /* @__PURE__ */ React8.createElement(Avatar4.Root, {
|
|
737
466
|
...avatarProps,
|
|
738
467
|
animation: avatarAnimation,
|
|
739
468
|
status: avatarStatus
|
|
740
|
-
}, /* @__PURE__ */
|
|
469
|
+
}, /* @__PURE__ */ React8.createElement(Tooltip2.Trigger, {
|
|
741
470
|
asChild: true
|
|
742
|
-
}, /* @__PURE__ */
|
|
471
|
+
}, /* @__PURE__ */ React8.createElement(Avatar4.Frame, {
|
|
743
472
|
tabIndex: 0,
|
|
744
473
|
classNames: [
|
|
745
474
|
focusRing,
|
|
746
475
|
"relative rounded-full place-self-center"
|
|
747
476
|
]
|
|
748
|
-
}, /* @__PURE__ */
|
|
477
|
+
}, /* @__PURE__ */ React8.createElement(Avatar4.Fallback, {
|
|
749
478
|
text: hexToEmoji(invitationId)
|
|
750
|
-
})))), /* @__PURE__ */
|
|
751
|
-
side: "left"
|
|
752
|
-
|
|
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, {
|
|
479
|
+
})))), /* @__PURE__ */ React8.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React8.createElement(Tooltip2.Content, {
|
|
480
|
+
side: "left"
|
|
481
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label"), /* @__PURE__ */ React8.createElement(Tooltip2.Arrow, null)))), showShare && invitationUrl ? /* @__PURE__ */ React8.createElement(Tooltip2.Root, null, /* @__PURE__ */ React8.createElement(React8.Fragment, null, /* @__PURE__ */ React8.createElement(Tooltip2.Trigger, {
|
|
754
482
|
asChild: true
|
|
755
|
-
}, /* @__PURE__ */
|
|
483
|
+
}, /* @__PURE__ */ React8.createElement(Button4, {
|
|
756
484
|
variant: "ghost",
|
|
757
485
|
classNames: "grow justify-start font-medium",
|
|
758
486
|
onClick: () => send({
|
|
@@ -760,65 +488,64 @@ var InvitationListItemImpl = ({ invitation, invitationStatus: propsInvitationSta
|
|
|
760
488
|
invitation
|
|
761
489
|
}),
|
|
762
490
|
"data-testid": "show-qrcode"
|
|
763
|
-
}, /* @__PURE__ */
|
|
491
|
+
}, /* @__PURE__ */ React8.createElement("span", null, t("open share panel label")))), /* @__PURE__ */ React8.createElement(Clipboard.IconButton, {
|
|
764
492
|
variant: "ghost",
|
|
765
493
|
value: invitationUrl
|
|
766
|
-
})), /* @__PURE__ */
|
|
767
|
-
side: "left"
|
|
768
|
-
|
|
769
|
-
}, invitationHasLifetime && /* @__PURE__ */ React10.createElement("span", null, "Expires ", invitationTimeLeft)))) : showAuthCode ? /* @__PURE__ */ React10.createElement(AuthCode, {
|
|
494
|
+
})), /* @__PURE__ */ React8.createElement(Tooltip2.Portal, null, /* @__PURE__ */ React8.createElement(Tooltip2.Content, {
|
|
495
|
+
side: "left"
|
|
496
|
+
}, invitationHasLifetime && /* @__PURE__ */ React8.createElement("span", null, "Expires ", invitationTimeLeft)))) : showAuthCode ? /* @__PURE__ */ React8.createElement(AuthCode, {
|
|
770
497
|
code: authCode,
|
|
771
498
|
classNames: "grow"
|
|
772
|
-
}) : invitationStatus === Invitation.State.CONNECTING ? /* @__PURE__ */
|
|
499
|
+
}) : invitationStatus === Invitation.State.CONNECTING ? /* @__PURE__ */ React8.createElement("span", {
|
|
773
500
|
className: "pli-2 grow text-neutral-500"
|
|
774
|
-
}, "Connecting...") : invitationStatus === Invitation.State.AUTHENTICATING ? /* @__PURE__ */
|
|
501
|
+
}, "Connecting...") : invitationStatus === Invitation.State.AUTHENTICATING ? /* @__PURE__ */ React8.createElement("span", {
|
|
775
502
|
className: "pli-2 grow text-neutral-500"
|
|
776
|
-
}, "Authenticating...") : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? /* @__PURE__ */
|
|
503
|
+
}, "Authenticating...") : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? /* @__PURE__ */ React8.createElement("span", {
|
|
777
504
|
className: "pli-2 grow text-neutral-500"
|
|
778
|
-
}, "Failed") : invitationStatus === Invitation.State.CANCELLED ? /* @__PURE__ */
|
|
505
|
+
}, "Failed") : invitationStatus === Invitation.State.CANCELLED ? /* @__PURE__ */ React8.createElement("span", {
|
|
779
506
|
className: "pli-2 grow text-neutral-500"
|
|
780
|
-
}, "Cancelled") : invitationStatus === Invitation.State.SUCCESS ? /* @__PURE__ */
|
|
507
|
+
}, "Cancelled") : invitationStatus === Invitation.State.SUCCESS ? /* @__PURE__ */ React8.createElement("span", {
|
|
781
508
|
className: "pli-2 grow truncate"
|
|
782
|
-
}, "User joined") : !shareable ? /* @__PURE__ */
|
|
509
|
+
}, "User joined") : !shareable ? /* @__PURE__ */ React8.createElement("span", {
|
|
783
510
|
className: "pli-2 grow text-neutral-500"
|
|
784
|
-
}, "Pending Invitation") : /* @__PURE__ */
|
|
511
|
+
}, "Pending Invitation") : /* @__PURE__ */ React8.createElement("span", {
|
|
785
512
|
className: "grow"
|
|
786
|
-
}, " "), isCancellable ? /* @__PURE__ */
|
|
513
|
+
}, " "), isCancellable ? /* @__PURE__ */ React8.createElement(Button4, {
|
|
787
514
|
variant: "ghost",
|
|
788
515
|
classNames: "flex gap-1 pli-0",
|
|
789
516
|
onClick: cancel,
|
|
790
517
|
"data-testid": "cancel-invitation"
|
|
791
|
-
}, /* @__PURE__ */
|
|
518
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
792
519
|
className: "sr-only"
|
|
793
|
-
}, t("cancel invitation label")), /* @__PURE__ */
|
|
794
|
-
className:
|
|
795
|
-
})) : /* @__PURE__ */
|
|
520
|
+
}, t("cancel invitation label")), /* @__PURE__ */ React8.createElement(X, {
|
|
521
|
+
className: getSize4(4)
|
|
522
|
+
})) : /* @__PURE__ */ React8.createElement(Button4, {
|
|
796
523
|
variant: "ghost",
|
|
797
524
|
classNames: "flex gap-1 pli-0",
|
|
798
525
|
onClick: handleClickRemove,
|
|
799
526
|
"data-testid": "remove-invitation"
|
|
800
|
-
}, /* @__PURE__ */
|
|
527
|
+
}, /* @__PURE__ */ React8.createElement("span", {
|
|
801
528
|
className: "sr-only"
|
|
802
|
-
}, t("remove invitation label")), /* @__PURE__ */
|
|
803
|
-
className:
|
|
529
|
+
}, t("remove invitation label")), /* @__PURE__ */ React8.createElement(X, {
|
|
530
|
+
className: getSize4(4)
|
|
804
531
|
})));
|
|
805
532
|
};
|
|
806
533
|
|
|
807
534
|
// packages/sdk/shell/src/components/InvitationList/InvitationListContainer.tsx
|
|
808
|
-
import
|
|
535
|
+
import React10, { useCallback as useCallback2 } from "react";
|
|
809
536
|
import { useSpace, useSpaceInvitations } from "@dxos/react-client/echo";
|
|
810
537
|
|
|
811
538
|
// packages/sdk/shell/src/components/InvitationList/InvitationList.tsx
|
|
812
|
-
import
|
|
539
|
+
import React9 from "react";
|
|
813
540
|
import { List as List3 } from "@dxos/react-ui";
|
|
814
|
-
import { mx as
|
|
541
|
+
import { mx as mx8 } from "@dxos/react-ui-theme";
|
|
815
542
|
var InvitationList = ({ invitations, send, ...invitationProps }) => {
|
|
816
543
|
const { className, InvitationListItem: Item = InvitationListItem } = invitationProps;
|
|
817
|
-
return /* @__PURE__ */
|
|
818
|
-
classNames:
|
|
544
|
+
return /* @__PURE__ */ React9.createElement(List3, {
|
|
545
|
+
classNames: mx8("flex flex-col gap-2", className)
|
|
819
546
|
}, invitations.map((invitation) => {
|
|
820
547
|
const value = invitation.get().invitationId;
|
|
821
|
-
return /* @__PURE__ */
|
|
548
|
+
return /* @__PURE__ */ React9.createElement(Item, {
|
|
822
549
|
key: value,
|
|
823
550
|
send,
|
|
824
551
|
invitation,
|
|
@@ -836,7 +563,7 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
836
563
|
}, [
|
|
837
564
|
space
|
|
838
565
|
]);
|
|
839
|
-
return /* @__PURE__ */
|
|
566
|
+
return /* @__PURE__ */ React10.createElement(InvitationList, {
|
|
840
567
|
invitations,
|
|
841
568
|
onClickRemove: handleClickRemove,
|
|
842
569
|
createInvitationUrl,
|
|
@@ -845,11 +572,11 @@ var InvitationListContainer = ({ spaceKey, createInvitationUrl, send }) => {
|
|
|
845
572
|
};
|
|
846
573
|
|
|
847
574
|
// packages/sdk/shell/src/components/Panel/Action.tsx
|
|
848
|
-
import { CaretDown
|
|
849
|
-
import { useControllableState
|
|
850
|
-
import
|
|
851
|
-
import { Button as
|
|
852
|
-
import { descriptionText as descriptionText5, getSize as
|
|
575
|
+
import { CaretDown, Check, Placeholder } from "@phosphor-icons/react";
|
|
576
|
+
import { useControllableState } from "@radix-ui/react-use-controllable-state";
|
|
577
|
+
import React11, { forwardRef as forwardRef3 } from "react";
|
|
578
|
+
import { Button as Button5, DropdownMenu as DropdownMenu2, useTranslation as useTranslation6 } from "@dxos/react-ui";
|
|
579
|
+
import { descriptionText as descriptionText5, getSize as getSize5, mx as mx9 } from "@dxos/react-ui-theme";
|
|
853
580
|
var defaultActions = {
|
|
854
581
|
noopAction: {
|
|
855
582
|
label: "No-op",
|
|
@@ -862,17 +589,17 @@ var defaultActions = {
|
|
|
862
589
|
var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
863
590
|
const { classNames, variant, isFull = true, actions = defaultActions, activeAction: propsActiveAction, onChangeActiveAction, defaultActiveAction, "data-testid": testId, ...rest } = props;
|
|
864
591
|
const dropdownTestId = testId && `${testId}.more`;
|
|
865
|
-
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] =
|
|
592
|
+
const [activeActionKey2 = Object.keys(actions)[0], setActiveAction] = useControllableState({
|
|
866
593
|
prop: propsActiveAction,
|
|
867
594
|
onChange: onChangeActiveAction,
|
|
868
595
|
defaultProp: defaultActiveAction
|
|
869
596
|
});
|
|
870
597
|
const activeAction = actions[activeActionKey2] ?? {};
|
|
871
|
-
const { t } =
|
|
872
|
-
return /* @__PURE__ */
|
|
598
|
+
const { t } = useTranslation6("os");
|
|
599
|
+
return /* @__PURE__ */ React11.createElement("div", {
|
|
873
600
|
role: "none",
|
|
874
|
-
className:
|
|
875
|
-
}, /* @__PURE__ */
|
|
601
|
+
className: mx9("mbs-2 flex gap-px items-center", isFull && "is-full")
|
|
602
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
876
603
|
...rest,
|
|
877
604
|
classNames: [
|
|
878
605
|
"bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none",
|
|
@@ -882,22 +609,22 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
882
609
|
variant,
|
|
883
610
|
"data-testid": testId,
|
|
884
611
|
onClick: activeAction.onClick
|
|
885
|
-
}, activeAction.icon && /* @__PURE__ */
|
|
886
|
-
className:
|
|
887
|
-
}), /* @__PURE__ */
|
|
612
|
+
}, activeAction.icon && /* @__PURE__ */ React11.createElement(activeAction.icon, {
|
|
613
|
+
className: getSize5(5)
|
|
614
|
+
}), /* @__PURE__ */ React11.createElement("span", null, activeAction.label)), /* @__PURE__ */ React11.createElement(DropdownMenu2.Root, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Trigger, {
|
|
888
615
|
asChild: true
|
|
889
|
-
}, /* @__PURE__ */
|
|
616
|
+
}, /* @__PURE__ */ React11.createElement(Button5, {
|
|
890
617
|
classNames: [
|
|
891
618
|
"bs-11 flex-none rounded-is-none",
|
|
892
619
|
classNames
|
|
893
620
|
],
|
|
894
621
|
"data-testid": dropdownTestId
|
|
895
|
-
}, /* @__PURE__ */
|
|
622
|
+
}, /* @__PURE__ */ React11.createElement("span", {
|
|
896
623
|
className: "sr-only"
|
|
897
|
-
}, t("invite options label")), /* @__PURE__ */
|
|
898
|
-
className:
|
|
899
|
-
}))), /* @__PURE__ */
|
|
900
|
-
return /* @__PURE__ */
|
|
624
|
+
}, t("invite options label")), /* @__PURE__ */ React11.createElement(CaretDown, {
|
|
625
|
+
className: getSize5(4)
|
|
626
|
+
}))), /* @__PURE__ */ React11.createElement(DropdownMenu2.Portal, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Content, null, /* @__PURE__ */ React11.createElement(DropdownMenu2.Viewport, null, Object.entries(actions).map(([id, action]) => {
|
|
627
|
+
return /* @__PURE__ */ React11.createElement(DropdownMenu2.CheckboxItem, {
|
|
901
628
|
key: id,
|
|
902
629
|
"aria-labelledby": `${id}__label`,
|
|
903
630
|
"aria-describedby": `${id}__description`,
|
|
@@ -905,27 +632,27 @@ var BifurcatedAction = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
905
632
|
onCheckedChange: (checked) => checked && setActiveAction(id),
|
|
906
633
|
classNames: "gap-2",
|
|
907
634
|
"data-testid": action.testId
|
|
908
|
-
}, action.icon && /* @__PURE__ */
|
|
909
|
-
className:
|
|
910
|
-
}), /* @__PURE__ */
|
|
635
|
+
}, action.icon && /* @__PURE__ */ React11.createElement(action.icon, {
|
|
636
|
+
className: getSize5(5)
|
|
637
|
+
}), /* @__PURE__ */ React11.createElement("div", {
|
|
911
638
|
role: "none",
|
|
912
639
|
className: "flex-1 min-is-0 space-b-1"
|
|
913
|
-
}, /* @__PURE__ */
|
|
640
|
+
}, /* @__PURE__ */ React11.createElement("p", {
|
|
914
641
|
id: `${id}__label`
|
|
915
|
-
}, action.label), action.description && /* @__PURE__ */
|
|
642
|
+
}, action.label), action.description && /* @__PURE__ */ React11.createElement("p", {
|
|
916
643
|
id: `${id}__description`,
|
|
917
644
|
className: descriptionText5
|
|
918
|
-
}, action.description)), /* @__PURE__ */
|
|
645
|
+
}, action.description)), /* @__PURE__ */ React11.createElement(DropdownMenu2.ItemIndicator, {
|
|
919
646
|
asChild: true
|
|
920
|
-
}, /* @__PURE__ */
|
|
647
|
+
}, /* @__PURE__ */ React11.createElement(Check, {
|
|
921
648
|
weight: "bold",
|
|
922
|
-
className:
|
|
649
|
+
className: getSize5(4)
|
|
923
650
|
})));
|
|
924
|
-
})), /* @__PURE__ */
|
|
651
|
+
})), /* @__PURE__ */ React11.createElement(DropdownMenu2.Arrow, null)))));
|
|
925
652
|
});
|
|
926
653
|
var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
927
654
|
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
928
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ React11.createElement(Button5, {
|
|
929
656
|
...rest,
|
|
930
657
|
classNames: [
|
|
931
658
|
isFull && "is-full",
|
|
@@ -938,49 +665,49 @@ var Action = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
|
|
|
938
665
|
});
|
|
939
666
|
|
|
940
667
|
// packages/sdk/shell/src/components/Panel/Actions.tsx
|
|
941
|
-
import
|
|
942
|
-
import { mx as
|
|
668
|
+
import React12, { forwardRef as forwardRef4 } from "react";
|
|
669
|
+
import { mx as mx10 } from "@dxos/react-ui-theme";
|
|
943
670
|
var Actions = /* @__PURE__ */ forwardRef4(({ classNames, children, ...props }, forwardedRef) => {
|
|
944
|
-
return /* @__PURE__ */
|
|
671
|
+
return /* @__PURE__ */ React12.createElement("div", {
|
|
945
672
|
...props,
|
|
946
|
-
className:
|
|
673
|
+
className: mx10("flex flex-col gap-2 mbs-2", Array.isArray(children) && children.length > 1 ? "justify-between" : "justify-center", classNames),
|
|
947
674
|
ref: forwardedRef
|
|
948
675
|
}, children);
|
|
949
676
|
});
|
|
950
677
|
|
|
951
678
|
// packages/sdk/shell/src/components/Panel/CloseButton.tsx
|
|
952
679
|
import { X as X2 } from "@phosphor-icons/react";
|
|
953
|
-
import
|
|
954
|
-
import { Button as
|
|
955
|
-
import { getSize as
|
|
680
|
+
import React13 from "react";
|
|
681
|
+
import { Button as Button6, useTranslation as useTranslation7 } from "@dxos/react-ui";
|
|
682
|
+
import { getSize as getSize6, mx as mx11 } from "@dxos/react-ui-theme";
|
|
956
683
|
var CloseButton = ({ onDone, ...props }) => {
|
|
957
|
-
const { t } =
|
|
958
|
-
return /* @__PURE__ */
|
|
684
|
+
const { t } = useTranslation7("os");
|
|
685
|
+
return /* @__PURE__ */ React13.createElement(Button6, {
|
|
959
686
|
variant: "ghost",
|
|
960
|
-
classNames:
|
|
687
|
+
classNames: mx11("plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
961
688
|
onClick: () => onDone?.(),
|
|
962
689
|
...props
|
|
963
|
-
}, /* @__PURE__ */
|
|
690
|
+
}, /* @__PURE__ */ React13.createElement(X2, {
|
|
964
691
|
weight: "bold",
|
|
965
|
-
className:
|
|
966
|
-
}), /* @__PURE__ */
|
|
692
|
+
className: getSize6(4)
|
|
693
|
+
}), /* @__PURE__ */ React13.createElement("span", {
|
|
967
694
|
className: "sr-only"
|
|
968
695
|
}, t("exit label")));
|
|
969
696
|
};
|
|
970
697
|
|
|
971
698
|
// packages/sdk/shell/src/components/Panel/Emoji.tsx
|
|
972
|
-
import
|
|
973
|
-
import { mx as
|
|
699
|
+
import React14 from "react";
|
|
700
|
+
import { mx as mx12, getSize as getSize7 } from "@dxos/react-ui-theme";
|
|
974
701
|
var Emoji = ({ text, className }) => {
|
|
975
702
|
const size = 14;
|
|
976
|
-
return /* @__PURE__ */
|
|
703
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
977
704
|
role: "none",
|
|
978
|
-
className:
|
|
979
|
-
}, /* @__PURE__ */
|
|
705
|
+
className: mx12(getSize7(size), "rounded relative pointer-events-none", className)
|
|
706
|
+
}, /* @__PURE__ */ React14.createElement("svg", {
|
|
980
707
|
viewBox: `0 0 ${size * 4} ${size * 4}`,
|
|
981
708
|
width: size * 4,
|
|
982
709
|
height: size * 4
|
|
983
|
-
}, /* @__PURE__ */
|
|
710
|
+
}, /* @__PURE__ */ React14.createElement("text", {
|
|
984
711
|
x: "50%",
|
|
985
712
|
y: "50%",
|
|
986
713
|
textAnchor: "middle",
|
|
@@ -991,57 +718,57 @@ var Emoji = ({ text, className }) => {
|
|
|
991
718
|
};
|
|
992
719
|
var Centered = (props) => {
|
|
993
720
|
const { children } = props;
|
|
994
|
-
return /* @__PURE__ */
|
|
721
|
+
return /* @__PURE__ */ React14.createElement("div", {
|
|
995
722
|
role: "none",
|
|
996
723
|
className: "absolute inset-0 flex items-center justify-center"
|
|
997
724
|
}, children);
|
|
998
725
|
};
|
|
999
726
|
|
|
1000
727
|
// packages/sdk/shell/src/components/Panel/Heading.tsx
|
|
1001
|
-
import
|
|
1002
|
-
import { descriptionText as descriptionText6, mx as
|
|
728
|
+
import React15, { forwardRef as forwardRef5 } from "react";
|
|
729
|
+
import { descriptionText as descriptionText6, mx as mx13 } from "@dxos/react-ui-theme";
|
|
1003
730
|
var Heading = /* @__PURE__ */ forwardRef5(({ titleId, title, titleSrOnly, children, corner }, forwardedRef) => {
|
|
1004
|
-
return /* @__PURE__ */
|
|
731
|
+
return /* @__PURE__ */ React15.createElement("div", {
|
|
1005
732
|
role: "none",
|
|
1006
733
|
className: "pbe-2 relative",
|
|
1007
734
|
ref: forwardedRef
|
|
1008
|
-
}, corner, /* @__PURE__ */
|
|
735
|
+
}, corner, /* @__PURE__ */ React15.createElement("h1", {
|
|
1009
736
|
...!titleSrOnly && {
|
|
1010
737
|
id: titleId
|
|
1011
738
|
},
|
|
1012
|
-
className:
|
|
1013
|
-
}, title), titleSrOnly && /* @__PURE__ */
|
|
739
|
+
className: mx13(descriptionText6, "text-center mlb-2", titleSrOnly && "invisible")
|
|
740
|
+
}, title), titleSrOnly && /* @__PURE__ */ React15.createElement("span", {
|
|
1014
741
|
id: titleId
|
|
1015
742
|
}, title), children);
|
|
1016
743
|
});
|
|
1017
744
|
|
|
1018
745
|
// packages/sdk/shell/src/components/Panel/Label.tsx
|
|
1019
|
-
import
|
|
1020
|
-
import { descriptionText as descriptionText7, mx as
|
|
746
|
+
import React16 from "react";
|
|
747
|
+
import { descriptionText as descriptionText7, mx as mx14 } from "@dxos/react-ui-theme";
|
|
1021
748
|
var Label = (props) => {
|
|
1022
749
|
const { children } = props;
|
|
1023
|
-
return /* @__PURE__ */
|
|
1024
|
-
className:
|
|
750
|
+
return /* @__PURE__ */ React16.createElement("span", {
|
|
751
|
+
className: mx14(descriptionText7, "text-center mli-6 whitespace-normal")
|
|
1025
752
|
}, children);
|
|
1026
753
|
};
|
|
1027
754
|
|
|
1028
755
|
// packages/sdk/shell/src/components/Panel/Input.tsx
|
|
1029
|
-
import
|
|
756
|
+
import React17 from "react";
|
|
1030
757
|
import { Input as UiInput } from "@dxos/react-ui";
|
|
1031
758
|
var Input = ({ validationMessage, label, ...props }) => {
|
|
1032
|
-
return /* @__PURE__ */
|
|
759
|
+
return /* @__PURE__ */ React17.createElement(UiInput.Root, null, /* @__PURE__ */ React17.createElement(UiInput.Label, null, label), /* @__PURE__ */ React17.createElement(UiInput.TextInput, {
|
|
1033
760
|
...props,
|
|
1034
761
|
classNames: "plb-3 mbs-2 text-center"
|
|
1035
|
-
}), /* @__PURE__ */
|
|
762
|
+
}), /* @__PURE__ */ React17.createElement(UiInput.DescriptionAndValidation, null, validationMessage && /* @__PURE__ */ React17.createElement(UiInput.Validation, null, validationMessage)));
|
|
1036
763
|
};
|
|
1037
764
|
|
|
1038
765
|
// packages/sdk/shell/src/components/Panel/StepHeading.tsx
|
|
1039
|
-
import
|
|
1040
|
-
import { mx as
|
|
766
|
+
import React18, { forwardRef as forwardRef6 } from "react";
|
|
767
|
+
import { mx as mx15 } from "@dxos/react-ui-theme";
|
|
1041
768
|
var StepHeading = /* @__PURE__ */ forwardRef6(({ children, className, ...props }, forwardedRef) => {
|
|
1042
|
-
return /* @__PURE__ */
|
|
769
|
+
return /* @__PURE__ */ React18.createElement("h2", {
|
|
1043
770
|
...props,
|
|
1044
|
-
className:
|
|
771
|
+
className: mx15("font-normal text-sm mbe-4 mli-1 text-center", className),
|
|
1045
772
|
ref: forwardedRef
|
|
1046
773
|
}, children);
|
|
1047
774
|
});
|
|
@@ -1049,31 +776,31 @@ var StepHeading = /* @__PURE__ */ forwardRef6(({ children, className, ...props }
|
|
|
1049
776
|
// packages/sdk/shell/src/components/Viewport/Viewport.tsx
|
|
1050
777
|
import { useFocusFinders } from "@fluentui/react-tabster";
|
|
1051
778
|
import { createContextScope } from "@radix-ui/react-context";
|
|
1052
|
-
import { useControllableState as
|
|
1053
|
-
import
|
|
779
|
+
import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
|
|
780
|
+
import React19, { forwardRef as forwardRef7, useEffect } from "react";
|
|
1054
781
|
import { useForwardedRef } from "@dxos/react-ui";
|
|
1055
|
-
import { mx as
|
|
782
|
+
import { mx as mx16 } from "@dxos/react-ui-theme";
|
|
1056
783
|
var VIEWPORT_NAME = "Viewport";
|
|
1057
784
|
var VIEWS_NAME = "ViewportViews";
|
|
1058
785
|
var VIEW_NAME = "ViewportView";
|
|
1059
786
|
var [createViewportContext, createViewportScope] = createContextScope(VIEWPORT_NAME, []);
|
|
1060
787
|
var [ViewportProvider, useViewportContext] = createViewportContext(VIEWPORT_NAME);
|
|
1061
788
|
var ViewportRoot = ({ __viewportScope, classNames, children, defaultActiveView, activeView: propsActiveView, focusManaged = false, onActiveViewChange, ...props }) => {
|
|
1062
|
-
const [activeView = "never", setActiveView] =
|
|
789
|
+
const [activeView = "never", setActiveView] = useControllableState2({
|
|
1063
790
|
prop: propsActiveView,
|
|
1064
791
|
defaultProp: defaultActiveView,
|
|
1065
792
|
onChange: onActiveViewChange
|
|
1066
793
|
});
|
|
1067
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ React19.createElement(ViewportProvider, {
|
|
1068
795
|
focusManaged,
|
|
1069
796
|
activeView,
|
|
1070
797
|
setActiveView,
|
|
1071
798
|
scope: __viewportScope
|
|
1072
|
-
}, /* @__PURE__ */
|
|
799
|
+
}, /* @__PURE__ */ React19.createElement("div", {
|
|
1073
800
|
role: "region",
|
|
1074
801
|
"aria-live": "polite",
|
|
1075
802
|
...props,
|
|
1076
|
-
className:
|
|
803
|
+
className: mx16("is-full overflow-hidden", classNames)
|
|
1077
804
|
}, children));
|
|
1078
805
|
};
|
|
1079
806
|
ViewportRoot.displayName = VIEWPORT_NAME;
|
|
@@ -1081,11 +808,11 @@ var ViewportViews = ({ classNames, children, ...props }) => {
|
|
|
1081
808
|
const size = {
|
|
1082
809
|
inlineSize: `${Math.ceil(children.length) * 100}%`
|
|
1083
810
|
};
|
|
1084
|
-
return /* @__PURE__ */
|
|
811
|
+
return /* @__PURE__ */ React19.createElement("div", {
|
|
1085
812
|
role: "none",
|
|
1086
813
|
style: size,
|
|
1087
814
|
...props,
|
|
1088
|
-
className:
|
|
815
|
+
className: mx16("flex", classNames)
|
|
1089
816
|
}, children);
|
|
1090
817
|
};
|
|
1091
818
|
ViewportViews.displayName = VIEWS_NAME;
|
|
@@ -1103,12 +830,12 @@ var ViewportView = /* @__PURE__ */ forwardRef7(({ __viewportScope, classNames, c
|
|
|
1103
830
|
ref.current,
|
|
1104
831
|
isActive
|
|
1105
832
|
]);
|
|
1106
|
-
return /* @__PURE__ */
|
|
833
|
+
return /* @__PURE__ */ React19.createElement("section", {
|
|
1107
834
|
...props,
|
|
1108
835
|
...!isActive && {
|
|
1109
836
|
"aria-hidden": true
|
|
1110
837
|
},
|
|
1111
|
-
className:
|
|
838
|
+
className: mx16("min-is-0 flex-1 flex flex-col", isActive ? "order-2" : "order-4 invisible", classNames),
|
|
1112
839
|
ref
|
|
1113
840
|
}, children);
|
|
1114
841
|
});
|
|
@@ -1120,43 +847,44 @@ var Viewport = {
|
|
|
1120
847
|
};
|
|
1121
848
|
|
|
1122
849
|
// packages/sdk/shell/src/components/SpaceListItem.tsx
|
|
1123
|
-
import
|
|
850
|
+
import React20, { forwardRef as forwardRef8 } from "react";
|
|
1124
851
|
import { Avatar as Avatar5, useId as useId4 } from "@dxos/react-ui";
|
|
1125
|
-
import { mx as
|
|
852
|
+
import { mx as mx17 } from "@dxos/react-ui-theme";
|
|
1126
853
|
import { humanize, keyToEmoji } from "@dxos/util";
|
|
1127
854
|
var SpaceListItem = /* @__PURE__ */ forwardRef8(({ space, onClick }, ref) => {
|
|
1128
855
|
const fallbackValue = keyToEmoji(space.key);
|
|
1129
856
|
const labelId = useId4("identityListItem__label");
|
|
1130
857
|
const displayName = space.properties.name ?? humanize(space.key.toHex());
|
|
1131
|
-
return /* @__PURE__ */
|
|
1132
|
-
className:
|
|
858
|
+
return /* @__PURE__ */ React20.createElement("li", {
|
|
859
|
+
className: mx17("flex gap-2 items-center mbe-2", onClick && "cursor-pointer"),
|
|
1133
860
|
onClick: () => onClick?.(),
|
|
1134
861
|
ref,
|
|
1135
862
|
"data-testid": "space-list-item"
|
|
1136
|
-
}, /* @__PURE__ */
|
|
863
|
+
}, /* @__PURE__ */ React20.createElement(Avatar5.Root, {
|
|
1137
864
|
labelId
|
|
1138
|
-
}, /* @__PURE__ */
|
|
865
|
+
}, /* @__PURE__ */ React20.createElement(Avatar5.Frame, null, /* @__PURE__ */ React20.createElement(Avatar5.Fallback, {
|
|
1139
866
|
text: fallbackValue
|
|
1140
|
-
})), /* @__PURE__ */
|
|
867
|
+
})), /* @__PURE__ */ React20.createElement(Avatar5.Label, {
|
|
1141
868
|
classNames: "text-sm truncate"
|
|
1142
869
|
}, displayName)));
|
|
1143
870
|
});
|
|
1144
871
|
|
|
1145
872
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
1146
|
-
import
|
|
873
|
+
import React38 from "react";
|
|
1147
874
|
import { Clipboard as Clipboard3, Dialog, useId as useId10 } from "@dxos/react-ui";
|
|
1148
875
|
|
|
1149
876
|
// packages/sdk/shell/src/panels/IdentityPanel/IdentityPanel.tsx
|
|
1150
877
|
import { Key, Plugs, PlugsConnected } from "@phosphor-icons/react";
|
|
1151
|
-
import
|
|
878
|
+
import React25, { useEffect as useEffect4, useMemo as useMemo3, useState as useState5 } from "react";
|
|
1152
879
|
import { generateName as generateName3 } from "@dxos/display-name";
|
|
1153
880
|
import { log as log7 } from "@dxos/log";
|
|
1154
881
|
import { useClient as useClient6 } from "@dxos/react-client";
|
|
1155
882
|
import { useIdentity, useDevices, useHaloInvitations as useHaloInvitations2 } from "@dxos/react-client/halo";
|
|
1156
883
|
import { useInvitationStatus as useInvitationStatus2 } from "@dxos/react-client/invitations";
|
|
1157
884
|
import { useNetworkStatus, ConnectionState as ConnectionState2 } from "@dxos/react-client/mesh";
|
|
1158
|
-
import { Avatar as Avatar6, Input as Input2, Toolbar
|
|
1159
|
-
import {
|
|
885
|
+
import { Avatar as Avatar6, Input as Input2, Toolbar, Tooltip as Tooltip3, useClipboard as useClipboard2, useId as useId6, useTranslation as useTranslation11 } from "@dxos/react-ui";
|
|
886
|
+
import { EmojiPickerToolbarButton, HuePickerToolbarButton } from "@dxos/react-ui-pickers";
|
|
887
|
+
import { getSize as getSize10 } from "@dxos/react-ui-theme";
|
|
1160
888
|
import { hexToEmoji as hexToEmoji4, hexToHue as hexToHue2, keyToFallback as keyToFallback3 } from "@dxos/util";
|
|
1161
889
|
|
|
1162
890
|
// packages/sdk/shell/src/panels/IdentityPanel/identityMachine.ts
|
|
@@ -1272,7 +1000,7 @@ var useIdentityMachine = (client, options) => {
|
|
|
1272
1000
|
};
|
|
1273
1001
|
|
|
1274
1002
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx
|
|
1275
|
-
import
|
|
1003
|
+
import React21 from "react";
|
|
1276
1004
|
import { log as log2 } from "@dxos/log";
|
|
1277
1005
|
import { useClient as useClient2 } from "@dxos/react-client";
|
|
1278
1006
|
import { useHaloInvitations, DeviceType as DeviceType2 } from "@dxos/react-client/halo";
|
|
@@ -1308,7 +1036,7 @@ var IdentityActionChooser = (props) => {
|
|
|
1308
1036
|
});
|
|
1309
1037
|
};
|
|
1310
1038
|
const isProduction = client.config.values.runtime?.app?.env?.DX_ENVIRONMENT === "production";
|
|
1311
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ React21.createElement(IdentityActionChooserImpl, {
|
|
1312
1040
|
...props,
|
|
1313
1041
|
onClickAdd: createInvitation,
|
|
1314
1042
|
onClickJoinExisting: () => send?.({
|
|
@@ -1324,10 +1052,10 @@ var IdentityActionChooser = (props) => {
|
|
|
1324
1052
|
};
|
|
1325
1053
|
var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled, onClickAdd, onClickJoinExisting, onClickRecover, onClickReset, ...agentProps }) => {
|
|
1326
1054
|
const edgeDeviceAvailable = devices.find((device) => device.profile?.type === DeviceType2.AGENT_MANAGED && device.profile?.os?.toUpperCase() === "EDGE");
|
|
1327
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ React21.createElement("div", {
|
|
1328
1056
|
role: "none",
|
|
1329
1057
|
className: "bs-40 grow overflow-y-auto"
|
|
1330
|
-
}, /* @__PURE__ */
|
|
1058
|
+
}, /* @__PURE__ */ React21.createElement(DeviceList, {
|
|
1331
1059
|
devices,
|
|
1332
1060
|
connectionState,
|
|
1333
1061
|
onClickAdd,
|
|
@@ -1335,20 +1063,21 @@ var IdentityActionChooserImpl = ({ devices, connectionState, agentHostingEnabled
|
|
|
1335
1063
|
onClickRecover: agentProps.agentStatus === "created" ? onClickRecover : void 0,
|
|
1336
1064
|
onClickReset,
|
|
1337
1065
|
onAgentDestroy: agentProps.onAgentDestroy
|
|
1338
|
-
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */
|
|
1066
|
+
}), !edgeDeviceAvailable && agentHostingEnabled && /* @__PURE__ */ React21.createElement(AgentConfig, agentProps));
|
|
1339
1067
|
};
|
|
1340
1068
|
|
|
1341
1069
|
// packages/sdk/shell/src/panels/IdentityPanel/steps/ProfileForm.tsx
|
|
1342
|
-
import
|
|
1070
|
+
import React22, { useState } from "react";
|
|
1343
1071
|
import { log as log3 } from "@dxos/log";
|
|
1344
|
-
import { useClipboard, useTranslation as
|
|
1072
|
+
import { useClipboard, useTranslation as useTranslation8 } from "@dxos/react-ui";
|
|
1073
|
+
import { EmojiPickerBlock, HuePickerBlock } from "@dxos/react-ui-pickers";
|
|
1345
1074
|
import { hexToEmoji as hexToEmoji2, hexToHue } from "@dxos/util";
|
|
1346
1075
|
|
|
1347
1076
|
// packages/sdk/shell/src/panels/IdentityPanel/useAgentHandlers.ts
|
|
1348
1077
|
import { useClient as useClient5 } from "@dxos/react-client";
|
|
1349
1078
|
|
|
1350
1079
|
// packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts
|
|
1351
|
-
import { useEffect as useEffect2, useState as
|
|
1080
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
1352
1081
|
import { invariant } from "@dxos/invariant";
|
|
1353
1082
|
import { log as log4 } from "@dxos/log";
|
|
1354
1083
|
import { QueryAgentStatusResponse } from "@dxos/protocols/proto/dxos/client/services";
|
|
@@ -1356,9 +1085,9 @@ import { EdgeReplicationSetting } from "@dxos/protocols/proto/dxos/echo/metadata
|
|
|
1356
1085
|
import { useClient as useClient3 } from "@dxos/react-client";
|
|
1357
1086
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useEdgeAgentsHandlers.ts";
|
|
1358
1087
|
var useEdgeAgentHandlers = ({ identity }) => {
|
|
1359
|
-
const [validationMessage, setValidationMessage] =
|
|
1360
|
-
const [lastReceivedStatus, setLastReceivedStatus] =
|
|
1361
|
-
const [agentStatus, setAgentStatus] =
|
|
1088
|
+
const [validationMessage, setValidationMessage] = useState2("");
|
|
1089
|
+
const [lastReceivedStatus, setLastReceivedStatus] = useState2(QueryAgentStatusResponse.AgentStatus.UNKNOWN);
|
|
1090
|
+
const [agentStatus, setAgentStatus] = useState2("getting");
|
|
1362
1091
|
const client = useClient3();
|
|
1363
1092
|
const agentHostingEnabled = Boolean(client.config.values.runtime?.client?.edgeFeatures?.agents);
|
|
1364
1093
|
const handleStatus = (status) => {
|
|
@@ -1444,15 +1173,15 @@ var useEdgeAgentHandlers = ({ identity }) => {
|
|
|
1444
1173
|
};
|
|
1445
1174
|
|
|
1446
1175
|
// packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts
|
|
1447
|
-
import { useCallback as useCallback3, useEffect as useEffect3, useState as
|
|
1176
|
+
import { useCallback as useCallback3, useEffect as useEffect3, useState as useState3 } from "react";
|
|
1448
1177
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
1449
1178
|
import { log as log5 } from "@dxos/log";
|
|
1450
1179
|
import { useClient as useClient4, useAgentHostingClient } from "@dxos/react-client";
|
|
1451
1180
|
import { Invitation as Invitation3, InvitationEncoder as InvitationEncoder2 } from "@dxos/react-client/invitations";
|
|
1452
1181
|
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/IdentityPanel/useKubeAgentHandlers.ts";
|
|
1453
1182
|
var useKubeAgentHandlers = ({ invitations, identity }) => {
|
|
1454
|
-
const [validationMessage, setValidationMessage] =
|
|
1455
|
-
const [agentStatus, setAgentStatus] =
|
|
1183
|
+
const [validationMessage, setValidationMessage] = useState3("");
|
|
1184
|
+
const [agentStatus, setAgentStatus] = useState3("getting");
|
|
1456
1185
|
const agentHostingProviderClient = useAgentHostingClient();
|
|
1457
1186
|
const client = useClient4();
|
|
1458
1187
|
const updateAgentStatus = async () => {
|
|
@@ -1581,11 +1310,11 @@ var useAgentHandlers = (params) => {
|
|
|
1581
1310
|
};
|
|
1582
1311
|
|
|
1583
1312
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1584
|
-
import { Check as
|
|
1585
|
-
import
|
|
1313
|
+
import { Check as Check2, X as X3 } from "@phosphor-icons/react";
|
|
1314
|
+
import React23, { useMemo as useMemo2 } from "react";
|
|
1586
1315
|
import { QR } from "react-qr-rounded";
|
|
1587
|
-
import { Clipboard as Clipboard2, useId as useId5, useTranslation as
|
|
1588
|
-
import { descriptionText as descriptionText8, getSize as
|
|
1316
|
+
import { Clipboard as Clipboard2, useId as useId5, useTranslation as useTranslation9 } from "@dxos/react-ui";
|
|
1317
|
+
import { descriptionText as descriptionText8, getSize as getSize8, mx as mx18 } from "@dxos/react-ui-theme";
|
|
1589
1318
|
import { hexToEmoji as hexToEmoji3 } from "@dxos/util";
|
|
1590
1319
|
|
|
1591
1320
|
// packages/sdk/shell/src/util/invitationStatusValue.ts
|
|
@@ -1631,13 +1360,13 @@ var invitationStatusValue = /* @__PURE__ */ new Map([
|
|
|
1631
1360
|
|
|
1632
1361
|
// packages/sdk/shell/src/steps/InvitationManager.tsx
|
|
1633
1362
|
var InvitationManagerView = ({ children, ...props }) => {
|
|
1634
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ React23.createElement(Viewport.View, {
|
|
1635
1364
|
...props,
|
|
1636
1365
|
classNames: "grow flex flex-col justify-around items-center"
|
|
1637
1366
|
}, children);
|
|
1638
1367
|
};
|
|
1639
1368
|
var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCode, id = "0" }) => {
|
|
1640
|
-
const { t } =
|
|
1369
|
+
const { t } = useTranslation9("os");
|
|
1641
1370
|
const qrLabel = useId5("invitation-manager__qr-code");
|
|
1642
1371
|
const statusValue = multiUse ? 0 : invitationStatusValue.get(status) ?? 0;
|
|
1643
1372
|
const showAuthCode = statusValue === 3;
|
|
@@ -1658,50 +1387,50 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1658
1387
|
}, [
|
|
1659
1388
|
statusValue
|
|
1660
1389
|
]);
|
|
1661
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, /* @__PURE__ */ React23.createElement(Viewport.Root, {
|
|
1662
1391
|
activeView,
|
|
1663
1392
|
classNames: "grow plb-1"
|
|
1664
|
-
}, /* @__PURE__ */
|
|
1393
|
+
}, /* @__PURE__ */ React23.createElement(Viewport.Views, null, /* @__PURE__ */ React23.createElement(InvitationManagerView, {
|
|
1665
1394
|
id: "showing qr",
|
|
1666
1395
|
emoji
|
|
1667
|
-
}, /* @__PURE__ */
|
|
1396
|
+
}, /* @__PURE__ */ React23.createElement("p", {
|
|
1668
1397
|
className: "text-sm mlb-1 font-normal text-center"
|
|
1669
|
-
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */
|
|
1398
|
+
}, t(multiUse ? "invite many qr label" : "invite one qr label")), /* @__PURE__ */ React23.createElement("div", {
|
|
1670
1399
|
role: "none",
|
|
1671
|
-
className:
|
|
1672
|
-
}, /* @__PURE__ */
|
|
1400
|
+
className: mx18(descriptionText8, "is-full max-is-[14rem] relative")
|
|
1401
|
+
}, /* @__PURE__ */ React23.createElement(QR, {
|
|
1673
1402
|
rounding: 100,
|
|
1674
1403
|
backgroundColor: "transparent",
|
|
1675
1404
|
color: "currentColor",
|
|
1676
|
-
className:
|
|
1405
|
+
className: mx18("is-full bs-full p-2", showAuthCode && "invisible"),
|
|
1677
1406
|
"aria-labelledby": qrLabel,
|
|
1678
1407
|
errorCorrectionLevel: "Q",
|
|
1679
1408
|
cutout: true
|
|
1680
|
-
}, invitationUrl ?? "never"), /* @__PURE__ */
|
|
1409
|
+
}, invitationUrl ?? "never"), /* @__PURE__ */ React23.createElement(Centered, null, /* @__PURE__ */ React23.createElement(Emoji, {
|
|
1681
1410
|
text: emoji
|
|
1682
|
-
}))), /* @__PURE__ */
|
|
1411
|
+
}))), /* @__PURE__ */ React23.createElement("span", {
|
|
1683
1412
|
id: qrLabel,
|
|
1684
1413
|
className: "sr-only"
|
|
1685
|
-
}, t("qr label")), /* @__PURE__ */
|
|
1414
|
+
}, t("qr label")), /* @__PURE__ */ React23.createElement(Clipboard2.Button, {
|
|
1686
1415
|
variant: "ghost",
|
|
1687
1416
|
value: invitationUrl ?? "never"
|
|
1688
|
-
})), /* @__PURE__ */
|
|
1417
|
+
})), /* @__PURE__ */ React23.createElement(InvitationManagerView, {
|
|
1689
1418
|
id: "showing auth code"
|
|
1690
|
-
}, /* @__PURE__ */
|
|
1419
|
+
}, /* @__PURE__ */ React23.createElement(Label, null, t("auth code message")), /* @__PURE__ */ React23.createElement(AuthCode, {
|
|
1691
1420
|
code: authCode,
|
|
1692
1421
|
large: true,
|
|
1693
1422
|
classNames: "text-black dark:text-white"
|
|
1694
|
-
}), /* @__PURE__ */
|
|
1423
|
+
}), /* @__PURE__ */ React23.createElement(Label, null, t("auth other device emoji message")), emoji && /* @__PURE__ */ React23.createElement(Emoji, {
|
|
1695
1424
|
text: emoji
|
|
1696
|
-
})), /* @__PURE__ */
|
|
1425
|
+
})), /* @__PURE__ */ React23.createElement(InvitationManagerView, {
|
|
1697
1426
|
id: "showing final"
|
|
1698
|
-
}, statusValue > 0 ? /* @__PURE__ */
|
|
1699
|
-
className:
|
|
1700
|
-
}) : /* @__PURE__ */
|
|
1701
|
-
className:
|
|
1702
|
-
})))), /* @__PURE__ */
|
|
1427
|
+
}, statusValue > 0 ? /* @__PURE__ */ React23.createElement(Check2, {
|
|
1428
|
+
className: mx18("m-1.5", getSize8(6))
|
|
1429
|
+
}) : /* @__PURE__ */ React23.createElement(X3, {
|
|
1430
|
+
className: mx18("m-1.5", getSize8(6))
|
|
1431
|
+
})))), /* @__PURE__ */ React23.createElement(Actions, {
|
|
1703
1432
|
classNames: "mbs-4"
|
|
1704
|
-
}, /* @__PURE__ */
|
|
1433
|
+
}, /* @__PURE__ */ React23.createElement(Action, {
|
|
1705
1434
|
disabled: !active,
|
|
1706
1435
|
onClick: () => send?.({
|
|
1707
1436
|
type: "deselectInvitation"
|
|
@@ -1711,15 +1440,15 @@ var InvitationManager = ({ invitationUrl, active, send, status, multiUse, authCo
|
|
|
1711
1440
|
|
|
1712
1441
|
// packages/sdk/shell/src/steps/ConfirmReset.tsx
|
|
1713
1442
|
import { Warning } from "@phosphor-icons/react";
|
|
1714
|
-
import
|
|
1443
|
+
import React24, { useState as useState4 } from "react";
|
|
1715
1444
|
import { log as log6 } from "@dxos/log";
|
|
1716
|
-
import { Message, useTranslation as
|
|
1717
|
-
import { getSize as
|
|
1445
|
+
import { Message, useTranslation as useTranslation10 } from "@dxos/react-ui";
|
|
1446
|
+
import { getSize as getSize9, mx as mx19 } from "@dxos/react-ui-theme";
|
|
1718
1447
|
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/steps/ConfirmReset.tsx";
|
|
1719
1448
|
var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
1720
|
-
const { t } =
|
|
1721
|
-
const [validationMessage, setValidationMessage] =
|
|
1722
|
-
const [pending, setPending] =
|
|
1449
|
+
const { t } = useTranslation10("os");
|
|
1450
|
+
const [validationMessage, setValidationMessage] = useState4("");
|
|
1451
|
+
const [pending, setPending] = useState4(false);
|
|
1723
1452
|
const processReset = async () => {
|
|
1724
1453
|
setPending(true);
|
|
1725
1454
|
return onConfirm?.().then(() => setPending(false), (error) => {
|
|
@@ -1733,7 +1462,7 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1733
1462
|
setPending(false);
|
|
1734
1463
|
});
|
|
1735
1464
|
};
|
|
1736
|
-
return /* @__PURE__ */
|
|
1465
|
+
return /* @__PURE__ */ React24.createElement(ConfirmResetImpl, {
|
|
1737
1466
|
disabled: !active,
|
|
1738
1467
|
pending,
|
|
1739
1468
|
validationMessage,
|
|
@@ -1743,20 +1472,20 @@ var ConfirmReset = ({ active, onCancel, onConfirm, mode }) => {
|
|
|
1743
1472
|
});
|
|
1744
1473
|
};
|
|
1745
1474
|
var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCancel, mode }) => {
|
|
1746
|
-
const { t } =
|
|
1475
|
+
const { t } = useTranslation10("os");
|
|
1747
1476
|
const confirmationValue = t("confirmation value");
|
|
1748
|
-
const [inputValue, setInputValue] =
|
|
1477
|
+
const [inputValue, setInputValue] = useState4("");
|
|
1749
1478
|
const testIdAffix = mode === "join new identity" ? "join-new-identity" : mode === "recover" ? "recover" : "reset-storage";
|
|
1750
|
-
return /* @__PURE__ */
|
|
1479
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement("div", {
|
|
1751
1480
|
role: "none",
|
|
1752
1481
|
className: "grow flex flex-col gap-2 justify-center"
|
|
1753
|
-
}, /* @__PURE__ */
|
|
1482
|
+
}, /* @__PURE__ */ React24.createElement(Message.Root, {
|
|
1754
1483
|
valence: "error"
|
|
1755
|
-
}, /* @__PURE__ */
|
|
1756
|
-
className:
|
|
1757
|
-
}), t("sign out chooser title")), /* @__PURE__ */
|
|
1484
|
+
}, /* @__PURE__ */ React24.createElement(Message.Title, null, /* @__PURE__ */ React24.createElement(Warning, {
|
|
1485
|
+
className: mx19(getSize9(6), "inline mie-2")
|
|
1486
|
+
}), t("sign out chooser title")), /* @__PURE__ */ React24.createElement(Message.Body, null, t("sign out chooser message"))), /* @__PURE__ */ React24.createElement(Input, {
|
|
1758
1487
|
validationMessage,
|
|
1759
|
-
label: /* @__PURE__ */
|
|
1488
|
+
label: /* @__PURE__ */ React24.createElement(StepHeading, {
|
|
1760
1489
|
className: "text-start mlb-2"
|
|
1761
1490
|
}, t(mode === "join new identity" ? "join new identity input label" : mode === "recover" ? "recover reset input label" : "reset storage input label", {
|
|
1762
1491
|
confirmationValue
|
|
@@ -1767,11 +1496,11 @@ var ConfirmResetImpl = ({ disabled, pending, validationMessage, onConfirm, onCan
|
|
|
1767
1496
|
confirmationValue
|
|
1768
1497
|
}),
|
|
1769
1498
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
1770
|
-
})), /* @__PURE__ */
|
|
1499
|
+
})), /* @__PURE__ */ React24.createElement(Actions, null, onCancel && /* @__PURE__ */ React24.createElement(Action, {
|
|
1771
1500
|
disabled,
|
|
1772
1501
|
onClick: onCancel,
|
|
1773
1502
|
"data-testid": `${testIdAffix}.reset-identity-cancel`
|
|
1774
|
-
}, t("cancel label")), onConfirm && /* @__PURE__ */
|
|
1503
|
+
}, t("cancel label")), onConfirm && /* @__PURE__ */ React24.createElement(Action, {
|
|
1775
1504
|
variant: "destructive",
|
|
1776
1505
|
disabled: disabled || pending || inputValue !== confirmationValue,
|
|
1777
1506
|
onClick: onConfirm,
|
|
@@ -1786,10 +1515,10 @@ var getHueValue = (identity) => identity?.profile?.data?.hue || hexToHue2(identi
|
|
|
1786
1515
|
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || hexToEmoji4(identity?.identityKey.toHex() ?? "0");
|
|
1787
1516
|
var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, connectionState, onChangeConnectionState }) => {
|
|
1788
1517
|
const fallbackValue = keyToFallback3(identity.identityKey);
|
|
1789
|
-
const { t } =
|
|
1790
|
-
const [displayName, setDisplayName] =
|
|
1791
|
-
const [emoji, setEmojiDirectly] =
|
|
1792
|
-
const [hue, setHueDirectly] =
|
|
1518
|
+
const { t } = useTranslation11("os");
|
|
1519
|
+
const [displayName, setDisplayName] = useState5(identity.profile?.displayName ?? "");
|
|
1520
|
+
const [emoji, setEmojiDirectly] = useState5(getEmojiValue(identity));
|
|
1521
|
+
const [hue, setHueDirectly] = useState5(getHueValue(identity));
|
|
1793
1522
|
const { textValue, setTextValue } = useClipboard2();
|
|
1794
1523
|
const identityHex = identity.identityKey.toHex();
|
|
1795
1524
|
const publicKeyCopied = textValue === identityHex;
|
|
@@ -1814,29 +1543,29 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1814
1543
|
});
|
|
1815
1544
|
};
|
|
1816
1545
|
const isConnected = connectionState === ConnectionState2.ONLINE;
|
|
1817
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ React25.createElement(Heading, {
|
|
1818
1547
|
titleId,
|
|
1819
1548
|
title,
|
|
1820
|
-
corner: /* @__PURE__ */
|
|
1549
|
+
corner: /* @__PURE__ */ React25.createElement(CloseButton, {
|
|
1821
1550
|
onDone
|
|
1822
1551
|
})
|
|
1823
|
-
}, /* @__PURE__ */
|
|
1552
|
+
}, /* @__PURE__ */ React25.createElement(Avatar6.Root, {
|
|
1824
1553
|
size: 16,
|
|
1825
1554
|
variant: "circle",
|
|
1826
1555
|
status: isConnected ? "active" : "error",
|
|
1827
1556
|
hue: hue || fallbackValue.hue
|
|
1828
|
-
}, /* @__PURE__ */
|
|
1557
|
+
}, /* @__PURE__ */ React25.createElement(Toolbar.Root, {
|
|
1829
1558
|
classNames: "flex justify-center"
|
|
1830
|
-
}, /* @__PURE__ */
|
|
1559
|
+
}, /* @__PURE__ */ React25.createElement(Avatar6.Frame, {
|
|
1831
1560
|
classNames: "relative z-[2] -mli-4 chromatic-ignore"
|
|
1832
|
-
}, /* @__PURE__ */
|
|
1561
|
+
}, /* @__PURE__ */ React25.createElement(Avatar6.Fallback, {
|
|
1833
1562
|
text: emoji || fallbackValue.emoji
|
|
1834
|
-
}))), /* @__PURE__ */
|
|
1563
|
+
}))), /* @__PURE__ */ React25.createElement(Avatar6.Label, {
|
|
1835
1564
|
classNames: "sr-only",
|
|
1836
1565
|
"data-testid": "identityHeading.displayName"
|
|
1837
|
-
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */
|
|
1566
|
+
}, identity.profile?.displayName ?? generateName3(identity.identityKey.toHex())), /* @__PURE__ */ React25.createElement(Input2.Root, null, /* @__PURE__ */ React25.createElement(Input2.Label, {
|
|
1838
1567
|
srOnly: true
|
|
1839
|
-
}, t("display name input label")), /* @__PURE__ */
|
|
1568
|
+
}, t("display name input label")), /* @__PURE__ */ React25.createElement(Input2.TextInput, {
|
|
1840
1569
|
variant: "subdued",
|
|
1841
1570
|
"data-testid": "display-name-input",
|
|
1842
1571
|
placeholder: t("display name input placeholder"),
|
|
@@ -1847,51 +1576,49 @@ var IdentityHeading = ({ titleId, title, identity, onDone, onUpdateProfile, conn
|
|
|
1847
1576
|
...identity.profile,
|
|
1848
1577
|
displayName: value
|
|
1849
1578
|
})
|
|
1850
|
-
})), /* @__PURE__ */
|
|
1579
|
+
})), /* @__PURE__ */ React25.createElement(Toolbar.Root, {
|
|
1851
1580
|
classNames: "flex justify-center items-center gap-1 pt-3"
|
|
1852
|
-
}, /* @__PURE__ */
|
|
1581
|
+
}, /* @__PURE__ */ React25.createElement(EmojiPickerToolbarButton, {
|
|
1853
1582
|
emoji,
|
|
1854
1583
|
onChangeEmoji: setEmoji,
|
|
1855
1584
|
classNames: "bs-[--rail-action]"
|
|
1856
|
-
}), /* @__PURE__ */
|
|
1585
|
+
}), /* @__PURE__ */ React25.createElement(HuePickerToolbarButton, {
|
|
1857
1586
|
hue,
|
|
1858
1587
|
onChangeHue: setHue,
|
|
1859
1588
|
classNames: "bs-[--rail-action]"
|
|
1860
|
-
}), /* @__PURE__ */
|
|
1589
|
+
}), /* @__PURE__ */ React25.createElement(Tooltip3.Root, null, /* @__PURE__ */ React25.createElement(Tooltip3.Trigger, {
|
|
1861
1590
|
asChild: true
|
|
1862
|
-
}, /* @__PURE__ */
|
|
1591
|
+
}, /* @__PURE__ */ React25.createElement(Toolbar.Button, {
|
|
1863
1592
|
classNames: "bs-[--rail-action]",
|
|
1864
1593
|
"data-testid": "update-profile-form-copy-key",
|
|
1865
1594
|
onClick: () => setTextValue(identityHex)
|
|
1866
|
-
}, /* @__PURE__ */
|
|
1595
|
+
}, /* @__PURE__ */ React25.createElement("span", {
|
|
1867
1596
|
className: "sr-only"
|
|
1868
|
-
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */
|
|
1869
|
-
className:
|
|
1870
|
-
}))), /* @__PURE__ */
|
|
1871
|
-
side: "bottom"
|
|
1872
|
-
|
|
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, {
|
|
1597
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label")), /* @__PURE__ */ React25.createElement(Key, {
|
|
1598
|
+
className: getSize10(5)
|
|
1599
|
+
}))), /* @__PURE__ */ React25.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React25.createElement(Tooltip3.Content, {
|
|
1600
|
+
side: "bottom"
|
|
1601
|
+
}, t(publicKeyCopied ? "copy success label" : "copy self public key label"), /* @__PURE__ */ React25.createElement(Tooltip3.Arrow, null)))), /* @__PURE__ */ React25.createElement(Tooltip3.Root, null, /* @__PURE__ */ React25.createElement(Tooltip3.Trigger, {
|
|
1874
1602
|
asChild: true
|
|
1875
|
-
}, /* @__PURE__ */
|
|
1603
|
+
}, /* @__PURE__ */ React25.createElement(Toolbar.Button, {
|
|
1876
1604
|
classNames: [
|
|
1877
1605
|
"bs-[--rail-action]",
|
|
1878
1606
|
!isConnected && "text-error-500"
|
|
1879
1607
|
],
|
|
1880
1608
|
onClick: () => onChangeConnectionState?.(isConnected ? ConnectionState2.OFFLINE : ConnectionState2.ONLINE)
|
|
1881
|
-
}, /* @__PURE__ */
|
|
1609
|
+
}, /* @__PURE__ */ React25.createElement("span", {
|
|
1882
1610
|
className: "sr-only"
|
|
1883
|
-
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */
|
|
1884
|
-
className:
|
|
1885
|
-
}) : /* @__PURE__ */
|
|
1886
|
-
className:
|
|
1887
|
-
}))), /* @__PURE__ */
|
|
1888
|
-
side: "bottom"
|
|
1889
|
-
|
|
1890
|
-
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React27.createElement(Tooltip5.Arrow, null)))))));
|
|
1611
|
+
}, t(isConnected ? "disconnect label" : "connect label")), isConnected ? /* @__PURE__ */ React25.createElement(PlugsConnected, {
|
|
1612
|
+
className: getSize10(5)
|
|
1613
|
+
}) : /* @__PURE__ */ React25.createElement(Plugs, {
|
|
1614
|
+
className: getSize10(5)
|
|
1615
|
+
}))), /* @__PURE__ */ React25.createElement(Tooltip3.Portal, null, /* @__PURE__ */ React25.createElement(Tooltip3.Content, {
|
|
1616
|
+
side: "bottom"
|
|
1617
|
+
}, t(isConnected ? "disconnect label" : "connect label"), /* @__PURE__ */ React25.createElement(Tooltip3.Arrow, null)))))));
|
|
1891
1618
|
};
|
|
1892
1619
|
var IdentityPanelImpl = (props) => {
|
|
1893
1620
|
const { identity, titleId, activeView, onUpdateProfile, onResetStorage, onRecover, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser, InvitationManager: InvitationManagerComponent = InvitationManager, connectionState, onChangeConnectionState, onDone, ...rest } = props;
|
|
1894
|
-
const { t } =
|
|
1621
|
+
const { t } = useTranslation11("os");
|
|
1895
1622
|
const title = useMemo3(() => {
|
|
1896
1623
|
switch (activeView) {
|
|
1897
1624
|
case "device invitation manager":
|
|
@@ -1905,7 +1632,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1905
1632
|
]);
|
|
1906
1633
|
const onCancelReset = () => rest.send?.("unchooseAction");
|
|
1907
1634
|
const hideRecover = rest.agentStatus !== "created";
|
|
1908
|
-
return /* @__PURE__ */
|
|
1635
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(IdentityHeading, {
|
|
1909
1636
|
identity,
|
|
1910
1637
|
titleId,
|
|
1911
1638
|
title,
|
|
@@ -1914,44 +1641,44 @@ var IdentityPanelImpl = (props) => {
|
|
|
1914
1641
|
onUpdateProfile,
|
|
1915
1642
|
connectionState,
|
|
1916
1643
|
onChangeConnectionState
|
|
1917
|
-
}), /* @__PURE__ */
|
|
1644
|
+
}), /* @__PURE__ */ React25.createElement(Viewport.Root, {
|
|
1918
1645
|
activeView
|
|
1919
|
-
}, /* @__PURE__ */
|
|
1646
|
+
}, /* @__PURE__ */ React25.createElement(Viewport.Views, null, /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1920
1647
|
id: "identity action chooser",
|
|
1921
1648
|
classNames: viewStyles
|
|
1922
|
-
}, /* @__PURE__ */
|
|
1649
|
+
}, /* @__PURE__ */ React25.createElement(IdentityActionChooserComponent, {
|
|
1923
1650
|
active: activeView === "identity action chooser",
|
|
1924
1651
|
...rest,
|
|
1925
1652
|
connectionState
|
|
1926
|
-
})), /* @__PURE__ */
|
|
1653
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1927
1654
|
id: "device invitation manager",
|
|
1928
1655
|
classNames: viewStyles
|
|
1929
|
-
}, /* @__PURE__ */
|
|
1656
|
+
}, /* @__PURE__ */ React25.createElement(InvitationManagerComponent, {
|
|
1930
1657
|
active: activeView === "device invitation manager",
|
|
1931
1658
|
...rest,
|
|
1932
1659
|
invitationUrl: rest.createInvitationUrl(rest.invitationCode)
|
|
1933
|
-
})), /* @__PURE__ */
|
|
1660
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1934
1661
|
classNames: viewStyles,
|
|
1935
1662
|
id: "confirm join new identity"
|
|
1936
|
-
}, /* @__PURE__ */
|
|
1663
|
+
}, /* @__PURE__ */ React25.createElement(ConfirmReset, {
|
|
1937
1664
|
active: activeView === "confirm join new identity",
|
|
1938
1665
|
...rest,
|
|
1939
1666
|
mode: "join new identity",
|
|
1940
1667
|
onConfirm: onJoinNewIdentity,
|
|
1941
1668
|
onCancel: onCancelReset
|
|
1942
|
-
})), /* @__PURE__ */
|
|
1669
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1943
1670
|
classNames: viewStyles,
|
|
1944
1671
|
id: "confirm recover"
|
|
1945
|
-
}, /* @__PURE__ */
|
|
1672
|
+
}, /* @__PURE__ */ React25.createElement(ConfirmReset, {
|
|
1946
1673
|
active: activeView === "confirm recover",
|
|
1947
1674
|
...rest,
|
|
1948
1675
|
mode: "recover",
|
|
1949
1676
|
onConfirm: onRecover,
|
|
1950
1677
|
onCancel: onCancelReset
|
|
1951
|
-
})), /* @__PURE__ */
|
|
1678
|
+
})), /* @__PURE__ */ React25.createElement(Viewport.View, {
|
|
1952
1679
|
classNames: viewStyles,
|
|
1953
1680
|
id: "confirm reset storage"
|
|
1954
|
-
}, /* @__PURE__ */
|
|
1681
|
+
}, /* @__PURE__ */ React25.createElement(ConfirmReset, {
|
|
1955
1682
|
active: activeView === "confirm reset storage",
|
|
1956
1683
|
...rest,
|
|
1957
1684
|
mode: "reset storage",
|
|
@@ -1961,7 +1688,7 @@ var IdentityPanelImpl = (props) => {
|
|
|
1961
1688
|
};
|
|
1962
1689
|
var IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
1963
1690
|
const invitationStatus = useInvitationStatus2(invitation);
|
|
1964
|
-
return /* @__PURE__ */
|
|
1691
|
+
return /* @__PURE__ */ React25.createElement(IdentityPanelImpl, {
|
|
1965
1692
|
...props,
|
|
1966
1693
|
...invitationStatus
|
|
1967
1694
|
});
|
|
@@ -1979,7 +1706,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1979
1706
|
if (!identity) {
|
|
1980
1707
|
log7.error("IdentityPanel rendered with no active identity.", void 0, {
|
|
1981
1708
|
F: __dxlog_file6,
|
|
1982
|
-
L:
|
|
1709
|
+
L: 256,
|
|
1983
1710
|
S: void 0,
|
|
1984
1711
|
C: (f, a) => f(...a)
|
|
1985
1712
|
});
|
|
@@ -1996,7 +1723,7 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
1996
1723
|
const subscription = identityService.subscribe((state) => {
|
|
1997
1724
|
log7("[state]", state, {
|
|
1998
1725
|
F: __dxlog_file6,
|
|
1999
|
-
L:
|
|
1726
|
+
L: 269,
|
|
2000
1727
|
S: void 0,
|
|
2001
1728
|
C: (f, a) => f(...a)
|
|
2002
1729
|
});
|
|
@@ -2042,40 +1769,40 @@ var IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => co
|
|
|
2042
1769
|
onChangeConnectionState: handleChangeConnectionState,
|
|
2043
1770
|
...agentProps
|
|
2044
1771
|
};
|
|
2045
|
-
return identityState.context.invitation ? /* @__PURE__ */
|
|
1772
|
+
return identityState.context.invitation ? /* @__PURE__ */ React25.createElement(IdentityPanelWithInvitationImpl, {
|
|
2046
1773
|
...implProps,
|
|
2047
1774
|
invitation: identityState.context.invitation
|
|
2048
|
-
}) : /* @__PURE__ */
|
|
1775
|
+
}) : /* @__PURE__ */ React25.createElement(IdentityPanelImpl, implProps);
|
|
2049
1776
|
};
|
|
2050
1777
|
|
|
2051
1778
|
// packages/sdk/shell/src/panels/JoinPanel/JoinPanel.tsx
|
|
2052
|
-
import
|
|
1779
|
+
import React34, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo4 } from "react";
|
|
2053
1780
|
import { log as log11 } from "@dxos/log";
|
|
2054
1781
|
import { useClient as useClient8, useMulticastObservable } from "@dxos/react-client";
|
|
2055
1782
|
import { useIdentity as useIdentity2 } from "@dxos/react-client/halo";
|
|
2056
|
-
import { useId as useId8, useThemeContext as
|
|
1783
|
+
import { useId as useId8, useThemeContext as useThemeContext3 } from "@dxos/react-ui";
|
|
2057
1784
|
|
|
2058
1785
|
// packages/sdk/shell/src/panels/JoinPanel/JoinHeading.tsx
|
|
2059
1786
|
import { X as X4 } from "@phosphor-icons/react";
|
|
2060
|
-
import
|
|
2061
|
-
import { Button as
|
|
2062
|
-
import { descriptionText as descriptionText9, getSize as
|
|
1787
|
+
import React26, { cloneElement, forwardRef as forwardRef9 } from "react";
|
|
1788
|
+
import { Button as Button7, useTranslation as useTranslation12 } from "@dxos/react-ui";
|
|
1789
|
+
import { descriptionText as descriptionText9, getSize as getSize11, mx as mx20 } from "@dxos/react-ui-theme";
|
|
2063
1790
|
var JoinHeading = /* @__PURE__ */ forwardRef9(({ mode, titleId, exitActionParent, onExit }, forwardedRef) => {
|
|
2064
|
-
const { t } =
|
|
2065
|
-
const exitButton = /* @__PURE__ */
|
|
1791
|
+
const { t } = useTranslation12("os");
|
|
1792
|
+
const exitButton = /* @__PURE__ */ React26.createElement(Button7, {
|
|
2066
1793
|
variant: "ghost",
|
|
2067
1794
|
...onExit && {
|
|
2068
1795
|
onClick: onExit
|
|
2069
1796
|
},
|
|
2070
|
-
classNames:
|
|
1797
|
+
classNames: mx20(descriptionText9, "plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]"),
|
|
2071
1798
|
"data-testid": "join-exit"
|
|
2072
|
-
}, /* @__PURE__ */
|
|
1799
|
+
}, /* @__PURE__ */ React26.createElement(X4, {
|
|
2073
1800
|
weight: "bold",
|
|
2074
|
-
className:
|
|
2075
|
-
}), /* @__PURE__ */
|
|
1801
|
+
className: getSize11(4)
|
|
1802
|
+
}), /* @__PURE__ */ React26.createElement("span", {
|
|
2076
1803
|
className: "sr-only"
|
|
2077
1804
|
}, t("exit label")));
|
|
2078
|
-
return /* @__PURE__ */
|
|
1805
|
+
return /* @__PURE__ */ React26.createElement(Heading, {
|
|
2079
1806
|
ref: forwardedRef,
|
|
2080
1807
|
titleId,
|
|
2081
1808
|
title: t(mode === "halo-only" ? "selecting identity heading" : "joining space heading"),
|
|
@@ -2693,17 +2420,17 @@ var useJoinMachine = (client, options) => {
|
|
|
2693
2420
|
|
|
2694
2421
|
// packages/sdk/shell/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx
|
|
2695
2422
|
import { CaretRight as CaretRight2, Plus as Plus3, QrCode, Textbox } from "@phosphor-icons/react";
|
|
2696
|
-
import
|
|
2697
|
-
import { useTranslation as
|
|
2698
|
-
import { getSize as
|
|
2423
|
+
import React27 from "react";
|
|
2424
|
+
import { useTranslation as useTranslation13 } from "@dxos/react-ui";
|
|
2425
|
+
import { getSize as getSize12 } from "@dxos/react-ui-theme";
|
|
2699
2426
|
var AdditionMethodChooser = (viewStateProps) => {
|
|
2700
2427
|
const disabled = !viewStateProps.active;
|
|
2701
2428
|
const { send } = viewStateProps;
|
|
2702
|
-
const { t } =
|
|
2429
|
+
const { t } = useTranslation13("os");
|
|
2703
2430
|
const sharedButtonProps = {
|
|
2704
2431
|
disabled,
|
|
2705
|
-
after: /* @__PURE__ */
|
|
2706
|
-
className:
|
|
2432
|
+
after: /* @__PURE__ */ React27.createElement(CaretRight2, {
|
|
2433
|
+
className: getSize12(4),
|
|
2707
2434
|
weight: "bold"
|
|
2708
2435
|
}),
|
|
2709
2436
|
slots: {
|
|
@@ -2712,35 +2439,35 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2712
2439
|
}
|
|
2713
2440
|
}
|
|
2714
2441
|
};
|
|
2715
|
-
return /* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(StepHeading, null, t("addition method chooser title")), /* @__PURE__ */ React27.createElement("div", {
|
|
2716
2443
|
role: "none",
|
|
2717
2444
|
className: "flex flex-col gap-1 grow"
|
|
2718
|
-
}, /* @__PURE__ */
|
|
2445
|
+
}, /* @__PURE__ */ React27.createElement(CompoundButton, {
|
|
2719
2446
|
...sharedButtonProps,
|
|
2720
2447
|
description: t("create identity description"),
|
|
2721
|
-
before: /* @__PURE__ */
|
|
2722
|
-
className:
|
|
2448
|
+
before: /* @__PURE__ */ React27.createElement(Plus3, {
|
|
2449
|
+
className: getSize12(6)
|
|
2723
2450
|
}),
|
|
2724
2451
|
onClick: () => send({
|
|
2725
2452
|
type: "createIdentity"
|
|
2726
2453
|
}),
|
|
2727
2454
|
"data-autofocus": "choosingAuthMethod",
|
|
2728
2455
|
"data-testid": "identity-chooser.create-identity"
|
|
2729
|
-
}, t("create identity label")), /* @__PURE__ */
|
|
2456
|
+
}, t("create identity label")), /* @__PURE__ */ React27.createElement(CompoundButton, {
|
|
2730
2457
|
...sharedButtonProps,
|
|
2731
2458
|
description: t("join identity description"),
|
|
2732
|
-
before: /* @__PURE__ */
|
|
2733
|
-
className:
|
|
2459
|
+
before: /* @__PURE__ */ React27.createElement(QrCode, {
|
|
2460
|
+
className: getSize12(6)
|
|
2734
2461
|
}),
|
|
2735
2462
|
onClick: () => send({
|
|
2736
2463
|
type: "acceptHaloInvitation"
|
|
2737
2464
|
}),
|
|
2738
2465
|
"data-testid": "identity-chooser.join-identity"
|
|
2739
|
-
}, t("join identity label")), /* @__PURE__ */
|
|
2466
|
+
}, t("join identity label")), /* @__PURE__ */ React27.createElement(CompoundButton, {
|
|
2740
2467
|
...sharedButtonProps,
|
|
2741
2468
|
description: t("recover identity description"),
|
|
2742
|
-
before: /* @__PURE__ */
|
|
2743
|
-
className:
|
|
2469
|
+
before: /* @__PURE__ */ React27.createElement(Textbox, {
|
|
2470
|
+
className: getSize12(6)
|
|
2744
2471
|
}),
|
|
2745
2472
|
onClick: () => send({
|
|
2746
2473
|
type: "recoverIdentity"
|
|
@@ -2750,39 +2477,39 @@ var AdditionMethodChooser = (viewStateProps) => {
|
|
|
2750
2477
|
};
|
|
2751
2478
|
|
|
2752
2479
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityAdded.tsx
|
|
2753
|
-
import
|
|
2480
|
+
import React28, { cloneElement as cloneElement2 } from "react";
|
|
2754
2481
|
import { generateName as generateName4 } from "@dxos/display-name";
|
|
2755
|
-
import { Avatar as Avatar7, useId as useId7, useTranslation as
|
|
2756
|
-
import { mx as
|
|
2482
|
+
import { Avatar as Avatar7, useId as useId7, useTranslation as useTranslation14 } from "@dxos/react-ui";
|
|
2483
|
+
import { mx as mx21 } from "@dxos/react-ui-theme";
|
|
2757
2484
|
import { hexToFallback } from "@dxos/util";
|
|
2758
2485
|
var IdentityAdded = (props) => {
|
|
2759
2486
|
const { mode, addedIdentity, active, send, onDone, doneActionParent } = props;
|
|
2760
2487
|
const disabled = !active;
|
|
2761
|
-
const { t } =
|
|
2488
|
+
const { t } = useTranslation14("os");
|
|
2762
2489
|
const addedIdentityHex = addedIdentity?.identityKey.toHex() ?? "0";
|
|
2763
2490
|
const fallbackValue = hexToFallback(addedIdentityHex);
|
|
2764
2491
|
const labelId = useId7("identityListItem__label");
|
|
2765
2492
|
const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName4(addedIdentityHex));
|
|
2766
|
-
const doneAction = /* @__PURE__ */
|
|
2493
|
+
const doneAction = /* @__PURE__ */ React28.createElement(Action, {
|
|
2767
2494
|
...onDone && {
|
|
2768
2495
|
onClick: () => onDone(null)
|
|
2769
2496
|
},
|
|
2770
2497
|
disabled,
|
|
2771
2498
|
"data-autofocus": "confirmingAddedIdentity",
|
|
2772
2499
|
"data-testid": "identity-added-done"
|
|
2773
|
-
}, /* @__PURE__ */
|
|
2774
|
-
return /* @__PURE__ */
|
|
2500
|
+
}, /* @__PURE__ */ React28.createElement("span", null, t("done label")));
|
|
2501
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(StepHeading, null, t("identity added label")), /* @__PURE__ */ React28.createElement("div", {
|
|
2775
2502
|
role: "none",
|
|
2776
2503
|
className: "grow flex flex-col items-center justify-center text-center gap-2"
|
|
2777
|
-
}, /* @__PURE__ */
|
|
2504
|
+
}, /* @__PURE__ */ React28.createElement(Avatar7.Root, {
|
|
2778
2505
|
status: "active",
|
|
2779
2506
|
labelId,
|
|
2780
2507
|
hue: addedIdentity?.profile?.data?.hue || fallbackValue.hue
|
|
2781
|
-
}, /* @__PURE__ */
|
|
2508
|
+
}, /* @__PURE__ */ React28.createElement(Avatar7.Frame, null, /* @__PURE__ */ React28.createElement(Avatar7.Fallback, {
|
|
2782
2509
|
text: addedIdentity?.profile?.data?.emoji || fallbackValue.emoji
|
|
2783
|
-
})), /* @__PURE__ */
|
|
2784
|
-
classNames:
|
|
2785
|
-
}, displayName))), /* @__PURE__ */
|
|
2510
|
+
})), /* @__PURE__ */ React28.createElement(Avatar7.Label, {
|
|
2511
|
+
classNames: mx21("text-lg truncate", !addedIdentity?.profile?.displayName && "font-mono")
|
|
2512
|
+
}, displayName))), /* @__PURE__ */ React28.createElement(Actions, null, mode === "halo-only" ? doneActionParent ? /* @__PURE__ */ cloneElement2(doneActionParent, {}, doneAction) : doneAction : /* @__PURE__ */ React28.createElement(Action, {
|
|
2786
2513
|
variant: "primary",
|
|
2787
2514
|
disabled: disabled || !addedIdentity,
|
|
2788
2515
|
onClick: () => addedIdentity && send({
|
|
@@ -2794,21 +2521,21 @@ var IdentityAdded = (props) => {
|
|
|
2794
2521
|
};
|
|
2795
2522
|
|
|
2796
2523
|
// packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx
|
|
2797
|
-
import
|
|
2524
|
+
import React29, { useCallback as useCallback5, useState as useState6 } from "react";
|
|
2798
2525
|
import { log as log9 } from "@dxos/log";
|
|
2799
2526
|
import { useClient as useClient7 } from "@dxos/react-client";
|
|
2800
|
-
import { useTranslation as
|
|
2527
|
+
import { useTranslation as useTranslation15 } from "@dxos/react-ui";
|
|
2801
2528
|
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/IdentityInput.tsx";
|
|
2802
2529
|
var IdentityInput = (props) => {
|
|
2803
2530
|
const { send, method } = props;
|
|
2804
2531
|
const isRecover = method === "recover identity";
|
|
2805
2532
|
const client = useClient7();
|
|
2806
|
-
const { t } =
|
|
2807
|
-
const [validationMessage, setValidationMessage] =
|
|
2533
|
+
const { t } = useTranslation15("os");
|
|
2534
|
+
const [validationMessage, setValidationMessage] = useState6("");
|
|
2808
2535
|
const handleConfirm = async (value) => {
|
|
2809
2536
|
if (isRecover) {
|
|
2810
2537
|
await client.halo.recoverIdentity({
|
|
2811
|
-
|
|
2538
|
+
recoveryCode: value
|
|
2812
2539
|
}).then((identity) => {
|
|
2813
2540
|
send?.({
|
|
2814
2541
|
type: "selectIdentity",
|
|
@@ -2842,7 +2569,7 @@ var IdentityInput = (props) => {
|
|
|
2842
2569
|
});
|
|
2843
2570
|
}
|
|
2844
2571
|
};
|
|
2845
|
-
return /* @__PURE__ */
|
|
2572
|
+
return /* @__PURE__ */ React29.createElement(IdentityInputImpl, {
|
|
2846
2573
|
...props,
|
|
2847
2574
|
onConfirm: handleConfirm,
|
|
2848
2575
|
validationMessage
|
|
@@ -2850,9 +2577,9 @@ var IdentityInput = (props) => {
|
|
|
2850
2577
|
};
|
|
2851
2578
|
var IdentityInputImpl = (props) => {
|
|
2852
2579
|
const { method, active, onConfirm, validationMessage } = props;
|
|
2853
|
-
const { t } =
|
|
2854
|
-
const [inputValue, setInputValue] =
|
|
2855
|
-
const [pending, setPending] =
|
|
2580
|
+
const { t } = useTranslation15("os");
|
|
2581
|
+
const [inputValue, setInputValue] = useState6("");
|
|
2582
|
+
const [pending, setPending] = useState6(false);
|
|
2856
2583
|
const disabled = !active || pending;
|
|
2857
2584
|
const isRecover = method === "recover identity";
|
|
2858
2585
|
const handleConfirm = useCallback5(async () => {
|
|
@@ -2863,17 +2590,17 @@ var IdentityInputImpl = (props) => {
|
|
|
2863
2590
|
onConfirm,
|
|
2864
2591
|
inputValue
|
|
2865
2592
|
]);
|
|
2866
|
-
return /* @__PURE__ */
|
|
2593
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement("div", {
|
|
2867
2594
|
role: "none",
|
|
2868
2595
|
className: "grow flex flex-col justify-center"
|
|
2869
|
-
}, /* @__PURE__ */
|
|
2596
|
+
}, /* @__PURE__ */ React29.createElement(Input, {
|
|
2870
2597
|
validationMessage,
|
|
2871
|
-
label: /* @__PURE__ */
|
|
2598
|
+
label: /* @__PURE__ */ React29.createElement(StepHeading, null, t(isRecover ? "recover identity input label" : "new identity input label")),
|
|
2872
2599
|
disabled,
|
|
2873
2600
|
"data-testid": "identity-input",
|
|
2874
2601
|
placeholder: isRecover ? t("recovery code placeholder") : t("display name placeholder"),
|
|
2875
2602
|
onChange: ({ target: { value } }) => setInputValue(value)
|
|
2876
|
-
})), /* @__PURE__ */
|
|
2603
|
+
})), /* @__PURE__ */ React29.createElement(Actions, null, /* @__PURE__ */ React29.createElement(Action, {
|
|
2877
2604
|
variant: "primary",
|
|
2878
2605
|
disabled: disabled || inputValue.trim().length === 0,
|
|
2879
2606
|
onClick: handleConfirm,
|
|
@@ -2882,13 +2609,13 @@ var IdentityInputImpl = (props) => {
|
|
|
2882
2609
|
};
|
|
2883
2610
|
|
|
2884
2611
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAccepted.tsx
|
|
2885
|
-
import
|
|
2886
|
-
import { useTranslation as
|
|
2612
|
+
import React30, { cloneElement as cloneElement3 } from "react";
|
|
2613
|
+
import { useTranslation as useTranslation16 } from "@dxos/react-ui";
|
|
2887
2614
|
|
|
2888
2615
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx
|
|
2889
|
-
import
|
|
2616
|
+
import React31, { useState as useState7, useEffect as useEffect5, cloneElement as cloneElement4 } from "react";
|
|
2890
2617
|
import { log as log10 } from "@dxos/log";
|
|
2891
|
-
import { useTranslation as
|
|
2618
|
+
import { useTranslation as useTranslation17 } from "@dxos/react-ui";
|
|
2892
2619
|
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/JoinPanel/steps/InvitationInput.tsx";
|
|
2893
2620
|
var invitationCodeFromUrl = (text) => {
|
|
2894
2621
|
try {
|
|
@@ -2908,8 +2635,8 @@ var invitationCodeFromUrl = (text) => {
|
|
|
2908
2635
|
var InvitationInput = (props) => {
|
|
2909
2636
|
const { Kind, active, send, unredeemedCode, onExit, exitActionParent, onDone, doneActionParent, succeededKeys } = props;
|
|
2910
2637
|
const disabled = !active;
|
|
2911
|
-
const { t } =
|
|
2912
|
-
const [inputValue, setInputValue] =
|
|
2638
|
+
const { t } = useTranslation17("os");
|
|
2639
|
+
const [inputValue, setInputValue] = useState7(unredeemedCode ?? "");
|
|
2913
2640
|
useEffect5(() => {
|
|
2914
2641
|
unredeemedCode && setInputValue(unredeemedCode ?? "");
|
|
2915
2642
|
}, [
|
|
@@ -2927,7 +2654,7 @@ var InvitationInput = (props) => {
|
|
|
2927
2654
|
}
|
|
2928
2655
|
});
|
|
2929
2656
|
};
|
|
2930
|
-
const exitAction = /* @__PURE__ */
|
|
2657
|
+
const exitAction = /* @__PURE__ */ React31.createElement(Action, {
|
|
2931
2658
|
variant: "ghost",
|
|
2932
2659
|
disabled,
|
|
2933
2660
|
...onExit ? {
|
|
@@ -2937,11 +2664,11 @@ var InvitationInput = (props) => {
|
|
|
2937
2664
|
},
|
|
2938
2665
|
"data-testid": "join-exit"
|
|
2939
2666
|
}, t("cancel label"));
|
|
2940
|
-
return /* @__PURE__ */
|
|
2667
|
+
return /* @__PURE__ */ React31.createElement(React31.Fragment, null, /* @__PURE__ */ React31.createElement("div", {
|
|
2941
2668
|
role: "none",
|
|
2942
2669
|
className: "grow flex flex-col justify-center"
|
|
2943
|
-
}, /* @__PURE__ */
|
|
2944
|
-
label: /* @__PURE__ */
|
|
2670
|
+
}, /* @__PURE__ */ React31.createElement(Input, {
|
|
2671
|
+
label: /* @__PURE__ */ React31.createElement(StepHeading, null, t("invitation input label")),
|
|
2945
2672
|
placeholder: t("invitation input placeholder"),
|
|
2946
2673
|
disabled,
|
|
2947
2674
|
value: inputValue,
|
|
@@ -2949,7 +2676,7 @@ var InvitationInput = (props) => {
|
|
|
2949
2676
|
"data-autofocus": `inputting${Kind}InvitationCode`,
|
|
2950
2677
|
"data-testid": `${Kind.toLowerCase()}-invitation-input`,
|
|
2951
2678
|
onKeyUp: ({ key }) => key === "Enter" && handleNext()
|
|
2952
|
-
})), /* @__PURE__ */
|
|
2679
|
+
})), /* @__PURE__ */ React31.createElement(Actions, null, Kind === "Halo" ? null : exitActionParent ? /* @__PURE__ */ cloneElement4(exitActionParent, {}, exitAction) : doneActionParent ? /* @__PURE__ */ cloneElement4(doneActionParent, {}, exitAction) : exitAction, /* @__PURE__ */ React31.createElement(Action, {
|
|
2953
2680
|
variant: "primary",
|
|
2954
2681
|
disabled: disabled || inputValue.trim().length === 0,
|
|
2955
2682
|
onClick: handleNext,
|
|
@@ -2958,8 +2685,8 @@ var InvitationInput = (props) => {
|
|
|
2958
2685
|
};
|
|
2959
2686
|
|
|
2960
2687
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationRescuer.tsx
|
|
2961
|
-
import
|
|
2962
|
-
import { useTranslation as
|
|
2688
|
+
import React32 from "react";
|
|
2689
|
+
import { useTranslation as useTranslation18 } from "@dxos/react-ui";
|
|
2963
2690
|
import { descriptionText as descriptionText10 } from "@dxos/react-ui-theme";
|
|
2964
2691
|
var InvitationActions = ({
|
|
2965
2692
|
// `invitationState` does report correct state, but here we evaluate whether `failReason` is a better source of truth
|
|
@@ -2971,14 +2698,14 @@ var InvitationActions = ({
|
|
|
2971
2698
|
Kind,
|
|
2972
2699
|
failReason
|
|
2973
2700
|
}) => {
|
|
2974
|
-
const { t } =
|
|
2701
|
+
const { t } = useTranslation18("os");
|
|
2975
2702
|
if (failReason) {
|
|
2976
|
-
return /* @__PURE__ */
|
|
2703
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StepHeading, {
|
|
2977
2704
|
className: descriptionText10
|
|
2978
|
-
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */
|
|
2705
|
+
}, t(failReason === "timeout" ? "timeout status label" : failReason === "cancelled" ? "cancelled status label" : "error status label")), /* @__PURE__ */ React32.createElement("div", {
|
|
2979
2706
|
role: "none",
|
|
2980
2707
|
className: "grow"
|
|
2981
|
-
}), /* @__PURE__ */
|
|
2708
|
+
}), /* @__PURE__ */ React32.createElement(Actions, null, /* @__PURE__ */ React32.createElement(Action, {
|
|
2982
2709
|
disabled: !active,
|
|
2983
2710
|
onClick: () => send({
|
|
2984
2711
|
type: `reset${Kind}Invitation`
|
|
@@ -2986,16 +2713,16 @@ var InvitationActions = ({
|
|
|
2986
2713
|
"data-testid": "invitation-rescuer-reset"
|
|
2987
2714
|
}, t("reset label"))));
|
|
2988
2715
|
} else {
|
|
2989
|
-
return /* @__PURE__ */
|
|
2716
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(StepHeading, {
|
|
2990
2717
|
className: descriptionText10
|
|
2991
|
-
}, t("connecting status label")), /* @__PURE__ */
|
|
2718
|
+
}, t("connecting status label")), /* @__PURE__ */ React32.createElement("div", {
|
|
2992
2719
|
role: "none",
|
|
2993
2720
|
className: "grow"
|
|
2994
|
-
}), /* @__PURE__ */
|
|
2721
|
+
}), /* @__PURE__ */ React32.createElement(Actions, null, /* @__PURE__ */ React32.createElement(Action, {
|
|
2995
2722
|
disabled: true,
|
|
2996
2723
|
classNames: "order-2",
|
|
2997
2724
|
"data-testid": "next"
|
|
2998
|
-
}, t("next label")), /* @__PURE__ */
|
|
2725
|
+
}, t("next label")), /* @__PURE__ */ React32.createElement(Action, {
|
|
2999
2726
|
disabled: !active,
|
|
3000
2727
|
onClick: onInvitationCancel,
|
|
3001
2728
|
"data-testid": "invitation-rescuer-cancel"
|
|
@@ -3004,52 +2731,52 @@ var InvitationActions = ({
|
|
|
3004
2731
|
};
|
|
3005
2732
|
var InvitationRescuer = (props) => {
|
|
3006
2733
|
const { Kind, invitationState, active, send } = props;
|
|
3007
|
-
const { t } =
|
|
3008
|
-
return /* @__PURE__ */
|
|
2734
|
+
const { t } = useTranslation18("os");
|
|
2735
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, typeof invitationState === "undefined" ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement("div", {
|
|
3009
2736
|
role: "none",
|
|
3010
2737
|
className: "grow flex flex-col justify-center"
|
|
3011
|
-
}, /* @__PURE__ */
|
|
2738
|
+
}, /* @__PURE__ */ React32.createElement(StepHeading, {
|
|
3012
2739
|
className: descriptionText10
|
|
3013
|
-
}, "There was a problem joining the space")), /* @__PURE__ */
|
|
2740
|
+
}, "There was a problem joining the space")), /* @__PURE__ */ React32.createElement(Actions, null, /* @__PURE__ */ React32.createElement(Action, {
|
|
3014
2741
|
disabled: !active,
|
|
3015
2742
|
"data-testid": "invitation-rescuer-blank-reset",
|
|
3016
2743
|
onClick: () => send({
|
|
3017
2744
|
type: `reset${Kind}Invitation`
|
|
3018
2745
|
})
|
|
3019
|
-
}, t("reset label")))) : /* @__PURE__ */
|
|
2746
|
+
}, t("reset label")))) : /* @__PURE__ */ React32.createElement(InvitationActions, props));
|
|
3020
2747
|
};
|
|
3021
2748
|
|
|
3022
2749
|
// packages/sdk/shell/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx
|
|
3023
|
-
import
|
|
2750
|
+
import React33, { useState as useState8 } from "react";
|
|
3024
2751
|
import { Invitation as Invitation6 } from "@dxos/react-client/invitations";
|
|
3025
|
-
import { Input as Input3, useTranslation as
|
|
2752
|
+
import { Input as Input3, useTranslation as useTranslation19 } from "@dxos/react-ui";
|
|
3026
2753
|
import { descriptionText as descriptionText11 } from "@dxos/react-ui-theme";
|
|
3027
2754
|
import { hexToEmoji as hexToEmoji5 } from "@dxos/util";
|
|
3028
2755
|
var pinLength = 6;
|
|
3029
2756
|
var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invitationId, onInvitationAuthenticate, onInvitationCancel }) => {
|
|
3030
2757
|
const disabled = !active || pending;
|
|
3031
|
-
const { t } =
|
|
2758
|
+
const { t } = useTranslation19("os");
|
|
3032
2759
|
const invitationType = Kind.toLowerCase();
|
|
3033
|
-
const [authCode, setAuthCode] =
|
|
2760
|
+
const [authCode, setAuthCode] = useState8("");
|
|
3034
2761
|
const onChange = ({ target: { value } }) => {
|
|
3035
2762
|
setAuthCode(value);
|
|
3036
2763
|
if (value.length === pinLength) {
|
|
3037
2764
|
document.querySelector(`[data-autofocus-pinlength="${invitationType}"]`)?.focus();
|
|
3038
2765
|
}
|
|
3039
2766
|
};
|
|
3040
|
-
return /* @__PURE__ */
|
|
2767
|
+
return /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement("div", {
|
|
3041
2768
|
role: "none",
|
|
3042
2769
|
className: "grow flex flex-col justify-center gap-4"
|
|
3043
|
-
}, /* @__PURE__ */
|
|
2770
|
+
}, /* @__PURE__ */ React33.createElement(Input3.Root, failed && {
|
|
3044
2771
|
validationValence: "error"
|
|
3045
|
-
}, /* @__PURE__ */
|
|
2772
|
+
}, /* @__PURE__ */ React33.createElement(Input3.Label, {
|
|
3046
2773
|
asChild: true
|
|
3047
|
-
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */
|
|
2774
|
+
}, authMethod === Invitation6.AuthMethod.SHARED_SECRET ? /* @__PURE__ */ React33.createElement(StepHeading, null, t("auth code input label")) : /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(StepHeading, {
|
|
3048
2775
|
className: descriptionText11
|
|
3049
|
-
}, t("authenticating label")), /* @__PURE__ */
|
|
2776
|
+
}, t("authenticating label")), /* @__PURE__ */ React33.createElement("div", {
|
|
3050
2777
|
role: "none",
|
|
3051
2778
|
className: "grow"
|
|
3052
|
-
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */
|
|
2779
|
+
}))), authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React33.createElement(Input3.PinInput, {
|
|
3053
2780
|
disabled,
|
|
3054
2781
|
length: pinLength,
|
|
3055
2782
|
onChange,
|
|
@@ -3060,18 +2787,18 @@ var InvitationAuthenticator = ({ failed, Kind, authMethod, active, pending, invi
|
|
|
3060
2787
|
"data-prevent-ios-autofocus": true,
|
|
3061
2788
|
"data-testid": `${invitationType}-auth-code-input`,
|
|
3062
2789
|
"data-1p-ignore": true
|
|
3063
|
-
}), failed && /* @__PURE__ */
|
|
2790
|
+
}), failed && /* @__PURE__ */ React33.createElement(Input3.DescriptionAndValidation, {
|
|
3064
2791
|
classNames: "text-center"
|
|
3065
|
-
}, /* @__PURE__ */
|
|
2792
|
+
}, /* @__PURE__ */ React33.createElement(Input3.Validation, null, t("failed to authenticate message")))), invitationId && authMethod === Invitation6.AuthMethod.SHARED_SECRET && /* @__PURE__ */ React33.createElement(React33.Fragment, null, /* @__PURE__ */ React33.createElement(Label, null, t("auth other device emoji message")), /* @__PURE__ */ React33.createElement("div", {
|
|
3066
2793
|
className: "flex justify-center"
|
|
3067
|
-
}, /* @__PURE__ */
|
|
2794
|
+
}, /* @__PURE__ */ React33.createElement(Emoji, {
|
|
3068
2795
|
text: hexToEmoji5(invitationId)
|
|
3069
|
-
})))), /* @__PURE__ */
|
|
2796
|
+
})))), /* @__PURE__ */ React33.createElement(Actions, null, /* @__PURE__ */ React33.createElement(Action, {
|
|
3070
2797
|
variant: "ghost",
|
|
3071
2798
|
disabled,
|
|
3072
2799
|
onClick: () => onInvitationCancel?.(),
|
|
3073
2800
|
"data-testid": `${invitationType}-invitation-authenticator-cancel`
|
|
3074
|
-
}, t("cancel label")), /* @__PURE__ */
|
|
2801
|
+
}, t("cancel label")), /* @__PURE__ */ React33.createElement(Action, {
|
|
3075
2802
|
variant: "primary",
|
|
3076
2803
|
disabled,
|
|
3077
2804
|
onClick: () => onInvitationAuthenticate?.(authCode),
|
|
@@ -3133,46 +2860,46 @@ var JoinPanelImpl = (props) => {
|
|
|
3133
2860
|
IdentityInput: IdentityInputComponent = IdentityInput,
|
|
3134
2861
|
ConfirmReset: ConfirmResetComponent = ConfirmReset
|
|
3135
2862
|
} = props;
|
|
3136
|
-
return /* @__PURE__ */
|
|
2863
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, mode !== "halo-only" && /* @__PURE__ */ React34.createElement(JoinHeading, {
|
|
3137
2864
|
titleId,
|
|
3138
2865
|
mode,
|
|
3139
2866
|
onExit,
|
|
3140
2867
|
exitActionParent
|
|
3141
|
-
}), /* @__PURE__ */
|
|
2868
|
+
}), /* @__PURE__ */ React34.createElement(Viewport.Root, {
|
|
3142
2869
|
focusManaged: true,
|
|
3143
2870
|
activeView
|
|
3144
|
-
}, /* @__PURE__ */
|
|
2871
|
+
}, /* @__PURE__ */ React34.createElement(Viewport.Views, null, /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3145
2872
|
classNames: stepStyles,
|
|
3146
2873
|
id: "addition method chooser"
|
|
3147
|
-
}, /* @__PURE__ */
|
|
2874
|
+
}, /* @__PURE__ */ React34.createElement(AdditionMethodChooser, {
|
|
3148
2875
|
send,
|
|
3149
2876
|
active: activeView === "addition method chooser"
|
|
3150
|
-
})), /* @__PURE__ */
|
|
2877
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3151
2878
|
classNames: stepStyles,
|
|
3152
2879
|
id: "reset storage confirmation"
|
|
3153
|
-
}, /* @__PURE__ */
|
|
2880
|
+
}, /* @__PURE__ */ React34.createElement(ConfirmResetComponent, {
|
|
3154
2881
|
send,
|
|
3155
2882
|
active: activeView === "reset storage confirmation",
|
|
3156
2883
|
onCancel: onCancelResetStorage,
|
|
3157
2884
|
onConfirm: onConfirmResetStorage
|
|
3158
|
-
})), /* @__PURE__ */
|
|
2885
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3159
2886
|
classNames: stepStyles,
|
|
3160
2887
|
id: "create identity input"
|
|
3161
|
-
}, /* @__PURE__ */
|
|
2888
|
+
}, /* @__PURE__ */ React34.createElement(IdentityInputComponent, {
|
|
3162
2889
|
send,
|
|
3163
2890
|
method: "create identity",
|
|
3164
2891
|
active: activeView === "create identity input"
|
|
3165
|
-
})), /* @__PURE__ */
|
|
2892
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3166
2893
|
classNames: stepStyles,
|
|
3167
2894
|
id: "recover identity input"
|
|
3168
|
-
}, /* @__PURE__ */
|
|
2895
|
+
}, /* @__PURE__ */ React34.createElement(IdentityInputComponent, {
|
|
3169
2896
|
send,
|
|
3170
2897
|
method: "recover identity",
|
|
3171
2898
|
active: activeView === "recover identity input"
|
|
3172
|
-
})), /* @__PURE__ */
|
|
2899
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3173
2900
|
classNames: stepStyles,
|
|
3174
2901
|
id: "halo invitation input"
|
|
3175
|
-
}, /* @__PURE__ */
|
|
2902
|
+
}, /* @__PURE__ */ React34.createElement(InvitationInput, {
|
|
3176
2903
|
send,
|
|
3177
2904
|
Kind: "Halo",
|
|
3178
2905
|
active: activeView === "halo invitation input",
|
|
@@ -3182,20 +2909,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3182
2909
|
...succeededKeys?.Halo && {
|
|
3183
2910
|
succeededKeys: succeededKeys.Halo
|
|
3184
2911
|
}
|
|
3185
|
-
})), /* @__PURE__ */
|
|
2912
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3186
2913
|
classNames: stepStyles,
|
|
3187
2914
|
id: "halo invitation rescuer"
|
|
3188
|
-
}, /* @__PURE__ */
|
|
2915
|
+
}, /* @__PURE__ */ React34.createElement(InvitationRescuer, {
|
|
3189
2916
|
send,
|
|
3190
2917
|
Kind: "Halo",
|
|
3191
2918
|
active: activeView === "halo invitation rescuer",
|
|
3192
2919
|
invitationState: invitationStates?.Halo,
|
|
3193
2920
|
onInvitationCancel: onHaloInvitationCancel,
|
|
3194
2921
|
failReason: failReasons?.Halo
|
|
3195
|
-
})), /* @__PURE__ */
|
|
2922
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3196
2923
|
classNames: stepStyles,
|
|
3197
2924
|
id: "halo invitation authenticator"
|
|
3198
|
-
}, /* @__PURE__ */
|
|
2925
|
+
}, /* @__PURE__ */ React34.createElement(InvitationAuthenticator, {
|
|
3199
2926
|
send,
|
|
3200
2927
|
Kind: "Halo",
|
|
3201
2928
|
invitationId: invitationIds?.Halo,
|
|
@@ -3206,19 +2933,19 @@ var JoinPanelImpl = (props) => {
|
|
|
3206
2933
|
...failed.has("Halo") && {
|
|
3207
2934
|
failed: true
|
|
3208
2935
|
}
|
|
3209
|
-
})), /* @__PURE__ */
|
|
2936
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3210
2937
|
classNames: stepStyles,
|
|
3211
2938
|
id: "identity added"
|
|
3212
|
-
}, /* @__PURE__ */
|
|
2939
|
+
}, /* @__PURE__ */ React34.createElement(IdentityAdded, {
|
|
3213
2940
|
send,
|
|
3214
2941
|
mode,
|
|
3215
2942
|
active: activeView === "identity added",
|
|
3216
2943
|
doneActionParent,
|
|
3217
2944
|
onDone: onHaloDone
|
|
3218
|
-
})), /* @__PURE__ */
|
|
2945
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3219
2946
|
classNames: stepStyles,
|
|
3220
2947
|
id: "space invitation input"
|
|
3221
|
-
}, /* @__PURE__ */
|
|
2948
|
+
}, /* @__PURE__ */ React34.createElement(InvitationInput, {
|
|
3222
2949
|
send,
|
|
3223
2950
|
Kind: "Space",
|
|
3224
2951
|
active: activeView === "space invitation input",
|
|
@@ -3230,20 +2957,20 @@ var JoinPanelImpl = (props) => {
|
|
|
3230
2957
|
},
|
|
3231
2958
|
onExit,
|
|
3232
2959
|
exitActionParent
|
|
3233
|
-
})), /* @__PURE__ */
|
|
2960
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3234
2961
|
classNames: stepStyles,
|
|
3235
2962
|
id: "space invitation rescuer"
|
|
3236
|
-
}, /* @__PURE__ */
|
|
2963
|
+
}, /* @__PURE__ */ React34.createElement(InvitationRescuer, {
|
|
3237
2964
|
send,
|
|
3238
2965
|
Kind: "Space",
|
|
3239
2966
|
active: activeView === "space invitation rescuer",
|
|
3240
2967
|
invitationState: invitationStates?.Space,
|
|
3241
2968
|
onInvitationCancel: onSpaceInvitationCancel,
|
|
3242
2969
|
failReason: failReasons?.Space
|
|
3243
|
-
})), /* @__PURE__ */
|
|
2970
|
+
})), /* @__PURE__ */ React34.createElement(Viewport.View, {
|
|
3244
2971
|
classNames: stepStyles,
|
|
3245
2972
|
id: "space invitation authenticator"
|
|
3246
|
-
}, /* @__PURE__ */
|
|
2973
|
+
}, /* @__PURE__ */ React34.createElement(InvitationAuthenticator, {
|
|
3247
2974
|
send,
|
|
3248
2975
|
Kind: "Space",
|
|
3249
2976
|
invitationId: invitationIds?.Space,
|
|
@@ -3259,7 +2986,7 @@ var JoinPanelImpl = (props) => {
|
|
|
3259
2986
|
var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition = "default", initialInvitationCode, exitActionParent, onExit, doneActionParent, onDone: propsOnDone, onCancelResetStorage }) => {
|
|
3260
2987
|
const client = useClient8();
|
|
3261
2988
|
const identity = useIdentity2();
|
|
3262
|
-
const { hasIosKeyboard } =
|
|
2989
|
+
const { hasIosKeyboard } = useThemeContext3();
|
|
3263
2990
|
const titleId = useId8("joinPanel__heading", propsTitleId);
|
|
3264
2991
|
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
3265
2992
|
context: {
|
|
@@ -3521,7 +3248,7 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3521
3248
|
client,
|
|
3522
3249
|
joinSend
|
|
3523
3250
|
]);
|
|
3524
|
-
return /* @__PURE__ */
|
|
3251
|
+
return /* @__PURE__ */ React34.createElement(JoinPanelImpl, {
|
|
3525
3252
|
titleId,
|
|
3526
3253
|
mode,
|
|
3527
3254
|
send: joinSend,
|
|
@@ -3564,10 +3291,10 @@ var JoinPanel = ({ titleId: propsTitleId, mode = "default", initialDisposition =
|
|
|
3564
3291
|
|
|
3565
3292
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3566
3293
|
import { Planet } from "@phosphor-icons/react";
|
|
3567
|
-
import
|
|
3294
|
+
import React36, { useEffect as useEffect7, useMemo as useMemo5 } from "react";
|
|
3568
3295
|
import { log as log14 } from "@dxos/log";
|
|
3569
3296
|
import { useInvitationStatus as useInvitationStatus3 } from "@dxos/react-client/invitations";
|
|
3570
|
-
import { useId as useId9, useTranslation as
|
|
3297
|
+
import { useId as useId9, useTranslation as useTranslation21 } from "@dxos/react-ui";
|
|
3571
3298
|
|
|
3572
3299
|
// packages/sdk/shell/src/panels/SpacePanel/spaceMachine.ts
|
|
3573
3300
|
import { useMachine as useMachine3 } from "@xstate/react";
|
|
@@ -3633,13 +3360,13 @@ var useSpaceMachine = (options) => {
|
|
|
3633
3360
|
|
|
3634
3361
|
// packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx
|
|
3635
3362
|
import { Placeholder as Placeholder2, UserPlus, UsersThree } from "@phosphor-icons/react";
|
|
3636
|
-
import
|
|
3363
|
+
import React35, { useCallback as useCallback7, useState as useState9 } from "react";
|
|
3637
3364
|
import { log as log13 } from "@dxos/log";
|
|
3638
3365
|
import { useConfig } from "@dxos/react-client";
|
|
3639
3366
|
import { useSpaceInvitations as useSpaceInvitations2 } from "@dxos/react-client/echo";
|
|
3640
3367
|
import { Invitation as Invitation8, InvitationEncoder as InvitationEncoder4 } from "@dxos/react-client/invitations";
|
|
3641
|
-
import { ScrollArea, useTranslation as
|
|
3642
|
-
import { descriptionText as descriptionText12, mx as
|
|
3368
|
+
import { ScrollArea, useTranslation as useTranslation20 } from "@dxos/react-ui";
|
|
3369
|
+
import { descriptionText as descriptionText12, mx as mx22 } from "@dxos/react-ui-theme";
|
|
3643
3370
|
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/steps/SpaceManager.tsx";
|
|
3644
3371
|
var activeActionKey = "dxos:react-shell/space-manager/active-action";
|
|
3645
3372
|
var handleInvitationEvent = (invitation, subscription) => {
|
|
@@ -3659,7 +3386,7 @@ var handleInvitationEvent = (invitation, subscription) => {
|
|
|
3659
3386
|
};
|
|
3660
3387
|
var SpaceManager = (props) => {
|
|
3661
3388
|
const { space, target } = props;
|
|
3662
|
-
const { t } =
|
|
3389
|
+
const { t } = useTranslation20("os");
|
|
3663
3390
|
const config = useConfig();
|
|
3664
3391
|
const invitations = useSpaceInvitations2(space?.key);
|
|
3665
3392
|
const inviteActions = {
|
|
@@ -3704,7 +3431,7 @@ var SpaceManager = (props) => {
|
|
|
3704
3431
|
])
|
|
3705
3432
|
}
|
|
3706
3433
|
};
|
|
3707
|
-
return /* @__PURE__ */
|
|
3434
|
+
return /* @__PURE__ */ React35.createElement(SpaceManagerImpl, {
|
|
3708
3435
|
...props,
|
|
3709
3436
|
invitations,
|
|
3710
3437
|
inviteActions
|
|
@@ -3713,7 +3440,7 @@ var SpaceManager = (props) => {
|
|
|
3713
3440
|
var headingFragment = "pis-3 pie-1 plb-1 mbe-1 font-medium";
|
|
3714
3441
|
var SpaceManagerImpl = (props) => {
|
|
3715
3442
|
const { active, space, createInvitationUrl, send, inviteActions: propsInviteActions, invitations, showInactiveInvitations, SpaceMemberList: SpaceMemberListComponent = SpaceMemberList, InvitationList: InvitationListComponent = InvitationList } = props;
|
|
3716
|
-
const { t } =
|
|
3443
|
+
const { t } = useTranslation20("os");
|
|
3717
3444
|
const inviteActions = propsInviteActions ?? {
|
|
3718
3445
|
noopInvite: {
|
|
3719
3446
|
label: t("create space invitation label"),
|
|
@@ -3723,7 +3450,7 @@ var SpaceManagerImpl = (props) => {
|
|
|
3723
3450
|
}
|
|
3724
3451
|
}
|
|
3725
3452
|
};
|
|
3726
|
-
const [activeAction, setInternalActiveAction] =
|
|
3453
|
+
const [activeAction, setInternalActiveAction] = useState9(localStorage.getItem(activeActionKey) ?? "inviteMany");
|
|
3727
3454
|
const setActiveAction = (nextAction) => {
|
|
3728
3455
|
setInternalActiveAction(nextAction);
|
|
3729
3456
|
localStorage.setItem(activeActionKey, nextAction);
|
|
@@ -3731,26 +3458,26 @@ var SpaceManagerImpl = (props) => {
|
|
|
3731
3458
|
const visibleInvitations = showInactiveInvitations ? invitations : invitations?.filter((invitation) => ![
|
|
3732
3459
|
Invitation8.State.CANCELLED
|
|
3733
3460
|
].includes(invitation.get().state));
|
|
3734
|
-
return /* @__PURE__ */
|
|
3461
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(ScrollArea.Root, {
|
|
3735
3462
|
classNames: "grow shrink basis-28 -mli-2"
|
|
3736
|
-
}, /* @__PURE__ */
|
|
3463
|
+
}, /* @__PURE__ */ React35.createElement(ScrollArea.Viewport, {
|
|
3737
3464
|
classNames: "is-full pie-2"
|
|
3738
|
-
}, !!visibleInvitations?.length && /* @__PURE__ */
|
|
3739
|
-
className:
|
|
3740
|
-
}, t("invitation list heading")), /* @__PURE__ */
|
|
3465
|
+
}, !!visibleInvitations?.length && /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement("h3", {
|
|
3466
|
+
className: mx22(headingFragment, descriptionText12)
|
|
3467
|
+
}, t("invitation list heading")), /* @__PURE__ */ React35.createElement(InvitationListComponent, {
|
|
3741
3468
|
className: "mb-2",
|
|
3742
3469
|
send,
|
|
3743
3470
|
invitations: visibleInvitations ?? [],
|
|
3744
3471
|
onClickRemove: (invitation) => invitation.cancel(),
|
|
3745
3472
|
createInvitationUrl
|
|
3746
|
-
}), /* @__PURE__ */
|
|
3747
|
-
className:
|
|
3748
|
-
}, t("space member list heading"))), /* @__PURE__ */
|
|
3473
|
+
}), /* @__PURE__ */ React35.createElement("h3", {
|
|
3474
|
+
className: mx22(headingFragment, descriptionText12, "mbs-2")
|
|
3475
|
+
}, t("space member list heading"))), /* @__PURE__ */ React35.createElement(SpaceMemberListComponent, {
|
|
3749
3476
|
spaceKey: space.key,
|
|
3750
3477
|
includeSelf: true
|
|
3751
|
-
})), /* @__PURE__ */
|
|
3478
|
+
})), /* @__PURE__ */ React35.createElement(ScrollArea.Scrollbar, {
|
|
3752
3479
|
orientation: "vertical"
|
|
3753
|
-
}, /* @__PURE__ */
|
|
3480
|
+
}, /* @__PURE__ */ React35.createElement(ScrollArea.Thumb, null))), /* @__PURE__ */ React35.createElement(Actions, null, /* @__PURE__ */ React35.createElement(BifurcatedAction, {
|
|
3754
3481
|
disabled: !active,
|
|
3755
3482
|
actions: inviteActions,
|
|
3756
3483
|
activeAction,
|
|
@@ -3762,45 +3489,45 @@ var SpaceManagerImpl = (props) => {
|
|
|
3762
3489
|
// packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx
|
|
3763
3490
|
var __dxlog_file13 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/panels/SpacePanel/SpacePanel.tsx";
|
|
3764
3491
|
var SpacePanelHeading = ({ titleId, space, onDone }) => {
|
|
3765
|
-
const { t } =
|
|
3492
|
+
const { t } = useTranslation21("os");
|
|
3766
3493
|
const name = space.properties.name;
|
|
3767
|
-
return /* @__PURE__ */
|
|
3494
|
+
return /* @__PURE__ */ React36.createElement(Heading, {
|
|
3768
3495
|
titleId,
|
|
3769
3496
|
title: t("space panel heading"),
|
|
3770
|
-
corner: /* @__PURE__ */
|
|
3497
|
+
corner: /* @__PURE__ */ React36.createElement(CloseButton, {
|
|
3771
3498
|
"data-testid": "identity-panel-done",
|
|
3772
3499
|
onDone
|
|
3773
3500
|
})
|
|
3774
|
-
}, /* @__PURE__ */
|
|
3501
|
+
}, /* @__PURE__ */ React36.createElement("div", {
|
|
3775
3502
|
role: "none",
|
|
3776
3503
|
className: "flex gap-4 items-center justify-center mlb-4"
|
|
3777
|
-
}, /* @__PURE__ */
|
|
3504
|
+
}, /* @__PURE__ */ React36.createElement(Planet, {
|
|
3778
3505
|
size: 32,
|
|
3779
3506
|
weight: "light"
|
|
3780
|
-
}), /* @__PURE__ */
|
|
3507
|
+
}), /* @__PURE__ */ React36.createElement("div", {
|
|
3781
3508
|
className: "block text-start font-light text-xl"
|
|
3782
3509
|
}, name ?? space.key.truncate())));
|
|
3783
3510
|
};
|
|
3784
3511
|
var SpacePanelImpl = (props) => {
|
|
3785
3512
|
const { titleId, activeView, space, hideHeading, target, SpaceManager: SpaceManagerComponent = SpaceManager, InvitationManager: InvitationManagerComponent = InvitationManager, ...rest } = props;
|
|
3786
|
-
return /* @__PURE__ */
|
|
3513
|
+
return /* @__PURE__ */ React36.createElement(React36.Fragment, null, !hideHeading && /* @__PURE__ */ React36.createElement(SpacePanelHeading, {
|
|
3787
3514
|
...rest,
|
|
3788
3515
|
titleId,
|
|
3789
3516
|
space
|
|
3790
|
-
}), /* @__PURE__ */
|
|
3517
|
+
}), /* @__PURE__ */ React36.createElement(Viewport.Root, {
|
|
3791
3518
|
activeView
|
|
3792
|
-
}, /* @__PURE__ */
|
|
3519
|
+
}, /* @__PURE__ */ React36.createElement(Viewport.Views, null, /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3793
3520
|
id: "space manager",
|
|
3794
3521
|
classNames: stepStyles
|
|
3795
|
-
}, /* @__PURE__ */
|
|
3522
|
+
}, /* @__PURE__ */ React36.createElement(SpaceManagerComponent, {
|
|
3796
3523
|
active: activeView === "space manager",
|
|
3797
3524
|
space,
|
|
3798
3525
|
target,
|
|
3799
3526
|
...rest
|
|
3800
|
-
})), /* @__PURE__ */
|
|
3527
|
+
})), /* @__PURE__ */ React36.createElement(Viewport.View, {
|
|
3801
3528
|
id: "space invitation manager",
|
|
3802
3529
|
classNames: stepStyles
|
|
3803
|
-
}, /* @__PURE__ */
|
|
3530
|
+
}, /* @__PURE__ */ React36.createElement(InvitationManagerComponent, {
|
|
3804
3531
|
active: activeView === "space invitation manager",
|
|
3805
3532
|
...rest,
|
|
3806
3533
|
invitationUrl: props.invitationUrl
|
|
@@ -3808,7 +3535,7 @@ var SpacePanelImpl = (props) => {
|
|
|
3808
3535
|
};
|
|
3809
3536
|
var SpacePanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
3810
3537
|
const invitationStatus = useInvitationStatus3(invitation);
|
|
3811
|
-
return /* @__PURE__ */
|
|
3538
|
+
return /* @__PURE__ */ React36.createElement(SpacePanelImpl, {
|
|
3812
3539
|
...props,
|
|
3813
3540
|
...invitationStatus,
|
|
3814
3541
|
invitationUrl: props.createInvitationUrl(invitationStatus.invitationCode)
|
|
@@ -3855,24 +3582,24 @@ var SpacePanel = ({ titleId: propsTitleId, createInvitationUrl = (code) => code,
|
|
|
3855
3582
|
};
|
|
3856
3583
|
return spaceState.context.invitation ? (
|
|
3857
3584
|
// TODO(wittjosiah): Unused? Remove?
|
|
3858
|
-
/* @__PURE__ */
|
|
3585
|
+
/* @__PURE__ */ React36.createElement(SpacePanelWithInvitationImpl, {
|
|
3859
3586
|
...implProps,
|
|
3860
3587
|
invitation: spaceState.context.invitation
|
|
3861
3588
|
})
|
|
3862
|
-
) : /* @__PURE__ */
|
|
3589
|
+
) : /* @__PURE__ */ React36.createElement(SpacePanelImpl, implProps);
|
|
3863
3590
|
};
|
|
3864
3591
|
|
|
3865
3592
|
// packages/sdk/shell/src/panels/StatusPanel/StatusPanel.tsx
|
|
3866
|
-
import
|
|
3867
|
-
import { Status, useTranslation as
|
|
3593
|
+
import React37 from "react";
|
|
3594
|
+
import { Status, useTranslation as useTranslation22 } from "@dxos/react-ui";
|
|
3868
3595
|
var StatusPanel = ({ titleId }) => {
|
|
3869
|
-
const { t } =
|
|
3870
|
-
return /* @__PURE__ */
|
|
3596
|
+
const { t } = useTranslation22("os");
|
|
3597
|
+
return /* @__PURE__ */ React37.createElement("div", {
|
|
3871
3598
|
className: "grid place-items-center p-2 gap-2"
|
|
3872
|
-
}, /* @__PURE__ */
|
|
3599
|
+
}, /* @__PURE__ */ React37.createElement("p", {
|
|
3873
3600
|
id: titleId,
|
|
3874
3601
|
className: "font-medium text-center"
|
|
3875
|
-
}, t("resetting message")), /* @__PURE__ */
|
|
3602
|
+
}, t("resetting message")), /* @__PURE__ */ React37.createElement(Status, {
|
|
3876
3603
|
indeterminate: true
|
|
3877
3604
|
}, t("resetting message")));
|
|
3878
3605
|
};
|
|
@@ -3880,96 +3607,96 @@ var StatusPanel = ({ titleId }) => {
|
|
|
3880
3607
|
// packages/sdk/shell/src/composites/IdentityDialog/IdentityDialog.tsx
|
|
3881
3608
|
var IdentityDialog = (props) => {
|
|
3882
3609
|
const titleId = useId10("identityDialog__title", props.title);
|
|
3883
|
-
return /* @__PURE__ */
|
|
3610
|
+
return /* @__PURE__ */ React38.createElement(Dialog.Root, {
|
|
3884
3611
|
defaultOpen: true,
|
|
3885
3612
|
onOpenChange: (open) => open || props.onDone?.()
|
|
3886
|
-
}, /* @__PURE__ */
|
|
3613
|
+
}, /* @__PURE__ */ React38.createElement(Dialog.Portal, null, /* @__PURE__ */ React38.createElement(Dialog.Overlay, null, /* @__PURE__ */ React38.createElement(Dialog.Content, {
|
|
3887
3614
|
"aria-labelledby": titleId,
|
|
3888
3615
|
onOpenAutoFocus: (e) => e.preventDefault()
|
|
3889
|
-
}, /* @__PURE__ */
|
|
3616
|
+
}, /* @__PURE__ */ React38.createElement(Clipboard3.Provider, null, /* @__PURE__ */ React38.createElement(IdentityPanel, {
|
|
3890
3617
|
...props,
|
|
3891
3618
|
titleId,
|
|
3892
|
-
doneActionParent: /* @__PURE__ */
|
|
3619
|
+
doneActionParent: /* @__PURE__ */ React38.createElement(Dialog.Close, {
|
|
3893
3620
|
asChild: true
|
|
3894
3621
|
})
|
|
3895
3622
|
}))))));
|
|
3896
3623
|
};
|
|
3897
3624
|
|
|
3898
3625
|
// packages/sdk/shell/src/composites/JoinDialog/JoinDialog.tsx
|
|
3899
|
-
import
|
|
3626
|
+
import React39 from "react";
|
|
3900
3627
|
import { AlertDialog, useId as useId11, useVisualViewport } from "@dxos/react-ui";
|
|
3901
3628
|
var JoinDialog = (joinPanelProps) => {
|
|
3902
3629
|
const titleId = useId11("joinDialog__title");
|
|
3903
3630
|
const { height } = useVisualViewport();
|
|
3904
|
-
return /* @__PURE__ */
|
|
3631
|
+
return /* @__PURE__ */ React39.createElement(AlertDialog.Root, {
|
|
3905
3632
|
defaultOpen: true,
|
|
3906
3633
|
onOpenChange: (open) => open || (joinPanelProps.onExit ? joinPanelProps.onExit() : joinPanelProps.onDone?.(null))
|
|
3907
|
-
}, /* @__PURE__ */
|
|
3634
|
+
}, /* @__PURE__ */ React39.createElement(AlertDialog.Portal, null, /* @__PURE__ */ React39.createElement(AlertDialog.Overlay, {
|
|
3908
3635
|
classNames: "backdrop-blur",
|
|
3909
3636
|
...height && {
|
|
3910
3637
|
style: {
|
|
3911
3638
|
blockSize: `${height}px`
|
|
3912
3639
|
}
|
|
3913
3640
|
}
|
|
3914
|
-
}, /* @__PURE__ */
|
|
3641
|
+
}, /* @__PURE__ */ React39.createElement(AlertDialog.Content, {
|
|
3915
3642
|
"aria-labelledby": titleId
|
|
3916
|
-
}, /* @__PURE__ */
|
|
3643
|
+
}, /* @__PURE__ */ React39.createElement(JoinPanel, {
|
|
3917
3644
|
...joinPanelProps,
|
|
3918
3645
|
titleId,
|
|
3919
|
-
exitActionParent: /* @__PURE__ */
|
|
3646
|
+
exitActionParent: /* @__PURE__ */ React39.createElement(AlertDialog.Cancel, {
|
|
3920
3647
|
asChild: true
|
|
3921
3648
|
}),
|
|
3922
|
-
doneActionParent: /* @__PURE__ */
|
|
3649
|
+
doneActionParent: /* @__PURE__ */ React39.createElement(AlertDialog.Action, {
|
|
3923
3650
|
asChild: true
|
|
3924
3651
|
})
|
|
3925
3652
|
})))));
|
|
3926
3653
|
};
|
|
3927
3654
|
|
|
3928
3655
|
// packages/sdk/shell/src/composites/Shell/run-shell.tsx
|
|
3929
|
-
import
|
|
3656
|
+
import React43, { StrictMode } from "react";
|
|
3930
3657
|
import { createRoot } from "react-dom/client";
|
|
3931
3658
|
import { DEFAULT_CLIENT_CHANNEL, DEFAULT_SHELL_CHANNEL } from "@dxos/client-protocol";
|
|
3932
3659
|
import { AgentHostingProvider, ClientProvider, ClientServicesProxy, Config, ShellDisplay as ShellDisplay2 } from "@dxos/react-client";
|
|
3933
|
-
import { Button as
|
|
3660
|
+
import { Button as Button8, Clipboard as Clipboard5, Dialog as Dialog3, ThemeProvider, Tooltip as Tooltip4, useTranslation as useTranslation23 } from "@dxos/react-ui";
|
|
3934
3661
|
import { defaultTx } from "@dxos/react-ui-theme";
|
|
3935
3662
|
import { createIFramePort } from "@dxos/rpc-tunnel";
|
|
3936
3663
|
|
|
3937
3664
|
// packages/sdk/shell/src/composites/Shell/Shell.tsx
|
|
3938
|
-
import
|
|
3665
|
+
import React42, { useEffect as useEffect8, useState as useState10 } from "react";
|
|
3939
3666
|
import { log as log15 } from "@dxos/log";
|
|
3940
3667
|
import { useClient as useClient9 } from "@dxos/react-client";
|
|
3941
3668
|
import { ShellDisplay, ShellLayout } from "@dxos/react-client";
|
|
3942
3669
|
import { useSpace as useSpace2 } from "@dxos/react-client/echo";
|
|
3943
3670
|
|
|
3944
3671
|
// packages/sdk/shell/src/composites/SpaceDialog/SpaceDialog.tsx
|
|
3945
|
-
import
|
|
3672
|
+
import React40 from "react";
|
|
3946
3673
|
import { Clipboard as Clipboard4, Dialog as Dialog2, useId as useId12 } from "@dxos/react-ui";
|
|
3947
3674
|
var SpaceDialog = (spacePanelProps) => {
|
|
3948
3675
|
const titleId = useId12("spaceDialog__title");
|
|
3949
|
-
return /* @__PURE__ */
|
|
3676
|
+
return /* @__PURE__ */ React40.createElement(Dialog2.Root, {
|
|
3950
3677
|
defaultOpen: true,
|
|
3951
3678
|
onOpenChange: (open) => open || spacePanelProps.onDone?.()
|
|
3952
|
-
}, /* @__PURE__ */
|
|
3679
|
+
}, /* @__PURE__ */ React40.createElement(Dialog2.Portal, null, /* @__PURE__ */ React40.createElement(Dialog2.Overlay, null, /* @__PURE__ */ React40.createElement(Dialog2.Content, {
|
|
3953
3680
|
"aria-labelledby": titleId
|
|
3954
|
-
}, /* @__PURE__ */
|
|
3681
|
+
}, /* @__PURE__ */ React40.createElement(Clipboard4.Provider, null, /* @__PURE__ */ React40.createElement(SpacePanel, {
|
|
3955
3682
|
...spacePanelProps,
|
|
3956
3683
|
titleId,
|
|
3957
|
-
doneActionParent: /* @__PURE__ */
|
|
3684
|
+
doneActionParent: /* @__PURE__ */ React40.createElement(Dialog2.Close, {
|
|
3958
3685
|
asChild: true
|
|
3959
3686
|
})
|
|
3960
3687
|
}))))));
|
|
3961
3688
|
};
|
|
3962
3689
|
|
|
3963
3690
|
// packages/sdk/shell/src/composites/StatusDialog/StatusDialog.tsx
|
|
3964
|
-
import
|
|
3691
|
+
import React41 from "react";
|
|
3965
3692
|
import { AlertDialog as AlertDialog2, useId as useId13 } from "@dxos/react-ui";
|
|
3966
3693
|
var StatusDialog = () => {
|
|
3967
3694
|
const titleId = useId13("statusDialog__title");
|
|
3968
|
-
return /* @__PURE__ */
|
|
3695
|
+
return /* @__PURE__ */ React41.createElement(AlertDialog2.Root, {
|
|
3969
3696
|
open: true
|
|
3970
|
-
}, /* @__PURE__ */
|
|
3697
|
+
}, /* @__PURE__ */ React41.createElement(AlertDialog2.Portal, null, /* @__PURE__ */ React41.createElement(AlertDialog2.Overlay, null, /* @__PURE__ */ React41.createElement(AlertDialog2.Content, {
|
|
3971
3698
|
"aria-labelledby": titleId
|
|
3972
|
-
}, /* @__PURE__ */
|
|
3699
|
+
}, /* @__PURE__ */ React41.createElement(StatusPanel, {
|
|
3973
3700
|
titleId
|
|
3974
3701
|
})))));
|
|
3975
3702
|
};
|
|
@@ -3978,14 +3705,14 @@ var StatusDialog = () => {
|
|
|
3978
3705
|
var __dxlog_file14 = "/home/runner/work/dxos/dxos/packages/sdk/shell/src/composites/Shell/Shell.tsx";
|
|
3979
3706
|
var blurActiveElement = () => document.activeElement?.blur?.();
|
|
3980
3707
|
var Shell = ({ runtime }) => {
|
|
3981
|
-
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] =
|
|
3708
|
+
const [{ layout, invitationCode, spaceKey, spaceId, target }, setLayout] = useState10({
|
|
3982
3709
|
layout: runtime.layout,
|
|
3983
3710
|
invitationCode: runtime.invitationCode,
|
|
3984
3711
|
spaceKey: runtime.spaceKey,
|
|
3985
3712
|
spaceId: runtime.spaceId,
|
|
3986
3713
|
target: runtime.target
|
|
3987
3714
|
});
|
|
3988
|
-
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] =
|
|
3715
|
+
const [{ invitationUrl, deviceInvitationParam, spaceInvitationParam }, setInvitationUrl] = useState10({
|
|
3989
3716
|
invitationUrl: runtime.invitationUrl,
|
|
3990
3717
|
deviceInvitationParam: runtime.deviceInvitationParam,
|
|
3991
3718
|
spaceInvitationParam: runtime.spaceInvitationParam
|
|
@@ -4037,11 +3764,11 @@ var Shell = ({ runtime }) => {
|
|
|
4037
3764
|
]);
|
|
4038
3765
|
switch (layout) {
|
|
4039
3766
|
case ShellLayout.STATUS:
|
|
4040
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ React42.createElement(StatusDialog, null);
|
|
4041
3768
|
case ShellLayout.INITIALIZE_IDENTITY:
|
|
4042
3769
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION:
|
|
4043
3770
|
case ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY:
|
|
4044
|
-
return /* @__PURE__ */
|
|
3771
|
+
return /* @__PURE__ */ React42.createElement(JoinDialog, {
|
|
4045
3772
|
mode: "halo-only",
|
|
4046
3773
|
initialDisposition: layout === ShellLayout.INITIALIZE_IDENTITY_FROM_RECOVERY ? "recover-identity" : layout === ShellLayout.INITIALIZE_IDENTITY_FROM_INVITATION ? "accept-halo-invitation" : "default",
|
|
4047
3774
|
initialInvitationCode: invitationCode,
|
|
@@ -4061,7 +3788,7 @@ var Shell = ({ runtime }) => {
|
|
|
4061
3788
|
case ShellLayout.IDENTITY:
|
|
4062
3789
|
case ShellLayout.SHARE_IDENTITY:
|
|
4063
3790
|
case ShellLayout.EDIT_PROFILE:
|
|
4064
|
-
return /* @__PURE__ */
|
|
3791
|
+
return /* @__PURE__ */ React42.createElement(IdentityDialog, {
|
|
4065
3792
|
createInvitationUrl: createDeviceInvitationUrl,
|
|
4066
3793
|
onResetStorage: async () => {
|
|
4067
3794
|
runtime.setLayout({
|
|
@@ -4107,7 +3834,7 @@ var Shell = ({ runtime }) => {
|
|
|
4107
3834
|
initialDisposition: layout === ShellLayout.SHARE_IDENTITY ? "manage-device-invitation" : "default"
|
|
4108
3835
|
});
|
|
4109
3836
|
case ShellLayout.SPACE:
|
|
4110
|
-
return space ? /* @__PURE__ */
|
|
3837
|
+
return space ? /* @__PURE__ */ React42.createElement(SpaceDialog, {
|
|
4111
3838
|
space,
|
|
4112
3839
|
target,
|
|
4113
3840
|
createInvitationUrl: createSpaceInvitationUrl,
|
|
@@ -4122,7 +3849,7 @@ var Shell = ({ runtime }) => {
|
|
|
4122
3849
|
}
|
|
4123
3850
|
}) : null;
|
|
4124
3851
|
case ShellLayout.JOIN_SPACE:
|
|
4125
|
-
return /* @__PURE__ */
|
|
3852
|
+
return /* @__PURE__ */ React42.createElement(JoinDialog, {
|
|
4126
3853
|
initialInvitationCode: invitationCode,
|
|
4127
3854
|
onDone: async (result) => {
|
|
4128
3855
|
blurActiveElement();
|
|
@@ -4429,25 +4156,25 @@ var runShell = async (config = new Config()) => {
|
|
|
4429
4156
|
const services = new ClientServicesProxy(createIFramePort({
|
|
4430
4157
|
channel: DEFAULT_CLIENT_CHANNEL
|
|
4431
4158
|
}));
|
|
4432
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4159
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React43.createElement(StrictMode, null, /* @__PURE__ */ React43.createElement(ThemeProvider, {
|
|
4433
4160
|
tx: defaultTx,
|
|
4434
4161
|
resourceExtensions: [
|
|
4435
4162
|
osTranslations
|
|
4436
4163
|
]
|
|
4437
|
-
}, /* @__PURE__ */
|
|
4164
|
+
}, /* @__PURE__ */ React43.createElement(ClientProvider, {
|
|
4438
4165
|
config,
|
|
4439
4166
|
services,
|
|
4440
4167
|
noBanner: true
|
|
4441
|
-
}, /* @__PURE__ */
|
|
4168
|
+
}, /* @__PURE__ */ React43.createElement(Clipboard5.Provider, null, /* @__PURE__ */ React43.createElement(Tooltip4.Provider, null, /* @__PURE__ */ React43.createElement(AgentHostingProvider, null, /* @__PURE__ */ React43.createElement(Shell, {
|
|
4442
4169
|
runtime
|
|
4443
4170
|
}))))))));
|
|
4444
4171
|
} catch {
|
|
4445
|
-
createRoot(document.getElementById("root")).render(/* @__PURE__ */
|
|
4172
|
+
createRoot(document.getElementById("root")).render(/* @__PURE__ */ React43.createElement(StrictMode, null, /* @__PURE__ */ React43.createElement(ThemeProvider, {
|
|
4446
4173
|
tx: defaultTx,
|
|
4447
4174
|
resourceExtensions: [
|
|
4448
4175
|
osTranslations
|
|
4449
4176
|
]
|
|
4450
|
-
}, /* @__PURE__ */
|
|
4177
|
+
}, /* @__PURE__ */ React43.createElement(Fallback, {
|
|
4451
4178
|
onClose: () => runtime.setAppContext({
|
|
4452
4179
|
display: ShellDisplay2.NONE
|
|
4453
4180
|
})
|
|
@@ -4455,24 +4182,24 @@ var runShell = async (config = new Config()) => {
|
|
|
4455
4182
|
}
|
|
4456
4183
|
};
|
|
4457
4184
|
var Fallback = ({ onClose }) => {
|
|
4458
|
-
const { t } =
|
|
4459
|
-
return /* @__PURE__ */
|
|
4185
|
+
const { t } = useTranslation23("os");
|
|
4186
|
+
return /* @__PURE__ */ React43.createElement(Dialog3.Root, {
|
|
4460
4187
|
modal: true,
|
|
4461
4188
|
open: true,
|
|
4462
4189
|
onOpenChange: () => onClose?.()
|
|
4463
|
-
}, /* @__PURE__ */
|
|
4190
|
+
}, /* @__PURE__ */ React43.createElement(Dialog3.Overlay, null, /* @__PURE__ */ React43.createElement(Dialog3.Content, null, /* @__PURE__ */ React43.createElement(Dialog3.Title, null, t("shell fallback title")), /* @__PURE__ */ React43.createElement(Dialog3.Close, {
|
|
4464
4191
|
asChild: true,
|
|
4465
4192
|
onClick: () => onClose?.()
|
|
4466
|
-
}, /* @__PURE__ */
|
|
4193
|
+
}, /* @__PURE__ */ React43.createElement(Button8, {
|
|
4467
4194
|
variant: "primary"
|
|
4468
4195
|
}, t("close label"))))));
|
|
4469
4196
|
};
|
|
4470
4197
|
|
|
4471
4198
|
// packages/sdk/shell/src/composites/Shell/ShellContext.tsx
|
|
4472
|
-
import
|
|
4199
|
+
import React44, { createContext, useCallback as useCallback8, useContext, useEffect as useEffect9, useMemo as useMemo6, useState as useState11 } from "react";
|
|
4473
4200
|
import { useClient as useClient10, ShellDisplay as ShellDisplay3, ShellLayout as ShellLayout4 } from "@dxos/react-client";
|
|
4474
4201
|
import { useIdentity as useIdentity3 } from "@dxos/react-client/halo";
|
|
4475
|
-
import { mx as
|
|
4202
|
+
import { mx as mx23 } from "@dxos/react-ui-theme";
|
|
4476
4203
|
|
|
4477
4204
|
// packages/sdk/shell/src/composites/Shell/memory-shell-runtime.ts
|
|
4478
4205
|
import { Event as Event2 } from "@dxos/async";
|
|
@@ -4550,7 +4277,7 @@ var useShell = () => {
|
|
|
4550
4277
|
var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoinedSpace, children }) => {
|
|
4551
4278
|
const client = useClient10();
|
|
4552
4279
|
const identity = useIdentity3();
|
|
4553
|
-
const [display, setDisplay] =
|
|
4280
|
+
const [display, setDisplay] = useState11(!identity || spaceInvitationCode || deviceInvitationCode ? ShellDisplay3.FULLSCREEN : ShellDisplay3.NONE);
|
|
4554
4281
|
const shellRuntime = useMemo6(() => {
|
|
4555
4282
|
if (client.config.get("runtime.app.env.DX_VAULT") !== "false") {
|
|
4556
4283
|
return;
|
|
@@ -4620,11 +4347,11 @@ var ShellProvider = ({ space, deviceInvitationCode, spaceInvitationCode, onJoine
|
|
|
4620
4347
|
}, [
|
|
4621
4348
|
shellRuntime
|
|
4622
4349
|
]);
|
|
4623
|
-
return /* @__PURE__ */
|
|
4624
|
-
className:
|
|
4625
|
-
}, /* @__PURE__ */
|
|
4350
|
+
return /* @__PURE__ */ React44.createElement(React44.Fragment, null, shellRuntime && /* @__PURE__ */ React44.createElement("div", {
|
|
4351
|
+
className: mx23(display === ShellDisplay3.NONE ? "hidden" : "")
|
|
4352
|
+
}, /* @__PURE__ */ React44.createElement(Shell, {
|
|
4626
4353
|
runtime: shellRuntime
|
|
4627
|
-
})), /* @__PURE__ */
|
|
4354
|
+
})), /* @__PURE__ */ React44.createElement(ShellContext.Provider, {
|
|
4628
4355
|
value: {
|
|
4629
4356
|
runtime: shellRuntime,
|
|
4630
4357
|
setDisplay
|
|
@@ -4644,11 +4371,7 @@ export {
|
|
|
4644
4371
|
ConfirmResetImpl,
|
|
4645
4372
|
DeviceList,
|
|
4646
4373
|
Emoji,
|
|
4647
|
-
EmojiPickerBlock,
|
|
4648
|
-
EmojiPickerToolbarButton,
|
|
4649
4374
|
Heading,
|
|
4650
|
-
HuePickerBlock,
|
|
4651
|
-
HuePickerToolbarButton,
|
|
4652
4375
|
IdentityDialog,
|
|
4653
4376
|
IdentityListItem,
|
|
4654
4377
|
IdentityPanel,
|