@tenphi/tasty 3.9.8 → 3.9.10

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.
Files changed (65) hide show
  1. package/dist/{babel-C5mN2_fA.d.ts → babel-rZcEwPLM.d.ts} +2 -3
  2. package/dist/chunks/{build-config-iyzPTrZa.js → build-config-CL4eRu2z.js} +6 -6
  3. package/dist/chunks/{build-config-iyzPTrZa.js.map → build-config-CL4eRu2z.js.map} +1 -1
  4. package/dist/chunks/{collector-C4ouIOgI.js → collector-D2ARGT2L.js} +4 -4
  5. package/dist/chunks/{collector-C4ouIOgI.js.map → collector-D2ARGT2L.js.map} +1 -1
  6. package/dist/chunks/{config-engine-BAldIMv7.js → config-engine-DEmmPPdp.js} +17 -12
  7. package/dist/chunks/{config-engine-BAldIMv7.js.map → config-engine-DEmmPPdp.js.map} +1 -1
  8. package/dist/chunks/{css-definitions-BIgGXRLz.js → css-definitions-DotDkIXt.js} +6 -5
  9. package/dist/chunks/{css-definitions-BIgGXRLz.js.map → css-definitions-DotDkIXt.js.map} +1 -1
  10. package/dist/chunks/{css-resources-BN8apgxt.js → css-resources-P7IBUUZs.js} +2 -2
  11. package/dist/chunks/{css-resources-BN8apgxt.js.map → css-resources-P7IBUUZs.js.map} +1 -1
  12. package/dist/chunks/{debug-CUDFFYpM.js → debug-D8pg9RGI.js} +20 -19
  13. package/dist/chunks/{debug-CUDFFYpM.js.map → debug-D8pg9RGI.js.map} +1 -1
  14. package/dist/chunks/{dsl-C5yuAn41.js → dsl-DRhFWQzo.js} +42 -37
  15. package/dist/chunks/{dsl-C5yuAn41.js.map → dsl-DRhFWQzo.js.map} +1 -1
  16. package/dist/chunks/{react-runtime-46TyXx9v.js → react-runtime-BpxlOTbO.js} +28 -23
  17. package/dist/chunks/{react-runtime-46TyXx9v.js.map → react-runtime-BpxlOTbO.js.map} +1 -1
  18. package/dist/chunks/{runtime-engine-B_4lx2DJ.js → runtime-engine-CKFXUH-A.js} +27 -19
  19. package/dist/chunks/runtime-engine-CKFXUH-A.js.map +1 -0
  20. package/dist/chunks/{runtime-state-BMtykrat.js → runtime-state-BxaLhVdP.js} +2 -2
  21. package/dist/chunks/{runtime-state-BMtykrat.js.map → runtime-state-BxaLhVdP.js.map} +1 -1
  22. package/dist/chunks/{shared-utils-DWA4LjIa.js → shared-utils-y-HjvPN4.js} +16 -12
  23. package/dist/chunks/{shared-utils-DWA4LjIa.js.map → shared-utils-y-HjvPN4.js.map} +1 -1
  24. package/dist/chunks/{style-engine-BpgmapBp.js → style-engine-BBbBuSkT.js} +87 -75
  25. package/dist/chunks/{style-engine-BpgmapBp.js.map → style-engine-BBbBuSkT.js.map} +1 -1
  26. package/dist/chunks/{zero-engine-DcjMs3WX.js → zero-engine-gJrKBRiw.js} +6 -4
  27. package/dist/chunks/{zero-engine-DcjMs3WX.js.map → zero-engine-gJrKBRiw.js.map} +1 -1
  28. package/dist/{collector-CViSMO84.d.ts → collector-w4mBj5gd.d.ts} +2 -3
  29. package/dist/{config-CbDtZzZy.d.ts → config-CZWCzBr6.d.ts} +3 -12
  30. package/dist/core/index.d.ts +4 -4
  31. package/dist/core/index.js +8 -8
  32. package/dist/{index-lhkF3ln5.d.ts → index-G9JuwM9p.d.ts} +136 -163
  33. package/dist/index.d.ts +4 -4
  34. package/dist/index.js +9 -9
  35. package/dist/{merge-styles-Dp3eKkK9.d.ts → merge-styles-VXwJ0Frr.d.ts} +2 -3
  36. package/dist/ssr/astro-client.d.ts +1 -1
  37. package/dist/ssr/astro-middleware-extract-static.d.ts +1 -2
  38. package/dist/ssr/astro-middleware-extract.d.ts +1 -2
  39. package/dist/ssr/astro-middleware-static.d.ts +1 -2
  40. package/dist/ssr/astro-middleware.d.ts +1 -2
  41. package/dist/ssr/astro.d.ts +8 -16
  42. package/dist/ssr/astro.js +5 -4
  43. package/dist/ssr/astro.js.map +1 -1
  44. package/dist/ssr/index.d.ts +5 -6
  45. package/dist/ssr/index.js +2 -2
  46. package/dist/ssr/next-config.d.ts +3 -5
  47. package/dist/ssr/next-config.js +10 -6
  48. package/dist/ssr/next-config.js.map +1 -1
  49. package/dist/ssr/next.d.ts +3 -9
  50. package/dist/ssr/next.js +5 -4
  51. package/dist/ssr/next.js.map +1 -1
  52. package/dist/static/index.d.ts +8 -9
  53. package/dist/static/index.js +4 -4
  54. package/dist/static/index.js.map +1 -1
  55. package/dist/static/inject.d.ts +1 -2
  56. package/dist/{types-Ji9PGExW.d.ts → types-JEY8PVYP.d.ts} +5 -58
  57. package/dist/zero/babel.d.ts +1 -1
  58. package/dist/zero/babel.js +23 -18
  59. package/dist/zero/babel.js.map +1 -1
  60. package/dist/zero/index.d.ts +6 -7
  61. package/dist/zero/index.js +1 -1
  62. package/dist/zero/next.d.ts +3 -5
  63. package/dist/zero/next.js.map +1 -1
  64. package/package.json +31 -31
  65. package/dist/chunks/runtime-engine-B_4lx2DJ.js.map +0 -1
