@minca/core 0.1.14 → 0.1.16
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/README.md +4 -4
- package/dist/elements/auth-styles.d.ts +1 -1
- package/dist/elements/auth-styles.d.ts.map +1 -1
- package/dist/elements/auth-styles.js +21 -4
- package/dist/elements/auth-styles.js.map +1 -1
- package/dist/elements/minca-auth.d.ts.map +1 -1
- package/dist/elements/minca-auth.js +151 -57
- package/dist/elements/minca-auth.js.map +1 -1
- package/dist/files/space-files.d.ts +15 -3
- package/dist/files/space-files.d.ts.map +1 -1
- package/dist/files/space-files.js +225 -37
- package/dist/files/space-files.js.map +1 -1
- package/dist/identity/abilities.d.ts +2 -0
- package/dist/identity/abilities.d.ts.map +1 -1
- package/dist/identity/abilities.js +2 -0
- package/dist/identity/abilities.js.map +1 -1
- package/dist/identity/account-vault.d.ts +15 -71
- package/dist/identity/account-vault.d.ts.map +1 -1
- package/dist/identity/account-vault.js +45 -104
- package/dist/identity/account-vault.js.map +1 -1
- package/dist/identity/channel.d.ts +3 -9
- package/dist/identity/channel.d.ts.map +1 -1
- package/dist/identity/channel.js +42 -42
- package/dist/identity/channel.js.map +1 -1
- package/dist/identity/contact-key.d.ts +14 -29
- package/dist/identity/contact-key.d.ts.map +1 -1
- package/dist/identity/contact-key.js +31 -51
- package/dist/identity/contact-key.js.map +1 -1
- package/dist/identity/crypto-p256.d.ts.map +1 -1
- package/dist/identity/crypto-p256.js +39 -53
- package/dist/identity/crypto-p256.js.map +1 -1
- package/dist/identity/hpke.d.ts.map +1 -1
- package/dist/identity/hpke.js +19 -19
- package/dist/identity/hpke.js.map +1 -1
- package/dist/identity/identity-manager.d.ts.map +1 -1
- package/dist/identity/identity-manager.js +1 -2
- package/dist/identity/identity-manager.js.map +1 -1
- package/dist/identity/policy.d.ts.map +1 -1
- package/dist/identity/policy.js +35 -61
- package/dist/identity/policy.js.map +1 -1
- package/dist/identity/recovery-code.d.ts +2 -8
- package/dist/identity/recovery-code.d.ts.map +1 -1
- package/dist/identity/recovery-code.js +4 -11
- package/dist/identity/recovery-code.js.map +1 -1
- package/dist/identity/root-signer.d.ts +1 -6
- package/dist/identity/root-signer.d.ts.map +1 -1
- package/dist/identity/root-signer.js +12 -15
- package/dist/identity/root-signer.js.map +1 -1
- package/dist/identity/ucan.d.ts.map +1 -1
- package/dist/identity/ucan.js +48 -39
- package/dist/identity/ucan.js.map +1 -1
- package/dist/identity/webauthn.d.ts +6 -11
- package/dist/identity/webauthn.d.ts.map +1 -1
- package/dist/identity/webauthn.js +18 -30
- package/dist/identity/webauthn.js.map +1 -1
- package/dist/inbox/inbox.d.ts.map +1 -1
- package/dist/inbox/inbox.js +40 -30
- package/dist/inbox/inbox.js.map +1 -1
- package/dist/inbox/index.d.ts +2 -0
- package/dist/inbox/index.d.ts.map +1 -1
- package/dist/inbox/index.js +1 -0
- package/dist/inbox/index.js.map +1 -1
- package/dist/inbox/names.d.ts +54 -0
- package/dist/inbox/names.d.ts.map +1 -0
- package/dist/inbox/names.js +299 -0
- package/dist/inbox/names.js.map +1 -0
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -12
- package/dist/index.js.map +1 -1
- package/dist/network/mesh.d.ts +7 -20
- package/dist/network/mesh.d.ts.map +1 -1
- package/dist/network/mesh.js +267 -245
- package/dist/network/mesh.js.map +1 -1
- package/dist/network/relay-link.d.ts +31 -0
- package/dist/network/relay-link.d.ts.map +1 -0
- package/dist/network/relay-link.js +62 -0
- package/dist/network/relay-link.js.map +1 -0
- package/dist/network/relay-minca.d.ts +12 -1
- package/dist/network/relay-minca.d.ts.map +1 -1
- package/dist/network/relay-minca.js +25 -55
- package/dist/network/relay-minca.js.map +1 -1
- package/dist/network/relay-nostr.d.ts +14 -3
- package/dist/network/relay-nostr.d.ts.map +1 -1
- package/dist/network/relay-nostr.js +34 -72
- package/dist/network/relay-nostr.js.map +1 -1
- package/dist/network/relay-socket.d.ts +1 -1
- package/dist/network/relay-socket.d.ts.map +1 -1
- package/dist/network/relay-socket.js +3 -1
- package/dist/network/relay-socket.js.map +1 -1
- package/dist/network/relays.d.ts +26 -17
- package/dist/network/relays.d.ts.map +1 -1
- package/dist/network/relays.js +21 -28
- package/dist/network/relays.js.map +1 -1
- package/dist/network/rendezvous.d.ts +1 -1
- package/dist/network/rendezvous.d.ts.map +1 -1
- package/dist/network/rendezvous.js +2 -2
- package/dist/network/rendezvous.js.map +1 -1
- package/dist/node/actions.d.ts.map +1 -1
- package/dist/node/actions.js +56 -39
- package/dist/node/actions.js.map +1 -1
- package/dist/node/api.d.ts +6 -0
- package/dist/node/api.d.ts.map +1 -1
- package/dist/node/api.js +6 -0
- package/dist/node/api.js.map +1 -1
- package/dist/node/carrier.d.ts +5 -0
- package/dist/node/carrier.d.ts.map +1 -1
- package/dist/node/carrier.js +94 -73
- package/dist/node/carrier.js.map +1 -1
- package/dist/node/copy.d.ts +8 -7
- package/dist/node/copy.d.ts.map +1 -1
- package/dist/node/copy.js +54 -56
- package/dist/node/copy.js.map +1 -1
- package/dist/node/host.d.ts +39 -65
- package/dist/node/host.d.ts.map +1 -1
- package/dist/node/host.js +362 -379
- package/dist/node/host.js.map +1 -1
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/node-carriers.d.ts +35 -0
- package/dist/node/node-carriers.d.ts.map +1 -0
- package/dist/node/node-carriers.js +562 -0
- package/dist/node/node-carriers.js.map +1 -0
- package/dist/node/node-contacts.d.ts +11 -0
- package/dist/node/node-contacts.d.ts.map +1 -0
- package/dist/node/node-contacts.js +808 -0
- package/dist/node/node-contacts.js.map +1 -0
- package/dist/node/node-context.d.ts +76 -0
- package/dist/node/node-context.d.ts.map +1 -0
- package/dist/node/node-context.js +54 -0
- package/dist/node/node-context.js.map +1 -0
- package/dist/node/node-hosting.d.ts +20 -0
- package/dist/node/node-hosting.d.ts.map +1 -0
- package/dist/node/node-hosting.js +449 -0
- package/dist/node/node-hosting.js.map +1 -0
- package/dist/node/node-records.d.ts +18 -0
- package/dist/node/node-records.d.ts.map +1 -0
- package/dist/node/node-records.js +262 -0
- package/dist/node/node-records.js.map +1 -0
- package/dist/node/node.d.ts.map +1 -1
- package/dist/node/node.js +197 -1989
- package/dist/node/node.js.map +1 -1
- package/dist/node/remote.d.ts +5 -6
- package/dist/node/remote.d.ts.map +1 -1
- package/dist/node/remote.js +272 -260
- package/dist/node/remote.js.map +1 -1
- package/dist/node/space-catalog.d.ts +40 -0
- package/dist/node/space-catalog.d.ts.map +1 -0
- package/dist/node/space-catalog.js +158 -0
- package/dist/node/space-catalog.js.map +1 -0
- package/dist/node/space-checks.d.ts +25 -0
- package/dist/node/space-checks.d.ts.map +1 -0
- package/dist/node/space-checks.js +343 -0
- package/dist/node/space-checks.js.map +1 -0
- package/dist/node/space-history.d.ts +37 -0
- package/dist/node/space-history.d.ts.map +1 -0
- package/dist/node/space-history.js +350 -0
- package/dist/node/space-history.js.map +1 -0
- package/dist/node/space-holding.d.ts +49 -0
- package/dist/node/space-holding.d.ts.map +1 -0
- package/dist/node/space-holding.js +267 -0
- package/dist/node/space-holding.js.map +1 -0
- package/dist/node/space-index.d.ts +41 -0
- package/dist/node/space-index.d.ts.map +1 -0
- package/dist/node/space-index.js +217 -0
- package/dist/node/space-index.js.map +1 -0
- package/dist/node/space-keys.d.ts +34 -0
- package/dist/node/space-keys.d.ts.map +1 -0
- package/dist/node/space-keys.js +309 -0
- package/dist/node/space-keys.js.map +1 -0
- package/dist/node/space-lines.d.ts +33 -0
- package/dist/node/space-lines.d.ts.map +1 -0
- package/dist/node/space-lines.js +145 -0
- package/dist/node/space-lines.js.map +1 -0
- package/dist/node/space-membership.d.ts +69 -0
- package/dist/node/space-membership.d.ts.map +1 -0
- package/dist/node/space-membership.js +242 -0
- package/dist/node/space-membership.js.map +1 -0
- package/dist/node/space-mirrors.d.ts +43 -0
- package/dist/node/space-mirrors.d.ts.map +1 -0
- package/dist/node/space-mirrors.js +125 -0
- package/dist/node/space-mirrors.js.map +1 -0
- package/dist/node/space-peers.d.ts +104 -0
- package/dist/node/space-peers.d.ts.map +1 -0
- package/dist/node/space-peers.js +595 -0
- package/dist/node/space-peers.js.map +1 -0
- package/dist/node/space-profiles.d.ts +18 -0
- package/dist/node/space-profiles.d.ts.map +1 -0
- package/dist/node/space-profiles.js +105 -0
- package/dist/node/space-profiles.js.map +1 -0
- package/dist/node/space-rules.d.ts +29 -0
- package/dist/node/space-rules.d.ts.map +1 -0
- package/dist/node/space-rules.js +144 -0
- package/dist/node/space-rules.js.map +1 -0
- package/dist/node/space-runtime.d.ts +104 -143
- package/dist/node/space-runtime.d.ts.map +1 -1
- package/dist/node/space-runtime.js +293 -3954
- package/dist/node/space-runtime.js.map +1 -1
- package/dist/node/space-standing.d.ts +20 -0
- package/dist/node/space-standing.d.ts.map +1 -0
- package/dist/node/space-standing.js +317 -0
- package/dist/node/space-standing.js.map +1 -0
- package/dist/node/space-versions.d.ts +104 -0
- package/dist/node/space-versions.d.ts.map +1 -0
- package/dist/node/space-versions.js +153 -0
- package/dist/node/space-versions.js.map +1 -0
- package/dist/node/space-warrants.d.ts +25 -0
- package/dist/node/space-warrants.d.ts.map +1 -0
- package/dist/node/space-warrants.js +214 -0
- package/dist/node/space-warrants.js.map +1 -0
- package/dist/node/space-writing.d.ts +72 -0
- package/dist/node/space-writing.d.ts.map +1 -0
- package/dist/node/space-writing.js +440 -0
- package/dist/node/space-writing.js.map +1 -0
- package/dist/node/stores.d.ts +19 -50
- package/dist/node/stores.d.ts.map +1 -1
- package/dist/node/stores.js +14 -33
- package/dist/node/stores.js.map +1 -1
- package/dist/node/types.d.ts +225 -305
- package/dist/node/types.d.ts.map +1 -1
- package/dist/node/usage.d.ts +2 -24
- package/dist/node/usage.d.ts.map +1 -1
- package/dist/node/usage.js +118 -102
- package/dist/node/usage.js.map +1 -1
- package/dist/node/watch-notifications.d.ts.map +1 -1
- package/dist/node/watch-notifications.js +32 -29
- package/dist/node/watch-notifications.js.map +1 -1
- package/dist/node/worker.d.ts +5 -6
- package/dist/node/worker.d.ts.map +1 -1
- package/dist/node/worker.js +80 -72
- package/dist/node/worker.js.map +1 -1
- package/dist/node/writer-keys.d.ts +5 -6
- package/dist/node/writer-keys.d.ts.map +1 -1
- package/dist/node/writer-keys.js +66 -57
- package/dist/node/writer-keys.js.map +1 -1
- package/dist/node/writers.d.ts +12 -19
- package/dist/node/writers.d.ts.map +1 -1
- package/dist/node/writers.js +7 -15
- package/dist/node/writers.js.map +1 -1
- package/dist/privacy/direct.d.ts.map +1 -1
- package/dist/privacy/direct.js +31 -27
- package/dist/privacy/direct.js.map +1 -1
- package/dist/privacy/space-encryption.d.ts.map +1 -1
- package/dist/privacy/space-encryption.js +5 -9
- package/dist/privacy/space-encryption.js.map +1 -1
- package/dist/query/computed.d.ts.map +1 -1
- package/dist/query/computed.js +78 -77
- package/dist/query/computed.js.map +1 -1
- package/dist/query/engine.d.ts +3 -4
- package/dist/query/engine.d.ts.map +1 -1
- package/dist/query/engine.js +93 -86
- package/dist/query/engine.js.map +1 -1
- package/dist/query/filter.d.ts +8 -10
- package/dist/query/filter.d.ts.map +1 -1
- package/dist/query/filter.js +144 -161
- package/dist/query/filter.js.map +1 -1
- package/dist/records/cel-types.d.ts.map +1 -1
- package/dist/records/cel-types.js +13 -27
- package/dist/records/cel-types.js.map +1 -1
- package/dist/records/cel.d.ts.map +1 -1
- package/dist/records/cel.js +177 -242
- package/dist/records/cel.js.map +1 -1
- package/dist/records/rules.d.ts.map +1 -1
- package/dist/records/rules.js +46 -50
- package/dist/records/rules.js.map +1 -1
- package/dist/records/topics.d.ts.map +1 -1
- package/dist/records/topics.js +18 -22
- package/dist/records/topics.js.map +1 -1
- package/dist/schema/collection-def.d.ts.map +1 -1
- package/dist/schema/collection-def.js +16 -5
- package/dist/schema/collection-def.js.map +1 -1
- package/dist/schemas/automations.d.ts +16 -15
- package/dist/schemas/automations.d.ts.map +1 -1
- package/dist/schemas/automations.js +203 -165
- package/dist/schemas/automations.js.map +1 -1
- package/dist/schemas/blueprints.d.ts.map +1 -1
- package/dist/schemas/blueprints.js +14 -13
- package/dist/schemas/blueprints.js.map +1 -1
- package/dist/schemas/connectors.d.ts +12 -0
- package/dist/schemas/connectors.d.ts.map +1 -1
- package/dist/schemas/connectors.js +16 -11
- package/dist/schemas/connectors.js.map +1 -1
- package/dist/schemas/contacts.d.ts +57 -0
- package/dist/schemas/contacts.d.ts.map +1 -1
- package/dist/schemas/contacts.js +32 -0
- package/dist/schemas/contacts.js.map +1 -1
- package/dist/schemas/cron.d.ts.map +1 -1
- package/dist/schemas/cron.js +27 -28
- package/dist/schemas/cron.js.map +1 -1
- package/dist/schemas/defined.d.ts +6 -0
- package/dist/schemas/defined.d.ts.map +1 -0
- package/dist/schemas/defined.js +7 -0
- package/dist/schemas/defined.js.map +1 -0
- package/dist/schemas/fragments.d.ts +22 -2
- package/dist/schemas/fragments.d.ts.map +1 -1
- package/dist/schemas/fragments.js +20 -12
- package/dist/schemas/fragments.js.map +1 -1
- package/dist/schemas/guides.d.ts +3 -1
- package/dist/schemas/guides.d.ts.map +1 -1
- package/dist/schemas/guides.js +13 -12
- package/dist/schemas/guides.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +18 -14
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/library/annotations.d.ts +30 -0
- package/dist/schemas/library/annotations.d.ts.map +1 -1
- package/dist/schemas/library/annotations.js +1 -0
- package/dist/schemas/library/annotations.js.map +1 -1
- package/dist/schemas/library/community.d.ts +28 -0
- package/dist/schemas/library/community.d.ts.map +1 -1
- package/dist/schemas/library/life.d.ts +62 -2
- package/dist/schemas/library/life.d.ts.map +1 -1
- package/dist/schemas/library/media.d.ts +36 -0
- package/dist/schemas/library/media.d.ts.map +1 -1
- package/dist/schemas/library/money.d.ts +74 -2
- package/dist/schemas/library/money.d.ts.map +1 -1
- package/dist/schemas/library/planning.d.ts +56 -0
- package/dist/schemas/library/planning.d.ts.map +1 -1
- package/dist/schemas/library/publishing.d.ts +80 -4
- package/dist/schemas/library/publishing.d.ts.map +1 -1
- package/dist/schemas/library/social.d.ts +44 -0
- package/dist/schemas/library/social.d.ts.map +1 -1
- package/dist/session/account-hint.d.ts.map +1 -1
- package/dist/session/account-hint.js +8 -5
- package/dist/session/account-hint.js.map +1 -1
- package/dist/session/auth.d.ts +36 -2
- package/dist/session/auth.d.ts.map +1 -1
- package/dist/session/auth.js +95 -2
- package/dist/session/auth.js.map +1 -1
- package/dist/session/connect.d.ts +1 -0
- package/dist/session/connect.d.ts.map +1 -1
- package/dist/session/connect.js +3 -1
- package/dist/session/connect.js.map +1 -1
- package/dist/session/credentials.d.ts +8 -26
- package/dist/session/credentials.d.ts.map +1 -1
- package/dist/session/credentials.js +14 -32
- package/dist/session/credentials.js.map +1 -1
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +1 -0
- package/dist/session/index.js.map +1 -1
- package/dist/session/pairing.d.ts.map +1 -1
- package/dist/session/pairing.js +92 -88
- package/dist/session/pairing.js.map +1 -1
- package/dist/session/password-strength.d.ts.map +1 -1
- package/dist/session/password-strength.js +37 -37
- package/dist/session/password-strength.js.map +1 -1
- package/dist/session/places.d.ts.map +1 -1
- package/dist/session/places.js +18 -13
- package/dist/session/places.js.map +1 -1
- package/dist/session/popup.d.ts +13 -0
- package/dist/session/popup.d.ts.map +1 -0
- package/dist/session/popup.js +23 -0
- package/dist/session/popup.js.map +1 -0
- package/dist/space/constitution.d.ts.map +1 -1
- package/dist/space/constitution.js +22 -29
- package/dist/space/constitution.js.map +1 -1
- package/dist/space/grants.d.ts.map +1 -1
- package/dist/space/grants.js +37 -39
- package/dist/space/grants.js.map +1 -1
- package/dist/space/invite-link.d.ts.map +1 -1
- package/dist/space/invite-link.js +33 -33
- package/dist/space/invite-link.js.map +1 -1
- package/dist/space/own-automations.d.ts +13 -24
- package/dist/space/own-automations.d.ts.map +1 -1
- package/dist/space/own-automations.js +47 -37
- package/dist/space/own-automations.js.map +1 -1
- package/dist/space/roles.d.ts +56 -80
- package/dist/space/roles.d.ts.map +1 -1
- package/dist/space/roles.js +448 -441
- package/dist/space/roles.js.map +1 -1
- package/dist/space/space-access.d.ts +3 -4
- package/dist/space/space-access.d.ts.map +1 -1
- package/dist/space/space-access.js +3 -8
- package/dist/space/space-access.js.map +1 -1
- package/dist/storage/blob/directory.d.ts.map +1 -1
- package/dist/storage/blob/directory.js +39 -32
- package/dist/storage/blob/directory.js.map +1 -1
- package/dist/storage/blob/s3.d.ts.map +1 -1
- package/dist/storage/blob/s3.js +21 -19
- package/dist/storage/blob/s3.js.map +1 -1
- package/dist/storage/blob-store.d.ts +0 -9
- package/dist/storage/blob-store.d.ts.map +1 -1
- package/dist/storage/directory-access.d.ts +8 -32
- package/dist/storage/directory-access.d.ts.map +1 -1
- package/dist/storage/directory-access.js +11 -36
- package/dist/storage/directory-access.js.map +1 -1
- package/dist/storage/encrypted-adapter.d.ts +12 -32
- package/dist/storage/encrypted-adapter.d.ts.map +1 -1
- package/dist/storage/encrypted-adapter.js +31 -54
- package/dist/storage/encrypted-adapter.js.map +1 -1
- package/dist/storage/folder-adapter.d.ts +12 -26
- package/dist/storage/folder-adapter.d.ts.map +1 -1
- package/dist/storage/folder-adapter.js +37 -54
- package/dist/storage/folder-adapter.js.map +1 -1
- package/dist/storage/folder-reconcile.d.ts +12 -26
- package/dist/storage/folder-reconcile.d.ts.map +1 -1
- package/dist/storage/folder-reconcile.js +39 -48
- package/dist/storage/folder-reconcile.js.map +1 -1
- package/dist/storage/indexeddb-adapter.d.ts +2 -6
- package/dist/storage/indexeddb-adapter.d.ts.map +1 -1
- package/dist/storage/indexeddb-adapter.js +60 -114
- package/dist/storage/indexeddb-adapter.js.map +1 -1
- package/dist/storage/mirror.d.ts +0 -29
- package/dist/storage/mirror.d.ts.map +1 -1
- package/dist/storage/mirror.js +153 -110
- package/dist/storage/mirror.js.map +1 -1
- package/dist/storage/segment.d.ts.map +1 -1
- package/dist/storage/segment.js +3 -7
- package/dist/storage/segment.js.map +1 -1
- package/dist/storage/storage-provider.d.ts +6 -11
- package/dist/storage/storage-provider.d.ts.map +1 -1
- package/dist/storage/storage-provider.js +112 -116
- package/dist/storage/storage-provider.js.map +1 -1
- package/dist/sync/sync-engine.d.ts +10 -44
- package/dist/sync/sync-engine.d.ts.map +1 -1
- package/dist/sync/sync-engine.js +245 -247
- package/dist/sync/sync-engine.js.map +1 -1
- package/dist/sync/sync-messages.d.ts +1 -1
- package/dist/sync/sync-messages.d.ts.map +1 -1
- package/dist/sync/sync-messages.js +1 -1
- package/dist/sync/sync-messages.js.map +1 -1
- package/dist/utils/guards.d.ts +1 -0
- package/dist/utils/guards.d.ts.map +1 -1
- package/dist/utils/guards.js +1 -0
- package/dist/utils/guards.js.map +1 -1
- package/dist/utils/hmac.d.ts +5 -0
- package/dist/utils/hmac.d.ts.map +1 -0
- package/dist/utils/hmac.js +20 -0
- package/dist/utils/hmac.js.map +1 -0
- package/dist/utils/map.d.ts +10 -0
- package/dist/utils/map.d.ts.map +1 -0
- package/dist/utils/map.js +30 -0
- package/dist/utils/map.js.map +1 -0
- package/dist/utils/serial.d.ts +2 -0
- package/dist/utils/serial.d.ts.map +1 -1
- package/dist/utils/serial.js +9 -0
- package/dist/utils/serial.js.map +1 -1
- package/dist/validation/capability-gate.d.ts +7 -15
- package/dist/validation/capability-gate.d.ts.map +1 -1
- package/dist/validation/capability-gate.js +32 -36
- package/dist/validation/capability-gate.js.map +1 -1
- package/dist/validation/crypto-gate.d.ts.map +1 -1
- package/dist/validation/crypto-gate.js +12 -21
- package/dist/validation/crypto-gate.js.map +1 -1
- package/docs/README.md +3 -2
- package/docs/actions.md +47 -20
- package/docs/automations.md +1 -1
- package/docs/blueprints-and-guides.md +57 -13
- package/docs/building-an-app.md +11 -8
- package/docs/collections.md +33 -5
- package/docs/contacts.md +34 -1
- package/docs/contracts.md +1 -1
- package/docs/direct-messages.md +1 -1
- package/docs/inbox.md +5 -11
- package/docs/node.md +36 -26
- package/docs/records-and-queries.md +1 -1
- package/docs/sign-in.md +54 -26
- package/docs/spaces.md +6 -6
- package/docs/standard-library.md +33 -31
- package/docs/storage.md +37 -15
- package/docs/usernames.md +161 -0
- package/docs/warrants.md +1 -1
- package/package.json +2 -21
- package/dist/calls/calls.d.ts +0 -140
- package/dist/calls/calls.d.ts.map +0 -1
- package/dist/calls/calls.js +0 -861
- package/dist/calls/calls.js.map +0 -1
- package/dist/calls/index.d.ts +0 -4
- package/dist/calls/index.d.ts.map +0 -1
- package/dist/calls/index.js +0 -3
- package/dist/calls/index.js.map +0 -1
- package/dist/react/context.d.ts +0 -81
- package/dist/react/context.d.ts.map +0 -1
- package/dist/react/context.js +0 -97
- package/dist/react/context.js.map +0 -1
- package/dist/react/follow.d.ts +0 -11
- package/dist/react/follow.d.ts.map +0 -1
- package/dist/react/follow.js +0 -7
- package/dist/react/follow.js.map +0 -1
- package/dist/react/index.d.ts +0 -44
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js +0 -40
- package/dist/react/index.js.map +0 -1
- package/dist/react/minca-auth.d.ts +0 -19
- package/dist/react/minca-auth.d.ts.map +0 -1
- package/dist/react/minca-auth.js +0 -36
- package/dist/react/minca-auth.js.map +0 -1
- package/dist/react/use-calls.d.ts +0 -21
- package/dist/react/use-calls.d.ts.map +0 -1
- package/dist/react/use-calls.js +0 -39
- package/dist/react/use-calls.js.map +0 -1
- package/dist/react/use-invite-link.d.ts +0 -24
- package/dist/react/use-invite-link.d.ts.map +0 -1
- package/dist/react/use-invite-link.js +0 -62
- package/dist/react/use-invite-link.js.map +0 -1
- package/dist/react/use-live.d.ts +0 -16
- package/dist/react/use-live.d.ts.map +0 -1
- package/dist/react/use-live.js +0 -56
- package/dist/react/use-live.js.map +0 -1
- package/dist/react/use-my-name.d.ts +0 -12
- package/dist/react/use-my-name.d.ts.map +0 -1
- package/dist/react/use-my-name.js +0 -38
- package/dist/react/use-my-name.js.map +0 -1
- package/dist/react/use-names.d.ts +0 -7
- package/dist/react/use-names.d.ts.map +0 -1
- package/dist/react/use-names.js +0 -13
- package/dist/react/use-names.js.map +0 -1
- package/dist/react/use-network.d.ts +0 -9
- package/dist/react/use-network.d.ts.map +0 -1
- package/dist/react/use-network.js +0 -33
- package/dist/react/use-network.js.map +0 -1
- package/dist/react/use-query.d.ts +0 -14
- package/dist/react/use-query.d.ts.map +0 -1
- package/dist/react/use-query.js +0 -26
- package/dist/react/use-query.js.map +0 -1
- package/dist/react/use-space.d.ts +0 -29
- package/dist/react/use-space.d.ts.map +0 -1
- package/dist/react/use-space.js +0 -57
- package/dist/react/use-space.js.map +0 -1
- package/dist/react/use-spaces.d.ts +0 -29
- package/dist/react/use-spaces.d.ts.map +0 -1
- package/dist/react/use-spaces.js +0 -78
- package/dist/react/use-spaces.js.map +0 -1
- package/docs/calls.md +0 -189
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ const me = await manager.fromSeed(seed);
|
|
|
91
91
|
const node = await createNode({
|
|
92
92
|
signer: createLocalRootSigner(me, manager.getProvider()),
|
|
93
93
|
stores: indexedDBStores('groceries'),
|
|
94
|
-
network: { relays: ['wss://minca.
|
|
94
|
+
network: { relays: ['wss://relay.minca.social'] },
|
|
95
95
|
});
|
|
96
96
|
|
|
97
97
|
// 3. A private space, encrypted end to end, with a team's roles.
|
|
@@ -113,12 +113,12 @@ which signs a note for the app's own key, for the spaces the person picks:
|
|
|
113
113
|
|
|
114
114
|
```tsx
|
|
115
115
|
import { createMincaConnection } from '@minca/core/session';
|
|
116
|
-
import { MincaProvider, useConnection } from '@minca/
|
|
116
|
+
import { MincaProvider, useConnection } from '@minca/react';
|
|
117
117
|
|
|
118
118
|
const connection = createMincaConnection({
|
|
119
119
|
home: 'https://home.minca.social/connect', // a suggestion: the person may use their own
|
|
120
120
|
request: { name: 'Todo', access: 'write', scope: 'spaces' },
|
|
121
|
-
network: { relays: ['wss://minca.
|
|
121
|
+
network: { relays: ['wss://relay.minca.social'] },
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
function App() {
|
|
@@ -229,7 +229,7 @@ One npm workspace. Everything imports the protocol as `@minca/core`.
|
|
|
229
229
|
| Identity: the seed, recovery code, wraps, passkeys, UCAN, root signers | [sign-in](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/sign-in.md), [node](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/node.md#root-signers-and-notes) | [01 Identity](https://github.com/leifriksheim/minca/blob/main/spec/01-identity.md) |
|
|
230
230
|
| Spaces: the constitution, founders, roles and grants, invites, successors, key changes, profiles | [spaces](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/spaces.md) | [03 Spaces](https://github.com/leifriksheim/minca/blob/main/spec/03-spaces.md) |
|
|
231
231
|
| Collections, schemas, rules, contracts and computed fields, links, queries, the standard library | [collections](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/collections.md), [contracts](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/contracts.md), [computed fields](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/computed.md), [query format](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/query-format.md), [standard library](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/standard-library.md), [blueprints and guides](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/blueprints-and-guides.md) | [02 Records](https://github.com/leifriksheim/minca/blob/main/spec/02-records.md), [09 Contracts](https://github.com/leifriksheim/minca/blob/main/spec/09-contracts.md) |
|
|
232
|
-
| Calls, contacts, the inbox, direct messages | [calls](https://github.com/leifriksheim/minca/blob/main/packages/
|
|
232
|
+
| Calls, contacts, the inbox, direct messages | [calls](https://github.com/leifriksheim/minca/blob/main/packages/calls/README.md), [contacts](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/contacts.md), [inbox](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/inbox.md), [direct messages](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/direct-messages.md) | [07 Inbox](https://github.com/leifriksheim/minca/blob/main/spec/07-inbox.md), [04 Network](https://github.com/leifriksheim/minca/blob/main/spec/04-network.md) |
|
|
233
233
|
| Network: the relay, TURN, meeting peers, introductions, pairing a phone | [node](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/node.md#the-network), [packages/relay](https://github.com/leifriksheim/minca/blob/main/packages/relay/README.md) | [04 Network](https://github.com/leifriksheim/minca/blob/main/spec/04-network.md) |
|
|
234
234
|
| Sync, storage adapters, data folders and locking them, mirrors | [storage](https://github.com/leifriksheim/minca/blob/main/packages/core/docs/storage.md) | [05 Sync and storage](https://github.com/leifriksheim/minca/blob/main/spec/05-sync-and-storage.md) |
|
|
235
235
|
| Hosting: keeping spaces online, payment, bots a host runs | [packages/cli](https://github.com/leifriksheim/minca/blob/main/packages/cli/README.md) | [08 Hosting](https://github.com/leifriksheim/minca/blob/main/spec/08-hosting.md) |
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* not a media query — so the same element fits a full page, a modal or a side
|
|
15
15
|
* panel without being told which.
|
|
16
16
|
*/
|
|
17
|
-
export declare const AUTH_CSS = "\nminca-auth {\n --minca-ink: #000;\n --minca-body: #171717;\n --minca-muted: #666;\n --minca-faint: #8f8f8f;\n --minca-surface: #fff;\n --minca-sunken: #fafafa;\n --minca-line: #eaeaea;\n --minca-line-strong: #d4d4d4;\n --minca-accent: #000;\n --minca-accent-hover: #383838;\n --minca-on-accent: #fff;\n --minca-danger: #e5484d;\n --minca-danger-soft: #fff0f0;\n --minca-warn: #9a5a0b;\n --minca-good: #2f7a52;\n --minca-radius: 6px;\n --minca-font: \"Geist\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n --minca-mono: \"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace;\n\n display: block;\n container-type: inline-size;\n color: var(--minca-body);\n font-family: var(--minca-font);\n font-size: 14px;\n letter-spacing: -0.006em;\n -webkit-font-smoothing: antialiased;\n}\nminca-auth[hidden] { display: none; }\nminca-auth *, minca-auth *::before, minca-auth *::after { box-sizing: border-box; }\nminca-auth :is(h1, p) { margin: 0; }\n\nminca-auth .wa-card { width: 100%; max-width: 380px; margin: 0 auto; }\nminca-auth .wa-wordmark { display: flex; align-items: center; gap: 8px; margin-bottom: 40px; color: var(--minca-ink); font-weight: 600; font-size: 16px; letter-spacing: -0.03em; }\nminca-auth .wa-title { font-size: 28px; font-weight: 600; letter-spacing: -0.04em; color: var(--minca-ink); margin-bottom: 8px; line-height: 1.2; }\nminca-auth .wa-subtitle { font-size: 15px; color: var(--minca-muted); margin-bottom: 32px; line-height: 1.5; }\nminca-auth .wa-hint { font-size: 14px; color: var(--minca-muted); margin-bottom: 20px; line-height: 1.6; }\nminca-auth .wa-small { font-size: 13px; color: var(--minca-muted); margin-top: 8px; line-height: 1.6; }\nminca-auth .wa-meter { display: flex; gap: 4px; margin-top: 2px; }\nminca-auth .wa-meter > span { flex: 1; height: 4px; border-radius: 2px; background: var(--minca-line); transition: background-color .15s ease; }\nminca-auth .wa-meter[data-strength=\"weak\"] > span:first-child { background: var(--minca-danger); }\nminca-auth .wa-meter[data-strength=\"fair\"] > span:not(:last-child) { background: var(--minca-warn); }\nminca-auth .wa-meter[data-strength=\"strong\"] > span { background: var(--minca-good); }\nminca-auth .wa-small[data-strength] { margin-top: 0; }\nminca-auth .wa-small[data-strength=\"weak\"] { color: var(--minca-danger); }\nminca-auth .wa-error { color: var(--minca-danger); font-size: 14px; font-weight: 500; }\nminca-auth .wa-error-box { margin-top: 16px; padding: 12px 14px; border-radius: var(--minca-radius); background: var(--minca-danger-soft); }\n\nminca-auth .wa-form { display: flex; flex-direction: column; gap: 8px; }\nminca-auth .wa-form + .wa-form { margin-top: 10px; }\nminca-auth input {\n width: 100%; height: 40px; padding: 0 12px;\n border-radius: var(--minca-radius); border: 1px solid var(--minca-line-strong);\n background: var(--minca-surface); color: var(--minca-ink);\n font: inherit; font-size: 14px; outline: none;\n transition: border-color .15s ease, box-shadow .15s ease;\n}\nminca-auth input::placeholder { color: var(--minca-faint); }\nminca-auth input:focus { border-color: var(--minca-muted); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }\nminca-auth .wa-offscreen {\n position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;\n overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;\n}\n\nminca-auth button { font: inherit; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }\nminca-auth button:not(:disabled) { cursor: pointer; }\nminca-auth button:disabled { opacity: .5; cursor: not-allowed; }\nminca-auth :focus-visible { outline: 2px solid var(--minca-ink); outline-offset: 2px; }\nminca-auth button:focus:not(:focus-visible) { outline: none; }\n\nminca-auth .wa-button {\n width: 100%; height: 40px; padding: 0 16px;\n border-radius: var(--minca-radius); border: 1px solid transparent;\n background: var(--minca-accent); color: var(--minca-on-accent);\n font-size: 14px; font-weight: 500;\n}\nminca-auth .wa-button:not(:disabled):hover { background: var(--minca-accent-hover); }\nminca-auth .wa-link {\n background: none; border: none; padding: 4px 0; margin-right: 12px;\n color: var(--minca-muted); font-size: 13px; font-weight: 500; text-align: left;\n}\nminca-auth .wa-link:not(:disabled):hover { color: var(--minca-ink); }\nminca-auth .wa-links { display: flex; flex-wrap: wrap; margin-top: 10px; }\n\nminca-auth .wa-options { display: flex; flex-direction: column; gap: 12px; }\nminca-auth .wa-option {\n display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 16px;\n text-align: left; border-radius: var(--minca-radius);\n border: 1px solid var(--minca-line); background: var(--minca-surface); color: var(--minca-body);\n}\nminca-auth .wa-option:not(:disabled):hover { background: var(--minca-sunken); border-color: var(--minca-line-strong); }\nminca-auth .wa-option-title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--minca-ink); }\nminca-auth .wa-option-text { color: var(--minca-muted); font-size: 13px; line-height: 1.5; }\nminca-auth .wa-badge {\n font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px;\n background: var(--minca-sunken); border: 1px solid var(--minca-line); color: var(--minca-muted);\n}\n\nminca-auth .wa-accounts { display: flex; flex-direction: column; gap: 8px; }\nminca-auth .wa-account { border: 1px solid var(--minca-line); border-radius: var(--minca-radius); background: var(--minca-surface); }\nminca-auth .wa-account-open { padding: 20px; border-color: var(--minca-line-strong); }\nminca-auth .wa-account-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }\nminca-auth .wa-account-head .wa-account-name { font-size: 17px; }\nminca-auth .wa-account-row {\n display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px;\n text-align: left; color: var(--minca-body);\n}\nminca-auth .wa-account-row:not(:disabled):hover { background: var(--minca-sunken); }\nminca-auth .wa-account-name { display: block; font-weight: 600; color: var(--minca-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\nminca-auth .wa-chevron { color: var(--minca-faint); font-size: 18px; }\nminca-auth .wa-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--minca-faint); font-size: 12px; }\nminca-auth .wa-or::before, minca-auth .wa-or::after { content: ''; flex: 1; height: 1px; background: var(--minca-line); }\nminca-auth .wa-secondary.wa-wide { flex: none; width: 100%; height: 40px; }\nminca-auth .wa-small .wa-link { padding: 0; margin: 0 8px 0 0; font-size: 13px; }\nminca-auth .wa-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--minca-line); }\nminca-auth .wa-footer .wa-links { margin-top: 0; }\nminca-auth .wa-avatar { flex-shrink: 0; display: block; border-radius: 8px; }\nminca-auth .wa-avatar-round { border-radius: 50% !important; }\n\nminca-auth .wa-code {\n display: block; margin-top: 16px; padding: 12px; border-radius: var(--minca-radius);\n background: var(--minca-sunken); border: 1px solid var(--minca-line);\n font-family: var(--minca-mono); font-size: 13px; color: var(--minca-ink);\n word-break: break-all; user-select: all;\n}\n\nminca-auth .wa-code-large { font-size: 17px; letter-spacing: 0.04em; text-align: center; padding: 16px 12px; margin-top: 0; }\nminca-auth .wa-row { display: flex; gap: 8px; margin-top: 10px; }\nminca-auth .wa-secondary {\n flex: 1; height: 36px; padding: 0 12px;\n border-radius: var(--minca-radius); border: 1px solid var(--minca-line-strong);\n background: var(--minca-surface); color: var(--minca-ink); font-size: 13px; font-weight: 500;\n}\nminca-auth .wa-secondary:not(:disabled):hover { background: var(--minca-sunken); }\nminca-auth .wa-check { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 16px; font-size: 14px; line-height: 1.5; color: var(--minca-body); cursor: pointer; }\nminca-auth .wa-check input { width: 16px; height: 16px; margin: 3px 0 0; padding: 0; flex-shrink: 0; accent-color: var(--minca-accent); box-shadow: none; }\nminca-auth .wa-label { font-size: 13px; color: var(--minca-muted); }\nminca-auth .wa-steps { margin: 0 0 20px; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--minca-body); }\n\nminca-auth .wa-info { position: relative; display: inline; }\nminca-auth .wa-info-button {\n display: inline-flex; align-items: center; justify-content: center;\n width: 16px; height: 16px; padding: 0; margin-left: 6px; vertical-align: text-bottom;\n border-radius: 999px; border: 1px solid var(--minca-line-strong); background: none;\n color: var(--minca-faint); font-size: 10px; font-weight: 700; line-height: 1;\n}\nminca-auth .wa-popover {\n position: absolute; z-index: 30; top: 22px; left: 0; width: min(260px, 80cqi);\n padding: 12px 14px; border-radius: var(--minca-radius);\n background: var(--minca-surface); border: 1px solid var(--minca-line);\n box-shadow: 0 12px 28px -12px rgba(15, 17, 21, .22);\n font-size: 12.5px; line-height: 1.6; color: var(--minca-muted); font-weight: 400;\n}\nminca-auth .wa-popover[hidden] { display: none; }\n\n@container (max-width: 340px) {\n minca-auth .wa-title { font-size: 24px; }\n minca-auth .wa-subtitle { margin-bottom: 24px; }\n minca-auth .wa-wordmark { margin-bottom: 28px; }\n minca-auth .wa-popover { left: auto; right: -8px; }\n}\n";
|
|
17
|
+
export declare const AUTH_CSS = "\nminca-auth {\n --minca-ink: #000;\n --minca-body: #171717;\n --minca-muted: #666;\n --minca-faint: #8f8f8f;\n --minca-surface: #fff;\n --minca-sunken: #fafafa;\n --minca-line: #eaeaea;\n --minca-line-strong: #d4d4d4;\n --minca-accent: #000;\n --minca-accent-hover: #383838;\n --minca-on-accent: #fff;\n --minca-danger: #e5484d;\n --minca-danger-soft: #fff0f0;\n --minca-warn: #9a5a0b;\n --minca-good: #2f7a52;\n --minca-radius: 6px;\n --minca-font: \"Geist\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif;\n --minca-mono: \"Geist Mono\", ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace;\n\n display: block;\n container-type: inline-size;\n color: var(--minca-body);\n font-family: var(--minca-font);\n font-size: 14px;\n letter-spacing: -0.006em;\n -webkit-font-smoothing: antialiased;\n}\nminca-auth[hidden] { display: none; }\nminca-auth *, minca-auth *::before, minca-auth *::after { box-sizing: border-box; }\nminca-auth :is(h1, p) { margin: 0; }\n\nminca-auth .wa-card { width: 100%; max-width: 380px; margin: 0 auto; }\nminca-auth .wa-wordmark { display: flex; align-items: center; gap: 8px; margin-bottom: 40px; color: var(--minca-ink); font-weight: 600; font-size: 16px; letter-spacing: -0.03em; }\nminca-auth .wa-title { font-size: 28px; font-weight: 600; letter-spacing: -0.04em; color: var(--minca-ink); margin-bottom: 8px; line-height: 1.2; }\nminca-auth .wa-subtitle { font-size: 15px; color: var(--minca-muted); margin-bottom: 32px; line-height: 1.5; }\nminca-auth .wa-hint { font-size: 14px; color: var(--minca-muted); margin-bottom: 20px; line-height: 1.6; }\nminca-auth .wa-small { font-size: 13px; color: var(--minca-muted); margin-top: 8px; line-height: 1.6; }\nminca-auth .wa-meter { display: flex; gap: 4px; margin-top: 2px; }\nminca-auth .wa-meter > span { flex: 1; height: 4px; border-radius: 2px; background: var(--minca-line); transition: background-color .15s ease; }\nminca-auth .wa-meter[data-strength=\"weak\"] > span:first-child { background: var(--minca-danger); }\nminca-auth .wa-meter[data-strength=\"fair\"] > span:not(:last-child) { background: var(--minca-warn); }\nminca-auth .wa-meter[data-strength=\"strong\"] > span { background: var(--minca-good); }\nminca-auth .wa-small[data-strength] { margin-top: 0; }\nminca-auth .wa-small[data-strength=\"weak\"] { color: var(--minca-danger); }\nminca-auth .wa-error { color: var(--minca-danger); font-size: 14px; font-weight: 500; }\nminca-auth .wa-error-box { margin-top: 16px; padding: 12px 14px; border-radius: var(--minca-radius); background: var(--minca-danger-soft); }\n\nminca-auth .wa-form { display: flex; flex-direction: column; gap: 8px; }\nminca-auth .wa-form + .wa-form { margin-top: 10px; }\nminca-auth input {\n width: 100%; height: 40px; padding: 0 12px;\n border-radius: var(--minca-radius); border: 1px solid var(--minca-line-strong);\n background: var(--minca-surface); color: var(--minca-ink);\n font: inherit; font-size: 14px; outline: none;\n transition: border-color .15s ease, box-shadow .15s ease;\n}\nminca-auth input::placeholder { color: var(--minca-faint); }\nminca-auth .wa-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--minca-ink); margin-top: 10px; }\nminca-auth .wa-optional { font-weight: 400; color: var(--minca-faint); }\nminca-auth .wa-under { margin-top: -2px; font-size: 12px; }\nminca-auth .wa-username {\n display: flex; align-items: center; height: 40px;\n border-radius: var(--minca-radius); border: 1px solid var(--minca-line-strong); background: var(--minca-surface);\n transition: border-color .15s ease, box-shadow .15s ease;\n}\nminca-auth .wa-username:focus-within { border-color: var(--minca-muted); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }\nminca-auth .wa-username input, minca-auth .wa-username input:focus { flex: 1; min-width: 0; height: 100%; border: none; box-shadow: none; background: transparent; }\nminca-auth .wa-username > span { padding-right: 12px; color: var(--minca-muted); white-space: nowrap; }\nminca-auth .wa-domain { all: unset; padding: 0 12px 0 0; color: var(--minca-muted); white-space: nowrap; cursor: pointer; }\nminca-auth .wa-domain:hover, minca-auth .wa-domain:focus-visible { color: var(--minca-ink); text-decoration: underline; text-underline-offset: 3px; }\nminca-auth .wa-domain[hidden] { display: none; }\nminca-auth .wa-under a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }\nminca-auth .wa-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0 10px 0 -4px; padding: 0 !important; border-radius: 50%; font-size: 11px; font-weight: 700; }\nminca-auth .wa-mark:empty { display: none; }\nminca-auth .wa-mark[data-name=\"free\"] { background: var(--minca-good); color: #fff !important; }\nminca-auth .wa-mark[data-name=\"taken\"] { background: var(--minca-danger); color: #fff !important; }\nminca-auth .wa-small[data-name=\"taken\"] { color: var(--minca-danger); }\nminca-auth .wa-small[data-name=\"free\"]:not(.wa-under) { color: var(--minca-good); }\nminca-auth input:focus { border-color: var(--minca-muted); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }\nminca-auth .wa-offscreen {\n position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;\n overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;\n}\n\nminca-auth button { font: inherit; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }\nminca-auth button:not(:disabled) { cursor: pointer; }\nminca-auth button:disabled { opacity: .5; cursor: not-allowed; }\nminca-auth :focus-visible { outline: 2px solid var(--minca-ink); outline-offset: 2px; }\nminca-auth button:focus:not(:focus-visible) { outline: none; }\n\nminca-auth .wa-button {\n width: 100%; height: 40px; padding: 0 16px;\n border-radius: var(--minca-radius); border: 1px solid transparent;\n background: var(--minca-accent); color: var(--minca-on-accent);\n font-size: 14px; font-weight: 500;\n}\nminca-auth .wa-button:not(:disabled):hover { background: var(--minca-accent-hover); }\nminca-auth .wa-link {\n background: none; border: none; padding: 4px 0; margin-right: 12px;\n color: var(--minca-muted); font-size: 13px; font-weight: 500; text-align: left;\n}\nminca-auth .wa-link:not(:disabled):hover { color: var(--minca-ink); }\nminca-auth .wa-links { display: flex; flex-wrap: wrap; margin-top: 10px; }\n\nminca-auth .wa-options { display: flex; flex-direction: column; gap: 12px; }\nminca-auth .wa-option {\n display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 16px;\n text-align: left; border-radius: var(--minca-radius);\n border: 1px solid var(--minca-line); background: var(--minca-surface); color: var(--minca-body);\n}\nminca-auth .wa-option:not(:disabled):hover { background: var(--minca-sunken); border-color: var(--minca-line-strong); }\nminca-auth .wa-option-title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--minca-ink); }\nminca-auth .wa-option-text { color: var(--minca-muted); font-size: 13px; line-height: 1.5; }\nminca-auth .wa-badge {\n font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px;\n background: var(--minca-sunken); border: 1px solid var(--minca-line); color: var(--minca-muted);\n}\n\nminca-auth .wa-accounts { display: flex; flex-direction: column; gap: 8px; }\nminca-auth .wa-account { border: 1px solid var(--minca-line); border-radius: var(--minca-radius); background: var(--minca-surface); }\nminca-auth .wa-account-open { padding: 20px; border-color: var(--minca-line-strong); }\nminca-auth .wa-account-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 20px; }\nminca-auth .wa-account-head .wa-account-name { font-size: 17px; }\nminca-auth .wa-account-row {\n display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px;\n text-align: left; color: var(--minca-body);\n}\nminca-auth .wa-account-row:not(:disabled):hover { background: var(--minca-sunken); }\nminca-auth .wa-account-name { display: block; font-weight: 600; color: var(--minca-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\nminca-auth .wa-chevron { color: var(--minca-faint); font-size: 18px; }\nminca-auth .wa-small .wa-link { padding: 0; margin: 0 8px 0 0; font-size: 13px; }\nminca-auth .wa-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--minca-line); }\nminca-auth .wa-footer .wa-links { margin-top: 0; }\nminca-auth .wa-avatar { flex-shrink: 0; display: block; border-radius: 8px; }\nminca-auth .wa-avatar-round { border-radius: 50% !important; }\n\nminca-auth .wa-code {\n display: block; margin-top: 16px; padding: 12px; border-radius: var(--minca-radius);\n background: var(--minca-sunken); border: 1px solid var(--minca-line);\n font-family: var(--minca-mono); font-size: 13px; color: var(--minca-ink);\n word-break: break-all; user-select: all;\n}\n\nminca-auth .wa-code-large { font-size: 17px; letter-spacing: 0.04em; text-align: center; padding: 16px 12px; margin-top: 0; }\nminca-auth .wa-row { display: flex; gap: 8px; margin-top: 10px; }\nminca-auth .wa-secondary {\n flex: 1; height: 36px; padding: 0 12px;\n border-radius: var(--minca-radius); border: 1px solid var(--minca-line-strong);\n background: var(--minca-surface); color: var(--minca-ink); font-size: 13px; font-weight: 500;\n}\nminca-auth .wa-secondary:not(:disabled):hover { background: var(--minca-sunken); }\nminca-auth .wa-check { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 16px; font-size: 14px; line-height: 1.5; color: var(--minca-body); cursor: pointer; }\nminca-auth .wa-check input { width: 16px; height: 16px; margin: 3px 0 0; padding: 0; flex-shrink: 0; accent-color: var(--minca-accent); box-shadow: none; }\nminca-auth .wa-steps { margin: 0 0 20px; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--minca-body); }\n\nminca-auth .wa-info { position: relative; display: inline; }\nminca-auth .wa-info-button {\n display: inline-flex; align-items: center; justify-content: center;\n width: 16px; height: 16px; padding: 0; margin-left: 6px; vertical-align: text-bottom;\n border-radius: 999px; border: 1px solid var(--minca-line-strong); background: none;\n color: var(--minca-faint); font-size: 10px; font-weight: 700; line-height: 1;\n}\nminca-auth .wa-popover {\n position: absolute; z-index: 30; top: 22px; left: 0; width: min(260px, 80cqi);\n padding: 12px 14px; border-radius: var(--minca-radius);\n background: var(--minca-surface); border: 1px solid var(--minca-line);\n box-shadow: 0 12px 28px -12px rgba(15, 17, 21, .22);\n font-size: 12.5px; line-height: 1.6; color: var(--minca-muted); font-weight: 400;\n}\nminca-auth .wa-popover[hidden] { display: none; }\n\n@container (max-width: 340px) {\n minca-auth .wa-title { font-size: 24px; }\n minca-auth .wa-subtitle { margin-bottom: 24px; }\n minca-auth .wa-wordmark { margin-bottom: 28px; }\n minca-auth .wa-popover { left: auto; right: -8px; }\n}\n";
|
|
18
18
|
//# sourceMappingURL=auth-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-styles.d.ts","sourceRoot":"","sources":["../../src/elements/auth-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"auth-styles.d.ts","sourceRoot":"","sources":["../../src/elements/auth-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,q5VAmLpB,CAAC"}
|
|
@@ -73,6 +73,27 @@ minca-auth input {
|
|
|
73
73
|
transition: border-color .15s ease, box-shadow .15s ease;
|
|
74
74
|
}
|
|
75
75
|
minca-auth input::placeholder { color: var(--minca-faint); }
|
|
76
|
+
minca-auth .wa-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--minca-ink); margin-top: 10px; }
|
|
77
|
+
minca-auth .wa-optional { font-weight: 400; color: var(--minca-faint); }
|
|
78
|
+
minca-auth .wa-under { margin-top: -2px; font-size: 12px; }
|
|
79
|
+
minca-auth .wa-username {
|
|
80
|
+
display: flex; align-items: center; height: 40px;
|
|
81
|
+
border-radius: var(--minca-radius); border: 1px solid var(--minca-line-strong); background: var(--minca-surface);
|
|
82
|
+
transition: border-color .15s ease, box-shadow .15s ease;
|
|
83
|
+
}
|
|
84
|
+
minca-auth .wa-username:focus-within { border-color: var(--minca-muted); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
|
|
85
|
+
minca-auth .wa-username input, minca-auth .wa-username input:focus { flex: 1; min-width: 0; height: 100%; border: none; box-shadow: none; background: transparent; }
|
|
86
|
+
minca-auth .wa-username > span { padding-right: 12px; color: var(--minca-muted); white-space: nowrap; }
|
|
87
|
+
minca-auth .wa-domain { all: unset; padding: 0 12px 0 0; color: var(--minca-muted); white-space: nowrap; cursor: pointer; }
|
|
88
|
+
minca-auth .wa-domain:hover, minca-auth .wa-domain:focus-visible { color: var(--minca-ink); text-decoration: underline; text-underline-offset: 3px; }
|
|
89
|
+
minca-auth .wa-domain[hidden] { display: none; }
|
|
90
|
+
minca-auth .wa-under a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
|
|
91
|
+
minca-auth .wa-mark { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin: 0 10px 0 -4px; padding: 0 !important; border-radius: 50%; font-size: 11px; font-weight: 700; }
|
|
92
|
+
minca-auth .wa-mark:empty { display: none; }
|
|
93
|
+
minca-auth .wa-mark[data-name="free"] { background: var(--minca-good); color: #fff !important; }
|
|
94
|
+
minca-auth .wa-mark[data-name="taken"] { background: var(--minca-danger); color: #fff !important; }
|
|
95
|
+
minca-auth .wa-small[data-name="taken"] { color: var(--minca-danger); }
|
|
96
|
+
minca-auth .wa-small[data-name="free"]:not(.wa-under) { color: var(--minca-good); }
|
|
76
97
|
minca-auth input:focus { border-color: var(--minca-muted); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }
|
|
77
98
|
minca-auth .wa-offscreen {
|
|
78
99
|
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
|
@@ -125,9 +146,6 @@ minca-auth .wa-account-row {
|
|
|
125
146
|
minca-auth .wa-account-row:not(:disabled):hover { background: var(--minca-sunken); }
|
|
126
147
|
minca-auth .wa-account-name { display: block; font-weight: 600; color: var(--minca-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
127
148
|
minca-auth .wa-chevron { color: var(--minca-faint); font-size: 18px; }
|
|
128
|
-
minca-auth .wa-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--minca-faint); font-size: 12px; }
|
|
129
|
-
minca-auth .wa-or::before, minca-auth .wa-or::after { content: ''; flex: 1; height: 1px; background: var(--minca-line); }
|
|
130
|
-
minca-auth .wa-secondary.wa-wide { flex: none; width: 100%; height: 40px; }
|
|
131
149
|
minca-auth .wa-small .wa-link { padding: 0; margin: 0 8px 0 0; font-size: 13px; }
|
|
132
150
|
minca-auth .wa-footer { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--minca-line); }
|
|
133
151
|
minca-auth .wa-footer .wa-links { margin-top: 0; }
|
|
@@ -151,7 +169,6 @@ minca-auth .wa-secondary {
|
|
|
151
169
|
minca-auth .wa-secondary:not(:disabled):hover { background: var(--minca-sunken); }
|
|
152
170
|
minca-auth .wa-check { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 16px; font-size: 14px; line-height: 1.5; color: var(--minca-body); cursor: pointer; }
|
|
153
171
|
minca-auth .wa-check input { width: 16px; height: 16px; margin: 3px 0 0; padding: 0; flex-shrink: 0; accent-color: var(--minca-accent); box-shadow: none; }
|
|
154
|
-
minca-auth .wa-label { font-size: 13px; color: var(--minca-muted); }
|
|
155
172
|
minca-auth .wa-steps { margin: 0 0 20px; padding-left: 20px; font-size: 14px; line-height: 1.6; color: var(--minca-body); }
|
|
156
173
|
|
|
157
174
|
minca-auth .wa-info { position: relative; display: inline; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-styles.js","sourceRoot":"","sources":["../../src/elements/auth-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG
|
|
1
|
+
{"version":3,"file":"auth-styles.js","sourceRoot":"","sources":["../../src/elements/auth-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmLvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minca-auth.d.ts","sourceRoot":"","sources":["../../src/elements/minca-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"minca-auth.d.ts","sourceRoot":"","sources":["../../src/elements/minca-auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAKL,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAS5B,mCAAmC;AACnC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;CACvC;AAUD,QAAA,MAAM,IAAI;;;CAAqC,CAAC;AAoNhD,qBAAa,gBAAiB,SAAQ,IAAI;;IAwBxC,6HAA6H;IAC7H,IAAI,IAAI,IAAI,SAAS,CAMpB;IAUD,IAAI,IAAI,CAAC,IAAI,EAAE,SAAS,EAIvB;IAED;;;;OAIG;IACH,IAAI,MAAM,IAAI,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,IAAI,CAE5E;IAED,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,IAAI,EAG/E;IAYD,iBAAiB,IAAI,IAAI,CAWxB;IAED,oBAAoB,IAAI,IAAI,CAG3B;CA83BF;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,GAAG,SAAe,GAAG,IAAI,CAGxD;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,gBAAgB,CAAC;KAChC;IACD,UAAU,mBAAmB;QAC3B,eAAe,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;KACvD;CACF"}
|
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
import { createMincaAuth, } from '../session/auth.js';
|
|
21
21
|
import { accountCredentialName, offerToSave, recoveryKit } from '../session/credentials.js';
|
|
22
22
|
import { passwordStrength } from '../session/password-strength.js';
|
|
23
|
+
import { adHocName, formatUsername, nameFromUsername, parseUsername, usernameFree } from '../inbox/names.js';
|
|
23
24
|
import { adoptStyles, h, svg } from './dom.js';
|
|
24
25
|
import { AUTH_CSS } from './auth-styles.js';
|
|
26
|
+
/** How to give out Minca usernames at a domain of your own */
|
|
27
|
+
const OWN_DOMAIN_HELP = 'https://github.com/leifriksheim/minca/blob/main/packages/core/docs/usernames.md#running-one-for-your-domain';
|
|
25
28
|
// Where there is no DOM the module still loads; the element is only ever made where there is one.
|
|
26
29
|
const Base = globalThis.HTMLElement ?? class {
|
|
27
30
|
};
|
|
@@ -97,6 +100,22 @@ function card(title, ...body) {
|
|
|
97
100
|
function subtitle(...text) {
|
|
98
101
|
return h('p', { class: 'wa-subtitle' }, ...text);
|
|
99
102
|
}
|
|
103
|
+
/** How the username asked for at sign-up is going, above the setup screens that follow; at `domain`, by its name alone */
|
|
104
|
+
function claimLine({ username: claim }, domain) {
|
|
105
|
+
if (!claim)
|
|
106
|
+
return null;
|
|
107
|
+
const states = { claiming: 'checking', claimed: 'free', failed: 'taken' };
|
|
108
|
+
const shown = domain && claim.username.endsWith(`@${domain}`)
|
|
109
|
+
? claim.username.slice(0, -domain.length - 1)
|
|
110
|
+
: claim.username;
|
|
111
|
+
// The service's own words, without who refused what: the line says that already.
|
|
112
|
+
const why = (claim.error ?? 'the name service said no').replace(/^.* refused \S+: /, '');
|
|
113
|
+
return h('p', { class: 'wa-small', 'data-name': states[claim.status], 'aria-live': 'polite', style: 'margin:0 0 12px' }, claim.status === 'claiming'
|
|
114
|
+
? `Getting ${shown} for you…`
|
|
115
|
+
: claim.status === 'claimed'
|
|
116
|
+
? `${shown} is your username.`
|
|
117
|
+
: `${shown} couldn't be yours: ${why}. Pick another in any app, under Contacts.`);
|
|
118
|
+
}
|
|
100
119
|
/** A form that stays on the page when submitted */
|
|
101
120
|
function form(onSubmit, props, ...children) {
|
|
102
121
|
return h('form', {
|
|
@@ -108,6 +127,10 @@ function form(onSubmit, props, ...children) {
|
|
|
108
127
|
},
|
|
109
128
|
}, ...children);
|
|
110
129
|
}
|
|
130
|
+
/** The step's one main button */
|
|
131
|
+
function button(label, onclick, disabled, key) {
|
|
132
|
+
return h('button', { type: 'button', class: 'wa-button', 'data-key': key, disabled, onclick }, label);
|
|
133
|
+
}
|
|
111
134
|
function submit(busy, label, busyLabel) {
|
|
112
135
|
return h('button', { type: 'submit', class: 'wa-button', disabled: busy }, busy ? busyLabel : label);
|
|
113
136
|
}
|
|
@@ -136,6 +159,10 @@ function download({ filename, text }) {
|
|
|
136
159
|
anchor.remove();
|
|
137
160
|
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
138
161
|
}
|
|
162
|
+
/** How a pairing is going, in a line: red once it failed */
|
|
163
|
+
function pairingLine(stage, quiet, style) {
|
|
164
|
+
return h('p', { class: stage.kind === 'failed' ? 'wa-error' : quiet, style }, describePairing(stage));
|
|
165
|
+
}
|
|
139
166
|
function describePairing(stage) {
|
|
140
167
|
switch (stage.kind) {
|
|
141
168
|
case 'waiting':
|
|
@@ -167,25 +194,31 @@ export class MincaAuthElement extends Base {
|
|
|
167
194
|
#choosingPassword = false;
|
|
168
195
|
#showPairHelp = false;
|
|
169
196
|
#mismatch = false;
|
|
197
|
+
/** With a passkey too, whether the password was asked for rather than the passkey */
|
|
198
|
+
#withPassword = false;
|
|
170
199
|
#lastSelected = null;
|
|
171
200
|
#lastStage = null;
|
|
201
|
+
/** The username on the create screen, and whether it is free */
|
|
202
|
+
#username = {
|
|
203
|
+
checked: '',
|
|
204
|
+
state: 'empty',
|
|
205
|
+
};
|
|
206
|
+
#usernameTimer;
|
|
172
207
|
/** The flow this element draws. Set it to share one with the rest of the page; otherwise one is made from the attributes. */
|
|
173
208
|
get auth() {
|
|
174
209
|
this.#auth ??= createMincaAuth({
|
|
175
210
|
...(this.getAttribute('app-name') ? { appName: this.getAttribute('app-name') } : {}),
|
|
176
|
-
network: {
|
|
177
|
-
relays: (this.getAttribute('relays') ?? '')
|
|
178
|
-
.split(',')
|
|
179
|
-
.map((url) => url.trim())
|
|
180
|
-
.filter(Boolean),
|
|
181
|
-
nodes: (this.getAttribute('nodes') ?? '')
|
|
182
|
-
.split(',')
|
|
183
|
-
.map((url) => url.trim())
|
|
184
|
-
.filter(Boolean),
|
|
185
|
-
},
|
|
211
|
+
network: { relays: this.#urls('relays'), nodes: this.#urls('nodes') },
|
|
186
212
|
});
|
|
187
213
|
return this.#auth;
|
|
188
214
|
}
|
|
215
|
+
/** A comma-separated attribute's addresses */
|
|
216
|
+
#urls(name) {
|
|
217
|
+
return (this.getAttribute(name) ?? '')
|
|
218
|
+
.split(',')
|
|
219
|
+
.map((url) => url.trim())
|
|
220
|
+
.filter(Boolean);
|
|
221
|
+
}
|
|
189
222
|
set auth(auth) {
|
|
190
223
|
if (auth === this.#auth)
|
|
191
224
|
return;
|
|
@@ -259,12 +292,15 @@ export class MincaAuthElement extends Base {
|
|
|
259
292
|
}
|
|
260
293
|
#reset() {
|
|
261
294
|
this.#drafts.clear();
|
|
295
|
+
clearTimeout(this.#usernameTimer);
|
|
296
|
+
this.#username = { checked: '', state: 'empty' };
|
|
262
297
|
this.#filledAs = '';
|
|
263
298
|
this.#copied = false;
|
|
264
299
|
this.#stored = false;
|
|
265
300
|
this.#choosingPassword = false;
|
|
266
301
|
this.#showPairHelp = false;
|
|
267
302
|
this.#mismatch = false;
|
|
303
|
+
this.#withPassword = false;
|
|
268
304
|
}
|
|
269
305
|
#redraw() {
|
|
270
306
|
this.#render(this.auth.getState());
|
|
@@ -389,7 +425,7 @@ export class MincaAuthElement extends Base {
|
|
|
389
425
|
].filter((node) => node !== null);
|
|
390
426
|
}
|
|
391
427
|
/** The everyday password, filed under the account's name so a manager fills the right one. */
|
|
392
|
-
#passwordForm(state, account
|
|
428
|
+
#passwordForm(state, account) {
|
|
393
429
|
const password = this.#input('password', {
|
|
394
430
|
type: 'password',
|
|
395
431
|
name: 'password',
|
|
@@ -401,9 +437,7 @@ export class MincaAuthElement extends Base {
|
|
|
401
437
|
return form(() => {
|
|
402
438
|
if (password.value)
|
|
403
439
|
void this.auth.signInWithPassword(password.value);
|
|
404
|
-
}, {}, offscreenUsername(accountCredentialName(account.name), true), password,
|
|
405
|
-
? h('button', { type: 'submit', class: 'wa-secondary wa-wide', disabled: state.busy }, 'Sign in with password')
|
|
406
|
-
: submit(state.busy, 'Sign in', 'Signing in…'));
|
|
440
|
+
}, {}, offscreenUsername(accountCredentialName(account.name), true), password, submit(state.busy, 'Sign in', 'Signing in…'));
|
|
407
441
|
}
|
|
408
442
|
#signIn(state) {
|
|
409
443
|
const auth = this.auth;
|
|
@@ -422,19 +456,20 @@ export class MincaAuthElement extends Base {
|
|
|
422
456
|
: 'The recovery code opens the account anywhere, with nothing stored. Next you set up a passkey or password so it stops asking.')),
|
|
423
457
|
...this.#codeForm(state, selected),
|
|
424
458
|
];
|
|
459
|
+
// One way in at a time: the passkey, with the password a tap away when there is one too.
|
|
460
|
+
const byPassword = open.hasPassword && (!hasPasskey || this.#withPassword);
|
|
461
|
+
const toggle = (to) => () => {
|
|
462
|
+
this.#withPassword = to;
|
|
463
|
+
this.#redraw();
|
|
464
|
+
};
|
|
425
465
|
return [
|
|
426
|
-
|
|
427
|
-
?
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
disabled: state.busy,
|
|
432
|
-
onclick: () => void auth.signInWithPasskey(),
|
|
433
|
-
}, state.busy ? 'Waiting…' : 'Sign in with passkey')
|
|
466
|
+
byPassword
|
|
467
|
+
? this.#passwordForm(state, account)
|
|
468
|
+
: button(state.busy ? 'Waiting…' : 'Sign in with passkey', () => void auth.signInWithPasskey(), state.busy, 'passkey'),
|
|
469
|
+
hasPasskey && open.hasPassword
|
|
470
|
+
? h('p', { class: 'wa-small', style: 'margin-top:12px' }, link(byPassword ? 'Use your passkey instead' : 'Use your password instead', toggle(!byPassword), state.busy))
|
|
434
471
|
: null,
|
|
435
|
-
hasPasskey && open.hasPassword ?
|
|
436
|
-
open.hasPassword ? this.#passwordForm(state, account, hasPasskey) : null,
|
|
437
|
-
h('p', { class: 'wa-small', style: 'margin-top:12px' }, 'Forgot it? ', link('Use your recovery code', () => auth.showRestore(), state.busy)),
|
|
472
|
+
h('p', { class: 'wa-small', style: hasPasskey && open.hasPassword ? 'margin-top:4px' : 'margin-top:12px' }, open.hasPassword ? 'Forgot it? ' : null, link(open.hasPassword ? 'Use your recovery code' : 'Use your recovery code instead', () => auth.showRestore(), state.busy)),
|
|
438
473
|
];
|
|
439
474
|
};
|
|
440
475
|
// The one being signed in to first, then the rest to switch to.
|
|
@@ -442,7 +477,7 @@ export class MincaAuthElement extends Base {
|
|
|
442
477
|
const rows = ordered.map((account) => {
|
|
443
478
|
const isOpen = account.id === state.selectedId && entry !== null;
|
|
444
479
|
if (isOpen)
|
|
445
|
-
return h('div', { class: 'wa-account wa-account-open' }, h('div', { class: 'wa-account-head' }, this.#drawAvatar(account.did, 48), h('span', { class: 'wa-account-name' }, account.name)), ...waysIn(account, entry));
|
|
480
|
+
return h('div', { class: 'wa-account wa-account-open' }, h('div', { class: 'wa-account-head' }, this.#drawAvatar(account.did, 48, true), h('span', { class: 'wa-account-name' }, account.name)), ...waysIn(account, entry));
|
|
446
481
|
return h('button', {
|
|
447
482
|
type: 'button',
|
|
448
483
|
class: 'wa-account wa-account-row',
|
|
@@ -451,8 +486,10 @@ export class MincaAuthElement extends Base {
|
|
|
451
486
|
}, this.#drawAvatar(account.did, 32, true), h('span', { class: 'wa-account-name', style: 'flex:1;min-width:0' }, account.name), h('span', { class: 'wa-chevron', 'aria-hidden': 'true' }, '›'));
|
|
452
487
|
});
|
|
453
488
|
const one = accounts.length === 1 ? accounts[0] : undefined;
|
|
454
|
-
return card('Welcome back',
|
|
455
|
-
|
|
489
|
+
return card('Welcome back',
|
|
490
|
+
// With one account its name is under its face already, so the line above it doesn't say it again.
|
|
491
|
+
subtitle(one
|
|
492
|
+
? 'Sign in to continue.'
|
|
456
493
|
: accounts.length > 0
|
|
457
494
|
? 'Choose your account.'
|
|
458
495
|
: 'There are no accounts here yet.'), h('div', { class: 'wa-accounts' }, ...rows), errorBox(state.error), h('div', { class: 'wa-footer' }, links(link('Another account', () => auth.showExisting(), state.busy), link('Create a new account', () => auth.startCreating(), state.busy)), place
|
|
@@ -476,17 +513,89 @@ export class MincaAuthElement extends Base {
|
|
|
476
513
|
// ─── Making an account ─────────────────────────────────────────────
|
|
477
514
|
#create(state) {
|
|
478
515
|
const auth = this.auth;
|
|
479
|
-
const
|
|
516
|
+
const domain = auth.usernames;
|
|
517
|
+
if (!domain) {
|
|
518
|
+
const name = this.#input('name', {
|
|
519
|
+
type: 'text',
|
|
520
|
+
placeholder: 'Your name',
|
|
521
|
+
autocomplete: 'off',
|
|
522
|
+
autofocus: true,
|
|
523
|
+
disabled: state.busy,
|
|
524
|
+
'aria-label': 'Your name',
|
|
525
|
+
});
|
|
526
|
+
return card('Create your account', subtitle('What should apps call you? You can change it later.'), form(() => {
|
|
527
|
+
if (name.value.trim())
|
|
528
|
+
void auth.createAccount(name.value.trim());
|
|
529
|
+
}, {}, name, submit(state.busy, 'Continue', 'Creating…')), errorBox(state.error), links(link('I already have an account', () => auth.showExisting(), state.busy)), this.#podLine(state));
|
|
530
|
+
}
|
|
531
|
+
const busy = state.busy;
|
|
532
|
+
const username = this.#input('username', {
|
|
480
533
|
type: 'text',
|
|
481
|
-
placeholder: '
|
|
534
|
+
placeholder: 'yourname',
|
|
482
535
|
autocomplete: 'off',
|
|
536
|
+
autocapitalize: 'none',
|
|
537
|
+
spellcheck: 'false',
|
|
538
|
+
maxlength: '320',
|
|
483
539
|
autofocus: true,
|
|
484
|
-
disabled:
|
|
540
|
+
disabled: busy,
|
|
541
|
+
'aria-label': 'Username',
|
|
485
542
|
});
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
543
|
+
// The whole username: as typed when it names a domain of its own, else at this home's.
|
|
544
|
+
const typedName = () => username.value.trim().toLowerCase();
|
|
545
|
+
const fullName = (typed) => (typed.includes('@') ? typed : `${typed}@${domain}`);
|
|
546
|
+
const status = h('p', { class: 'wa-small wa-under', 'aria-live': 'polite' });
|
|
547
|
+
// In the field: a tick once it is free, a cross once it is taken.
|
|
548
|
+
const mark = h('span', { class: 'wa-mark', 'aria-hidden': 'true' });
|
|
549
|
+
const show = () => {
|
|
550
|
+
const { state: now } = this.#username;
|
|
551
|
+
const typed = typedName();
|
|
552
|
+
const own = typed.includes('@') ? (parseUsername(typed)?.domain ?? null) : null;
|
|
553
|
+
mark.dataset.name = status.dataset.name = now;
|
|
554
|
+
mark.textContent = now === 'free' ? '✓' : now === 'taken' ? '✕' : '';
|
|
555
|
+
if (now === 'unknown' && own)
|
|
556
|
+
return status.replaceChildren(`${own} doesn't give out Minca usernames yet. `, h('a', { href: OWN_DOMAIN_HELP, target: '_blank', rel: 'noopener' }, 'Set it up'));
|
|
557
|
+
status.textContent =
|
|
558
|
+
now === 'taken'
|
|
559
|
+
? 'Someone has that one. Try another.'
|
|
560
|
+
: now === 'invalid'
|
|
561
|
+
? typed.endsWith('@')
|
|
562
|
+
? 'Your domain, like you@yourname.com.'
|
|
563
|
+
: 'Letters, numbers, dots, dashes and underscores.'
|
|
564
|
+
: now === 'unknown'
|
|
565
|
+
? "Couldn't check it just now. It's tried when you continue."
|
|
566
|
+
: own && now === 'free'
|
|
567
|
+
? `Free at ${own}.`
|
|
568
|
+
: 'How people find you and add you. You can change it later.';
|
|
569
|
+
};
|
|
570
|
+
// Looks the name up a moment after typing stops.
|
|
571
|
+
const check = () => {
|
|
572
|
+
clearTimeout(this.#usernameTimer);
|
|
573
|
+
const typed = typedName();
|
|
574
|
+
const parsed = typed ? parseUsername(fullName(typed)) : null;
|
|
575
|
+
this.#username = { checked: typed, state: !typed ? 'empty' : parsed ? 'checking' : 'invalid' };
|
|
576
|
+
show();
|
|
577
|
+
if (!parsed)
|
|
578
|
+
return;
|
|
579
|
+
this.#usernameTimer = setTimeout(() => {
|
|
580
|
+
void usernameFree(formatUsername(parsed)).then((free) => {
|
|
581
|
+
if (this.#username.checked !== typed)
|
|
582
|
+
return;
|
|
583
|
+
this.#username.state = free === null ? 'unknown' : free ? 'free' : 'taken';
|
|
584
|
+
show();
|
|
585
|
+
});
|
|
586
|
+
}, 300);
|
|
587
|
+
};
|
|
588
|
+
username.addEventListener('input', check);
|
|
589
|
+
show();
|
|
590
|
+
// No username, so nobody finds the account by one: a name to show until it is given its own.
|
|
591
|
+
const skip = () => void auth.createAccount(adHocName());
|
|
592
|
+
return card('Pick a username', subtitle('Free, and yours. No email or phone number needed.'), form(() => {
|
|
593
|
+
const typed = typedName();
|
|
594
|
+
const { state: now } = this.#username;
|
|
595
|
+
if (!typed || now === 'taken' || now === 'invalid' || now === 'checking')
|
|
596
|
+
return;
|
|
597
|
+
void auth.createAccount(nameFromUsername(typed.split('@')[0]), { username: fullName(typed) });
|
|
598
|
+
}, {}, h('div', { class: 'wa-username' }, username, mark), status, submit(busy, 'Continue', 'Creating…')), errorBox(state.error), links(link('Continue without a username', skip, busy), link('I already have an account', () => auth.showExisting(), busy)), this.#podLine(state));
|
|
490
599
|
}
|
|
491
600
|
/**
|
|
492
601
|
* The recovery code, to keep.
|
|
@@ -500,7 +609,7 @@ export class MincaAuthElement extends Base {
|
|
|
500
609
|
const auth = this.auth;
|
|
501
610
|
const code = state.freshCode ?? '';
|
|
502
611
|
const account = state.session?.account;
|
|
503
|
-
return card('Your recovery code', h('p', { class: 'wa-hint' }, 'This code is your account. With it you can restore your account on any device, even if you lose everything else.', info('Why it matters', 'Nobody can reissue it: there is no server that knows your account. Anyone who has it can open your account, so keep it private. ', 'Save it as a secure note in your password manager, or print it and put it away — not as a login for this site, where a new password could replace it.')), h('code', { class: 'wa-code wa-code-large' }, code), h('div', { class: 'wa-row' }, h('button', {
|
|
612
|
+
return card('Your recovery code', claimLine(state, this.auth.usernames), h('p', { class: 'wa-hint' }, 'This code is your account. With it you can restore your account on any device, even if you lose everything else.', info('Why it matters', 'Nobody can reissue it: there is no server that knows your account. Anyone who has it can open your account, so keep it private. ', 'Save it as a secure note in your password manager, or print it and put it away — not as a login for this site, where a new password could replace it.')), h('code', { class: 'wa-code wa-code-large' }, code), h('div', { class: 'wa-row' }, h('button', {
|
|
504
613
|
type: 'button',
|
|
505
614
|
class: 'wa-secondary',
|
|
506
615
|
onclick: () => {
|
|
@@ -524,7 +633,7 @@ export class MincaAuthElement extends Base {
|
|
|
524
633
|
this.#stored = event.target.checked;
|
|
525
634
|
this.#redraw();
|
|
526
635
|
},
|
|
527
|
-
}), h('span', null, "I've stored my recovery code somewhere safe.")),
|
|
636
|
+
}), h('span', null, "I've stored my recovery code somewhere safe.")), button('Continue', () => auth.codeSaved(), !this.#stored));
|
|
528
637
|
}
|
|
529
638
|
/**
|
|
530
639
|
* How this account is opened every day. Not skippable: without one, every
|
|
@@ -586,7 +695,7 @@ export class MincaAuthElement extends Base {
|
|
|
586
695
|
'aria-label': 'Account',
|
|
587
696
|
}), password, meter, strength, confirm, this.#mismatch ? h('p', { class: 'wa-error' }, 'Those two do not match.') : null, submit(state.busy, 'Use this password', 'Saving…'));
|
|
588
697
|
};
|
|
589
|
-
return card('How do you want to sign in?', subtitle('This is what you will use every day.', info('Where it works', 'A passkey signs you in on this site, in this browser. A password works wherever your account is kept — this browser, or your pod in any app pointed at it. On a new device, add it from this one or use your recovery code.')), h('div', { class: 'wa-options' }, passkeys
|
|
698
|
+
return card('How do you want to sign in?', claimLine(state, this.auth.usernames), subtitle('This is what you will use every day.', info('Where it works', 'A passkey signs you in on this site, in this browser. A password works wherever your account is kept — this browser, or your pod in any app pointed at it. On a new device, add it from this one or use your recovery code.')), h('div', { class: 'wa-options' }, passkeys
|
|
590
699
|
? option('Passkey', 'Touch ID, Windows Hello, or your password manager. Nothing to type.', () => void auth.addPasskey(), state.busy, true)
|
|
591
700
|
: null, passkeys && !choosing
|
|
592
701
|
? option('Password', 'Saved in your password manager, like any other login.', () => {
|
|
@@ -598,10 +707,7 @@ export class MincaAuthElement extends Base {
|
|
|
598
707
|
state.setup === 'restored'
|
|
599
708
|
? h('p', { class: 'wa-small', style: 'margin-top:16px' }, 'If your browser offered to save the recovery code as a password, don’t — the password you set now would replace it. Keep the code where you had it.')
|
|
600
709
|
: null, state.setup === 'paired' && state.pairingStage
|
|
601
|
-
?
|
|
602
|
-
class: state.pairingStage.kind === 'failed' ? 'wa-error' : 'wa-small',
|
|
603
|
-
style: 'margin-top:16px',
|
|
604
|
-
}, describePairing(state.pairingStage))
|
|
710
|
+
? pairingLine(state.pairingStage, 'wa-small', 'margin-top:16px')
|
|
605
711
|
: null,
|
|
606
712
|
// The app waits in the tab it opened; the camera opened this one.
|
|
607
713
|
state.setup === 'paired'
|
|
@@ -637,15 +743,8 @@ export class MincaAuthElement extends Base {
|
|
|
637
743
|
: 'This phone becomes the same account, with its own copy of your spaces.', info('What happens next', 'Your computer and this phone show the same six digits. When you confirm them on the computer, it sends the account here directly — the relay only introduces the two, and sees nothing it could use.')), state.accounts.length > 0 && !code && !arriving
|
|
638
744
|
? h('p', { class: 'wa-error' }, 'Only continue if the code is on your own screen, in front of you. A link someone sent you would put this phone in their account instead of yours.')
|
|
639
745
|
: null, state.pairing && !code && !arriving
|
|
640
|
-
?
|
|
641
|
-
|
|
642
|
-
class: 'wa-button',
|
|
643
|
-
disabled: state.busy,
|
|
644
|
-
onclick: () => void auth.acceptPairing(),
|
|
645
|
-
}, state.busy ? 'Looking…' : 'Continue')
|
|
646
|
-
: null, stage
|
|
647
|
-
? h('p', { class: stage.kind === 'failed' ? 'wa-error' : 'wa-hint', style: 'margin-top:12px' }, describePairing(stage))
|
|
648
|
-
: null, errorBox(state.error), h('p', { class: 'wa-small' }, 'Keep the code showing on your computer until this finishes.'), links(link(state.pairing ? 'Not now' : 'Back', () => auth.dismissPairing(), state.busy && !code)));
|
|
746
|
+
? button(state.busy ? 'Looking…' : 'Continue', () => void auth.acceptPairing(), state.busy)
|
|
747
|
+
: null, stage ? pairingLine(stage, 'wa-hint', 'margin-top:12px') : null, errorBox(state.error), h('p', { class: 'wa-small' }, 'Keep the code showing on your computer until this finishes.'), links(link(state.pairing ? 'Not now' : 'Back', () => auth.dismissPairing(), state.busy && !code)));
|
|
649
748
|
}
|
|
650
749
|
/** The account a pairing brought, to a phone signed in to another: add it, or switch to it if it is already here */
|
|
651
750
|
#pairArrived(state, arrival, current) {
|
|
@@ -653,12 +752,7 @@ export class MincaAuthElement extends Base {
|
|
|
653
752
|
const known = arrival.account;
|
|
654
753
|
return card(known ? `Switch to ${known.name}?` : 'Add this account?', h('div', { class: 'wa-row', style: 'align-items:center;gap:12px' }, this.#drawAvatar(arrival.did, 40), h('p', { class: 'wa-hint', style: 'margin:0' }, known
|
|
655
754
|
? `The computer that showed the code sent ${known.name}, which is already on this phone. Switch to it? ${current} stays here, to switch back to.`
|
|
656
|
-
: `The computer that showed the code sent a different account from ${current}, one this phone doesn't have. Add it only if it is yours: if you meant to add this phone to ${current}, it already is, and this account is someone else's.`)),
|
|
657
|
-
type: 'button',
|
|
658
|
-
class: 'wa-button',
|
|
659
|
-
disabled: state.busy,
|
|
660
|
-
onclick: () => void auth.answerPairing(true),
|
|
661
|
-
}, known ? `Switch to ${known.name}` : 'Add and switch'), errorBox(state.error), links(link(`Stay as ${current}`, () => void auth.answerPairing(false), state.busy)));
|
|
755
|
+
: `The computer that showed the code sent a different account from ${current}, one this phone doesn't have. Add it only if it is yours: if you meant to add this phone to ${current}, it already is, and this account is someone else's.`)), button(known ? `Switch to ${known.name}` : 'Add and switch', () => void auth.answerPairing(true), state.busy), errorBox(state.error), links(link(`Stay as ${current}`, () => void auth.answerPairing(false), state.busy)));
|
|
662
756
|
}
|
|
663
757
|
}
|
|
664
758
|
/** Registers `<minca-auth>`, once. Importing this module does it for you. */
|