@dxos/shell 0.3.11-main.4eab977 → 0.3.11-main.4faaf44
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 +36766 -0
- package/dist/bundle/shell.mjs.map +1 -0
- package/dist/bundle/shell.umd.js +210 -0
- package/dist/bundle/shell.umd.js.map +1 -0
- package/dist/bundle/style.css +1 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +712 -446
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs +35 -14
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/types/src/components/IdentityList/SpaceMemberList.js +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberList.js.map +1 -1
- package/dist/types/src/components/Panel/Action.d.ts.map +1 -1
- package/dist/types/src/components/Panel/Action.js +3 -18
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +15 -5
- package/dist/types/src/composites/Shell/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 +17 -9
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +12 -2
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +10 -2
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js +26 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +5 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts +16 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js +40 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +2 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +2 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts +15 -0
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +78 -0
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +4 -3
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +15 -18
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js +3 -3
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +13 -6
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +1 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +5 -3
- 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 +2 -2
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts +1 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +3 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts +1 -0
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.js +4 -1
- package/dist/types/src/playwright/invitations-manager.js.map +1 -1
- package/dist/types/src/playwright/invitations.spec.js +15 -0
- package/dist/types/src/playwright/invitations.spec.js.map +1 -1
- package/dist/types/src/testing/shell-manager.d.ts +5 -4
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +36 -12
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +5 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +5 -0
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +21 -20
- package/src/components/IdentityList/SpaceMemberList.tsx +1 -1
- package/src/components/Panel/Action.tsx +4 -19
- package/src/composites/Shell/Shell.tsx +16 -3
- package/src/panels/IdentityPanel/IdentityPanel.tsx +27 -11
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +20 -2
- package/src/panels/IdentityPanel/identityMachine.ts +11 -3
- package/src/panels/IdentityPanel/steps/AgentForm.tsx +61 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +8 -4
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +84 -0
- package/src/panels/IdentityPanel/steps/index.ts +2 -0
- package/src/panels/IdentityPanel/useAgentHandlers.ts +88 -0
- package/src/panels/JoinPanel/JoinPanel.tsx +2 -2
- package/src/panels/JoinPanel/joinMachine.ts +16 -19
- package/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx +3 -3
- package/src/panels/JoinPanel/steps/InvitationInput.tsx +7 -1
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +2 -1
- package/src/panels/SpacePanel/SpacePanel.tsx +4 -1
- package/src/panels/SpacePanel/SpacePanelProps.ts +1 -0
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +4 -1
- package/src/playwright/invitations-manager.ts +5 -1
- package/src/playwright/invitations.spec.ts +19 -0
- package/src/testing/shell-manager.ts +40 -13
- package/src/translations/locales/en-US.ts +5 -0
|
@@ -110,6 +110,9 @@ var ShellManager = class extends ScopedShellManager {
|
|
|
110
110
|
return this.inIFrame ? this.page.frameLocator("data-testid=dxos-shell") : this.page;
|
|
111
111
|
}
|
|
112
112
|
// Getters
|
|
113
|
+
async getDisplayName() {
|
|
114
|
+
return this.shell.getByTestId("identityHeading.displayName").textContent();
|
|
115
|
+
}
|
|
113
116
|
async isCurrentSpaceViewVisible() {
|
|
114
117
|
return await this.shell.getByTestId("current-space-view").isVisible();
|
|
115
118
|
}
|
|
@@ -123,24 +126,42 @@ var ShellManager = class extends ScopedShellManager {
|
|
|
123
126
|
await this.shell.getByTestId("create-identity-input-continue").click();
|
|
124
127
|
await this.shell.getByTestId("halo-invitation-accepted-done").click();
|
|
125
128
|
}
|
|
126
|
-
async
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
await this.page.keyboard.press("Meta+.");
|
|
132
|
-
}
|
|
133
|
-
async openSpaceList() {
|
|
134
|
-
await this.page.keyboard.press("Meta+Shift+>");
|
|
129
|
+
async createDeviceInvitation() {
|
|
130
|
+
this._invitationCode = new Trigger();
|
|
131
|
+
this._authCode = new Trigger();
|
|
132
|
+
await this.shell.getByTestId("devices-panel.create-invitation").click();
|
|
133
|
+
return await this._invitationCode.wait();
|
|
135
134
|
}
|
|
136
|
-
async
|
|
137
|
-
|
|
135
|
+
async resetDevice() {
|
|
136
|
+
const handleDialog = async (dialog) => {
|
|
137
|
+
if (dialog.type() === "confirm") {
|
|
138
|
+
await dialog.accept();
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
this.page.on("dialog", handleDialog);
|
|
142
|
+
await this.shell.getByTestId("devices-panel.sign-out").click();
|
|
143
|
+
await this.shell.getByTestId("sign-out.reset-device").click();
|
|
144
|
+
this.page.off("dialog", handleDialog);
|
|
145
|
+
}
|
|
146
|
+
async joinNewIdentity(invitationCode) {
|
|
147
|
+
await this.shell.getByTestId("devices-panel.sign-out").click();
|
|
148
|
+
await this.shell.getByTestId("sign-out.join-new-identity").click();
|
|
149
|
+
await this.shell.getByTestId("reset-identity-input").fill("CONFIRM");
|
|
150
|
+
await this.shell.getByTestId("reset-identity-input-confirm").click();
|
|
151
|
+
await this.shell.getByTestId("identity-chooser.join-identity").click();
|
|
152
|
+
await this.inputInvitation("device", invitationCode, this.shell);
|
|
153
|
+
}
|
|
154
|
+
async authenticateDevice(authCode, skipDone = true) {
|
|
155
|
+
await sleep(1500);
|
|
156
|
+
await this.authenticateInvitation("device", authCode, this.shell);
|
|
157
|
+
if (!skipDone) {
|
|
158
|
+
await this.doneInvitation("device", this.shell);
|
|
159
|
+
}
|
|
138
160
|
}
|
|
139
|
-
async
|
|
140
|
-
await this.
|
|
161
|
+
async closeShell() {
|
|
162
|
+
await this.page.keyboard.press("Escape");
|
|
141
163
|
}
|
|
142
164
|
async createSpaceInvitation() {
|
|
143
|
-
await this.openCurrentSpace();
|
|
144
165
|
this._invitationCode = new Trigger();
|
|
145
166
|
this._authCode = new Trigger();
|
|
146
167
|
await this.shell.getByTestId("spaces-panel.create-invitation").click();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/testing/fixtures/identities.ts", "../../../../src/testing/fixtures/invitations.ts", "../../../../src/testing/scoped-shell-manager.ts", "../../../../src/testing/shell-manager.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/react-client';\nimport { SpaceMember } from '@dxos/react-client/echo';\n\nexport const alice: SpaceMember = {\n identity: {\n identityKey: PublicKey.random(),\n profile: {\n displayName: 'Alice',\n },\n },\n presence: SpaceMember.PresenceState.ONLINE,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/react-client';\nimport { Invitation, CancellableInvitationObservable } from '@dxos/react-client/invitations';\n\nexport const inviteWithState = (state: Invitation.State) =>\n new CancellableInvitationObservable({\n initialInvitation: {\n state,\n invitationId: Math.random().toString(16).slice(2),\n kind: Invitation.Kind.SPACE,\n authMethod: Invitation.AuthMethod.NONE,\n swarmKey: PublicKey.random(),\n type: Invitation.Type.INTERACTIVE,\n authCode: [Invitation.State.READY_FOR_AUTHENTICATION, Invitation.State.AUTHENTICATING].includes(state)\n ? '123456'\n : '',\n },\n subscriber: () => {},\n onCancel: async () => {},\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Locator, Page, FrameLocator } from '@playwright/test';\n\ntype Scope = Locator | FrameLocator | Page;\n\nexport class ScopedShellManager {\n page!: Page;\n\n authenticatorIsVisible(type: 'device' | 'space', scope?: Scope) {\n return (scope || this.page).getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).isVisible();\n }\n\n async invitationFailed(scope?: Scope, timeout = 3000) {\n const peer = scope || this.page;\n try {\n await peer.locator('[data-testid=invitation-rescuer-reset]:not([disabled])').waitFor({ timeout });\n return true;\n } catch {\n return false;\n }\n }\n\n async inputInvitation(type: 'device' | 'space', invitation: string, scope?: Scope) {\n await (scope || this.page).getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-input`).fill(invitation);\n await this.page.keyboard.press('Enter');\n }\n\n async invitationInputContinue(type: 'device' | 'space', scope?: Scope) {\n await (scope || this.page).getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-input-continue`).click();\n }\n\n async cancelInvitation(type: 'device' | 'space', kind: 'host' | 'guest', scope?: Scope) {\n if (kind === 'guest') {\n await (scope || this.page)\n .getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-authenticator-cancel`)\n .click();\n } else {\n await (scope || this.page).getByTestId('cancel-invitation').nth(0).click();\n }\n }\n\n async readyToAuthenticate(type: 'device' | 'space', scope?: Scope, timeout = 3000) {\n const peer = scope || this.page;\n try {\n await peer\n .locator(`[data-testid=${type === 'device' ? 'halo' : 'space'}-auth-code-input]:not([disabled])`)\n .waitFor({ timeout });\n return true;\n } catch {\n return false;\n }\n }\n\n async authenticateInvitation(type: 'device' | 'space', authCode: string, scope?: Scope) {\n const peer = scope || this.page;\n // TODO(wittjosiah): Update ids.\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).fill(authCode);\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-authenticator-next`).click();\n }\n\n async clearAuthCode(type: 'device' | 'space', scope?: Scope) {\n const peer = scope || this.page;\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).fill('');\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).focus();\n }\n\n async resetInvitation(scope?: Scope) {\n await (scope || this.page).getByTestId('invitation-rescuer-reset').click();\n }\n\n async doneInvitation(type: 'device' | 'space', scope?: Scope) {\n await (scope || this.page)\n .getByTestId(type === 'device' ? 'halo-invitation-accepted-done' : 'space-invitation-accepted-done')\n .click();\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { ConsoleMessage, Page } from '@playwright/test';\n\nimport { sleep, Trigger } from '@dxos/async';\n\nimport { ScopedShellManager } from './scoped-shell-manager';\n\nexport class ShellManager extends ScopedShellManager {\n private _invitationCode = new Trigger<string>();\n private _authCode = new Trigger<string>();\n\n // prettier-ignore\n constructor(\n override readonly page: Page,\n readonly inIFrame = true,\n ) {\n super();\n this.page.on('console', (message) => this._onConsoleMessage(message));\n }\n\n get shell() {\n return this.inIFrame ? this.page.frameLocator('data-testid=dxos-shell') : this.page;\n }\n\n // Getters\n\n async isCurrentSpaceViewVisible(): Promise<boolean> {\n return await this.shell.getByTestId('current-space-view').isVisible();\n }\n\n async isSpaceListViewVisible(): Promise<boolean> {\n return await this.shell.getByTestId('space-list-view').isVisible();\n }\n\n // Actions\n\n async createIdentity(name: string) {\n await this.shell.getByTestId('create-identity').click();\n await this.page.keyboard.type(name);\n await this.shell.getByTestId('create-identity-input-continue').click();\n await this.shell.getByTestId('halo-invitation-accepted-done').click();\n }\n\n async
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,iBAAiB;AAC1B,SAASC,mBAAmB;AAErB,IAAMC,QAAqB;EAChCC,UAAU;IACRC,aAAaC,UAAUC,OAAM;IAC7BC,SAAS;MACPC,aAAa;IACf;EACF;EACAC,UAAUC,YAAYC,cAAcC;AACtC;;;ACXA,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,YAAYC,uCAAuC;AAErD,IAAMC,kBAAkB,CAACC,UAC9B,IAAIC,gCAAgC;EAClCC,mBAAmB;IACjBF;IACAG,cAAcC,KAAKC,OAAM,E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Y,mBAAA,EAAqBgB,IAAI,CAAA,EAAGH,MAAK;IAC1E;EACF;EAEA,MAAMI,oBAAoBpB,MAA0BC,OAAeK,UAAU,KAAM;AACjF,UAAMC,OAAON,SAAS,KAAKC;AAC3B,QAAI;AACF,YAAMK,KACHC,QAAQ,gBAAgBR,SAAS,WAAW,SAAS,OAAA,mCAA0C,EAC/FS,QAAQ;QAAEH;MAAQ,CAAA;AACrB,aAAO;IACT,QAAQ;AACN,aAAO;IACT;EACF;EAEA,MAAMe,uBAAuBrB,MAA0BsB,UAAkBrB,OAAe;AACtF,UAAMM,OAAON,SAAS,KAAKC;AAE3B,UAAMK,KAAKJ,YAAY,GAAGH,SAAS,WAAW,SAAS,OAAA,kBAAyB,EAAEY,KAAKU,QAAAA;AACvF,UAAMf,KAAKJ,YAAY,GAAGH,SAAS,WAAW,SAAS,OAAA,gCAAuC,EAAEgB,MAAK;EACvG;EAEA,MAAMO,cAAcvB,MAA0BC,OAAe;AAC3D,UAAMM,OAAON,SAAS,KAAKC;AAC3B,UAAMK,KAAKJ,YAAY,GAAGH,SAAS,WAAW,SAAS,OAAA,kBAAyB,EAAEY,KAAK,EAAA;AACvF,UAAML,KAAKJ,YAAY,GAAGH,SAAS,WAAW,SAAS,OAAA,kBAAyB,EAAEwB,MAAK;EACzF;EAEA,MAAMC,gBAAgBxB,OAAe;AACnC,WAAOA,SAAS,KAAKC,MAAMC,YAAY,0BAAA,EAA4Ba,MAAK;EAC1E;EAEA,MAAMU,eAAe1B,MAA0BC,OAAe;AAC5D,WAAOA,SAAS,KAAKC,MAClBC,YAAYH,SAAS,WAAW,kCAAkC,gCAAA,EAClEgB,MAAK;EACV;AACF;;;ACxEA,SAASW,OAAOC,eAAe;
|
|
6
|
-
"names": ["PublicKey", "SpaceMember", "alice", "identity", "identityKey", "PublicKey", "random", "profile", "displayName", "presence", "SpaceMember", "PresenceState", "ONLINE", "PublicKey", "Invitation", "CancellableInvitationObservable", "inviteWithState", "state", "CancellableInvitationObservable", "initialInvitation", "invitationId", "Math", "random", "toString", "slice", "kind", "Invitation", "Kind", "SPACE", "authMethod", "AuthMethod", "NONE", "swarmKey", "PublicKey", "type", "Type", "INTERACTIVE", "authCode", "State", "READY_FOR_AUTHENTICATION", "AUTHENTICATING", "includes", "subscriber", "onCancel", "ScopedShellManager", "authenticatorIsVisible", "type", "scope", "page", "getByTestId", "isVisible", "invitationFailed", "timeout", "peer", "locator", "waitFor", "inputInvitation", "invitation", "fill", "keyboard", "press", "invitationInputContinue", "click", "cancelInvitation", "kind", "nth", "readyToAuthenticate", "authenticateInvitation", "authCode", "clearAuthCode", "focus", "resetInvitation", "doneInvitation", "sleep", "Trigger", "ShellManager", "ScopedShellManager", "constructor", "page", "inIFrame", "_invitationCode", "Trigger", "_authCode", "on", "message", "_onConsoleMessage", "shell", "frameLocator", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/react-client';\nimport { SpaceMember } from '@dxos/react-client/echo';\n\nexport const alice: SpaceMember = {\n identity: {\n identityKey: PublicKey.random(),\n profile: {\n displayName: 'Alice',\n },\n },\n presence: SpaceMember.PresenceState.ONLINE,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { PublicKey } from '@dxos/react-client';\nimport { Invitation, CancellableInvitationObservable } from '@dxos/react-client/invitations';\n\nexport const inviteWithState = (state: Invitation.State) =>\n new CancellableInvitationObservable({\n initialInvitation: {\n state,\n invitationId: Math.random().toString(16).slice(2),\n kind: Invitation.Kind.SPACE,\n authMethod: Invitation.AuthMethod.NONE,\n swarmKey: PublicKey.random(),\n type: Invitation.Type.INTERACTIVE,\n authCode: [Invitation.State.READY_FOR_AUTHENTICATION, Invitation.State.AUTHENTICATING].includes(state)\n ? '123456'\n : '',\n },\n subscriber: () => {},\n onCancel: async () => {},\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { Locator, Page, FrameLocator } from '@playwright/test';\n\ntype Scope = Locator | FrameLocator | Page;\n\nexport class ScopedShellManager {\n page!: Page;\n\n authenticatorIsVisible(type: 'device' | 'space', scope?: Scope) {\n return (scope || this.page).getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).isVisible();\n }\n\n async invitationFailed(scope?: Scope, timeout = 3000) {\n const peer = scope || this.page;\n try {\n await peer.locator('[data-testid=invitation-rescuer-reset]:not([disabled])').waitFor({ timeout });\n return true;\n } catch {\n return false;\n }\n }\n\n async inputInvitation(type: 'device' | 'space', invitation: string, scope?: Scope) {\n await (scope || this.page).getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-input`).fill(invitation);\n await this.page.keyboard.press('Enter');\n }\n\n async invitationInputContinue(type: 'device' | 'space', scope?: Scope) {\n await (scope || this.page).getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-input-continue`).click();\n }\n\n async cancelInvitation(type: 'device' | 'space', kind: 'host' | 'guest', scope?: Scope) {\n if (kind === 'guest') {\n await (scope || this.page)\n .getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-authenticator-cancel`)\n .click();\n } else {\n await (scope || this.page).getByTestId('cancel-invitation').nth(0).click();\n }\n }\n\n async readyToAuthenticate(type: 'device' | 'space', scope?: Scope, timeout = 3000) {\n const peer = scope || this.page;\n try {\n await peer\n .locator(`[data-testid=${type === 'device' ? 'halo' : 'space'}-auth-code-input]:not([disabled])`)\n .waitFor({ timeout });\n return true;\n } catch {\n return false;\n }\n }\n\n async authenticateInvitation(type: 'device' | 'space', authCode: string, scope?: Scope) {\n const peer = scope || this.page;\n // TODO(wittjosiah): Update ids.\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).fill(authCode);\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-invitation-authenticator-next`).click();\n }\n\n async clearAuthCode(type: 'device' | 'space', scope?: Scope) {\n const peer = scope || this.page;\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).fill('');\n await peer.getByTestId(`${type === 'device' ? 'halo' : 'space'}-auth-code-input`).focus();\n }\n\n async resetInvitation(scope?: Scope) {\n await (scope || this.page).getByTestId('invitation-rescuer-reset').click();\n }\n\n async doneInvitation(type: 'device' | 'space', scope?: Scope) {\n await (scope || this.page)\n .getByTestId(type === 'device' ? 'halo-invitation-accepted-done' : 'space-invitation-accepted-done')\n .click();\n }\n}\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport type { ConsoleMessage, Dialog, Page } from '@playwright/test';\n\nimport { sleep, Trigger } from '@dxos/async';\n\nimport { ScopedShellManager } from './scoped-shell-manager';\n\n// TODO(wittjosiah): Normalize data-testids between snake and camel case.\n\nexport class ShellManager extends ScopedShellManager {\n private _invitationCode = new Trigger<string>();\n private _authCode = new Trigger<string>();\n\n // prettier-ignore\n constructor(\n override readonly page: Page,\n readonly inIFrame = true,\n ) {\n super();\n this.page.on('console', (message) => this._onConsoleMessage(message));\n }\n\n get shell() {\n return this.inIFrame ? this.page.frameLocator('data-testid=dxos-shell') : this.page;\n }\n\n // Getters\n\n async getDisplayName(): Promise<string | null> {\n return this.shell.getByTestId('identityHeading.displayName').textContent();\n }\n\n async isCurrentSpaceViewVisible(): Promise<boolean> {\n return await this.shell.getByTestId('current-space-view').isVisible();\n }\n\n async isSpaceListViewVisible(): Promise<boolean> {\n return await this.shell.getByTestId('space-list-view').isVisible();\n }\n\n // Actions\n\n async createIdentity(name: string) {\n await this.shell.getByTestId('create-identity').click();\n await this.page.keyboard.type(name);\n await this.shell.getByTestId('create-identity-input-continue').click();\n await this.shell.getByTestId('halo-invitation-accepted-done').click();\n }\n\n async createDeviceInvitation(): Promise<string> {\n this._invitationCode = new Trigger<string>();\n this._authCode = new Trigger<string>();\n await this.shell.getByTestId('devices-panel.create-invitation').click();\n return await this._invitationCode.wait();\n }\n\n async resetDevice() {\n const handleDialog = async (dialog: Dialog) => {\n if (dialog.type() === 'confirm') {\n await dialog.accept();\n }\n };\n\n this.page.on('dialog', handleDialog);\n await this.shell.getByTestId('devices-panel.sign-out').click();\n await this.shell.getByTestId('sign-out.reset-device').click();\n this.page.off('dialog', handleDialog);\n }\n\n async joinNewIdentity(invitationCode: string) {\n await this.shell.getByTestId('devices-panel.sign-out').click();\n await this.shell.getByTestId('sign-out.join-new-identity').click();\n await this.shell.getByTestId('reset-identity-input').fill('CONFIRM');\n await this.shell.getByTestId('reset-identity-input-confirm').click();\n await this.shell.getByTestId('identity-chooser.join-identity').click();\n await this.inputInvitation('device', invitationCode, this.shell);\n }\n\n async authenticateDevice(authCode: string, skipDone = true) {\n // Wait for focus to shift before typing.\n await sleep(1500);\n await this.authenticateInvitation('device', authCode, this.shell);\n // TODO(wittjosiah): When \"signing out\" and joinging a new identity, the done step seems to be skipped.\n if (!skipDone) {\n await this.doneInvitation('device', this.shell);\n }\n }\n\n async closeShell() {\n await this.page.keyboard.press('Escape');\n }\n\n async createSpaceInvitation(): Promise<string> {\n this._invitationCode = new Trigger<string>();\n this._authCode = new Trigger<string>();\n await this.shell.getByTestId('spaces-panel.create-invitation').click();\n return await this._invitationCode.wait();\n }\n\n async acceptSpaceInvitation(invitationCode: string) {\n await this.inputInvitation('space', invitationCode, this.shell);\n }\n\n async getAuthCode(): Promise<string> {\n return await this._authCode.wait();\n }\n\n async authenticate(authCode: string) {\n // Wait for focus to shift before typing.\n await sleep(1500);\n await this.authenticateInvitation('space', authCode, this.shell);\n await this.doneInvitation('space', this.shell);\n }\n\n private async _onConsoleMessage(message: ConsoleMessage) {\n try {\n const json = JSON.parse(message.text());\n if (json.invitationCode) {\n this._invitationCode.wake(json.invitationCode);\n }\n if (json.authCode) {\n this._authCode.wake(json.authCode);\n }\n } catch {}\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,iBAAiB;AAC1B,SAASC,mBAAmB;AAErB,IAAMC,QAAqB;EAChCC,UAAU;IACRC,aAAaC,UAAUC,OAAM;IAC7BC,SAAS;MACPC,aAAa;IACf;EACF;EACAC,UAAUC,YAAYC,cAAcC;AACt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,UAAM,KAAKC,uBAAuB,SAASH,UAAU,KAAKzB,KAAK;AAC/D,UAAM,KAAK6B,eAAe,SAAS,KAAK7B,KAAK;EAC/C;EAEA,MAAcD,kBAAkBD,SAAyB;AACvD,QAAI;AACF,YAAMsC,OAAOC,KAAKC,MAAMxC,QAAQyC,KAAI,CAAA;AACpC,UAAIH,KAAKf,gBAAgB;AACvB,aAAK3B,gBAAgB8C,KAAKJ,KAAKf,cAAc;MAC/C;AACA,UAAIe,KAAKX,UAAU;AACjB,aAAK7B,UAAU4C,KAAKJ,KAAKX,QAAQ;MACnC;IACF,QAAQ;IAAC;EACX;AACF;",
|
|
6
|
+
"names": ["PublicKey", "SpaceMember", "alice", "identity", "identityKey", "PublicKey", "random", "profile", "displayName", "presence", "SpaceMember", "PresenceState", "ONLINE", "PublicKey", "Invitation", "CancellableInvitationObservable", "inviteWithState", "state", "CancellableInvitationObservable", "initialInvitation", "invitationId", "Math", "random", "toString", "slice", "kind", "Invitation", "Kind", "SPACE", "authMethod", "AuthMethod", "NONE", "swarmKey", "PublicKey", "type", "Type", "INTERACTIVE", "authCode", "State", "READY_FOR_AUTHENTICATION", "AUTHENTICATING", "includes", "subscriber", "onCancel", "ScopedShellManager", "authenticatorIsVisible", "type", "scope", "page", "getByTestId", "isVisible", "invitationFailed", "timeout", "peer", "locator", "waitFor", "inputInvitation", "invitation", "fill", "keyboard", "press", "invitationInputContinue", "click", "cancelInvitation", "kind", "nth", "readyToAuthenticate", "authenticateInvitation", "authCode", "clearAuthCode", "focus", "resetInvitation", "doneInvitation", "sleep", "Trigger", "ShellManager", "ScopedShellManager", "constructor", "page", "inIFrame", "_invitationCode", "Trigger", "_authCode", "on", "message", "_onConsoleMessage", "shell", "frameLocator", "getDisplayName", "getByTestId", "textContent", "isCurrentSpaceViewVisible", "isVisible", "isSpaceListViewVisible", "createIdentity", "name", "click", "keyboard", "type", "createDeviceInvitation", "wait", "resetDevice", "handleDialog", "dialog", "accept", "off", "joinNewIdentity", "invitationCode", "fill", "inputInvitation", "authenticateDevice", "authCode", "skipDone", "sleep", "authenticateInvitation", "doneInvitation", "closeShell", "press", "createSpaceInvitation", "acceptSpaceInvitation", "getAuthCode", "authenticate", "json", "JSON", "parse", "text", "wake"]
|
|
7
7
|
}
|
|
@@ -45,7 +45,7 @@ exports.SpaceMemberList = SpaceMemberList;
|
|
|
45
45
|
const SpaceMemberListImpl = ({ members, onSelect }) => {
|
|
46
46
|
const { t } = (0, react_ui_1.useTranslation)('os');
|
|
47
47
|
const visibleMembers = members.filter((member) => member.identity);
|
|
48
|
-
return visibleMembers.length > 0 ? (react_1.default.createElement(react_ui_1.List, { classNames: 'flex flex-col gap-2' }, visibleMembers.map((member) => {
|
|
48
|
+
return visibleMembers.length > 0 ? (react_1.default.createElement(react_ui_1.List, { classNames: 'flex flex-col gap-2', "data-testid": 'space-members-list' }, visibleMembers.map((member) => {
|
|
49
49
|
return (react_1.default.createElement(IdentityListItem_1.IdentityListItem, { key: member.identity.identityKey.toHex(), identity: member.identity, presence: member.presence, onClick: onSelect && (() => onSelect(member)) }));
|
|
50
50
|
}))) : (react_1.default.createElement("div", { role: 'none', className: 'grow flex items-center p-2' },
|
|
51
51
|
react_1.default.createElement("p", { className: (0, react_ui_theme_1.mx)(react_ui_theme_1.descriptionText, 'text-center is-full mlb-2') }, t('empty space members message'))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpaceMemberList.js","sourceRoot":"","sources":["../../../../../src/components/IdentityList/SpaceMemberList.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,+CAAuC;AAEvC,qDAA+D;AAE/D,kDAAqD;AACrD,6CAAsD;AACtD,yDAA2D;AAE3D,yDAAsD;AAc/C,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAwB,EAAE,EAAE;IAC3F,MAAM,MAAM,GAAG,IAAA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GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnE,OAAO,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CACjC,8BAAC,eAAI,IAAC,UAAU,EAAC,qBAAqB,iBAAa,oBAAoB,IACpE,cAAc,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC7B,OAAO,CACL,8BAAC,mCAAgB,IACf,GAAG,EAAE,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,EACxC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,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,2BAA2B,CAAC,IAAG,CAAC,CAAC,6BAA6B,CAAC,CAAK,CAClG,CACP,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,mBAAmB,uBAqB9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../../src/components/Panel/Action.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,SAAS,EAAe,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAE,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../../src/components/Panel/Action.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAoB,KAAK,SAAS,EAAe,MAAM,uBAAuB,CAAC;AAEtF,OAAO,KAAK,EAAE,EAAE,KAAK,QAAQ,EAAE,KAAK,EAAE,EAAc,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvF,OAAO,EAAE,KAAK,WAAW,EAAwC,MAAM,gBAAgB,CAAC;AAGxF,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;CACrB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAEjC,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IACxD,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAWnD,eAAO,MAAM,gBAAgB,g2JA2E3B,CAAC;AAEH,eAAO,MAAM,MAAM,syJAYjB,CAAC"}
|
|
@@ -32,21 +32,6 @@ const react_use_controllable_state_1 = require("@radix-ui/react-use-controllable
|
|
|
32
32
|
const react_2 = __importStar(require("react"));
|
|
33
33
|
const react_ui_1 = require("@dxos/react-ui");
|
|
34
34
|
const react_ui_theme_1 = require("@dxos/react-ui-theme");
|
|
35
|
-
const buttonColorFragment = (props) => {
|
|
36
|
-
var _a;
|
|
37
|
-
const resolvedVariant = (_a = props.variant) !== null && _a !== void 0 ? _a : 'default';
|
|
38
|
-
return [
|
|
39
|
-
!props.disabled
|
|
40
|
-
? resolvedVariant === 'default'
|
|
41
|
-
? 'bg-neutral-25 hover:bg-white hover:text-primary-500 active:bg-neutral-25 dark:active:bg-neutral-800'
|
|
42
|
-
: resolvedVariant === 'ghost'
|
|
43
|
-
? 'active:bg-neutral-125 dark:active:bg-neutral-800'
|
|
44
|
-
: resolvedVariant === 'primary'
|
|
45
|
-
? 'active:bg-primary-700 dark:active:bg-primary-500'
|
|
46
|
-
: ''
|
|
47
|
-
: '',
|
|
48
|
-
];
|
|
49
|
-
};
|
|
50
35
|
const defaultActions = {
|
|
51
36
|
noopAction: {
|
|
52
37
|
label: 'No-op',
|
|
@@ -66,12 +51,12 @@ exports.BifurcatedAction = (0, react_2.forwardRef)((props, forwardedRef) => {
|
|
|
66
51
|
const activeAction = (_a = actions[activeActionKey]) !== null && _a !== void 0 ? _a : {};
|
|
67
52
|
const { t } = (0, react_ui_1.useTranslation)('os');
|
|
68
53
|
return (react_2.default.createElement("div", { role: 'none', className: (0, react_ui_theme_1.mx)('mbs-2 flex gap-px items-center', isFull && 'is-full') },
|
|
69
|
-
react_2.default.createElement(react_ui_1.Button, { ...rest, classNames: ['bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none', classNames
|
|
54
|
+
react_2.default.createElement(react_ui_1.Button, { ...rest, classNames: ['bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none', classNames], ref: forwardedRef, variant: variant, onClick: activeAction.onClick },
|
|
70
55
|
activeAction.icon && react_2.default.createElement(activeAction.icon, null),
|
|
71
56
|
react_2.default.createElement("span", null, activeAction.label)),
|
|
72
57
|
react_2.default.createElement(react_ui_1.DropdownMenu.Root, null,
|
|
73
58
|
react_2.default.createElement(react_ui_1.DropdownMenu.Trigger, { asChild: true },
|
|
74
|
-
react_2.default.createElement(react_ui_1.Button, { classNames: ['bs-11 flex-none rounded-is-none', classNames
|
|
59
|
+
react_2.default.createElement(react_ui_1.Button, { classNames: ['bs-11 flex-none rounded-is-none', classNames] },
|
|
75
60
|
react_2.default.createElement("span", { className: 'sr-only' }, t('invite options label')),
|
|
76
61
|
react_2.default.createElement(react_1.CaretDown, null))),
|
|
77
62
|
react_2.default.createElement(react_ui_1.DropdownMenu.Content, null,
|
|
@@ -88,6 +73,6 @@ exports.BifurcatedAction = (0, react_2.forwardRef)((props, forwardedRef) => {
|
|
|
88
73
|
});
|
|
89
74
|
exports.Action = (0, react_2.forwardRef)((props, forwardedRef) => {
|
|
90
75
|
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
91
|
-
return (react_2.default.createElement(react_ui_1.Button, { ...rest, classNames: [isFull && 'is-full', 'bs-11 flex gap-2 mbs-2', classNames
|
|
76
|
+
return (react_2.default.createElement(react_ui_1.Button, { ...rest, classNames: [isFull && 'is-full', 'bs-11 flex gap-2 mbs-2', classNames], ref: forwardedRef, variant: variant }, children));
|
|
92
77
|
});
|
|
93
78
|
//# sourceMappingURL=Action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../../src/components/Panel/Action.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAAsF;AACtF,yFAA8E;AAC9E,+CAAuF;AAEvF,
|
|
1
|
+
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../../src/components/Panel/Action.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAAsF;AACtF,yFAA8E;AAC9E,+CAAuF;AAEvF,6CAAwF;AACxF,yDAAoE;AAmBpE,MAAM,cAAc,GAAG;IACrB,UAAU,EAAE;QACV,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,EAAE;QACf,IAAI,EAAE,mBAAW;QACjB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;KAClB;CACgC,CAAC;AAEvB,QAAA,gBAAgB,GAAG,IAAA,kBAAU,EAA2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AAE,GAAG,KAAK,CAAC;IACxE,OAAO,CACL,8BAAC,iBAAM,OACD,IAAI,EACR,UAAU,EAAE,CAAC,MAAM,IAAI,SAAS,EAAE,wBAAwB,EAAE,UAAU,CAAC,EACvE,GAAG,EAAE,YAAY,EACjB,OAAO,EAAE,OAAO,IAEf,QAAQ,CACF,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../../../../src/composites/Shell/Shell.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAiD,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../../../../src/composites/Shell/Shell.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAiD,KAAK,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAOjH,eAAO,MAAM,KAAK;aAAoC,YAAY;YAAU,MAAM;wBAgGjF,CAAC"}
|
|
@@ -35,11 +35,13 @@ const IdentityDialog_1 = require("../IdentityDialog");
|
|
|
35
35
|
const JoinDialog_1 = require("../JoinDialog");
|
|
36
36
|
const SpaceDialog_1 = require("../SpaceDialog");
|
|
37
37
|
const Shell = ({ runtime, origin }) => {
|
|
38
|
-
const [{ layout, invitationCode, spaceKey }, setLayout] = (0, react_1.useState)({
|
|
38
|
+
const [{ layout, invitationCode, spaceKey, target }, setLayout] = (0, react_1.useState)({
|
|
39
39
|
layout: runtime.layout,
|
|
40
40
|
invitationCode: runtime.invitationCode,
|
|
41
41
|
spaceKey: runtime.spaceKey,
|
|
42
|
+
target: runtime.target,
|
|
42
43
|
});
|
|
44
|
+
const client = (0, react_client_1.useClient)();
|
|
43
45
|
const space = (0, echo_1.useSpace)(spaceKey);
|
|
44
46
|
(0, react_1.useEffect)(() => {
|
|
45
47
|
return runtime.layoutUpdate.on((request) => setLayout(request));
|
|
@@ -64,19 +66,27 @@ const Shell = ({ runtime, origin }) => {
|
|
|
64
66
|
case react_client_1.ShellLayout.IDENTITY:
|
|
65
67
|
case react_client_1.ShellLayout.SHARE_IDENTITY:
|
|
66
68
|
case react_client_1.ShellLayout.EDIT_PROFILE:
|
|
67
|
-
return (react_1.default.createElement(IdentityDialog_1.IdentityDialog, { createInvitationUrl: (invitationCode) => `${origin}?deviceInvitationCode=${invitationCode}`,
|
|
69
|
+
return (react_1.default.createElement(IdentityDialog_1.IdentityDialog, { createInvitationUrl: (invitationCode) => `${origin}?deviceInvitationCode=${invitationCode}`, onResetDevice: async () => {
|
|
70
|
+
await client.reset();
|
|
71
|
+
await runtime.setAppContext({ display: react_client_1.ShellDisplay.NONE, reload: true });
|
|
72
|
+
}, onJoinNewIdentity: () => runtime.setLayout({ layout: react_client_1.ShellLayout.INITIALIZE_IDENTITY }), onDone: async () => {
|
|
68
73
|
await runtime.setAppContext({ display: react_client_1.ShellDisplay.NONE });
|
|
69
74
|
runtime.setLayout({ layout: react_client_1.ShellLayout.DEFAULT });
|
|
70
75
|
} }));
|
|
71
76
|
case react_client_1.ShellLayout.SPACE:
|
|
72
|
-
return space ? (react_1.default.createElement(SpaceDialog_1.SpaceDialog, { space: space, createInvitationUrl: (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`, onDone: async () => {
|
|
77
|
+
return space ? (react_1.default.createElement(SpaceDialog_1.SpaceDialog, { space: space, target: target, createInvitationUrl: (invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`, onDone: async () => {
|
|
73
78
|
await runtime.setAppContext({ display: react_client_1.ShellDisplay.NONE });
|
|
74
79
|
runtime.setLayout({ layout: react_client_1.ShellLayout.DEFAULT });
|
|
75
80
|
} })) : null;
|
|
76
81
|
case react_client_1.ShellLayout.JOIN_SPACE:
|
|
77
82
|
return (react_1.default.createElement(JoinDialog_1.JoinDialog, { initialInvitationCode: invitationCode, onDone: async (result) => {
|
|
78
|
-
var _a;
|
|
79
|
-
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const target = (_a = result === null || result === void 0 ? void 0 : result.target) !== null && _a !== void 0 ? _a : undefined;
|
|
85
|
+
await runtime.setAppContext({
|
|
86
|
+
display: react_client_1.ShellDisplay.NONE,
|
|
87
|
+
spaceKey: (_b = result === null || result === void 0 ? void 0 : result.spaceKey) !== null && _b !== void 0 ? _b : undefined,
|
|
88
|
+
target,
|
|
89
|
+
});
|
|
80
90
|
runtime.setLayout({ layout: react_client_1.ShellLayout.DEFAULT });
|
|
81
91
|
}, onExit: async () => {
|
|
82
92
|
await runtime.setAppContext({ display: react_client_1.ShellDisplay.NONE });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shell.js","sourceRoot":"","sources":["../../../../../src/composites/Shell/Shell.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,+CAAmD;AAEnD,mCAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"Shell.js","sourceRoot":"","sources":["../../../../../src/composites/Shell/Shell.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,+CAAmD;AAEnD,mCAAgC;AAChC,qDAAiH;AACjH,kDAAmD;AAEnD,sDAAmD;AACnD,8CAA2C;AAC3C,gDAA6C;AAEtC,MAAM,KAAK,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAA6C,EAAE,EAAE;IACtF,MAAM,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAgB;QACxF,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,cAAc,EAAE,OAAO,CAAC,cAAc;QACtC,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,wBAAS,GAAE,CAAC;IAC3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,CAAC,IAAI,CAAC;QAEX,KAAK,0BAAW,CAAC,UAAU;YACzB,OAAO,CACL,8BAAC,uBAAU,IACT,qBAAqB,EAAE,cAAc,EACrC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;;oBACvB,MAAM,MAAM,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,mCAAI,SAAS,CAAC;oBAC3C,MAAM,OAAO,CAAC,aAAa,CAAC;wBAC1B,OAAO,EAAE,2BAAY,CAAC,IAAI;wBAC1B,QAAQ,EAAE,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,QAAQ,mCAAI,SAAS;wBACvC,MAAM;qBACP,CAAC,CAAC;oBACH,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,0BAAW,CAAC,OAAO,EAAE,CAAC,CAAC;gBACrD,CAAC,EACD,MAAM,EAAE,KAAK,IAAI,EAAE;oBACjB,MAAM,OAAO,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,2BAAY,CAAC,IAAI,EAAE,CAAC,CAAC;oBAC5D,OAAO,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,0BAAW,CAAC,OAAO,EAAE,CAAC,CAAC;gBACrD,CAAC,GACD,CACH,CAAC;QAEJ;YACE,OAAO,IAAI,CAAC;KACf;AACH,CAAC,CAAC;AAhGW,QAAA,KAAK,SAgGhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityPanel.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"IdentityPanel.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACxB,MAAM,sBAAsB,CAAC;AAyB9B,eAAO,MAAM,iBAAiB,UAAW,sBAAsB,gBAkE9D,CAAC;AAUF,eAAO,MAAM,aAAa,6DAIvB,kBAAkB,uBA8DpB,CAAC"}
|
|
@@ -36,6 +36,7 @@ const invitations_1 = require("@dxos/react-client/invitations");
|
|
|
36
36
|
const react_ui_1 = require("@dxos/react-ui");
|
|
37
37
|
const identityMachine_1 = require("./identityMachine");
|
|
38
38
|
const steps_1 = require("./steps");
|
|
39
|
+
const useAgentHandlers_1 = require("./useAgentHandlers");
|
|
39
40
|
const components_1 = require("../../components");
|
|
40
41
|
const steps_2 = require("../../steps");
|
|
41
42
|
const viewStyles = 'pbs-1 pbe-3 pli-3';
|
|
@@ -46,22 +47,21 @@ const IdentityHeading = ({ titleId, title, identity, onDone }) => {
|
|
|
46
47
|
react_1.default.createElement(react_ui_1.Avatar.Root, { size: 12, variant: 'circle', status: 'active' },
|
|
47
48
|
react_1.default.createElement(react_ui_1.Avatar.Frame, { classNames: 'block mbs-4 mbe-2 mli-auto chromatic-ignore' },
|
|
48
49
|
react_1.default.createElement(react_ui_1.Avatar.Fallback, { href: fallbackHref })),
|
|
49
|
-
react_1.default.createElement(react_ui_1.Avatar.Label, { classNames: 'block text-center font-light text-xl' }, (_b = (_a = identity.profile) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : (0, display_name_1.generateName)(identity.identityKey.toHex())))));
|
|
50
|
+
react_1.default.createElement(react_ui_1.Avatar.Label, { classNames: 'block text-center font-light text-xl', "data-testid": 'identityHeading.displayName' }, (_b = (_a = identity.profile) === null || _a === void 0 ? void 0 : _a.displayName) !== null && _b !== void 0 ? _b : (0, display_name_1.generateName)(identity.identityKey.toHex())))));
|
|
50
51
|
};
|
|
51
52
|
const IdentityPanelImpl = (props) => {
|
|
52
|
-
const { identity, titleId, activeView, onUpdateProfile, IdentityActionChooser: IdentityActionChooserComponent = steps_1.IdentityActionChooser, InvitationManager: InvitationManagerComponent = steps_2.InvitationManager, onDone, ...rest } = props;
|
|
53
|
+
const { identity, titleId, activeView, onUpdateProfile, onResetDevice, onJoinNewIdentity, IdentityActionChooser: IdentityActionChooserComponent = steps_1.IdentityActionChooser, InvitationManager: InvitationManagerComponent = steps_2.InvitationManager, onDone, ...rest } = props;
|
|
53
54
|
const { t } = (0, react_ui_1.useTranslation)('os');
|
|
54
55
|
const title = (0, react_1.useMemo)(() => {
|
|
55
56
|
switch (activeView) {
|
|
56
|
-
case '
|
|
57
|
-
return
|
|
57
|
+
case 'agent manager':
|
|
58
|
+
return 'Manage Agent';
|
|
58
59
|
case 'device invitation manager':
|
|
59
60
|
return t('choose add device label');
|
|
60
61
|
default:
|
|
61
62
|
return t('identity heading');
|
|
62
63
|
}
|
|
63
64
|
}, [activeView, t]);
|
|
64
|
-
console.log('[IdentityPanelImpl]', { activeView });
|
|
65
65
|
return (react_1.default.createElement(react_ui_1.DensityProvider, { density: 'fine' },
|
|
66
66
|
react_1.default.createElement(IdentityHeading, { identity, titleId, title, onDone }),
|
|
67
67
|
react_1.default.createElement(components_1.Viewport.Root, { activeView: activeView },
|
|
@@ -73,7 +73,11 @@ const IdentityPanelImpl = (props) => {
|
|
|
73
73
|
react_1.default.createElement(components_1.Viewport.View, { id: 'device manager', classNames: viewStyles },
|
|
74
74
|
react_1.default.createElement(steps_1.DeviceManager, { active: activeView === 'device manager', ...rest })),
|
|
75
75
|
react_1.default.createElement(components_1.Viewport.View, { classNames: viewStyles, id: 'update profile form' },
|
|
76
|
-
react_1.default.createElement(steps_1.ProfileForm, { send: rest.send, active: activeView === 'update profile form', profile: identity.profile, onUpdateProfile: onUpdateProfile }))
|
|
76
|
+
react_1.default.createElement(steps_1.ProfileForm, { send: rest.send, active: activeView === 'update profile form', profile: identity.profile, onUpdateProfile: onUpdateProfile })),
|
|
77
|
+
react_1.default.createElement(components_1.Viewport.View, { classNames: viewStyles, id: 'signing out' },
|
|
78
|
+
react_1.default.createElement(steps_1.SignOutChooser, { send: rest.send, active: activeView === 'signing out', onResetDevice: onResetDevice, onJoinNewIdentity: onJoinNewIdentity })),
|
|
79
|
+
react_1.default.createElement(components_1.Viewport.View, { classNames: viewStyles, id: 'agent manager' },
|
|
80
|
+
react_1.default.createElement(steps_1.AgentForm, { send: rest.send, active: activeView === 'agent manager', ...rest }))))));
|
|
77
81
|
};
|
|
78
82
|
exports.IdentityPanelImpl = IdentityPanelImpl;
|
|
79
83
|
const IdentityPanelWithInvitationImpl = ({ invitation, ...props }) => {
|
|
@@ -85,6 +89,8 @@ const IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) =>
|
|
|
85
89
|
const client = (0, react_client_1.useClient)();
|
|
86
90
|
const devices = (0, halo_1.useDevices)();
|
|
87
91
|
const identity = (0, halo_1.useIdentity)();
|
|
92
|
+
const invitations = (0, halo_1.useHaloInvitations)();
|
|
93
|
+
const agentProps = (0, useAgentHandlers_1.useAgentHandlers)({ client, identity, invitations });
|
|
88
94
|
if (!identity) {
|
|
89
95
|
console.error('IdentityPanel rendered with no active identity.');
|
|
90
96
|
return null;
|
|
@@ -106,13 +112,14 @@ const IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) =>
|
|
|
106
112
|
return 'device manager';
|
|
107
113
|
case [{ managingProfile: 'idle' }, { managingProfile: 'pending' }].some(identityState.matches):
|
|
108
114
|
return 'update profile form';
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
case identityState.matches('signingOut'):
|
|
116
|
+
return 'signing out';
|
|
117
|
+
case [{ managingAgent: 'idle' }, { managingAgent: 'pending' }].some(identityState.matches):
|
|
118
|
+
return 'agent manager';
|
|
111
119
|
default:
|
|
112
120
|
return 'identity action chooser';
|
|
113
121
|
}
|
|
114
122
|
}, [identityState]);
|
|
115
|
-
console.log({ activeView, identityState });
|
|
116
123
|
const onUpdateProfile = async (profile) => {
|
|
117
124
|
identitySend({ type: 'updateProfile' });
|
|
118
125
|
await client.halo.updateProfile(profile);
|
|
@@ -126,6 +133,7 @@ const IdentityPanel = ({ titleId: propsTitleId, createInvitationUrl = (code) =>
|
|
|
126
133
|
titleId,
|
|
127
134
|
createInvitationUrl,
|
|
128
135
|
onUpdateProfile,
|
|
136
|
+
...agentProps,
|
|
129
137
|
};
|
|
130
138
|
return identityState.context.invitation ? (react_1.default.createElement(IdentityPanelWithInvitationImpl, { ...implProps, invitation: identityState.context.invitation })) : (react_1.default.createElement(exports.IdentityPanelImpl, { ...implProps }));
|
|
131
139
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityPanel.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AACF,+CAAkD;AAElD,qDAAkD;AAClD,mCAAgC;AAChC,qDAA+C;AAC/C,
|
|
1
|
+
{"version":3,"file":"IdentityPanel.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AACF,+CAAkD;AAElD,qDAAkD;AAClD,mCAAgC;AAChC,qDAA+C;AAC/C,kDAAqG;AACrG,gEAAqE;AAErE,6CAAkG;AAOlG,uDAAuD;AACvD,mCAAuG;AACvG,yDAAsD;AACtD,iDAAkE;AAClE,uCAAgD;AAEhD,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAEvC,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAA6B,EAAE,EAAE;;IAC1F,MAAM,YAAY,GAAG,IAAA,2BAAgB,EAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACxE,OAAO,CACL,8BAAC,oBAAO,IAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE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C,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG;QAChB,GAAG,KAAK;QACR,QAAQ;QACR,OAAO;QACP,UAAU;QACV,IAAI,EAAE,YAAY;QAClB,OAAO;QACP,mBAAmB;QACnB,eAAe;QACf,GAAG,UAAU;KACmB,CAAC;IAEnC,OAAO,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CACxC,8BAAC,+BAA+B,OAAK,SAAS,EAAE,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,UAAU,GAAI,CACjG,CAAC,CAAC,CAAC,CACF,8BAAC,yBAAiB,OAAK,SAAS,GAAI,CACrC,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,aAAa,iBAkExB"}
|
|
@@ -4,12 +4,22 @@ import type { Device, Identity } from '@dxos/react-client/halo';
|
|
|
4
4
|
import type { InvitationStatus } from '@dxos/react-client/invitations';
|
|
5
5
|
import type { IdentityEvent } from './identityMachine';
|
|
6
6
|
import type { InvitationManagerProps } from '../../steps';
|
|
7
|
+
export type AgentFormProps = {
|
|
8
|
+
onAgentCreate?: () => Promise<void>;
|
|
9
|
+
onAgentDestroy?: () => Promise<void>;
|
|
10
|
+
agentStatus?: string;
|
|
11
|
+
agentActive?: boolean;
|
|
12
|
+
agentProviderDisabled?: boolean;
|
|
13
|
+
validationMessage?: string;
|
|
14
|
+
};
|
|
7
15
|
export type IdentityPanelImplProps = {
|
|
8
16
|
titleId: string;
|
|
9
|
-
activeView: 'device manager' | 'update profile form' | 'device invitation manager' | 'identity action chooser';
|
|
17
|
+
activeView: 'device manager' | 'agent manager' | 'update profile form' | 'device invitation manager' | 'identity action chooser' | 'signing out';
|
|
10
18
|
identity: Identity;
|
|
11
19
|
devices: Device[];
|
|
12
20
|
onUpdateProfile?: (profile: NonNullable<Identity['profile']>) => Promise<void>;
|
|
21
|
+
onResetDevice?: () => Promise<void>;
|
|
22
|
+
onJoinNewIdentity?: () => void;
|
|
13
23
|
createInvitationUrl: (invitationCode: string) => string;
|
|
14
24
|
send?: (event: SingleOrArray<Event<IdentityEvent>>) => void;
|
|
15
25
|
onDone?: () => void;
|
|
@@ -17,7 +27,7 @@ export type IdentityPanelImplProps = {
|
|
|
17
27
|
invitationUrl?: string;
|
|
18
28
|
IdentityActionChooser?: React.FC<IdentityPanelStepProps>;
|
|
19
29
|
InvitationManager?: React.FC<InvitationManagerProps>;
|
|
20
|
-
} & Partial<InvitationStatus>;
|
|
30
|
+
} & Partial<InvitationStatus> & Partial<AgentFormProps>;
|
|
21
31
|
export type IdentityPanelProps = Partial<Omit<IdentityPanelImplProps, 'send' | 'activeView' | 'identity'>>;
|
|
22
32
|
export type IdentityPanelHeadingProps = Pick<IdentityPanelImplProps, 'titleId' | 'identity' | 'onDone'> & {
|
|
23
33
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdentityPanelProps.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanelProps.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,
|
|
1
|
+
{"version":3,"file":"IdentityPanelProps.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanelProps.ts"],"names":[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AE,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,KAAK,IAAI,CAAC;IAC5D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,CAAC,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC;IACzD,iBAAiB,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC;CACtD,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAC3B,OAAO,CAAC,cAAc,CAAC,CAAC;AAE1B,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC;AAE3G,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC,GAAG;IACxG,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,EAAE,MAAM,GAAG,QAAQ,GAAG,kBAAkB,CAAC,GAAG;IAC1G,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
|
@@ -10,7 +10,7 @@ type IdentityMachineContext = {
|
|
|
10
10
|
identitySubscribable: Subscribable<SetIdentityEvent> | null;
|
|
11
11
|
};
|
|
12
12
|
type IdentityChooseActionEvent = {
|
|
13
|
-
type: 'chooseDevices' | 'chooseProfile' |
|
|
13
|
+
type: 'chooseDevices' | 'chooseAgent' | 'chooseProfile' | 'chooseSignOut' | 'sigingOut' | 'unchooseAction';
|
|
14
14
|
};
|
|
15
15
|
type IdentitySelectDeviceInvitationEvent = {
|
|
16
16
|
type: 'selectInvitation';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityMachine.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/identityMachine.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAyB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGxG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,sBAAsB,GAAG;IAC5B,UAAU,CAAC,EAAE,+BAA+B,CAAC;IAC7C,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,oBAAoB,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;CAC7D,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,eAAe,GAAG,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"identityMachine.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/identityMachine.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAyB,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAGxG,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAEtF,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,KAAK,sB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)({
|
|
|
21
21
|
states: {
|
|
22
22
|
choosingAction: {},
|
|
23
23
|
managingDeviceInvitation: {},
|
|
24
|
+
managingAgent: {
|
|
25
|
+
initial: 'idle',
|
|
26
|
+
states: {
|
|
27
|
+
idle: {},
|
|
28
|
+
pending: {},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
24
31
|
managingDevices: {},
|
|
25
32
|
managingProfile: {
|
|
26
33
|
initial: 'idle',
|
|
@@ -33,7 +40,7 @@ const identityMachine = (0, xstate_1.createMachine)({
|
|
|
33
40
|
updateProfile: { target: '.pending', actions: 'log' },
|
|
34
41
|
},
|
|
35
42
|
},
|
|
36
|
-
|
|
43
|
+
signingOut: {},
|
|
37
44
|
},
|
|
38
45
|
on: {
|
|
39
46
|
unchooseAction: { target: '.choosingAction', actions: ['unsetInvitation', 'log'] },
|
|
@@ -41,7 +48,8 @@ const identityMachine = (0, xstate_1.createMachine)({
|
|
|
41
48
|
selectInvitation: { target: '.managingDeviceInvitation', actions: ['setInvitation', 'log'] },
|
|
42
49
|
chooseDevices: { target: '.managingDevices', actions: 'log' },
|
|
43
50
|
chooseProfile: { target: '.managingProfile', actions: 'log' },
|
|
44
|
-
|
|
51
|
+
chooseSignOut: { target: '.signingOut', actions: 'log' },
|
|
52
|
+
chooseAgent: { target: '.managingAgent', actions: 'log' },
|
|
45
53
|
},
|
|
46
54
|
}, {
|
|
47
55
|
actions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identityMachine.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/identityMachine.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,yCAA2C;AAC3C,mCAAwG;AAExG,mCAAgC;AAsChC,MAAM,eAAe,GAAG,IAAA,sBAAa,EACnC;IACE,EAAE,EAAE,UAAU;IACd,0BAA0B,EAAE,IAAI;IAChC,OAAO,EAAE;QACP,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,IAAI;KAC3B;IACD,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,oBAAqB;KAChD;IACD,MAAM,EAAE;QACN,cAAc,EAAE,EAAE;QAClB,wBAAwB,EAAE,EAAE;QAC5B,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE;YACf,OAAO,EAAE,MAAM;YACf,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,EAAE;aACZ;YACD,EAAE,EAAE;gBACF,WAAW,EAAE,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE;gBAC1E,aAAa,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE;aACtD;SACF;QACD,
|
|
1
|
+
{"version":3,"file":"identityMachine.js","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/identityMachine.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEF,yCAA2C;AAC3C,mCAAwG;AAExG,mCAAgC;AAsChC,MAAM,eAAe,GAAG,IAAA,sBAAa,EACnC;IACE,EAAE,EAAE,UAAU;IACd,0BAA0B,EAAE,IAAI;IAChC,OAAO,EAAE;QACP,QAAQ,EAAE,IAAI;QACd,oBAAoB,EAAE,IAAI;KAC3B;IACD,OAAO,EAAE,gBAAgB;IACzB,MAAM,EAAE;QACN,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,oBAAqB;KAChD;IACD,MAAM,EAAE;QACN,cAAc,EAAE,EAAE;QAClB,wBAAwB,EAAE,EAAE;QAC5B,aAAa,EAAE;YACb,OAAO,EAAE,MAAM;YACf,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE;gBACR,OAAO,EAAE,EAAE;aACZ;SACF;QACD,eAAe,EAAE,EAAE;QACnB,eAAe,EAAE;YACf,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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
|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