fix price and modular
This commit is contained in:
+3
-3
@@ -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.DH45uomy.mjs';
|
||||
export { c as createHeadCore, a as createUnhead } from './shared/unhead.CGCfDSEL.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.BpRRHAhY.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
import './shared/unhead.CYpwL2hc.mjs';
|
||||
import './shared/unhead.CbpEuj3y.mjs';
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.Djo8ep_Y.mjs';
|
||||
export { A as AliasSortingPlugin, D as DeprecationsPlugin, P as PromisesPlugin, T as TemplateParamsPlugin } from './shared/unhead.ckV6dpEQ.mjs';
|
||||
import { d as defineHeadPlugin } from './shared/unhead.CApf5sj3.mjs';
|
||||
export { F as FlatMetaPlugin, S as SafeInputPlugin } from './shared/unhead.CApf5sj3.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
import './shared/unhead.CbpEuj3y.mjs';
|
||||
import './shared/unhead.BYvz9V1x.mjs';
|
||||
import './shared/unhead.DQc16pHI.mjs';
|
||||
import './shared/unhead.yem5I2v_.mjs';
|
||||
|
||||
+4
-6
@@ -1,9 +1,9 @@
|
||||
import { a as createUnhead } from './shared/unhead.DH45uomy.mjs';
|
||||
import { a as createUnhead } from './shared/unhead.CGCfDSEL.mjs';
|
||||
import { T as TagsWithInnerContent, S as SelfClosingTags } from './shared/unhead.yem5I2v_.mjs';
|
||||
import { parseHtmlForUnheadExtraction } from './parser.mjs';
|
||||
import { parseHtmlForUnheadExtraction, applyHeadToHtml, parseHtmlForIndexes } from './parser.mjs';
|
||||
import 'hookable';
|
||||
import './shared/unhead.BpRRHAhY.mjs';
|
||||
import './shared/unhead.DZbvapt-.mjs';
|
||||
import './shared/unhead.CYpwL2hc.mjs';
|
||||
import './shared/unhead.CbpEuj3y.mjs';
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
function createHead(options = {}) {
|
||||
@@ -165,7 +165,6 @@ async function renderSSRHead(head, options) {
|
||||
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
async function transformHtmlTemplate(head, html, options) {
|
||||
const { parseHtmlForUnheadExtraction, applyHeadToHtml } = await import('./parser.mjs');
|
||||
const template = parseHtmlForUnheadExtraction(html);
|
||||
head.push(template.input, { _index: 0 });
|
||||
const headHtml = await renderSSRHead(head, options);
|
||||
@@ -173,7 +172,6 @@ async function transformHtmlTemplate(head, html, options) {
|
||||
}
|
||||
// @__NO_SIDE_EFFECTS__
|
||||
async function transformHtmlTemplateRaw(head, html, options) {
|
||||
const { parseHtmlForIndexes, applyHeadToHtml } = await import('./parser.mjs');
|
||||
const headHtml = await renderSSRHead(head, options);
|
||||
const template = parseHtmlForIndexes(html);
|
||||
return applyHeadToHtml(template, headHtml);
|
||||
|
||||
Generated
Vendored
+3
-3
@@ -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") {
|
||||
Generated
Vendored
+12
-12
@@ -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) {
|
||||
Generated
Vendored
+3
-2
@@ -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") {
|
||||
Generated
Vendored
+1
-1
@@ -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;
|
||||
+2
-2
@@ -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.BpRRHAhY.mjs';
|
||||
export { d as dedupeKey, h as hashTag, i as isMetaArrayDupeKey, n as normalizeEntryToTags, a as normalizeProps, w as walkResolver } from './shared/unhead.CYpwL2hc.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 { s as sortTags, t as tagWeight } from './shared/unhead.CbpEuj3y.mjs';
|
||||
export { p as processTemplateParams } from './shared/unhead.BYvz9V1x.mjs';
|
||||
|
||||
Reference in New Issue
Block a user