nuxt4, and some changes on packages

This commit is contained in:
2025-08-19 21:38:30 +03:30
parent 61fee6c3da
commit 5b6f1a1cdf
900 changed files with 11139 additions and 15161 deletions
@@ -1,5 +1,4 @@
const SepSub = "%separator";
const SepSubRE = new RegExp(`${SepSub}(?:\\s*${SepSub})*`, "g");
function sub(p, token, isJson = false) {
let val;
if (token === "s" || token === "pageTitle") {
@@ -36,11 +35,7 @@ function processTemplateParams(s, p, sep, isJson = false) {
return re !== void 0 ? re : token;
}).trim();
if (hasSepSub) {
if (s.endsWith(SepSub))
s = s.slice(0, -SepSub.length);
if (s.startsWith(SepSub))
s = s.slice(SepSub.length);
s = s.replace(SepSubRE, sep || "").trim();
s = s.split(SepSub).map((part) => part.trim()).filter((part) => part !== "").join(sep ? ` ${sep} ` : " ");
}
return s;
}
@@ -1,6 +1,12 @@
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)
@@ -18,7 +24,12 @@ function dedupeKey(tag) {
if (tag.tag === "meta") {
for (const n of allowedMetaProperties) {
if (props[n] !== void 0) {
return `${name}:${props[n]}`;
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}`;
}
}
}
@@ -101,6 +112,10 @@ function normalizeProps(tag, input) {
if (!input) {
return tag;
}
if (tag.tag === "templateParams") {
tag.props = input;
return tag;
}
Object.entries(input).forEach(([key, value]) => {
if (value === null) {
tag.props[key] = null;
@@ -1,5 +1,5 @@
import { createHooks } from 'hookable';
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.ytfIU1HR.mjs';
import { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.BpRRHAhY.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 = [];
const normalizeQueue = /* @__PURE__ */ new Set();
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.push(_i);
!rm && normalizeQueue.add(_i);
hooks.callHook("entries:updated", head);
},
dispose() {
if (entries.delete(_i)) {
_._poll(true);
head.invalidate();
}
},
// a patch is the same as creating a new entry, just a nice DX
@@ -72,8 +72,9 @@ function createUnhead(resolvedOptions = {}) {
entries: [...head.entries.values()]
};
await hooks.callHook("entries:resolve", ctx);
while (normalizeQueue.length) {
const i = normalizeQueue.shift();
while (normalizeQueue.size) {
const i = normalizeQueue.values().next().value;
normalizeQueue.delete(i);
const e = entries.get(i);
if (e) {
const normalizeCtx = {
@@ -161,6 +162,13 @@ 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));
@@ -1,6 +1,6 @@
import { d as defineHeadPlugin } from './unhead.CApf5sj3.mjs';
import { s as sortTags } from './unhead.DZbvapt-.mjs';
import { p as processTemplateParams } from './unhead.C13swrCa.mjs';
import { p as processTemplateParams } from './unhead.BYvz9V1x.mjs';
const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;
const AliasSortingPlugin = defineHeadPlugin({