4/5/1404
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
||||
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';
|
||||
export { c as createHeadCore, a as createUnhead } from './shared/unhead.CAk5S5m6.mjs';
|
||||
export { c as createHeadCore, a as createUnhead } from './shared/unhead.CXyUfY4l.mjs';
|
||||
export { u as useScript } from './shared/unhead.B578PsDV.mjs';
|
||||
import './shared/unhead.CApf5sj3.mjs';
|
||||
import './shared/unhead.DQc16pHI.mjs';
|
||||
import './shared/unhead.yem5I2v_.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.Di5OD67x.mjs';
|
||||
import './shared/unhead.ytfIU1HR.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { a as createUnhead } from './shared/unhead.CAk5S5m6.mjs';
|
||||
import { a as createUnhead } from './shared/unhead.CXyUfY4l.mjs';
|
||||
import { T as TagsWithInnerContent, S as SelfClosingTags$1 } from './shared/unhead.yem5I2v_.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.Di5OD67x.mjs';
|
||||
import './shared/unhead.ytfIU1HR.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
|
||||
Generated
Vendored
+6
-14
@@ -1,5 +1,5 @@
|
||||
import { createHooks } from 'hookable';
|
||||
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.Di5OD67x.mjs';
|
||||
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.ytfIU1HR.mjs';
|
||||
import { t as tagWeight, s as sortTags } from './unhead.DZbvapt-.mjs';
|
||||
import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
|
||||
|
||||
@@ -23,7 +23,7 @@ function createUnhead(resolvedOptions = {}) {
|
||||
const ssr = !resolvedOptions.document;
|
||||
const entries = /* @__PURE__ */ new Map();
|
||||
const plugins = /* @__PURE__ */ new Map();
|
||||
const normalizeQueue = /* @__PURE__ */ new Set();
|
||||
const normalizeQueue = [];
|
||||
const head = {
|
||||
_entryCount: 1,
|
||||
// 0 is reserved for internal use
|
||||
@@ -45,12 +45,12 @@ function createUnhead(resolvedOptions = {}) {
|
||||
const _ = {
|
||||
_poll(rm = false) {
|
||||
head.dirty = true;
|
||||
!rm && normalizeQueue.add(_i);
|
||||
!rm && normalizeQueue.push(_i);
|
||||
hooks.callHook("entries:updated", head);
|
||||
},
|
||||
dispose() {
|
||||
if (entries.delete(_i)) {
|
||||
head.invalidate();
|
||||
_._poll(true);
|
||||
}
|
||||
},
|
||||
// a patch is the same as creating a new entry, just a nice DX
|
||||
@@ -72,9 +72,8 @@ function createUnhead(resolvedOptions = {}) {
|
||||
entries: [...head.entries.values()]
|
||||
};
|
||||
await hooks.callHook("entries:resolve", ctx);
|
||||
while (normalizeQueue.size) {
|
||||
const i = normalizeQueue.values().next().value;
|
||||
normalizeQueue.delete(i);
|
||||
while (normalizeQueue.length) {
|
||||
const i = normalizeQueue.shift();
|
||||
const e = entries.get(i);
|
||||
if (e) {
|
||||
const normalizeCtx = {
|
||||
@@ -162,13 +161,6 @@ function createUnhead(resolvedOptions = {}) {
|
||||
finalTags.push(t);
|
||||
}
|
||||
return finalTags;
|
||||
},
|
||||
invalidate() {
|
||||
for (const entry of entries.values()) {
|
||||
normalizeQueue.add(entry._i);
|
||||
}
|
||||
head.dirty = true;
|
||||
hooks.callHook("entries:updated", head);
|
||||
}
|
||||
};
|
||||
(resolvedOptions?.plugins || []).forEach((p) => registerPlugin(head, p));
|
||||
Generated
Vendored
+1
-12
@@ -1,12 +1,6 @@
|
||||
import { U as UniqueTags, T as TagsWithInnerContent, M as MetaTagsArrayable, a as TagConfigKeys, D as DupeableTags } from './unhead.yem5I2v_.mjs';
|
||||
|
||||
const allowedMetaProperties = ["name", "property", "http-equiv"];
|
||||
const StandardSingleMetaTags = /* @__PURE__ */ new Set([
|
||||
"viewport",
|
||||
"description",
|
||||
"keywords",
|
||||
"robots"
|
||||
]);
|
||||
function isMetaArrayDupeKey(v) {
|
||||
const parts = v.split(":");
|
||||
if (!parts.length)
|
||||
@@ -24,12 +18,7 @@ function dedupeKey(tag) {
|
||||
if (tag.tag === "meta") {
|
||||
for (const n of allowedMetaProperties) {
|
||||
if (props[n] !== void 0) {
|
||||
const propValue = props[n];
|
||||
const isStructured = propValue.includes(":");
|
||||
const isStandardSingle = StandardSingleMetaTags.has(propValue);
|
||||
const shouldAlwaysDedupe = isStructured || isStandardSingle;
|
||||
const keyPart = !shouldAlwaysDedupe && tag.key ? `:key:${tag.key}` : "";
|
||||
return `${name}:${propValue}${keyPart}`;
|
||||
return `${name}:${props[n]}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
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';
|
||||
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.Di5OD67x.mjs';
|
||||
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.ytfIU1HR.mjs';
|
||||
export { r as resolveMetaKeyType, a as resolveMetaKeyValue, b as resolvePackedMetaObjectValue, u as unpackMeta } from './shared/unhead.DQc16pHI.mjs';
|
||||
export { s as sortTags, t as tagWeight } from './shared/unhead.DZbvapt-.mjs';
|
||||
export { p as processTemplateParams } from './shared/unhead.C13swrCa.mjs';
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "unhead",
|
||||
"type": "module",
|
||||
"version": "2.0.12",
|
||||
"version": "2.0.10",
|
||||
"description": "Full-stack <head> manager built for any framework.",
|
||||
"author": {
|
||||
"name": "Harlan Wilton",
|
||||
|
||||
Reference in New Issue
Block a user