@dxos/plugin-client 0.10.0 → 0.11.0
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/ClientPlugin.mjs +65 -0
- package/dist/lib/ClientPlugin.mjs.map +1 -0
- package/dist/lib/ClientPlugin.node.mjs +904 -0
- package/dist/lib/ClientPlugin.node.mjs.map +1 -0
- package/dist/lib/ClientPlugin.workerd.mjs +10 -0
- package/dist/lib/ClientPlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities/node.mjs +13 -0
- package/dist/lib/capabilities/node.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +23 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-AccountContainer.mjs +190 -0
- package/dist/lib/chunk-AccountContainer.mjs.map +1 -0
- package/dist/lib/chunk-DevicesContainer.mjs +275 -0
- package/dist/lib/chunk-DevicesContainer.mjs.map +1 -0
- package/dist/lib/chunk-InvitationsContainer.mjs +149 -0
- package/dist/lib/chunk-InvitationsContainer.mjs.map +1 -0
- package/dist/lib/chunk-JoinDialog.mjs +35 -0
- package/dist/lib/chunk-JoinDialog.mjs.map +1 -0
- package/dist/lib/chunk-ProfileContainer.mjs +145 -0
- package/dist/lib/chunk-ProfileContainer.mjs.map +1 -0
- package/dist/lib/chunk-RecoveryCodeDialog.mjs +72 -0
- package/dist/lib/chunk-RecoveryCodeDialog.mjs.map +1 -0
- package/dist/lib/chunk-RecoveryCredentialsContainer.mjs +65 -0
- package/dist/lib/chunk-RecoveryCredentialsContainer.mjs.map +1 -0
- package/dist/lib/chunk-ResetDialog.mjs +47 -0
- package/dist/lib/chunk-ResetDialog.mjs.map +1 -0
- package/dist/lib/chunk-UsageContainer.mjs +217 -0
- package/dist/lib/chunk-UsageContainer.mjs.map +1 -0
- package/dist/lib/{neutral/account-cache-YVQKLNV2.mjs → chunk-account-cache.mjs} +10 -12
- package/dist/lib/chunk-account-cache.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +111 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-client.mjs +90 -0
- package/dist/lib/chunk-client.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-GSKMAS3S.mjs → chunk-constants.mjs} +5 -8
- package/dist/lib/chunk-constants.mjs.map +1 -0
- package/dist/lib/chunk-create-agent.mjs +23 -0
- package/dist/lib/chunk-create-agent.mjs.map +1 -0
- package/dist/lib/chunk-create-identity.mjs +28 -0
- package/dist/lib/chunk-create-identity.mjs.map +1 -0
- package/dist/lib/chunk-create-passkey.mjs +85 -0
- package/dist/lib/chunk-create-passkey.mjs.map +1 -0
- package/dist/lib/chunk-create-recovery-code.mjs +31 -0
- package/dist/lib/chunk-create-recovery-code.mjs.map +1 -0
- package/dist/lib/chunk-hooks.mjs +29 -0
- package/dist/lib/chunk-hooks.mjs.map +1 -0
- package/dist/lib/chunk-hub-http-client.mjs +14 -0
- package/dist/lib/chunk-hub-http-client.mjs.map +1 -0
- package/dist/lib/chunk-join-identity.mjs +20 -0
- package/dist/lib/chunk-join-identity.mjs.map +1 -0
- package/dist/lib/chunk-layer-specs.mjs +107 -0
- package/dist/lib/chunk-layer-specs.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-6G4KZLBG.mjs → chunk-meta.mjs} +13 -20
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-migrations.mjs +29 -0
- package/dist/lib/chunk-migrations.mjs.map +1 -0
- package/dist/lib/chunk-navigation-handler.mjs +71 -0
- package/dist/lib/chunk-navigation-handler.mjs.map +1 -0
- package/dist/lib/chunk-navigation-target-loader.mjs +46 -0
- package/dist/lib/chunk-navigation-target-loader.mjs.map +1 -0
- package/dist/lib/chunk-open-usage.mjs +14 -0
- package/dist/lib/chunk-open-usage.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +11 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-operations.mjs +212 -0
- package/dist/lib/chunk-operations.mjs.map +1 -0
- package/dist/lib/chunk-progress.mjs +10 -0
- package/dist/lib/chunk-progress.mjs.map +1 -0
- package/dist/lib/chunk-react-context.mjs +30 -0
- package/dist/lib/chunk-react-context.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +70 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-recover-identity.mjs +17 -0
- package/dist/lib/chunk-recover-identity.mjs.map +1 -0
- package/dist/lib/chunk-redeem-passkey.mjs +72 -0
- package/dist/lib/chunk-redeem-passkey.mjs.map +1 -0
- package/dist/lib/chunk-redeem-token.mjs +24 -0
- package/dist/lib/chunk-redeem-token.mjs.map +1 -0
- package/dist/lib/chunk-remote-trace-monitor.mjs +37 -0
- package/dist/lib/chunk-remote-trace-monitor.mjs.map +1 -0
- package/dist/lib/chunk-reset-storage.mjs +17 -0
- package/dist/lib/chunk-reset-storage.mjs.map +1 -0
- package/dist/lib/chunk-resolve-navigation-targets.mjs +32 -0
- package/dist/lib/chunk-resolve-navigation-targets.mjs.map +1 -0
- package/dist/lib/chunk-schema-defs.mjs +53 -0
- package/dist/lib/chunk-schema-defs.mjs.map +1 -0
- package/dist/lib/chunk-share-identity.mjs +16 -0
- package/dist/lib/chunk-share-identity.mjs.map +1 -0
- package/dist/lib/chunk-space-replication-progress.mjs +94 -0
- package/dist/lib/chunk-space-replication-progress.mjs.map +1 -0
- package/dist/lib/chunk-trace-progress.mjs +69 -0
- package/dist/lib/chunk-trace-progress.mjs.map +1 -0
- package/dist/lib/chunk-update-profile.mjs +15 -0
- package/dist/lib/chunk-update-profile.mjs.map +1 -0
- package/dist/lib/components.mjs +0 -0
- package/dist/lib/containers.mjs +15 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +27 -0
- package/dist/lib/index.mjs.map +1 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/operations.mjs +2 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/testing.mjs +21 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +111 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +139 -0
- package/dist/lib/types.mjs.map +1 -0
- package/dist/types/src/ClientPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/account-cache.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/client.d.ts +1 -1
- package/dist/types/src/capabilities/client.d.ts.map +1 -1
- package/dist/types/src/capabilities/hub-http-client.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +6 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +1 -1
- package/dist/types/src/capabilities/migrations.d.ts +1 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts +3 -1
- package/dist/types/src/capabilities/navigation-handler/navigation-handler.d.ts.map +1 -1
- package/dist/types/src/capabilities/navigation-target-loader.d.ts +11 -0
- package/dist/types/src/capabilities/navigation-target-loader.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +2 -1
- package/dist/types/src/capabilities/node.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/remote-trace-monitor.d.ts +15 -0
- package/dist/types/src/capabilities/remote-trace-monitor.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema-defs.d.ts +1 -1
- package/dist/types/src/capabilities/space-replication-progress.d.ts +11 -0
- package/dist/types/src/capabilities/space-replication-progress.d.ts.map +1 -0
- package/dist/types/src/capabilities/trace-progress.d.ts +17 -0
- package/dist/types/src/capabilities/trace-progress.d.ts.map +1 -0
- package/dist/types/src/commands/account/login/login.d.ts +2 -1
- package/dist/types/src/commands/account/login/login.d.ts.map +1 -1
- package/dist/types/src/commands/account/logout/logout.d.ts +1 -1
- package/dist/types/src/commands/account/logout/logout.d.ts.map +1 -1
- package/dist/types/src/commands/halo/index.d.ts.map +1 -1
- package/dist/types/src/commands/halo/share/share.d.ts.map +1 -1
- package/dist/types/src/commands/profile/create.d.ts.map +1 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.d.ts +4 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.d.ts.map +1 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/AccountContainer/AccountContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts +4 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.d.ts.map +1 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/DevicesContainer/DevicesContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.d.ts +4 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/InvitationsContainer/InvitationsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts +4 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts +4 -1
- package/dist/types/src/containers/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts +4 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/ProfileContainer/ProfileContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts +4 -1
- package/dist/types/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts +4 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts +4 -1
- package/dist/types/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.stories.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts +4 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.d.ts.map +1 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts +4 -1
- package/dist/types/src/containers/ResetDialog/ResetDialog.stories.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageContainer.d.ts +4 -5
- package/dist/types/src/containers/UsageContainer/UsageContainer.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageView.d.ts +4 -7
- package/dist/types/src/containers/UsageContainer/UsageView.d.ts.map +1 -1
- package/dist/types/src/containers/UsageContainer/UsageView.stories.d.ts +4 -2
- package/dist/types/src/containers/UsageContainer/UsageView.stories.d.ts.map +1 -1
- package/dist/types/src/halo-services-layer.d.ts +19 -0
- package/dist/types/src/halo-services-layer.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/operations/definitions.d.ts +9 -1
- package/dist/types/src/operations/definitions.d.ts.map +1 -1
- package/dist/types/src/operations/errors.d.ts +109 -0
- package/dist/types/src/operations/errors.d.ts.map +1 -0
- package/dist/types/src/operations/errors.test.d.ts +2 -0
- package/dist/types/src/operations/errors.test.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +1 -0
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/redeem-passkey.d.ts.map +1 -1
- package/dist/types/src/operations/resolve-navigation-targets.d.ts +5 -0
- package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
- package/dist/types/src/operations/update-profile.d.ts +5 -0
- package/dist/types/src/operations/update-profile.d.ts.map +1 -0
- package/dist/types/src/progress/index.d.ts +2 -0
- package/dist/types/src/progress/index.d.ts.map +1 -0
- package/dist/types/src/progress/progress-keys.d.ts +6 -0
- package/dist/types/src/progress/progress-keys.d.ts.map +1 -0
- package/dist/types/src/testing/initializeIdentity.d.ts +5 -1
- package/dist/types/src/testing/initializeIdentity.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +10 -1
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +6 -0
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +60 -55
- package/src/ClientPlugin.ts +25 -2
- package/src/capabilities/app-graph-builder.ts +1 -1
- package/src/capabilities/client.ts +26 -0
- package/src/capabilities/index.ts +10 -0
- package/src/capabilities/layer-specs.ts +64 -2
- package/src/capabilities/migrations.ts +9 -1
- package/src/capabilities/navigation-handler/navigation-handler.ts +20 -3
- package/src/capabilities/navigation-target-loader.ts +70 -0
- package/src/capabilities/react-context.tsx +20 -2
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +14 -12
- package/src/capabilities/remote-trace-monitor.ts +62 -0
- package/src/capabilities/space-replication-progress.ts +143 -0
- package/src/capabilities/trace-progress.ts +84 -0
- package/src/commands/account/login/login.ts +48 -6
- package/src/commands/account/logout/logout.ts +4 -0
- package/src/commands/halo/index.ts +6 -2
- package/src/commands/halo/share/share.ts +16 -5
- package/src/commands/profile/create.ts +23 -40
- package/src/containers/AccountContainer/AccountContainer.tsx +6 -5
- package/src/containers/DevicesContainer/DevicesContainer.tsx +2 -0
- package/src/containers/InvitationsContainer/InvitationsContainer.tsx +2 -0
- package/src/containers/JoinDialog/JoinDialog.tsx +2 -0
- package/src/containers/ProfileContainer/ProfileContainer.tsx +19 -13
- package/src/containers/RecoveryCodeDialog/RecoveryCodeDialog.tsx +2 -0
- package/src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx +7 -9
- package/src/containers/ResetDialog/ResetDialog.tsx +2 -0
- package/src/containers/UsageContainer/UsageContainer.tsx +10 -1
- package/src/containers/UsageContainer/UsageView.stories.tsx +0 -12
- package/src/containers/UsageContainer/UsageView.tsx +9 -10
- package/src/halo-services-layer.ts +29 -0
- package/src/index.ts +9 -0
- package/src/operations/definitions.ts +9 -1
- package/src/operations/errors.test.ts +27 -0
- package/src/operations/errors.ts +47 -0
- package/src/operations/index.ts +3 -0
- package/src/operations/open-usage.ts +3 -3
- package/src/operations/redeem-passkey.ts +85 -55
- package/src/operations/resolve-navigation-targets.ts +71 -0
- package/src/operations/share-identity.ts +3 -3
- package/src/operations/update-profile.ts +20 -0
- package/src/progress/index.ts +5 -0
- package/src/progress/progress-keys.ts +15 -0
- package/src/testing/initializeIdentity.ts +10 -2
- package/src/translations.ts +2 -0
- package/src/types/capabilities.ts +15 -1
- package/src/types/schema.ts +7 -0
- package/dist/lib/neutral/AccountContainer-7SF53UON.mjs +0 -186
- package/dist/lib/neutral/AccountContainer-7SF53UON.mjs.map +0 -7
- package/dist/lib/neutral/ClientPlugin.mjs +0 -72
- package/dist/lib/neutral/ClientPlugin.mjs.map +0 -7
- package/dist/lib/neutral/ClientPlugin.node.mjs +0 -1156
- package/dist/lib/neutral/ClientPlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/ClientPlugin.workerd.mjs +0 -16
- package/dist/lib/neutral/ClientPlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/DevicesContainer-PRWIN36N.mjs +0 -271
- package/dist/lib/neutral/DevicesContainer-PRWIN36N.mjs.map +0 -7
- package/dist/lib/neutral/InvitationsContainer-BI5RAWET.mjs +0 -143
- package/dist/lib/neutral/InvitationsContainer-BI5RAWET.mjs.map +0 -7
- package/dist/lib/neutral/JoinDialog-4BWV4CYB.mjs +0 -53
- package/dist/lib/neutral/JoinDialog-4BWV4CYB.mjs.map +0 -7
- package/dist/lib/neutral/ProfileContainer-YEAYOTX5.mjs +0 -169
- package/dist/lib/neutral/ProfileContainer-YEAYOTX5.mjs.map +0 -7
- package/dist/lib/neutral/RecoveryCodeDialog-7EPNKCLB.mjs +0 -59
- package/dist/lib/neutral/RecoveryCodeDialog-7EPNKCLB.mjs.map +0 -7
- package/dist/lib/neutral/RecoveryCredentialsContainer-6BZ2IWX7.mjs +0 -60
- package/dist/lib/neutral/RecoveryCredentialsContainer-6BZ2IWX7.mjs.map +0 -7
- package/dist/lib/neutral/ResetDialog-KUWX45JY.mjs +0 -57
- package/dist/lib/neutral/ResetDialog-KUWX45JY.mjs.map +0 -7
- package/dist/lib/neutral/UsageContainer-2DWCVVE4.mjs +0 -241
- package/dist/lib/neutral/UsageContainer-2DWCVVE4.mjs.map +0 -7
- package/dist/lib/neutral/account-cache-YVQKLNV2.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-RVXTD6OE.mjs +0 -159
- package/dist/lib/neutral/app-graph-builder-RVXTD6OE.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -34
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/node.mjs +0 -21
- package/dist/lib/neutral/capabilities/node.mjs.map +0 -7
- package/dist/lib/neutral/chunk-6G4KZLBG.mjs.map +0 -7
- package/dist/lib/neutral/chunk-7DEIKHB7.mjs +0 -199
- package/dist/lib/neutral/chunk-7DEIKHB7.mjs.map +0 -7
- package/dist/lib/neutral/chunk-A7WDDIWY.mjs +0 -162
- package/dist/lib/neutral/chunk-A7WDDIWY.mjs.map +0 -7
- package/dist/lib/neutral/chunk-GSKMAS3S.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-JY35S2CN.mjs +0 -27
- package/dist/lib/neutral/chunk-JY35S2CN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZFABGG2E.mjs +0 -8
- package/dist/lib/neutral/chunk-ZFABGG2E.mjs.map +0 -7
- package/dist/lib/neutral/client-7I5Y5SOA.mjs +0 -62
- package/dist/lib/neutral/client-7I5Y5SOA.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -1
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -25
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-agent-6UKJMZS5.mjs +0 -26
- package/dist/lib/neutral/create-agent-6UKJMZS5.mjs.map +0 -7
- package/dist/lib/neutral/create-identity-ULCRB3YH.mjs +0 -42
- package/dist/lib/neutral/create-identity-ULCRB3YH.mjs.map +0 -7
- package/dist/lib/neutral/create-passkey-I7VDS3AC.mjs +0 -81
- package/dist/lib/neutral/create-passkey-I7VDS3AC.mjs.map +0 -7
- package/dist/lib/neutral/create-recovery-code-DH2B6EGP.mjs +0 -36
- package/dist/lib/neutral/create-recovery-code-DH2B6EGP.mjs.map +0 -7
- package/dist/lib/neutral/hub-http-client-WOJUCDKV.mjs +0 -19
- package/dist/lib/neutral/hub-http-client-WOJUCDKV.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -25
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/join-identity-PJCHDNLH.mjs +0 -27
- package/dist/lib/neutral/join-identity-PJCHDNLH.mjs.map +0 -7
- package/dist/lib/neutral/layer-specs-YI7BVWKZ.mjs +0 -59
- package/dist/lib/neutral/layer-specs-YI7BVWKZ.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/migrations-7FTW55ER.mjs +0 -23
- package/dist/lib/neutral/migrations-7FTW55ER.mjs.map +0 -7
- package/dist/lib/neutral/navigation-handler-MQ6MZXLX.mjs +0 -46
- package/dist/lib/neutral/navigation-handler-MQ6MZXLX.mjs.map +0 -7
- package/dist/lib/neutral/open-usage-OJVTPGOY.mjs +0 -27
- package/dist/lib/neutral/open-usage-OJVTPGOY.mjs.map +0 -7
- package/dist/lib/neutral/operation-handler-E3HB7E2T.mjs +0 -13
- package/dist/lib/neutral/operation-handler-E3HB7E2T.mjs.map +0 -7
- package/dist/lib/neutral/operations/index.mjs +0 -12
- package/dist/lib/neutral/operations/index.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -17
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-context-V74T6JOJ.mjs +0 -23
- package/dist/lib/neutral/react-context-V74T6JOJ.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-HPXRA65U.mjs +0 -75
- package/dist/lib/neutral/react-surface-HPXRA65U.mjs.map +0 -7
- package/dist/lib/neutral/recover-identity-B7YM2BR4.mjs +0 -26
- package/dist/lib/neutral/recover-identity-B7YM2BR4.mjs.map +0 -7
- package/dist/lib/neutral/redeem-passkey-TYP4XLHO.mjs +0 -66
- package/dist/lib/neutral/redeem-passkey-TYP4XLHO.mjs.map +0 -7
- package/dist/lib/neutral/redeem-token-2J33R3PV.mjs +0 -29
- package/dist/lib/neutral/redeem-token-2J33R3PV.mjs.map +0 -7
- package/dist/lib/neutral/reset-storage-K47HZTGP.mjs +0 -26
- package/dist/lib/neutral/reset-storage-K47HZTGP.mjs.map +0 -7
- package/dist/lib/neutral/schema-defs-IHBCKTMM.mjs +0 -51
- package/dist/lib/neutral/schema-defs-IHBCKTMM.mjs.map +0 -7
- package/dist/lib/neutral/share-identity-TOROBLWL.mjs +0 -31
- package/dist/lib/neutral/share-identity-TOROBLWL.mjs.map +0 -7
- package/dist/lib/neutral/testing/index.mjs +0 -25
- package/dist/lib/neutral/testing/index.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -124
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -16
- package/dist/lib/neutral/types/index.mjs.map +0 -7
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useHubHttpClient
|
|
3
|
-
} from "./chunk-JY35S2CN.mjs";
|
|
4
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
-
|
|
6
|
-
// src/containers/InvitationsContainer/InvitationsContainer.tsx
|
|
7
|
-
import { useAtom, useAtomSet } from "@effect-atom/atom-react";
|
|
8
|
-
import React, { useCallback, useState } from "react";
|
|
9
|
-
import { useCapability } from "@dxos/app-framework/ui";
|
|
10
|
-
import { Context } from "@dxos/context";
|
|
11
|
-
import { Clipboard, Icon, IconButton, useAsyncEffect, useTranslation } from "@dxos/react-ui";
|
|
12
|
-
import { Form } from "@dxos/react-ui-form";
|
|
13
|
-
import { Listbox } from "@dxos/react-ui-list";
|
|
14
|
-
import { meta } from "#meta";
|
|
15
|
-
import { ClientCapabilities } from "#types";
|
|
16
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-client/src/containers/InvitationsContainer/InvitationsContainer.tsx";
|
|
17
|
-
var InvitationsContainer = () => {
|
|
18
|
-
const { t } = useTranslation(meta.profile.key);
|
|
19
|
-
const accountCacheAtom = useCapability(ClientCapabilities.AccountCache);
|
|
20
|
-
const [cache] = useAtom(accountCacheAtom);
|
|
21
|
-
const setCache = useAtomSet(accountCacheAtom);
|
|
22
|
-
const [pending, setPending] = useState(false);
|
|
23
|
-
const hubClient = useHubHttpClient();
|
|
24
|
-
useAsyncEffect(async () => {
|
|
25
|
-
if (!hubClient) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
const result = await hubClient.listAccountInvitations(new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 27 }));
|
|
30
|
-
setCache((prev) => ({
|
|
31
|
-
...prev,
|
|
32
|
-
invitations: result.invitations,
|
|
33
|
-
fetchedAt: Date.now()
|
|
34
|
-
}));
|
|
35
|
-
} catch {
|
|
36
|
-
}
|
|
37
|
-
}, [
|
|
38
|
-
hubClient,
|
|
39
|
-
setCache
|
|
40
|
-
]);
|
|
41
|
-
const handleIssue = useCallback(async () => {
|
|
42
|
-
if (!hubClient) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
setPending(true);
|
|
46
|
-
try {
|
|
47
|
-
const result = await hubClient.issueAccountInvitation(new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 46 }));
|
|
48
|
-
setCache((prev) => ({
|
|
49
|
-
...prev,
|
|
50
|
-
account: prev.account ? {
|
|
51
|
-
...prev.account,
|
|
52
|
-
invitationsRemaining: Math.max(0, prev.account.invitationsRemaining - 1)
|
|
53
|
-
} : prev.account,
|
|
54
|
-
invitations: [
|
|
55
|
-
{
|
|
56
|
-
code: result.code,
|
|
57
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
58
|
-
},
|
|
59
|
-
...prev.invitations ?? []
|
|
60
|
-
]
|
|
61
|
-
}));
|
|
62
|
-
} finally {
|
|
63
|
-
setPending(false);
|
|
64
|
-
}
|
|
65
|
-
}, [
|
|
66
|
-
hubClient,
|
|
67
|
-
setCache
|
|
68
|
-
]);
|
|
69
|
-
const remaining = cache.account?.invitationsRemaining ?? 0;
|
|
70
|
-
const list = cache.invitations ?? [];
|
|
71
|
-
const available = list.filter((row) => !row.redeemedByIdentityDid);
|
|
72
|
-
const redeemed = list.filter((row) => Boolean(row.redeemedByIdentityDid));
|
|
73
|
-
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Form.Root, {
|
|
74
|
-
variant: "settings"
|
|
75
|
-
}, /* @__PURE__ */ React.createElement(Form.Viewport, {
|
|
76
|
-
scroll: true
|
|
77
|
-
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.Section, {
|
|
78
|
-
title: t("invitations-section.title"),
|
|
79
|
-
description: t("invitations-section.description")
|
|
80
|
-
}, /* @__PURE__ */ React.createElement(Form.Row, {
|
|
81
|
-
label: t("generate-invitation.label"),
|
|
82
|
-
description: t("generate-invitation.description", {
|
|
83
|
-
count: remaining
|
|
84
|
-
})
|
|
85
|
-
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
86
|
-
icon: "ph--plus--regular",
|
|
87
|
-
label: t("generate-invitation.label"),
|
|
88
|
-
variant: "primary",
|
|
89
|
-
onClick: handleIssue,
|
|
90
|
-
disabled: pending || remaining <= 0
|
|
91
|
-
}))), available.length > 0 ? /* @__PURE__ */ React.createElement(Form.Section, {
|
|
92
|
-
title: t("available-invitations.title")
|
|
93
|
-
}, /* @__PURE__ */ React.createElement(Listbox.Root, null, /* @__PURE__ */ React.createElement(Listbox.Content, {
|
|
94
|
-
classNames: "gap-1"
|
|
95
|
-
}, available.map((row) => /* @__PURE__ */ React.createElement(AvailableInvitationItem, {
|
|
96
|
-
key: row.code,
|
|
97
|
-
row
|
|
98
|
-
}))))) : null, redeemed.length > 0 ? /* @__PURE__ */ React.createElement(Form.Section, {
|
|
99
|
-
title: t("redeemed-invitations.title")
|
|
100
|
-
}, /* @__PURE__ */ React.createElement(Listbox.Root, null, /* @__PURE__ */ React.createElement(Listbox.Content, {
|
|
101
|
-
classNames: "gap-1"
|
|
102
|
-
}, redeemed.map((row) => /* @__PURE__ */ React.createElement(RedeemedInvitationItem, {
|
|
103
|
-
key: row.code,
|
|
104
|
-
row
|
|
105
|
-
}))))) : null))));
|
|
106
|
-
};
|
|
107
|
-
var AvailableInvitationItem = ({ row }) => /* @__PURE__ */ React.createElement(Listbox.Item, {
|
|
108
|
-
id: row.code,
|
|
109
|
-
classNames: "grid grid-cols-[min-content_1fr_min-content] items-center gap-2"
|
|
110
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
111
|
-
icon: "ph--paper-plane-tilt--duotone",
|
|
112
|
-
size: 5,
|
|
113
|
-
classNames: "text-description"
|
|
114
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
115
|
-
className: "flex flex-col min-w-0"
|
|
116
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
117
|
-
className: "font-mono truncate"
|
|
118
|
-
}, row.code), /* @__PURE__ */ React.createElement("p", {
|
|
119
|
-
className: "text-description text-xs"
|
|
120
|
-
}, new Date(row.createdAt).toLocaleString())), /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
|
|
121
|
-
value: row.code
|
|
122
|
-
}));
|
|
123
|
-
var RedeemedInvitationItem = ({ row }) => {
|
|
124
|
-
const date = row.redeemedAt ?? row.createdAt;
|
|
125
|
-
return /* @__PURE__ */ React.createElement(Listbox.Item, {
|
|
126
|
-
id: row.code,
|
|
127
|
-
classNames: "grid grid-cols-[min-content_1fr] items-center gap-2"
|
|
128
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
129
|
-
icon: "ph--check-circle--duotone",
|
|
130
|
-
size: 5,
|
|
131
|
-
classNames: "text-success-text"
|
|
132
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
133
|
-
className: "flex flex-col min-w-0"
|
|
134
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
135
|
-
className: "font-mono truncate"
|
|
136
|
-
}, row.code), /* @__PURE__ */ React.createElement("p", {
|
|
137
|
-
className: "text-description text-xs"
|
|
138
|
-
}, new Date(date).toLocaleString())));
|
|
139
|
-
};
|
|
140
|
-
export {
|
|
141
|
-
InvitationsContainer as default
|
|
142
|
-
};
|
|
143
|
-
//# sourceMappingURL=InvitationsContainer-BI5RAWET.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/InvitationsContainer/InvitationsContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { useAtom, useAtomSet } from '@effect-atom/atom-react';\nimport React, { useCallback, useState } from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { Context } from '@dxos/context';\nimport { Clipboard, Icon, IconButton, useAsyncEffect, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\nimport { Listbox } from '@dxos/react-ui-list';\n\nimport { meta } from '#meta';\nimport { type AccountCacheInvitation, ClientCapabilities } from '#types';\n\nimport { useHubHttpClient } from '../../hooks';\n\nexport const InvitationsContainer = () => {\n const { t } = useTranslation(meta.profile.key);\n const accountCacheAtom = useCapability(ClientCapabilities.AccountCache);\n const [cache] = useAtom(accountCacheAtom);\n const setCache = useAtomSet(accountCacheAtom);\n const [pending, setPending] = useState(false);\n\n // Account/invitation routes live on hub-service, not the edge worker.\n const hubClient = useHubHttpClient();\n\n useAsyncEffect(async () => {\n if (!hubClient) {\n return;\n }\n\n try {\n const result = await hubClient.listAccountInvitations(new Context());\n setCache((prev) => ({ ...prev, invitations: result.invitations, fetchedAt: Date.now() }));\n } catch {\n // Offline: keep cache.\n }\n }, [hubClient, setCache]);\n\n const handleIssue = useCallback(async () => {\n if (!hubClient) {\n return;\n }\n setPending(true);\n try {\n const result = await hubClient.issueAccountInvitation(new Context());\n // Optimistically push the new code and decrement the remaining quota; the\n // server consumes one slot at issue time. Next refresh reconciles.\n setCache((prev) => ({\n ...prev,\n account: prev.account\n ? { ...prev.account, invitationsRemaining: Math.max(0, prev.account.invitationsRemaining - 1) }\n : prev.account,\n invitations: [{ code: result.code, createdAt: new Date().toISOString() }, ...(prev.invitations ?? [])],\n }));\n } finally {\n setPending(false);\n }\n }, [hubClient, setCache]);\n\n const remaining = cache.account?.invitationsRemaining ?? 0;\n const list = cache.invitations ?? [];\n const available = list.filter((row) => !row.redeemedByIdentityDid);\n const redeemed = list.filter((row) => Boolean(row.redeemedByIdentityDid));\n\n return (\n <Clipboard.Provider>\n <Form.Root variant='settings'>\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={t('invitations-section.title')} description={t('invitations-section.description')}>\n <Form.Row\n label={t('generate-invitation.label')}\n description={t('generate-invitation.description', { count: remaining })}\n >\n <IconButton\n icon='ph--plus--regular'\n label={t('generate-invitation.label')}\n variant='primary'\n onClick={handleIssue}\n disabled={pending || remaining <= 0}\n />\n </Form.Row>\n </Form.Section>\n\n {available.length > 0 ? (\n <Form.Section title={t('available-invitations.title')}>\n <Listbox.Root>\n <Listbox.Content classNames='gap-1'>\n {available.map((row) => (\n <AvailableInvitationItem key={row.code} row={row} />\n ))}\n </Listbox.Content>\n </Listbox.Root>\n </Form.Section>\n ) : null}\n\n {redeemed.length > 0 ? (\n <Form.Section title={t('redeemed-invitations.title')}>\n <Listbox.Root>\n <Listbox.Content classNames='gap-1'>\n {redeemed.map((row) => (\n <RedeemedInvitationItem key={row.code} row={row} />\n ))}\n </Listbox.Content>\n </Listbox.Root>\n </Form.Section>\n ) : null}\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n </Clipboard.Provider>\n );\n};\n\nconst AvailableInvitationItem = ({ row }: { row: AccountCacheInvitation }) => (\n <Listbox.Item id={row.code} classNames='grid grid-cols-[min-content_1fr_min-content] items-center gap-2'>\n <Icon icon='ph--paper-plane-tilt--duotone' size={5} classNames='text-description' />\n <div className='flex flex-col min-w-0'>\n <div className='font-mono truncate'>{row.code}</div>\n <p className='text-description text-xs'>{new Date(row.createdAt).toLocaleString()}</p>\n </div>\n <Clipboard.IconButton value={row.code} />\n </Listbox.Item>\n);\n\nconst RedeemedInvitationItem = ({ row }: { row: AccountCacheInvitation }) => {\n const date = row.redeemedAt ?? row.createdAt;\n return (\n <Listbox.Item id={row.code} classNames='grid grid-cols-[min-content_1fr] items-center gap-2'>\n <Icon icon='ph--check-circle--duotone' size={5} classNames='text-success-text' />\n <div className='flex flex-col min-w-0'>\n <div className='font-mono truncate'>{row.code}</div>\n <p className='text-description text-xs'>{new Date(date).toLocaleString()}</p>\n </div>\n </Listbox.Item>\n );\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["useAtom", "useAtomSet", "React", "useCallback", "useState", "useCapability", "Context", "Clipboard", "Icon", "IconButton", "useAsyncEffect", "useTranslation", "Form", "Listbox", "meta", "ClientCapabilities", "InvitationsContainer", "accountCacheAtom", "useCapability", "cache", "setCache", "useAtomSet", "pending", "setPending", "hubClient", "useHubHttpClient", "invitations", "fetchedAt", "result", "account", "prev", "invitationsRemaining", "code", "available", "list", "filter", "row", "redeemedByIdentityDid", "redeemed", "Clipboard", "variant", "Form", "scroll", "Content", "title", "t", "label", "count", "remaining", "icon", "onClick", "handleIssue", "disabled", "Listbox", "classNames", "AvailableInvitationItem", "RedeemedInvitationItem", "className", "div", "Date", "toLocaleString", "value", "id"]
|
|
7
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/JoinDialog/JoinDialog.tsx
|
|
4
|
-
import React, { useCallback } from "react";
|
|
5
|
-
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
6
|
-
import { LayoutOperation } from "@dxos/app-toolkit";
|
|
7
|
-
import { ObservabilityOperation } from "@dxos/plugin-observability";
|
|
8
|
-
import { Dialog, useTranslation } from "@dxos/react-ui";
|
|
9
|
-
import { JoinPanel } from "@dxos/shell/react";
|
|
10
|
-
import { osTranslations } from "@dxos/ui-theme";
|
|
11
|
-
import { meta } from "#meta";
|
|
12
|
-
import { ClientOperation } from "#operations";
|
|
13
|
-
var JoinDialog = (props) => {
|
|
14
|
-
const { invokePromise } = useOperationInvoker();
|
|
15
|
-
const { t } = useTranslation(meta.profile.key);
|
|
16
|
-
const handleCancelResetStorage = useCallback(() => invokePromise(ClientOperation.ShareIdentity), [
|
|
17
|
-
invokePromise
|
|
18
|
-
]);
|
|
19
|
-
const handleDone = useCallback(async (result) => {
|
|
20
|
-
if (result?.identityKey) {
|
|
21
|
-
await Promise.all([
|
|
22
|
-
invokePromise(LayoutOperation.UpdateDialog, {
|
|
23
|
-
state: false
|
|
24
|
-
}),
|
|
25
|
-
invokePromise(ObservabilityOperation.SendEvent, {
|
|
26
|
-
name: props.initialDisposition === "recover-identity" ? "identity.recover" : "identity.join"
|
|
27
|
-
})
|
|
28
|
-
]);
|
|
29
|
-
}
|
|
30
|
-
}, [
|
|
31
|
-
invokePromise
|
|
32
|
-
]);
|
|
33
|
-
return /* @__PURE__ */ React.createElement(Dialog.Content, null, /* @__PURE__ */ React.createElement(Dialog.Header, null, /* @__PURE__ */ React.createElement(Dialog.Title, {
|
|
34
|
-
classNames: "sr-only"
|
|
35
|
-
}, t("join-space.label", {
|
|
36
|
-
ns: osTranslations
|
|
37
|
-
}))), /* @__PURE__ */ React.createElement(Dialog.Body, null, /* @__PURE__ */ React.createElement(JoinPanel, {
|
|
38
|
-
...props,
|
|
39
|
-
mode: "halo-only",
|
|
40
|
-
exitActionParent: /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
41
|
-
asChild: true
|
|
42
|
-
}),
|
|
43
|
-
doneActionParent: /* @__PURE__ */ React.createElement(Dialog.Close, {
|
|
44
|
-
asChild: true
|
|
45
|
-
}),
|
|
46
|
-
onCancelResetStorage: handleCancelResetStorage,
|
|
47
|
-
onDone: handleDone
|
|
48
|
-
})));
|
|
49
|
-
};
|
|
50
|
-
export {
|
|
51
|
-
JoinDialog as default
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=JoinDialog-4BWV4CYB.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/JoinDialog/JoinDialog.tsx"],
|
|
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';\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 '#operations';\n\nexport const JoinDialog = (props: JoinPanelProps) => {\n const { invokePromise } = useOperationInvoker();\n const { t } = useTranslation(meta.profile.key);\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 // TODO(burdon): Move JoinHeading into Dialog.Heading.\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 <Dialog.Body>\n <JoinPanel\n {...props}\n mode='halo-only'\n exitActionParent={<Dialog.Close asChild />}\n doneActionParent={<Dialog.Close asChild />}\n onCancelResetStorage={handleCancelResetStorage}\n onDone={handleDone}\n />\n </Dialog.Body>\n </Dialog.Content>\n );\n};\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;AAE/B,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAEzB,IAAMC,aAAa,CAACC,UAAAA;AACzB,QAAM,EAAEC,cAAa,IAAKX,oBAAAA;AAC1B,QAAM,EAAEY,EAAC,IAAKR,eAAeG,KAAKM,QAAQC,GAAG;AAE7C,QAAMC,2BAA2BhB,YAAY,MAAMY,cAAcH,gBAAgBQ,aAAa,GAAG;IAACL;GAAc;AAEhH,QAAMM,aAAalB,YACjB,OAAOmB,WAAAA;AACL,QAAIA,QAAQC,aAAa;AACvB,YAAMC,QAAQC,IAAI;QAChBV,cAAcV,gBAAgBqB,cAAc;UAAEC,OAAO;QAAM,CAAA;QAC3DZ,cAAcT,uBAAuBsB,WAAW;UAC9CC,MAAMf,MAAMgB,uBAAuB,qBAAqB,qBAAqB;QAC/E,CAAA;OACD;IACH;EACF,GACA;IAACf;GAAc;AAIjB,SACE,sBAAA,cAACR,OAAOwB,SAAO,MACb,sBAAA,cAACxB,OAAOyB,QAAM,MACZ,sBAAA,cAACzB,OAAO0B,OAAK;IAACC,YAAW;KAAWlB,EAAE,oBAAoB;IAAEmB,IAAIzB;EAAe,CAAA,CAAA,CAAA,GAEjF,sBAAA,cAACH,OAAO6B,MAAI,MACV,sBAAA,cAAC3B,WAAAA;IACE,GAAGK;IACJuB,MAAK;IACLC,kBAAkB,sBAAA,cAAC/B,OAAOgC,OAAK;MAACC,SAAAA;;IAChCC,kBAAkB,sBAAA,cAAClC,OAAOgC,OAAK;MAACC,SAAAA;;IAChCE,sBAAsBvB;IACtBwB,QAAQtB;;AAKlB;",
|
|
6
|
-
"names": ["React", "useCallback", "useOperationInvoker", "LayoutOperation", "ObservabilityOperation", "Dialog", "useTranslation", "JoinPanel", "osTranslations", "meta", "ClientOperation", "JoinDialog", "props", "invokePromise", "t", "profile", "key", "handleCancelResetStorage", "ShareIdentity", "handleDone", "result", "identityKey", "Promise", "all", "UpdateDialog", "state", "SendEvent", "name", "initialDisposition", "Content", "Header", "Title", "classNames", "ns", "Body", "mode", "exitActionParent", "Close", "asChild", "doneActionParent", "onCancelResetStorage", "onDone"]
|
|
7
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/ProfileContainer/ProfileContainer.tsx
|
|
4
|
-
import * as Schema from "effect/Schema";
|
|
5
|
-
import React, { useCallback, useMemo, useState } from "react";
|
|
6
|
-
import { debounce } from "@dxos/async";
|
|
7
|
-
import { useClient } from "@dxos/react-client";
|
|
8
|
-
import { useIdentity } from "@dxos/react-client/halo";
|
|
9
|
-
import { ButtonGroup, Clipboard, Input, useTranslation } from "@dxos/react-ui";
|
|
10
|
-
import { Form } from "@dxos/react-ui-form";
|
|
11
|
-
import { EmojiPickerBlock, HuePicker } from "@dxos/react-ui-pickers";
|
|
12
|
-
import { hexToEmoji, hexToHue } from "@dxos/util";
|
|
13
|
-
import { meta } from "#meta";
|
|
14
|
-
var UserProfile = Schema.Struct({
|
|
15
|
-
did: Schema.String.annotations({
|
|
16
|
-
title: "DID"
|
|
17
|
-
}),
|
|
18
|
-
displayName: Schema.String.annotations({
|
|
19
|
-
title: "Display name"
|
|
20
|
-
}),
|
|
21
|
-
emoji: Schema.String.annotations({
|
|
22
|
-
title: "Avatar"
|
|
23
|
-
}),
|
|
24
|
-
hue: Schema.String.annotations({
|
|
25
|
-
title: "Color"
|
|
26
|
-
})
|
|
27
|
-
});
|
|
28
|
-
var getDefaultHueValue = (identity) => hexToHue(identity?.identityKey.toHex() ?? "0");
|
|
29
|
-
var getHueValue = (identity) => identity?.profile?.data?.hue || getDefaultHueValue(identity);
|
|
30
|
-
var getDefaultEmojiValue = (identity) => hexToEmoji(identity?.identityKey.toHex() ?? "0");
|
|
31
|
-
var getEmojiValue = (identity) => identity?.profile?.data?.emoji || getDefaultEmojiValue(identity);
|
|
32
|
-
var ProfileContainer = () => {
|
|
33
|
-
const { t } = useTranslation(meta.profile.key);
|
|
34
|
-
const client = useClient();
|
|
35
|
-
const identity = useIdentity();
|
|
36
|
-
const [displayName, setDisplayNameDirectly] = useState(identity?.profile?.displayName ?? "");
|
|
37
|
-
const [emoji, setEmojiDirectly] = useState(getEmojiValue(identity));
|
|
38
|
-
const [hue, setHueDirectly] = useState(getHueValue(identity));
|
|
39
|
-
const updateProfile = useMemo(() => debounce((profile) => client.halo.updateProfile({
|
|
40
|
-
displayName: profile.displayName,
|
|
41
|
-
data: {
|
|
42
|
-
emoji: profile.emoji,
|
|
43
|
-
hue: profile.hue
|
|
44
|
-
}
|
|
45
|
-
}), 2e3), []);
|
|
46
|
-
const handleChange = useCallback((profile, meta2) => {
|
|
47
|
-
for (const [path, changed] of Object.entries(meta2.changed)) {
|
|
48
|
-
if (changed) {
|
|
49
|
-
switch (path) {
|
|
50
|
-
case "displayName":
|
|
51
|
-
setDisplayNameDirectly(profile.displayName ?? "");
|
|
52
|
-
break;
|
|
53
|
-
case "emoji":
|
|
54
|
-
setEmojiDirectly(profile.emoji ?? getDefaultEmojiValue(identity));
|
|
55
|
-
break;
|
|
56
|
-
case "hue":
|
|
57
|
-
setHueDirectly(profile.hue ?? getDefaultHueValue(identity));
|
|
58
|
-
break;
|
|
59
|
-
default:
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
void updateProfile(profile);
|
|
65
|
-
}, [
|
|
66
|
-
identity
|
|
67
|
-
]);
|
|
68
|
-
const values = useMemo(() => ({
|
|
69
|
-
did: identity?.did,
|
|
70
|
-
displayName,
|
|
71
|
-
emoji,
|
|
72
|
-
hue
|
|
73
|
-
}), [
|
|
74
|
-
identity,
|
|
75
|
-
displayName,
|
|
76
|
-
emoji,
|
|
77
|
-
hue
|
|
78
|
-
]);
|
|
79
|
-
const fieldMap = useMemo(() => ({
|
|
80
|
-
displayName: ({ type, label, getValue, onValueChange }) => {
|
|
81
|
-
const handleChange2 = useCallback(({ target: { value } }) => onValueChange(type, value), [
|
|
82
|
-
onValueChange,
|
|
83
|
-
type
|
|
84
|
-
]);
|
|
85
|
-
return /* @__PURE__ */ React.createElement(Form.Row, {
|
|
86
|
-
label,
|
|
87
|
-
description: t("display-name.description")
|
|
88
|
-
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
89
|
-
value: getValue(),
|
|
90
|
-
onChange: handleChange2,
|
|
91
|
-
placeholder: t("display-name-input.placeholder"),
|
|
92
|
-
classNames: "min-w-64"
|
|
93
|
-
})));
|
|
94
|
-
},
|
|
95
|
-
emoji: ({ type, label, getValue, onValueChange }) => {
|
|
96
|
-
const handleChange2 = useCallback((nextEmoji) => onValueChange(type, nextEmoji), [
|
|
97
|
-
onValueChange,
|
|
98
|
-
type
|
|
99
|
-
]);
|
|
100
|
-
const handleEmojiReset = useCallback(() => onValueChange(type, getDefaultEmojiValue(identity)), [
|
|
101
|
-
onValueChange,
|
|
102
|
-
type
|
|
103
|
-
]);
|
|
104
|
-
return /* @__PURE__ */ React.createElement(Form.Row, {
|
|
105
|
-
label,
|
|
106
|
-
description: t("icon.description")
|
|
107
|
-
}, /* @__PURE__ */ React.createElement(EmojiPickerBlock, {
|
|
108
|
-
triggerVariant: "default",
|
|
109
|
-
emoji: getValue(),
|
|
110
|
-
onChangeEmoji: handleChange2,
|
|
111
|
-
onClickClear: handleEmojiReset,
|
|
112
|
-
classNames: "justify-self-end"
|
|
113
|
-
}));
|
|
114
|
-
},
|
|
115
|
-
hue: ({ type, label, getValue, onValueChange }) => {
|
|
116
|
-
const handleChange2 = useCallback((nextHue) => onValueChange(type, nextHue), [
|
|
117
|
-
onValueChange,
|
|
118
|
-
type
|
|
119
|
-
]);
|
|
120
|
-
const handleHueReset = useCallback(() => onValueChange(type, getDefaultHueValue(identity)), [
|
|
121
|
-
onValueChange,
|
|
122
|
-
type
|
|
123
|
-
]);
|
|
124
|
-
return /* @__PURE__ */ React.createElement(Form.Row, {
|
|
125
|
-
label,
|
|
126
|
-
description: t("hue.description")
|
|
127
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
128
|
-
className: "flex justify-self-end"
|
|
129
|
-
}, /* @__PURE__ */ React.createElement(HuePicker, {
|
|
130
|
-
value: getValue(),
|
|
131
|
-
onChange: handleChange2,
|
|
132
|
-
onReset: handleHueReset
|
|
133
|
-
})));
|
|
134
|
-
},
|
|
135
|
-
// TODO(wittjosiah): We need text input annotations for disabled and copyable.
|
|
136
|
-
did: ({ label, getValue }) => {
|
|
137
|
-
return /* @__PURE__ */ React.createElement(Form.Row, {
|
|
138
|
-
label,
|
|
139
|
-
description: t("did.description")
|
|
140
|
-
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(ButtonGroup, {
|
|
141
|
-
classNames: "w-full"
|
|
142
|
-
}, /* @__PURE__ */ React.createElement(Input.TextInput, {
|
|
143
|
-
value: getValue(),
|
|
144
|
-
disabled: true,
|
|
145
|
-
classNames: "min-w-64"
|
|
146
|
-
}), /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
|
|
147
|
-
value: getValue() ?? ""
|
|
148
|
-
}))));
|
|
149
|
-
}
|
|
150
|
-
}), [
|
|
151
|
-
t
|
|
152
|
-
]);
|
|
153
|
-
return /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Form.Root, {
|
|
154
|
-
variant: "settings",
|
|
155
|
-
schema: UserProfile,
|
|
156
|
-
values,
|
|
157
|
-
fieldMap,
|
|
158
|
-
onValuesChanged: handleChange
|
|
159
|
-
}, /* @__PURE__ */ React.createElement(Form.Viewport, {
|
|
160
|
-
scroll: true
|
|
161
|
-
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.Section, {
|
|
162
|
-
title: t("profile.label"),
|
|
163
|
-
description: t("profile.description")
|
|
164
|
-
}, /* @__PURE__ */ React.createElement(Form.FieldSet, null))))));
|
|
165
|
-
};
|
|
166
|
-
export {
|
|
167
|
-
ProfileContainer as default
|
|
168
|
-
};
|
|
169
|
-
//# sourceMappingURL=ProfileContainer-YEAYOTX5.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/ProfileContainer/ProfileContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React, { type ChangeEvent, useCallback, useMemo, useState } from 'react';\n\nimport { debounce } from '@dxos/async';\nimport { useClient } from '@dxos/react-client';\nimport { type Identity, useIdentity } from '@dxos/react-client/halo';\nimport { ButtonGroup, Clipboard, Input, useTranslation } from '@dxos/react-ui';\nimport { Form, type FormFieldMap, type FormUpdateMeta } from '@dxos/react-ui-form';\nimport { EmojiPickerBlock, HuePicker } from '@dxos/react-ui-pickers';\nimport { hexToEmoji, hexToHue } from '@dxos/util';\n\nimport { meta } from '#meta';\n\n// TOOD(burdon): Factor out?\n// TODO(wittjosiah): Integrate annotations with translations.\nconst UserProfile = Schema.Struct({\n did: Schema.String.annotations({ title: 'DID' }),\n displayName: Schema.String.annotations({ title: 'Display name' }),\n emoji: Schema.String.annotations({ title: 'Avatar' }),\n hue: Schema.String.annotations({ title: 'Color' }),\n});\n\ntype UserProfile = Schema.Schema.Type<typeof UserProfile>;\n\n// TODO(thure): Factor out?\nconst getDefaultHueValue = (identity: Identity | null) => hexToHue(identity?.identityKey.toHex() ?? '0');\nconst getHueValue = (identity: Identity | null) => identity?.profile?.data?.hue || getDefaultHueValue(identity);\nconst getDefaultEmojiValue = (identity: Identity | null) => hexToEmoji(identity?.identityKey.toHex() ?? '0');\nconst getEmojiValue = (identity: Identity | null) => identity?.profile?.data?.emoji || getDefaultEmojiValue(identity);\n\nexport const ProfileContainer = () => {\n const { t } = useTranslation(meta.profile.key);\n const client = useClient();\n const identity = useIdentity();\n const [displayName, setDisplayNameDirectly] = useState(identity?.profile?.displayName ?? '');\n const [emoji, setEmojiDirectly] = useState<string>(getEmojiValue(identity));\n const [hue, setHueDirectly] = useState<string>(getHueValue(identity));\n\n const updateProfile = useMemo(\n () =>\n debounce(\n (profile: Partial<UserProfile>) =>\n client.halo.updateProfile({\n displayName: profile.displayName,\n data: {\n emoji: profile.emoji,\n hue: profile.hue,\n },\n }),\n 2_000,\n ),\n [],\n );\n\n const handleChange = useCallback(\n (profile: Partial<UserProfile>, meta: FormUpdateMeta<UserProfile>) => {\n for (const [path, changed] of Object.entries(meta.changed)) {\n if (changed) {\n switch (path) {\n case 'displayName':\n setDisplayNameDirectly(profile.displayName ?? '');\n break;\n case 'emoji':\n setEmojiDirectly(profile.emoji ?? getDefaultEmojiValue(identity));\n break;\n case 'hue':\n setHueDirectly(profile.hue ?? getDefaultHueValue(identity));\n break;\n default:\n break;\n }\n }\n }\n\n void updateProfile(profile);\n },\n [identity],\n );\n\n const values = useMemo(\n () => ({\n did: identity?.did,\n displayName,\n emoji,\n hue,\n }),\n [identity, displayName, emoji, hue],\n );\n\n // TODO(wittjosiah): Integrate descriptions with the form schema.\n const fieldMap = useMemo<FormFieldMap>(\n () => ({\n displayName: ({ type, label, getValue, onValueChange }) => {\n const handleChange = useCallback(\n ({ target: { value } }: ChangeEvent<HTMLInputElement>) => onValueChange(type, value),\n [onValueChange, type],\n );\n\n return (\n <Form.Row label={label} description={t('display-name.description')}>\n <Input.Root>\n <Input.TextInput\n value={getValue()}\n onChange={handleChange}\n placeholder={t('display-name-input.placeholder')}\n classNames='min-w-64'\n />\n </Input.Root>\n </Form.Row>\n );\n },\n emoji: ({ type, label, getValue, onValueChange }) => {\n const handleChange = useCallback((nextEmoji: string) => onValueChange(type, nextEmoji), [onValueChange, type]);\n const handleEmojiReset = useCallback(\n () => onValueChange(type, getDefaultEmojiValue(identity)),\n [onValueChange, type],\n );\n\n return (\n <Form.Row label={label} description={t('icon.description')}>\n <EmojiPickerBlock\n triggerVariant='default'\n emoji={getValue()}\n onChangeEmoji={handleChange}\n onClickClear={handleEmojiReset}\n classNames='justify-self-end'\n />\n </Form.Row>\n );\n },\n hue: ({ type, label, getValue, onValueChange }) => {\n const handleChange = useCallback((nextHue: string) => onValueChange(type, nextHue), [onValueChange, type]);\n const handleHueReset = useCallback(\n () => onValueChange(type, getDefaultHueValue(identity)),\n [onValueChange, type],\n );\n\n return (\n <Form.Row label={label} description={t('hue.description')}>\n <div className='flex justify-self-end'>\n <HuePicker value={getValue()} onChange={handleChange} onReset={handleHueReset} />\n </div>\n </Form.Row>\n );\n },\n // TODO(wittjosiah): We need text input annotations for disabled and copyable.\n did: ({ label, getValue }) => {\n return (\n <Form.Row label={label} description={t('did.description')}>\n <Input.Root>\n <ButtonGroup classNames='w-full'>\n <Input.TextInput value={getValue()} disabled classNames='min-w-64' />\n <Clipboard.IconButton value={getValue() ?? ''} />\n </ButtonGroup>\n </Input.Root>\n </Form.Row>\n );\n },\n }),\n [t],\n );\n\n return (\n <Clipboard.Provider>\n <Form.Root\n variant='settings'\n schema={UserProfile}\n values={values}\n fieldMap={fieldMap}\n onValuesChanged={handleChange}\n >\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={t('profile.label')} description={t('profile.description')}>\n <Form.FieldSet />\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n </Clipboard.Provider>\n );\n};\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Schema", "React", "useCallback", "useMemo", "useState", "debounce", "useClient", "useIdentity", "ButtonGroup", "Clipboard", "Input", "useTranslation", "Form", "EmojiPickerBlock", "HuePicker", "hexToEmoji", "hexToHue", "meta", "UserProfile", "Struct", "did", "String", "annotations", "title", "displayName", "emoji", "hue", "getDefaultHueValue", "identity", "identityKey", "toHex", "getHueValue", "profile", "data", "getDefaultEmojiValue", "getEmojiValue", "ProfileContainer", "t", "key", "client", "setDisplayNameDirectly", "setEmojiDirectly", "setHueDirectly", "updateProfile", "halo", "handleChange", "path", "changed", "Object", "entries", "values", "fieldMap", "type", "label", "getValue", "onValueChange", "target", "value", "Row", "description", "Root", "TextInput", "onChange", "placeholder", "classNames", "nextEmoji", "handleEmojiReset", "triggerVariant", "onChangeEmoji", "onClickClear", "nextHue", "handleHueReset", "div", "className", "onReset", "disabled", "IconButton", "Provider", "variant", "schema", "onValuesChanged", "Viewport", "scroll", "Content", "Section", "FieldSet"]
|
|
7
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/RecoveryCodeDialog/RecoveryCodeDialog.tsx
|
|
4
|
-
import React, { useCallback, useState } from "react";
|
|
5
|
-
import { AlertDialog, Button, Clipboard, Input, useTranslation } from "@dxos/react-ui";
|
|
6
|
-
import { meta } from "#meta";
|
|
7
|
-
var RecoveryCodeDialog = ({ code }) => {
|
|
8
|
-
const { t } = useTranslation(meta.profile.key);
|
|
9
|
-
const [confirmation, setConfirmation] = useState(false);
|
|
10
|
-
const handleConfirmation = useCallback((checked) => setConfirmation(checked), []);
|
|
11
|
-
return /* @__PURE__ */ React.createElement(AlertDialog.Content, {
|
|
12
|
-
size: "md",
|
|
13
|
-
classNames: "min-h-[15rem]"
|
|
14
|
-
}, /* @__PURE__ */ React.createElement(AlertDialog.Body, null, /* @__PURE__ */ React.createElement(AlertDialog.Title, null, t("recovery-code-dialog.title")), /* @__PURE__ */ React.createElement(AlertDialog.Description, {
|
|
15
|
-
classNames: "py-4"
|
|
16
|
-
}, t("recovery-code-dialog.description")), /* @__PURE__ */ React.createElement(Clipboard.Provider, null, /* @__PURE__ */ React.createElement(Code, {
|
|
17
|
-
code
|
|
18
|
-
})), /* @__PURE__ */ React.createElement("div", {
|
|
19
|
-
className: "flex flex-col py-4 gap-2"
|
|
20
|
-
}, /* @__PURE__ */ React.createElement("p", null, t("recovery-code-dialog-warning-1.message")), /* @__PURE__ */ React.createElement("p", null, t("recovery-code-dialog-warning-2.message"))), /* @__PURE__ */ React.createElement("div", {
|
|
21
|
-
className: "flex items-center gap-2 pb-4"
|
|
22
|
-
}, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Checkbox, {
|
|
23
|
-
"data-testid": "recoveryCode.confirm",
|
|
24
|
-
checked: confirmation,
|
|
25
|
-
onCheckedChange: handleConfirmation
|
|
26
|
-
}), /* @__PURE__ */ React.createElement(Input.Label, null, t("recovery-code-confirmation.label"))))), /* @__PURE__ */ React.createElement(AlertDialog.ActionBar, null, /* @__PURE__ */ React.createElement(AlertDialog.Action, {
|
|
27
|
-
asChild: true
|
|
28
|
-
}, /* @__PURE__ */ React.createElement(Button, {
|
|
29
|
-
"data-testid": "recoveryCode.continue",
|
|
30
|
-
variant: "primary",
|
|
31
|
-
disabled: !confirmation
|
|
32
|
-
}, t("continue.label")))));
|
|
33
|
-
};
|
|
34
|
-
var Code = ({ code }) => {
|
|
35
|
-
const words = code.split(" ");
|
|
36
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
37
|
-
className: "relative p-2 border border-separator rounded-sm group"
|
|
38
|
-
}, /* @__PURE__ */ React.createElement(Clipboard.IconButton, {
|
|
39
|
-
value: code,
|
|
40
|
-
classNames: "absolute top-2 right-2 invisible group-hover:visible"
|
|
41
|
-
}), /* @__PURE__ */ React.createElement("div", {
|
|
42
|
-
className: "grid grid-cols-4"
|
|
43
|
-
}, words.map((word, i) => /* @__PURE__ */ React.createElement("div", {
|
|
44
|
-
key: i,
|
|
45
|
-
className: "flex items-center p-2 gap-2"
|
|
46
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
47
|
-
className: "w-4 text-xs text-center text-subdued"
|
|
48
|
-
}, i + 1), /* @__PURE__ */ React.createElement("div", {
|
|
49
|
-
className: "text-sm"
|
|
50
|
-
}, word)))));
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// src/containers/RecoveryCodeDialog/index.ts
|
|
54
|
-
var RecoveryCodeDialog_default = RecoveryCodeDialog;
|
|
55
|
-
export {
|
|
56
|
-
RecoveryCodeDialog,
|
|
57
|
-
RecoveryCodeDialog_default as default
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=RecoveryCodeDialog-7EPNKCLB.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/RecoveryCodeDialog/RecoveryCodeDialog.tsx", "../../../src/containers/RecoveryCodeDialog/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { AlertDialog, Button, Clipboard, Input, useTranslation } from '@dxos/react-ui';\n\nimport { meta } from '#meta';\n\nexport type RecoveryCodeDialogProps = {\n code: string;\n};\n\n// TODO(burdon): Should have cancel button.\nexport const RecoveryCodeDialog = ({ code }: RecoveryCodeDialogProps) => {\n const { t } = useTranslation(meta.profile.key);\n const [confirmation, setConfirmation] = useState(false);\n\n const handleConfirmation = useCallback((checked: boolean) => setConfirmation(checked), []);\n\n return (\n <AlertDialog.Content size='md' classNames='min-h-[15rem]'>\n <AlertDialog.Body>\n <AlertDialog.Title>{t('recovery-code-dialog.title')}</AlertDialog.Title>\n <AlertDialog.Description classNames='py-4'>{t('recovery-code-dialog.description')}</AlertDialog.Description>\n <Clipboard.Provider>\n <Code code={code} />\n </Clipboard.Provider>\n <div className='flex flex-col py-4 gap-2'>\n <p>{t('recovery-code-dialog-warning-1.message')}</p>\n <p>{t('recovery-code-dialog-warning-2.message')}</p>\n </div>\n <div className='flex items-center gap-2 pb-4'>\n <Input.Root>\n <Input.Checkbox\n data-testid='recoveryCode.confirm'\n checked={confirmation}\n onCheckedChange={handleConfirmation}\n />\n <Input.Label>{t('recovery-code-confirmation.label')}</Input.Label>\n </Input.Root>\n </div>\n </AlertDialog.Body>\n <AlertDialog.ActionBar>\n <AlertDialog.Action asChild>\n <Button data-testid='recoveryCode.continue' variant='primary' disabled={!confirmation}>\n {t('continue.label')}\n </Button>\n </AlertDialog.Action>\n </AlertDialog.ActionBar>\n </AlertDialog.Content>\n );\n};\n\nconst Code = ({ code }: { code: string }) => {\n const words = code.split(' ');\n return (\n <div className='relative p-2 border border-separator rounded-sm group'>\n <Clipboard.IconButton value={code} classNames='absolute top-2 right-2 invisible group-hover:visible' />\n <div className='grid grid-cols-4'>\n {words.map((word, i) => (\n <div key={i} className='flex items-center p-2 gap-2'>\n <div className='w-4 text-xs text-center text-subdued'>{i + 1}</div>\n <div className='text-sm'>{word}</div>\n </div>\n ))}\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { RecoveryCodeDialog } from './RecoveryCodeDialog';\n\nexport * from './RecoveryCodeDialog';\nexport default RecoveryCodeDialog;\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,SAASC,aAAaC,gBAAgB;AAE7C,SAASC,aAAaC,QAAQC,WAAWC,OAAOC,sBAAsB;AAEtE,SAASC,YAAY;AAOd,IAAMC,qBAAqB,CAAC,EAAEC,KAAI,MAA2B;AAClE,QAAM,EAAEC,EAAC,IAAKJ,eAAeC,KAAKI,QAAQC,GAAG;AAC7C,QAAM,CAACC,cAAcC,eAAAA,IAAmBb,SAAS,KAAA;AAEjD,QAAMc,qBAAqBf,YAAY,CAACgB,YAAqBF,gBAAgBE,OAAAA,GAAU,CAAA,CAAE;AAEzF,SACE,sBAAA,cAACd,YAAYe,SAAO;IAACC,MAAK;IAAKC,YAAW;KACxC,sBAAA,cAACjB,YAAYkB,MAAI,MACf,sBAAA,cAAClB,YAAYmB,OAAK,MAAEX,EAAE,4BAAA,CAAA,GACtB,sBAAA,cAACR,YAAYoB,aAAW;IAACH,YAAW;KAAQT,EAAE,kCAAA,CAAA,GAC9C,sBAAA,cAACN,UAAUmB,UAAQ,MACjB,sBAAA,cAACC,MAAAA;IAAKf;OAER,sBAAA,cAACgB,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACC,KAAAA,MAAGjB,EAAE,wCAAA,CAAA,GACN,sBAAA,cAACiB,KAAAA,MAAGjB,EAAE,wCAAA,CAAA,CAAA,GAER,sBAAA,cAACe,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACrB,MAAMuB,MAAI,MACT,sBAAA,cAACvB,MAAMwB,UAAQ;IACbC,eAAY;IACZd,SAASH;IACTkB,iBAAiBhB;MAEnB,sBAAA,cAACV,MAAM2B,OAAK,MAAEtB,EAAE,kCAAA,CAAA,CAAA,CAAA,CAAA,GAItB,sBAAA,cAACR,YAAY+B,WAAS,MACpB,sBAAA,cAAC/B,YAAYgC,QAAM;IAACC,SAAAA;KAClB,sBAAA,cAAChC,QAAAA;IAAO2B,eAAY;IAAwBM,SAAQ;IAAUC,UAAU,CAACxB;KACtEH,EAAE,gBAAA,CAAA,CAAA,CAAA,CAAA;AAMf;AAEA,IAAMc,OAAO,CAAC,EAAEf,KAAI,MAAoB;AACtC,QAAM6B,QAAQ7B,KAAK8B,MAAM,GAAA;AACzB,SACE,sBAAA,cAACd,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACtB,UAAUoC,YAAU;IAACC,OAAOhC;IAAMU,YAAW;MAC9C,sBAAA,cAACM,OAAAA;IAAIC,WAAU;KACZY,MAAMI,IAAI,CAACC,MAAMC,MAChB,sBAAA,cAACnB,OAAAA;IAAIb,KAAKgC;IAAGlB,WAAU;KACrB,sBAAA,cAACD,OAAAA;IAAIC,WAAU;KAAwCkB,IAAI,CAAA,GAC3D,sBAAA,cAACnB,OAAAA;IAAIC,WAAU;KAAWiB,IAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAMtC;;;AC/DA,IAAA,6BAAeE;",
|
|
6
|
-
"names": ["React", "useCallback", "useState", "AlertDialog", "Button", "Clipboard", "Input", "useTranslation", "meta", "RecoveryCodeDialog", "code", "t", "profile", "key", "confirmation", "setConfirmation", "handleConfirmation", "checked", "Content", "size", "classNames", "Body", "Title", "Description", "Provider", "Code", "div", "className", "p", "Root", "Checkbox", "data-testid", "onCheckedChange", "Label", "ActionBar", "Action", "asChild", "variant", "disabled", "words", "split", "IconButton", "value", "map", "word", "i", "RecoveryCodeDialog"]
|
|
7
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx
|
|
4
|
-
import React from "react";
|
|
5
|
-
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
6
|
-
import { useCredentials } from "@dxos/react-client/halo";
|
|
7
|
-
import { Icon, IconButton, Message, useTranslation } from "@dxos/react-ui";
|
|
8
|
-
import { Form } from "@dxos/react-ui-form";
|
|
9
|
-
import { Listbox } from "@dxos/react-ui-list";
|
|
10
|
-
import { meta } from "#meta";
|
|
11
|
-
import { ClientOperation } from "#operations";
|
|
12
|
-
var MANAGE_CREDENTIALS_DIALOG = `${meta.profile.key}.ManageCredentialsDialog`;
|
|
13
|
-
var RecoveryCredentialsContainer = () => {
|
|
14
|
-
const { t } = useTranslation(meta.profile.key);
|
|
15
|
-
const { invokePromise } = useOperationInvoker();
|
|
16
|
-
const credentials = useCredentials();
|
|
17
|
-
const recoveryCredentials = credentials.filter((credential) => credential.subject.assertion["@type"] === "dxos.halo.credentials.IdentityRecovery");
|
|
18
|
-
return /* @__PURE__ */ React.createElement(Form.Root, {
|
|
19
|
-
variant: "settings"
|
|
20
|
-
}, /* @__PURE__ */ React.createElement(Form.Viewport, {
|
|
21
|
-
scroll: true
|
|
22
|
-
}, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.Section, {
|
|
23
|
-
title: t("recovery-setup-dialog.title"),
|
|
24
|
-
description: t("recovery-setup-dialog.description")
|
|
25
|
-
}, /* @__PURE__ */ React.createElement(Form.Row, {
|
|
26
|
-
label: t("create-passkey.label"),
|
|
27
|
-
description: t("create-passkey.description")
|
|
28
|
-
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
29
|
-
label: t("create-passkey.label"),
|
|
30
|
-
icon: "ph--key--duotone",
|
|
31
|
-
variant: "primary",
|
|
32
|
-
onClick: () => invokePromise(ClientOperation.CreatePasskey)
|
|
33
|
-
})), /* @__PURE__ */ React.createElement(Form.Row, {
|
|
34
|
-
label: t("create-recovery-code.label"),
|
|
35
|
-
description: t("create-recovery-code.description")
|
|
36
|
-
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
37
|
-
label: t("create-recovery-code.label"),
|
|
38
|
-
icon: "ph--receipt--duotone",
|
|
39
|
-
variant: "default",
|
|
40
|
-
onClick: () => invokePromise(ClientOperation.CreateRecoveryCode)
|
|
41
|
-
}))), /* @__PURE__ */ React.createElement(Form.Section, {
|
|
42
|
-
title: t("credentials-list.label")
|
|
43
|
-
}, recoveryCredentials.length < 1 ? /* @__PURE__ */ React.createElement(Message.Root, {
|
|
44
|
-
valence: "error"
|
|
45
|
-
}, /* @__PURE__ */ React.createElement(Message.Title, {
|
|
46
|
-
icon: "ph--shield-warning--duotone"
|
|
47
|
-
}, t("no-credentials.title")), /* @__PURE__ */ React.createElement(Message.Content, null, t("no-credentials.message"))) : /* @__PURE__ */ React.createElement(Listbox.Root, null, /* @__PURE__ */ React.createElement(Listbox.Content, {
|
|
48
|
-
classNames: "gap-1"
|
|
49
|
-
}, recoveryCredentials.map((credential, index) => /* @__PURE__ */ React.createElement(Listbox.Item, {
|
|
50
|
-
key: credential.id?.toHex() ?? index,
|
|
51
|
-
id: credential.id?.toHex() ?? `${index}`,
|
|
52
|
-
classNames: "gap-2"
|
|
53
|
-
}, /* @__PURE__ */ React.createElement(Icon, {
|
|
54
|
-
icon: "ph--key--regular"
|
|
55
|
-
}), /* @__PURE__ */ React.createElement(Listbox.ItemLabel, null, credential.issuanceDate.toLocaleString())))))))));
|
|
56
|
-
};
|
|
57
|
-
export {
|
|
58
|
-
RecoveryCredentialsContainer as default
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=RecoveryCredentialsContainer-6BZ2IWX7.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/containers/RecoveryCredentialsContainer/RecoveryCredentialsContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { useCredentials } from '@dxos/react-client/halo';\nimport { Icon, IconButton, Message, useTranslation } from '@dxos/react-ui';\nimport { Form } from '@dxos/react-ui-form';\nimport { Listbox } from '@dxos/react-ui-list';\n\nimport { meta } from '#meta';\nimport { ClientOperation } from '#operations';\n\nexport const MANAGE_CREDENTIALS_DIALOG = `${meta.profile.key}.ManageCredentialsDialog`;\n\nexport const RecoveryCredentialsContainer = () => {\n const { t } = useTranslation(meta.profile.key);\n const { invokePromise } = useOperationInvoker();\n const credentials = useCredentials();\n const recoveryCredentials = credentials.filter(\n (credential) => credential.subject.assertion['@type'] === 'dxos.halo.credentials.IdentityRecovery',\n );\n\n return (\n <Form.Root variant='settings'>\n <Form.Viewport scroll>\n <Form.Content>\n <Form.Section title={t('recovery-setup-dialog.title')} description={t('recovery-setup-dialog.description')}>\n <Form.Row label={t('create-passkey.label')} description={t('create-passkey.description')}>\n <IconButton\n label={t('create-passkey.label')}\n icon='ph--key--duotone'\n variant='primary'\n onClick={() => invokePromise(ClientOperation.CreatePasskey)}\n />\n </Form.Row>\n <Form.Row label={t('create-recovery-code.label')} description={t('create-recovery-code.description')}>\n <IconButton\n label={t('create-recovery-code.label')}\n icon='ph--receipt--duotone'\n variant='default'\n onClick={() => invokePromise(ClientOperation.CreateRecoveryCode)}\n />\n </Form.Row>\n </Form.Section>\n <Form.Section title={t('credentials-list.label')}>\n {recoveryCredentials.length < 1 ? (\n <Message.Root valence='error'>\n <Message.Title icon='ph--shield-warning--duotone'>{t('no-credentials.title')}</Message.Title>\n <Message.Content>{t('no-credentials.message')}</Message.Content>\n </Message.Root>\n ) : (\n <Listbox.Root>\n <Listbox.Content classNames='gap-1'>\n {recoveryCredentials.map((credential, index) => (\n <Listbox.Item\n key={credential.id?.toHex() ?? index}\n id={credential.id?.toHex() ?? `${index}`}\n classNames='gap-2'\n >\n <Icon icon='ph--key--regular' />\n <Listbox.ItemLabel>{credential.issuanceDate.toLocaleString()}</Listbox.ItemLabel>\n </Listbox.Item>\n ))}\n </Listbox.Content>\n </Listbox.Root>\n )}\n </Form.Section>\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,WAAW;AAElB,SAASC,2BAA2B;AACpC,SAASC,sBAAsB;AAC/B,SAASC,MAAMC,YAAYC,SAASC,sBAAsB;AAC1D,SAASC,YAAY;AACrB,SAASC,eAAe;AAExB,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAEzB,IAAMC,4BAA4B,GAAGF,KAAKG,QAAQC,GAAG;AAErD,IAAMC,+BAA+B,MAAA;AAC1C,QAAM,EAAEC,EAAC,IAAKT,eAAeG,KAAKG,QAAQC,GAAG;AAC7C,QAAM,EAAEG,cAAa,IAAKf,oBAAAA;AAC1B,QAAMgB,cAAcf,eAAAA;AACpB,QAAMgB,sBAAsBD,YAAYE,OACtC,CAACC,eAAeA,WAAWC,QAAQC,UAAU,OAAA,MAAa,wCAAA;AAG5D,SACE,sBAAA,cAACf,KAAKgB,MAAI;IAACC,SAAQ;KACjB,sBAAA,cAACjB,KAAKkB,UAAQ;IAACC,QAAAA;KACb,sBAAA,cAACnB,KAAKoB,SAAO,MACX,sBAAA,cAACpB,KAAKqB,SAAO;IAACC,OAAOd,EAAE,6BAAA;IAAgCe,aAAaf,EAAE,mCAAA;KACpE,sBAAA,cAACR,KAAKwB,KAAG;IAACC,OAAOjB,EAAE,sBAAA;IAAyBe,aAAaf,EAAE,4BAAA;KACzD,sBAAA,cAACX,YAAAA;IACC4B,OAAOjB,EAAE,sBAAA;IACTkB,MAAK;IACLT,SAAQ;IACRU,SAAS,MAAMlB,cAAcN,gBAAgByB,aAAa;OAG9D,sBAAA,cAAC5B,KAAKwB,KAAG;IAACC,OAAOjB,EAAE,4BAAA;IAA+Be,aAAaf,EAAE,kCAAA;KAC/D,sBAAA,cAACX,YAAAA;IACC4B,OAAOjB,EAAE,4BAAA;IACTkB,MAAK;IACLT,SAAQ;IACRU,SAAS,MAAMlB,cAAcN,gBAAgB0B,kBAAkB;QAIrE,sBAAA,cAAC7B,KAAKqB,SAAO;IAACC,OAAOd,EAAE,wBAAA;KACpBG,oBAAoBmB,SAAS,IAC5B,sBAAA,cAAChC,QAAQkB,MAAI;IAACe,SAAQ;KACpB,sBAAA,cAACjC,QAAQkC,OAAK;IAACN,MAAK;KAA+BlB,EAAE,sBAAA,CAAA,GACrD,sBAAA,cAACV,QAAQsB,SAAO,MAAEZ,EAAE,wBAAA,CAAA,CAAA,IAGtB,sBAAA,cAACP,QAAQe,MAAI,MACX,sBAAA,cAACf,QAAQmB,SAAO;IAACa,YAAW;KACzBtB,oBAAoBuB,IAAI,CAACrB,YAAYsB,UACpC,sBAAA,cAAClC,QAAQmC,MAAI;IACX9B,KAAKO,WAAWwB,IAAIC,MAAAA,KAAWH;IAC/BE,IAAIxB,WAAWwB,IAAIC,MAAAA,KAAW,GAAGH,KAAAA;IACjCF,YAAW;KAEX,sBAAA,cAACrC,MAAAA;IAAK8B,MAAK;MACX,sBAAA,cAACzB,QAAQsC,WAAS,MAAE1B,WAAW2B,aAAaC,eAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAWhF;",
|
|
6
|
-
"names": ["React", "useOperationInvoker", "useCredentials", "Icon", "IconButton", "Message", "useTranslation", "Form", "Listbox", "meta", "ClientOperation", "MANAGE_CREDENTIALS_DIALOG", "profile", "key", "RecoveryCredentialsContainer", "t", "invokePromise", "credentials", "recoveryCredentials", "filter", "credential", "subject", "assertion", "Root", "variant", "Viewport", "scroll", "Content", "Section", "title", "description", "Row", "label", "icon", "onClick", "CreatePasskey", "CreateRecoveryCode", "length", "valence", "Title", "classNames", "map", "index", "Item", "id", "toHex", "ItemLabel", "issuanceDate", "toLocaleString"]
|
|
7
|
-
}
|