fix price and modular

This commit is contained in:
2026-02-01 17:38:39 +03:30
parent 55f34aa15d
commit 164542d3e2
801 changed files with 16129 additions and 14478 deletions
@@ -1,6 +1,6 @@
import { createHooks } from 'hookable';
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 { n as normalizeEntryToTags, d as dedupeKey, i as isMetaArrayDupeKey } from './unhead.CYpwL2hc.mjs';
import { t as tagWeight, s as sortTags } from './unhead.CbpEuj3y.mjs';
import { c as UsesMergeStrategy, V as ValidHeadTags } from './unhead.yem5I2v_.mjs';
function registerPlugin(head, p) {
@@ -151,7 +151,7 @@ function createUnhead(resolvedOptions = {}) {
continue;
}
if (tag === "script" && innerHTML) {
if (props.type?.endsWith("json")) {
if (String(props.type).endsWith("json")) {
const v = typeof innerHTML === "string" ? innerHTML : JSON.stringify(innerHTML);
t.innerHTML = v.replace(/</g, "\\u003C");
} else if (typeof innerHTML === "string") {
@@ -25,8 +25,8 @@ function dedupeKey(tag) {
for (const n of allowedMetaProperties) {
if (props[n] !== void 0) {
const propValue = props[n];
const isStructured = propValue.includes(":");
const isStandardSingle = StandardSingleMetaTags.has(propValue);
const isStructured = propValue && typeof propValue === "string" && propValue.includes(":");
const isStandardSingle = propValue && StandardSingleMetaTags.has(propValue);
const shouldAlwaysDedupe = isStructured || isStandardSingle;
const keyPart = !shouldAlwaysDedupe && tag.key ? `:key:${tag.key}` : "";
return `${name}:${propValue}${keyPart}`;
@@ -63,17 +63,14 @@ function walkResolver(val, resolve, key) {
val = val();
}
}
let v;
if (resolve) {
v = resolve(key, val);
}
const v = resolve ? resolve(key, val) : val;
if (Array.isArray(v)) {
return v.map((r) => walkResolver(r, resolve));
}
if (v?.constructor === Object) {
const next = {};
for (const key2 of Object.keys(v)) {
next[key2] = walkResolver(v[key2], resolve, key2);
for (const k of Object.keys(v)) {
next[k] = walkResolver(v[k], resolve, k);
}
return next;
}
@@ -83,11 +80,13 @@ function walkResolver(val, resolve, key) {
function normalizeStyleClassProps(key, value) {
const store = key === "style" ? /* @__PURE__ */ new Map() : /* @__PURE__ */ new Set();
function processValue(rawValue) {
const value2 = rawValue.trim();
if (rawValue == null || rawValue === void 0)
return;
const value2 = String(rawValue).trim();
if (!value2)
return;
if (key === "style") {
const [k, ...v] = value2.split(":").map((s) => s.trim());
const [k, ...v] = value2.split(":").map((s) => s ? s.trim() : "");
if (k && v.length)
store.set(k, v.join(":"));
} else {
@@ -101,7 +100,7 @@ function normalizeStyleClassProps(key, value) {
} else if (value && typeof value === "object") {
Object.entries(value).forEach(([k, v]) => {
if (v && v !== "false") {
key === "style" ? store.set(k.trim(), v) : processValue(k);
key === "style" ? store.set(String(k).trim(), String(v)) : processValue(k);
}
});
}
@@ -144,8 +143,9 @@ function normalizeProps(tag, input) {
}
const strValue = String(value);
const isDataKey = key.startsWith("data-");
const isMetaContentKey = tag.tag === "meta" && key === "content";
if (strValue === "true" || strValue === "") {
tag.props[key] = isDataKey ? strValue : true;
tag.props[key] = isDataKey || isMetaContentKey ? strValue : true;
} else if (!value && isDataKey && strValue === "false") {
tag.props[key] = "false";
} else if (value !== void 0) {
@@ -54,11 +54,12 @@ function tagWeight(head, tag) {
} else if (tag.tag === "link" && tag.props.rel) {
weight = weightMap.link[tag.props.rel];
} else if (tag.tag === "script") {
const type = String(tag.props.type);
if (isTruthy(tag.props.async)) {
weight = weightMap.script.async;
} else if (tag.props.src && !isTruthy(tag.props.defer) && !isTruthy(tag.props.async) && tag.props.type !== "module" && !tag.props.type?.endsWith("json")) {
} else if (tag.props.src && !isTruthy(tag.props.defer) && !isTruthy(tag.props.async) && type !== "module" && !type.endsWith("json") || tag.innerHTML && !type.endsWith("json")) {
weight = weightMap.script.sync;
} else if (isTruthy(tag.props.defer) && tag.props.src && !isTruthy(tag.props.async)) {
} else if (isTruthy(tag.props.defer) && tag.props.src && !isTruthy(tag.props.async) || type === "module") {
weight = weightMap.script.defer;
}
} else if (tag.tag === "style") {
@@ -1,5 +1,5 @@
import { d as defineHeadPlugin } from './unhead.CApf5sj3.mjs';
import { s as sortTags } from './unhead.DZbvapt-.mjs';
import { s as sortTags } from './unhead.CbpEuj3y.mjs';
import { p as processTemplateParams } from './unhead.BYvz9V1x.mjs';
const formatKey = (k) => !k.includes(":key") ? k.split(":").join(":key:") : k;