unhead 2.0.0-alpha.13 → 2.0.0-alpha.14
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/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/legacy.d.mts +1 -1
- package/dist/legacy.d.ts +1 -1
- package/dist/legacy.mjs +4 -4
- package/dist/plugins.mjs +3 -3
- package/dist/server.d.mts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/shared/{unhead.DgyS1B7b.mjs → unhead.BDJ47PJE.mjs} +1 -1
- package/dist/shared/{unhead.MUC9HWYx.d.ts → unhead.C45sZTyS.d.mts} +32 -30
- package/dist/shared/{unhead.MUC9HWYx.d.mts → unhead.C45sZTyS.d.ts} +32 -30
- package/dist/shared/{unhead.Cktr7sRK.mjs → unhead.cW6GzjRO.mjs} +1 -1
- package/dist/shared/{unhead.Mt30Mzm-.mjs → unhead.nHwoOBDy.mjs} +1 -1
- package/dist/shared/{unhead.CnyuWd5e.mjs → unhead.oUj3qANc.mjs} +1 -1
- package/dist/types.d.mts +58 -22
- package/dist/types.d.ts +58 -22
- package/dist/utils.d.mts +3 -3
- package/dist/utils.d.ts +3 -3
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
package/dist/client.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as unhead_types from 'unhead/types';
|
|
2
|
-
import { a as Head, b as CreateClientHeadOptions, U as Unhead, R as RenderDomHeadOptions } from './shared/unhead.
|
|
2
|
+
import { a as Head, b as CreateClientHeadOptions, U as Unhead, R as RenderDomHeadOptions } from './shared/unhead.C45sZTyS.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
|
-
declare function createHead<T
|
|
5
|
+
declare function createHead<T = Head>(options?: CreateClientHeadOptions): unhead_types.Unhead<T>;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Render the head tags to the DOM.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as unhead_types from 'unhead/types';
|
|
2
|
-
import { a as Head, b as CreateClientHeadOptions, U as Unhead, R as RenderDomHeadOptions } from './shared/unhead.
|
|
2
|
+
import { a as Head, b as CreateClientHeadOptions, U as Unhead, R as RenderDomHeadOptions } from './shared/unhead.C45sZTyS.js';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
|
-
declare function createHead<T
|
|
5
|
+
declare function createHead<T = Head>(options?: CreateClientHeadOptions): unhead_types.Unhead<T>;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Render the head tags to the DOM.
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as Unhead, H as HeadEntryOptions, A as ActiveHeadEntry,
|
|
1
|
+
import { U as Unhead, H as HeadEntryOptions, A as ActiveHeadEntry, j as UseSeoMetaInput, a as Head, C as CreateHeadOptions } from './shared/unhead.C45sZTyS.mjs';
|
|
2
2
|
import { HeadSafe } from './types.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
@@ -10,6 +10,6 @@ declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input: UseSeoMetaI
|
|
|
10
10
|
* Creates a core instance of unhead. Does not provide a global ctx for composables to work
|
|
11
11
|
* and does not register DOM plugins.
|
|
12
12
|
*/
|
|
13
|
-
declare function createHeadCore<T
|
|
13
|
+
declare function createHeadCore<T = Head>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
|
14
14
|
|
|
15
15
|
export { createHeadCore, useHead, useHeadSafe, useSeoMeta };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as Unhead, H as HeadEntryOptions, A as ActiveHeadEntry,
|
|
1
|
+
import { U as Unhead, H as HeadEntryOptions, A as ActiveHeadEntry, j as UseSeoMetaInput, a as Head, C as CreateHeadOptions } from './shared/unhead.C45sZTyS.js';
|
|
2
2
|
import { HeadSafe } from './types.js';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
@@ -10,6 +10,6 @@ declare function useSeoMeta<T extends Unhead<any>>(unhead: T, input: UseSeoMetaI
|
|
|
10
10
|
* Creates a core instance of unhead. Does not provide a global ctx for composables to work
|
|
11
11
|
* and does not register DOM plugins.
|
|
12
12
|
*/
|
|
13
|
-
declare function createHeadCore<T
|
|
13
|
+
declare function createHeadCore<T = Head>(resolvedOptions?: CreateHeadOptions): Unhead<T>;
|
|
14
14
|
|
|
15
15
|
export { createHeadCore, useHead, useHeadSafe, useSeoMeta };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.
|
|
1
|
+
export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.BDJ47PJE.mjs';
|
|
2
2
|
export { c as createHeadCore } from './shared/unhead.BfOKU5JT.mjs';
|
|
3
|
-
import './shared/unhead.
|
|
4
|
-
import './shared/unhead.
|
|
3
|
+
import './shared/unhead.cW6GzjRO.mjs';
|
|
4
|
+
import './shared/unhead.oUj3qANc.mjs';
|
|
5
5
|
import './shared/unhead.BX2ITVEM.mjs';
|
|
6
6
|
import 'hookable';
|
|
7
7
|
import './shared/unhead.CGUU1vXi.mjs';
|
package/dist/legacy.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createHeadCore, useHead, useHeadSafe, useSeoMeta } from './index.mjs';
|
|
2
|
-
import { S as Script, A as ActiveHeadEntry, H as HeadEntryOptions, U as Unhead, a as Head, C as CreateHeadOptions } from './shared/unhead.
|
|
2
|
+
import { S as Script, A as ActiveHeadEntry, H as HeadEntryOptions, U as Unhead, a as Head, C as CreateHeadOptions } from './shared/unhead.C45sZTyS.mjs';
|
|
3
3
|
import './types.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
package/dist/legacy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { createHeadCore, useHead, useHeadSafe, useSeoMeta } from './index.js';
|
|
2
|
-
import { S as Script, A as ActiveHeadEntry, H as HeadEntryOptions, U as Unhead, a as Head, C as CreateHeadOptions } from './shared/unhead.
|
|
2
|
+
import { S as Script, A as ActiveHeadEntry, H as HeadEntryOptions, U as Unhead, a as Head, C as CreateHeadOptions } from './shared/unhead.C45sZTyS.js';
|
|
3
3
|
import './types.js';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as createHeadCore } from './shared/unhead.BfOKU5JT.mjs';
|
|
2
2
|
import { b as ScriptNetworkEvents } from './shared/unhead.BX2ITVEM.mjs';
|
|
3
|
-
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.
|
|
4
|
-
export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.
|
|
3
|
+
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.nHwoOBDy.mjs';
|
|
4
|
+
export { u as useHead, a as useHeadSafe, b as useSeoMeta } from './shared/unhead.BDJ47PJE.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
6
|
import './shared/unhead.CGUU1vXi.mjs';
|
|
7
|
-
import './shared/unhead.
|
|
7
|
+
import './shared/unhead.oUj3qANc.mjs';
|
|
8
8
|
import './shared/unhead.Cixots_n.mjs';
|
|
9
|
-
import './shared/unhead.
|
|
9
|
+
import './shared/unhead.cW6GzjRO.mjs';
|
|
10
10
|
|
|
11
11
|
function resolveScriptKey(input) {
|
|
12
12
|
return input.key || input.src || (typeof input.innerHTML === "string" ? input.innerHTML : "");
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.
|
|
2
|
-
import { d as defineHeadPlugin } from './shared/unhead.
|
|
3
|
-
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.
|
|
1
|
+
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.nHwoOBDy.mjs';
|
|
2
|
+
import { d as defineHeadPlugin } from './shared/unhead.oUj3qANc.mjs';
|
|
3
|
+
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.cW6GzjRO.mjs';
|
|
4
4
|
import './shared/unhead.BX2ITVEM.mjs';
|
|
5
5
|
import './shared/unhead.Cixots_n.mjs';
|
|
6
6
|
|
package/dist/server.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as unhead_types from 'unhead/types';
|
|
2
|
-
import { a as Head, c as CreateServerHeadOptions, U as Unhead, d as RenderSSRHeadOptions, e as SSRHeadPayload, f as HeadTag } from './shared/unhead.
|
|
2
|
+
import { a as Head, c as CreateServerHeadOptions, U as Unhead, d as RenderSSRHeadOptions, e as SSRHeadPayload, f as ResolvedHead, g as HeadTag } from './shared/unhead.C45sZTyS.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
|
-
declare function createHead<T
|
|
5
|
+
declare function createHead<T = Head>(options?: CreateServerHeadOptions): unhead_types.Unhead<T>;
|
|
6
6
|
|
|
7
7
|
declare function renderSSRHead<T extends Record<string, any>>(head: Unhead<T>, options?: RenderSSRHeadOptions): Promise<SSRHeadPayload>;
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?
|
|
|
10
10
|
|
|
11
11
|
declare function extractUnheadInputFromHtml(html: string): {
|
|
12
12
|
html: string;
|
|
13
|
-
input:
|
|
13
|
+
input: ResolvedHead<any>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
declare function propsToString(props: Record<string, any>): string;
|
package/dist/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as unhead_types from 'unhead/types';
|
|
2
|
-
import { a as Head, c as CreateServerHeadOptions, U as Unhead, d as RenderSSRHeadOptions, e as SSRHeadPayload, f as HeadTag } from './shared/unhead.
|
|
2
|
+
import { a as Head, c as CreateServerHeadOptions, U as Unhead, d as RenderSSRHeadOptions, e as SSRHeadPayload, f as ResolvedHead, g as HeadTag } from './shared/unhead.C45sZTyS.js';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
|
-
declare function createHead<T
|
|
5
|
+
declare function createHead<T = Head>(options?: CreateServerHeadOptions): unhead_types.Unhead<T>;
|
|
6
6
|
|
|
7
7
|
declare function renderSSRHead<T extends Record<string, any>>(head: Unhead<T>, options?: RenderSSRHeadOptions): Promise<SSRHeadPayload>;
|
|
8
8
|
|
|
@@ -10,7 +10,7 @@ declare function transformHtmlTemplate(head: Unhead<any>, html: string, options?
|
|
|
10
10
|
|
|
11
11
|
declare function extractUnheadInputFromHtml(html: string): {
|
|
12
12
|
html: string;
|
|
13
|
-
input:
|
|
13
|
+
input: ResolvedHead<any>;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
declare function propsToString(props: Record<string, any>): string;
|
|
@@ -18,10 +18,14 @@ interface MergeHead {
|
|
|
18
18
|
type Never<T> = {
|
|
19
19
|
[P in keyof T]?: never;
|
|
20
20
|
};
|
|
21
|
-
type MaybeFunction<T> = T | (() => T);
|
|
22
21
|
type Falsey = false | null | undefined;
|
|
23
|
-
type
|
|
24
|
-
|
|
22
|
+
type ResolvableValue<T> = T | Falsey | (() => T | Falsey);
|
|
23
|
+
type ResolvableProperties<T> = {
|
|
24
|
+
[key in keyof T]?: ResolvableValue<T[key]>;
|
|
25
|
+
};
|
|
26
|
+
type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
|
|
27
|
+
type DeepResolvableProperties<T> = {
|
|
28
|
+
[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]>;
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
interface DataKeys {
|
|
@@ -1497,10 +1501,8 @@ interface MetaFlat extends MetaFlatArticle, MetaFlatBook, MetaFlatProfile {
|
|
|
1497
1501
|
*/
|
|
1498
1502
|
keywords: string;
|
|
1499
1503
|
}
|
|
1500
|
-
type
|
|
1501
|
-
|
|
1502
|
-
};
|
|
1503
|
-
type MetaFlatInput = Partial<MetaFlatNullable>;
|
|
1504
|
+
type MetaFlatInput = DeepResolvableProperties<Partial<MetaFlat>>;
|
|
1505
|
+
type ResolvedMetaFlat = Partial<MetaFlat>;
|
|
1504
1506
|
|
|
1505
1507
|
interface Noscript$1 {
|
|
1506
1508
|
/**
|
|
@@ -1689,20 +1691,20 @@ type MaybeEventFnHandlers<T> = {
|
|
|
1689
1691
|
[key in keyof T]?: T[key] | ((e: Event) => void);
|
|
1690
1692
|
};
|
|
1691
1693
|
type TitleTemplateResolver = string | ((title?: string) => string | null);
|
|
1692
|
-
type Title =
|
|
1694
|
+
type Title = ResolvableValue<number | string | Falsey> | ResolvableProperties<({
|
|
1693
1695
|
textContent: string;
|
|
1694
1696
|
} & SchemaAugmentations['title'])>;
|
|
1695
1697
|
type TitleTemplate = TitleTemplateResolver | null | ({
|
|
1696
1698
|
textContent: TitleTemplateResolver;
|
|
1697
1699
|
} & SchemaAugmentations['titleTemplate']);
|
|
1698
|
-
type Base<E extends EntryAugmentation = Record<string, any>> =
|
|
1699
|
-
type Link<E extends EntryAugmentation = Record<string, any>> =
|
|
1700
|
-
type Meta<E extends EntryAugmentation = Record<string, any>> =
|
|
1701
|
-
type Style<E extends EntryAugmentation = Record<string, any>> =
|
|
1702
|
-
type Script<E extends EntryAugmentation = Record<string, any>> =
|
|
1703
|
-
type Noscript<E extends EntryAugmentation = Record<string, any>> =
|
|
1704
|
-
type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> =
|
|
1705
|
-
type BodyAttributes<E extends EntryAugmentation = Record<string, any>> =
|
|
1700
|
+
type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
|
|
1701
|
+
type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
|
|
1702
|
+
type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
|
|
1703
|
+
type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
|
|
1704
|
+
type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
|
|
1705
|
+
type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
|
|
1706
|
+
type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
|
|
1707
|
+
type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
|
|
1706
1708
|
type ResolvedTitle = ({
|
|
1707
1709
|
textContent: string;
|
|
1708
1710
|
} & ResolvedSchemaAugmentations['title']);
|
|
@@ -1743,7 +1745,7 @@ interface Head<E extends MergeHead = SchemaAugmentations> extends HeadUtils {
|
|
|
1743
1745
|
*
|
|
1744
1746
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
1745
1747
|
*/
|
|
1746
|
-
base?: Base<E['base']
|
|
1748
|
+
base?: ResolvableValue<Base<E['base']>>;
|
|
1747
1749
|
/**
|
|
1748
1750
|
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
1749
1751
|
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
@@ -1751,54 +1753,54 @@ interface Head<E extends MergeHead = SchemaAugmentations> extends HeadUtils {
|
|
|
1751
1753
|
*
|
|
1752
1754
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
1753
1755
|
*/
|
|
1754
|
-
link?: Link<E['link']
|
|
1756
|
+
link?: ResolvableValue<ResolvableValue<Link<E['link']>>[]>;
|
|
1755
1757
|
/**
|
|
1756
1758
|
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
1757
1759
|
*
|
|
1758
1760
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
1759
1761
|
*/
|
|
1760
|
-
meta?: Meta<E['meta']
|
|
1762
|
+
meta?: ResolvableValue<ResolvableValue<Meta<E['meta']>>[]>;
|
|
1761
1763
|
/**
|
|
1762
1764
|
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
1763
1765
|
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
1764
1766
|
*
|
|
1765
1767
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
1766
1768
|
*/
|
|
1767
|
-
style?: (Style<E['style']> | string)[]
|
|
1769
|
+
style?: ResolvableValue<ResolvableValue<(Style<E['style']> | string)>[]>;
|
|
1768
1770
|
/**
|
|
1769
1771
|
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
1770
1772
|
*
|
|
1771
1773
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
1772
1774
|
*/
|
|
1773
|
-
script?: (Script<E['script']> | string)[]
|
|
1775
|
+
script?: ResolvableValue<ResolvableValue<(Script<E['script']> | string)>[]>;
|
|
1774
1776
|
/**
|
|
1775
1777
|
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
1776
1778
|
* or if scripting is currently turned off in the browser.
|
|
1777
1779
|
*
|
|
1778
1780
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
1779
1781
|
*/
|
|
1780
|
-
noscript?: (Noscript<E['noscript']> | string)[]
|
|
1782
|
+
noscript?: ResolvableValue<ResolvableValue<(Noscript<E['noscript']> | string)>[]>;
|
|
1781
1783
|
/**
|
|
1782
1784
|
* Attributes for the `<html>` HTML element.
|
|
1783
1785
|
*
|
|
1784
1786
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
1785
1787
|
*/
|
|
1786
|
-
htmlAttrs?: HtmlAttributes<E['htmlAttrs']
|
|
1788
|
+
htmlAttrs?: ResolvableValue<HtmlAttributes<E['htmlAttrs']>>;
|
|
1787
1789
|
/**
|
|
1788
1790
|
* Attributes for the `<body>` HTML element.
|
|
1789
1791
|
*
|
|
1790
1792
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
1791
1793
|
*/
|
|
1792
|
-
bodyAttrs?: BodyAttributes<E['bodyAttrs']
|
|
1794
|
+
bodyAttrs?: ResolvableValue<BodyAttributes<E['bodyAttrs']>>;
|
|
1793
1795
|
}
|
|
1794
1796
|
interface ResolvedHead<E extends MergeHead = ResolvedSchemaAugmentations> extends HeadUtils {
|
|
1795
1797
|
title?: ResolvedTitle;
|
|
1796
1798
|
base?: ResolvedBase<E['base']>;
|
|
1797
1799
|
link?: ResolvedLink<E['link']>[];
|
|
1798
1800
|
meta?: ResolvedMeta<E['meta']>[];
|
|
1799
|
-
style?:
|
|
1800
|
-
script?:
|
|
1801
|
-
noscript?:
|
|
1801
|
+
style?: ResolvedStyle<E['style']>[];
|
|
1802
|
+
script?: ResolvedScript<E['script']>[];
|
|
1803
|
+
noscript?: ResolvedNoscript<E['noscript']>[];
|
|
1802
1804
|
htmlAttrs?: ResolvedHtmlAttributes<E['htmlAttrs']>;
|
|
1803
1805
|
bodyAttrs?: ResolvedBodyAttributes<E['bodyAttrs']>;
|
|
1804
1806
|
}
|
|
@@ -1860,7 +1862,7 @@ interface TagPriority {
|
|
|
1860
1862
|
*/
|
|
1861
1863
|
tagPriority?: number | 'critical' | 'high' | 'low' | `before:${string}` | `after:${string}`;
|
|
1862
1864
|
}
|
|
1863
|
-
type TagUserProperties =
|
|
1865
|
+
type TagUserProperties = ResolvableProperties<TagPriority & TagPosition & InnerContent & ResolvesDuplicates & ProcessesTemplateParams>;
|
|
1864
1866
|
type TagKey = keyof Head;
|
|
1865
1867
|
type TemplateParams = {
|
|
1866
1868
|
separator?: '|' | '-' | '·' | string;
|
|
@@ -2117,7 +2119,7 @@ interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplatePa
|
|
|
2117
2119
|
*/
|
|
2118
2120
|
_safe?: boolean;
|
|
2119
2121
|
}
|
|
2120
|
-
interface Unhead<Input
|
|
2122
|
+
interface Unhead<Input = Head> {
|
|
2121
2123
|
/**
|
|
2122
2124
|
* Registered plugins.
|
|
2123
2125
|
*/
|
|
@@ -2199,4 +2201,4 @@ interface DomState {
|
|
|
2199
2201
|
elMap: Map<string, Element | Element[]>;
|
|
2200
2202
|
}
|
|
2201
2203
|
|
|
2202
|
-
export type {
|
|
2204
|
+
export type { HtmlAttr as $, ActiveHeadEntry as A, BaseMeta as B, CreateHeadOptions as C, DataKeys as D, EntryResolveCtx as E, ShouldRenderContext as F, SSRRenderContext as G, HeadEntryOptions as H, HeadHooks as I, DomPluginOptions as J, BodyEvents as K, LinkBase as L, HttpEventAttributes as M, Noscript as N, MetaFlatInput as O, PropResolver as P, UserTagConfigWithoutInnerContent as Q, RenderDomHeadOptions as R, Script as S, TemplateParams as T, Unhead as U, UserAttributesConfig as V, ResolvedSchemaAugmentations as W, MaybeArray as X, BaseBodyAttr as Y, BaseHtmlAttr as Z, BodyAttr as _, Head as a, EntryAugmentation as a0, MaybeEventFnHandlers as a1, Title as a2, TitleTemplate as a3, Base as a4, Link as a5, Meta as a6, ResolvedTitle as a7, ResolvedTitleTemplate as a8, ResolvedBase as a9, Never as aA, Falsey as aB, ResolvableUnion as aC, DeepResolvableProperties as aD, ResolvedLink as aa, ResolvedMeta as ab, ResolvedStyle as ac, ResolvedScript as ad, ResolvedNoscript as ae, ResolvedHtmlAttributes as af, ResolvedBodyAttributes as ag, HeadUtils as ah, UseHeadInput as ai, ResolvesDuplicates as aj, ValidTagPositions as ak, TagPosition as al, InnerContentVal as am, InnerContent as an, TagPriority as ao, TagUserProperties as ap, TagKey as aq, ProcessesTemplateParams as ar, HasTemplateParams as as, HeadTagKeys as at, Booleanable as au, Stringable as av, Arrayable as aw, DefinedValueOrEmptyObject as ax, Merge as ay, MergeHead as az, CreateClientHeadOptions as b, CreateServerHeadOptions as c, RenderSSRHeadOptions as d, SSRHeadPayload as e, ResolvedHead as f, HeadTag as g, HeadPluginInput as h, ResolvedMetaFlat as i, UseSeoMetaInput as j, ResolvableProperties as k, BodyAttributes as l, SchemaAugmentations as m, HtmlAttributes as n, ScriptBase as o, Style as p, ResolvableValue as q, SideEffectsRecord as r, RuntimeMode as s, HeadEntry as t, HeadPluginOptions as u, HeadPlugin as v, DomState as w, HookResult as x, DomRenderTagContext as y, DomBeforeRenderCtx as z };
|
|
@@ -18,10 +18,14 @@ interface MergeHead {
|
|
|
18
18
|
type Never<T> = {
|
|
19
19
|
[P in keyof T]?: never;
|
|
20
20
|
};
|
|
21
|
-
type MaybeFunction<T> = T | (() => T);
|
|
22
21
|
type Falsey = false | null | undefined;
|
|
23
|
-
type
|
|
24
|
-
|
|
22
|
+
type ResolvableValue<T> = T | Falsey | (() => T | Falsey);
|
|
23
|
+
type ResolvableProperties<T> = {
|
|
24
|
+
[key in keyof T]?: ResolvableValue<T[key]>;
|
|
25
|
+
};
|
|
26
|
+
type ResolvableUnion<T> = T extends string | number | boolean ? ResolvableValue<T> : T extends object ? DeepResolvableProperties<T> : ResolvableValue<T>;
|
|
27
|
+
type DeepResolvableProperties<T> = {
|
|
28
|
+
[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]>;
|
|
25
29
|
};
|
|
26
30
|
|
|
27
31
|
interface DataKeys {
|
|
@@ -1497,10 +1501,8 @@ interface MetaFlat extends MetaFlatArticle, MetaFlatBook, MetaFlatProfile {
|
|
|
1497
1501
|
*/
|
|
1498
1502
|
keywords: string;
|
|
1499
1503
|
}
|
|
1500
|
-
type
|
|
1501
|
-
|
|
1502
|
-
};
|
|
1503
|
-
type MetaFlatInput = Partial<MetaFlatNullable>;
|
|
1504
|
+
type MetaFlatInput = DeepResolvableProperties<Partial<MetaFlat>>;
|
|
1505
|
+
type ResolvedMetaFlat = Partial<MetaFlat>;
|
|
1504
1506
|
|
|
1505
1507
|
interface Noscript$1 {
|
|
1506
1508
|
/**
|
|
@@ -1689,20 +1691,20 @@ type MaybeEventFnHandlers<T> = {
|
|
|
1689
1691
|
[key in keyof T]?: T[key] | ((e: Event) => void);
|
|
1690
1692
|
};
|
|
1691
1693
|
type TitleTemplateResolver = string | ((title?: string) => string | null);
|
|
1692
|
-
type Title =
|
|
1694
|
+
type Title = ResolvableValue<number | string | Falsey> | ResolvableProperties<({
|
|
1693
1695
|
textContent: string;
|
|
1694
1696
|
} & SchemaAugmentations['title'])>;
|
|
1695
1697
|
type TitleTemplate = TitleTemplateResolver | null | ({
|
|
1696
1698
|
textContent: TitleTemplateResolver;
|
|
1697
1699
|
} & SchemaAugmentations['titleTemplate']);
|
|
1698
|
-
type Base<E extends EntryAugmentation = Record<string, any>> =
|
|
1699
|
-
type Link<E extends EntryAugmentation = Record<string, any>> =
|
|
1700
|
-
type Meta<E extends EntryAugmentation = Record<string, any>> =
|
|
1701
|
-
type Style<E extends EntryAugmentation = Record<string, any>> =
|
|
1702
|
-
type Script<E extends EntryAugmentation = Record<string, any>> =
|
|
1703
|
-
type Noscript<E extends EntryAugmentation = Record<string, any>> =
|
|
1704
|
-
type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> =
|
|
1705
|
-
type BodyAttributes<E extends EntryAugmentation = Record<string, any>> =
|
|
1700
|
+
type Base<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Base$1 & SchemaAugmentations['base']> & DefinedValueOrEmptyObject<E>;
|
|
1701
|
+
type Link<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<LinkBase & DataKeys & SchemaAugmentations['link']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
|
|
1702
|
+
type Meta<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BaseMeta & DataKeys & SchemaAugmentations['meta']> & DefinedValueOrEmptyObject<E>;
|
|
1703
|
+
type Style<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Style$1 & DataKeys & SchemaAugmentations['style']> & DefinedValueOrEmptyObject<E>;
|
|
1704
|
+
type Script<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<ScriptBase & DataKeys & SchemaAugmentations['script']> & MaybeEventFnHandlers<HttpEventAttributes> & DefinedValueOrEmptyObject<E>;
|
|
1705
|
+
type Noscript<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<Noscript$1 & DataKeys & SchemaAugmentations['noscript']> & DefinedValueOrEmptyObject<E>;
|
|
1706
|
+
type HtmlAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<HtmlAttr & DataKeys & SchemaAugmentations['htmlAttrs']> & DefinedValueOrEmptyObject<E>;
|
|
1707
|
+
type BodyAttributes<E extends EntryAugmentation = Record<string, any>> = ResolvableProperties<BodyAttr & DataKeys & SchemaAugmentations['bodyAttrs']> & MaybeEventFnHandlers<BodyEvents> & DefinedValueOrEmptyObject<E>;
|
|
1706
1708
|
type ResolvedTitle = ({
|
|
1707
1709
|
textContent: string;
|
|
1708
1710
|
} & ResolvedSchemaAugmentations['title']);
|
|
@@ -1743,7 +1745,7 @@ interface Head<E extends MergeHead = SchemaAugmentations> extends HeadUtils {
|
|
|
1743
1745
|
*
|
|
1744
1746
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
1745
1747
|
*/
|
|
1746
|
-
base?: Base<E['base']
|
|
1748
|
+
base?: ResolvableValue<Base<E['base']>>;
|
|
1747
1749
|
/**
|
|
1748
1750
|
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
1749
1751
|
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
@@ -1751,54 +1753,54 @@ interface Head<E extends MergeHead = SchemaAugmentations> extends HeadUtils {
|
|
|
1751
1753
|
*
|
|
1752
1754
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
1753
1755
|
*/
|
|
1754
|
-
link?: Link<E['link']
|
|
1756
|
+
link?: ResolvableValue<ResolvableValue<Link<E['link']>>[]>;
|
|
1755
1757
|
/**
|
|
1756
1758
|
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
1757
1759
|
*
|
|
1758
1760
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
1759
1761
|
*/
|
|
1760
|
-
meta?: Meta<E['meta']
|
|
1762
|
+
meta?: ResolvableValue<ResolvableValue<Meta<E['meta']>>[]>;
|
|
1761
1763
|
/**
|
|
1762
1764
|
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
1763
1765
|
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
1764
1766
|
*
|
|
1765
1767
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
1766
1768
|
*/
|
|
1767
|
-
style?: (Style<E['style']> | string)[]
|
|
1769
|
+
style?: ResolvableValue<ResolvableValue<(Style<E['style']> | string)>[]>;
|
|
1768
1770
|
/**
|
|
1769
1771
|
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
1770
1772
|
*
|
|
1771
1773
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
1772
1774
|
*/
|
|
1773
|
-
script?: (Script<E['script']> | string)[]
|
|
1775
|
+
script?: ResolvableValue<ResolvableValue<(Script<E['script']> | string)>[]>;
|
|
1774
1776
|
/**
|
|
1775
1777
|
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
1776
1778
|
* or if scripting is currently turned off in the browser.
|
|
1777
1779
|
*
|
|
1778
1780
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
1779
1781
|
*/
|
|
1780
|
-
noscript?: (Noscript<E['noscript']> | string)[]
|
|
1782
|
+
noscript?: ResolvableValue<ResolvableValue<(Noscript<E['noscript']> | string)>[]>;
|
|
1781
1783
|
/**
|
|
1782
1784
|
* Attributes for the `<html>` HTML element.
|
|
1783
1785
|
*
|
|
1784
1786
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
1785
1787
|
*/
|
|
1786
|
-
htmlAttrs?: HtmlAttributes<E['htmlAttrs']
|
|
1788
|
+
htmlAttrs?: ResolvableValue<HtmlAttributes<E['htmlAttrs']>>;
|
|
1787
1789
|
/**
|
|
1788
1790
|
* Attributes for the `<body>` HTML element.
|
|
1789
1791
|
*
|
|
1790
1792
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
1791
1793
|
*/
|
|
1792
|
-
bodyAttrs?: BodyAttributes<E['bodyAttrs']
|
|
1794
|
+
bodyAttrs?: ResolvableValue<BodyAttributes<E['bodyAttrs']>>;
|
|
1793
1795
|
}
|
|
1794
1796
|
interface ResolvedHead<E extends MergeHead = ResolvedSchemaAugmentations> extends HeadUtils {
|
|
1795
1797
|
title?: ResolvedTitle;
|
|
1796
1798
|
base?: ResolvedBase<E['base']>;
|
|
1797
1799
|
link?: ResolvedLink<E['link']>[];
|
|
1798
1800
|
meta?: ResolvedMeta<E['meta']>[];
|
|
1799
|
-
style?:
|
|
1800
|
-
script?:
|
|
1801
|
-
noscript?:
|
|
1801
|
+
style?: ResolvedStyle<E['style']>[];
|
|
1802
|
+
script?: ResolvedScript<E['script']>[];
|
|
1803
|
+
noscript?: ResolvedNoscript<E['noscript']>[];
|
|
1802
1804
|
htmlAttrs?: ResolvedHtmlAttributes<E['htmlAttrs']>;
|
|
1803
1805
|
bodyAttrs?: ResolvedBodyAttributes<E['bodyAttrs']>;
|
|
1804
1806
|
}
|
|
@@ -1860,7 +1862,7 @@ interface TagPriority {
|
|
|
1860
1862
|
*/
|
|
1861
1863
|
tagPriority?: number | 'critical' | 'high' | 'low' | `before:${string}` | `after:${string}`;
|
|
1862
1864
|
}
|
|
1863
|
-
type TagUserProperties =
|
|
1865
|
+
type TagUserProperties = ResolvableProperties<TagPriority & TagPosition & InnerContent & ResolvesDuplicates & ProcessesTemplateParams>;
|
|
1864
1866
|
type TagKey = keyof Head;
|
|
1865
1867
|
type TemplateParams = {
|
|
1866
1868
|
separator?: '|' | '-' | '·' | string;
|
|
@@ -2117,7 +2119,7 @@ interface HeadEntryOptions extends TagPosition, TagPriority, ProcessesTemplatePa
|
|
|
2117
2119
|
*/
|
|
2118
2120
|
_safe?: boolean;
|
|
2119
2121
|
}
|
|
2120
|
-
interface Unhead<Input
|
|
2122
|
+
interface Unhead<Input = Head> {
|
|
2121
2123
|
/**
|
|
2122
2124
|
* Registered plugins.
|
|
2123
2125
|
*/
|
|
@@ -2199,4 +2201,4 @@ interface DomState {
|
|
|
2199
2201
|
elMap: Map<string, Element | Element[]>;
|
|
2200
2202
|
}
|
|
2201
2203
|
|
|
2202
|
-
export type {
|
|
2204
|
+
export type { HtmlAttr as $, ActiveHeadEntry as A, BaseMeta as B, CreateHeadOptions as C, DataKeys as D, EntryResolveCtx as E, ShouldRenderContext as F, SSRRenderContext as G, HeadEntryOptions as H, HeadHooks as I, DomPluginOptions as J, BodyEvents as K, LinkBase as L, HttpEventAttributes as M, Noscript as N, MetaFlatInput as O, PropResolver as P, UserTagConfigWithoutInnerContent as Q, RenderDomHeadOptions as R, Script as S, TemplateParams as T, Unhead as U, UserAttributesConfig as V, ResolvedSchemaAugmentations as W, MaybeArray as X, BaseBodyAttr as Y, BaseHtmlAttr as Z, BodyAttr as _, Head as a, EntryAugmentation as a0, MaybeEventFnHandlers as a1, Title as a2, TitleTemplate as a3, Base as a4, Link as a5, Meta as a6, ResolvedTitle as a7, ResolvedTitleTemplate as a8, ResolvedBase as a9, Never as aA, Falsey as aB, ResolvableUnion as aC, DeepResolvableProperties as aD, ResolvedLink as aa, ResolvedMeta as ab, ResolvedStyle as ac, ResolvedScript as ad, ResolvedNoscript as ae, ResolvedHtmlAttributes as af, ResolvedBodyAttributes as ag, HeadUtils as ah, UseHeadInput as ai, ResolvesDuplicates as aj, ValidTagPositions as ak, TagPosition as al, InnerContentVal as am, InnerContent as an, TagPriority as ao, TagUserProperties as ap, TagKey as aq, ProcessesTemplateParams as ar, HasTemplateParams as as, HeadTagKeys as at, Booleanable as au, Stringable as av, Arrayable as aw, DefinedValueOrEmptyObject as ax, Merge as ay, MergeHead as az, CreateClientHeadOptions as b, CreateServerHeadOptions as c, RenderSSRHeadOptions as d, SSRHeadPayload as e, ResolvedHead as f, HeadTag as g, HeadPluginInput as h, ResolvedMetaFlat as i, UseSeoMetaInput as j, ResolvableProperties as k, BodyAttributes as l, SchemaAugmentations as m, HtmlAttributes as n, ScriptBase as o, Style as p, ResolvableValue as q, SideEffectsRecord as r, RuntimeMode as s, HeadEntry as t, HeadPluginOptions as u, HeadPlugin as v, DomState as w, HookResult as x, DomRenderTagContext as y, DomBeforeRenderCtx as z };
|
|
@@ -96,7 +96,7 @@ function handleObjectEntry(key, value) {
|
|
|
96
96
|
const input = Object.fromEntries(
|
|
97
97
|
Object.entries(sanitizedValue).map(([k, v]) => [`${key}${k === "url" ? "" : `${k[0].toUpperCase()}${k.slice(1)}`}`, v])
|
|
98
98
|
);
|
|
99
|
-
return unpackMeta(input).sort((a, b) => (a[attr]?.length || 0) - (b[attr]?.length || 0));
|
|
99
|
+
return unpackMeta(input || {}).sort((a, b) => (a[attr]?.length || 0) - (b[attr]?.length || 0));
|
|
100
100
|
}
|
|
101
101
|
function resolveMetaKeyType(key) {
|
|
102
102
|
if (MetaPackingSchema[key]?.metaKey === "http-equiv" || NAMESPACES.HTTP_EQUIV.has(key)) {
|
package/dist/types.d.mts
CHANGED
|
@@ -1,27 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActiveHeadEntry,
|
|
1
|
+
import { k as ResolvableProperties, l as BodyAttributes, D as DataKeys, m as SchemaAugmentations, n as HtmlAttributes, B as BaseMeta, L as LinkBase, o as ScriptBase, N as Noscript, p as Style, a as Head, q as ResolvableValue } from './shared/unhead.C45sZTyS.mjs';
|
|
2
|
+
export { A as ActiveHeadEntry, aw as Arrayable, a4 as Base, Y as BaseBodyAttr, Z as BaseHtmlAttr, _ as BodyAttr, K as BodyEvents, au as Booleanable, b as CreateClientHeadOptions, C as CreateHeadOptions, c as CreateServerHeadOptions, aD as DeepResolvableProperties, ax as DefinedValueOrEmptyObject, z as DomBeforeRenderCtx, J as DomPluginOptions, y as DomRenderTagContext, w as DomState, a0 as EntryAugmentation, E as EntryResolveCtx, aB as Falsey, as as HasTemplateParams, t as HeadEntry, H as HeadEntryOptions, I as HeadHooks, v as HeadPlugin, h as HeadPluginInput, u as HeadPluginOptions, g as HeadTag, at as HeadTagKeys, ah as HeadUtils, x as HookResult, $ as HtmlAttr, M as HttpEventAttributes, an as InnerContent, am as InnerContentVal, a5 as Link, X as MaybeArray, a1 as MaybeEventFnHandlers, ay as Merge, az as MergeHead, a6 as Meta, O as MetaFlatInput, aA as Never, ar as ProcessesTemplateParams, P as PropResolver, R as RenderDomHeadOptions, d as RenderSSRHeadOptions, aC as ResolvableUnion, a9 as ResolvedBase, ag as ResolvedBodyAttributes, f as ResolvedHead, af as ResolvedHtmlAttributes, aa as ResolvedLink, ab as ResolvedMeta, ae as ResolvedNoscript, W as ResolvedSchemaAugmentations, ad as ResolvedScript, ac as ResolvedStyle, a7 as ResolvedTitle, a8 as ResolvedTitleTemplate, aj as ResolvesDuplicates, s as RuntimeMode, e as SSRHeadPayload, G as SSRRenderContext, S as Script, F as ShouldRenderContext, r as SideEffectsRecord, av as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, T as TemplateParams, a2 as Title, a3 as TitleTemplate, U as Unhead, ai as UseHeadInput, j as UseSeoMetaInput, V as UserAttributesConfig, Q as UserTagConfigWithoutInnerContent, ak as ValidTagPositions } from './shared/unhead.C45sZTyS.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
|
-
type SafeBodyAttr = Pick<
|
|
6
|
-
type SafeHtmlAttr = Pick<
|
|
7
|
-
type SafeMeta = Pick<
|
|
8
|
-
type SafeLink = Pick<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} &
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
} & DataKeys;
|
|
15
|
-
type SafeNoscript = Pick<Noscript, 'id' | 'textContent'> & DataKeys;
|
|
16
|
-
type SafeStyle = Pick<Script, 'id' | 'textContent' | 'media'> & DataKeys;
|
|
5
|
+
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
|
6
|
+
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
7
|
+
type SafeMeta = ResolvableProperties<Pick<BaseMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
|
8
|
+
type SafeLink = ResolvableProperties<Pick<LinkBase, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
|
9
|
+
type SafeScript = ResolvableProperties<Pick<ScriptBase, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
|
|
10
|
+
textContent?: string;
|
|
11
|
+
} & SchemaAugmentations['script']>;
|
|
12
|
+
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id' | 'textContent'> & DataKeys & SchemaAugmentations['noscript']>;
|
|
13
|
+
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'textContent' | 'nonce' | 'title' | 'blocking'> & DataKeys & SchemaAugmentations['style']>;
|
|
17
14
|
interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParams'> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
17
|
+
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
18
|
+
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
|
19
|
+
*
|
|
20
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
21
|
+
*/
|
|
22
|
+
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
|
|
23
|
+
/**
|
|
24
|
+
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
25
|
+
*
|
|
26
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
27
|
+
*/
|
|
28
|
+
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
|
|
29
|
+
/**
|
|
30
|
+
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
31
|
+
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
32
|
+
*
|
|
33
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
34
|
+
*/
|
|
35
|
+
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
|
|
36
|
+
/**
|
|
37
|
+
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
38
|
+
*
|
|
39
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
40
|
+
*/
|
|
41
|
+
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
|
|
42
|
+
/**
|
|
43
|
+
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
44
|
+
* or if scripting is currently turned off in the browser.
|
|
45
|
+
*
|
|
46
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
47
|
+
*/
|
|
48
|
+
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Attributes for the `<html>` HTML element.
|
|
51
|
+
*
|
|
52
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
53
|
+
*/
|
|
54
|
+
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
|
|
55
|
+
/**
|
|
56
|
+
* Attributes for the `<body>` HTML element.
|
|
57
|
+
*
|
|
58
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
59
|
+
*/
|
|
60
|
+
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
|
|
25
61
|
}
|
|
26
62
|
|
|
27
|
-
export {
|
|
63
|
+
export { BaseMeta, BodyAttributes, DataKeys, Head, type HeadSafe, HtmlAttributes, LinkBase, Noscript, ResolvableProperties, ResolvableValue, type SafeBodyAttr, type SafeHtmlAttr, type SafeLink, type SafeMeta, type SafeNoscript, type SafeScript, type SafeStyle, SchemaAugmentations, ScriptBase, Style };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,27 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { A as ActiveHeadEntry,
|
|
1
|
+
import { k as ResolvableProperties, l as BodyAttributes, D as DataKeys, m as SchemaAugmentations, n as HtmlAttributes, B as BaseMeta, L as LinkBase, o as ScriptBase, N as Noscript, p as Style, a as Head, q as ResolvableValue } from './shared/unhead.C45sZTyS.js';
|
|
2
|
+
export { A as ActiveHeadEntry, aw as Arrayable, a4 as Base, Y as BaseBodyAttr, Z as BaseHtmlAttr, _ as BodyAttr, K as BodyEvents, au as Booleanable, b as CreateClientHeadOptions, C as CreateHeadOptions, c as CreateServerHeadOptions, aD as DeepResolvableProperties, ax as DefinedValueOrEmptyObject, z as DomBeforeRenderCtx, J as DomPluginOptions, y as DomRenderTagContext, w as DomState, a0 as EntryAugmentation, E as EntryResolveCtx, aB as Falsey, as as HasTemplateParams, t as HeadEntry, H as HeadEntryOptions, I as HeadHooks, v as HeadPlugin, h as HeadPluginInput, u as HeadPluginOptions, g as HeadTag, at as HeadTagKeys, ah as HeadUtils, x as HookResult, $ as HtmlAttr, M as HttpEventAttributes, an as InnerContent, am as InnerContentVal, a5 as Link, X as MaybeArray, a1 as MaybeEventFnHandlers, ay as Merge, az as MergeHead, a6 as Meta, O as MetaFlatInput, aA as Never, ar as ProcessesTemplateParams, P as PropResolver, R as RenderDomHeadOptions, d as RenderSSRHeadOptions, aC as ResolvableUnion, a9 as ResolvedBase, ag as ResolvedBodyAttributes, f as ResolvedHead, af as ResolvedHtmlAttributes, aa as ResolvedLink, ab as ResolvedMeta, ae as ResolvedNoscript, W as ResolvedSchemaAugmentations, ad as ResolvedScript, ac as ResolvedStyle, a7 as ResolvedTitle, a8 as ResolvedTitleTemplate, aj as ResolvesDuplicates, s as RuntimeMode, e as SSRHeadPayload, G as SSRRenderContext, S as Script, F as ShouldRenderContext, r as SideEffectsRecord, av as Stringable, aq as TagKey, al as TagPosition, ao as TagPriority, ap as TagUserProperties, T as TemplateParams, a2 as Title, a3 as TitleTemplate, U as Unhead, ai as UseHeadInput, j as UseSeoMetaInput, V as UserAttributesConfig, Q as UserTagConfigWithoutInnerContent, ak as ValidTagPositions } from './shared/unhead.C45sZTyS.js';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
5
|
-
type SafeBodyAttr = Pick<
|
|
6
|
-
type SafeHtmlAttr = Pick<
|
|
7
|
-
type SafeMeta = Pick<
|
|
8
|
-
type SafeLink = Pick<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} &
|
|
12
|
-
type
|
|
13
|
-
|
|
14
|
-
} & DataKeys;
|
|
15
|
-
type SafeNoscript = Pick<Noscript, 'id' | 'textContent'> & DataKeys;
|
|
16
|
-
type SafeStyle = Pick<Script, 'id' | 'textContent' | 'media'> & DataKeys;
|
|
5
|
+
type SafeBodyAttr = ResolvableProperties<Pick<BodyAttributes, 'id' | 'class' | 'style'> & DataKeys & SchemaAugmentations['bodyAttrs']>;
|
|
6
|
+
type SafeHtmlAttr = ResolvableProperties<Pick<HtmlAttributes, 'id' | 'class' | 'style' | 'lang' | 'dir'> & DataKeys & SchemaAugmentations['htmlAttrs']>;
|
|
7
|
+
type SafeMeta = ResolvableProperties<Pick<BaseMeta, 'id' | 'name' | 'property' | 'charset' | 'content' | 'media'> & DataKeys & SchemaAugmentations['meta']>;
|
|
8
|
+
type SafeLink = ResolvableProperties<Pick<LinkBase, 'id' | 'color' | 'crossorigin' | 'fetchpriority' | 'href' | 'hreflang' | 'imagesrcset' | 'imagesizes' | 'integrity' | 'media' | 'referrerpolicy' | 'rel' | 'sizes' | 'type'> & DataKeys & SchemaAugmentations['link']>;
|
|
9
|
+
type SafeScript = ResolvableProperties<Pick<ScriptBase, 'id' | 'type' | 'nonce' | 'blocking'> & DataKeys & {
|
|
10
|
+
textContent?: string;
|
|
11
|
+
} & SchemaAugmentations['script']>;
|
|
12
|
+
type SafeNoscript = ResolvableProperties<Pick<Noscript, 'id' | 'textContent'> & DataKeys & SchemaAugmentations['noscript']>;
|
|
13
|
+
type SafeStyle = ResolvableProperties<Pick<Style, 'id' | 'media' | 'textContent' | 'nonce' | 'title' | 'blocking'> & DataKeys & SchemaAugmentations['style']>;
|
|
17
14
|
interface HeadSafe extends Pick<Head, 'title' | 'titleTemplate' | 'templateParams'> {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
17
|
+
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
18
|
+
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
|
19
|
+
*
|
|
20
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-as
|
|
21
|
+
*/
|
|
22
|
+
link?: ResolvableValue<ResolvableValue<SafeLink[]>>;
|
|
23
|
+
/**
|
|
24
|
+
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
25
|
+
*
|
|
26
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
27
|
+
*/
|
|
28
|
+
meta?: ResolvableValue<ResolvableValue<SafeMeta>[]>;
|
|
29
|
+
/**
|
|
30
|
+
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
31
|
+
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
32
|
+
*
|
|
33
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
34
|
+
*/
|
|
35
|
+
style?: ResolvableValue<ResolvableValue<(SafeStyle | string)>[]>;
|
|
36
|
+
/**
|
|
37
|
+
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
38
|
+
*
|
|
39
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
40
|
+
*/
|
|
41
|
+
script?: ResolvableValue<ResolvableValue<(SafeScript | string)>[]>;
|
|
42
|
+
/**
|
|
43
|
+
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
44
|
+
* or if scripting is currently turned off in the browser.
|
|
45
|
+
*
|
|
46
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
47
|
+
*/
|
|
48
|
+
noscript?: ResolvableValue<ResolvableValue<(SafeNoscript | string)>[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Attributes for the `<html>` HTML element.
|
|
51
|
+
*
|
|
52
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
53
|
+
*/
|
|
54
|
+
htmlAttrs?: ResolvableValue<SafeHtmlAttr>;
|
|
55
|
+
/**
|
|
56
|
+
* Attributes for the `<body>` HTML element.
|
|
57
|
+
*
|
|
58
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
59
|
+
*/
|
|
60
|
+
bodyAttrs?: ResolvableValue<SafeBodyAttr>;
|
|
25
61
|
}
|
|
26
62
|
|
|
27
|
-
export {
|
|
63
|
+
export { BaseMeta, BodyAttributes, DataKeys, Head, type HeadSafe, HtmlAttributes, LinkBase, Noscript, ResolvableProperties, ResolvableValue, type SafeBodyAttr, type SafeHtmlAttr, type SafeLink, type SafeMeta, type SafeNoscript, type SafeScript, type SafeStyle, SchemaAugmentations, ScriptBase, Style };
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as HeadTag, h as HeadPluginInput, B as BaseMeta, i as ResolvedMetaFlat, a as Head, P as PropResolver, U as Unhead, T as TemplateParams } from './shared/unhead.C45sZTyS.mjs';
|
|
2
2
|
import { PropResolver as PropResolver$1 } from 'unhead/types';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
@@ -22,10 +22,10 @@ declare function defineHeadPlugin(plugin: HeadPluginInput): HeadPluginInput;
|
|
|
22
22
|
declare function resolveMetaKeyType(key: string): keyof BaseMeta;
|
|
23
23
|
declare function resolveMetaKeyValue(key: string): string;
|
|
24
24
|
declare function resolvePackedMetaObjectValue(value: string, key: string): string;
|
|
25
|
-
declare function unpackMeta<T extends
|
|
25
|
+
declare function unpackMeta<T extends ResolvedMetaFlat>(input: T): Required<Head>['meta'];
|
|
26
26
|
|
|
27
27
|
declare function normalizeProps(tag: HeadTag, input: Record<string, any>): HeadTag;
|
|
28
|
-
declare function normalizeEntryToTags(input:
|
|
28
|
+
declare function normalizeEntryToTags(input: any, propResolvers: PropResolver[]): HeadTag[];
|
|
29
29
|
|
|
30
30
|
declare const sortTags: (a: HeadTag, b: HeadTag) => number;
|
|
31
31
|
declare function tagWeight<T extends HeadTag>(head: Unhead<any>, tag: T): number;
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as HeadTag, h as HeadPluginInput, B as BaseMeta, i as ResolvedMetaFlat, a as Head, P as PropResolver, U as Unhead, T as TemplateParams } from './shared/unhead.C45sZTyS.js';
|
|
2
2
|
import { PropResolver as PropResolver$1 } from 'unhead/types';
|
|
3
3
|
import 'hookable';
|
|
4
4
|
|
|
@@ -22,10 +22,10 @@ declare function defineHeadPlugin(plugin: HeadPluginInput): HeadPluginInput;
|
|
|
22
22
|
declare function resolveMetaKeyType(key: string): keyof BaseMeta;
|
|
23
23
|
declare function resolveMetaKeyValue(key: string): string;
|
|
24
24
|
declare function resolvePackedMetaObjectValue(value: string, key: string): string;
|
|
25
|
-
declare function unpackMeta<T extends
|
|
25
|
+
declare function unpackMeta<T extends ResolvedMetaFlat>(input: T): Required<Head>['meta'];
|
|
26
26
|
|
|
27
27
|
declare function normalizeProps(tag: HeadTag, input: Record<string, any>): HeadTag;
|
|
28
|
-
declare function normalizeEntryToTags(input:
|
|
28
|
+
declare function normalizeEntryToTags(input: any, propResolvers: PropResolver[]): HeadTag[];
|
|
29
29
|
|
|
30
30
|
declare const sortTags: (a: HeadTag, b: HeadTag) => number;
|
|
31
31
|
declare function tagWeight<T extends HeadTag>(head: Unhead<any>, tag: T): number;
|
package/dist/utils.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { D as DupeableTags, H as HasElementTags, M as MetaTagsArrayable, b as ScriptNetworkEvents, S as SelfClosingTags, a as TagConfigKeys, T as TagsWithInnerContent, U as UniqueTags, c as UsesMergeStrategy, V as ValidHeadTags, s as sortTags, t as tagWeight } from './shared/unhead.BX2ITVEM.mjs';
|
|
2
2
|
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.CGUU1vXi.mjs';
|
|
3
|
-
export { d as defineHeadPlugin, r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.
|
|
3
|
+
export { d as defineHeadPlugin, r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.oUj3qANc.mjs';
|
|
4
4
|
export { p as processTemplateParams } from './shared/unhead.Cixots_n.mjs';
|