@dxos/shell 0.4.10-main.fd4f2a3 → 0.4.10-next.71cec10

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.
Files changed (145) hide show
  1. package/dist/bundle/index-Cms4wG79.mjs +110 -0
  2. package/dist/bundle/index-Cms4wG79.mjs.map +1 -0
  3. package/dist/bundle/index-DACjPI-n.mjs +96625 -0
  4. package/dist/bundle/index-DACjPI-n.mjs.map +1 -0
  5. package/dist/bundle/shell.mjs +9 -81827
  6. package/dist/bundle/shell.mjs.map +1 -1
  7. package/dist/bundle/shell.umd.js +152 -89
  8. package/dist/bundle/shell.umd.js.map +1 -1
  9. package/dist/bundle/style.css +1 -1
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/react.mjs +862 -821
  12. package/dist/lib/browser/react.mjs.map +4 -4
  13. package/dist/lib/browser/testing/index.mjs +7 -4
  14. package/dist/lib/browser/testing/index.mjs.map +3 -3
  15. package/dist/types/src/components/AgentConfig.d.ts +3 -0
  16. package/dist/types/src/components/AgentConfig.d.ts.map +1 -0
  17. package/dist/types/src/components/AgentConfig.js +37 -0
  18. package/dist/types/src/components/AgentConfig.js.map +1 -0
  19. package/dist/types/src/components/DeviceList/DeviceList.d.ts +3 -0
  20. package/dist/types/src/components/DeviceList/DeviceList.d.ts.map +1 -0
  21. package/dist/types/src/components/DeviceList/DeviceList.js +29 -0
  22. package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -0
  23. package/dist/types/src/components/DeviceList/DeviceListItem.d.ts +6 -0
  24. package/dist/types/src/components/DeviceList/DeviceListItem.d.ts.map +1 -0
  25. package/dist/types/src/components/DeviceList/DeviceListItem.js +72 -0
  26. package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -0
  27. package/dist/types/src/components/DeviceList/DeviceListProps.d.ts +27 -0
  28. package/dist/types/src/components/DeviceList/DeviceListProps.d.ts.map +1 -0
  29. package/dist/types/src/components/DeviceList/DeviceListProps.js +6 -0
  30. package/dist/types/src/components/DeviceList/DeviceListProps.js.map +1 -0
  31. package/dist/types/src/components/DeviceList/index.d.ts +3 -0
  32. package/dist/types/src/components/DeviceList/index.d.ts.map +1 -0
  33. package/dist/types/src/components/DeviceList/index.js +22 -0
  34. package/dist/types/src/components/DeviceList/index.js.map +1 -0
  35. package/dist/types/src/components/EmojiPicker.d.ts +9 -2
  36. package/dist/types/src/components/EmojiPicker.d.ts.map +1 -1
  37. package/dist/types/src/components/EmojiPicker.js +57 -3
  38. package/dist/types/src/components/EmojiPicker.js.map +1 -1
  39. package/dist/types/src/components/HuePicker.d.ts +9 -2
  40. package/dist/types/src/components/HuePicker.d.ts.map +1 -1
  41. package/dist/types/src/components/HuePicker.js +75 -6
  42. package/dist/types/src/components/HuePicker.js.map +1 -1
  43. package/dist/types/src/components/IdentityList/index.d.ts +0 -1
  44. package/dist/types/src/components/IdentityList/index.d.ts.map +1 -1
  45. package/dist/types/src/components/IdentityList/index.js +0 -1
  46. package/dist/types/src/components/IdentityList/index.js.map +1 -1
  47. package/dist/types/src/components/InvitationList/InvitationListItem.js +5 -5
  48. package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
  49. package/dist/types/src/components/Panel/Action.d.ts +2 -2
  50. package/dist/types/src/components/Viewport/Viewport.d.ts +1 -1
  51. package/dist/types/src/components/index.d.ts +2 -0
  52. package/dist/types/src/components/index.d.ts.map +1 -1
  53. package/dist/types/src/components/index.js +2 -0
  54. package/dist/types/src/components/index.js.map +1 -1
  55. package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
  56. package/dist/types/src/composites/Shell/Shell.js +1 -5
  57. package/dist/types/src/composites/Shell/Shell.js.map +1 -1
  58. package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
  59. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +80 -40
  60. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
  61. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +0 -3
  62. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
  63. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +1 -43
  64. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
  65. package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +8 -11
  66. package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
  67. package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +1 -1
  68. package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
  69. package/dist/types/src/panels/IdentityPanel/identityMachine.js +0 -24
  70. package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
  71. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +4 -4
  72. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
  73. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +9 -43
  74. package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
  75. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +1 -1
  76. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
  77. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +2 -2
  78. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
  79. package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +0 -2
  80. package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
  81. package/dist/types/src/panels/IdentityPanel/steps/index.js +0 -2
  82. package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
  83. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
  84. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +5 -1
  85. package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -1
  86. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
  87. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +3 -1
  88. package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
  89. package/dist/types/src/playwright/invitations.spec.js +3 -1
  90. package/dist/types/src/playwright/invitations.spec.js.map +1 -1
  91. package/dist/types/src/steps/InvitationManager.d.ts +1 -1
  92. package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
  93. package/dist/types/src/steps/InvitationManager.js +3 -4
  94. package/dist/types/src/steps/InvitationManager.js.map +1 -1
  95. package/dist/types/src/stories/Invitations.e2e-stories.d.ts.map +1 -1
  96. package/dist/types/src/stories/Invitations.e2e-stories.js +5 -2
  97. package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -1
  98. package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
  99. package/dist/types/src/testing/shell-manager.js +7 -4
  100. package/dist/types/src/testing/shell-manager.js.map +1 -1
  101. package/dist/types/src/translations/locales/en-US.d.ts +12 -2
  102. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  103. package/dist/types/src/translations/locales/en-US.js +12 -2
  104. package/dist/types/src/translations/locales/en-US.js.map +1 -1
  105. package/package.json +22 -21
  106. package/src/components/AgentConfig.tsx +66 -0
  107. package/src/components/DeviceList/DeviceList.tsx +54 -0
  108. package/src/components/DeviceList/DeviceListItem.tsx +120 -0
  109. package/src/components/DeviceList/DeviceListProps.ts +33 -0
  110. package/src/components/DeviceList/index.ts +6 -0
  111. package/src/components/EmojiPicker.tsx +101 -4
  112. package/src/components/HuePicker.tsx +99 -5
  113. package/src/components/IdentityList/index.ts +0 -1
  114. package/src/components/InvitationList/InvitationListItem.tsx +5 -5
  115. package/src/components/index.ts +2 -0
  116. package/src/composites/Shell/Shell.tsx +1 -7
  117. package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +0 -63
  118. package/src/panels/IdentityPanel/IdentityPanel.tsx +123 -34
  119. package/src/panels/IdentityPanel/IdentityPanelProps.ts +10 -14
  120. package/src/panels/IdentityPanel/identityMachine.ts +1 -31
  121. package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +23 -76
  122. package/src/panels/IdentityPanel/steps/ProfileForm.tsx +12 -4
  123. package/src/panels/IdentityPanel/steps/index.ts +0 -2
  124. package/src/panels/IdentityPanel/useAgentHandlers.ts +5 -1
  125. package/src/panels/SpacePanel/steps/SpaceManager.tsx +3 -1
  126. package/src/playwright/invitations.spec.ts +3 -1
  127. package/src/steps/InvitationManager.tsx +4 -4
  128. package/src/stories/Invitations.e2e-stories.tsx +6 -3
  129. package/src/testing/shell-manager.ts +7 -4
  130. package/src/translations/locales/en-US.ts +13 -2
  131. package/dist/types/src/components/IdentityList/DeviceList.d.ts +0 -7
  132. package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +0 -1
  133. package/dist/types/src/components/IdentityList/DeviceList.js +0 -34
  134. package/dist/types/src/components/IdentityList/DeviceList.js.map +0 -1
  135. package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts +0 -3
  136. package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts.map +0 -1
  137. package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js +0 -26
  138. package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js.map +0 -1
  139. package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts +0 -10
  140. package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts.map +0 -1
  141. package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js +0 -23
  142. package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js.map +0 -1
  143. package/src/components/IdentityList/DeviceList.tsx +0 -49
  144. package/src/panels/IdentityPanel/steps/AgentForm.tsx +0 -61
  145. package/src/panels/IdentityPanel/steps/DeviceManager.tsx +0 -41
