This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
+20 -6
View File
@@ -1,4 +1,3 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -30,9 +29,14 @@ module.exports = __toCommonJS(css_exports);
var import_html = require("../../helper/html");
var import_constants = require("../../jsx/constants");
var import_css = require("../../jsx/dom/css");
var import_html2 = require("../../utils/html");
var import_common = require("./common");
var import_common2 = require("./common");
const createCssContext = ({ id }) => {
const createCssContext = ({
id,
classNameSlug,
onInvalidSlug
}) => {
const [cssJsxDomObject, StyleRenderToDom] = (0, import_css.createCssJsxDomObjects)({ id });
const contextMap = /* @__PURE__ */ new WeakMap();
const nonceMap = /* @__PURE__ */ new WeakMap();
@@ -85,7 +89,14 @@ const createCssContext = ({ id }) => {
}
return Promise.resolve((0, import_html.raw)("", [appendStyle]));
};
const className = new String(cssClassName[import_common.CLASS_NAME]);
const rawClassName = cssClassName[import_common.CLASS_NAME];
let escapedClassName = rawClassName;
if (/[&<>'"]/.test(rawClassName)) {
const escapedBuffer = [""];
(0, import_html2.escapeToBuffer)(rawClassName, escapedBuffer);
escapedClassName = escapedBuffer[0];
}
const className = new String(escapedClassName);
Object.assign(className, cssClassName);
className.isEscaped = true;
className.callbacks = [addClassNameToContext];
@@ -95,15 +106,18 @@ const createCssContext = ({ id }) => {
return promise;
};
const css2 = (strings, ...values) => {
return newCssClassNameObject((0, import_common.cssCommon)(strings, values));
return newCssClassNameObject((0, import_common.cssCommon)(strings, values, classNameSlug, onInvalidSlug));
};
const cx2 = (...args) => {
args = (0, import_common.cxCommon)(args);
return css2(Array(args.length).fill(""), ...args);
};
const keyframes2 = import_common.keyframesCommon;
const keyframes2 = (strings, ...values) => (0, import_common.keyframesCommon)(strings, values, classNameSlug, onInvalidSlug);
const viewTransition2 = ((strings, ...values) => {
return newCssClassNameObject((0, import_common.viewTransitionCommon)(strings, values));
return newCssClassNameObject(
(0, import_common.viewTransitionCommon)(strings, values, classNameSlug, onInvalidSlug)
// eslint-disable-line @typescript-eslint/no-explicit-any
);
});
const Style2 = ({ children, nonce } = {}) => (0, import_html.raw)(
`<style id="${id}"${nonce ? ` nonce="${nonce}"` : ""}>${children ? children[import_common.STYLE_STRING] : ""}</style>`,