unhead 2.0.12 → 2.0.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 +2 -2
- package/dist/legacy.mjs +4 -4
- package/dist/plugins.mjs +14 -8
- package/dist/server.mjs +2 -2
- package/dist/shared/{unhead.C13swrCa.mjs → unhead.BYvz9V1x.mjs} +1 -6
- package/dist/shared/{unhead.Di5OD67x.mjs → unhead.BpRRHAhY.mjs} +4 -0
- package/dist/shared/{unhead.CAk5S5m6.mjs → unhead.DH45uomy.mjs} +1 -1
- package/dist/shared/{unhead.DeCxexjU.mjs → unhead.Djo8ep_Y.mjs} +1 -1
- package/dist/utils.mjs +2 -2
- 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.DH45uomy.mjs';
|
|
2
2
|
import { H as HasElementTags } from './shared/unhead.yem5I2v_.mjs';
|
|
3
|
-
import { h as hashTag, i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey } from './shared/unhead.
|
|
3
|
+
import { h as hashTag, i as isMetaArrayDupeKey, a as normalizeProps, d as dedupeKey } from './shared/unhead.BpRRHAhY.mjs';
|
|
4
4
|
import 'hookable';
|
|
5
5
|
import './shared/unhead.DZbvapt-.mjs';
|
|
6
6
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.BPM0-cfG.mjs';
|
|
2
|
-
export { c as createHeadCore, a as createUnhead } from './shared/unhead.
|
|
2
|
+
export { c as createHeadCore, a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
|
3
3
|
export { u as useScript } from './shared/unhead.B578PsDV.mjs';
|
|
4
4
|
import './shared/unhead.CApf5sj3.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.BpRRHAhY.mjs';
|
|
9
9
|
import './shared/unhead.DZbvapt-.mjs';
|
package/dist/legacy.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
|
2
|
+
import { D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin, A as AliasSortingPlugin } from './shared/unhead.Djo8ep_Y.mjs';
|
|
3
3
|
export { u as useHead, a as useHeadSafe, b as useSeoMeta, c as useServerHead, d as useServerHeadSafe, e as useServerSeoMeta } from './shared/unhead.BPM0-cfG.mjs';
|
|
4
4
|
export { u as useScript } from './shared/unhead.B578PsDV.mjs';
|
|
5
5
|
import 'hookable';
|
|
6
|
-
import './shared/unhead.
|
|
6
|
+
import './shared/unhead.BpRRHAhY.mjs';
|
|
7
7
|
import './shared/unhead.yem5I2v_.mjs';
|
|
8
8
|
import './shared/unhead.DZbvapt-.mjs';
|
|
9
9
|
import './shared/unhead.CApf5sj3.mjs';
|
|
10
10
|
import './shared/unhead.DQc16pHI.mjs';
|
|
11
|
-
import './shared/unhead.
|
|
11
|
+
import './shared/unhead.BYvz9V1x.mjs';
|
|
12
12
|
|
|
13
13
|
const activeHead = { value: null };
|
|
14
14
|
function getActiveHead() {
|
package/dist/plugins.mjs
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
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.Djo8ep_Y.mjs';
|
|
2
2
|
import { d as defineHeadPlugin } from './shared/unhead.CApf5sj3.mjs';
|
|
3
3
|
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.CApf5sj3.mjs';
|
|
4
4
|
import './shared/unhead.DZbvapt-.mjs';
|
|
5
|
-
import './shared/unhead.
|
|
5
|
+
import './shared/unhead.BYvz9V1x.mjs';
|
|
6
6
|
import './shared/unhead.DQc16pHI.mjs';
|
|
7
7
|
import './shared/unhead.yem5I2v_.mjs';
|
|
8
8
|
|
|
9
|
+
const META_TRANSFORMABLE_URL = [
|
|
10
|
+
"og:url",
|
|
11
|
+
"og:image",
|
|
12
|
+
"og:image:secure_url",
|
|
13
|
+
"twitter:image",
|
|
14
|
+
"twitter:image:src",
|
|
15
|
+
"og:video",
|
|
16
|
+
"og:video:secure_url",
|
|
17
|
+
"og:see_also"
|
|
18
|
+
];
|
|
9
19
|
function CanonicalPlugin(options) {
|
|
10
20
|
return (head) => {
|
|
11
21
|
let host = options.canonicalHost || (!head.ssr ? window.location.origin : "");
|
|
@@ -30,12 +40,8 @@ function CanonicalPlugin(options) {
|
|
|
30
40
|
hooks: {
|
|
31
41
|
"tags:resolve": (ctx) => {
|
|
32
42
|
for (const tag of ctx.tags) {
|
|
33
|
-
if (tag.tag === "meta") {
|
|
34
|
-
|
|
35
|
-
tag.props.content = resolvePath(tag.props.content);
|
|
36
|
-
} else if (tag.props?.property === "og:url") {
|
|
37
|
-
tag.props.content = resolvePath(tag.props.content);
|
|
38
|
-
}
|
|
43
|
+
if (tag.tag === "meta" && (META_TRANSFORMABLE_URL.includes(tag.props?.property) || META_TRANSFORMABLE_URL.includes(tag.props?.name))) {
|
|
44
|
+
tag.props.content = resolvePath(tag.props.content);
|
|
39
45
|
} else if (tag.tag === "link" && tag.props.rel === "canonical") {
|
|
40
46
|
tag.props.href = resolvePath(tag.props.href);
|
|
41
47
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as createUnhead } from './shared/unhead.
|
|
1
|
+
import { a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
|
2
2
|
import { T as TagsWithInnerContent, S as SelfClosingTags$1 } from './shared/unhead.yem5I2v_.mjs';
|
|
3
3
|
import 'hookable';
|
|
4
|
-
import './shared/unhead.
|
|
4
|
+
import './shared/unhead.BpRRHAhY.mjs';
|
|
5
5
|
import './shared/unhead.DZbvapt-.mjs';
|
|
6
6
|
|
|
7
7
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
const SepSub = "%separator";
|
|
2
|
-
const SepSubRE = new RegExp(`${SepSub}(?:\\s*${SepSub})*`, "g");
|
|
3
2
|
function sub(p, token, isJson = false) {
|
|
4
3
|
let val;
|
|
5
4
|
if (token === "s" || token === "pageTitle") {
|
|
@@ -36,11 +35,7 @@ function processTemplateParams(s, p, sep, isJson = false) {
|
|
|
36
35
|
return re !== void 0 ? re : token;
|
|
37
36
|
}).trim();
|
|
38
37
|
if (hasSepSub) {
|
|
39
|
-
|
|
40
|
-
s = s.slice(0, -SepSub.length);
|
|
41
|
-
if (s.startsWith(SepSub))
|
|
42
|
-
s = s.slice(SepSub.length);
|
|
43
|
-
s = s.replace(SepSubRE, sep || "").trim();
|
|
38
|
+
s = s.split(SepSub).map((part) => part.trim()).filter((part) => part !== "").join(sep ? ` ${sep} ` : " ");
|
|
44
39
|
}
|
|
45
40
|
return s;
|
|
46
41
|
}
|
|
@@ -112,6 +112,10 @@ function normalizeProps(tag, input) {
|
|
|
112
112
|
if (!input) {
|
|
113
113
|
return tag;
|
|
114
114
|
}
|
|
115
|
+
if (tag.tag === "templateParams") {
|
|
116
|
+
tag.props = input;
|
|
117
|
+
return tag;
|
|
118
|
+
}
|
|
115
119
|
Object.entries(input).forEach(([key, value]) => {
|
|
116
120
|
if (value === null) {
|
|
117
121
|
tag.props[key] = null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createHooks } from 'hookable';
|
|
2
|
-
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.
|
|
2
|
+
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.BpRRHAhY.mjs';
|
|
3
3
|
import { t as tagWeight, s as sortTags } from './unhead.DZbvapt-.mjs';
|
|
4
4
|
import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { d as defineHeadPlugin } from './unhead.CApf5sj3.mjs';
|
|
2
2
|
import { s as sortTags } from './unhead.DZbvapt-.mjs';
|
|
3
|
-
import { p as processTemplateParams } from './unhead.
|
|
3
|
+
import { p as processTemplateParams } from './unhead.BYvz9V1x.mjs';
|
|
4
4
|
|
|
5
5
|
const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;
|
|
6
6
|
const AliasSortingPlugin = defineHeadPlugin({
|
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.BpRRHAhY.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.DZbvapt-.mjs';
|
|
5
|
-
export { p as processTemplateParams } from './shared/unhead.
|
|
5
|
+
export { p as processTemplateParams } from './shared/unhead.BYvz9V1x.mjs';
|