@immich/ui 0.32.0 → 0.33.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.
@@ -0,0 +1,45 @@
1
+ <script lang="ts">
2
+ import { resolveUrl } from '../../utilities/common.js';
3
+
4
+ type Props = {
5
+ site: {
6
+ title: string;
7
+ description: string;
8
+ imageUrl?: string;
9
+ };
10
+ page?: {
11
+ title: string;
12
+ description: string;
13
+ imageUrl?: string;
14
+ };
15
+ };
16
+
17
+ const { site, page }: Props = $props();
18
+
19
+ let fullTitle = $derived(page ? `${page.title} | ${site.title}` : site.title);
20
+
21
+ let pageDescription = $derived(page?.description ?? site.description);
22
+ let pageUrl = $derived(page?.imageUrl ?? site?.imageUrl);
23
+ </script>
24
+
25
+ <svelte:head>
26
+ <title>{fullTitle}</title>
27
+ <meta name="description" content={site.description} />
28
+
29
+ <!-- Facebook Meta Tags -->
30
+ <meta property="og:type" content="website" />
31
+ <meta property="og:site_name" content="{site.title} — {site.description}" />
32
+ <meta property="og:title" content={fullTitle} />
33
+ <meta property="og:description" content={pageDescription} />
34
+ {#if pageUrl}
35
+ <meta property="og:image" content={resolveUrl(pageUrl)} />
36
+ {/if}
37
+
38
+ <!-- Twitter Meta Tags -->
39
+ <meta name="twitter:card" content="summary_large_image" />
40
+ <meta name="twitter:title" content={fullTitle} />
41
+ <meta name="twitter:description" content={pageDescription} />
42
+ {#if pageUrl}
43
+ <meta property="twitter:image" content={resolveUrl(pageUrl)} />
44
+ {/if}
45
+ </svelte:head>
@@ -0,0 +1,15 @@
1
+ type Props = {
2
+ site: {
3
+ title: string;
4
+ description: string;
5
+ imageUrl?: string;
6
+ };
7
+ page?: {
8
+ title: string;
9
+ description: string;
10
+ imageUrl?: string;
11
+ };
12
+ };
13
+ declare const SiteMetadata: import("svelte").Component<Props, {}, "">;
14
+ type SiteMetadata = ReturnType<typeof SiteMetadata>;
15
+ export default SiteMetadata;
package/dist/index.d.ts CHANGED
@@ -51,6 +51,7 @@ export { default as NavbarItem } from './components/Navbar/NavbarItem.svelte';
51
51
  export { default as PasswordInput } from './components/PasswordInput/PasswordInput.svelte';
52
52
  export { default as Scrollable } from './components/Scrollable/Scrollable.svelte';
53
53
  export { default as Select } from './components/Select/Select.svelte';
54
+ export { default as SiteMetadata } from './components/SiteMetadata/SiteMetadata.svelte';
54
55
  export { default as HStack } from './components/Stack/HStack.svelte';
55
56
  export { default as Stack } from './components/Stack/Stack.svelte';
56
57
  export { default as VStack } from './components/Stack/VStack.svelte';
package/dist/index.js CHANGED
@@ -53,6 +53,7 @@ export { default as NavbarItem } from './components/Navbar/NavbarItem.svelte';
53
53
  export { default as PasswordInput } from './components/PasswordInput/PasswordInput.svelte';
54
54
  export { default as Scrollable } from './components/Scrollable/Scrollable.svelte';
55
55
  export { default as Select } from './components/Select/Select.svelte';
56
+ export { default as SiteMetadata } from './components/SiteMetadata/SiteMetadata.svelte';
56
57
  export { default as HStack } from './components/Stack/HStack.svelte';
57
58
  export { default as Stack } from './components/Stack/Stack.svelte';
58
59
  export { default as VStack } from './components/Stack/VStack.svelte';
@@ -1,5 +1,6 @@
1
+ import { env } from '$env/dynamic/public';
1
2
  const getImmichApp = (host) => {
2
- if (!host.endsWith('immich.app')) {
3
+ if (!host || !host.endsWith('immich.app')) {
3
4
  return false;
4
5
  }
5
6
  if (host === 'immich.app' || host.startsWith('pr-')) {
@@ -13,7 +14,7 @@ export const resolveUrl = (url, currentHostname) => {
13
14
  }
14
15
  const target = new URL(url);
15
16
  const targetApp = getImmichApp(target.hostname);
16
- const currentApp = getImmichApp(currentHostname ?? globalThis.location.hostname);
17
+ const currentApp = getImmichApp(currentHostname ?? globalThis.location?.hostname ?? env.PUBLIC_IMMICH_HOSTNAME);
17
18
  return targetApp && targetApp === currentApp ? target.pathname : target.href;
18
19
  };
19
20
  export const isExternalLink = (href) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.32.0",
3
+ "version": "0.33.0",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "scripts": {
6
6
  "create": "node scripts/create.js",