@unhead/schema 1.1.29 → 1.1.30
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/index.d.ts +23 -20
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,15 @@ interface ResolvesDuplicates {
|
|
|
8
8
|
* to be made you can provide a unique key for each entry.
|
|
9
9
|
*/
|
|
10
10
|
key?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The strategy to use when a duplicate tag is encountered.
|
|
13
|
+
*
|
|
14
|
+
* - `replace` - Replace the existing tag with the new tag
|
|
15
|
+
* - `merge` - Merge the existing tag with the new tag
|
|
16
|
+
*
|
|
17
|
+
* @default 'replace' (some tags will default to 'merge', such as htmlAttr)
|
|
18
|
+
*/
|
|
19
|
+
tagDuplicateStrategy?: 'replace' | 'merge';
|
|
11
20
|
/**
|
|
12
21
|
* @deprecated Use `key` instead
|
|
13
22
|
*/
|
|
@@ -16,12 +25,6 @@ interface ResolvesDuplicates {
|
|
|
16
25
|
* @deprecated Use `key` instead
|
|
17
26
|
*/
|
|
18
27
|
vmid?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Specify where to render the tag.
|
|
21
|
-
*
|
|
22
|
-
* @default 'head'
|
|
23
|
-
*/
|
|
24
|
-
tagDuplicateStrategy?: 'replace' | 'merge';
|
|
25
28
|
}
|
|
26
29
|
type ValidTagPositions = 'head' | 'bodyClose' | 'bodyOpen';
|
|
27
30
|
interface TagPosition {
|
|
@@ -63,11 +66,11 @@ interface TagPriority {
|
|
|
63
66
|
* (besides some special tags).
|
|
64
67
|
*
|
|
65
68
|
* The following special tags have default priorities:
|
|
66
|
-
* * -2
|
|
67
|
-
* * -1
|
|
68
|
-
* * 0
|
|
69
|
+
* * -2 `<meta charset ...>`
|
|
70
|
+
* * -1 `<base>`
|
|
71
|
+
* * 0 `<meta http-equiv="content-security-policy" ...>`
|
|
69
72
|
*
|
|
70
|
-
* All other tags have a default priority of 10:
|
|
73
|
+
* All other tags have a default priority of 10: `<meta>`, `<script>`, `<link>`, `<style>`, etc
|
|
71
74
|
*/
|
|
72
75
|
tagPriority?: number | 'critical' | 'high' | 'low' | `before:${string}` | `after:${string}`;
|
|
73
76
|
}
|
|
@@ -182,21 +185,21 @@ interface HeadUtils {
|
|
|
182
185
|
}
|
|
183
186
|
interface Head<E extends MergeHead = SchemaAugmentations> extends HeadUtils {
|
|
184
187
|
/**
|
|
185
|
-
* The
|
|
188
|
+
* The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
|
|
186
189
|
* It only contains text; tags within the element are ignored.
|
|
187
190
|
*
|
|
188
191
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title
|
|
189
192
|
*/
|
|
190
193
|
title?: Title | Promise<Title>;
|
|
191
194
|
/**
|
|
192
|
-
* The
|
|
195
|
+
* The `<base>` HTML element specifies the base URL to use for all relative URLs in a document.
|
|
193
196
|
* There can be only one <base> element in a document.
|
|
194
197
|
*
|
|
195
198
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
|
|
196
199
|
*/
|
|
197
200
|
base?: Base<E['base']>;
|
|
198
201
|
/**
|
|
199
|
-
* The
|
|
202
|
+
* The `<link>` HTML element specifies relationships between the current document and an external resource.
|
|
200
203
|
* This element is most commonly used to link to stylesheets, but is also used to establish site icons
|
|
201
204
|
* (both "favicon" style icons and icons for the home screen and apps on mobile devices) among other things.
|
|
202
205
|
*
|
|
@@ -204,39 +207,39 @@ interface Head<E extends MergeHead = SchemaAugmentations> extends HeadUtils {
|
|
|
204
207
|
*/
|
|
205
208
|
link?: Link<E['link']>[];
|
|
206
209
|
/**
|
|
207
|
-
* The
|
|
210
|
+
* The `<meta>` element represents metadata that cannot be expressed in other HTML elements, like `<link>` or `<script>`.
|
|
208
211
|
*
|
|
209
212
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
|
|
210
213
|
*/
|
|
211
214
|
meta?: Meta<E['meta']>[];
|
|
212
215
|
/**
|
|
213
|
-
* The
|
|
214
|
-
* It contains CSS, which is applied to the contents of the document containing the
|
|
216
|
+
* The `<style>` HTML element contains style information for a document, or part of a document.
|
|
217
|
+
* It contains CSS, which is applied to the contents of the document containing the `<style>` element.
|
|
215
218
|
*
|
|
216
219
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/style
|
|
217
220
|
*/
|
|
218
221
|
style?: (Style<E['style']> | string)[];
|
|
219
222
|
/**
|
|
220
|
-
* The
|
|
223
|
+
* The `<script>` HTML element is used to embed executable code or data; this is typically used to embed or refer to JavaScript code.
|
|
221
224
|
*
|
|
222
225
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
|
|
223
226
|
*/
|
|
224
227
|
script?: (Script<E['script']> | string)[];
|
|
225
228
|
/**
|
|
226
|
-
* The
|
|
229
|
+
* The `<noscript>` HTML element defines a section of HTML to be inserted if a script type on the page is unsupported
|
|
227
230
|
* or if scripting is currently turned off in the browser.
|
|
228
231
|
*
|
|
229
232
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/noscript
|
|
230
233
|
*/
|
|
231
234
|
noscript?: (Noscript<E['noscript']> | string)[];
|
|
232
235
|
/**
|
|
233
|
-
* Attributes for the
|
|
236
|
+
* Attributes for the `<html>` HTML element.
|
|
234
237
|
*
|
|
235
238
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/html
|
|
236
239
|
*/
|
|
237
240
|
htmlAttrs?: HtmlAttributes<E['htmlAttrs']>;
|
|
238
241
|
/**
|
|
239
|
-
* Attributes for the
|
|
242
|
+
* Attributes for the `<body>` HTML element.
|
|
240
243
|
*
|
|
241
244
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body
|
|
242
245
|
*/
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/schema",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.30",
|
|
5
5
|
"packageManager": "pnpm@8.6.2",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"hookable": "^5.5.3",
|
|
39
|
-
"zhead": "^2.0.
|
|
39
|
+
"zhead": "^2.0.9"
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "unbuild .",
|