@unhead/vue 3.0.0-beta.6 → 3.0.0-beta.8
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/client.d.mts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/scripts.d.mts +3 -3
- package/dist/scripts.d.ts +3 -3
- package/dist/scripts.mjs +1 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/shared/{vue.BW2vTlaC.d.mts → vue.9wC_EyGs.d.mts} +23 -15
- package/dist/shared/{vue.BW2vTlaC.d.ts → vue.9wC_EyGs.d.ts} +23 -15
- package/dist/shared/{vue.WuLQR0U8.mjs → vue.BUll6Wuy.mjs} +2 -1
- package/dist/stream/client.d.mts +1 -1
- package/dist/stream/client.d.ts +1 -1
- package/dist/stream/server.d.mts +1 -1
- package/dist/stream/server.d.ts +1 -1
- package/dist/stream/vite.mjs +25 -9
- package/dist/types.d.mts +6 -6
- package/dist/types.d.ts +6 -6
- package/package.json +5 -4
package/dist/client.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { CreateClientHeadOptions } from 'unhead/types';
|
|
|
2
2
|
export { CreateClientHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
4
|
export { renderDOMHead } from 'unhead/client';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from './shared/vue.9wC_EyGs.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
package/dist/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CreateClientHeadOptions } from 'unhead/types';
|
|
|
2
2
|
export { CreateClientHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
4
|
export { renderDOMHead } from 'unhead/client';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from './shared/vue.9wC_EyGs.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: CreateClientHeadOptions): VueHeadClient;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActiveHeadEntry } from 'unhead/types';
|
|
2
|
-
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes,
|
|
3
|
-
import { V as VueHeadClient, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, a as ResolvableProperties, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, R as ResolvableValue } from './shared/vue.
|
|
2
|
+
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
+
import { V as VueHeadClient, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.9wC_EyGs.mjs';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, a as ResolvableProperties, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, R as ResolvableValue } from './shared/vue.9wC_EyGs.mjs';
|
|
5
5
|
import { UseHeadSafeInput } from './types.mjs';
|
|
6
6
|
export { Base, BodyAttributes, HeadSafe, HtmlAttributes, Link, MergeHead, Meta, Noscript, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style } from './types.mjs';
|
|
7
7
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActiveHeadEntry } from 'unhead/types';
|
|
2
|
-
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes,
|
|
3
|
-
import { V as VueHeadClient, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, a as ResolvableProperties, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, R as ResolvableValue } from './shared/vue.
|
|
2
|
+
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
+
import { V as VueHeadClient, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput } from './shared/vue.9wC_EyGs.js';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, a as ResolvableProperties, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, R as ResolvableValue } from './shared/vue.9wC_EyGs.js';
|
|
5
5
|
import { UseHeadSafeInput } from './types.js';
|
|
6
6
|
export { Base, BodyAttributes, HeadSafe, HtmlAttributes, Link, MergeHead, Meta, Noscript, SafeBodyAttr, SafeHtmlAttr, SafeLink, SafeMeta, SafeNoscript, SafeScript, SafeStyle, Script, Style } from './types.js';
|
|
7
7
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { h as headSymbol, i as injectHead, u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/vue.DdPIVN-K.mjs';
|
|
2
2
|
export { V as VueHeadMixin } from './shared/vue.CLCWY4Ey.mjs';
|
|
3
3
|
export { createUnhead } from 'unhead';
|
|
4
|
-
export { u as useScript } from './shared/vue.
|
|
4
|
+
export { u as useScript } from './shared/vue.BUll6Wuy.mjs';
|
|
5
5
|
import 'unhead/plugins';
|
|
6
6
|
import 'unhead/utils';
|
|
7
7
|
import 'vue';
|
package/dist/scripts.d.mts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
|
|
2
2
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
3
|
-
import {
|
|
3
|
+
import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
|
-
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.9wC_EyGs.mjs';
|
|
6
6
|
|
|
7
7
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
8
8
|
status: Ref<UseScriptStatus>;
|
|
9
9
|
}
|
|
10
|
-
type UseScriptInput = string | (ResolvableProperties<Omit<
|
|
10
|
+
type UseScriptInput = string | (ResolvableProperties<Omit<GenericScript & DataKeys & SchemaAugmentations['script'], 'src'>> & {
|
|
11
11
|
src: string;
|
|
12
12
|
});
|
|
13
13
|
interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
|
package/dist/scripts.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { UseScriptOptions as UseScriptOptions$1, ScriptInstance, UseScriptStatus, UseFunctionType } from 'unhead/scripts';
|
|
2
2
|
export { AsVoidFunctions, EventHandlerOptions, RecordingEntry, ScriptInstance, UseFunctionType, UseScriptResolvedInput, UseScriptStatus, WarmupStrategy, createSpyProxy } from 'unhead/scripts';
|
|
3
|
-
import {
|
|
3
|
+
import { GenericScript, DataKeys, SchemaAugmentations, HeadEntryOptions } from 'unhead/types';
|
|
4
4
|
import { Ref } from 'vue';
|
|
5
|
-
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { a as ResolvableProperties, V as VueHeadClient } from './shared/vue.9wC_EyGs.js';
|
|
6
6
|
|
|
7
7
|
interface VueScriptInstance<T extends Record<symbol | string, any>> extends Omit<ScriptInstance<T>, 'status'> {
|
|
8
8
|
status: Ref<UseScriptStatus>;
|
|
9
9
|
}
|
|
10
|
-
type UseScriptInput = string | (ResolvableProperties<Omit<
|
|
10
|
+
type UseScriptInput = string | (ResolvableProperties<Omit<GenericScript & DataKeys & SchemaAugmentations['script'], 'src'>> & {
|
|
11
11
|
src: string;
|
|
12
12
|
});
|
|
13
13
|
interface UseScriptOptions<T extends Record<symbol | string, any> = Record<string, any>> extends Omit<HeadEntryOptions, 'head'>, Pick<UseScriptOptions$1<T>, 'use' | 'eventContext' | 'beforeInit'> {
|
package/dist/scripts.mjs
CHANGED
package/dist/server.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { CreateServerHeadOptions } from 'unhead/types';
|
|
|
2
2
|
export { CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.mjs';
|
|
4
4
|
export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from './shared/vue.9wC_EyGs.mjs';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient;
|
package/dist/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { CreateServerHeadOptions } from 'unhead/types';
|
|
|
2
2
|
export { CreateServerHeadOptions } from 'unhead/types';
|
|
3
3
|
export { V as VueHeadMixin } from './shared/vue.DnywREVF.js';
|
|
4
4
|
export { SSRHeadPayload, propsToString, renderSSRHead, transformHtmlTemplate } from 'unhead/server';
|
|
5
|
-
import { V as VueHeadClient } from './shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from './shared/vue.9wC_EyGs.js';
|
|
6
6
|
import 'vue';
|
|
7
7
|
|
|
8
8
|
declare function createHead(options?: Omit<CreateServerHeadOptions, 'propsResolver'>): VueHeadClient;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base,
|
|
1
|
+
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions, MetaFlat } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Falsy = false | null | undefined;
|
|
5
5
|
type MaybeFalsy<T> = T | Falsy;
|
|
6
6
|
type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
|
|
7
7
|
type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
|
|
8
|
-
type
|
|
9
|
-
[
|
|
8
|
+
type Prettify<T> = {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} & {};
|
|
11
|
+
type _ResolvablePropertiesRaw<T> = {
|
|
12
|
+
[K in keyof T as {} extends Pick<T, K> ? never : K]: ResolvableValue<T[K]>;
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T as {} extends Pick<T, K> ? K : never]?: ResolvableValue<T[K]>;
|
|
10
15
|
};
|
|
16
|
+
type ResolvableProperties<T> = Prettify<_ResolvablePropertiesRaw<T>>;
|
|
11
17
|
type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
|
|
12
18
|
type DeepResolvableProperties<T> = {
|
|
13
19
|
[K in keyof T]?: T[K] extends string | object ? T[K] extends string ? ResolvableUnion<T[K]> : T[K] extends object ? DeepResolvableProperties<T[K]> : ResolvableUnion<T[K]> : ResolvableUnion<T[K]>;
|
|
@@ -19,11 +25,11 @@ interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
|
|
|
19
25
|
*
|
|
20
26
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
21
27
|
*/
|
|
22
|
-
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<
|
|
28
|
+
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
|
|
23
29
|
/**
|
|
24
|
-
* The
|
|
30
|
+
* The style attribute contains CSS styling declarations to be applied to the element.
|
|
25
31
|
*
|
|
26
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/
|
|
32
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
|
|
27
33
|
*/
|
|
28
34
|
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
|
|
29
35
|
}
|
|
@@ -33,23 +39,25 @@ interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'>
|
|
|
33
39
|
*
|
|
34
40
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
35
41
|
*/
|
|
36
|
-
class?: MaybeArray<ResolvableValue<Stringable
|
|
42
|
+
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
|
|
37
43
|
/**
|
|
38
|
-
* The
|
|
44
|
+
* The style attribute contains CSS styling declarations to be applied to the element.
|
|
39
45
|
*
|
|
40
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/
|
|
46
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
|
|
41
47
|
*/
|
|
42
|
-
style?: MaybeArray<ResolvableValue<
|
|
48
|
+
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
|
|
43
49
|
}
|
|
44
50
|
type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
|
|
45
51
|
textContent: Stringable;
|
|
46
52
|
} & SchemaAugmentations['title'])>;
|
|
47
53
|
type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
|
|
48
|
-
type ResolvableBase =
|
|
49
|
-
type
|
|
50
|
-
type
|
|
54
|
+
type ResolvableBase = DistributeResolvable<Base, SchemaAugmentations['base']>;
|
|
55
|
+
type DistributeResolvable<T, Aug> = T extends any ? ResolvableProperties<T & Aug> : never;
|
|
56
|
+
type DistributeResolvableWithEvents<T, Aug, Events> = T extends any ? T extends Events ? ResolvableProperties<Omit<T, keyof Events> & Aug> & MaybeEventFnHandlers<Events> : ResolvableProperties<T & Aug> : never;
|
|
57
|
+
type ResolvableLink = DistributeResolvableWithEvents<Link, SchemaAugmentations['link'], LinkHttpEvents>;
|
|
58
|
+
type ResolvableMeta = DistributeResolvable<UnheadMeta, SchemaAugmentations['meta']>;
|
|
51
59
|
type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
|
|
52
|
-
type ResolvableScript =
|
|
60
|
+
type ResolvableScript = DistributeResolvableWithEvents<Script, SchemaAugmentations['script'], ScriptHttpEvents>;
|
|
53
61
|
type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
|
|
54
62
|
type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
55
63
|
type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
|
|
@@ -128,7 +136,7 @@ interface ReactiveHead {
|
|
|
128
136
|
type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
|
|
129
137
|
head?: VueHeadClient<any>;
|
|
130
138
|
};
|
|
131
|
-
type UseHeadInput<
|
|
139
|
+
type UseHeadInput<_Deprecated = never> = ResolvableValue<ReactiveHead>;
|
|
132
140
|
type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
|
|
133
141
|
title?: ReactiveHead['title'];
|
|
134
142
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base,
|
|
1
|
+
import { Stringable, SchemaAugmentations, ResolvableTitleTemplate as ResolvableTitleTemplate$1, Base, MaybeEventFnHandlers, Link, LinkHttpEvents, UnheadMeta, Style, DataKeys, Script, ScriptHttpEvents, Noscript, HtmlAttributes, MaybeArray, BodyAttributesWithoutEvents, BodyEvents, Unhead, HeadEntryOptions, MetaFlat } from 'unhead/types';
|
|
2
2
|
import { ComputedRef, Ref, CSSProperties, Plugin } from 'vue';
|
|
3
3
|
|
|
4
4
|
type Falsy = false | null | undefined;
|
|
5
5
|
type MaybeFalsy<T> = T | Falsy;
|
|
6
6
|
type ResolvableValue<T> = MaybeFalsy<T> | (() => MaybeFalsy<T>) | ComputedRef<MaybeFalsy<T>> | Ref<MaybeFalsy<T>>;
|
|
7
7
|
type ResolvableArray<T> = ResolvableValue<ResolvableValue<T>[]>;
|
|
8
|
-
type
|
|
9
|
-
[
|
|
8
|
+
type Prettify<T> = {
|
|
9
|
+
[K in keyof T]: T[K];
|
|
10
|
+
} & {};
|
|
11
|
+
type _ResolvablePropertiesRaw<T> = {
|
|
12
|
+
[K in keyof T as {} extends Pick<T, K> ? never : K]: ResolvableValue<T[K]>;
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T as {} extends Pick<T, K> ? K : never]?: ResolvableValue<T[K]>;
|
|
10
15
|
};
|
|
16
|
+
type ResolvableProperties<T> = Prettify<_ResolvablePropertiesRaw<T>>;
|
|
11
17
|
type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
|
|
12
18
|
type DeepResolvableProperties<T> = {
|
|
13
19
|
[K in keyof T]?: T[K] extends string | object ? T[K] extends string ? ResolvableUnion<T[K]> : T[K] extends object ? DeepResolvableProperties<T[K]> : ResolvableUnion<T[K]> : ResolvableUnion<T[K]>;
|
|
@@ -19,11 +25,11 @@ interface HtmlAttr extends Omit<HtmlAttributes, 'class' | 'style'> {
|
|
|
19
25
|
*
|
|
20
26
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
21
27
|
*/
|
|
22
|
-
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<
|
|
28
|
+
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
|
|
23
29
|
/**
|
|
24
|
-
* The
|
|
30
|
+
* The style attribute contains CSS styling declarations to be applied to the element.
|
|
25
31
|
*
|
|
26
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/
|
|
32
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
|
|
27
33
|
*/
|
|
28
34
|
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
|
|
29
35
|
}
|
|
@@ -33,23 +39,25 @@ interface BodyAttr extends Omit<BodyAttributesWithoutEvents, 'class' | 'style'>
|
|
|
33
39
|
*
|
|
34
40
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/class
|
|
35
41
|
*/
|
|
36
|
-
class?: MaybeArray<ResolvableValue<Stringable
|
|
42
|
+
class?: MaybeArray<ResolvableValue<Stringable> | Record<string, ResolvableValue<boolean>>>;
|
|
37
43
|
/**
|
|
38
|
-
* The
|
|
44
|
+
* The style attribute contains CSS styling declarations to be applied to the element.
|
|
39
45
|
*
|
|
40
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/
|
|
46
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style
|
|
41
47
|
*/
|
|
42
|
-
style?: MaybeArray<ResolvableValue<
|
|
48
|
+
style?: MaybeArray<ResolvableValue<Stringable> | ResolvableProperties<CSSProperties>>;
|
|
43
49
|
}
|
|
44
50
|
type ResolvableTitle = ResolvableValue<Stringable> | ResolvableProperties<({
|
|
45
51
|
textContent: Stringable;
|
|
46
52
|
} & SchemaAugmentations['title'])>;
|
|
47
53
|
type ResolvableTitleTemplate = ResolvableTitleTemplate$1 | Ref<string>;
|
|
48
|
-
type ResolvableBase =
|
|
49
|
-
type
|
|
50
|
-
type
|
|
54
|
+
type ResolvableBase = DistributeResolvable<Base, SchemaAugmentations['base']>;
|
|
55
|
+
type DistributeResolvable<T, Aug> = T extends any ? ResolvableProperties<T & Aug> : never;
|
|
56
|
+
type DistributeResolvableWithEvents<T, Aug, Events> = T extends any ? T extends Events ? ResolvableProperties<Omit<T, keyof Events> & Aug> & MaybeEventFnHandlers<Events> : ResolvableProperties<T & Aug> : never;
|
|
57
|
+
type ResolvableLink = DistributeResolvableWithEvents<Link, SchemaAugmentations['link'], LinkHttpEvents>;
|
|
58
|
+
type ResolvableMeta = DistributeResolvable<UnheadMeta, SchemaAugmentations['meta']>;
|
|
51
59
|
type ResolvableStyle = ResolvableProperties<Style & DataKeys & SchemaAugmentations['style']>;
|
|
52
|
-
type ResolvableScript =
|
|
60
|
+
type ResolvableScript = DistributeResolvableWithEvents<Script, SchemaAugmentations['script'], ScriptHttpEvents>;
|
|
53
61
|
type ResolvableNoscript = ResolvableProperties<Noscript & DataKeys & SchemaAugmentations['noscript']>;
|
|
54
62
|
type ResolvableHtmlAttributes = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
55
63
|
type ResolvableBodyAttributes = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents>;
|
|
@@ -128,7 +136,7 @@ interface ReactiveHead {
|
|
|
128
136
|
type UseHeadOptions = Omit<HeadEntryOptions, 'head'> & {
|
|
129
137
|
head?: VueHeadClient<any>;
|
|
130
138
|
};
|
|
131
|
-
type UseHeadInput<
|
|
139
|
+
type UseHeadInput<_Deprecated = never> = ResolvableValue<ReactiveHead>;
|
|
132
140
|
type UseSeoMetaInput = ResolvableProperties<MetaFlat> & {
|
|
133
141
|
title?: ReactiveHead['title'];
|
|
134
142
|
titleTemplate?: ReactiveHead['titleTemplate'];
|
|
@@ -24,8 +24,9 @@ function registerVueScopeHandlers(script, scope) {
|
|
|
24
24
|
};
|
|
25
25
|
script.onLoaded = (cb) => _registerCb("loaded", cb);
|
|
26
26
|
script.onError = (cb) => _registerCb("error", cb);
|
|
27
|
+
const triggerAbortController = script._triggerAbortController;
|
|
27
28
|
onScopeDispose(() => {
|
|
28
|
-
|
|
29
|
+
triggerAbortController?.abort();
|
|
29
30
|
});
|
|
30
31
|
}
|
|
31
32
|
function useScript(_input, _options) {
|
package/dist/stream/client.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { CreateStreamableClientHeadOptions } from 'unhead/stream/client';
|
|
3
3
|
export { CreateStreamableClientHeadOptions, UnheadStreamQueue } from 'unhead/stream/client';
|
|
4
4
|
export { V as VueHeadMixin } from '../shared/vue.DnywREVF.mjs';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.9wC_EyGs.mjs';
|
|
6
6
|
import 'unhead/types';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/stream/client.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { CreateStreamableClientHeadOptions } from 'unhead/stream/client';
|
|
3
3
|
export { CreateStreamableClientHeadOptions, UnheadStreamQueue } from 'unhead/stream/client';
|
|
4
4
|
export { V as VueHeadMixin } from '../shared/vue.DnywREVF.js';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.9wC_EyGs.js';
|
|
6
6
|
import 'unhead/types';
|
|
7
7
|
|
|
8
8
|
/**
|
package/dist/stream/server.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { WebStreamableHeadContext } from 'unhead/stream/server';
|
|
3
3
|
export { CreateStreamableServerHeadOptions, StreamingTemplateParts, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
4
4
|
import { ResolvableHead, CreateStreamableServerHeadOptions } from 'unhead/types';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.9wC_EyGs.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Streaming script component - outputs inline script with current head state.
|
package/dist/stream/server.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as vue from 'vue';
|
|
|
2
2
|
import { WebStreamableHeadContext } from 'unhead/stream/server';
|
|
3
3
|
export { CreateStreamableServerHeadOptions, StreamingTemplateParts, prepareStreamingTemplate, renderSSRHeadShell, renderSSRHeadSuspenseChunk, wrapStream } from 'unhead/stream/server';
|
|
4
4
|
import { ResolvableHead, CreateStreamableServerHeadOptions } from 'unhead/types';
|
|
5
|
-
import { V as VueHeadClient } from '../shared/vue.
|
|
5
|
+
import { V as VueHeadClient } from '../shared/vue.9wC_EyGs.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Streaming script component - outputs inline script with current head state.
|
package/dist/stream/vite.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import MagicString from 'magic-string';
|
|
2
|
-
import {
|
|
2
|
+
import { parseAndWalk } from 'oxc-walker';
|
|
3
3
|
import { createStreamingPlugin } from 'unhead/stream/vite';
|
|
4
4
|
|
|
5
5
|
function transform(code, id, isSSR, s) {
|
|
@@ -15,13 +15,30 @@ function transform(code, id, isSSR, s) {
|
|
|
15
15
|
if (!scriptMatch)
|
|
16
16
|
return true;
|
|
17
17
|
const scriptEnd = scriptMatch.index + scriptMatch[0].length;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const scriptCloseIndex = code.indexOf("<\/script>", scriptEnd);
|
|
19
|
+
if (scriptCloseIndex === -1)
|
|
20
|
+
return true;
|
|
21
|
+
const scriptContent = code.slice(scriptEnd, scriptCloseIndex);
|
|
22
|
+
let existingImport = null;
|
|
23
|
+
parseAndWalk(scriptContent, id, {
|
|
24
|
+
parseOptions: { lang: "ts" },
|
|
25
|
+
enter(node) {
|
|
26
|
+
if (node.type === "ImportDeclaration" && node.source.value === importPath) {
|
|
27
|
+
existingImport = {
|
|
28
|
+
start: scriptEnd + node.start,
|
|
29
|
+
end: scriptEnd + node.end,
|
|
30
|
+
specifiers: node.specifiers?.map((spec) => spec.local?.name).filter(Boolean) || []
|
|
31
|
+
};
|
|
32
|
+
this.skip();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const foundImport = existingImport;
|
|
37
|
+
if (foundImport) {
|
|
38
|
+
if (!foundImport.specifiers.includes("HeadStream")) {
|
|
39
|
+
const inner = foundImport.specifiers.join(", ");
|
|
23
40
|
const newImports = inner ? `${inner}, HeadStream` : "HeadStream";
|
|
24
|
-
s.overwrite(
|
|
41
|
+
s.overwrite(foundImport.start, foundImport.end, `import { ${newImports} } from '${importPath}'
|
|
25
42
|
`);
|
|
26
43
|
}
|
|
27
44
|
} else {
|
|
@@ -33,10 +50,9 @@ import { HeadStream } from '${importPath}'`);
|
|
|
33
50
|
function unheadVuePlugin(options) {
|
|
34
51
|
return createStreamingPlugin({
|
|
35
52
|
framework: "@unhead/vue",
|
|
53
|
+
filter: /\.vue$/,
|
|
36
54
|
mode: options?.mode,
|
|
37
55
|
transform(code, id, opts) {
|
|
38
|
-
if (!/\.vue$/.test(id))
|
|
39
|
-
return null;
|
|
40
56
|
const s = new MagicString(code);
|
|
41
57
|
if (!transform(code, id, opts?.ssr ?? false, s))
|
|
42
58
|
return null;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ResolvableHead,
|
|
2
|
-
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes,
|
|
3
|
-
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.
|
|
1
|
+
import { ResolvableHead, GenericLink, DataKeys, SchemaAugmentations, MetaGeneric, Style as Style$1, GenericScript, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript as Noscript$1, HtmlAttributes as HtmlAttributes$1, BodyAttributesWithoutEvents, RawInput } from 'unhead/types';
|
|
2
|
+
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
+
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.9wC_EyGs.mjs';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.9wC_EyGs.mjs';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
7
|
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
|
8
8
|
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes$1, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
9
9
|
type SafeMeta = ResolvableProperties<Pick<MetaGeneric, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
|
10
|
-
type SafeLink = ResolvableProperties<Pick<
|
|
11
|
-
type SafeScript = ResolvableProperties<Pick<
|
|
10
|
+
type SafeLink = ResolvableProperties<Pick<GenericLink, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
|
11
|
+
type SafeScript = ResolvableProperties<Pick<GenericScript, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
|
|
12
12
|
textContent?: string;
|
|
13
13
|
} & TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams>;
|
|
14
14
|
type SafeNoscript = ResolvableProperties<Pick<Noscript$1, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ResolvableHead,
|
|
2
|
-
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes,
|
|
3
|
-
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.
|
|
4
|
-
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.
|
|
1
|
+
import { ResolvableHead, GenericLink, DataKeys, SchemaAugmentations, MetaGeneric, Style as Style$1, GenericScript, TagPriority, TagPosition, ResolvesDuplicates, ProcessesTemplateParams, Noscript as Noscript$1, HtmlAttributes as HtmlAttributes$1, BodyAttributesWithoutEvents, RawInput } from 'unhead/types';
|
|
2
|
+
export { ActiveHeadEntry, AriaAttributes, BodyAttributesWithoutEvents, BodyEvents, DataKeys, GenericLink, GenericScript, GlobalAttributes, HeadEntryOptions, HeadTag, HttpEventAttributes, MetaFlat, MetaFlat as MetaFlatInput, RawInput, RenderSSRHeadOptions, ResolvableHead, SerializableHead, SpeculationRules, Unhead } from 'unhead/types';
|
|
3
|
+
import { R as ResolvableValue, a as ResolvableProperties } from './shared/vue.9wC_EyGs.js';
|
|
4
|
+
export { B as BodyAttr, D as DeepResolvableProperties, b as Head, H as HtmlAttr, M as MaybeFalsy, b as ReactiveHead, o as ResolvableArray, e as ResolvableBase, l as ResolvableBodyAttributes, k as ResolvableHtmlAttributes, f as ResolvableLink, g as ResolvableMeta, j as ResolvableNoscript, i as ResolvableScript, h as ResolvableStyle, c as ResolvableTitle, d as ResolvableTitleTemplate, p as ResolvableUnion, m as UseHeadInput, U as UseHeadOptions, n as UseSeoMetaInput, V as VueHeadClient } from './shared/vue.9wC_EyGs.js';
|
|
5
5
|
import 'vue';
|
|
6
6
|
|
|
7
7
|
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributesWithoutEvents, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
|
8
8
|
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes$1, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
9
9
|
type SafeMeta = ResolvableProperties<Pick<MetaGeneric, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
|
10
|
-
type SafeLink = ResolvableProperties<Pick<
|
|
11
|
-
type SafeScript = ResolvableProperties<Pick<
|
|
10
|
+
type SafeLink = ResolvableProperties<Pick<GenericLink, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
|
11
|
+
type SafeScript = ResolvableProperties<Pick<GenericScript, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
|
|
12
12
|
textContent?: string;
|
|
13
13
|
} & TagPriority & TagPosition & ResolvesDuplicates & ProcessesTemplateParams>;
|
|
14
14
|
type SafeNoscript = ResolvableProperties<Pick<Noscript$1, 'id'> & DataKeys & Omit<SchemaAugmentations['noscript'], 'innerHTML'>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.8",
|
|
5
5
|
"description": "Full-stack <head> manager built for Vue.",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -124,12 +124,13 @@
|
|
|
124
124
|
"dependencies": {
|
|
125
125
|
"hookable": "^6.0.1",
|
|
126
126
|
"magic-string": "^0.30.21",
|
|
127
|
-
"
|
|
128
|
-
"
|
|
127
|
+
"oxc-parser": "^0.106.0",
|
|
128
|
+
"oxc-walker": "^0.7.0",
|
|
129
|
+
"unhead": "3.0.0-beta.8"
|
|
129
130
|
},
|
|
130
131
|
"devDependencies": {
|
|
131
132
|
"@vue/server-renderer": "^3.5.26",
|
|
132
|
-
"vite": "7.2.2",
|
|
133
|
+
"vite": "^7.2.2",
|
|
133
134
|
"vue": "^3.5.26"
|
|
134
135
|
},
|
|
135
136
|
"scripts": {
|