unhead 2.0.0-alpha.25 → 2.0.0-alpha.27
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 +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.mjs +2 -2
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.mjs +3 -3
- package/dist/legacy.d.mts +7 -5
- package/dist/legacy.d.ts +7 -5
- package/dist/legacy.mjs +9 -8
- package/dist/plugins.d.mts +8 -5
- package/dist/plugins.d.ts +8 -5
- package/dist/plugins.mjs +4 -4
- 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 +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.mjs +2 -2
- package/dist/shared/{unhead.CG0hxuzW.mjs → unhead.BHfOzKG2.mjs} +3 -2
- package/dist/shared/{unhead.H9K4hNc3.d.mts → unhead.BNvCtqZe.d.mts} +96 -84
- package/dist/shared/{unhead.H9K4hNc3.d.ts → unhead.BNvCtqZe.d.ts} +96 -84
- package/dist/shared/{unhead.CYOiVxYm.d.ts → unhead.BVMY7T4L.d.ts} +1 -1
- package/dist/shared/{unhead.D5hDM0h5.d.mts → unhead.C7wPKDIu.d.mts} +1 -1
- package/dist/shared/{unhead.kC9yNSGl.mjs → unhead.CydFxwlU.mjs} +8 -5
- package/dist/shared/{unhead.PEkM8z0l.mjs → unhead.DDkQzRDt.mjs} +2 -2
- package/dist/shared/{unhead.CMEjo4Tf.d.mts → unhead.DVa9RUZi.d.mts} +1 -1
- package/dist/shared/{unhead.Dl6vXegp.mjs → unhead.DaDcnCjk.mjs} +1 -1
- package/dist/shared/{unhead.f-vxWgdH.d.ts → unhead.DwaxOn3-.d.ts} +1 -1
- package/dist/shared/{unhead.CnbCxOp9.mjs → unhead.kVuXtrDW.mjs} +1 -1
- package/dist/types.d.mts +53 -3
- package/dist/types.d.ts +53 -3
- package/dist/utils.d.mts +2 -2
- package/dist/utils.d.ts +2 -2
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { al as ResolvableHead, o as CreateClientHeadOptions, q as Unhead, B as RenderDomHeadOptions } from './shared/unhead.BNvCtqZe.mjs';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
|
|
4
4
|
declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOptions): Unhead<T>;
|
|
@@ -6,7 +6,7 @@ declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOption
|
|
|
6
6
|
/**
|
|
7
7
|
* Render the head tags to the DOM.
|
|
8
8
|
*/
|
|
9
|
-
declare function renderDOMHead(head:
|
|
9
|
+
declare function renderDOMHead<T extends Unhead<unknown>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
|
|
10
10
|
|
|
11
11
|
declare function createDebouncedFn(callee: () => void, delayer: (fn: () => void) => void): () => void;
|
|
12
12
|
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { al as ResolvableHead, o as CreateClientHeadOptions, q as Unhead, B as RenderDomHeadOptions } from './shared/unhead.BNvCtqZe.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
|
|
4
4
|
declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOptions): Unhead<T>;
|
|
@@ -6,7 +6,7 @@ declare function createHead<T = ResolvableHead>(options?: CreateClientHeadOption
|
|
|
6
6
|
/**
|
|
7
7
|
* Render the head tags to the DOM.
|
|
8
8
|
*/
|
|
9
|
-
declare function renderDOMHead(head:
|
|
9
|
+
declare function renderDOMHead<T extends Unhead<unknown>>(head: T, options?: RenderDomHeadOptions): Promise<void>;
|
|
10
10
|
|
|
11
11
|
declare function createDebouncedFn(callee: () => void, delayer: (fn: () => void) => void): () => void;
|
|
12
12
|
|
package/dist/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
|
|
2
2
|
import { H as HasElementTags } from './shared/unhead.yem5I2v_.mjs';
|
|
3
3
|
import { h as hashTag, i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey } from './shared/unhead.xsi8MZXD.mjs';
|
|
4
4
|
import 'hookable';
|
|
@@ -184,7 +184,7 @@ async function renderDOMHead(head, options = {}) {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
function createHead(options = {}) {
|
|
187
|
-
const head =
|
|
187
|
+
const head = createUnhead({
|
|
188
188
|
document: typeof window !== "undefined" ? document : void 0,
|
|
189
189
|
...options
|
|
190
190
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { H as HeadSafe } from './shared/unhead.
|
|
2
|
-
import {
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { H as HeadSafe } from './shared/unhead.C7wPKDIu.mjs';
|
|
2
|
+
import { q as Unhead, al as ResolvableHead, p as HeadEntryOptions, m as ActiveHeadEntry, aq as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.BNvCtqZe.mjs';
|
|
3
|
+
export { u as useScript } from './shared/unhead.DVa9RUZi.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
|
-
declare function useHead<T extends Unhead<any
|
|
6
|
+
declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: I, options?: HeadEntryOptions): ActiveHeadEntry<I>;
|
|
7
7
|
declare function useHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
|
|
8
8
|
declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
9
9
|
/**
|
|
@@ -19,10 +19,14 @@ declare function useServerHeadSafe<T extends Unhead<any>>(unhead: T, input?: Hea
|
|
|
19
19
|
*/
|
|
20
20
|
declare function useServerSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: Omit<HeadEntryOptions, 'mode'>): ActiveHeadEntry<UseSeoMetaInput>;
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated use `createUnhead` instead
|
|
24
|
+
*/
|
|
25
|
+
declare function createHeadCore<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
|
22
26
|
/**
|
|
23
27
|
* Creates a core instance of unhead. Does not provide a global ctx for composables to work
|
|
24
28
|
* and does not register DOM plugins.
|
|
25
29
|
*/
|
|
26
|
-
declare function
|
|
30
|
+
declare function createUnhead<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
|
27
31
|
|
|
28
|
-
export { createHeadCore, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
32
|
+
export { createHeadCore, createUnhead, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { H as HeadSafe } from './shared/unhead.
|
|
2
|
-
import {
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { H as HeadSafe } from './shared/unhead.BVMY7T4L.js';
|
|
2
|
+
import { q as Unhead, al as ResolvableHead, p as HeadEntryOptions, m as ActiveHeadEntry, aq as UseSeoMetaInput, C as CreateHeadOptions } from './shared/unhead.BNvCtqZe.js';
|
|
3
|
+
export { u as useScript } from './shared/unhead.DwaxOn3-.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
|
-
declare function useHead<T extends Unhead<any
|
|
6
|
+
declare function useHead<T extends Unhead<any>, I = ResolvableHead>(unhead: T, input?: I, options?: HeadEntryOptions): ActiveHeadEntry<I>;
|
|
7
7
|
declare function useHeadSafe<T extends Unhead<any>>(unhead: T, input?: HeadSafe, options?: HeadEntryOptions): ActiveHeadEntry<HeadSafe>;
|
|
8
8
|
declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: HeadEntryOptions): ActiveHeadEntry<UseSeoMetaInput>;
|
|
9
9
|
/**
|
|
@@ -19,10 +19,14 @@ declare function useServerHeadSafe<T extends Unhead<any>>(unhead: T, input?: Hea
|
|
|
19
19
|
*/
|
|
20
20
|
declare function useServerSeoMeta<T extends Unhead<any>>(unhead: T, input?: UseSeoMetaInput, options?: Omit<HeadEntryOptions, 'mode'>): ActiveHeadEntry<UseSeoMetaInput>;
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated use `createUnhead` instead
|
|
24
|
+
*/
|
|
25
|
+
declare function createHeadCore<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
|
22
26
|
/**
|
|
23
27
|
* Creates a core instance of unhead. Does not provide a global ctx for composables to work
|
|
24
28
|
* and does not register DOM plugins.
|
|
25
29
|
*/
|
|
26
|
-
declare function
|
|
30
|
+
declare function createUnhead<T = ResolvableHead>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
|
27
31
|
|
|
28
|
-
export { createHeadCore, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
|
32
|
+
export { createHeadCore, createUnhead, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.
|
|
2
|
-
export { c as createHeadCore } from './shared/unhead.
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.DDkQzRDt.mjs';
|
|
2
|
+
export { c as createHeadCore, a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
|
|
3
|
+
export { u as useScript } from './shared/unhead.BHfOzKG2.mjs';
|
|
4
4
|
import './shared/unhead.z5bPaiJg.mjs';
|
|
5
5
|
import './shared/unhead.DFwCX-QT.mjs';
|
|
6
6
|
import './shared/unhead.yem5I2v_.mjs';
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createUnhead } from './index.mjs';
|
|
2
|
+
export { useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './index.mjs';
|
|
3
|
+
import { q as Unhead, al as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.BNvCtqZe.mjs';
|
|
4
|
+
export { u as useScript } from './shared/unhead.DVa9RUZi.mjs';
|
|
5
|
+
import './shared/unhead.C7wPKDIu.mjs';
|
|
5
6
|
import 'hookable';
|
|
6
7
|
|
|
7
8
|
declare const activeHead: {
|
|
@@ -10,5 +11,6 @@ declare const activeHead: {
|
|
|
10
11
|
declare function getActiveHead(): Unhead<any> | null;
|
|
11
12
|
declare function createServerHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
|
12
13
|
declare function createHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
|
14
|
+
declare const createHeadCore: typeof createUnhead;
|
|
13
15
|
|
|
14
|
-
export { activeHead, createHead, createServerHead, getActiveHead };
|
|
16
|
+
export { activeHead, createHead, createHeadCore, createServerHead, createUnhead, getActiveHead };
|
package/dist/legacy.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createUnhead } from './index.js';
|
|
2
|
+
export { useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './index.js';
|
|
3
|
+
import { q as Unhead, al as ResolvableHead, C as CreateHeadOptions } from './shared/unhead.BNvCtqZe.js';
|
|
4
|
+
export { u as useScript } from './shared/unhead.DwaxOn3-.js';
|
|
5
|
+
import './shared/unhead.BVMY7T4L.js';
|
|
5
6
|
import 'hookable';
|
|
6
7
|
|
|
7
8
|
declare const activeHead: {
|
|
@@ -10,5 +11,6 @@ declare const activeHead: {
|
|
|
10
11
|
declare function getActiveHead(): Unhead<any> | null;
|
|
11
12
|
declare function createServerHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
|
12
13
|
declare function createHead<T extends Record<string, any> = ResolvableHead>(options?: CreateHeadOptions): Unhead<T>;
|
|
14
|
+
declare const createHeadCore: typeof createUnhead;
|
|
13
15
|
|
|
14
|
-
export { activeHead, createHead, createServerHead, getActiveHead };
|
|
16
|
+
export { activeHead, createHead, createHeadCore, createServerHead, createUnhead, getActiveHead };
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.
|
|
3
|
-
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.
|
|
4
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
|
|
2
|
+
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.DaDcnCjk.mjs';
|
|
3
|
+
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.DDkQzRDt.mjs';
|
|
4
|
+
export { u as useScript } from './shared/unhead.BHfOzKG2.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
import './shared/unhead.xsi8MZXD.mjs';
|
|
7
7
|
import './shared/unhead.yem5I2v_.mjs';
|
|
8
8
|
import './shared/unhead.DZbvapt-.mjs';
|
|
9
9
|
import './shared/unhead.z5bPaiJg.mjs';
|
|
10
10
|
import './shared/unhead.DFwCX-QT.mjs';
|
|
11
|
-
import './shared/unhead.
|
|
11
|
+
import './shared/unhead.kVuXtrDW.mjs';
|
|
12
12
|
|
|
13
13
|
const activeHead = { value: null };
|
|
14
14
|
function getActiveHead() {
|
|
15
15
|
return activeHead?.value;
|
|
16
16
|
}
|
|
17
17
|
function createServerHead(options = {}) {
|
|
18
|
-
return activeHead.value =
|
|
18
|
+
return activeHead.value = createUnhead({
|
|
19
19
|
disableCapoSorting: true,
|
|
20
20
|
...options,
|
|
21
21
|
// @ts-expect-error untyped
|
|
@@ -30,7 +30,7 @@ function createServerHead(options = {}) {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
function createHead(options = {}) {
|
|
33
|
-
return activeHead.value =
|
|
33
|
+
return activeHead.value = createUnhead({
|
|
34
34
|
disableCapoSorting: true,
|
|
35
35
|
...options,
|
|
36
36
|
plugins: [
|
|
@@ -42,5 +42,6 @@ function createHead(options = {}) {
|
|
|
42
42
|
]
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
const createHeadCore = createUnhead;
|
|
45
46
|
|
|
46
|
-
export { activeHead, createHead, createHeadCore, createServerHead, getActiveHead };
|
|
47
|
+
export { activeHead, createHead, createHeadCore, createServerHead, createUnhead, getActiveHead };
|
package/dist/plugins.d.mts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as HeadPluginInput, q as Unhead, j as HeadPluginOptions } from './shared/unhead.BNvCtqZe.mjs';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
|
|
4
4
|
declare const AliasSortingPlugin: HeadPluginInput;
|
|
5
5
|
|
|
6
|
+
interface CanonicalPluginOptions {
|
|
7
|
+
canonicalHost?: string;
|
|
8
|
+
customResolver?: (url: string) => string;
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* CanonicalPlugin resolves paths in tags that require a canonical host to be set.
|
|
8
12
|
*
|
|
@@ -20,10 +24,9 @@ declare const AliasSortingPlugin: HeadPluginInput;
|
|
|
20
24
|
* // to:
|
|
21
25
|
* // <meta property="og:image" content="https://example.com/image.jpg">
|
|
22
26
|
*/
|
|
23
|
-
declare function CanonicalPlugin(options: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}): HeadPluginInput;
|
|
27
|
+
declare function CanonicalPlugin(options: CanonicalPluginOptions): ((head: Unhead) => HeadPluginOptions & {
|
|
28
|
+
key: string;
|
|
29
|
+
});
|
|
27
30
|
|
|
28
31
|
declare function defineHeadPlugin(plugin: HeadPluginInput): HeadPluginInput;
|
|
29
32
|
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as HeadPluginInput, q as Unhead, j as HeadPluginOptions } from './shared/unhead.BNvCtqZe.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
|
|
4
4
|
declare const AliasSortingPlugin: HeadPluginInput;
|
|
5
5
|
|
|
6
|
+
interface CanonicalPluginOptions {
|
|
7
|
+
canonicalHost?: string;
|
|
8
|
+
customResolver?: (url: string) => string;
|
|
9
|
+
}
|
|
6
10
|
/**
|
|
7
11
|
* CanonicalPlugin resolves paths in tags that require a canonical host to be set.
|
|
8
12
|
*
|
|
@@ -20,10 +24,9 @@ declare const AliasSortingPlugin: HeadPluginInput;
|
|
|
20
24
|
* // to:
|
|
21
25
|
* // <meta property="og:image" content="https://example.com/image.jpg">
|
|
22
26
|
*/
|
|
23
|
-
declare function CanonicalPlugin(options: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}): HeadPluginInput;
|
|
27
|
+
declare function CanonicalPlugin(options: CanonicalPluginOptions): ((head: Unhead) => HeadPluginOptions & {
|
|
28
|
+
key: string;
|
|
29
|
+
});
|
|
27
30
|
|
|
28
31
|
declare function defineHeadPlugin(plugin: HeadPluginInput): HeadPluginInput;
|
|
29
32
|
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.
|
|
1
|
+
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.DaDcnCjk.mjs';
|
|
2
2
|
import { d as defineHeadPlugin } from './shared/unhead.z5bPaiJg.mjs';
|
|
3
3
|
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.z5bPaiJg.mjs';
|
|
4
4
|
import './shared/unhead.DZbvapt-.mjs';
|
|
5
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.kVuXtrDW.mjs';
|
|
6
6
|
import './shared/unhead.DFwCX-QT.mjs';
|
|
7
7
|
import './shared/unhead.yem5I2v_.mjs';
|
|
8
8
|
|
|
9
9
|
function CanonicalPlugin(options) {
|
|
10
|
-
return
|
|
10
|
+
return (head) => {
|
|
11
11
|
function resolvePath(path) {
|
|
12
12
|
if (options?.customResolver) {
|
|
13
13
|
return options.customResolver(path);
|
|
@@ -43,7 +43,7 @@ function CanonicalPlugin(options) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
}
|
|
46
|
+
};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
function InferSeoMetaPlugin(options = {}) {
|
package/dist/scripts.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput,
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { e as RecordingEntry } from './shared/unhead.BNvCtqZe.mjs';
|
|
2
|
+
export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput, f as UseScriptOptions, b as UseScriptResolvedInput, g as UseScriptReturn, U as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.BNvCtqZe.mjs';
|
|
3
|
+
export { u as useScript } from './shared/unhead.DVa9RUZi.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
|
package/dist/scripts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput,
|
|
3
|
-
export { u as useScript } from './shared/unhead.
|
|
1
|
+
import { e as RecordingEntry } from './shared/unhead.BNvCtqZe.js';
|
|
2
|
+
export { A as AsVoidFunctions, E as EventHandlerOptions, S as ScriptInstance, d as UseFunctionType, a as UseScriptContext, c as UseScriptInput, f as UseScriptOptions, b as UseScriptResolvedInput, g as UseScriptReturn, U as UseScriptStatus, W as WarmupStrategy } from './shared/unhead.BNvCtqZe.js';
|
|
3
|
+
export { u as useScript } from './shared/unhead.DwaxOn3-.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
|
6
6
|
declare function createSpyProxy<T extends Record<string, any> | any[]>(target: T, onApply: (stack: RecordingEntry[][]) => void): T;
|
package/dist/scripts.mjs
CHANGED
package/dist/server.d.mts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { al as ResolvableHead, n as CreateServerHeadOptions, q as Unhead, t as RenderSSRHeadOptions, s as SSRHeadPayload, an as SerializableHead, aD as HeadTag } from './shared/unhead.BNvCtqZe.mjs';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
|
|
4
4
|
declare function createHead<T = ResolvableHead>(options?: CreateServerHeadOptions): Unhead<T>;
|
|
5
5
|
|
|
6
|
-
declare function renderSSRHead(head:
|
|
6
|
+
declare function renderSSRHead<T extends Unhead<unknown>>(head: T, options?: RenderSSRHeadOptions): Promise<SSRHeadPayload>;
|
|
7
7
|
|
|
8
8
|
declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
|
|
9
9
|
|
|
10
10
|
declare function extractUnheadInputFromHtml(html: string): {
|
|
11
11
|
html: string;
|
|
12
|
-
input:
|
|
12
|
+
input: SerializableHead;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
declare function propsToString(props: Record<string, any>): string;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { al as ResolvableHead, n as CreateServerHeadOptions, q as Unhead, t as RenderSSRHeadOptions, s as SSRHeadPayload, an as SerializableHead, aD as HeadTag } from './shared/unhead.BNvCtqZe.js';
|
|
2
2
|
import 'hookable';
|
|
3
3
|
|
|
4
4
|
declare function createHead<T = ResolvableHead>(options?: CreateServerHeadOptions): Unhead<T>;
|
|
5
5
|
|
|
6
|
-
declare function renderSSRHead(head:
|
|
6
|
+
declare function renderSSRHead<T extends Unhead<unknown>>(head: T, options?: RenderSSRHeadOptions): Promise<SSRHeadPayload>;
|
|
7
7
|
|
|
8
8
|
declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?: RenderSSRHeadOptions): Promise<string>;
|
|
9
9
|
|
|
10
10
|
declare function extractUnheadInputFromHtml(html: string): {
|
|
11
11
|
html: string;
|
|
12
|
-
input:
|
|
12
|
+
input: SerializableHead;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
declare function propsToString(props: Record<string, any>): string;
|
package/dist/server.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.CydFxwlU.mjs';
|
|
2
2
|
import { T as TagsWithInnerContent, S as SelfClosingTags$1 } from './shared/unhead.yem5I2v_.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
import './shared/unhead.xsi8MZXD.mjs';
|
|
5
5
|
import './shared/unhead.DZbvapt-.mjs';
|
|
6
6
|
|
|
7
7
|
function createHead(options = {}) {
|
|
8
|
-
const unhead =
|
|
8
|
+
const unhead = createUnhead({
|
|
9
9
|
...options,
|
|
10
10
|
// @ts-expect-error untyped
|
|
11
11
|
document: false,
|
|
@@ -77,8 +77,9 @@ function useScript(head, _input, _options) {
|
|
|
77
77
|
head.hooks.callHook(`script:updated`, hookCtx);
|
|
78
78
|
};
|
|
79
79
|
ScriptNetworkEvents.forEach((fn) => {
|
|
80
|
-
const
|
|
81
|
-
input[
|
|
80
|
+
const k = fn;
|
|
81
|
+
const _fn = typeof input[k] === "function" ? input[k].bind(options.eventContext) : null;
|
|
82
|
+
input[k] = (e) => {
|
|
82
83
|
syncStatus(fn === "onload" ? "loaded" : fn === "onerror" ? "error" : "loading");
|
|
83
84
|
_fn?.(e);
|
|
84
85
|
};
|