@@ -6,7 +6,7 @@ import { Check, X } from '@phosphor-icons/react';
6
6
  import React, { useMemo } from 'react';
7
7
  import { QR } from 'react-qr-rounded';
8
8
 
9
- import { type InvitationStatus, Invitation } from '@dxos/react-client/invitations';
9
+ import { type InvitationStatus } from '@dxos/react-client/invitations';
10
10
  import { useId, useTranslation } from '@dxos/react-ui';
11
11
  import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
12
12
  import { hexToEmoji } from '@dxos/util';
@@ -43,13 +43,13 @@ export const InvitationManager = ({
43
43
  active,
44
44
  send,
45
45
  status,
46
- type,
46
+ multiUse,
47
47
  authCode,
48
48
  id = '0',
49
49
  }: InvitationManagerProps) => {
50
50
  const { t } = useTranslation('os');
51
51
  const qrLabel = useId('invitation-manager__qr-code');
52
- const statusValue = type === Invitation.Type.MULTIUSE ? 0 : invitationStatusValue.get(status!) ?? 0;
52
+ const statusValue = multiUse ? 0 : invitationStatusValue.get(status!) ?? 0;
53
53
  const showAuthCode = statusValue === 3;
54
54
  const emoji = hexToEmoji(id);
55
55
  const activeView = useMemo(() => {
@@ -69,7 +69,7 @@ export const InvitationManager = ({
69
69
  <Viewport.Views>
70
70
  <InvitationManagerView id='showing qr' emoji={emoji}>
71
71
  <p className='text-sm mlb-1 font-normal text-center'>
72
- {t(type === Invitation.Type.MULTIUSE ? 'invite many qr label' : 'invite one qr label')}
72
+ {t(multiUse ? 'invite many qr label' : 'invite one qr label')}
73
73
  </p>
74
74
  <div role='none' className={mx(descriptionText, 'is-full max-is-[14rem] relative')}>
75
75
  <QR
@@ -10,7 +10,7 @@ import React, { useMemo, useState } from 'react';
10
10
  import { log } from '@dxos/log';
11
11
  import { faker } from '@dxos/random';
12
12
  import { useClient } from '@dxos/react-client';
13
- import { type Space, type SpaceMember, SpaceProxy, useSpaces } from '@dxos/react-client/echo';
13
+ import { type Space, type SpaceMember, useSpaces } from '@dxos/react-client/echo';
14
14
  import { useIdentity } from '@dxos/react-client/halo';
15
15
  import { Invitation, InvitationEncoder } from '@dxos/react-client/invitations';
16
16
  import { ConnectionState, useNetworkStatus } from '@dxos/react-client/mesh';
@@ -36,7 +36,7 @@ const Panel = ({ id, panel, setPanel }: { id: number; panel?: PanelType; setPane
36
36
  const spaces = useSpaces();
37
37
 
38
38
  useMemo(() => {
39
- if (panel instanceof SpaceProxy) {
39
+ if (panel && typeof panel !== 'string') {
40
40
  (window as any)[`peer${id}CreateSpaceInvitation`] = (options?: Partial<Invitation>) => {
41
41
  const invitation = panel.share(options);
42
42
 
@@ -50,7 +50,7 @@ const Panel = ({ id, panel, setPanel }: { id: number; panel?: PanelType; setPane
50
50
  }
51
51
  }, [panel]);
52
52
 
53
- if (panel instanceof SpaceProxy) {
53
+ if (panel && typeof panel !== 'string') {
54
54
  return <SpacePanel space={panel} createInvitationUrl={createInvitationUrl} />;
55
55
  }
56
56
 
@@ -216,6 +216,9 @@ const Invitations = (args: { id: number; count: number }) => {
216
216
  );
217
217
  };
218
218
 
219
+ // TODO(wittjosiah): This story fails to start in Safari/Webkit.
220
+ // The issue appears to be related to dynamic imports during client initialization.
221
+ // This does not seem to be a problem in other browsers nor in Safari in the app.
219
222
  export const Default = {
220
223
  render: (args: { id: number }) => (
221
224
  <ClipboardProvider>
@@ -65,15 +65,17 @@ export class ShellManager extends ScopedShellManager {
65
65
  };
66
66
 
67
67
  this.page.on('dialog', handleDialog);
68
- await this.shell.getByTestId('devices-panel.sign-out').click();
68
+ await this.shell.getByTestId('device-list-item-current.options').click();
69
+ await this.shell.getByTestId('device-list-item-current.reset').click();
69
70
  await this.shell.getByTestId('reset-storage.reset-identity-input').fill('CONFIRM');
70
71
  await this.shell.getByTestId('reset-storage.reset-identity-confirm').click();
71
72
  }
72
73
 
73
74
  async joinNewIdentity(invitationCode: string) {
74
- await this.shell.getByTestId('devices-panel.join-new-identity').click();
75
+ await this.shell.getByTestId('device-list-item-current.options').click();
76
+ await this.shell.getByTestId('device-list-item-current.join-existing').click();
75
77
  await this.shell.getByTestId('join-new-identity.reset-identity-input').fill('CONFIRM');
76
- await this.shell.getByTestId('join-new-identity.reset-identity-input-confirm').click();
78
+ await this.shell.getByTestId('join-new-identity.reset-identity-confirm').click();
77
79
  await this.inputInvitation('device', invitationCode, this.shell);
78
80
  }
79
81
 
@@ -115,7 +117,8 @@ export class ShellManager extends ScopedShellManager {
115
117
 
116
118
  private async _onConsoleMessage(message: ConsoleMessage) {
117
119
  try {
118
- const json = JSON.parse(message.text());
120
+ const text = message.text();
121
+ const json = JSON.parse(text.slice(text.indexOf('{')));
119
122
  if (json.invitationCode) {
120
123
  this._invitationCode.wake(json.invitationCode);
121
124
  }
@@ -45,8 +45,6 @@ export const os = {
45
45
  'connected status label': 'Enter confirmation PIN',
46
46
  'authenticating status label': 'Enter confirmation PIN',
47
47
  'success status label': 'Success',
48
- 'connect label': 'Connect',
49
- 'reconnect label': 'Reconnect',
50
48
  'cancel label': 'Cancel',
51
49
  'done label': 'Done',
52
50
  'reset label': 'Start over',
@@ -131,4 +129,17 @@ export const os = {
131
129
  'fuchsia label': 'Fuchsia',
132
130
  'pink label': 'Pink',
133
131
  'rose label': 'Rose',
132
+ 'current device tag label': 'This device',
133
+ 'device name placeholder': '{{platform}} on {{os}}',
134
+ 'more options label': 'More options',
135
+ 'disconnect label': 'Currently online. Click to go offline.',
136
+ 'connect label': 'Currently offline. Click to go online.',
137
+ 'edit device label': 'Edit device name & avatar',
138
+ 'agent heading': 'Agent',
139
+ 'agent message title': 'About creating an agent',
140
+ 'agent message body':
141
+ 'Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it’s always online your changes will sync even when all your physical devices are asleep.',
142
+ 'create agent label': 'Start an agent',
143
+ 'destroy agent label': 'Shut down agent',
144
+ 'agent device label': 'Your agent',
134
145
  };
@@ -1,7 +0,0 @@
1
- import { type Device } from '@dxos/react-client/halo';
2
- export interface DeviceListProps {
3
- devices: Device[];
4
- onSelect?: (device: Device) => void;
5
- }
6
- export declare const DeviceList: ({ devices, onSelect }: DeviceListProps) => JSX.Element;
7
- //# sourceMappingURL=DeviceList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceList.d.ts","sourceRoot":"","sources":["../../../../../src/components/IdentityList/DeviceList.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,yBAAyB,CAAC;AAMlE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,UAAU,0BAA2B,eAAe,gBA8BhE,CAAC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2023 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DeviceList = void 0;
10
- const react_1 = __importDefault(require("react"));
11
- const display_name_1 = require("@dxos/display-name");
12
- const halo_1 = require("@dxos/react-client/halo");
13
- const react_ui_1 = require("@dxos/react-ui");
14
- const react_ui_theme_1 = require("@dxos/react-ui-theme");
15
- const IdentityListItem_1 = require("./IdentityListItem");
16
- const DeviceList = ({ devices, onSelect }) => {
17
- const { t } = (0, react_ui_1.useTranslation)('os');
18
- return devices.length > 0 ? (react_1.default.createElement(react_ui_1.List, { classNames: 'flex flex-col gap-2' }, devices.map((device) => {
19
- var _a, _b;
20
- // TODO(wittjosiah): Render this better. Consider communicating these as apps rather than devices.
21
- const deviceType = ((_a = device.profile) === null || _a === void 0 ? void 0 : _a.type) || halo_1.DeviceType.UNKNOWN;
22
- const displayName = ((_b = device.profile) === null || _b === void 0 ? void 0 : _b.label)
23
- ? `${device.profile.label} (${halo_1.DeviceType[deviceType]})`
24
- : (0, display_name_1.generateName)(device.deviceKey.toHex());
25
- const identity = {
26
- identityKey: device.deviceKey,
27
- profile: { displayName },
28
- };
29
- return (react_1.default.createElement(IdentityListItem_1.IdentityListItem, { key: device.deviceKey.toHex(), identity: identity, presence: device.presence, onClick: onSelect && (() => onSelect(device)) }));
30
- }))) : (react_1.default.createElement("div", { role: 'none', className: 'grow flex items-center p-2' },
31
- react_1.default.createElement("p", { className: (0, react_ui_theme_1.mx)(react_ui_theme_1.descriptionText, 'text-center is-full') }, t('empty device list message'))));
32
- };
33
- exports.DeviceList = DeviceList;
34
- //# sourceMappingURL=DeviceList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceList.js","sourceRoot":"","sources":["../../../../../src/components/IdentityList/DeviceList.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,kDAA0B;AAE1B,qDAAkD;AAClD,kDAAkE;AAClE,6CAAsD;AACtD,yDAA2D;AAE3D,yDAAsD;AAO/C,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAmB,EAAE,EAAE;IACnE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC1B,8BAAC,eAAI,IAAC,UAAU,EAAC,qBAAqB,IACnC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;;QACtB,kGAAkG;QAClG,MAAM,UAAU,GAAG,CAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,IAAI,KAAI,iBAAU,CAAC,OAAO,CAAC;QAC9D,MAAM,WAAW,GAAG,CAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,KAAK;YACvC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,KAAK,iBAAU,CAAC,UAAU,CAAC,GAAG;YACvD,CAAC,CAAC,IAAA,2BAAY,EAAC,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAG;YACf,WAAW,EAAE,MAAM,CAAC,SAAS;YAC7B,OAAO,EAAE,EAAE,WAAW,EAAE;SACzB,CAAC;QACF,OAAO,CACL,8BAAC,mCAAgB,IACf,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,EAC7B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,OAAO,EAAE,QAAQ,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,GAC7C,CACH,CAAC;IACJ,CAAC,CAAC,CACG,CACR,CAAC,CAAC,CAAC,CACF,uCAAK,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,4BAA4B;QACrD,qCAAG,SAAS,EAAE,IAAA,mBAAE,EAAC,gCAAe,EAAE,qBAAqB,CAAC,IAAG,CAAC,CAAC,2BAA2B,CAAC,CAAK,CAC1F,CACP,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,UAAU,cA8BrB"}
@@ -1,3 +0,0 @@
1
- import { type AgentFormProps, type IdentityPanelStepProps } from '../IdentityPanelProps';
2
- export declare const AgentForm: (props: IdentityPanelStepProps & AgentFormProps) => JSX.Element;
3
- //# sourceMappingURL=AgentForm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentForm.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/AgentForm.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,eAAO,MAAM,SAAS,UAAW,sBAAsB,GAAG,cAAc,gBAiDvE,CAAC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2023 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.AgentForm = void 0;
10
- const react_1 = __importDefault(require("react"));
11
- const react_ui_1 = require("@dxos/react-ui");
12
- const components_1 = require("../../../components");
13
- const AgentForm = (props) => {
14
- const { active, onAgentCreate, onAgentDestroy, send, validationMessage, agentStatus, agentActive, agentProviderDisabled, } = props;
15
- const disabled = !active;
16
- const { t } = (0, react_ui_1.useTranslation)('os');
17
- return (react_1.default.createElement(react_1.default.Fragment, null,
18
- react_1.default.createElement("div", { role: 'none', className: 'grow flex flex-col justify-center' },
19
- react_1.default.createElement(components_1.Input, { validationMessage, label: react_1.default.createElement(components_1.StepHeading, null, "Agent Status"), disabled: disabled, "data-testid": 'agent-status', value: agentStatus })),
20
- react_1.default.createElement(components_1.Actions, null,
21
- react_1.default.createElement(components_1.Action, { disabled: agentActive || agentProviderDisabled, onClick: () => onAgentCreate === null || onAgentCreate === void 0 ? void 0 : onAgentCreate(), "data-testid": 'create-agent' }, "Create Agent"),
22
- react_1.default.createElement(components_1.Action, { disabled: !agentActive || agentProviderDisabled, onClick: () => onAgentDestroy === null || onAgentDestroy === void 0 ? void 0 : onAgentDestroy(), "data-testid": 'destroy-agent' }, "Destroy Agent"),
23
- react_1.default.createElement(components_1.Action, { disabled: disabled, onClick: () => send === null || send === void 0 ? void 0 : send({ type: 'unchooseAction' }), "data-testid": 'update-profile-form-back' }, t('back label')))));
24
- };
25
- exports.AgentForm = AgentForm;
26
- //# sourceMappingURL=AgentForm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AgentForm.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/AgentForm.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,kDAA0B;AAE1B,6CAAgD;AAEhD,oDAA0E;AAGnE,MAAM,SAAS,GAAG,CAAC,KAA8C,EAAE,EAAE;IAC1E,MAAM,EACJ,MAAM,EACN,aAAa,EACb,cAAc,EACd,IAAI,EACJ,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,qBAAqB,GACtB,GAAG,KAAK,CAAC;IACV,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC;IACzB,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC;IACnC,OAAO,CACL;QACE,uCAAK,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,mCAAmC;YAC5D,8BAAC,kBAAK,IACE,iBAAiB,EACvB,KAAK,EAAE,8BAAC,wBAAW,uBAA2B,EAC9C,QAAQ,EAAE,QAAQ,iBACN,cAAc,EAC1B,KAAK,EAAE,WAAW,GAClB,CACE;QACN,8BAAC,oBAAO;YACN,8BAAC,mBAAM,IACL,QAAQ,EAAE,WAAW,IAAI,qBAAqB,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,iBACnB,cAAc,mBAGpB;YACT,8BAAC,mBAAM,IACL,QAAQ,EAAE,CAAC,WAAW,IAAI,qBAAqB,EAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,EAAI,iBACpB,eAAe,oBAGrB;YACT,8BAAC,mBAAM,IACL,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,iBACpC,0BAA0B,IAEtC,CAAC,CAAC,YAAY,CAAC,CACT,CACD,CACT,CACJ,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,SAAS,aAiDpB"}
@@ -1,10 +0,0 @@
1
- import { type Event, type SingleOrArray } from 'xstate';
2
- import { type Device } from '@dxos/react-client/halo';
3
- import type { IdentityPanelStepProps } from '../IdentityPanelProps';
4
- import type { IdentityEvent } from '../identityMachine';
5
- export interface DeviceManagerProps extends Omit<IdentityPanelStepProps, 'send'> {
6
- send?: (event: SingleOrArray<Event<IdentityEvent>>) => void;
7
- devices: Device[];
8
- }
9
- export declare const DeviceManager: ({ devices, active, send }: DeviceManagerProps) => JSX.Element;
10
- //# sourceMappingURL=DeviceManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceManager.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/DeviceManager.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAExD,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;IAC9E,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,8BAA+B,kBAAkB,gBAqB1E,CAAC"}
@@ -1,23 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2023 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DeviceManager = void 0;
10
- const react_1 = __importDefault(require("react"));
11
- const react_ui_1 = require("@dxos/react-ui");
12
- const components_1 = require("../../../components");
13
- const DeviceManager = ({ devices, active, send }) => {
14
- const { t } = (0, react_ui_1.useTranslation)('os');
15
- const disabled = !active;
16
- return (react_1.default.createElement(react_1.default.Fragment, null,
17
- react_1.default.createElement("div", { role: 'none', className: 'grow' },
18
- react_1.default.createElement(components_1.DeviceList, { devices: devices })),
19
- react_1.default.createElement(components_1.Actions, null,
20
- react_1.default.createElement(components_1.Action, { variant: 'ghost', disabled: disabled, onClick: () => send === null || send === void 0 ? void 0 : send({ type: 'unchooseAction' }), "data-testid": 'manage-devices-back' }, t('back label')))));
21
- };
22
- exports.DeviceManager = DeviceManager;
23
- //# sourceMappingURL=DeviceManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DeviceManager.js","sourceRoot":"","sources":["../../../../../../src/panels/IdentityPanel/steps/DeviceManager.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,kDAA0B;AAI1B,6CAAgD;AAEhD,oDAAkE;AAS3D,MAAM,aAAa,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAsB,EAAE,EAAE;IAC7E,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,CAAC,MAAM,CAAC;IAEzB,OAAO,CACL;QACE,uCAAK,IAAI,EAAC,MAAM,EAAC,SAAS,EAAC,MAAM;YAC/B,8BAAC,uBAAU,IAAC,OAAO,EAAE,OAAO,GAAI,CAC5B;QACN,8BAAC,oBAAO;YACN,8BAAC,mBAAM,IACL,OAAO,EAAC,OAAO,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC,iBACpC,qBAAqB,IAEjC,CAAC,CAAC,YAAY,CAAC,CACT,CACD,CACT,CACJ,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,aAAa,iBAqBxB"}
@@ -1,49 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { generateName } from '@dxos/display-name';
8
- import { type Device, DeviceType } from '@dxos/react-client/halo';
9
- import { List, useTranslation } from '@dxos/react-ui';
10
- import { descriptionText, mx } from '@dxos/react-ui-theme';
11
-
12
- import { IdentityListItem } from './IdentityListItem';
13
-
14
- export interface DeviceListProps {
15
- devices: Device[];
16
- onSelect?: (device: Device) => void;
17
- }
18
-
19
- export const DeviceList = ({ devices, onSelect }: DeviceListProps) => {
20
- const { t } = useTranslation('os');
21
- return devices.length > 0 ? (
22
- <List classNames='flex flex-col gap-2'>
23
- {devices.map((device) => {
24
- // TODO(wittjosiah): Render this better. Consider communicating these as apps rather than devices.
25
- const deviceType = device.profile?.type || DeviceType.UNKNOWN;
26
- const displayName = device.profile?.label
27
- ? `${device.profile.label} (${DeviceType[deviceType]})`
28
- : generateName(device.deviceKey.toHex());
29
-
30
- const identity = {
31
- identityKey: device.deviceKey,
32
- profile: { displayName },
33
- };
34
- return (
35
- <IdentityListItem
36
- key={device.deviceKey.toHex()}
37
- identity={identity}
38
- presence={device.presence}
39
- onClick={onSelect && (() => onSelect(device))}
40
- />
41
- );
42
- })}
43
- </List>
44
- ) : (
45
- <div role='none' className='grow flex items-center p-2'>
46
- <p className={mx(descriptionText, 'text-center is-full')}>{t('empty device list message')}</p>
47
- </div>
48
- );
49
- };
@@ -1,61 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { useTranslation } from '@dxos/react-ui';
8
-
9
- import { Action, Actions, StepHeading, Input } from '../../../components';
10
- import { type AgentFormProps, type IdentityPanelStepProps } from '../IdentityPanelProps';
11
-
12
- export const AgentForm = (props: IdentityPanelStepProps & AgentFormProps) => {
13
- const {
14
- active,
15
- onAgentCreate,
16
- onAgentDestroy,
17
- send,
18
- validationMessage,
19
- agentStatus,
20
- agentActive,
21
- agentProviderDisabled,
22
- } = props;
23
- const disabled = !active;
24
- const { t } = useTranslation('os');
25
- return (
26
- <>
27
- <div role='none' className='grow flex flex-col justify-center'>
28
- <Input
29
- {...{ validationMessage }}
30
- label={<StepHeading>Agent Status</StepHeading>}
31
- disabled={disabled}
32
- data-testid='agent-status'
33
- value={agentStatus}
34
- />
35
- </div>
36
- <Actions>
37
- <Action
38
- disabled={agentActive || agentProviderDisabled}
39
- onClick={() => onAgentCreate?.()}
40
- data-testid={'create-agent'}
41
- >
42
- Create Agent
43
- </Action>
44
- <Action
45
- disabled={!agentActive || agentProviderDisabled}
46
- onClick={() => onAgentDestroy?.()}
47
- data-testid={'destroy-agent'}
48
- >
49
- Destroy Agent
50
- </Action>
51
- <Action
52
- disabled={disabled}
53
- onClick={() => send?.({ type: 'unchooseAction' })}
54
- data-testid={'update-profile-form-back'}
55
- >
56
- {t('back label')}
57
- </Action>
58
- </Actions>
59
- </>
60
- );
61
- };
@@ -1,41 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
- import { type Event, type SingleOrArray } from 'xstate';
7
-
8
- import { type Device } from '@dxos/react-client/halo';
9
- import { useTranslation } from '@dxos/react-ui';
10
-
11
- import { Action, Actions, DeviceList } from '../../../components';
12
- import type { IdentityPanelStepProps } from '../IdentityPanelProps';
13
- import type { IdentityEvent } from '../identityMachine';
14
-
15
- export interface DeviceManagerProps extends Omit<IdentityPanelStepProps, 'send'> {
16
- send?: (event: SingleOrArray<Event<IdentityEvent>>) => void;
17
- devices: Device[];
18
- }
19
-
20
- export const DeviceManager = ({ devices, active, send }: DeviceManagerProps) => {
21
- const { t } = useTranslation('os');
22
- const disabled = !active;
23
-
24
- return (
25
- <>
26
- <div role='none' className='grow'>
27
- <DeviceList devices={devices} />
28
- </div>
29
- <Actions>
30
- <Action
31
- variant='ghost'
32
- disabled={disabled}
33
- onClick={() => send?.({ type: 'unchooseAction' })}
34
- data-testid={'manage-devices-back'}
35
- >
36
- {t('back label')}
37
- </Action>
38
- </Actions>
39
- </>
40
- );
41
- };