diff --git a/package.json b/package.json index b5790ed..5f98750 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "vitest": "^3.1.1" }, "dependencies": { - "@blah-im/core": "^0.5.0", + "@blah-im/core": "^0.5.1", "@melt-ui/svelte": "^0.86.6", "@zeabur/svelte-adapter": "^1.0.0", "bits-ui": "^1.3.19", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 798e172..ed7af1c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@blah-im/core': - specifier: ^0.5.0 - version: 0.5.0 + specifier: ^0.5.1 + version: 0.5.1 '@melt-ui/svelte': specifier: ^0.86.6 version: 0.86.6(svelte@5.25.12) @@ -143,8 +143,8 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@blah-im/core@0.5.0': - resolution: {integrity: sha512-Joaj8K+yd4DVwQrSe8NRxwjMFtzibvj9z70fl/s3ulw+1+dZtsCaRoYnNHS0hE8CZ7g2QshLG6ymvWBQo4rXNQ==} + '@blah-im/core@0.5.1': + resolution: {integrity: sha512-JEyIS4vTZFlYP67BtdJute+yT3hDBJoOLGZ+YZ5j5UQ2ttP9vAFeXsaX7ErstoXskQU7d9f7u0T0vmnzomVv8g==} '@esbuild/aix-ppc64@0.19.12': resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} @@ -2091,7 +2091,7 @@ snapshots: '@jridgewell/gen-mapping': 0.3.8 '@jridgewell/trace-mapping': 0.3.25 - '@blah-im/core@0.5.0': + '@blah-im/core@0.5.1': dependencies: zod: 3.24.2 diff --git a/src/lib/components/GroupedList/GroupedListInputItem.svelte b/src/lib/components/GroupedList/GroupedListInputItem.svelte index e399878..b8d3c27 100644 --- a/src/lib/components/GroupedList/GroupedListInputItem.svelte +++ b/src/lib/components/GroupedList/GroupedListInputItem.svelte @@ -1,4 +1,6 @@ diff --git a/src/lib/components/RichTextInput/ClientInput.svelte b/src/lib/components/RichTextInput/ClientInput.svelte index e48767e..de69343 100644 --- a/src/lib/components/RichTextInput/ClientInput.svelte +++ b/src/lib/components/RichTextInput/ClientInput.svelte @@ -21,6 +21,7 @@ const initialDoc = DOMParser.fromSchema(stateConfiguration.schema).parse(domEl); domEl.replaceChildren(); onDocChange?.(initialDoc); + isEmpty = initialDoc.textContent.length === 0; const state = createProseMirrorEditorState({ initialDoc, ...stateConfiguration }); editorView = new EditorView( diff --git a/src/routes/(app)/settings/SettingsAccountSections.svelte b/src/routes/(app)/settings/SettingsAccountSections.svelte index 88fcdb6..afe885a 100644 --- a/src/routes/(app)/settings/SettingsAccountSections.svelte +++ b/src/routes/(app)/settings/SettingsAccountSections.svelte @@ -44,9 +44,7 @@

- {currentAccount.profile.signee.id_key.slice(0, 6) + - '...' + - currentAccount.profile.signee.id_key.slice(-6)} + {currentAccount.id_key.slice(0, 4) + '..' + currentAccount.id_key.slice(-4)}

diff --git a/src/routes/(app)/settings/account/new/+page.svelte b/src/routes/(app)/settings/account/new/+page.svelte index a866c59..e924920 100644 --- a/src/routes/(app)/settings/account/new/+page.svelte +++ b/src/routes/(app)/settings/account/new/+page.svelte @@ -6,7 +6,6 @@ import { GroupedListContainer, GroupedListSection, - GroupedListItem, GroupedListInputItem } from '$lib/components/GroupedList'; import LoadingIndicator from '$lib/components/LoadingIndicator.svelte'; @@ -24,12 +23,18 @@ let password: string = $state(''); let repeatPassword: string = $state(''); let identityServer: string = $state('other.blue'); + let selfhostDomain: string = $state(''); let isBusy: boolean = $state(false); - let passwordMatch = $derived(password === repeatPassword); - let canCreate = $derived(name.length > 0 && password.length > 0 && passwordMatch); - let customize = $derived(page.url.hash === '#customize'); + const passwordMatch = $derived(password === repeatPassword); + const selfhostIdentity = $derived(page.url.hash === '#identity-selfhost'); + const canCreate = $derived( + name.length > 0 && + password.length > 0 && + passwordMatch && + (selfhostIdentity ? selfhostDomain.length > 0 : false) + ); async function createAccount() { const profile: BlahProfile = { @@ -37,7 +42,7 @@ name, bio: bioDoc?.textContent, preferred_chat_server_urls: [], - id_urls: [] + id_urls: selfhostIdentity ? ['https://' + selfhostDomain] : [] }; isBusy = true; @@ -114,7 +119,27 @@ {/snippet} - {#if customize} + {#if selfhostIdentity} + + + Domain Name + + + {#snippet footer()} +
+

+ After creating account, you need to serve your profile file to a specific location under + this domain. + Learn more about hosting your own profile... +

+

+ Use identity service if you you want a simple way + to start. You can always switch to self-hosting later. +

+
+ {/snippet} +
+ {:else} Initial Service @@ -123,23 +148,19 @@ {#snippet footer()}

- Your profile is stored and served to other users on the identity service. + By creating an account on {identityServer}, which stores and serve this public + profile to other users, you agree to Terms of Service and Privacy Policy of + {identityServer}. Learn more about identity services...

You can add, replace or remove identity services later in account settings.

+

+ If you own or can afford a domain name, you can + host your own profile + instead of using a service. +

{/snippet}
{/if} -
-

- By creating an account, you agree to Terms of Service and Privacy Policy of - {identityServer}, which stores and serve your public profile to other users. - {#if customize} - Use default - {:else} - Customize... - {/if} -

-