@@ -1,9 +1,9 @@
1
- import { f as parseStyle, j as normalizeDslName, m as resetGlobalPredefinedTokens, p as resetGlobalParseFunctions, u as normalizeColorTokenValue, w as Lru } from "./dsl-C5yuAn41.js";
2
- import { i as warn, n as isSelector, o as isDevEnv, r as resetStyleWarnings } from "./shared-utils-DWA4LjIa.js";
3
- import { A as validateNamePrefix, B as formatFunctionPrelude, D as makeKeyframeName, F as normalizePropertyDefinition, G as registerLocalFunctionPolyfills, I as parsePropertyToken, K as resetFunctionPolyfills, M as extractLocalProperties, N as getEffectiveDefinition, O as rscClassRegexGlobal, R as extractLocalFunctions, S as PropertyTypeResolver, T as makeClassName, U as parseFunctionName, V as formatFunctionRule, _ as extractLocalFontFace, a as formatPropertyCSS, b as formatFontFaceRule, c as filterUsedKeyframes, d as replaceAnimationNames, f as resolveKeyframesNames, h as formatCounterStyleRule, i as formatKeyframesCSS, j as hashString, k as tastyClassRegex, l as hasLocalKeyframes, m as formatCounterStyleDeclarations, o as extractAnimationNamesFromStyles, p as extractLocalCounterStyle, r as formatRules, s as extractLocalKeyframes, u as mergeKeyframes, v as fontFaceContentHash, y as formatFontFaceDeclarations, z as formatFunctionDeclarations } from "./css-definitions-BIgGXRLz.js";
4
- import { A as createStyle, C as splitSelectorsSafely, G as markStylesGeneratedState, K as resetGlobalPolyfillsState, O as resetHandlers, S as camelToKebab, U as hasStylesGenerated, W as isFunctionsPolyfillEnabled, a as registerBaseStyleProps, b as renderStyles, n as generateChunkCacheKey, o as resetBaseStyleProps, q as resetStylesGeneratedState, r as categorizeStyleKeys, t as renderStylesForChunk, w as STYLE_HANDLER_MAP, y as clearPipelineCache, z as resetStyleChunks } from "./style-engine-BpgmapBp.js";
5
- import { n as applyStyleConfig, r as normalizeConfig, t as resolveRecipesWith } from "./config-engine-BAldIMv7.js";
6
- import { _ as resetConfigResources, a as getGlobalConfigTokens, c as getGlobalFunctions, d as mergeGlobalConfigTokens, f as mergeGlobalCounterStyles, g as mergeGlobalStyles, h as mergeGlobalProperties, i as getEffectiveProperties, l as getGlobalStyles, m as mergeGlobalFunctions, o as getGlobalCounterStyles, p as mergeGlobalFontFaces, s as getGlobalFontFaces, t as getRegisteredSSRCollector, v as setRuntimeConfigState } from "./runtime-state-BMtykrat.js";
1
+ import { f as parseStyle, j as normalizeDslName, m as resetGlobalPredefinedTokens, p as resetGlobalParseFunctions, u as normalizeColorTokenValue, w as Lru } from "./dsl-DRhFWQzo.js";
2
+ import { i as warn, n as isSelector, o as isDevEnv, r as resetStyleWarnings } from "./shared-utils-y-HjvPN4.js";
3
+ import { A as validateNamePrefix, B as formatFunctionPrelude, D as makeKeyframeName, F as normalizePropertyDefinition, G as registerLocalFunctionPolyfills, I as parsePropertyToken, K as resetFunctionPolyfills, M as extractLocalProperties, N as getEffectiveDefinition, O as rscClassRegexGlobal, R as extractLocalFunctions, S as PropertyTypeResolver, T as makeClassName, U as parseFunctionName, V as formatFunctionRule, _ as extractLocalFontFace, a as formatPropertyCSS, b as formatFontFaceRule, c as filterUsedKeyframes, d as replaceAnimationNames, f as resolveKeyframesNames, h as formatCounterStyleRule, i as formatKeyframesCSS, j as hashString, k as tastyClassRegex, l as hasLocalKeyframes, m as formatCounterStyleDeclarations, o as extractAnimationNamesFromStyles, p as extractLocalCounterStyle, r as formatRules, s as extractLocalKeyframes, u as mergeKeyframes, v as fontFaceContentHash, y as formatFontFaceDeclarations, z as formatFunctionDeclarations } from "./css-definitions-DotDkIXt.js";
4
+ import { A as createStyle, C as splitSelectorsSafely, G as markStylesGeneratedState, K as resetGlobalPolyfillsState, O as resetHandlers, S as camelToKebab, U as hasStylesGenerated, W as isFunctionsPolyfillEnabled, a as registerBaseStyleProps, b as renderStyles, n as generateChunkCacheKey, o as resetBaseStyleProps, q as resetStylesGeneratedState, r as categorizeStyleKeys, t as renderStylesForChunk, w as STYLE_HANDLER_MAP, y as clearPipelineCache, z as resetStyleChunks } from "./style-engine-BBbBuSkT.js";
5
+ import { n as applyStyleConfig, r as normalizeConfig, t as resolveRecipesWith } from "./config-engine-DEmmPPdp.js";
6
+ import { _ as resetConfigResources, a as getGlobalConfigTokens, c as getGlobalFunctions, d as mergeGlobalConfigTokens, f as mergeGlobalCounterStyles, g as mergeGlobalStyles, h as mergeGlobalProperties, i as getEffectiveProperties, l as getGlobalStyles, m as mergeGlobalFunctions, o as getGlobalCounterStyles, p as mergeGlobalFontFaces, s as getGlobalFontFaces, t as getRegisteredSSRCollector, v as setRuntimeConfigState } from "./runtime-state-BxaLhVdP.js";
7
7
  import React from "react";
