@absolutejs/absolute 0.19.0-beta.230 → 0.19.0-beta.232

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.
Files changed (43) hide show
  1. package/.absolutejs/vue-tsc.tsbuildinfo +1 -1
  2. package/.claude/settings.local.json +2 -1
  3. package/dist/ai-client/angular/ai/index.js +12 -14
  4. package/dist/ai-client/react/ai/index.js +12 -14
  5. package/dist/ai-client/vue/ai/index.js +12 -14
  6. package/dist/angular/ai/index.js +13 -15
  7. package/dist/angular/ai/index.js.map +3 -3
  8. package/dist/react/ai/index.js +13 -15
  9. package/dist/react/ai/index.js.map +3 -3
  10. package/dist/svelte/ai/index.js +13 -15
  11. package/dist/svelte/ai/index.js.map +3 -3
  12. package/dist/vue/ai/index.js +13 -15
  13. package/dist/vue/ai/index.js.map +3 -3
  14. package/package.json +1 -1
  15. package/dist/angular/components/image.component.js +0 -202
  16. package/dist/angular/components/index.js +0 -1
  17. package/dist/dev/client/constants.ts +0 -25
  18. package/dist/dev/client/cssUtils.ts +0 -305
  19. package/dist/dev/client/domDiff.ts +0 -225
  20. package/dist/dev/client/domState.ts +0 -420
  21. package/dist/dev/client/domTracker.ts +0 -60
  22. package/dist/dev/client/errorOverlay.ts +0 -183
  23. package/dist/dev/client/frameworkDetect.ts +0 -62
  24. package/dist/dev/client/handlers/angular.ts +0 -551
  25. package/dist/dev/client/handlers/angularRuntime.ts +0 -205
  26. package/dist/dev/client/handlers/html.ts +0 -361
  27. package/dist/dev/client/handlers/htmx.ts +0 -274
  28. package/dist/dev/client/handlers/react.ts +0 -107
  29. package/dist/dev/client/handlers/rebuild.ts +0 -152
  30. package/dist/dev/client/handlers/svelte.ts +0 -331
  31. package/dist/dev/client/handlers/vue.ts +0 -291
  32. package/dist/dev/client/headPatch.ts +0 -232
  33. package/dist/dev/client/hmrClient.ts +0 -250
  34. package/dist/dev/client/moduleVersions.ts +0 -61
  35. package/dist/dev/client/reactRefreshSetup.ts +0 -32
  36. package/dist/svelte/components/Head.svelte +0 -147
  37. package/dist/svelte/components/Head.svelte.d.ts +0 -5
  38. package/dist/svelte/components/Image.svelte +0 -161
  39. package/dist/svelte/components/Image.svelte.d.ts +0 -5
  40. package/dist/svelte/components/JsonLd.svelte +0 -20
  41. package/dist/svelte/components/JsonLd.svelte.d.ts +0 -2
  42. package/dist/vue/components/Image.vue +0 -186
  43. package/dist/vue/components/Image.vue.d.ts +0 -4
