@homebound/truss 2.19.3 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/runtime.js CHANGED
@@ -21,6 +21,7 @@ function trussProps(...hashes) {
21
21
  const inlineStyle = {};
22
22
  const debugSources = [];
23
23
  for (const [key, value] of Object.entries(merged)) {
24
+ if (key === "$css") continue;
24
25
  if (key === "__marker") {
25
26
  if (typeof value === "string") {
26
27
  classNames.push(value);
@@ -145,6 +146,7 @@ ${body}
145
146
  function formatRuntimeStyleRule(selector, declarations) {
146
147
  const lines = [];
147
148
  for (const [property, value] of Object.entries(declarations)) {
149
+ if (property === "$css") continue;
148
150
  if (value === void 0 || value === null) continue;
149
151
  if (typeof value !== "string" && typeof value !== "number") {
150
152
  throw new Error(runtimeStyleUnsupportedValueMessage(selector, property));
@@ -187,12 +189,8 @@ function resolveShouldValidateTrussStyleValues() {
187
189
  return process.env.NODE_ENV !== "production";
188
190
  }
189
191
  const viteEnv = import.meta.env;
190
- if (typeof viteEnv?.DEV === "boolean") {
191
- return viteEnv.DEV;
192
- }
193
- if (typeof viteEnv?.PROD === "boolean") {
194
- return !viteEnv.PROD;
195
- }
192
+ if (typeof viteEnv?.DEV === "boolean") return viteEnv.DEV;
193
+ if (typeof viteEnv?.PROD === "boolean") return !viteEnv.PROD;
196
194
  return false;
197
195
  }
198
196
  function resolveShouldEmitTrussSrcAttribute() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/runtime.ts"],"sourcesContent":["import { useInsertionEffect } from \"react\";\n\n/** A compact source label for a Truss CSS expression, used in debug mode. */\nexport class TrussDebugInfo {\n /** I.e. `\"FileName.tsx:line\"` */\n readonly src: string;\n\n constructor(src: string) {\n this.src = src;\n }\n}\n\n/**\n * Space-separated atomic class names, or a variable tuple with class names + CSS variable map.\n *\n * In debug mode, the transform appends a TrussDebugInfo as an extra tuple element:\n * - static with debug: `[classNames, debugInfo]`\n * - variable with debug: `[classNames, vars, debugInfo]`\n */\nexport type TrussStyleValue =\n | string\n | [classNames: string, vars: Record<string, string>]\n | [classNames: string, debugInfo: TrussDebugInfo]\n | [classNames: string, vars: Record<string, string>, debugInfo: TrussDebugInfo];\n\n/** A property-keyed style hash where each key owns one logical CSS property. */\nexport type TrussCustomClassNameValue = string | ReadonlyArray<string | false | null | undefined>;\nexport type RuntimeStyleDeclarationValue = string | number | null | undefined;\nexport type TrussInlineStyleValue = Record<string, RuntimeStyleDeclarationValue> | false | null | undefined;\nexport type TrussStyleHash = Record<string, TrussStyleValue | TrussCustomClassNameValue | TrussInlineStyleValue>;\nexport type RuntimeStyleDeclarations = Record<string, RuntimeStyleDeclarationValue | Record<string, unknown>>;\nexport type RuntimeStyleCss = Record<string, RuntimeStyleDeclarations | string>;\n\nconst shouldValidateTrussStyleValues = resolveShouldValidateTrussStyleValues();\nconst shouldEmitTrussSrcAttribute = resolveShouldEmitTrussSrcAttribute();\nconst TRUSS_CSS_CHUNKS = \"__trussCssChunks__\";\nlet trussStyleElement: TrussStyleElement | null = null;\n\n/** Merge one or more Truss style hashes into `{ className, style?, data-truss-src? }`. */\nexport function trussProps(\n ...hashes: ReadonlyArray<TrussStyleHash | false | null | undefined>\n): Record<string, unknown> {\n const merged: Record<string, unknown> = {};\n\n for (const hash of hashes) {\n if (!hash || typeof hash !== \"object\") continue;\n Object.assign(merged, hash);\n }\n\n const classNames: string[] = [];\n const inlineStyle: Record<string, unknown> = {};\n const debugSources: string[] = [];\n\n for (const [key, value] of Object.entries(merged)) {\n // __marker is a special key — its value is a marker class name, not a CSS property\n if (key === \"__marker\") {\n if (typeof value === \"string\") {\n classNames.push(value);\n }\n continue;\n }\n\n if (key.startsWith(\"className_\")) {\n // I.e. plugin-emitted raw class names that should flow straight into the final prop.\n appendCustomClassNames(classNames, value);\n continue;\n }\n\n if (key.startsWith(\"style_\")) {\n appendInlineStyles(inlineStyle, value);\n continue;\n }\n\n if (shouldValidateTrussStyleValues) assertValidTrussStyleValue(key, value);\n const trussValue = value as TrussStyleValue;\n\n if (typeof trussValue === \"string\") {\n // I.e. \"df\" or \"black blue_h\"\n classNames.push(trussValue);\n continue;\n }\n\n // Tuple: [classNames, varsOrDebug?, maybeDebug?]\n classNames.push(trussValue[0]);\n\n for (let i = 1; i < trussValue.length; i++) {\n const el = trussValue[i];\n if (el instanceof TrussDebugInfo) {\n debugSources.push(el.src);\n } else if (typeof el === \"object\" && el !== null) {\n Object.assign(inlineStyle, el);\n }\n }\n }\n\n const props: Record<string, unknown> = {\n className: classNames.join(\" \"),\n };\n\n if (Object.keys(inlineStyle).length > 0) {\n props.style = inlineStyle;\n }\n\n if (shouldEmitTrussSrcAttribute && debugSources.length > 0) {\n props[\"data-truss-src\"] = [...new Set(debugSources)].join(\"; \");\n }\n\n return props;\n}\n\nfunction appendCustomClassNames(classNames: string[], value: unknown): void {\n if (typeof value === \"string\") {\n // I.e. `className_button: \"button\"`\n classNames.push(value);\n return;\n }\n\n if (!Array.isArray(value)) return;\n for (const entry of value) {\n if (typeof entry === \"string\") {\n // I.e. `className_button: [\"button\", cond && \"selected\"]`\n classNames.push(entry);\n }\n }\n}\n\nfunction appendInlineStyles(inlineStyle: Record<string, unknown>, value: unknown): void {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return;\n }\n\n for (const [key, entry] of Object.entries(value)) {\n if (entry === undefined || entry === null) {\n continue;\n }\n if (typeof entry === \"string\" || typeof entry === \"number\") {\n inlineStyle[key] = entry;\n }\n }\n}\n\n/** Merge explicit className/style with Truss style hashes. */\nexport function mergeProps(\n explicitClassName: string | undefined,\n explicitStyle: Record<string, unknown> | undefined,\n ...hashes: ReadonlyArray<TrussStyleHash | false | null | undefined>\n): Record<string, unknown> {\n const result = trussProps(...hashes);\n\n if (explicitClassName) {\n result.className = `${explicitClassName} ${result.className ?? \"\"}`.trim();\n }\n\n if (explicitStyle) {\n result.style = { ...explicitStyle, ...(result.style as Record<string, unknown> | undefined) };\n }\n\n return result;\n}\n\n/**\n * Inject CSS text into the document for jsdom/test environments.\n *\n * In browser dev mode, CSS is served via the Vite virtual endpoint instead.\n */\nexport function __injectTrussCSS(cssText: string): void {\n if (typeof document === \"undefined\" || cssText.length === 0) return;\n\n const style = getOrCreateTrussStyleElement();\n\n // Track exact injected chunks on the style node so repeated execution of the\n // test bootstrap or transformed modules does not append duplicate CSS text.\n const injectedChunks = (style[TRUSS_CSS_CHUNKS] ??= new Set<string>());\n if (injectedChunks.has(cssText) || style.textContent?.includes(cssText)) {\n injectedChunks.add(cssText);\n return;\n }\n\n injectedChunks.add(cssText);\n style.textContent = (style.textContent ?? \"\") + cssText;\n}\n\nexport interface RuntimeStyleProps {\n css: RuntimeStyleCss;\n}\n\n/**\n * Inject dynamic or selector-based CSS at runtime into a transient `<style>` tag.\n *\n * This is the runtime counterpart to `.css.ts` files:\n * - use `.css.ts` for static/global arbitrary selectors that should be baked into the build output\n * - use `RuntimeStyle` for selectors that depend on runtime values or should only exist while a component is mounted\n *\n * Example with a flat `Css` expression:\n * ```tsx\n * <RuntimeStyle\n * css={{\n * \".preview a\": Css.blue.$,\n * }}\n * />\n * ```\n *\n * Example with raw CSS via `Css.raw`:\n * ```tsx\n * <RuntimeStyle\n * css={{\n * \".preview code\": Css.raw`\n * font-variant-ligatures: none;\n * text-decoration: underline;\n * `,\n * }}\n * />\n * ```\n *\n * The injected `<style>` element is appended on mount and removed on unmount.\n *\n * Note: Only flat `Css.*.$` expressions are supported here; selector/marker helpers like\n * `onHover`, `when`, `ifSm`, `ifContainer`, `element`, `className()`, and `style()` are rejected\n * at runtime.\n */\nexport function RuntimeStyle(props: RuntimeStyleProps): null {\n useRuntimeStyle(props.css);\n return null;\n}\n\n/**\n * Hook that injects dynamic or selector-based CSS at runtime into a transient `<style>` tag.\n *\n * This is the hook counterpart to the `RuntimeStyle` component and `.css.ts` files:\n * - use `.css.ts` for static/global arbitrary selectors baked into the build output\n * - use `useRuntimeStyle` when you need the same thing from a hook instead of a component\n *\n * Example with a flat `Css` expression:\n * ```ts\n * useRuntimeStyle({ \"body\": Css.mbPx(dynamicValue).$ });\n * ```\n *\n * Example with raw CSS via `Css.raw`:\n * ```ts\n * useRuntimeStyle({ \".preview code\": Css.raw`font-variant-ligatures: none;` });\n * ```\n *\n * The injected `<style>` element is appended on mount and removed on unmount.\n *\n * Note: Only flat `Css.*.$` expressions are supported here; selector/marker helpers like\n * `onHover`, `when`, `ifSm`, `ifContainer`, `element`, `className()`, and `style()` are rejected\n * at runtime.\n */\nexport function useRuntimeStyle(css: RuntimeStyleCss): void {\n const cssText = buildRuntimeStyleCssText(css);\n useInsertionEffect(() => {\n if (typeof document === \"undefined\" || cssText.length === 0) return;\n const style = document.createElement(\"style\");\n style.setAttribute(\"data-truss-runtime-style\", \"\");\n style.textContent = cssText;\n document.head.appendChild(style);\n return () => style.remove();\n }, [cssText]);\n}\n\n/** Serialize RuntimeStyle rules into CSS text for a transient `<style>` tag. */\nfunction buildRuntimeStyleCssText(css: RuntimeStyleCss): string {\n const rules: string[] = [];\n for (const [selector, value] of Object.entries(css)) {\n if (typeof value === \"string\") {\n rules.push(formatRawRuntimeStyleRule(selector, value));\n } else {\n rules.push(formatRuntimeStyleRule(selector, value));\n }\n }\n return rules.join(\"\\n\\n\");\n}\n\nfunction formatRawRuntimeStyleRule(selector: string, raw: string): string {\n const trimmed = raw.trim();\n if (!trimmed) return `${selector} {}`;\n const body = trimmed\n .split(\"\\n\")\n .map((line) => ` ${line.trim()}`)\n .filter((line) => line.trim().length > 0)\n .join(\"\\n\");\n return `${selector} {\\n${body}\\n}`;\n}\n\nfunction formatRuntimeStyleRule(selector: string, declarations: RuntimeStyleDeclarations): string {\n const lines: string[] = [];\n for (const [property, value] of Object.entries(declarations)) {\n if (value === undefined || value === null) continue;\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n throw new Error(runtimeStyleUnsupportedValueMessage(selector, property));\n }\n lines.push(` ${camelToKebabRuntime(property)}: ${String(value)};`);\n }\n if (lines.length === 0) return `${selector} {}`;\n return `${selector} {\\n${lines.join(\"\\n\")}\\n}`;\n}\n\nfunction runtimeStyleUnsupportedValueMessage(selector: string, property: string): string {\n return `RuntimeStyle selector \\`${selector}\\` has an unsupported nested value for \\`${property}\\`. Only flat Css expressions can be used here; selector/marker/className helpers like onHover, when, ifSm, ifContainer, element, className(), and style() are not supported.`;\n}\n\nfunction camelToKebabRuntime(property: string): string {\n return property\n .replace(/^(Webkit|Moz|Ms|O)/, function prefixToCss(prefix) {\n return `-${prefix.toLowerCase()}`;\n })\n .replace(/[A-Z]/g, function upperToCss(letter) {\n return `-${letter.toLowerCase()}`;\n });\n}\n\n/** Fail fast when `trussProps` receives a non-Truss style value. */\nfunction assertValidTrussStyleValue(key: string, value: unknown): asserts value is TrussStyleValue {\n if (typeof value === \"string\") return;\n if (Array.isArray(value) && typeof value[0] === \"string\") {\n for (let i = 1; i < value.length; i++) {\n const el = value[i];\n if (el instanceof TrussDebugInfo) continue;\n if (typeof el === \"object\" && el !== null && !Array.isArray(el)) continue;\n throw new TypeError(invalidTrussStyleValueMessage(key));\n }\n return;\n }\n throw new TypeError(invalidTrussStyleValueMessage(key));\n}\n\nfunction invalidTrussStyleValueMessage(key: string): string {\n return `Invalid Truss style value for \\`${key}\\`. trussProps only accepts generated Truss style hashes; use mergeProps for explicit className/style merging.`;\n}\n\n/** Enable validation in dev/test environments, but skip it in production. */\nfunction resolveShouldValidateTrussStyleValues(): boolean {\n if (typeof process !== \"undefined\" && typeof process.env.NODE_ENV === \"string\") {\n return process.env.NODE_ENV !== \"production\";\n }\n const viteEnv = (import.meta as ImportMeta & { env?: { DEV?: boolean; PROD?: boolean } }).env;\n if (typeof viteEnv?.DEV === \"boolean\") {\n return viteEnv.DEV;\n }\n if (typeof viteEnv?.PROD === \"boolean\") {\n return !viteEnv.PROD;\n }\n return false;\n}\n\n/** Omit unstable source labels from rendered props during Vitest runs. */\nfunction resolveShouldEmitTrussSrcAttribute(): boolean {\n if (typeof process !== \"undefined\" && typeof process.env.VITEST === \"string\") {\n return false;\n }\n return true;\n}\n\nfunction getOrCreateTrussStyleElement(): TrussStyleElement {\n const id = \"data-truss\";\n if (trussStyleElement?.ownerDocument === document && trussStyleElement.isConnected) {\n return trussStyleElement;\n }\n\n const style = (document.querySelector(`style[${id}]`) as TrussStyleElement | null) ?? document.createElement(\"style\");\n if (!style.isConnected) {\n style.setAttribute(id, \"\");\n document.head.appendChild(style);\n }\n trussStyleElement = style;\n return trussStyleElement;\n}\n\ntype TrussStyleElement = HTMLStyleElement & {\n [TRUSS_CSS_CHUNKS]?: Set<string>;\n};\n"],"mappings":";AAAA,SAAS,0BAA0B;AAG5B,IAAM,iBAAN,MAAqB;AAAA;AAAA,EAEjB;AAAA,EAET,YAAY,KAAa;AACvB,SAAK,MAAM;AAAA,EACb;AACF;AAuBA,IAAM,iCAAiC,sCAAsC;AAC7E,IAAM,8BAA8B,mCAAmC;AACvE,IAAM,mBAAmB;AACzB,IAAI,oBAA8C;AAG3C,SAAS,cACX,QACsB;AACzB,QAAM,SAAkC,CAAC;AAEzC,aAAW,QAAQ,QAAQ;AACzB,QAAI,CAAC,QAAQ,OAAO,SAAS,SAAU;AACvC,WAAO,OAAO,QAAQ,IAAI;AAAA,EAC5B;AAEA,QAAM,aAAuB,CAAC;AAC9B,QAAM,cAAuC,CAAC;AAC9C,QAAM,eAAyB,CAAC;AAEhC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAEjD,QAAI,QAAQ,YAAY;AACtB,UAAI,OAAO,UAAU,UAAU;AAC7B,mBAAW,KAAK,KAAK;AAAA,MACvB;AACA;AAAA,IACF;AAEA,QAAI,IAAI,WAAW,YAAY,GAAG;AAEhC,6BAAuB,YAAY,KAAK;AACxC;AAAA,IACF;AAEA,QAAI,IAAI,WAAW,QAAQ,GAAG;AAC5B,yBAAmB,aAAa,KAAK;AACrC;AAAA,IACF;AAEA,QAAI,+BAAgC,4BAA2B,KAAK,KAAK;AACzE,UAAM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;AACA,sBAAoB;AACpB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../src/runtime.ts"],"sourcesContent":["import { useInsertionEffect } from \"react\";\n\n/** A compact source label for a Truss CSS expression, used in debug mode. */\nexport class TrussDebugInfo {\n /** I.e. `\"FileName.tsx:line\"` */\n readonly src: string;\n\n constructor(src: string) {\n this.src = src;\n }\n}\n\n/**\n * Space-separated atomic class names, or a variable tuple with class names + CSS variable map.\n *\n * In debug mode, the transform appends a TrussDebugInfo as an extra tuple element:\n * - static with debug: `[classNames, debugInfo]`\n * - variable with debug: `[classNames, vars, debugInfo]`\n */\nexport type TrussStyleValue =\n | string\n | [classNames: string, vars: Record<string, string>]\n | [classNames: string, debugInfo: TrussDebugInfo]\n | [classNames: string, vars: Record<string, string>, debugInfo: TrussDebugInfo];\n\n/** A property-keyed style hash where each key owns one logical CSS property. */\nexport type TrussCustomClassNameValue = string | ReadonlyArray<string | false | null | undefined>;\nexport type RuntimeStyleDeclarationValue = string | number | null | undefined;\nexport type TrussInlineStyleValue = Record<string, RuntimeStyleDeclarationValue> | false | null | undefined;\nexport type TrussStyleHash = Record<string, TrussStyleValue | TrussCustomClassNameValue | TrussInlineStyleValue>;\nexport type RuntimeStyleDeclarations = Record<string, RuntimeStyleDeclarationValue | Record<string, unknown>>;\nexport type RuntimeStyleCss = Record<string, RuntimeStyleDeclarations | string>;\n\nconst shouldValidateTrussStyleValues = resolveShouldValidateTrussStyleValues();\nconst shouldEmitTrussSrcAttribute = resolveShouldEmitTrussSrcAttribute();\nconst TRUSS_CSS_CHUNKS = \"__trussCssChunks__\";\nlet trussStyleElement: TrussStyleElement | null = null;\n\n/** Merge one or more Truss style hashes into `{ className, style?, data-truss-src? }`. */\nexport function trussProps(\n ...hashes: ReadonlyArray<TrussStyleHash | false | null | undefined>\n): Record<string, unknown> {\n const merged: Record<string, unknown> = {};\n\n for (const hash of hashes) {\n if (!hash || typeof hash !== \"object\") continue;\n Object.assign(merged, hash);\n }\n\n const classNames: string[] = [];\n const inlineStyle: Record<string, unknown> = {};\n const debugSources: string[] = [];\n\n for (const [key, value] of Object.entries(merged)) {\n // $css is the Css expression marker — skip it\n if (key === \"$css\") continue;\n\n // __marker is a special key — its value is a marker class name, not a CSS property\n if (key === \"__marker\") {\n if (typeof value === \"string\") {\n classNames.push(value);\n }\n continue;\n }\n\n if (key.startsWith(\"className_\")) {\n // I.e. plugin-emitted raw class names that should flow straight into the final prop.\n appendCustomClassNames(classNames, value);\n continue;\n }\n\n if (key.startsWith(\"style_\")) {\n appendInlineStyles(inlineStyle, value);\n continue;\n }\n\n if (shouldValidateTrussStyleValues) assertValidTrussStyleValue(key, value);\n const trussValue = value as TrussStyleValue;\n\n if (typeof trussValue === \"string\") {\n // I.e. \"df\" or \"black blue_h\"\n classNames.push(trussValue);\n continue;\n }\n\n // Tuple: [classNames, varsOrDebug?, maybeDebug?]\n classNames.push(trussValue[0]);\n\n for (let i = 1; i < trussValue.length; i++) {\n const el = trussValue[i];\n if (el instanceof TrussDebugInfo) {\n debugSources.push(el.src);\n } else if (typeof el === \"object\" && el !== null) {\n Object.assign(inlineStyle, el);\n }\n }\n }\n\n const props: Record<string, unknown> = {\n className: classNames.join(\" \"),\n };\n\n if (Object.keys(inlineStyle).length > 0) {\n props.style = inlineStyle;\n }\n\n if (shouldEmitTrussSrcAttribute && debugSources.length > 0) {\n props[\"data-truss-src\"] = [...new Set(debugSources)].join(\"; \");\n }\n\n return props;\n}\n\nfunction appendCustomClassNames(classNames: string[], value: unknown): void {\n if (typeof value === \"string\") {\n // I.e. `className_button: \"button\"`\n classNames.push(value);\n return;\n }\n\n if (!Array.isArray(value)) return;\n for (const entry of value) {\n if (typeof entry === \"string\") {\n // I.e. `className_button: [\"button\", cond && \"selected\"]`\n classNames.push(entry);\n }\n }\n}\n\nfunction appendInlineStyles(inlineStyle: Record<string, unknown>, value: unknown): void {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n return;\n }\n\n for (const [key, entry] of Object.entries(value)) {\n if (entry === undefined || entry === null) {\n continue;\n }\n if (typeof entry === \"string\" || typeof entry === \"number\") {\n inlineStyle[key] = entry;\n }\n }\n}\n\n/** Merge explicit className/style with Truss style hashes. */\nexport function mergeProps(\n explicitClassName: string | undefined,\n explicitStyle: Record<string, unknown> | undefined,\n ...hashes: ReadonlyArray<TrussStyleHash | false | null | undefined>\n): Record<string, unknown> {\n const result = trussProps(...hashes);\n\n if (explicitClassName) {\n result.className = `${explicitClassName} ${result.className ?? \"\"}`.trim();\n }\n\n if (explicitStyle) {\n result.style = { ...explicitStyle, ...(result.style as Record<string, unknown> | undefined) };\n }\n\n return result;\n}\n\n/**\n * Inject CSS text into the document for jsdom/test environments.\n *\n * In browser dev mode, CSS is served via the Vite virtual endpoint instead.\n */\nexport function __injectTrussCSS(cssText: string): void {\n if (typeof document === \"undefined\" || cssText.length === 0) return;\n\n const style = getOrCreateTrussStyleElement();\n\n // Track exact injected chunks on the style node so repeated execution of the\n // test bootstrap or transformed modules does not append duplicate CSS text.\n const injectedChunks = (style[TRUSS_CSS_CHUNKS] ??= new Set<string>());\n if (injectedChunks.has(cssText) || style.textContent?.includes(cssText)) {\n injectedChunks.add(cssText);\n return;\n }\n\n injectedChunks.add(cssText);\n style.textContent = (style.textContent ?? \"\") + cssText;\n}\n\nexport interface RuntimeStyleProps {\n css: RuntimeStyleCss;\n}\n\n/**\n * Inject dynamic or selector-based CSS at runtime into a transient `<style>` tag.\n *\n * This is the runtime counterpart to `.css.ts` files:\n * - use `.css.ts` for static/global arbitrary selectors that should be baked into the build output\n * - use `RuntimeStyle` for selectors that depend on runtime values or should only exist while a component is mounted\n *\n * Example with a flat `Css` expression:\n * ```tsx\n * <RuntimeStyle\n * css={{\n * \".preview a\": Css.blue.$,\n * }}\n * />\n * ```\n *\n * Example with raw CSS via `Css.raw`:\n * ```tsx\n * <RuntimeStyle\n * css={{\n * \".preview code\": Css.raw`\n * font-variant-ligatures: none;\n * text-decoration: underline;\n * `,\n * }}\n * />\n * ```\n *\n * The injected `<style>` element is appended on mount and removed on unmount.\n *\n * Note: Only flat `Css.*.$` expressions are supported here; selector/marker helpers like\n * `onHover`, `when`, `ifSm`, `ifContainer`, `element`, `className()`, and `style()` are rejected\n * at runtime.\n */\nexport function RuntimeStyle(props: RuntimeStyleProps): null {\n useRuntimeStyle(props.css);\n return null;\n}\n\n/**\n * Hook that injects dynamic or selector-based CSS at runtime into a transient `<style>` tag.\n *\n * This is the hook counterpart to the `RuntimeStyle` component and `.css.ts` files:\n * - use `.css.ts` for static/global arbitrary selectors baked into the build output\n * - use `useRuntimeStyle` when you need the same thing from a hook instead of a component\n *\n * Example with a flat `Css` expression:\n * ```ts\n * useRuntimeStyle({ \"body\": Css.mbPx(dynamicValue).$ });\n * ```\n *\n * Example with raw CSS via `Css.raw`:\n * ```ts\n * useRuntimeStyle({ \".preview code\": Css.raw`font-variant-ligatures: none;` });\n * ```\n *\n * The injected `<style>` element is appended on mount and removed on unmount.\n *\n * Note: Only flat `Css.*.$` expressions are supported here; selector/marker helpers like\n * `onHover`, `when`, `ifSm`, `ifContainer`, `element`, `className()`, and `style()` are rejected\n * at runtime.\n */\nexport function useRuntimeStyle(css: RuntimeStyleCss): void {\n const cssText = buildRuntimeStyleCssText(css);\n useInsertionEffect(() => {\n if (typeof document === \"undefined\" || cssText.length === 0) return;\n const style = document.createElement(\"style\");\n style.setAttribute(\"data-truss-runtime-style\", \"\");\n style.textContent = cssText;\n document.head.appendChild(style);\n return () => style.remove();\n }, [cssText]);\n}\n\n/** Serialize RuntimeStyle rules into CSS text for a transient `<style>` tag. */\nfunction buildRuntimeStyleCssText(css: RuntimeStyleCss): string {\n const rules: string[] = [];\n for (const [selector, value] of Object.entries(css)) {\n if (typeof value === \"string\") {\n rules.push(formatRawRuntimeStyleRule(selector, value));\n } else {\n rules.push(formatRuntimeStyleRule(selector, value));\n }\n }\n return rules.join(\"\\n\\n\");\n}\n\nfunction formatRawRuntimeStyleRule(selector: string, raw: string): string {\n const trimmed = raw.trim();\n if (!trimmed) return `${selector} {}`;\n const body = trimmed\n .split(\"\\n\")\n .map((line) => ` ${line.trim()}`)\n .filter((line) => line.trim().length > 0)\n .join(\"\\n\");\n return `${selector} {\\n${body}\\n}`;\n}\n\nfunction formatRuntimeStyleRule(selector: string, declarations: RuntimeStyleDeclarations): string {\n const lines: string[] = [];\n for (const [property, value] of Object.entries(declarations)) {\n if (property === \"$css\") continue;\n if (value === undefined || value === null) continue;\n if (typeof value !== \"string\" && typeof value !== \"number\") {\n throw new Error(runtimeStyleUnsupportedValueMessage(selector, property));\n }\n lines.push(` ${camelToKebabRuntime(property)}: ${String(value)};`);\n }\n if (lines.length === 0) return `${selector} {}`;\n return `${selector} {\\n${lines.join(\"\\n\")}\\n}`;\n}\n\nfunction runtimeStyleUnsupportedValueMessage(selector: string, property: string): string {\n return `RuntimeStyle selector \\`${selector}\\` has an unsupported nested value for \\`${property}\\`. Only flat Css expressions can be used here; selector/marker/className helpers like onHover, when, ifSm, ifContainer, element, className(), and style() are not supported.`;\n}\n\nfunction camelToKebabRuntime(property: string): string {\n return property\n .replace(/^(Webkit|Moz|Ms|O)/, function prefixToCss(prefix) {\n return `-${prefix.toLowerCase()}`;\n })\n .replace(/[A-Z]/g, function upperToCss(letter) {\n return `-${letter.toLowerCase()}`;\n });\n}\n\n/** Fail fast when `trussProps` receives a non-Truss style value. */\nfunction assertValidTrussStyleValue(key: string, value: unknown): asserts value is TrussStyleValue {\n if (typeof value === \"string\") return;\n if (Array.isArray(value) && typeof value[0] === \"string\") {\n for (let i = 1; i < value.length; i++) {\n const el = value[i];\n if (el instanceof TrussDebugInfo) continue;\n if (typeof el === \"object\" && el !== null && !Array.isArray(el)) continue;\n throw new TypeError(invalidTrussStyleValueMessage(key));\n }\n return;\n }\n throw new TypeError(invalidTrussStyleValueMessage(key));\n}\n\nfunction invalidTrussStyleValueMessage(key: string): string {\n return `Invalid Truss style value for \\`${key}\\`. trussProps only accepts generated Truss style hashes; use mergeProps for explicit className/style merging.`;\n}\n\n/** Enable validation in dev/test environments, but skip it in production. */\nfunction resolveShouldValidateTrussStyleValues(): boolean {\n if (typeof process !== \"undefined\" && typeof process.env.NODE_ENV === \"string\") {\n return process.env.NODE_ENV !== \"production\";\n }\n const viteEnv = (import.meta as ImportMeta & { env?: { DEV?: boolean; PROD?: boolean } }).env;\n if (typeof viteEnv?.DEV === \"boolean\") return viteEnv.DEV;\n if (typeof viteEnv?.PROD === \"boolean\") return !viteEnv.PROD;\n return false;\n}\n\n/** Omit unstable source labels from rendered props during Vitest runs. */\nfunction resolveShouldEmitTrussSrcAttribute(): boolean {\n if (typeof process !== \"undefined\" && typeof process.env.VITEST === \"string\") {\n return false;\n }\n return true;\n}\n\nfunction getOrCreateTrussStyleElement(): TrussStyleElement {\n const id = \"data-truss\";\n if (trussStyleElement?.ownerDocument === document && trussStyleElement.isConnected) {\n return trussStyleElement;\n }\n\n const style = (document.querySelector(`style[${id}]`) as TrussStyleElement | null) ?? document.createElement(\"style\");\n if (!style.isConnected) {\n style.setAttribute(id, \"\");\n document.head.appendChild(style);\n }\n trussStyleElement = style;\n return trussStyleElement;\n}\n\ntype TrussStyleElement = HTMLStyleElement & {\n [TRUSS_CSS_CHUNKS]?: Set<string>;\n};\n"],"mappings":";AAAA,SAAS,0BAA0B;AAG5B,IAAM,iBAAN,MAAqB;AAAA;AAAA,EAEjB;AAAA,EAET,YAAY,KAAa;AACvB,SAAK,MAAM;AAAA,EACb;AACF;AAuBA,IAAM,iCAAiC,sCAAsC;AAC7E,IAAM,8BAA8B,mCAAmC;AACvE,IAAM,mBAAmB;AACzB,IAAI,oBAA8C;AAG3C,SAAS,cACX,QACsB;AACzB,QAAM,SAAkC,CAAC;AAEzC,aAAW,QAAQ,QAAQ;AACzB,QAAI,CAAC,QAAQ,OAAO,SAAS,SAAU;AACvC,WAAO,OAAO,QAAQ,IAAI;AAAA,EAC5B;AAEA,QAAM,aAAuB,CAAC;AAC9B,QAAM,cAAuC,CAAC;AAC9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AAQ;AACxD,SAAO;AACT;AAGA,SAAS,qCAA8C;AACrD,MAAI,OAAO,YAAY,eAAe,OAAO,QAAQ,IAAI,WAAW,UAAU;AAC5E,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,SAAS,+BAAkD;AACzD,QAAM,KAAK;AACX,MAAI,mBAAmB,kBAAkB,YAAY,kBAAkB,aAAa;AAClF,WAAO;AAAA,EACT;AAEA,QAAM,QAAS,SAAS,cAAc,SAAS,EAAE,GAAG,KAAkC,SAAS,cAAc,OAAO;AACpH,MAAI,CAAC,MAAM,aAAa;AACtB,UAAM,aAAa,IAAI,EAAE;AACzB,aAAS,KAAK,YAAY,KAAK;AAAA,EACjC;AACA,sBAAoB;AACpB,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homebound/truss",
3
- "version": "2.19.3",
3
+ "version": "2.20.1",
4
4
  "type": "module",
5
5
  "main": "build/index.js",
6
6
  "bin": "cli.js",