@immich/ui 0.31.0 → 0.31.2
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/common/context.svelte.js +1 -1
- package/dist/common/use-child.svelte.js +1 -1
- package/dist/components/Alert/Alert.svelte +1 -1
- package/dist/components/AppShell/AppShell.svelte +1 -1
- package/dist/components/AppShell/AppShellSidebar.svelte +1 -1
- package/dist/components/Card/Card.svelte +1 -1
- package/dist/components/Card/CardDescription.svelte +1 -1
- package/dist/components/Checkbox/Checkbox.svelte +1 -1
- package/dist/components/Code/Code.svelte +1 -1
- package/dist/components/CodeBlock/CodeBlock.svelte +1 -1
- package/dist/components/Container/Container.svelte +1 -1
- package/dist/components/Field/Field.svelte +1 -1
- package/dist/components/Heading/Heading.svelte +1 -1
- package/dist/components/HelperText/HelperText.svelte +1 -1
- package/dist/components/Icon/Icon.svelte +1 -1
- package/dist/components/Input/Input.svelte +1 -1
- package/dist/components/Kbd/Kbd.svelte +1 -1
- package/dist/components/Label/Label.svelte +1 -1
- package/dist/components/Link/Link.svelte +7 -4
- package/dist/components/Link/Link.svelte.d.ts +0 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.svelte +1 -1
- package/dist/components/Logo/Logo.svelte +1 -1
- package/dist/components/Modal/Modal.svelte +1 -1
- package/dist/components/Navbar/NavbarItem.svelte +1 -12
- package/dist/components/Navbar/NavbarItem.svelte.d.ts +0 -1
- package/dist/components/Scrollable/Scrollable.svelte +1 -1
- package/dist/components/Stack/Stack.svelte +1 -1
- package/dist/components/SupporterBadge/SupporterBadge.svelte +1 -1
- package/dist/components/Switch/Switch.svelte +1 -1
- package/dist/components/Text/Text.svelte +1 -1
- package/dist/components/Textarea/Textarea.svelte +1 -1
- package/dist/components/ThemeSwitcher/ThemeSwitcher.svelte +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal/Button.svelte +5 -3
- package/dist/internal/Child.svelte +1 -1
- package/dist/internal/Select.svelte +1 -1
- package/dist/internal/Text.svelte +1 -1
- package/dist/services/command-palette-manager.svelte.d.ts +0 -1
- package/dist/services/command-palette-manager.svelte.js +1 -2
- package/dist/site/SiteFooter.svelte +1 -1
- package/dist/site/SiteFooterLink.svelte +1 -1
- package/dist/site/constants.d.ts +1 -2
- package/dist/site/constants.js +1 -2
- package/dist/types.d.ts +0 -2
- package/dist/utilities/common.d.ts +2 -0
- package/dist/utilities/common.js +21 -0
- package/dist/{utils.d.ts → utilities/internal.d.ts} +1 -1
- package/package.json +1 -1
- /package/dist/{utils.js → utilities/internal.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withPrefix } from '../
|
|
1
|
+
import { withPrefix } from '../utilities/internal.js';
|
|
2
2
|
import { getContext, hasContext, setContext } from 'svelte';
|
|
3
3
|
const fieldKey = Symbol(withPrefix('field'));
|
|
4
4
|
export const setFieldContext = (field) => setContext(fieldKey, field);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChildKey } from '../constants.js';
|
|
2
|
-
import { withPrefix } from '../
|
|
2
|
+
import { withPrefix } from '../utilities/internal.js';
|
|
3
3
|
import { setContext } from 'svelte';
|
|
4
4
|
import { SvelteMap } from 'svelte/reactivity';
|
|
5
5
|
export const withChildrenSnippets = (key) => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import Icon from '../Icon/Icon.svelte';
|
|
6
6
|
import Text from '../Text/Text.svelte';
|
|
7
7
|
import type { Color, Size } from '../../types.js';
|
|
8
|
-
import { cleanClass } from '../../
|
|
8
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
9
9
|
import {
|
|
10
10
|
mdiAlertOutline,
|
|
11
11
|
mdiCheckCircleOutline,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { withChildrenSnippets } from '../../common/use-child.svelte.js';
|
|
3
3
|
import Scrollable from '../Scrollable/Scrollable.svelte';
|
|
4
4
|
import { ChildKey } from '../../constants.js';
|
|
5
|
-
import { cleanClass } from '../../
|
|
5
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
6
6
|
import type { Snippet } from 'svelte';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Scrollable from '../Scrollable/Scrollable.svelte';
|
|
3
3
|
import { ChildKey } from '../../constants.js';
|
|
4
4
|
import Child from '../../internal/Child.svelte';
|
|
5
|
-
import { cleanClass } from '../../
|
|
5
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
6
6
|
import { type Snippet } from 'svelte';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import Scrollable from '../Scrollable/Scrollable.svelte';
|
|
5
5
|
import { ChildKey } from '../../constants.js';
|
|
6
6
|
import type { Color } from '../../types.js';
|
|
7
|
-
import { cleanClass } from '../../
|
|
7
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
8
8
|
import { mdiChevronDown } from '@mdi/js';
|
|
9
9
|
import { type Snippet } from 'svelte';
|
|
10
10
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import Label from '../Label/Label.svelte';
|
|
5
5
|
import Text from '../Text/Text.svelte';
|
|
6
6
|
import type { Color, Shape, Size } from '../../types.js';
|
|
7
|
-
import { cleanClass, generateId } from '../../
|
|
7
|
+
import { cleanClass, generateId } from '../../utilities/internal.js';
|
|
8
8
|
import { mdiCheck, mdiMinus } from '@mdi/js';
|
|
9
9
|
import { Checkbox as CheckboxPrimitive, type WithoutChildrenOrChild } from 'bits-ui';
|
|
10
10
|
import { tv } from 'tailwind-variants';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Size, TextColor } from '../../types.js';
|
|
3
|
-
import { cleanClass } from '../../
|
|
3
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
6
6
|
import { tv } from 'tailwind-variants';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import IconButton from '../IconButton/IconButton.svelte';
|
|
4
4
|
import { theme } from '../../services/theme.svelte.js';
|
|
5
5
|
import { Theme, type TranslationProps } from '../../types.js';
|
|
6
|
-
import { t } from '../../
|
|
6
|
+
import { t } from '../../services/translation.svelte.js';
|
|
7
7
|
import { mdiCheckCircle, mdiContentCopy } from '@mdi/js';
|
|
8
8
|
import { Highlight, LineNumbers } from 'svelte-highlight';
|
|
9
9
|
import { typescript, type LanguageType } from 'svelte-highlight/languages';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { withChildrenSnippets } from '../../common/use-child.svelte.js';
|
|
4
4
|
import { ChildKey } from '../../constants.js';
|
|
5
5
|
import type { FieldContext } from '../../types.js';
|
|
6
|
-
import { cleanClass } from '../../
|
|
6
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
7
7
|
import { type Snippet } from 'svelte';
|
|
8
8
|
|
|
9
9
|
type Props = FieldContext & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FontWeight, HeadingColor, HeadingSize, HeadingTag, TextVariant } from '../../types.js';
|
|
3
|
-
import { cleanClass } from '../../
|
|
3
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
4
4
|
import Text from '../../internal/Text.svelte';
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
6
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { ChildKey } from '../../constants.js';
|
|
4
4
|
import Child from '../../internal/Child.svelte';
|
|
5
5
|
import type { TextColor } from '../../types.js';
|
|
6
|
-
import { cleanClass } from '../../
|
|
6
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
7
7
|
import type { Snippet } from 'svelte';
|
|
8
8
|
|
|
9
9
|
type Props = {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import Label from '../Label/Label.svelte';
|
|
5
5
|
import Text from '../Text/Text.svelte';
|
|
6
6
|
import type { InputProps } from '../../types.js';
|
|
7
|
-
import { cleanClass, generateId, isIconLike } from '../../
|
|
7
|
+
import { cleanClass, generateId, isIconLike } from '../../utilities/internal.js';
|
|
8
8
|
import { tv } from 'tailwind-variants';
|
|
9
9
|
|
|
10
10
|
let {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Color, Size } from '../../types.js';
|
|
3
|
-
import { cleanClass } from '../../
|
|
3
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
6
6
|
import { tv } from 'tailwind-variants';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { styles } from '../../styles.js';
|
|
3
3
|
import type { LabelProps } from '../../types.js';
|
|
4
|
-
import { cleanClass } from '../../
|
|
4
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
5
5
|
|
|
6
6
|
const { label, size, color, class: className, children, ...restProps }: LabelProps = $props();
|
|
7
7
|
</script>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import { isExternalLink, resolveUrl } from '../../utilities/common.js';
|
|
3
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
3
4
|
import type { Snippet } from 'svelte';
|
|
4
5
|
import type { HTMLAnchorAttributes } from 'svelte/elements';
|
|
5
6
|
|
|
@@ -8,14 +9,16 @@
|
|
|
8
9
|
children: Snippet;
|
|
9
10
|
href: string;
|
|
10
11
|
underline?: boolean;
|
|
11
|
-
external?: boolean;
|
|
12
12
|
} & HTMLAnchorAttributes;
|
|
13
13
|
|
|
14
|
-
const { href, class: className, underline = true,
|
|
14
|
+
const { href, class: className, underline = true, children, ...restProps }: Props = $props();
|
|
15
|
+
|
|
16
|
+
let resolved = $derived(resolveUrl(href));
|
|
17
|
+
let external = $derived(isExternalLink(resolved));
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
20
|
<a
|
|
18
|
-
{
|
|
21
|
+
href={resolved}
|
|
19
22
|
draggable="false"
|
|
20
23
|
class={cleanClass(underline && 'underline', className)}
|
|
21
24
|
target={external ? '_blank' : undefined}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import icon from '../../assets/immich-logo.svg';
|
|
9
9
|
import { theme } from '../../services/theme.svelte.js';
|
|
10
10
|
import { Theme, type Size } from '../../types.js';
|
|
11
|
-
import { cleanClass } from '../../
|
|
11
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
12
12
|
import { tv } from 'tailwind-variants';
|
|
13
13
|
|
|
14
14
|
type Props = {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import Logo from '../Logo/Logo.svelte';
|
|
11
11
|
import { ChildKey } from '../../constants.js';
|
|
12
12
|
import type { ModalSize } from '../../types.js';
|
|
13
|
-
import { cleanClass } from '../../
|
|
13
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
14
14
|
import { Dialog } from 'bits-ui';
|
|
15
15
|
import { tick, type Snippet } from 'svelte';
|
|
16
16
|
import { tv } from 'tailwind-variants';
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
type Props = {
|
|
9
9
|
title: string;
|
|
10
10
|
href: string;
|
|
11
|
-
external?: boolean;
|
|
12
11
|
active?: boolean;
|
|
13
12
|
variant?: 'compact';
|
|
14
13
|
isActive?: () => boolean;
|
|
@@ -18,16 +17,7 @@
|
|
|
18
17
|
|
|
19
18
|
const startsWithHref = () => page.url.pathname.startsWith(href);
|
|
20
19
|
|
|
21
|
-
let {
|
|
22
|
-
href,
|
|
23
|
-
external,
|
|
24
|
-
isActive: isActiveOverride,
|
|
25
|
-
title,
|
|
26
|
-
variant,
|
|
27
|
-
active: activeOverride,
|
|
28
|
-
icon,
|
|
29
|
-
activeIcon,
|
|
30
|
-
}: Props = $props();
|
|
20
|
+
let { href, isActive: isActiveOverride, title, variant, active: activeOverride, icon, activeIcon }: Props = $props();
|
|
31
21
|
|
|
32
22
|
const isActive = isActiveOverride ?? startsWithHref;
|
|
33
23
|
let active = $derived(activeOverride ?? isActive());
|
|
@@ -52,7 +42,6 @@
|
|
|
52
42
|
|
|
53
43
|
<Link
|
|
54
44
|
{href}
|
|
55
|
-
{external}
|
|
56
45
|
aria-current={active ? 'page' : undefined}
|
|
57
46
|
underline={false}
|
|
58
47
|
class={styles({ active, variant: variant ?? 'default' })}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import Logo from '../Logo/Logo.svelte';
|
|
3
3
|
import Text from '../Text/Text.svelte';
|
|
4
4
|
import type { Size } from '../../types.js';
|
|
5
|
-
import { cleanClass } from '../../
|
|
5
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
6
6
|
import type { Snippet } from 'svelte';
|
|
7
7
|
import { tv } from 'tailwind-variants';
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import Label from '../Label/Label.svelte';
|
|
4
4
|
import Text from '../Text/Text.svelte';
|
|
5
5
|
import type { Color } from '../../types.js';
|
|
6
|
-
import { cleanClass, generateId } from '../../
|
|
6
|
+
import { cleanClass, generateId } from '../../utilities/internal.js';
|
|
7
7
|
import { Switch, type WithoutChildrenOrChild } from 'bits-ui';
|
|
8
8
|
import { tv } from 'tailwind-variants';
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Text from '../../internal/Text.svelte';
|
|
3
3
|
import type { FontWeight, Size, TextColor, TextVariant } from '../../types.js';
|
|
4
|
-
import { cleanClass } from '../../
|
|
4
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
6
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
7
7
|
import { tv } from 'tailwind-variants';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import Label from '../Label/Label.svelte';
|
|
4
4
|
import Text from '../Text/Text.svelte';
|
|
5
5
|
import type { TextareaProps } from '../../types.js';
|
|
6
|
-
import { cleanClass, generateId } from '../../
|
|
6
|
+
import { cleanClass, generateId } from '../../utilities/internal.js';
|
|
7
7
|
import type { FormEventHandler } from 'svelte/elements';
|
|
8
8
|
import { tv } from 'tailwind-variants';
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { theme, toggleTheme } from '../../services/theme.svelte.js';
|
|
4
4
|
import { t } from '../../services/translation.svelte.js';
|
|
5
5
|
import { Theme, type Color, type Size, type TranslationProps, type Variants } from '../../types.js';
|
|
6
|
-
import { cleanClass } from '../../
|
|
6
|
+
import { cleanClass } from '../../utilities/internal.js';
|
|
7
7
|
import { mdiWeatherNight, mdiWeatherSunny } from '@mdi/js';
|
|
8
8
|
|
|
9
9
|
type Props = {
|
package/dist/index.d.ts
CHANGED
|
@@ -65,5 +65,6 @@ export * from './services/theme.svelte.js';
|
|
|
65
65
|
export * from './services/translation.svelte.js';
|
|
66
66
|
export * from './types.js';
|
|
67
67
|
export * from './utilities/byte-units.js';
|
|
68
|
+
export * from './utilities/common.js';
|
|
68
69
|
export * from './site/constants.js';
|
|
69
70
|
export { default as SiteFooter } from './site/SiteFooter.svelte';
|
package/dist/index.js
CHANGED
|
@@ -68,6 +68,7 @@ export * from './services/theme.svelte.js';
|
|
|
68
68
|
export * from './services/translation.svelte.js';
|
|
69
69
|
export * from './types.js';
|
|
70
70
|
export * from './utilities/byte-units.js';
|
|
71
|
+
export * from './utilities/common.js';
|
|
71
72
|
// site
|
|
72
73
|
export * from './site/constants.js';
|
|
73
74
|
export { default as SiteFooter } from './site/SiteFooter.svelte';
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import Icon from '../components/Icon/Icon.svelte';
|
|
3
3
|
import LoadingSpinner from '../components/LoadingSpinner/LoadingSpinner.svelte';
|
|
4
4
|
import type { ButtonProps, Size } from '../types.js';
|
|
5
|
-
import {
|
|
5
|
+
import { isExternalLink, resolveUrl } from '../utilities/common.js';
|
|
6
|
+
import { cleanClass } from '../utilities/internal.js';
|
|
6
7
|
import { Button as ButtonPrimitive } from 'bits-ui';
|
|
7
8
|
import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
8
9
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -17,7 +18,6 @@
|
|
|
17
18
|
ref = $bindable(null),
|
|
18
19
|
type = 'button',
|
|
19
20
|
href,
|
|
20
|
-
external,
|
|
21
21
|
variant = 'filled',
|
|
22
22
|
color = 'primary',
|
|
23
23
|
shape = 'semi-round',
|
|
@@ -154,9 +154,11 @@
|
|
|
154
154
|
{/snippet}
|
|
155
155
|
|
|
156
156
|
{#if href}
|
|
157
|
+
{@const resolved = resolveUrl(href)}
|
|
158
|
+
{@const external = isExternalLink(resolved)}
|
|
157
159
|
<a
|
|
158
160
|
bind:this={ref}
|
|
159
|
-
{
|
|
161
|
+
href={resolved}
|
|
160
162
|
class={classList}
|
|
161
163
|
aria-disabled={disabled}
|
|
162
164
|
target={external ? '_blank' : undefined}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { ChildKey } from '../constants.js';
|
|
3
3
|
import type { ChildData } from '../types.js';
|
|
4
|
-
import { withPrefix } from '../
|
|
4
|
+
import { withPrefix } from '../utilities/internal.js';
|
|
5
5
|
import { getContext, type Snippet } from 'svelte';
|
|
6
6
|
|
|
7
7
|
type ContextType = {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import Input from '../components/Input/Input.svelte';
|
|
7
7
|
import Label from '../components/Label/Label.svelte';
|
|
8
8
|
import type { SelectCommonProps, SelectItem } from '../types.js';
|
|
9
|
-
import { cleanClass, generateId } from '../
|
|
9
|
+
import { cleanClass, generateId } from '../utilities/internal.js';
|
|
10
10
|
import { mdiArrowDown, mdiArrowUp, mdiCheck, mdiUnfoldMoreHorizontal } from '@mdi/js';
|
|
11
11
|
import { Select } from 'bits-ui';
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { FontWeight, HeadingColor, HeadingTag, Size, TextVariant } from '../types.js';
|
|
3
|
-
import { cleanClass } from '../
|
|
3
|
+
import { cleanClass } from '../utilities/internal.js';
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
6
6
|
import { tv } from 'tailwind-variants';
|
|
@@ -52,11 +52,10 @@ class CommandPaletteManager {
|
|
|
52
52
|
this.recentItems.unshift(selected);
|
|
53
53
|
this.recentItems = this.recentItems.slice(0, 5);
|
|
54
54
|
if ('href' in selected) {
|
|
55
|
-
if (selected.href.startsWith('
|
|
55
|
+
if (!selected.href.startsWith('/')) {
|
|
56
56
|
window.open(selected.href, '_blank');
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
|
-
// eslint-disable-next-line svelte/no-navigation-without-resolve
|
|
60
59
|
await goto(selected.href);
|
|
61
60
|
}
|
|
62
61
|
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
<Heading size="tiny">Download</Heading>
|
|
36
36
|
<SiteFooterLink href={Constants.Get.Android} icon={siAndroid} text="Android" />
|
|
37
37
|
<SiteFooterLink href={Constants.Get.iOS} icon={siApple} text="iOS" />
|
|
38
|
-
<SiteFooterLink href={Constants.Get.
|
|
38
|
+
<SiteFooterLink href={Constants.Get.Download} icon={mdiServerOutline} text="Server" />
|
|
39
39
|
</Stack>
|
|
40
40
|
|
|
41
41
|
<Stack>
|
package/dist/site/constants.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const Constants: {
|
|
|
11
11
|
Android: string;
|
|
12
12
|
FDroid: string;
|
|
13
13
|
GithubRelease: string;
|
|
14
|
-
|
|
14
|
+
Download: string;
|
|
15
15
|
};
|
|
16
16
|
Sites: {
|
|
17
17
|
Api: string;
|
|
@@ -41,6 +41,5 @@ export declare const siteCommands: {
|
|
|
41
41
|
title: string;
|
|
42
42
|
description: string;
|
|
43
43
|
href: string;
|
|
44
|
-
external: boolean;
|
|
45
44
|
text: string;
|
|
46
45
|
}[];
|
package/dist/site/constants.js
CHANGED
|
@@ -13,7 +13,7 @@ export const Constants = {
|
|
|
13
13
|
Android: 'https://get.immich.app/android',
|
|
14
14
|
FDroid: 'https://get.immich.app/fdroid',
|
|
15
15
|
GithubRelease: 'https://github.com/immich-app/immich/releases/latest',
|
|
16
|
-
|
|
16
|
+
Download: 'https://immich.app/download',
|
|
17
17
|
},
|
|
18
18
|
Sites: {
|
|
19
19
|
Api: 'https://api.immich.app/',
|
|
@@ -129,6 +129,5 @@ export const siteCommands = [
|
|
|
129
129
|
title: site.title,
|
|
130
130
|
description: site.description,
|
|
131
131
|
href: site.href,
|
|
132
|
-
external: true,
|
|
133
132
|
text: asText('Site', 'Link', site.title, site.description, site.href),
|
|
134
133
|
}));
|
package/dist/types.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const getImmichApp = (host) => {
|
|
2
|
+
if (!host.endsWith('immich.app')) {
|
|
3
|
+
return false;
|
|
4
|
+
}
|
|
5
|
+
if (host === 'immich.app' || host.startsWith('pr-')) {
|
|
6
|
+
return 'root';
|
|
7
|
+
}
|
|
8
|
+
return host.split('.')[0];
|
|
9
|
+
};
|
|
10
|
+
export const resolveUrl = (url, currentHostname) => {
|
|
11
|
+
if (!isExternalLink(url)) {
|
|
12
|
+
return url;
|
|
13
|
+
}
|
|
14
|
+
const target = new URL(url);
|
|
15
|
+
const targetApp = getImmichApp(target.hostname);
|
|
16
|
+
const currentApp = getImmichApp(currentHostname ?? globalThis.location.hostname);
|
|
17
|
+
return targetApp && targetApp === currentApp ? target.pathname : target.href;
|
|
18
|
+
};
|
|
19
|
+
export const isExternalLink = (href) => {
|
|
20
|
+
return !(href.startsWith('/') || href.startsWith('#'));
|
|
21
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconLike } from '
|
|
1
|
+
import type { IconLike } from '../types.js';
|
|
2
2
|
export declare const cleanClass: (...classNames: unknown[]) => string;
|
|
3
3
|
export declare const withPrefix: (key: string) => string;
|
|
4
4
|
export declare const generateId: () => string;
|
package/package.json
CHANGED
|
File without changes
|