8
8
  //#region src/prop-handlers.ts
9
9
  const GTKEY = "__tasty_prop_handlers__";
@@ -371,10 +371,12 @@ var SheetManager = class {
371
371
  styleSheet.insertRule(singleRule, idx);
372
372
  recordInsertion(idx);
373
373
  } catch (singleErr) {
374
- console.warn("[Tasty] Browser rejected CSS rule:", singleRule, singleErr);
374
+ if (process.env.NODE_ENV !== "production") console.warn("[Tasty] Browser rejected CSS rule:", singleRule, singleErr);
375
375
  }
376
376
  }
377
- else if (!(fullRule.startsWith("@property ") && !this.engineSupportsAtProperty(registry, styleSheet))) console.warn("[Tasty] Browser rejected CSS rule:", fullRule, e);
377
+ else if (process.env.NODE_ENV !== "production") {
378
+ if (!(fullRule.startsWith("@property ") && !this.engineSupportsAtProperty(registry, styleSheet))) console.warn("[Tasty] Browser rejected CSS rule:", fullRule, e);
379
+ }
378
380
  }
379
381
  } else if (styleElement) {
380
382
  const atomicRuleIndex = this.findAvailableRuleIndex(targetSheet);
@@ -1307,11 +1309,12 @@ var StyleInjector = class {
1307
1309
  property(name, options) {
1308
1310
  const root = options?.root || document;
1309
1311
  const registry = this.sheetManager.getRegistry(root);
1310
- const effectiveResult = getEffectiveDefinition(name, {
1312
+ const userDefinition = {
1311
1313
  syntax: options?.syntax,
1312
1314
  inherits: options?.inherits,
1313
1315
  initialValue: options?.initialValue
1314
- });
1316
+ };
1317
+ const effectiveResult = getEffectiveDefinition(name, userDefinition);
1315
1318
  if (!effectiveResult.isValid) {
1316
1319
  if (isDevEnv()) console.warn(`[Tasty] property(): ${effectiveResult.error}. Got: "${name}"`);
1317
1320
  return;
@@ -1585,9 +1588,9 @@ var StyleInjector = class {
1585
1588
  //#endregion
1586
1589
  //#region src/config.ts
1587
1590
  const emittedWarnings = /* @__PURE__ */ new Set();
1588
- const devMode = isDevEnv();
1591
+ const devMode$1 = isDevEnv();
1589
1592
  function warnOnce(key, message) {
1590
- if (devMode && !emittedWarnings.has(key)) {
1593
+ if (devMode$1 && !emittedWarnings.has(key)) {
1591
1594
  emittedWarnings.add(key);
1592
1595
  console.warn(message);
1593
1596
  }
@@ -1597,6 +1600,7 @@ let globalKeyframes = null;
1597
1600
  let globalRecipes = null;
1598
1601
  const GLOBAL_INJECTOR_KEY = "__TASTY_GLOBAL_INJECTOR__";
1599
1602
  function isTestEnvironment() {
1603
+ if (typeof process !== "undefined" && process.env.NODE_ENV === "test") return true;
1600
1604
  if (typeof global !== "undefined") {
1601
1605
  const g = global;
1602
1606
  if (g.vi || g.jest || g.expect || g.describe || g.it) return true;
@@ -1706,7 +1710,7 @@ function setGlobalRecipes(recipes) {
1706
1710
  warnOnce("recipes-after-styles", "[Tasty] Cannot update recipes after styles have been generated.\nThe new recipes will be ignored.");
1707
1711
  return;
1708
1712
  }
1709
- if (devMode) for (const [name, recipeStyles] of Object.entries(recipes)) {
1713
+ if (devMode$1) for (const [name, recipeStyles] of Object.entries(recipes)) {
1710
1714
  if (name === "none") warnOnce("recipe-reserved-none", "[Tasty] Recipe name \"none\" is reserved. It is used as a keyword meaning \"no base recipes\" (e.g. recipe: 'none / post-recipe'). Choose a different name for your recipe.");
1711
1715
  for (const key of Object.keys(recipeStyles)) {
1712
1716
  if (isSelector(key)) warnOnce(`recipe-selector-${name}-${key}`, `[Tasty] Recipe "${name}" contains sub-element key "${key}". Recipes must be flat styles without sub-element keys. Remove the sub-element key from the recipe definition.`);
@@ -2117,7 +2121,10 @@ function getUsedKeyframes(styles) {
2117
2121
  if (!hasLocal && !hasGlobal) return null;
2118
2122
  const usedNames = extractAnimationNamesFromStyles(styles);
2119
2123
  if (usedNames.size === 0) return null;
2120
- return filterUsedKeyframes(mergeKeyframes(hasLocal ? extractLocalKeyframes(styles) : null, hasGlobal ? getGlobalKeyframes() : null), usedNames);
2124
+ const local = hasLocal ? extractLocalKeyframes(styles) : null;
2125
+ const global = hasGlobal ? getGlobalKeyframes() : null;
2126
+ const allKeyframes = mergeKeyframes(local, global);
2127
+ return filterUsedKeyframes(allKeyframes, usedNames);
2121
2128
  }
2122
2129
  function processChunkSSR(collector, styles, chunkName, styleKeys, stableStyles, keyframeNames) {
2123
2130
  if (styleKeys.length === 0) return null;
@@ -2280,7 +2287,7 @@ function computeStyles(styles, options) {
2280
2287
  }
2281
2288
  //#endregion
2282
2289
  //#region src/utils/filter-base-props.ts
2283
- const BasePropNames = new Set([
2290
+ const BasePropNames = /* @__PURE__ */ new Set([
2284
2291
  "role",
2285
2292
  "title",
2286
2293
  "inert",
@@ -2302,7 +2309,7 @@ const BasePropNames = new Set([
2302
2309
  "tabIndex"
2303
2310
  ]);
2304
2311
  const eventRe = /^on[A-Z].+$/;
2305
- const ignoredEventProps = new Set([
2312
+ const ignoredEventProps = /* @__PURE__ */ new Set([
2306
2313
  "onPress",
2307
2314
  "onHoverStart",
2308
2315
  "onHoverEnd",
@@ -2331,17 +2338,18 @@ function modAttrs(map) {
2331
2338
  if (value === true) attrs[attrName] = "";
2332
2339
  else if (typeof value === "string") attrs[attrName] = value;
2333
2340
  else if (typeof value === "number") attrs[attrName] = String(value);
2334
- else console.warn(`[Tasty] Invalid mod value for "${key}". Expected boolean, string, or number, got ${typeof value}`);
2341
+ else if (process.env.NODE_ENV !== "production") console.warn(`[Tasty] Invalid mod value for "${key}". Expected boolean, string, or number, got ${typeof value}`);
2335
2342
  }
2336
2343
  cache.set(cacheKey, attrs);
2337
2344
  return attrs;
2338
2345
  }
2339
2346
  //#endregion
2340
2347
  //#region src/utils/process-tokens.ts
2348
+ const devMode = process.env.NODE_ENV !== "production";
2341
2349
  function isValidTokenValue(value) {
2342
2350
  if (value === void 0 || value === null || value === false) return false;
2343
2351
  if (typeof value === "object") {
2344
- console.warn("[Tasty] Object values are not allowed in tokens prop. Tokens do not support state-based styling. Use a primitive value instead.");
2352
+ if (devMode) console.warn("[Tasty] Object values are not allowed in tokens prop. Tokens do not support state-based styling. Use a primitive value instead.");
2345
2353
  return false;
2346
2354
  }
2347
2355
  return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
@@ -2405,4 +2413,4 @@ function depsEqual(a, b) {
2405
2413
  //#endregion
2406
2414
  export { propHandlerRegistry as $, ownKeyframes as A, getNamePrefix as B, holdKeyframes as C, injector as D, injectRawCSS as E, configure as F, resetConfig as G, hasGlobalRecipes as H, getConfig as I, closeBatchWindow as J, StyleInjector as K, getGlobalInjector as L, touch as M, ChunkSheetRegistry as N, isPropertyDefined as O, chunkSheetRegistry as P, resetStyleBatch as Q, getGlobalKeyframes as R, getRawCSSText as S, injectGlobal as T, isConfigLocked as U, hasGlobalKeyframes as V, isTestEnvironment as W, hasPendingStyleWrites as X, flushStyles as Y, openBatchWindow as Z, fontFace as _, filterBaseProps as a, getCSSText as b, hasKeys as c, getStyleTarget as d, pushRSCCSS as f, destroy as g, createInjector as h, modAttrs as i, property as j, keyframes as k, collectAutoInferredProperties as l, counterStyle as m, createClientState as n, computeStyles as o, cleanup as p, SheetManager as q, processTokens as r, resolveRecipes as s, depsEqual as t, collectAutoInferredPropertiesRSC as u, func as v, inject as w, getCSSTextForNode as x, gc as y, getGlobalRecipes as z };
2407
2415
 
2408
- //# sourceMappingURL=runtime-engine-B_4lx2DJ.js.map
2416
+ //# sourceMappingURL=runtime-engine-CKFXUH-A.js.map