@dxos/plugin-client 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51
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/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/chunk-M37DHX5L.mjs +131 -0
- package/dist/lib/browser/chunk-M37DHX5L.mjs.map +7 -0
- package/dist/lib/browser/chunk-RPMM5NKJ.mjs +175 -0
- package/dist/lib/browser/chunk-RPMM5NKJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-VAIJSQYA.mjs +12 -0
- package/dist/lib/browser/chunk-VAIJSQYA.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +70 -94
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/create-agent-JV3EM3TV.mjs +26 -0
- package/dist/lib/browser/create-agent-JV3EM3TV.mjs.map +7 -0
- package/dist/lib/browser/create-identity-ZITQKEVZ.mjs +30 -0
- package/dist/lib/browser/create-identity-ZITQKEVZ.mjs.map +7 -0
- package/dist/lib/browser/create-passkey-NCP4XA7C.mjs +81 -0
- package/dist/lib/browser/create-passkey-NCP4XA7C.mjs.map +7 -0
- package/dist/lib/browser/create-recovery-code-L5LA3GAP.mjs +36 -0
- package/dist/lib/browser/create-recovery-code-L5LA3GAP.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +29 -105
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/join-identity-3W6PJLKN.mjs +27 -0
- package/dist/lib/browser/join-identity-3W6PJLKN.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +13 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/recover-identity-KL6QY4GI.mjs +26 -0
- package/dist/lib/browser/recover-identity-KL6QY4GI.mjs.map +7 -0
- package/dist/lib/browser/redeem-passkey-NDEWSJTM.mjs +66 -0
- package/dist/lib/browser/redeem-passkey-NDEWSJTM.mjs.map +7 -0
- package/dist/lib/browser/redeem-token-YLWAVFXD.mjs +29 -0
- package/dist/lib/browser/redeem-token-YLWAVFXD.mjs.map +7 -0
- package/dist/lib/browser/reset-storage-OBHEGA6Z.mjs +26 -0
- package/dist/lib/browser/reset-storage-OBHEGA6Z.mjs.map +7 -0
- package/dist/lib/browser/share-identity-FTFHFSZQ.mjs +31 -0
- package/dist/lib/browser/share-identity-FTFHFSZQ.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +22 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/lib/browser/translations.mjs +74 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -6
- package/dist/lib/node-esm/chunk-G77YYPR6.mjs +176 -0
- package/dist/lib/node-esm/chunk-G77YYPR6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OHKM7GJW.mjs +14 -0
- package/dist/lib/node-esm/chunk-OHKM7GJW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-UBY7FBQ7.mjs +133 -0
- package/dist/lib/node-esm/chunk-UBY7FBQ7.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +70 -94
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/create-agent-Y4BPVDV7.mjs +27 -0
- package/dist/lib/node-esm/create-agent-Y4BPVDV7.mjs.map +7 -0
- package/dist/lib/node-esm/create-identity-367SQSX6.mjs +31 -0
- package/dist/lib/node-esm/create-identity-367SQSX6.mjs.map +7 -0
- package/dist/lib/node-esm/create-passkey-WMWK2ETT.mjs +82 -0
- package/dist/lib/node-esm/create-passkey-WMWK2ETT.mjs.map +7 -0
- package/dist/lib/node-esm/create-recovery-code-VJGE5HJL.mjs +37 -0
- package/dist/lib/node-esm/create-recovery-code-VJGE5HJL.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +29 -105
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/join-identity-IRIRO2VT.mjs +28 -0
- package/dist/lib/node-esm/join-identity-IRIRO2VT.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +14 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/recover-identity-LJCY4BCJ.mjs +27 -0
- package/dist/lib/node-esm/recover-identity-LJCY4BCJ.mjs.map +7 -0
- package/dist/lib/node-esm/redeem-passkey-PT7QWFJE.mjs +67 -0
- package/dist/lib/node-esm/redeem-passkey-PT7QWFJE.mjs.map +7 -0
- package/dist/lib/node-esm/redeem-token-BHKHEXJM.mjs +30 -0
- package/dist/lib/node-esm/redeem-token-BHKHEXJM.mjs.map +7 -0
- package/dist/lib/node-esm/reset-storage-VPUZJOUV.mjs +27 -0
- package/dist/lib/node-esm/reset-storage-VPUZJOUV.mjs.map +7 -0
- package/dist/lib/node-esm/share-identity-SZ3REIRC.mjs +32 -0
- package/dist/lib/node-esm/share-identity-SZ3REIRC.mjs.map +7 -0
- package/dist/lib/node-esm/testing/index.mjs +23 -0
- package/dist/lib/node-esm/testing/index.mjs.map +7 -0
- package/dist/lib/node-esm/translations.mjs +75 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -6
- package/dist/types/src/ClientPlugin.d.ts +1 -1
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/{client/client.d.ts → client.d.ts} +2 -2
- package/dist/types/src/capabilities/client.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +32 -7
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-handler/index.d.ts +4 -0
- package/dist/types/src/capabilities/navigation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +15 -0
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +21 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs.d.ts.map +1 -0
- package/dist/types/src/cli/commands/config/index.d.ts +1 -1
- package/dist/types/src/cli/commands/config/view.d.ts +1 -1
- package/dist/types/src/cli/commands/config/view.d.ts.map +1 -1
- package/dist/types/src/cli/commands/device/info/info.d.ts +2 -2
- package/dist/types/src/cli/commands/device/info/info.d.ts.map +1 -1
- package/dist/types/src/cli/commands/device/list/list.d.ts +2 -2
- package/dist/types/src/cli/commands/device/list/list.d.ts.map +1 -1
- package/dist/types/src/cli/commands/device/update/update.d.ts.map +1 -1
- package/dist/types/src/cli/commands/device/util.d.ts.map +1 -1
- package/dist/types/src/cli/commands/edge/status.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/create/create.d.ts +2 -2
- package/dist/types/src/cli/commands/halo/create/create.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/credential/list/list.d.ts +3 -3
- package/dist/types/src/cli/commands/halo/credential/list/list.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/identity/identity.d.ts +2 -2
- package/dist/types/src/cli/commands/halo/identity/identity.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/join/join.d.ts +1 -1
- package/dist/types/src/cli/commands/halo/keys/keys.d.ts +2 -2
- package/dist/types/src/cli/commands/halo/keys/keys.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/seed/seed.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/update/update.d.ts.map +1 -1
- package/dist/types/src/cli/commands/halo/util.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/create.d.ts +3 -2
- package/dist/types/src/cli/commands/profile/create.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/delete.d.ts +1 -1
- package/dist/types/src/cli/commands/profile/delete.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/import.d.ts +2 -2
- package/dist/types/src/cli/commands/profile/index.d.ts +6 -6
- package/dist/types/src/cli/commands/profile/list.d.ts.map +1 -1
- package/dist/types/src/cli/commands/profile/reset.d.ts +1 -1
- package/dist/types/src/cli/commands/profile/util.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/cli/testing/test-console.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts +166 -165
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/index.d.ts +1 -2
- package/dist/types/src/containers/DevicesContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +15 -0
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -0
- package/dist/types/src/containers/JoinDialog/index.d.ts +1 -2
- package/dist/types/src/containers/JoinDialog/index.d.ts.map +1 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ProfileContainer/index.d.ts +1 -2
- package/dist/types/src/containers/ProfileContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCodeDialog/index.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts +1 -2
- package/dist/types/src/containers/RecoveryCredentialsContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/create-agent.d.ts +5 -0
- package/dist/types/src/operations/create-agent.d.ts.map +1 -0
- package/dist/types/src/operations/create-identity.d.ts +5 -0
- package/dist/types/src/operations/create-identity.d.ts.map +1 -0
- package/dist/types/src/operations/create-passkey.d.ts +5 -0
- package/dist/types/src/operations/create-passkey.d.ts.map +1 -0
- package/dist/types/src/operations/create-recovery-code.d.ts +5 -0
- package/dist/types/src/operations/create-recovery-code.d.ts.map +1 -0
- package/dist/types/src/operations/definitions.d.ts +36 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/join-identity.d.ts +5 -0
- package/dist/types/src/operations/join-identity.d.ts.map +1 -0
- package/dist/types/src/operations/recover-identity.d.ts +5 -0
- package/dist/types/src/operations/recover-identity.d.ts.map +1 -0
- package/dist/types/src/operations/redeem-passkey.d.ts +5 -0
- package/dist/types/src/operations/redeem-passkey.d.ts.map +1 -0
- package/dist/types/src/operations/redeem-token.d.ts +5 -0
- package/dist/types/src/operations/redeem-token.d.ts.map +1 -0
- package/dist/types/src/operations/reset-storage.d.ts +5 -0
- package/dist/types/src/operations/reset-storage.d.ts.map +1 -0
- package/dist/types/src/operations/share-identity.d.ts +5 -0
- package/dist/types/src/operations/share-identity.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/initializeIdentity.d.ts +13 -0
- package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +1 -2
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/events.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +20 -173
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +68 -39
- package/src/ClientPlugin.ts +14 -10
- package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +20 -19
- package/src/capabilities/{client/client.ts → client.ts} +9 -7
- package/src/capabilities/index.ts +15 -7
- package/src/capabilities/{migrations/migrations.ts → migrations.ts} +1 -1
- package/src/capabilities/navigation-handler/index.ts +9 -0
- package/src/capabilities/navigation-handler/navigation-handler.ts +64 -0
- package/src/capabilities/node.ts +13 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +4 -4
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +18 -22
- package/src/capabilities/{schema-defs/schema-defs.ts → schema-defs.ts} +1 -1
- package/src/cli/commands/config/view.ts +4 -1
- package/src/cli/commands/device/info/info.test.ts +0 -1
- package/src/cli/commands/device/info/info.ts +0 -2
- package/src/cli/commands/device/list/list.test.ts +0 -1
- package/src/cli/commands/device/list/list.ts +0 -2
- package/src/cli/commands/device/update/update.ts +0 -2
- package/src/cli/commands/edge/status.ts +2 -1
- package/src/cli/commands/halo/create/create.test.ts +0 -1
- package/src/cli/commands/halo/create/create.ts +11 -4
- package/src/cli/commands/halo/credential/list/list.test.ts +0 -1
- package/src/cli/commands/halo/credential/list/list.ts +4 -7
- package/src/cli/commands/halo/identity/identity.ts +0 -1
- package/src/cli/commands/halo/keys/keys.ts +0 -2
- package/src/cli/commands/halo/seed/seed.ts +0 -2
- package/src/cli/commands/halo/update/update.test.ts +0 -1
- package/src/cli/commands/halo/update/update.ts +0 -2
- package/src/cli/commands/profile/create.ts +9 -6
- package/src/cli/commands/profile/delete.ts +5 -2
- package/src/cli/commands/profile/list.ts +12 -11
- package/src/cli/plugin.ts +7 -10
- package/src/cli/testing/test-console.ts +1 -2
- package/src/constants.ts +4 -4
- package/src/containers/DevicesContainer/DevicesContainer.stories.tsx +4 -3
- package/src/containers/DevicesContainer/DevicesContainer.tsx +49 -48
- package/src/containers/DevicesContainer/index.ts +1 -3
- package/src/containers/JoinDialog/JoinDialog.stories.tsx +43 -0
- package/src/containers/JoinDialog/JoinDialog.tsx +15 -12
- package/src/containers/JoinDialog/index.ts +1 -3
- package/src/containers/ProfileContainer/ProfileContainer.stories.tsx +1 -1
- package/src/containers/ProfileContainer/ProfileContainer.tsx +12 -12
- package/src/containers/ProfileContainer/index.ts +1 -3
- package/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.stories.tsx +1 -1
- package/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.tsx +7 -7
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.tsx +4 -3
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx +25 -27
- package/src/containers/RecoveryCredentialsContainer/index.ts +1 -3
- package/src/containers/ResetDialog/ResetDialog.stories.tsx +4 -4
- package/src/containers/ResetDialog/ResetDialog.tsx +7 -5
- package/src/index.ts +2 -5
- package/src/meta.ts +1 -1
- package/src/operations/create-agent.ts +26 -0
- package/src/operations/create-identity.ts +29 -0
- package/src/operations/create-passkey.ts +88 -0
- package/src/operations/create-recovery-code.ts +34 -0
- package/src/operations/definitions.ts +107 -0
- package/src/operations/index.ts +20 -0
- package/src/operations/join-identity.ts +28 -0
- package/src/operations/recover-identity.ts +28 -0
- package/src/operations/redeem-passkey.ts +85 -0
- package/src/operations/redeem-token.ts +31 -0
- package/src/operations/reset-storage.ts +27 -0
- package/src/operations/share-identity.ts +26 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/initializeIdentity.ts +24 -0
- package/src/translations.ts +53 -43
- package/src/types/capabilities.ts +4 -4
- package/src/types/events.ts +6 -6
- package/src/types/schema.ts +11 -121
- package/dist/lib/browser/DevicesContainer-46MEG3F5.mjs +0 -268
- package/dist/lib/browser/DevicesContainer-46MEG3F5.mjs.map +0 -7
- package/dist/lib/browser/JoinDialog-2RCYK4O5.mjs +0 -59
- package/dist/lib/browser/JoinDialog-2RCYK4O5.mjs.map +0 -7
- package/dist/lib/browser/ProfileContainer-XYRCOQ5I.mjs +0 -171
- package/dist/lib/browser/ProfileContainer-XYRCOQ5I.mjs.map +0 -7
- package/dist/lib/browser/RecoveryCodeDialog-EX2CLFND.mjs +0 -60
- package/dist/lib/browser/RecoveryCodeDialog-EX2CLFND.mjs.map +0 -7
- package/dist/lib/browser/RecoveryCredentialsContainer-RWTEIHOB.mjs +0 -57
- package/dist/lib/browser/RecoveryCredentialsContainer-RWTEIHOB.mjs.map +0 -7
- package/dist/lib/browser/ResetDialog-W24FOWBQ.mjs +0 -52
- package/dist/lib/browser/ResetDialog-W24FOWBQ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-QJWFLYZE.mjs +0 -121
- package/dist/lib/browser/app-graph-builder-QJWFLYZE.mjs.map +0 -7
- package/dist/lib/browser/chunk-4XYOOXAH.mjs +0 -18
- package/dist/lib/browser/chunk-4XYOOXAH.mjs.map +0 -7
- package/dist/lib/browser/chunk-DPAXDXMK.mjs +0 -283
- package/dist/lib/browser/chunk-DPAXDXMK.mjs.map +0 -7
- package/dist/lib/browser/chunk-N2GMSVDQ.mjs +0 -15
- package/dist/lib/browser/chunk-N2GMSVDQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-VYX3ROUX.mjs +0 -15
- package/dist/lib/browser/chunk-VYX3ROUX.mjs.map +0 -7
- package/dist/lib/browser/client-Z25GQ5YC.mjs +0 -86
- package/dist/lib/browser/client-Z25GQ5YC.mjs.map +0 -7
- package/dist/lib/browser/migrations-HLHRMOW6.mjs +0 -25
- package/dist/lib/browser/migrations-HLHRMOW6.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-6QW3BKA5.mjs +0 -299
- package/dist/lib/browser/operation-resolver-6QW3BKA5.mjs.map +0 -7
- package/dist/lib/browser/react-context-E7TAJMDK.mjs +0 -26
- package/dist/lib/browser/react-context-E7TAJMDK.mjs.map +0 -7
- package/dist/lib/browser/react-surface-L5A2LBFE.mjs +0 -77
- package/dist/lib/browser/react-surface-L5A2LBFE.mjs.map +0 -7
- package/dist/lib/browser/schema-defs-5WDZWVEI.mjs +0 -28
- package/dist/lib/browser/schema-defs-5WDZWVEI.mjs.map +0 -7
- package/dist/lib/node-esm/DevicesContainer-WQ3DQA45.mjs +0 -269
- package/dist/lib/node-esm/DevicesContainer-WQ3DQA45.mjs.map +0 -7
- package/dist/lib/node-esm/JoinDialog-KLTNJY5F.mjs +0 -60
- package/dist/lib/node-esm/JoinDialog-KLTNJY5F.mjs.map +0 -7
- package/dist/lib/node-esm/ProfileContainer-XI425QK5.mjs +0 -172
- package/dist/lib/node-esm/ProfileContainer-XI425QK5.mjs.map +0 -7
- package/dist/lib/node-esm/RecoveryCodeDialog-AISRNJUM.mjs +0 -61
- package/dist/lib/node-esm/RecoveryCodeDialog-AISRNJUM.mjs.map +0 -7
- package/dist/lib/node-esm/RecoveryCredentialsContainer-3TKQRPQK.mjs +0 -58
- package/dist/lib/node-esm/RecoveryCredentialsContainer-3TKQRPQK.mjs.map +0 -7
- package/dist/lib/node-esm/ResetDialog-GGBWSQZO.mjs +0 -54
- package/dist/lib/node-esm/ResetDialog-GGBWSQZO.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-6JD6BZAI.mjs +0 -122
- package/dist/lib/node-esm/app-graph-builder-6JD6BZAI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H2CCMM4Z.mjs +0 -20
- package/dist/lib/node-esm/chunk-H2CCMM4Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HKSNTZF5.mjs +0 -16
- package/dist/lib/node-esm/chunk-HKSNTZF5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RGULICLJ.mjs +0 -17
- package/dist/lib/node-esm/chunk-RGULICLJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-VEUNEDN5.mjs +0 -284
- package/dist/lib/node-esm/chunk-VEUNEDN5.mjs.map +0 -7
- package/dist/lib/node-esm/client-5AIPYSBT.mjs +0 -87
- package/dist/lib/node-esm/client-5AIPYSBT.mjs.map +0 -7
- package/dist/lib/node-esm/migrations-O5KG2GGN.mjs +0 -26
- package/dist/lib/node-esm/migrations-O5KG2GGN.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-GSH7AOTZ.mjs +0 -300
- package/dist/lib/node-esm/operation-resolver-GSH7AOTZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-context-OMJSBS23.mjs +0 -27
- package/dist/lib/node-esm/react-context-OMJSBS23.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-N3BSPMMX.mjs +0 -78
- package/dist/lib/node-esm/react-surface-N3BSPMMX.mjs.map +0 -7
- package/dist/lib/node-esm/schema-defs-ENOYSDP3.mjs +0 -29
- package/dist/lib/node-esm/schema-defs-ENOYSDP3.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/client/client.d.ts.map +0 -1
- package/dist/types/src/capabilities/client/index.d.ts +0 -18
- package/dist/types/src/capabilities/client/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/migrations/index.d.ts +0 -3
- package/dist/types/src/capabilities/migrations/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/migrations/migrations.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -8
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
- package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-defs/index.d.ts +0 -3
- package/dist/types/src/capabilities/schema-defs/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/schema-defs/schema-defs.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/client/index.ts +0 -7
- package/src/capabilities/migrations/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -247
- package/src/capabilities/react-context/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/schema-defs/index.ts +0 -7
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{migrations/migrations.d.ts → migrations.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +0 -0
- /package/dist/types/src/capabilities/{schema-defs/schema-defs.d.ts → schema-defs.d.ts} +0 -0
package/src/types/schema.ts
CHANGED
|
@@ -7,9 +7,8 @@ import * as Schema from 'effect/Schema';
|
|
|
7
7
|
|
|
8
8
|
import { Capability } from '@dxos/app-framework';
|
|
9
9
|
import { type Client, type ClientOptions, PublicKey } from '@dxos/client';
|
|
10
|
-
import { Operation } from '@dxos/operation';
|
|
11
10
|
|
|
12
|
-
import { meta } from '
|
|
11
|
+
import { meta } from '#meta';
|
|
13
12
|
|
|
14
13
|
// TODO(wittjosiah): Factor out. Generate?
|
|
15
14
|
const IdentitySchema = Schema.Struct({
|
|
@@ -31,59 +30,59 @@ export namespace ClientAction {
|
|
|
31
30
|
data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
32
31
|
});
|
|
33
32
|
|
|
34
|
-
export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}
|
|
33
|
+
export class CreateIdentity extends Schema.TaggedClass<CreateIdentity>()(`${meta.id}.action.create-identity`, {
|
|
35
34
|
input: ProfileSchema,
|
|
36
35
|
output: IdentitySchema,
|
|
37
36
|
}) {}
|
|
38
37
|
|
|
39
|
-
export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}
|
|
38
|
+
export class JoinIdentity extends Schema.TaggedClass<JoinIdentity>()(`${meta.id}.action.join-identity`, {
|
|
40
39
|
input: Schema.Struct({
|
|
41
40
|
invitationCode: Schema.optional(Schema.String),
|
|
42
41
|
}),
|
|
43
42
|
output: Schema.Void,
|
|
44
43
|
}) {}
|
|
45
44
|
|
|
46
|
-
export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}
|
|
45
|
+
export class ShareIdentity extends Schema.TaggedClass<ShareIdentity>()(`${meta.id}.action.share-identity`, {
|
|
47
46
|
input: Schema.Void,
|
|
48
47
|
output: Schema.Void,
|
|
49
48
|
}) {}
|
|
50
49
|
|
|
51
|
-
export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}
|
|
50
|
+
export class RecoverIdentity extends Schema.TaggedClass<RecoverIdentity>()(`${meta.id}.action.recover-identity`, {
|
|
52
51
|
input: Schema.Void,
|
|
53
52
|
output: Schema.Void,
|
|
54
53
|
}) {}
|
|
55
54
|
|
|
56
|
-
export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}
|
|
55
|
+
export class ResetStorage extends Schema.TaggedClass<ResetStorage>()(`${meta.id}.action.reset-storage`, {
|
|
57
56
|
input: Schema.Struct({
|
|
58
57
|
mode: Schema.optional(Schema.String),
|
|
59
58
|
}),
|
|
60
59
|
output: Schema.Void,
|
|
61
60
|
}) {}
|
|
62
61
|
|
|
63
|
-
export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}
|
|
62
|
+
export class CreateAgent extends Schema.TaggedClass<CreateAgent>()(`${meta.id}.action.create-agent`, {
|
|
64
63
|
input: Schema.Void,
|
|
65
64
|
output: Schema.Void,
|
|
66
65
|
}) {}
|
|
67
66
|
|
|
68
67
|
export class CreateRecoveryCode extends Schema.TaggedClass<CreateRecoveryCode>()(
|
|
69
|
-
`${meta.id}
|
|
68
|
+
`${meta.id}.action.create-recovery-code`,
|
|
70
69
|
{
|
|
71
70
|
input: Schema.Void,
|
|
72
71
|
output: Schema.Void,
|
|
73
72
|
},
|
|
74
73
|
) {}
|
|
75
74
|
|
|
76
|
-
export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}
|
|
75
|
+
export class CreatePasskey extends Schema.TaggedClass<CreatePasskey>()(`${meta.id}.action.create-passkey`, {
|
|
77
76
|
input: Schema.Void,
|
|
78
77
|
output: Schema.Void,
|
|
79
78
|
}) {}
|
|
80
79
|
|
|
81
|
-
export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}
|
|
80
|
+
export class RedeemPasskey extends Schema.TaggedClass<RedeemPasskey>()(`${meta.id}.action.redeem-passkey`, {
|
|
82
81
|
input: Schema.Void,
|
|
83
82
|
output: Schema.Void,
|
|
84
83
|
}) {}
|
|
85
84
|
|
|
86
|
-
export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}
|
|
85
|
+
export class RedeemToken extends Schema.TaggedClass<RedeemToken>()(`${meta.id}.action.redeem-token`, {
|
|
87
86
|
input: Schema.Struct({
|
|
88
87
|
token: Schema.String,
|
|
89
88
|
}),
|
|
@@ -91,115 +90,6 @@ export namespace ClientAction {
|
|
|
91
90
|
}) {}
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
const CLIENT_OPERATION = `${meta.id}/operation`;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Operations for the Client plugin.
|
|
98
|
-
*/
|
|
99
|
-
export namespace ClientOperation {
|
|
100
|
-
const ProfileSchema = Schema.Struct({
|
|
101
|
-
displayName: Schema.optional(Schema.String),
|
|
102
|
-
avatarCid: Schema.optional(Schema.String),
|
|
103
|
-
data: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
export const CreateIdentity = Operation.make({
|
|
107
|
-
meta: { key: `${CLIENT_OPERATION}/create-identity`, name: 'Create Identity' },
|
|
108
|
-
services: [Capability.Service],
|
|
109
|
-
schema: {
|
|
110
|
-
input: ProfileSchema,
|
|
111
|
-
output: IdentitySchema,
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
export const JoinIdentity = Operation.make({
|
|
116
|
-
meta: { key: `${CLIENT_OPERATION}/join-identity`, name: 'Join Identity' },
|
|
117
|
-
services: [Capability.Service],
|
|
118
|
-
schema: {
|
|
119
|
-
input: Schema.Struct({
|
|
120
|
-
invitationCode: Schema.optional(Schema.String),
|
|
121
|
-
}),
|
|
122
|
-
output: Schema.Void,
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
export const ShareIdentity = Operation.make({
|
|
127
|
-
meta: { key: `${CLIENT_OPERATION}/share-identity`, name: 'Share Identity' },
|
|
128
|
-
services: [Capability.Service],
|
|
129
|
-
schema: {
|
|
130
|
-
input: Schema.Void,
|
|
131
|
-
output: Schema.Void,
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
export const RecoverIdentity = Operation.make({
|
|
136
|
-
meta: { key: `${CLIENT_OPERATION}/recover-identity`, name: 'Recover Identity' },
|
|
137
|
-
services: [Capability.Service],
|
|
138
|
-
schema: {
|
|
139
|
-
input: Schema.Void,
|
|
140
|
-
output: Schema.Void,
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
export const ResetStorage = Operation.make({
|
|
145
|
-
meta: { key: `${CLIENT_OPERATION}/reset-storage`, name: 'Reset Storage' },
|
|
146
|
-
services: [Capability.Service],
|
|
147
|
-
schema: {
|
|
148
|
-
input: Schema.Struct({
|
|
149
|
-
mode: Schema.optional(Schema.String),
|
|
150
|
-
}),
|
|
151
|
-
output: Schema.Void,
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
export const CreateAgent = Operation.make({
|
|
156
|
-
meta: { key: `${CLIENT_OPERATION}/create-agent`, name: 'Create Agent' },
|
|
157
|
-
services: [Capability.Service],
|
|
158
|
-
schema: {
|
|
159
|
-
input: Schema.Void,
|
|
160
|
-
output: Schema.Void,
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
export const CreateRecoveryCode = Operation.make({
|
|
165
|
-
meta: { key: `${CLIENT_OPERATION}/create-recovery-code`, name: 'Create Recovery Code' },
|
|
166
|
-
services: [Capability.Service],
|
|
167
|
-
schema: {
|
|
168
|
-
input: Schema.Void,
|
|
169
|
-
output: Schema.Void,
|
|
170
|
-
},
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
export const CreatePasskey = Operation.make({
|
|
174
|
-
meta: { key: `${CLIENT_OPERATION}/create-passkey`, name: 'Create Passkey' },
|
|
175
|
-
services: [Capability.Service],
|
|
176
|
-
schema: {
|
|
177
|
-
input: Schema.Void,
|
|
178
|
-
output: Schema.Void,
|
|
179
|
-
},
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
export const RedeemPasskey = Operation.make({
|
|
183
|
-
meta: { key: `${CLIENT_OPERATION}/redeem-passkey`, name: 'Redeem Passkey' },
|
|
184
|
-
services: [Capability.Service],
|
|
185
|
-
schema: {
|
|
186
|
-
input: Schema.Void,
|
|
187
|
-
output: Schema.Void,
|
|
188
|
-
},
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
export const RedeemToken = Operation.make({
|
|
192
|
-
meta: { key: `${CLIENT_OPERATION}/redeem-token`, name: 'Redeem Token' },
|
|
193
|
-
services: [Capability.Service],
|
|
194
|
-
schema: {
|
|
195
|
-
input: Schema.Struct({
|
|
196
|
-
token: Schema.String,
|
|
197
|
-
}),
|
|
198
|
-
output: Schema.Void,
|
|
199
|
-
},
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
93
|
export type ClientPluginOptions = ClientOptions & {
|
|
204
94
|
/**
|
|
205
95
|
* Base origin for the invitation link.
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ClientOperation
|
|
3
|
-
} from "./chunk-DPAXDXMK.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-N2GMSVDQ.mjs";
|
|
7
|
-
|
|
8
|
-
// src/containers/DevicesContainer/DevicesContainer.tsx
|
|
9
|
-
import React, { useCallback, useEffect, useState } from "react";
|
|
10
|
-
import { QR } from "react-qr-rounded";
|
|
11
|
-
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
12
|
-
import { log } from "@dxos/log";
|
|
13
|
-
import { useClient, useMulticastObservable } from "@dxos/react-client";
|
|
14
|
-
import { useDevices } from "@dxos/react-client/halo";
|
|
15
|
-
import { Invitation, InvitationEncoder } from "@dxos/react-client/invitations";
|
|
16
|
-
import { useNetworkStatus } from "@dxos/react-client/mesh";
|
|
17
|
-
import { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from "@dxos/react-ui";
|
|
18
|
-
import { Settings } from "@dxos/react-ui-form";
|
|
19
|
-
import { AuthCode, Centered, DeviceListItem, Emoji, Viewport, translationKey } from "@dxos/shell/react";
|
|
20
|
-
import { osTranslations } from "@dxos/ui-theme";
|
|
21
|
-
import { hexToEmoji } from "@dxos/util";
|
|
22
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/containers/DevicesContainer/DevicesContainer.tsx";
|
|
23
|
-
var DevicesContainer = ({ createInvitationUrl }) => {
|
|
24
|
-
const { t } = useTranslation(translationKey);
|
|
25
|
-
const { invokePromise } = useOperationInvoker();
|
|
26
|
-
const devices = useDevices();
|
|
27
|
-
const { swarm: connectionState } = useNetworkStatus();
|
|
28
|
-
const handleResetStorage = useCallback(() => invokePromise(ClientOperation.ResetStorage, {}), [
|
|
29
|
-
invokePromise
|
|
30
|
-
]);
|
|
31
|
-
const handleRecover = useCallback(() => invokePromise(ClientOperation.ResetStorage, {
|
|
32
|
-
mode: "recover"
|
|
33
|
-
}), [
|
|
34
|
-
invokePromise
|
|
35
|
-
]);
|
|
36
|
-
const handleJoinNewIdentity = useCallback(() => invokePromise(ClientOperation.ResetStorage, {
|
|
37
|
-
mode: "join new identity"
|
|
38
|
-
}), [
|
|
39
|
-
invokePromise
|
|
40
|
-
]);
|
|
41
|
-
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
42
|
-
title: t("devices verbose label", {
|
|
43
|
-
ns: meta.id
|
|
44
|
-
}),
|
|
45
|
-
description: t("devices description", {
|
|
46
|
-
ns: meta.id
|
|
47
|
-
})
|
|
48
|
-
}, /* @__PURE__ */ React.createElement(Settings.Frame, null, /* @__PURE__ */ React.createElement(Settings.FrameItem, {
|
|
49
|
-
title: t("devices label", {
|
|
50
|
-
ns: meta.id
|
|
51
|
-
})
|
|
52
|
-
}, /* @__PURE__ */ React.createElement(List, null, devices.map((device) => /* @__PURE__ */ React.createElement(DeviceListItem, {
|
|
53
|
-
key: device.deviceKey.toHex(),
|
|
54
|
-
device,
|
|
55
|
-
connectionState
|
|
56
|
-
})))), createInvitationUrl && /* @__PURE__ */ React.createElement(Settings.FrameItem, {
|
|
57
|
-
title: "Add device"
|
|
58
|
-
}, /* @__PURE__ */ React.createElement(DeviceInvitation, {
|
|
59
|
-
createInvitationUrl
|
|
60
|
-
})))), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
61
|
-
title: t("danger zone title", {
|
|
62
|
-
ns: meta.id
|
|
63
|
-
}),
|
|
64
|
-
description: t("danger zone description", {
|
|
65
|
-
ns: meta.id
|
|
66
|
-
})
|
|
67
|
-
}, /* @__PURE__ */ React.createElement(Settings.Group, null, /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
68
|
-
title: t("reset device label"),
|
|
69
|
-
description: t("reset device description", {
|
|
70
|
-
ns: meta.id
|
|
71
|
-
})
|
|
72
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
73
|
-
variant: "destructive",
|
|
74
|
-
onClick: handleResetStorage,
|
|
75
|
-
"data-testid": "devicesContainer.reset"
|
|
76
|
-
}, t("reset device label"))), /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
77
|
-
title: t("recover identity label"),
|
|
78
|
-
description: t("recover identity description", {
|
|
79
|
-
ns: meta.id
|
|
80
|
-
})
|
|
81
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
82
|
-
variant: "destructive",
|
|
83
|
-
onClick: handleRecover,
|
|
84
|
-
"data-testid": "devicesContainer.recover"
|
|
85
|
-
}, t("recover identity label"))), /* @__PURE__ */ React.createElement(Settings.Item, {
|
|
86
|
-
title: t("join new identity label"),
|
|
87
|
-
description: t("join new identity description", {
|
|
88
|
-
ns: meta.id
|
|
89
|
-
})
|
|
90
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
91
|
-
variant: "destructive",
|
|
92
|
-
onClick: handleJoinNewIdentity,
|
|
93
|
-
"data-testid": "devicesContainer.joinExisting"
|
|
94
|
-
}, t("join new identity label")))))));
|
|
95
|
-
};
|
|
96
|
-
var DeviceInvitation = (props) => {
|
|
97
|
-
const client = useClient();
|
|
98
|
-
const [invitation, setInvitation] = useState();
|
|
99
|
-
const onInvitationCreate = useCallback(() => {
|
|
100
|
-
const invitation2 = client.halo.share();
|
|
101
|
-
if (client.config.values.runtime?.app?.env?.DX_ENVIRONMENT !== "production") {
|
|
102
|
-
const subscription = invitation2.subscribe((invitation3) => {
|
|
103
|
-
const invitationCode = InvitationEncoder.encode(invitation3);
|
|
104
|
-
if (invitation3.state === Invitation.State.CONNECTING) {
|
|
105
|
-
log.info(JSON.stringify({
|
|
106
|
-
invitationCode,
|
|
107
|
-
authCode: invitation3.authCode
|
|
108
|
-
}), void 0, {
|
|
109
|
-
F: __dxlog_file,
|
|
110
|
-
L: 117,
|
|
111
|
-
S: void 0,
|
|
112
|
-
C: (f, a) => f(...a)
|
|
113
|
-
});
|
|
114
|
-
subscription.unsubscribe();
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
setInvitation(invitation2);
|
|
119
|
-
}, [
|
|
120
|
-
client
|
|
121
|
-
]);
|
|
122
|
-
const onInvitationDone = useCallback(() => {
|
|
123
|
-
setInvitation(void 0);
|
|
124
|
-
}, []);
|
|
125
|
-
if (invitation) {
|
|
126
|
-
return /* @__PURE__ */ React.createElement(DeviceInvitationImpl, {
|
|
127
|
-
...props,
|
|
128
|
-
invitation,
|
|
129
|
-
onInvitationCreate,
|
|
130
|
-
onInvitationDone
|
|
131
|
-
});
|
|
132
|
-
} else {
|
|
133
|
-
return /* @__PURE__ */ React.createElement(InvitationSection, {
|
|
134
|
-
...props,
|
|
135
|
-
onInvitationCreate,
|
|
136
|
-
onInvitationDone
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
var DeviceInvitationImpl = ({ invitation: invitationObservable, createInvitationUrl, onInvitationDone, onInvitationCreate }) => {
|
|
141
|
-
const invitation = useMulticastObservable(invitationObservable);
|
|
142
|
-
const url = createInvitationUrl(InvitationEncoder.encode(invitation));
|
|
143
|
-
useEffect(() => {
|
|
144
|
-
if (invitation.state >= Invitation.State.SUCCESS) {
|
|
145
|
-
onInvitationDone();
|
|
146
|
-
}
|
|
147
|
-
}, [
|
|
148
|
-
invitation.state
|
|
149
|
-
]);
|
|
150
|
-
return /* @__PURE__ */ React.createElement(InvitationSection, {
|
|
151
|
-
...invitation,
|
|
152
|
-
url,
|
|
153
|
-
onInvitationDone,
|
|
154
|
-
onInvitationCreate
|
|
155
|
-
});
|
|
156
|
-
};
|
|
157
|
-
var InvitationSection = ({ state = -1, authCode, invitationId = "never", url = "never", onInvitationDone = () => {
|
|
158
|
-
}, onInvitationCreate = () => {
|
|
159
|
-
} }) => {
|
|
160
|
-
const { t } = useTranslation(meta.id);
|
|
161
|
-
const activeView = state < 0 ? "init" : state >= Invitation.State.CANCELLED ? "complete" : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode ? "auth-code" : "qr-code";
|
|
162
|
-
return activeView === "init" ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
|
|
163
|
-
className: "text-description mb-2"
|
|
164
|
-
}, t("add device description")), /* @__PURE__ */ React.createElement(IconButton, {
|
|
165
|
-
icon: "ph--plus--regular",
|
|
166
|
-
label: t("create device invitation label"),
|
|
167
|
-
disabled: state >= 0,
|
|
168
|
-
classNames: "w-full",
|
|
169
|
-
"data-testid": "devicesContainer.createInvitation",
|
|
170
|
-
onClick: onInvitationCreate
|
|
171
|
-
})) : /* @__PURE__ */ React.createElement(Viewport.Root, {
|
|
172
|
-
activeView
|
|
173
|
-
}, /* @__PURE__ */ React.createElement(Viewport.Views, null, /* @__PURE__ */ React.createElement(Viewport.View, {
|
|
174
|
-
id: "init"
|
|
175
|
-
}), /* @__PURE__ */ React.createElement(Viewport.View, {
|
|
176
|
-
id: "complete"
|
|
177
|
-
}, /* @__PURE__ */ React.createElement(InvitationComplete, {
|
|
178
|
-
statusValue: state
|
|
179
|
-
})), /* @__PURE__ */ React.createElement(Viewport.View, {
|
|
180
|
-
id: "auth-code"
|
|
181
|
-
}, /* @__PURE__ */ React.createElement(InvitationAuthCode, {
|
|
182
|
-
id: invitationId,
|
|
183
|
-
code: authCode ?? "never",
|
|
184
|
-
onCancel: onInvitationDone
|
|
185
|
-
})), /* @__PURE__ */ React.createElement(Viewport.View, {
|
|
186
|
-
id: "qr-code"
|
|
187
|
-
}, /* @__PURE__ */ React.createElement(InvitationQR, {
|
|
188
|
-
id: invitationId,
|
|
189
|
-
url,
|
|
190
|
-
onCancel: onInvitationDone
|
|
191
|
-
}))));
|
|
192
|
-
};
|
|
193
|
-
var InvitationQR = ({ id, url, onCancel }) => {
|
|
194
|
-
const { t } = useTranslation(osTranslations);
|
|
195
|
-
const qrLabel = useId("devices-container__qr-code");
|
|
196
|
-
const emoji = hexToEmoji(id);
|
|
197
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
|
|
198
|
-
className: "text-description"
|
|
199
|
-
}, t("qr code description", {
|
|
200
|
-
ns: meta.id
|
|
201
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
202
|
-
role: "group",
|
|
203
|
-
className: "grid grid-cols-[1fr_min-content]"
|
|
204
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
205
|
-
className: "flex justify-center py-4"
|
|
206
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
207
|
-
role: "none",
|
|
208
|
-
className: "w-full md:max-w-80 aspect-square relative text-description"
|
|
209
|
-
}, /* @__PURE__ */ React.createElement(QR, {
|
|
210
|
-
rounding: 100,
|
|
211
|
-
backgroundColor: "transparent",
|
|
212
|
-
color: "currentColor",
|
|
213
|
-
"aria-labelledby": qrLabel,
|
|
214
|
-
errorCorrectionLevel: "Q",
|
|
215
|
-
cutout: true
|
|
216
|
-
}, url ?? "never"), /* @__PURE__ */ React.createElement(Centered, null, /* @__PURE__ */ React.createElement(Emoji, {
|
|
217
|
-
text: emoji
|
|
218
|
-
})))), /* @__PURE__ */ React.createElement("span", {
|
|
219
|
-
id: qrLabel,
|
|
220
|
-
className: "sr-only"
|
|
221
|
-
}, t("qr label"))), /* @__PURE__ */ React.createElement("div", {
|
|
222
|
-
className: "flex justify-center"
|
|
223
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
224
|
-
className: "flex gap-2"
|
|
225
|
-
}, /* @__PURE__ */ React.createElement(Clipboard.Button, {
|
|
226
|
-
value: url ?? "never"
|
|
227
|
-
}), /* @__PURE__ */ React.createElement(Button, {
|
|
228
|
-
variant: "ghost",
|
|
229
|
-
onClick: onCancel
|
|
230
|
-
}, t("cancel label")))));
|
|
231
|
-
};
|
|
232
|
-
var InvitationAuthCode = ({ id, code, onCancel }) => {
|
|
233
|
-
const { t } = useTranslation(osTranslations);
|
|
234
|
-
const emoji = hexToEmoji(id);
|
|
235
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("p", {
|
|
236
|
-
className: "text-description"
|
|
237
|
-
}, t("auth other device emoji message")), emoji && /* @__PURE__ */ React.createElement(Emoji, {
|
|
238
|
-
text: emoji,
|
|
239
|
-
className: "mx-auto my-2 text-center"
|
|
240
|
-
}), /* @__PURE__ */ React.createElement("p", {
|
|
241
|
-
className: "text-description"
|
|
242
|
-
}, t("auth code message")), /* @__PURE__ */ React.createElement(AuthCode, {
|
|
243
|
-
code,
|
|
244
|
-
large: true,
|
|
245
|
-
classNames: "mx-auto my-2 text-center grow"
|
|
246
|
-
}), /* @__PURE__ */ React.createElement(Button, {
|
|
247
|
-
variant: "ghost",
|
|
248
|
-
onClick: onCancel
|
|
249
|
-
}, t("cancel label")));
|
|
250
|
-
};
|
|
251
|
-
var InvitationComplete = ({ statusValue }) => {
|
|
252
|
-
return statusValue > 0 ? /* @__PURE__ */ React.createElement(Icon, {
|
|
253
|
-
icon: "ph--check--regular",
|
|
254
|
-
size: 6,
|
|
255
|
-
classNames: "m-1.5"
|
|
256
|
-
}) : /* @__PURE__ */ React.createElement(Icon, {
|
|
257
|
-
icon: "ph--x--regular",
|
|
258
|
-
size: 6,
|
|
259
|
-
classNames: "m-1.5"
|
|
260
|
-
});
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
// src/containers/DevicesContainer/index.ts
|
|
264
|
-
var DevicesContainer_default = DevicesContainer;
|
|
265
|
-
export {
|
|
266
|
-
DevicesContainer_default as default
|
|
267
|
-
};
|
|
268
|
-
//# sourceMappingURL=DevicesContainer-46MEG3F5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/DevicesContainer/DevicesContainer.tsx", "../../../src/containers/DevicesContainer/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { QR } from 'react-qr-rounded';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { log } from '@dxos/log';\nimport { useClient, useMulticastObservable } from '@dxos/react-client';\nimport { type Device, useDevices } from '@dxos/react-client/halo';\nimport { type CancellableInvitationObservable, Invitation, InvitationEncoder } from '@dxos/react-client/invitations';\nimport { useNetworkStatus } from '@dxos/react-client/mesh';\nimport { Button, Clipboard, Icon, IconButton, List, useId, useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\nimport { AuthCode, Centered, DeviceListItem, Emoji, Viewport, translationKey } from '@dxos/shell/react';\nimport { osTranslations } from '@dxos/ui-theme';\nimport { hexToEmoji } from '@dxos/util';\n\nimport { meta } from '../../meta';\nimport { ClientOperation } from '../../types';\n\nexport type DevicesContainerProps = {\n createInvitationUrl?: (invitationCode: string) => string;\n};\n\nexport const DevicesContainer = ({ createInvitationUrl }: DevicesContainerProps) => {\n const { t } = useTranslation(translationKey);\n const { invokePromise } = useOperationInvoker();\n const devices = useDevices();\n const { swarm: connectionState } = useNetworkStatus();\n\n const handleResetStorage = useCallback(() => invokePromise(ClientOperation.ResetStorage, {}), [invokePromise]);\n\n const handleRecover = useCallback(\n () => invokePromise(ClientOperation.ResetStorage, { mode: 'recover' }),\n [invokePromise],\n );\n\n const handleJoinNewIdentity = useCallback(\n () => invokePromise(ClientOperation.ResetStorage, { mode: 'join new identity' }),\n [invokePromise],\n );\n\n return (\n <Clipboard.Provider>\n <Settings.Root>\n <Settings.Section\n title={t('devices verbose label', { ns: meta.id })}\n description={t('devices description', { ns: meta.id })}\n >\n <Settings.Frame>\n <Settings.FrameItem title={t('devices label', { ns: meta.id })}>\n <List>\n {devices.map((device: Device) => (\n <DeviceListItem key={device.deviceKey.toHex()} device={device} connectionState={connectionState} />\n ))}\n </List>\n </Settings.FrameItem>\n {createInvitationUrl && (\n <Settings.FrameItem title='Add device'>\n <DeviceInvitation createInvitationUrl={createInvitationUrl} />\n </Settings.FrameItem>\n )}\n </Settings.Frame>\n </Settings.Section>\n <Settings.Section\n title={t('danger zone title', { ns: meta.id })}\n description={t('danger zone description', { ns: meta.id })}\n >\n <Settings.Group>\n <Settings.Item title={t('reset device label')} description={t('reset device description', { ns: meta.id })}>\n <Button variant='destructive' onClick={handleResetStorage} data-testid='devicesContainer.reset'>\n {t('reset device label')}\n </Button>\n </Settings.Item>\n <Settings.Item\n title={t('recover identity label')}\n description={t('recover identity description', { ns: meta.id })}\n >\n <Button variant='destructive' onClick={handleRecover} data-testid='devicesContainer.recover'>\n {t('recover identity label')}\n </Button>\n </Settings.Item>\n <Settings.Item\n title={t('join new identity label')}\n description={t('join new identity description', { ns: meta.id })}\n >\n <Button variant='destructive' onClick={handleJoinNewIdentity} data-testid='devicesContainer.joinExisting'>\n {t('join new identity label')}\n </Button>\n </Settings.Item>\n </Settings.Group>\n </Settings.Section>\n </Settings.Root>\n </Clipboard.Provider>\n );\n};\n\ntype DeviceInvitationProps = {\n invitation?: CancellableInvitationObservable;\n createInvitationUrl: (invitationCode: string) => string;\n onInvitationDone: () => void;\n onInvitationCreate: () => void;\n};\n\nconst DeviceInvitation = (props: Pick<DeviceInvitationProps, 'createInvitationUrl'>) => {\n const client = useClient();\n const [invitation, setInvitation] = useState<CancellableInvitationObservable>();\n\n const onInvitationCreate = useCallback(() => {\n const invitation = client.halo.share();\n if (client.config.values.runtime?.app?.env?.DX_ENVIRONMENT !== 'production') {\n const subscription = invitation.subscribe((invitation: Invitation) => {\n const invitationCode = InvitationEncoder.encode(invitation);\n if (invitation.state === Invitation.State.CONNECTING) {\n log.info(JSON.stringify({ invitationCode, authCode: invitation.authCode }));\n subscription.unsubscribe();\n }\n });\n }\n setInvitation(invitation);\n }, [client]);\n\n const onInvitationDone = useCallback(() => {\n setInvitation(undefined);\n }, []);\n\n if (invitation) {\n return <DeviceInvitationImpl {...props} {...{ invitation, onInvitationCreate, onInvitationDone }} />;\n } else {\n return <InvitationSection {...props} {...{ onInvitationCreate, onInvitationDone }} />;\n }\n};\n\nconst DeviceInvitationImpl = ({\n invitation: invitationObservable,\n createInvitationUrl,\n onInvitationDone,\n onInvitationCreate,\n}: DeviceInvitationProps) => {\n const invitation = useMulticastObservable(invitationObservable!);\n const url = createInvitationUrl(InvitationEncoder.encode(invitation));\n\n useEffect(() => {\n if (invitation.state >= Invitation.State.SUCCESS) {\n onInvitationDone();\n }\n }, [invitation.state]);\n\n return <InvitationSection {...invitation} {...{ url, onInvitationDone, onInvitationCreate }} />;\n};\n\ntype InvitationComponentProps = Partial<\n Pick<Invitation, 'authCode' | 'invitationId'> &\n Pick<DeviceInvitationProps, 'onInvitationDone' | 'onInvitationCreate'> & {\n state: number;\n url: string;\n }\n>;\n\nconst InvitationSection = ({\n state = -1,\n authCode,\n invitationId = 'never',\n url = 'never',\n onInvitationDone = () => {},\n onInvitationCreate = () => {},\n}: InvitationComponentProps) => {\n const { t } = useTranslation(meta.id);\n const activeView =\n state < 0\n ? 'init'\n : state >= Invitation.State.CANCELLED\n ? 'complete'\n : state >= Invitation.State.READY_FOR_AUTHENTICATION && authCode\n ? 'auth-code'\n : 'qr-code';\n return activeView === 'init' ? (\n <>\n <p className='text-description mb-2'>{t('add device description')}</p>\n <IconButton\n icon='ph--plus--regular'\n label={t('create device invitation label')}\n disabled={state >= 0}\n classNames='w-full'\n data-testid='devicesContainer.createInvitation'\n onClick={onInvitationCreate}\n />\n </>\n ) : (\n <Viewport.Root activeView={activeView}>\n <Viewport.Views>\n <Viewport.View id='init'>\n {/* This view intentionally left blank while conditionally rendering the viewport. */}\n </Viewport.View>\n <Viewport.View id='complete'>\n <InvitationComplete statusValue={state} />\n </Viewport.View>\n <Viewport.View id='auth-code'>\n <InvitationAuthCode id={invitationId} code={authCode ?? 'never'} onCancel={onInvitationDone} />\n </Viewport.View>\n <Viewport.View id='qr-code'>\n <InvitationQR id={invitationId} url={url} onCancel={onInvitationDone} />\n </Viewport.View>\n </Viewport.Views>\n </Viewport.Root>\n );\n};\n\nconst InvitationQR = ({ id, url, onCancel }: { id: string; url: string; onCancel: () => void }) => {\n const { t } = useTranslation(osTranslations);\n const qrLabel = useId('devices-container__qr-code');\n const emoji = hexToEmoji(id);\n return (\n <>\n <p className='text-description'>{t('qr code description', { ns: meta.id })}</p>\n <div role='group' className='grid grid-cols-[1fr_min-content]'>\n <div className='flex justify-center py-4'>\n <div role='none' className='w-full md:max-w-80 aspect-square relative text-description'>\n <QR\n rounding={100}\n backgroundColor='transparent'\n color='currentColor'\n aria-labelledby={qrLabel}\n errorCorrectionLevel='Q'\n cutout={true}\n >\n {url ?? 'never'}\n </QR>\n <Centered>\n <Emoji text={emoji} />\n </Centered>\n </div>\n </div>\n <span id={qrLabel} className='sr-only'>\n {t('qr label')}\n </span>\n </div>\n {/* TODO(burdon): Factor out button bar */}\n <div className='flex justify-center'>\n <div className='flex gap-2'>\n <Clipboard.Button value={url ?? 'never'} />\n <Button variant='ghost' onClick={onCancel}>\n {t('cancel label')}\n </Button>\n </div>\n </div>\n </>\n );\n};\n\nconst InvitationAuthCode = ({ id, code, onCancel }: { id: string; code: string; onCancel: () => void }) => {\n const { t } = useTranslation(osTranslations);\n const emoji = hexToEmoji(id);\n\n return (\n <>\n <p className='text-description'>{t('auth other device emoji message')}</p>\n {emoji && <Emoji text={emoji} className='mx-auto my-2 text-center' />}\n <p className='text-description'>{t('auth code message')}</p>\n <AuthCode code={code} large classNames='mx-auto my-2 text-center grow' />\n <Button variant='ghost' onClick={onCancel}>\n {t('cancel label')}\n </Button>\n </>\n );\n};\n\nconst InvitationComplete = ({ statusValue }: { statusValue: number }) => {\n return statusValue > 0 ? (\n <Icon icon='ph--check--regular' size={6} classNames='m-1.5' />\n ) : (\n <Icon icon='ph--x--regular' size={6} classNames='m-1.5' />\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { DevicesContainer } from './DevicesContainer';\n\nexport default DevicesContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,OAAOA,SAASC,aAAaC,WAAWC,gBAAgB;AACxD,SAASC,UAAU;AAEnB,SAASC,2BAA2B;AACpC,SAASC,WAAW;AACpB,SAASC,WAAWC,8BAA8B;AAClD,SAAsBC,kBAAkB;AACxC,SAA+CC,YAAYC,yBAAyB;AACpF,SAASC,wBAAwB;AACjC,SAASC,QAAQC,WAAWC,MAAMC,YAAYC,MAAMC,OAAOC,sBAAsB;AACjF,SAASC,gBAAgB;AACzB,SAASC,UAAUC,UAAUC,gBAAgBC,OAAOC,UAAUC,sBAAsB;AACpF,SAASC,sBAAsB;AAC/B,SAASC,kBAAkB;;AASpB,IAAMC,mBAAmB,CAAC,EAAEC,oBAAmB,MAAyB;AAC7E,QAAM,EAAEC,EAAC,IAAK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SAInB,sBAAA,cAACc,QAAAA;IAAK9F,IAAI8E;IAAShB,WAAU;KAC1BvF,EAAE,UAAA,CAAA,CAAA,GAIP,sBAAA,cAAC2G,OAAAA;IAAIpB,WAAU;KACb,sBAAA,cAACoB,OAAAA;IAAIpB,WAAU;KACb,sBAAA,cAACtE,UAAUsB,QAAM;IAACiF,OAAOzC,OAAO;MAChC,sBAAA,cAACxC,QAAAA;IAAOC,SAAQ;IAAQC,SAAS2D;KAC9BpG,EAAE,cAAA,CAAA,CAAA,CAAA,CAAA;AAMf;AAEA,IAAMkG,qBAAqB,CAAC,EAAEzE,IAAI0E,MAAMC,SAAQ,MAAsD;AACpG,QAAM,EAAEpG,EAAC,IAAKC,eAAeqG,cAAAA;AAC7B,QAAMG,QAAQC,WAAWjF,EAAAA;AAEzB,SACE,sBAAA,cAAA,MAAA,UAAA,MACE,sBAAA,cAAC6D,KAAAA;IAAEC,WAAU;KAAoBvF,EAAE,iCAAA,CAAA,GAClCyG,SAAS,sBAAA,cAACY,OAAAA;IAAMC,MAAMb;IAAOlB,WAAU;MACxC,sBAAA,cAACD,KAAAA;IAAEC,WAAU;KAAoBvF,EAAE,mBAAA,CAAA,GACnC,sBAAA,cAACyH,UAAAA;IAAStB;IAAYuB,OAAAA;IAAM9B,YAAW;MACvC,sBAAA,cAACrD,QAAAA;IAAOC,SAAQ;IAAQC,SAAS2D;KAC9BpG,EAAE,cAAA,CAAA,CAAA;AAIX;AAEA,IAAMgG,qBAAqB,CAAC,EAAEC,YAAW,MAA2B;AAClE,SAAOA,cAAc,IACnB,sBAAA,cAAC0B,MAAAA;IAAKlC,MAAK;IAAqBmC,MAAM;IAAGhC,YAAW;OAEpD,sBAAA,cAAC+B,MAAAA;IAAKlC,MAAK;IAAiBmC,MAAM;IAAGhC,YAAW;;AAEpD;;;AC7QA,IAAA,2BAAeiC;",
|
|
6
|
-
"names": ["React", "useCallback", "useEffect", "useState", "QR", "useOperationInvoker", "log", "useClient", "useMulticastObservable", "useDevices", "Invitation", "InvitationEncoder", "useNetworkStatus", "Button", "Clipboard", "Icon", "IconButton", "List", "useId", "useTranslation", "Settings", "AuthCode", "Centered", "DeviceListItem", "Emoji", "Viewport", "translationKey", "osTranslations", "hexToEmoji", "DevicesContainer", "createInvitationUrl", "t", "useTranslation", "translationKey", "invokePromise", "useOperationInvoker", "devices", "useDevices", "swarm", "connectionState", "useNetworkStatus", "handleResetStorage", "useCallback", "ClientOperation", "ResetStorage", "handleRecover", "mode", "handleJoinNewIdentity", "Clipboard", "Provider", "Settings", "Root", "Section", "title", "ns", "meta", "id", "description", "Frame", "FrameItem", "List", "map", "device", "DeviceListItem", "key", "deviceKey", "toHex", "DeviceInvitation", "Group", "Item", "Button", "variant", "onClick", "data-testid", "props", "client", "useClient", "invitation", "setInvitation", "useState", "onInvitationCreate", "halo", "share", "config", "values", "runtime", "app", "env", "DX_ENVIRONMENT", "subscription", "subscribe", "invitationCode", "InvitationEncoder", "encode", "state", "Invitation", "State", "CONNECTING", "log", "info", "JSON", "stringify", "authCode", "unsubscribe", "onInvitationDone", "undefined", "DeviceInvitationImpl", "InvitationSection", "invitationObservable", "useMulticastObservable", "url", "useEffect", "SUCCESS", "invitationId", "activeView", "CANCELLED", "READY_FOR_AUTHENTICATION", "p", "className", "IconButton", "icon", "label", "disabled", "classNames", "Viewport", "Views", "View", "InvitationComplete", "statusValue", "InvitationAuthCode", "code", "onCancel", "InvitationQR", "osTranslations", "qrLabel", "useId", "emoji", "hexToEmoji", "div", "role", "QR", "rounding", "backgroundColor", "color", "aria-labelledby", "errorCorrectionLevel", "cutout", "Centered", "Emoji", "text", "span", "value", "AuthCode", "large", "Icon", "size", "DevicesContainer"]
|
|
7
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ClientOperation
|
|
3
|
-
} from "./chunk-DPAXDXMK.mjs";
|
|
4
|
-
import {
|
|
5
|
-
meta
|
|
6
|
-
} from "./chunk-N2GMSVDQ.mjs";
|
|
7
|
-
|
|
8
|
-
// src/containers/JoinDialog/JoinDialog.tsx
|
|
9
|
-
import React, { useCallback } from "react";
|
|
10
|
-
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
11
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
12
|
-
import { ObservabilityOperation } from "@dxos/plugin-observability/types";
|
|
13
|
-
import { Dialog, useTranslation } from "@dxos/react-ui";
|
|
14
|
-
import { JoinPanel } from "@dxos/shell/react";
|
|
15
|
-
import { osTranslations } from "@dxos/ui-theme";
|
|
16
|
-
var JoinDialog = (props) => {
|
|
17
|
-
const { invokePromise } = useOperationInvoker();
|
|
18
|
-
const { t } = useTranslation(meta.id);
|
|
19
|
-
const handleCancelResetStorage = useCallback(() => invokePromise(ClientOperation.ShareIdentity), [
|
|
20
|
-
invokePromise
|
|
21
|
-
]);
|
|
22
|
-
const handleDone = useCallback(async (result) => {
|
|
23
|
-
if (result?.identityKey) {
|
|
24
|
-
await Promise.all([
|
|
25
|
-
invokePromise(LayoutOperation.UpdateDialog, {
|
|
26
|
-
state: false
|
|
27
|
-
}),
|
|
28
|
-
invokePromise(ObservabilityOperation.SendEvent, {
|
|
29
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
30
|
-
})
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
}, [
|
|
34
|
-
invokePromise
|
|
35
|
-
]);
|
|
36
|
-
return /* @__PURE__ */ React.createElement(Dialog.Content, null, /* @__PURE__ */ React.createElement(Dialog.Header, null, /* @__PURE__ */ React.createElement(Dialog.Title, {
|
|
37
|
-
classNames: "sr-only"
|
|
38
|
-
}, t("join space label", {
|
|
39
|
-
ns: osTranslations
|
|
40
|
-
}))), /* @__PURE__ */ React.createElement(JoinPanel, {
|
|
41
|
-
mode: "halo-only",
|
|
42
|
-
...props,
|
|
43
|
-
exitActionParent: /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
44
|
-
asChild: true
|
|
45
|
-
}),
|
|
46
|
-
doneActionParent: /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
47
|
-
asChild: true
|
|
48
|
-
}),
|
|
49
|
-
onCancelResetStorage: handleCancelResetStorage,
|
|
50
|
-
onDone: handleDone
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/containers/JoinDialog/index.ts
|
|
55
|
-
var JoinDialog_default = JoinDialog;
|
|
56
|
-
export {
|
|
57
|
-
JoinDialog_default as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=JoinDialog-2RCYK4O5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/JoinDialog/JoinDialog.tsx", "../../../src/containers/JoinDialog/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation } from '@dxos/app-toolkit';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/types';\nimport { type InvitationResult } from '@dxos/react-client/invitations';\nimport { Dialog, useTranslation } from '@dxos/react-ui';\nimport { JoinPanel, type JoinPanelProps } from '@dxos/shell/react';\nimport { osTranslations } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\nimport { ClientOperation } from '../../types';\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { invokePromise } = useOperationInvoker();\n const { t } = useTranslation(meta.id);\n\n const handleCancelResetStorage = useCallback(() => invokePromise(ClientOperation.ShareIdentity), [invokePromise]);\n\n const handleDone = useCallback(\n async (result: InvitationResult | null) => {\n if (result?.identityKey) {\n await Promise.all([\n invokePromise(LayoutOperation.UpdateDialog, { state: false }),\n invokePromise(ObservabilityOperation.SendEvent, {\n name: props.initialDisposition === 'recover-identity' ? 'identity.recover' : 'identity.join',\n }),\n ]);\n }\n },\n [invokePromise],\n );\n\n return (\n <Dialog.Content>\n <Dialog.Header>\n <Dialog.Title classNames='sr-only'>{t('join space label', { ns: osTranslations })}</Dialog.Title>\n </Dialog.Header>\n <JoinPanel\n mode='halo-only'\n {...props}\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Content>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { JoinDialog } from './JoinDialog';\n\nexport default JoinDialog;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,OAAOA,SAASC,mBAAmB;AAEnC,SAASC,2BAA2B;AACpC,SAASC,uBAAuB;AAChC,SAASC,8BAA8B;AAEvC,SAASC,QAAQC,sBAAsB;AACvC,SAASC,iBAAsC;AAC/C,SAASC,sBAAsB;AAKxB,IAAMC,aAAa,CAACC,UAAAA;AACzB,QAAM,EAAEC,cAAa,IAAKC,oBAAAA;AAC1B,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,QAAMC,2BAA2BC,YAAY,MAAMP,cAAcQ,gBAAgBC,aAAa,GAAG;IAACT;GAAc;AAEhH,QAAMU,aAAaH,YACjB,OAAOI,WAAAA;AACL,QAAIA,QAAQC,aAAa;AACvB,YAAMC,QAAQC,IAAI;QAChBd,cAAce,gBAAgBC,cAAc;UAAEC,OAAO;QAAM,CAAA;QAC3DjB,cAAckB,uBAAuBC,WAAW;UAC9CC,MAAMrB,MAAMsB,uBAAuB,qBAAqB,qBAAqB;QAC/E,CAAA;OACD;IACH;EACF,GACA;IAACrB;GAAc;AAGjB,SACE,sBAAA,cAACsB,OAAOC,SAAO,MACb,sBAAA,cAACD,OAAOE,QAAM,MACZ,sBAAA,cAACF,OAAOG,OAAK;IAACC,YAAW;KAAWxB,EAAE,oBAAoB;IAAEyB,IAAIC;EAAe,CAAA,CAAA,CAAA,GAEjF,sBAAA,cAACC,WAAAA;IACCC,MAAK;IACJ,GAAG/B;IACJgC,kBAAkB,sBAAA,cAACT,OAAOU,OAAK;MAACC,SAAAA;;IAChCC,kBAAkB,sBAAA,cAACZ,OAAOU,OAAK;MAACC,SAAAA;;IAChCE,sBAAsB7B;IACtB8B,QAAQ1B;;AAIhB;;;AC9CA,IAAA,qBAAe2B;",
|
|
6
|
-
"names": ["React", "useCallback", "useOperationInvoker", "LayoutOperation", "ObservabilityOperation", "Dialog", "useTranslation", "JoinPanel", "osTranslations", "JoinDialog", "props", "invokePromise", "useOperationInvoker", "t", "useTranslation", "meta", "id", "handleCancelResetStorage", "useCallback", "ClientOperation", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "LayoutOperation", "UpdateDialog", "state", "ObservabilityOperation", "SendEvent", "name", "initialDisposition", "Dialog", "Content", "Header", "Title", "classNames", "ns", "osTranslations", "JoinPanel", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone", "JoinDialog"]
|
|
7
|
-
}
|