unhead 2.1.11 → 2.1.13
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.mjs +2 -2
- package/dist/index.mjs +4 -4
- package/dist/legacy.mjs +5 -5
- package/dist/plugins.mjs +3 -3
- package/dist/server.mjs +2 -2
- package/dist/shared/{unhead.fVVqDC1O.mjs → unhead.B5FWS6X0.mjs} +14 -10
- package/dist/shared/{unhead.D_nrZZPH.mjs → unhead.Ct24BOby.mjs} +1 -1
- package/dist/shared/{unhead.DxVOmucZ.mjs → unhead.D4vSFytZ.mjs} +3 -3
- package/dist/shared/{unhead.DwlZTAdp.mjs → unhead.Dh1cQCTe.mjs} +1 -1
- package/dist/shared/{unhead.Bx2DpYJy.mjs → unhead.TxTMM7cM.mjs} +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
package/dist/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as createUnhead } from './shared/unhead.
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.Ct24BOby.mjs';
|
|
2
2
|
import { H as HasElementTags } from './shared/unhead.yem5I2v_.mjs';
|
|
3
|
-
import { i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey, h as hashTag } from './shared/unhead.
|
|
3
|
+
import { i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey, h as hashTag } from './shared/unhead.B5FWS6X0.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
import './shared/unhead.CbpEuj3y.mjs';
|
|
6
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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, a as createUnhead } 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.Dh1cQCTe.mjs';
|
|
2
|
+
export { c as createHeadCore, a as createUnhead } from './shared/unhead.Ct24BOby.mjs';
|
|
3
3
|
export { u as useScript } from './shared/unhead.BnoAbrHA.mjs';
|
|
4
|
-
import './shared/unhead.
|
|
4
|
+
import './shared/unhead.D4vSFytZ.mjs';
|
|
5
5
|
import './shared/unhead.DQc16pHI.mjs';
|
|
6
6
|
import './shared/unhead.yem5I2v_.mjs';
|
|
7
7
|
import 'hookable';
|
|
8
|
-
import './shared/unhead.
|
|
8
|
+
import './shared/unhead.B5FWS6X0.mjs';
|
|
9
9
|
import './shared/unhead.CbpEuj3y.mjs';
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as createUnhead } from './shared/unhead.
|
|
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.
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.Ct24BOby.mjs';
|
|
2
|
+
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.TxTMM7cM.mjs';
|
|
3
|
+
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.Dh1cQCTe.mjs';
|
|
4
4
|
export { u as useScript } from './shared/unhead.BnoAbrHA.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
|
-
import './shared/unhead.
|
|
6
|
+
import './shared/unhead.B5FWS6X0.mjs';
|
|
7
7
|
import './shared/unhead.yem5I2v_.mjs';
|
|
8
8
|
import './shared/unhead.CbpEuj3y.mjs';
|
|
9
|
-
import './shared/unhead.
|
|
9
|
+
import './shared/unhead.D4vSFytZ.mjs';
|
|
10
10
|
import './shared/unhead.DQc16pHI.mjs';
|
|
11
11
|
import './shared/unhead.BYvz9V1x.mjs';
|
|
12
12
|
|
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.TxTMM7cM.mjs';
|
|
2
|
+
import { d as defineHeadPlugin } from './shared/unhead.D4vSFytZ.mjs';
|
|
3
|
+
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.D4vSFytZ.mjs';
|
|
4
4
|
import './shared/unhead.CbpEuj3y.mjs';
|
|
5
5
|
import './shared/unhead.BYvz9V1x.mjs';
|
|
6
6
|
import './shared/unhead.DQc16pHI.mjs';
|
package/dist/server.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as createUnhead } from './shared/unhead.
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.Ct24BOby.mjs';
|
|
2
2
|
import { T as TagsWithInnerContent, S as SelfClosingTags } from './shared/unhead.yem5I2v_.mjs';
|
|
3
3
|
import { parseHtmlForUnheadExtraction, applyHeadToHtml, parseHtmlForIndexes } from './parser.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.B5FWS6X0.mjs';
|
|
6
6
|
import './shared/unhead.CbpEuj3y.mjs';
|
|
7
7
|
|
|
8
8
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { U as UniqueTags, T as TagsWithInnerContent, M as MetaTagsArrayable, a as TagConfigKeys, D as DupeableTags } from './unhead.yem5I2v_.mjs';
|
|
1
|
+
import { U as UniqueTags, T as TagsWithInnerContent, M as MetaTagsArrayable, H as HasElementTags, a as TagConfigKeys, D as DupeableTags } from './unhead.yem5I2v_.mjs';
|
|
2
2
|
|
|
3
3
|
const allowedMetaProperties = ["name", "property", "http-equiv"];
|
|
4
4
|
const StandardSingleMetaTags = /* @__PURE__ */ new Set([
|
|
@@ -124,17 +124,20 @@ function normalizeProps(tag, input) {
|
|
|
124
124
|
tag.props = input;
|
|
125
125
|
return tag;
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
const isHtmlTag = HasElementTags.has(tag.tag) || tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs";
|
|
128
|
+
Object.entries(input).forEach(([prop, value]) => {
|
|
129
|
+
if (prop === "__proto__" || prop === "constructor" || prop === "prototype")
|
|
130
|
+
return;
|
|
128
131
|
if (value === null) {
|
|
129
|
-
tag.props[
|
|
132
|
+
tag.props[prop] = null;
|
|
130
133
|
return;
|
|
131
134
|
}
|
|
132
|
-
if (
|
|
133
|
-
tag.props[
|
|
135
|
+
if (prop === "class" || prop === "style") {
|
|
136
|
+
tag.props[prop] = normalizeStyleClassProps(prop, value);
|
|
134
137
|
return;
|
|
135
138
|
}
|
|
136
|
-
if (TagConfigKeys.has(
|
|
137
|
-
if (
|
|
139
|
+
if (TagConfigKeys.has(prop)) {
|
|
140
|
+
if ((prop === "textContent" || prop === "innerHTML") && typeof value === "object") {
|
|
138
141
|
let type = input.type;
|
|
139
142
|
if (!input.type) {
|
|
140
143
|
type = "application/json";
|
|
@@ -144,14 +147,15 @@ function normalizeProps(tag, input) {
|
|
|
144
147
|
}
|
|
145
148
|
input.type = type;
|
|
146
149
|
tag.props.type = type;
|
|
147
|
-
tag[
|
|
150
|
+
tag[prop] = JSON.stringify(value);
|
|
148
151
|
} else {
|
|
149
|
-
tag[
|
|
152
|
+
tag[prop] = value;
|
|
150
153
|
}
|
|
151
154
|
return;
|
|
152
155
|
}
|
|
156
|
+
const isDataKey = prop.startsWith("data-");
|
|
157
|
+
const key = isHtmlTag && !isDataKey ? prop.toLowerCase() : prop;
|
|
153
158
|
const strValue = String(value);
|
|
154
|
-
const isDataKey = key.startsWith("data-");
|
|
155
159
|
const isMetaContentKey = tag.tag === "meta" && key === "content";
|
|
156
160
|
if (strValue === "true" || strValue === "") {
|
|
157
161
|
tag.props[key] = isDataKey || isMetaContentKey ? strValue : true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHooks } from 'hookable';
|
|
2
|
-
import { n as normalizeEntryToTags, d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey } from './unhead.
|
|
2
|
+
import { n as normalizeEntryToTags, d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey } from './unhead.B5FWS6X0.mjs';
|
|
3
3
|
import { t as tagWeight, s as sortTags } from './unhead.CbpEuj3y.mjs';
|
|
4
4
|
import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
|
|
5
5
|
|
|
@@ -35,8 +35,8 @@ const WhitelistAttributes = {
|
|
|
35
35
|
};
|
|
36
36
|
const BlockedLinkRels = /* @__PURE__ */ new Set(["canonical", "modulepreload", "prerender", "preload", "prefetch", "dns-prefetch", "preconnect", "manifest", "pingback"]);
|
|
37
37
|
const SafeAttrName = /^[a-z][a-z0-9\-]*[a-z0-9]$/i;
|
|
38
|
-
const HtmlEntityHex = /&#x([0-9a-f]
|
|
39
|
-
const HtmlEntityDec = /&#(\d
|
|
38
|
+
const HtmlEntityHex = /&#x([0-9a-f]+);?/gi;
|
|
39
|
+
const HtmlEntityDec = /&#(\d+);?/g;
|
|
40
40
|
const HtmlEntityNamed = /&(tab|newline|colon|semi|lpar|rpar|sol|bsol|comma|period|excl|num|dollar|percnt|amp|apos|ast|plus|lt|gt|equals|quest|at|lsqb|rsqb|lcub|rcub|vert|hat|grave|tilde|nbsp);?/gi;
|
|
41
41
|
const ControlChars = /[\x00-\x20]+/g;
|
|
42
42
|
const NamedEntityMap = {
|
|
@@ -100,7 +100,7 @@ function stripProtoKeys(obj) {
|
|
|
100
100
|
if (obj && typeof obj === "object") {
|
|
101
101
|
const clean = {};
|
|
102
102
|
for (const key of Object.keys(obj)) {
|
|
103
|
-
if (key === "__proto__" || key === "constructor")
|
|
103
|
+
if (key === "__proto__" || key === "constructor" || key === "prototype")
|
|
104
104
|
continue;
|
|
105
105
|
clean[key] = stripProtoKeys(obj[key]);
|
|
106
106
|
}
|
package/dist/utils.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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 } from './shared/unhead.yem5I2v_.mjs';
|
|
2
|
-
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.
|
|
2
|
+
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.B5FWS6X0.mjs';
|
|
3
3
|
export { r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.DQc16pHI.mjs';
|
|
4
4
|
export { s as sortTags, t as tagWeight } from './shared/unhead.CbpEuj3y.mjs';
|
|
5
5
|
export { p as processTemplateParams } from './shared/unhead.BYvz9V1x.mjs';
|