@@ -1,147 +0,0 @@
1
- <script lang="ts">
2
- import type { Metadata, RobotsDirective } from '../../../types/metadata';
3
-
4
- let {
5
- title = 'AbsoluteJS',
6
- description = 'A page created using AbsoluteJS',
7
- icon = '/assets/ico/favicon.ico',
8
- font,
9
- cssPath,
10
- canonical,
11
- openGraph,
12
- twitter,
13
- robots,
14
- meta
15
- }: Metadata = $props();
16
-
17
- const robotsContent = (r: RobotsDirective) => {
18
- const directives: string[] = [];
19
- if (r.index === false) directives.push('noindex');
20
- if (r.index === true) directives.push('index');
21
- if (r.follow === false) directives.push('nofollow');
22
- if (r.follow === true) directives.push('follow');
23
- if (r.noarchive) directives.push('noarchive');
24
- if (r.nosnippet) directives.push('nosnippet');
25
- if (r.noimageindex) directives.push('noimageindex');
26
- if (r.maxSnippet !== undefined)
27
- directives.push(`max-snippet:${r.maxSnippet}`);
28
- if (r.maxImagePreview)
29
- directives.push(`max-image-preview:${r.maxImagePreview}`);
30
- if (r.maxVideoPreview !== undefined)
31
- directives.push(`max-video-preview:${r.maxVideoPreview}`);
32
- return directives.join(', ');
33
- };
34
-
35
- const cssPaths = $derived(
36
- cssPath ? (Array.isArray(cssPath) ? cssPath : [cssPath]) : []
37
- );
38
- </script>
39
-
40
- <svelte:head>
41
- <meta charset="utf-8" />
42
- <title>{title}</title>
43
- <meta name="description" content={description} />
44
- <meta name="viewport" content="width=device-width, initial-scale=1" />
45
- <link rel="icon" href={icon} />
46
-
47
- {#if canonical}
48
- <link rel="canonical" href={canonical} />
49
- {/if}
50
-
51
- {#if openGraph}
52
- <meta property="og:title" content={openGraph.title ?? title} />
53
- <meta
54
- property="og:description"
55
- content={openGraph.description ?? description}
56
- />
57
- {#if openGraph.url}
58
- <meta property="og:url" content={openGraph.url} />
59
- {/if}
60
- {#if openGraph.image}
61
- <meta property="og:image" content={openGraph.image} />
62
- {/if}
63
- {#if openGraph.imageAlt}
64
- <meta property="og:image:alt" content={openGraph.imageAlt} />
65
- {/if}
66
- {#if openGraph.imageWidth}
67
- <meta
68
- property="og:image:width"
69
- content={String(openGraph.imageWidth)}
70
- />
71
- {/if}
72
- {#if openGraph.imageHeight}
73
- <meta
74
- property="og:image:height"
75
- content={String(openGraph.imageHeight)}
76
- />
77
- {/if}
78
- {#if openGraph.type}
79
- <meta property="og:type" content={openGraph.type} />
80
- {/if}
81
- {#if openGraph.siteName}
82
- <meta property="og:site_name" content={openGraph.siteName} />
83
- {/if}
84
- {#if openGraph.locale}
85
- <meta property="og:locale" content={openGraph.locale} />
86
- {/if}
87
- {/if}
88
-
89
- {#if twitter}
90
- {#if twitter.card}
91
- <meta name="twitter:card" content={twitter.card} />
92
- {/if}
93
- <meta name="twitter:title" content={twitter.title ?? title} />
94
- <meta
95
- name="twitter:description"
96
- content={twitter.description ?? description}
97
- />
98
- {#if twitter.image}
99
- <meta name="twitter:image" content={twitter.image} />
100
- {/if}
101
- {#if twitter.imageAlt}
102
- <meta name="twitter:image:alt" content={twitter.imageAlt} />
103
- {/if}
104
- {#if twitter.site}
105
- <meta name="twitter:site" content={twitter.site} />
106
- {/if}
107
- {#if twitter.creator}
108
- <meta name="twitter:creator" content={twitter.creator} />
109
- {/if}
110
- {/if}
111
-
112
- {#if robots}
113
- {@const content = robotsContent(robots)}
114
- {#if content}
115
- <meta name="robots" {content} />
116
- {/if}
117
- {/if}
118
-
119
- {#if meta}
120
- {#each meta as tag}
121
- {#if tag.property}
122
- <meta property={tag.property} content={tag.content} />
123
- {:else if tag.httpEquiv}
124
- <meta http-equiv={tag.httpEquiv} content={tag.content} />
125
- {:else if tag.name}
126
- <meta name={tag.name} content={tag.content} />
127
- {/if}
128
- {/each}
129
- {/if}
130
-
131
- {#if font}
132
- <link rel="preconnect" href="https://fonts.googleapis.com" />
133
- <link
134
- rel="preconnect"
135
- href="https://fonts.gstatic.com"
136
- crossOrigin="anonymous"
137
- />
138
- <link
139
- href={`https://fonts.googleapis.com/css2?family=${font}:wght@100..900&display=swap`}
140
- rel="stylesheet"
141
- />
142
- {/if}
143
-
144
- {#each cssPaths as path}
145
- <link rel="stylesheet" href={path} type="text/css" />
146
- {/each}
147
- </svelte:head>
@@ -1,5 +0,0 @@
1
- import type { Metadata } from '../../types/metadata';
2
- import { SvelteComponent } from 'svelte';
3
- declare const __propDef: { props: Metadata };
4
- type Props = typeof __propDef.props;
5
- export default class Head extends SvelteComponent<Props> {}
@@ -1,161 +0,0 @@
1
- <script lang="ts">
2
- import type { ImageProps } from '@absolutejs/absolute/image';
3
- import {
4
- DEFAULT_QUALITY,
5
- buildOptimizedUrl,
6
- generateBlurSvg,
7
- generateSrcSet
8
- } from '@absolutejs/absolute/image';
9
-
10
- let {
11
- src,
12
- alt,
13
- width,
14
- height,
15
- fill,
16
- quality = DEFAULT_QUALITY,
17
- sizes,
18
- loader,
19
- unoptimized,
20
- loading,
21
- priority,
22
- placeholder,
23
- blurDataURL,
24
- className,
25
- style,
26
- onLoad,
27
- onError,
28
- crossOrigin,
29
- referrerPolicy,
30
- fetchPriority,
31
- overrideSrc
32
- }: ImageProps = $props();
33
-
34
- const resolvedSrc = $derived.by(() => {
35
- if (overrideSrc) return overrideSrc;
36
- if (unoptimized) return src;
37
- if (loader) return loader({ src, width: width ?? 0, quality });
38
- if (!width) return buildOptimizedUrl(src, 0, quality);
39
- return buildOptimizedUrl(src, width, quality);
40
- });
41
-
42
- const srcSet = $derived(
43
- unoptimized ? undefined : generateSrcSet(src, width, sizes)
44
- );
45
-
46
- const resolvedSizes = $derived(sizes ?? (fill ? '100vw' : undefined));
47
-
48
- const resolvedLoading = $derived(priority ? 'eager' : (loading ?? 'lazy'));
49
-
50
- const resolvedFetchPriority = $derived(priority ? 'high' : fetchPriority);
51
-
52
- const hasBlur = $derived(
53
- placeholder === 'blur' ||
54
- (typeof placeholder === 'string' &&
55
- placeholder !== 'empty' &&
56
- placeholder.startsWith('data:'))
57
- );
58
-
59
- const blurBackground = $derived.by(() => {
60
- if (!hasBlur) return undefined;
61
- if (
62
- typeof placeholder === 'string' &&
63
- placeholder !== 'blur' &&
64
- placeholder.startsWith('data:')
65
- ) {
66
- return generateBlurSvg(placeholder);
67
- }
68
- if (blurDataURL) return generateBlurSvg(blurDataURL);
69
- return undefined;
70
- });
71
-
72
- const imgStyle = $derived.by(() => {
73
- const base: Record<string, string | number> = {
74
- ...(style ?? {}),
75
- color: 'transparent'
76
- };
77
- if (blurBackground) {
78
- base.backgroundImage = blurBackground;
79
- base.backgroundSize = 'cover';
80
- base.backgroundPosition = 'center';
81
- base.backgroundRepeat = 'no-repeat';
82
- }
83
- if (fill) {
84
- base.position = 'absolute';
85
- base.height = '100%';
86
- base.width = '100%';
87
- base.inset = 0;
88
- base.objectFit = 'cover';
89
- }
90
- return Object.entries(base)
91
- .map(
92
- ([k, v]) =>
93
- `${k.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}:${v}`
94
- )
95
- .join(';');
96
- });
97
-
98
- const handleLoad = (e: Event) => {
99
- if (blurBackground) {
100
- (e.target as HTMLImageElement).style.backgroundImage = 'none';
101
- }
102
- if (onLoad) (onLoad as (event: Event) => void)(e);
103
- };
104
-
105
- const handleError = (e: Event) => {
106
- if (onError) (onError as (event: Event) => void)(e);
107
- };
108
- </script>
109
-
110
- <svelte:head>
111
- {#if priority}
112
- <link
113
- rel="preload"
114
- as="image"
115
- href={resolvedSrc}
116
- imagesrcset={srcSet}
117
- imagesizes={resolvedSizes}
118
- crossorigin={crossOrigin}
119
- />
120
- {/if}
121
- </svelte:head>
122
-
123
- {#if fill}
124
- <span
125
- style="position:relative;overflow:hidden;display:block;width:100%;height:100%"
126
- >
127
- <img
128
- {alt}
129
- src={resolvedSrc}
130
- srcset={srcSet}
131
- sizes={resolvedSizes}
132
- loading={resolvedLoading}
133
- class={className}
134
- style={imgStyle}
135
- crossorigin={crossOrigin}
136
- referrerpolicy={referrerPolicy}
137
- fetchpriority={resolvedFetchPriority}
138
- decoding="async"
139
- onload={handleLoad}
140
- onerror={handleError}
141
- />
142
- </span>
143
- {:else}
144
- <img
145
- {alt}
146
- src={resolvedSrc}
147
- srcset={srcSet}
148
- sizes={resolvedSizes}
149
- {width}
150
- {height}
151
- loading={resolvedLoading}
152
- class={className}
153
- style={imgStyle}
154
- crossorigin={crossOrigin}
155
- referrerpolicy={referrerPolicy}
156
- fetchpriority={resolvedFetchPriority}
157
- decoding="async"
158
- onload={handleLoad}
159
- onerror={handleError}
160
- />
161
- {/if}
@@ -1,5 +0,0 @@
1
- import type { ImageProps } from '../../types/image';
2
- import { SvelteComponent } from 'svelte';
3
- declare const __propDef: { props: ImageProps };
4
- type Props = typeof __propDef.props;
5
- export default class Image extends SvelteComponent<Props> {}
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import type { JsonLdSchema, WithContext } from '../../../types/jsonLd';
3
-
4
- let { schema }: { schema: JsonLdSchema | JsonLdSchema[] } = $props();
5
-
6
- const data = $derived<
7
- WithContext<JsonLdSchema> | WithContext<JsonLdSchema>[]
8
- >(
9
- Array.isArray(schema)
10
- ? schema.map((s) => ({
11
- '@context': 'https://schema.org' as const,
12
- ...s
13
- }))
14
- : { '@context': 'https://schema.org' as const, ...schema }
15
- );
16
- </script>
17
-
18
- <svelte:head>
19
- {@html `<script type="application/ld+json">${JSON.stringify(data)}</script>`}
20
- </svelte:head>
@@ -1,2 +0,0 @@
1
- import { SvelteComponent } from 'svelte';
2
- export default class JsonLd extends SvelteComponent {}
@@ -1,186 +0,0 @@
1
- <script setup lang="ts">
2
- import { computed, ref } from 'vue';
3
- import {
4
- DEFAULT_QUALITY,
5
- buildOptimizedUrl,
6
- generateBlurSvg,
7
- generateSrcSet
8
- } from '@absolutejs/absolute/image';
9
-
10
- type ImageLoader = (params: {
11
- src: string;
12
- width: number;
13
- quality: number;
14
- }) => string;
15
-
16
- const props = withDefaults(
17
- defineProps<{
18
- src: string;
19
- alt: string;
20
- width?: number;
21
- height?: number;
22
- fill?: boolean;
23
- quality?: number;
24
- sizes?: string;
25
- loader?: ImageLoader;
26
- unoptimized?: boolean;
27
- loading?: 'lazy' | 'eager';
28
- priority?: boolean;
29
- placeholder?: 'blur' | 'empty' | string;
30
- blurDataURL?: string;
31
- className?: string;
32
- style?: Record<string, string | number>;
33
- onLoad?: (() => void) | ((event: Event) => void);
34
- onError?: (() => void) | ((event: Event) => void);
35
- crossOrigin?: 'anonymous' | 'use-credentials' | '';
36
- referrerPolicy?:
37
- | ''
38
- | 'no-referrer'
39
- | 'no-referrer-when-downgrade'
40
- | 'origin'
41
- | 'origin-when-cross-origin'
42
- | 'same-origin'
43
- | 'strict-origin'
44
- | 'strict-origin-when-cross-origin'
45
- | 'unsafe-url';
46
- fetchPriority?: 'high' | 'low' | 'auto';
47
- overrideSrc?: string;
48
- }>(),
49
- {
50
- quality: DEFAULT_QUALITY,
51
- loading: 'lazy'
52
- }
53
- );
54
-
55
- const blurRemoved = ref(false);
56
-
57
- const resolvedSrc = computed(() => {
58
- if (props.overrideSrc) return props.overrideSrc;
59
- if (props.unoptimized) return props.src;
60
- if (props.loader)
61
- return props.loader({
62
- src: props.src,
63
- width: props.width ?? 0,
64
- quality: props.quality
65
- });
66
- if (!props.width) return buildOptimizedUrl(props.src, 0, props.quality);
67
- return buildOptimizedUrl(props.src, props.width, props.quality);
68
- });
69
-
70
- const srcSet = computed(() =>
71
- props.unoptimized
72
- ? undefined
73
- : generateSrcSet(props.src, props.width, props.sizes)
74
- );
75
-
76
- const resolvedSizes = computed(
77
- () => props.sizes ?? (props.fill ? '100vw' : undefined)
78
- );
79
-
80
- const resolvedLoading = computed(() =>
81
- props.priority ? 'eager' : props.loading
82
- );
83
-
84
- const resolvedFetchPriority = computed(() =>
85
- props.priority ? 'high' : props.fetchPriority
86
- );
87
-
88
- const hasBlur = computed(
89
- () =>
90
- props.placeholder === 'blur' ||
91
- (typeof props.placeholder === 'string' &&
92
- props.placeholder !== 'empty' &&
93
- props.placeholder.startsWith('data:'))
94
- );
95
-
96
- const blurBackground = computed(() => {
97
- if (!hasBlur.value || blurRemoved.value) return undefined;
98
- if (
99
- typeof props.placeholder === 'string' &&
100
- props.placeholder !== 'blur' &&
101
- props.placeholder.startsWith('data:')
102
- ) {
103
- return generateBlurSvg(props.placeholder);
104
- }
105
- if (props.blurDataURL) return generateBlurSvg(props.blurDataURL);
106
- return undefined;
107
- });
108
-
109
- const imgStyle = computed(() => {
110
- const base: Record<string, string | number> = {
111
- ...(props.style ?? {}),
112
- color: 'transparent'
113
- };
114
- if (blurBackground.value) {
115
- base.backgroundImage = blurBackground.value;
116
- base.backgroundSize = 'cover';
117
- base.backgroundPosition = 'center';
118
- base.backgroundRepeat = 'no-repeat';
119
- }
120
- if (props.fill) {
121
- base.position = 'absolute';
122
- base.height = '100%';
123
- base.width = '100%';
124
- base.inset = '0';
125
- base.objectFit = 'cover';
126
- }
127
- return base;
128
- });
129
-
130
- const handleLoad = (e: Event) => {
131
- blurRemoved.value = true;
132
- if (props.onLoad) (props.onLoad as (event: Event) => void)(e);
133
- };
134
-
135
- const handleError = (e: Event) => {
136
- if (props.onError) (props.onError as (event: Event) => void)(e);
137
- };
138
- </script>
139
-
140
- <template>
141
- <span
142
- v-if="fill"
143
- style="
144
- position: relative;
145
- overflow: hidden;
146
- display: block;
147
- width: 100%;
148
- height: 100%;
149
- "
150
- >
151
- <img
152
- :alt="alt"
153
- :src="resolvedSrc"
154
- :srcset="srcSet"
155
- :sizes="resolvedSizes"
156
- :loading="resolvedLoading"
157
- :class="className"
158
- :style="imgStyle"
159
- :crossorigin="crossOrigin"
160
- :referrerpolicy="referrerPolicy"
161
- :fetchpriority="resolvedFetchPriority"
162
- decoding="async"
163
- @load="handleLoad"
164
- @error="handleError"
165
- />
166
- </span>
167
-
168
- <img
169
- v-else
170
- :alt="alt"
171
- :src="resolvedSrc"
172
- :srcset="srcSet"
173
- :sizes="resolvedSizes"
174
- :width="width"
175
- :height="height"
176
- :loading="resolvedLoading"
177
- :class="className"
178
- :style="imgStyle"
179
- :crossorigin="crossOrigin"
180
- :referrerpolicy="referrerPolicy"
181
- :fetchpriority="resolvedFetchPriority"
182
- decoding="async"
183
- @load="handleLoad"
184
- @error="handleError"
185
- />
186
- </template>
@@ -1,4 +0,0 @@
1
- import type { ImageProps } from '../../types/image';
2
- import { DefineComponent } from 'vue';
3
- declare const _default: DefineComponent<ImageProps>;
4
- export default _default;