@tenphi/tasty 0.0.0-snapshot.27b6708 → 0.0.0-snapshot.28b6339

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 (109) hide show
  1. package/README.md +38 -54
  2. package/dist/{babel-BUQGeOXA.d.ts → babel-Zs1Q03qt.d.ts} +2 -2
  3. package/dist/chunks/async-storage-DKK-wTD4.js.map +1 -0
  4. package/dist/chunks/build-config-Mk7waOsw.js +45 -0
  5. package/dist/chunks/build-config-Mk7waOsw.js.map +1 -0
  6. package/dist/{collector-DTahQUiV.js → chunks/collector-Ducc5l3E.js} +29 -15
  7. package/dist/chunks/collector-Ducc5l3E.js.map +1 -0
  8. package/dist/chunks/config-engine-tKK7WxJO.js +331 -0
  9. package/dist/chunks/config-engine-tKK7WxJO.js.map +1 -0
  10. package/dist/chunks/css-definitions-Crstltrf.js +1229 -0
  11. package/dist/chunks/css-definitions-Crstltrf.js.map +1 -0
  12. package/dist/chunks/css-resources-Cyl_axbI.js +149 -0
  13. package/dist/chunks/css-resources-Cyl_axbI.js.map +1 -0
  14. package/dist/chunks/debug-HyyLIf6O.js +543 -0
  15. package/dist/chunks/debug-HyyLIf6O.js.map +1 -0
  16. package/dist/chunks/dsl-D7kBow--.js +1771 -0
  17. package/dist/chunks/dsl-D7kBow--.js.map +1 -0
  18. package/dist/chunks/hydration-CLdVKcH2.js +59 -0
  19. package/dist/chunks/hydration-CLdVKcH2.js.map +1 -0
  20. package/dist/chunks/react-runtime-UlZcbsEN.js +877 -0
  21. package/dist/chunks/react-runtime-UlZcbsEN.js.map +1 -0
  22. package/dist/chunks/runtime-engine-D2WOLvd6.js +3439 -0
  23. package/dist/chunks/runtime-engine-D2WOLvd6.js.map +1 -0
  24. package/dist/chunks/runtime-state-DOeH6rsG.js +138 -0
  25. package/dist/chunks/runtime-state-DOeH6rsG.js.map +1 -0
  26. package/dist/{merge-styles-oklji0KB.js → chunks/shared-utils-Bgl8FNGJ.js} +64 -24
  27. package/dist/chunks/shared-utils-Bgl8FNGJ.js.map +1 -0
  28. package/dist/chunks/style-engine-C4ZcOAPb.js +6915 -0
  29. package/dist/chunks/style-engine-C4ZcOAPb.js.map +1 -0
  30. package/dist/{css-writer-B-J87ncv.js → chunks/zero-engine-D4Rluo7u.js} +3 -3
  31. package/dist/chunks/zero-engine-D4Rluo7u.js.map +1 -0
  32. package/dist/{collector-DUaHCcTS.d.ts → collector-hl5KNH7k.d.ts} +23 -3
  33. package/dist/{config-YsxGv4tq.d.ts → config-DWL1ZYue.d.ts} +150 -55
  34. package/dist/core/index.d.ts +5 -5
  35. package/dist/core/index.js +9 -6
  36. package/dist/{index-PqN-DIpn.d.ts → index-D9N9GV24.d.ts} +129 -93
  37. package/dist/index.d.ts +5 -5
  38. package/dist/index.js +11 -922
  39. package/dist/{merge-styles-CU7JbEwg.d.ts → merge-styles-C_oMoJVd.d.ts} +2 -2
  40. package/dist/ssr/astro-client.js +1 -1
  41. package/dist/ssr/astro-middleware-extract-static.d.ts +11 -0
  42. package/dist/ssr/astro-middleware-extract-static.js +9 -0
  43. package/dist/ssr/astro-middleware-extract-static.js.map +1 -0
  44. package/dist/ssr/astro-middleware-extract.d.ts +11 -0
  45. package/dist/ssr/astro-middleware-extract.js +9 -0
  46. package/dist/ssr/astro-middleware-extract.js.map +1 -0
  47. package/dist/ssr/astro-middleware-static.d.ts +3 -1
  48. package/dist/ssr/astro-middleware.d.ts +3 -1
  49. package/dist/ssr/astro.d.ts +45 -3
  50. package/dist/ssr/astro.js +158 -15
  51. package/dist/ssr/astro.js.map +1 -1
  52. package/dist/ssr/index.d.ts +7 -7
  53. package/dist/ssr/index.js +4 -4
  54. package/dist/ssr/index.js.map +1 -1
  55. package/dist/ssr/next-config.d.ts +66 -0
  56. package/dist/ssr/next-config.js +135 -0
  57. package/dist/ssr/next-config.js.map +1 -0
  58. package/dist/ssr/next.d.ts +9 -2
  59. package/dist/ssr/next.js +27 -11
  60. package/dist/ssr/next.js.map +1 -1
  61. package/dist/static/index.d.ts +2 -2
  62. package/dist/static/index.js +1 -1
  63. package/dist/{index-Cd45t5NM.d.ts → types-jKZNpias.d.ts} +898 -803
  64. package/dist/zero/babel.d.ts +1 -1
  65. package/dist/zero/babel.js +25 -24
  66. package/dist/zero/babel.js.map +1 -1
  67. package/dist/zero/index.d.ts +1 -1
  68. package/dist/zero/index.js +1 -1
  69. package/dist/zero/next.d.ts +1 -1
  70. package/docs/README.md +5 -3
  71. package/docs/adoption.md +3 -3
  72. package/docs/ai-agents.md +83 -78
  73. package/docs/comparison.md +12 -12
  74. package/docs/configuration.md +47 -47
  75. package/docs/debug.md +19 -7
  76. package/docs/dsl.md +3 -3
  77. package/docs/getting-started.md +10 -10
  78. package/docs/injector.md +62 -25
  79. package/docs/methodology.md +3 -3
  80. package/docs/migration-v3.md +49 -49
  81. package/docs/plugins.md +37 -33
  82. package/docs/react-api.md +2 -2
  83. package/docs/runtime-benchmarks.md +351 -0
  84. package/docs/ssr.md +219 -61
  85. package/docs/styles.md +43 -11
  86. package/docs/tasty-static.md +136 -103
  87. package/package.json +80 -11
  88. package/dist/async-storage-DKK-wTD4.js.map +0 -1
  89. package/dist/collector-DTahQUiV.js.map +0 -1
  90. package/dist/config-B5kHzuNz.js +0 -12269
  91. package/dist/config-B5kHzuNz.js.map +0 -1
  92. package/dist/context-CA8YKeMn.js +0 -24
  93. package/dist/context-CA8YKeMn.js.map +0 -1
  94. package/dist/core-Dr4u1NVD.js +0 -1566
  95. package/dist/core-Dr4u1NVD.js.map +0 -1
  96. package/dist/css-writer-B-J87ncv.js.map +0 -1
  97. package/dist/format-global-rules-DklyaXv-.js +0 -22
  98. package/dist/format-global-rules-DklyaXv-.js.map +0 -1
  99. package/dist/format-rules-DKOA-6qu.js +0 -130
  100. package/dist/format-rules-DKOA-6qu.js.map +0 -1
  101. package/dist/hydrate-OeMX99We.js +0 -37
  102. package/dist/hydrate-OeMX99We.js.map +0 -1
  103. package/dist/index.js.map +0 -1
  104. package/dist/keyframes-CV8azJf3.js +0 -493
  105. package/dist/keyframes-CV8azJf3.js.map +0 -1
  106. package/dist/merge-styles-oklji0KB.js.map +0 -1
  107. package/dist/resolve-recipes-DTG81rzl.js +0 -144
  108. package/dist/resolve-recipes-DTG81rzl.js.map +0 -1
  109. /package/dist/{async-storage-DKK-wTD4.js → chunks/async-storage-DKK-wTD4.js} +0 -0
@@ -0,0 +1,138 @@
1
+ import { L as DEFAULT_PROPERTIES } from "./css-definitions-Crstltrf.js";
2
+ //#region src/config-resources.ts
3
+ let runtimeConfig = null;
4
+ let globalFontFace = null;
5
+ let globalCounterStyle = null;
6
+ let globalFunction = null;
7
+ let globalProperties = null;
8
+ let globalConfigTokens = null;
9
+ let globalStyles = null;
10
+ const GTKEY_TOKENS = "__tasty_cfg_tokens__";
11
+ const GTKEY_FONT_FACE = "__tasty_cfg_font_face__";
12
+ const GTKEY_COUNTER_STYLE = "__tasty_cfg_counter_style__";
13
+ const GTKEY_FUNCTION = "__tasty_cfg_function__";
14
+ const GTKEY_PROPERTIES = "__tasty_cfg_properties__";
15
+ const GTKEY_GLOBAL_STYLES = "__tasty_cfg_global_styles__";
16
+ function setOnGlobalThis(key, value) {
17
+ globalThis[key] = value;
18
+ }
19
+ function getFromGlobalThis(key) {
20
+ return globalThis[key];
21
+ }
22
+ function getRuntimeConfigState() {
23
+ return runtimeConfig;
24
+ }
25
+ function setRuntimeConfigState(config) {
26
+ runtimeConfig = config;
27
+ }
28
+ function getEffectiveProperties() {
29
+ const properties = globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES);
30
+ return properties ? {
31
+ ...DEFAULT_PROPERTIES,
32
+ ...properties
33
+ } : DEFAULT_PROPERTIES;
34
+ }
35
+ function getGlobalFontFaces() {
36
+ return globalFontFace ?? getFromGlobalThis(GTKEY_FONT_FACE) ?? null;
37
+ }
38
+ function getGlobalCounterStyles() {
39
+ return globalCounterStyle ?? getFromGlobalThis(GTKEY_COUNTER_STYLE) ?? null;
40
+ }
41
+ function getGlobalFunctions() {
42
+ return globalFunction ?? getFromGlobalThis(GTKEY_FUNCTION) ?? null;
43
+ }
44
+ function getGlobalConfigTokens() {
45
+ return globalConfigTokens ?? getFromGlobalThis(GTKEY_TOKENS) ?? null;
46
+ }
47
+ function getGlobalStyles() {
48
+ return globalStyles ?? getFromGlobalThis(GTKEY_GLOBAL_STYLES) ?? null;
49
+ }
50
+ function mergeGlobalProperties(properties) {
51
+ globalProperties = {
52
+ ...globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {},
53
+ ...properties
54
+ };
55
+ setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);
56
+ }
57
+ function mergeGlobalFontFaces(fontFaces) {
58
+ globalFontFace = {
59
+ ...getGlobalFontFaces() ?? {},
60
+ ...fontFaces
61
+ };
62
+ setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);
63
+ }
64
+ function mergeGlobalCounterStyles(counterStyles) {
65
+ globalCounterStyle = {
66
+ ...getGlobalCounterStyles() ?? {},
67
+ ...counterStyles
68
+ };
69
+ setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);
70
+ }
71
+ function mergeGlobalFunctions(functions) {
72
+ globalFunction = {
73
+ ...getGlobalFunctions() ?? {},
74
+ ...functions
75
+ };
76
+ setOnGlobalThis(GTKEY_FUNCTION, globalFunction);
77
+ }
78
+ function mergeGlobalConfigTokens(styles) {
79
+ globalConfigTokens = globalConfigTokens ? {
80
+ ...globalConfigTokens,
81
+ ...styles
82
+ } : styles;
83
+ setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);
84
+ }
85
+ function mergeGlobalStyles(styles) {
86
+ if (globalStyles) for (const [selector, selectorStyles] of Object.entries(styles)) globalStyles[selector] = globalStyles[selector] ? {
87
+ ...globalStyles[selector],
88
+ ...selectorStyles
89
+ } : selectorStyles;
90
+ else globalStyles = { ...styles };
91
+ setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);
92
+ }
93
+ function resetConfigResources() {
94
+ runtimeConfig = null;
95
+ globalProperties = null;
96
+ globalFontFace = null;
97
+ globalCounterStyle = null;
98
+ globalFunction = null;
99
+ globalConfigTokens = null;
100
+ globalStyles = null;
101
+ const globalState = globalThis;
102
+ delete globalState[GTKEY_TOKENS];
103
+ delete globalState[GTKEY_FONT_FACE];
104
+ delete globalState[GTKEY_COUNTER_STYLE];
105
+ delete globalState[GTKEY_FUNCTION];
106
+ delete globalState[GTKEY_PROPERTIES];
107
+ delete globalState[GTKEY_GLOBAL_STYLES];
108
+ }
109
+ //#endregion
110
+ //#region src/ssr/ssr-collector-ref.ts
111
+ const GETTER_KEY = "__tasty_ssr_collector_getter__";
112
+ let _getSSRCollector = null;
113
+ /**
114
+ * Register the collector getter in the current module graph only.
115
+ * Used by Next.js TastyRegistry.
116
+ */
117
+ function registerSSRCollectorGetter(fn) {
118
+ _getSSRCollector = fn;
119
+ }
120
+ /**
121
+ * Register the collector getter on globalThis so it is visible across
122
+ * separate module graphs (e.g. Astro middleware ↔ page components).
123
+ */
124
+ function registerSSRCollectorGetterGlobal(fn) {
125
+ globalThis[GETTER_KEY] = fn;
126
+ }
127
+ /**
128
+ * Retrieve the SSR collector: module-level first, globalThis fallback.
129
+ */
130
+ function getRegisteredSSRCollector() {
131
+ if (_getSSRCollector) return _getSSRCollector();
132
+ const getter = globalThis[GETTER_KEY];
133
+ return getter ? getter() : null;
134
+ }
135
+ //#endregion
136
+ export { resetConfigResources as _, getGlobalConfigTokens as a, getGlobalFunctions as c, mergeGlobalConfigTokens as d, mergeGlobalCounterStyles as f, mergeGlobalStyles as g, mergeGlobalProperties as h, getEffectiveProperties as i, getGlobalStyles as l, mergeGlobalFunctions as m, registerSSRCollectorGetter as n, getGlobalCounterStyles as o, mergeGlobalFontFaces as p, registerSSRCollectorGetterGlobal as r, getGlobalFontFaces as s, getRegisteredSSRCollector as t, getRuntimeConfigState as u, setRuntimeConfigState as v };
137
+
138
+ //# sourceMappingURL=runtime-state-DOeH6rsG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-state-DOeH6rsG.js","names":[],"sources":["../../src/config-resources.ts","../../src/ssr/ssr-collector-ref.ts"],"sourcesContent":["/**\n * DOM-free storage for configured CSS resources shared by the browser runtime\n * and server collectors.\n *\n * Astro can evaluate middleware and application code in separate module\n * graphs, so resources used by SSR are mirrored on globalThis. Keeping this\n * state outside config.ts lets server-only entrypoints read it without loading\n * StyleInjector and the rest of the browser runtime.\n */\n\nimport type {\n CounterStyleDescriptors,\n FontFaceInput,\n FunctionDefinition,\n PropertyDefinition,\n} from './injector/types';\nimport { DEFAULT_PROPERTIES } from './properties/defaults';\nimport type { ConfigTokens, Styles } from './styles/types';\n\ninterface RuntimeConfigState {\n namePrefix?: string;\n nonce?: string;\n}\n\nlet runtimeConfig: RuntimeConfigState | null = null;\nlet globalFontFace: Record<string, FontFaceInput> | null = null;\nlet globalCounterStyle: Record<string, CounterStyleDescriptors> | null = null;\nlet globalFunction: Record<string, FunctionDefinition> | null = null;\nlet globalProperties: Record<string, PropertyDefinition> | null = null;\nlet globalConfigTokens: ConfigTokens | null = null;\nlet globalStyles: Record<string, Styles> | null = null;\n\nconst GTKEY_TOKENS = '__tasty_cfg_tokens__';\nconst GTKEY_FONT_FACE = '__tasty_cfg_font_face__';\nconst GTKEY_COUNTER_STYLE = '__tasty_cfg_counter_style__';\nconst GTKEY_FUNCTION = '__tasty_cfg_function__';\nconst GTKEY_PROPERTIES = '__tasty_cfg_properties__';\nconst GTKEY_GLOBAL_STYLES = '__tasty_cfg_global_styles__';\n\nfunction setOnGlobalThis(key: string, value: unknown): void {\n (globalThis as Record<string, unknown>)[key] = value;\n}\n\nfunction getFromGlobalThis<T>(key: string): T | undefined {\n return (globalThis as Record<string, unknown>)[key] as T | undefined;\n}\n\nexport function getRuntimeConfigState(): RuntimeConfigState | null {\n return runtimeConfig;\n}\n\nexport function setRuntimeConfigState(config: RuntimeConfigState): void {\n runtimeConfig = config;\n}\n\nexport function getEffectiveProperties(): Record<string, PropertyDefinition> {\n const properties =\n globalProperties ??\n getFromGlobalThis<Record<string, PropertyDefinition>>(GTKEY_PROPERTIES);\n return properties\n ? { ...DEFAULT_PROPERTIES, ...properties }\n : DEFAULT_PROPERTIES;\n}\n\nexport function getGlobalFontFaces(): Record<string, FontFaceInput> | null {\n return (\n globalFontFace ??\n getFromGlobalThis<Record<string, FontFaceInput>>(GTKEY_FONT_FACE) ??\n null\n );\n}\n\nexport function getGlobalCounterStyles(): Record<\n string,\n CounterStyleDescriptors\n> | null {\n return (\n globalCounterStyle ??\n getFromGlobalThis<Record<string, CounterStyleDescriptors>>(\n GTKEY_COUNTER_STYLE,\n ) ??\n null\n );\n}\n\nexport function getGlobalFunctions(): Record<\n string,\n FunctionDefinition\n> | null {\n return (\n globalFunction ??\n getFromGlobalThis<Record<string, FunctionDefinition>>(GTKEY_FUNCTION) ??\n null\n );\n}\n\nexport function getGlobalConfigTokens(): ConfigTokens | null {\n return (\n globalConfigTokens ?? getFromGlobalThis<ConfigTokens>(GTKEY_TOKENS) ?? null\n );\n}\n\nexport function getGlobalStyles(): Record<string, Styles> | null {\n return (\n globalStyles ??\n getFromGlobalThis<Record<string, Styles>>(GTKEY_GLOBAL_STYLES) ??\n null\n );\n}\n\nexport function mergeGlobalProperties(\n properties: Record<string, PropertyDefinition>,\n): void {\n globalProperties = {\n ...(globalProperties ?? getFromGlobalThis(GTKEY_PROPERTIES) ?? {}),\n ...properties,\n };\n setOnGlobalThis(GTKEY_PROPERTIES, globalProperties);\n}\n\nexport function mergeGlobalFontFaces(\n fontFaces: Record<string, FontFaceInput>,\n): void {\n globalFontFace = { ...(getGlobalFontFaces() ?? {}), ...fontFaces };\n setOnGlobalThis(GTKEY_FONT_FACE, globalFontFace);\n}\n\nexport function mergeGlobalCounterStyles(\n counterStyles: Record<string, CounterStyleDescriptors>,\n): void {\n globalCounterStyle = {\n ...(getGlobalCounterStyles() ?? {}),\n ...counterStyles,\n };\n setOnGlobalThis(GTKEY_COUNTER_STYLE, globalCounterStyle);\n}\n\nexport function mergeGlobalFunctions(\n functions: Record<string, FunctionDefinition>,\n): void {\n globalFunction = { ...(getGlobalFunctions() ?? {}), ...functions };\n setOnGlobalThis(GTKEY_FUNCTION, globalFunction);\n}\n\nexport function mergeGlobalConfigTokens(styles: ConfigTokens): void {\n globalConfigTokens = globalConfigTokens\n ? { ...globalConfigTokens, ...styles }\n : styles;\n setOnGlobalThis(GTKEY_TOKENS, globalConfigTokens);\n}\n\nexport function mergeGlobalStyles(styles: Record<string, Styles>): void {\n if (globalStyles) {\n for (const [selector, selectorStyles] of Object.entries(styles)) {\n globalStyles[selector] = globalStyles[selector]\n ? { ...globalStyles[selector], ...selectorStyles }\n : selectorStyles;\n }\n } else {\n globalStyles = { ...styles };\n }\n setOnGlobalThis(GTKEY_GLOBAL_STYLES, globalStyles);\n}\n\nexport function resetConfigResources(): void {\n runtimeConfig = null;\n globalProperties = null;\n globalFontFace = null;\n globalCounterStyle = null;\n globalFunction = null;\n globalConfigTokens = null;\n globalStyles = null;\n\n const globalState = globalThis as Record<string, unknown>;\n delete globalState[GTKEY_TOKENS];\n delete globalState[GTKEY_FONT_FACE];\n delete globalState[GTKEY_COUNTER_STYLE];\n delete globalState[GTKEY_FUNCTION];\n delete globalState[GTKEY_PROPERTIES];\n delete globalState[GTKEY_GLOBAL_STYLES];\n}\n","/**\n * Global reference to the SSR collector getter function.\n *\n * This indirection avoids importing 'node:async_hooks' in the browser bundle.\n * The SSR entry point sets this ref when loaded on the server. The useStyles\n * hook calls it if set; on the client it stays null and is never called.\n *\n * Uses a module-level variable as the primary mechanism. In Next.js App\n * Router the RSC and SSR module graphs load separate copies of this module,\n * so the getter registered by TastyRegistry (SSR layer) is invisible to\n * server components (RSC layer) — which correctly fall through to inline\n * RSC styles.\n *\n * A globalThis fallback (`registerSSRCollectorGetterGlobal`) is provided\n * for frameworks like Astro where middleware and page components live in\n * different module graphs and must share the getter across them.\n */\n\nimport type { ServerStyleCollector } from './collector';\n\ntype SSRCollectorGetter = () => ServerStyleCollector | null;\n\nconst GETTER_KEY = '__tasty_ssr_collector_getter__';\n\nlet _getSSRCollector: SSRCollectorGetter | null = null;\n\n/**\n * Register the collector getter in the current module graph only.\n * Used by Next.js TastyRegistry.\n */\nexport function registerSSRCollectorGetter(fn: SSRCollectorGetter): void {\n _getSSRCollector = fn;\n}\n\n/**\n * Register the collector getter on globalThis so it is visible across\n * separate module graphs (e.g. Astro middleware ↔ page components).\n */\nexport function registerSSRCollectorGetterGlobal(fn: SSRCollectorGetter): void {\n (globalThis as Record<string, unknown>)[GETTER_KEY] = fn;\n}\n\n/**\n * Retrieve the SSR collector: module-level first, globalThis fallback.\n */\nexport function getRegisteredSSRCollector(): ServerStyleCollector | null {\n if (_getSSRCollector) return _getSSRCollector();\n const getter = (globalThis as Record<string, unknown>)[GETTER_KEY] as\n SSRCollectorGetter | undefined;\n return getter ? getter() : null;\n}\n"],"mappings":";;AAwBA,IAAI,gBAA2C;AAC/C,IAAI,iBAAuD;AAC3D,IAAI,qBAAqE;AACzE,IAAI,iBAA4D;AAChE,IAAI,mBAA8D;AAClE,IAAI,qBAA0C;AAC9C,IAAI,eAA8C;AAElD,MAAM,eAAe;AACrB,MAAM,kBAAkB;AACxB,MAAM,sBAAsB;AAC5B,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,sBAAsB;AAE5B,SAAS,gBAAgB,KAAa,OAAsB;CAC1D,WAAwC,OAAO;AACjD;AAEA,SAAS,kBAAqB,KAA4B;CACxD,OAAQ,WAAuC;AACjD;AAEA,SAAgB,wBAAmD;CACjE,OAAO;AACT;AAEA,SAAgB,sBAAsB,QAAkC;CACtE,gBAAgB;AAClB;AAEA,SAAgB,yBAA6D;CAC3E,MAAM,aACJ,oBACA,kBAAsD,gBAAgB;CACxE,OAAO,aACH;EAAE,GAAG;EAAoB,GAAG;CAAW,IACvC;AACN;AAEA,SAAgB,qBAA2D;CACzE,OACE,kBACA,kB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BAAqB;CACrB,iBAAiB;CACjB,qBAAqB;CACrB,eAAe;CAEf,MAAM,cAAc;CACpB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;CACnB,OAAO,YAAY;AACrB;;;AC9JA,MAAM,aAAa;AAEnB,IAAI,mBAA8C;;;;;AAMlD,SAAgB,2BAA2B,IAA8B;CACvE,mBAAmB;AACrB;;;;;AAMA,SAAgB,iCAAiC,IAA8B;CAC7E,WAAwC,cAAc;AACxD;;;;AAKA,SAAgB,4BAAyD;CACvE,IAAI,kBAAkB,OAAO,iBAAiB;CAC9C,MAAM,SAAU,WAAuC;CAEvD,OAAO,SAAS,OAAO,IAAI;AAC7B"}
@@ -1,7 +1,50 @@
1
- import { I as isSelector, Qt as isDevEnv } from "./config-B5kHzuNz.js";
1
+ //#region src/utils/is-dev-env.ts
2
+ /**
3
+ * Check if we're in a development environment at runtime
4
+ * Uses bracket notation to avoid bundler compilation
5
+ * Also checks for TASTY_DEBUG localStorage setting
6
+ */
7
+ function isDevEnv() {
8
+ if (typeof window !== "undefined" && window.localStorage) try {
9
+ const forceTastyDebug = window.localStorage.getItem("TASTY_DEBUG");
10
+ if (forceTastyDebug !== null && forceTastyDebug.toLowerCase() === "true") return true;
11
+ } catch {}
12
+ if (typeof process === "undefined") return false;
13
+ return true;
14
+ }
15
+ //#endregion
16
+ //#region src/utils/warnings.ts
17
+ const PREFIX = "[Tasty]";
18
+ /** Warning keys already emitted, so each distinct diagnostic warns once. */
19
+ const emittedWarnings = /* @__PURE__ */ new Set();
20
+ function warn(...args) {
21
+ console.warn(PREFIX, ...args);
22
+ }
23
+ /** Emit a warning at most once per key. No-op outside development mode. */
24
+ function warnOnceDev(key, message) {
25
+ if (emittedWarnings.has(key)) return;
26
+ emittedWarnings.add(key);
27
+ if (!isDevEnv()) return;
28
+ console.warn(`${PREFIX} ${message}`);
29
+ }
30
+ /** Forget emitted style warnings. Called by `resetConfig()` for test isolation. */
31
+ function resetStyleWarnings() {
32
+ emittedWarnings.clear();
33
+ }
34
+ //#endregion
35
+ //#region src/utils/is-selector.ts
36
+ /** Check whether a style-object key identifies a nested CSS selector. */
37
+ function isSelector(key) {
38
+ const first = key.charCodeAt(0);
39
+ return first === 38 || first === 46 || first >= 65 && first <= 90;
40
+ }
41
+ //#endregion
2
42
  //#region src/utils/merge-styles.ts
3
43
  const devMode = isDevEnv();
4
44
  const INHERIT_VALUE = "@inherit";
45
+ function warnMissingInherit(key) {
46
+ if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
47
+ }
5
48
  /**
6
49
  * Check if a value is a state map (object, not array).
7
50
  */
@@ -50,26 +93,24 @@ function resolveStateMap(parentValue, childMap) {
50
93
  * Extend mode: parent entries are preserved, child entries add/override/reposition.
51
94
  */
52
95
  function resolveExtendMode(parentMap, childMap) {
53
- const inheritKeys = /* @__PURE__ */ new Set();
54
- const removeKeys = /* @__PURE__ */ new Set();
55
- const overrideKeys = /* @__PURE__ */ new Map();
56
- for (const key of Object.keys(childMap)) {
57
- const val = childMap[key];
58
- if (val === INHERIT_VALUE) {
59
- if (key in parentMap) inheritKeys.add(key);
60
- else if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
61
- } else if (val === null) removeKeys.add(key);
62
- else if (key in parentMap) overrideKeys.set(key, val);
63
- }
64
96
  const result = {};
97
+ const childKeys = Object.keys(childMap);
98
+ const childKeySet = new Set(childKeys);
65
99
  for (const key of Object.keys(parentMap)) {
66
- if (removeKeys.has(key)) continue;
67
- if (inheritKeys.has(key)) continue;
68
- if (overrideKeys.has(key)) result[key] = overrideKeys.get(key);
69
- else result[key] = parentMap[key];
100
+ if (!childKeySet.has(key)) {
101
+ result[key] = parentMap[key];
102
+ continue;
103
+ }
104
+ const childValue = childMap[key];
105
+ if (childValue === null || childValue === INHERIT_VALUE) continue;
106
+ result[key] = childValue;
107
+ }
108
+ for (const key of childKeys) {
109
+ const value = childMap[key];
110
+ if (value === INHERIT_VALUE) if (key in parentMap) result[key] = parentMap[key];
111
+ else warnMissingInherit(key);
112
+ else if (value !== null && !(key in parentMap)) result[key] = value;
70
113
  }
71
- for (const key of Object.keys(childMap)) if (inheritKeys.has(key)) result[key] = parentMap[key];
72
- else if (!removeKeys.has(key) && !overrideKeys.has(key) && childMap[key] !== INHERIT_VALUE) result[key] = childMap[key];
73
114
  return result;
74
115
  }
75
116
  /**
@@ -79,10 +120,9 @@ function resolveReplaceMode(parentMap, childMap) {
79
120
  const result = {};
80
121
  for (const key of Object.keys(childMap)) {
81
122
  const val = childMap[key];
82
- if (val === INHERIT_VALUE) {
83
- if (key in parentMap) result[key] = parentMap[key];
84
- else if (devMode) console.warn(`[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`);
85
- } else if (val !== null) result[key] = val;
123
+ if (val === INHERIT_VALUE) if (key in parentMap) result[key] = parentMap[key];
124
+ else warnMissingInherit(key);
125
+ else if (val !== null) result[key] = val;
86
126
  }
87
127
  return result;
88
128
  }
@@ -139,6 +179,6 @@ function mergeStyles(...objects) {
139
179
  return styles;
140
180
  }
141
181
  //#endregion
142
- export { mergeStyles as t };
182
+ export { warnOnceDev as a, warn as i, isSelector as n, isDevEnv as o, resetStyleWarnings as r, mergeStyles as t };
143
183
 
144
- //# sourceMappingURL=merge-styles-oklji0KB.js.map
184
+ //# sourceMappingURL=shared-utils-Bgl8FNGJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-utils-Bgl8FNGJ.js","names":[],"sources":["../../src/utils/is-dev-env.ts","../../src/utils/warnings.ts","../../src/utils/is-selector.ts","../../src/utils/merge-styles.ts"],"sourcesContent":["/**\n * Check if we're in a development environment at runtime\n * Uses bracket notation to avoid bundler compilation\n * Also checks for TASTY_DEBUG localStorage setting\n */\nexport function isDevEnv(): boolean {\n // Check localStorage for DEBUG_TASTY setting (browser environment)\n if (typeof window !== 'undefined' && window.localStorage) {\n try {\n const forceTastyDebug = window.localStorage.getItem('TASTY_DEBUG');\n if (\n forceTastyDebug !== null &&\n forceTastyDebug.toLowerCase() === 'true'\n ) {\n return true;\n }\n } catch {\n // localStorage might not be available (private browsing, etc.)\n // Continue with other checks\n }\n }\n\n // Check NODE_ENV for Node.js environments\n if (typeof process === 'undefined') return false;\n\n // Use bracket notation to avoid bundler replacement\n const nodeEnv = process.env?.['NODE_ENV'];\n return nodeEnv !== 'test' && nodeEnv !== 'production';\n}\n","import { isDevEnv } from './is-dev-env';\n\nconst PREFIX = '[Tasty]';\n\n/** Warning keys already emitted, so each distinct diagnostic warns once. */\nconst emittedWarnings = new Set<string>();\n\nexport function warn(...args: unknown[]) {\n console.warn(PREFIX, ...args);\n}\n\n/** Emit a warning at most once per key. No-op outside development mode. */\nexport function warnOnceDev(key: string, message: string): void {\n if (emittedWarnings.has(key)) return;\n emittedWarnings.add(key);\n\n if (!isDevEnv()) return;\n\n console.warn(`${PREFIX} ${message}`);\n}\n\n/** Forget emitted style warnings. Called by `resetConfig()` for test isolation. */\nexport function resetStyleWarnings(): void {\n emittedWarnings.clear();\n}\n","/** Check whether a style-object key identifies a nested CSS selector. */\nexport function isSelector(key: string): boolean {\n const first = key.charCodeAt(0);\n return (\n first === 38 || // &\n first === 46 || // .\n (first >= 65 && first <= 90) // A-Z\n );\n}\n","import type { Styles, StylesWithoutSelectors } from '../styles/types';\n\nimport { isDevEnv } from './is-dev-env';\nimport { isSelector } from './is-selector';\n\nconst devMode = isDevEnv();\n\nconst INHERIT_VALUE = '@inherit';\n\nfunction warnMissingInherit(key: string): void {\n if (devMode) {\n console.warn(\n `[Tasty] @inherit used for state '${key}' that does not exist in the parent style map. Entry skipped.`,\n );\n }\n}\n\n/**\n * Check if a value is a state map (object, not array).\n */\nfunction isStateMap(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Normalize a parent value to a state map.\n * - Already a state map → return as-is\n * - Non-null, non-false primitive → wrap as `{ '': value }`\n * - null / undefined / false → return null (no parent to merge with)\n */\nfunction normalizeToStateMap(value: unknown): Record<string, unknown> | null {\n if (isStateMap(value)) return value as Record<string, unknown>;\n if (value != null && value !== false) return { '': value };\n return null;\n}\n\n/**\n * Resolve a child state map against a parent value.\n *\n * Mode is determined by whether the child contains a `''` (default) key:\n * - No `''` → extend mode: parent entries preserved, child adds/overrides/repositions\n * - Has `''` → replace mode: child defines everything, `@inherit` cherry-picks from parent\n *\n * In both modes:\n * - `@inherit` value → resolve from parent state map\n * - `null` value → remove this state from the result\n * - `false` value → tombstone, persists through all layers, blocks recipe\n */\nfunction resolveStateMap(\n parentValue: unknown,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const isExtend = !('' in childMap);\n const parentMap = normalizeToStateMap(parentValue);\n\n if (!parentMap) {\n // No parent to merge with — strip nulls and @inherit, return child entries\n const result: Record<string, unknown> = {};\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === null || val === INHERIT_VALUE) continue;\n result[key] = val;\n }\n return result;\n }\n\n if (isExtend) {\n return resolveExtendMode(parentMap, childMap);\n }\n\n return resolveReplaceMode(parentMap, childMap);\n}\n\n/**\n * Extend mode: parent entries are preserved, child entries add/override/reposition.\n */\nfunction resolveExtendMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n // 1. Parent entries in order (skip removed, skip repositioned, apply overrides)\n const result: Record<string, unknown> = {};\n const childKeys = Object.keys(childMap);\n const childKeySet = new Set(childKeys);\n for (const key of Object.keys(parentMap)) {\n if (!childKeySet.has(key)) {\n result[key] = parentMap[key];\n continue;\n }\n const childValue = childMap[key];\n if (childValue === null || childValue === INHERIT_VALUE) continue;\n result[key] = childValue;\n }\n\n // 2. Append new + repositioned entries in child declaration order\n for (const key of childKeys) {\n const value = childMap[key];\n if (value === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else warnMissingInherit(key);\n } else if (value !== null && !(key in parentMap)) {\n result[key] = value;\n }\n }\n\n return result;\n}\n\n/**\n * Replace mode: child entries define the result, `@inherit` pulls from parent.\n */\nfunction resolveReplaceMode(\n parentMap: Record<string, unknown>,\n childMap: Record<string, unknown>,\n): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n\n for (const key of Object.keys(childMap)) {\n const val = childMap[key];\n if (val === INHERIT_VALUE) {\n if (key in parentMap) {\n result[key] = parentMap[key];\n } else warnMissingInherit(key);\n } else if (val !== null) {\n result[key] = val;\n }\n }\n\n return result;\n}\n\n/**\n * Merge sub-element properties with state map / null / undefined support.\n */\nfunction mergeSubElementStyles(\n parentSub: StylesWithoutSelectors | undefined,\n childSub: StylesWithoutSelectors,\n): StylesWithoutSelectors {\n const parent = parentSub as Record<string, unknown> | undefined;\n const child = childSub as Record<string, unknown>;\n const merged: Record<string, unknown> = { ...parent, ...child };\n\n for (const key of Object.keys(child)) {\n const val = child[key];\n\n if (val === undefined) {\n if (parent && key in parent) {\n merged[key] = parent[key];\n }\n } else if (val === null) {\n delete merged[key];\n } else if (isStateMap(val)) {\n merged[key] = resolveStateMap(\n parent ? parent[key] : undefined,\n val as Record<string, unknown>,\n );\n }\n }\n\n return merged as StylesWithoutSelectors;\n}\n\nexport function mergeStyles(...objects: (Styles | undefined | null)[]): Styles {\n let styles: Styles = objects[0] ? { ...objects[0] } : {};\n let pos = 1;\n\n while (pos in objects) {\n const selectorKeys = Object.keys(styles).filter(\n (key) => isSelector(key) && styles[key],\n );\n const newStyles = objects[pos];\n\n if (newStyles) {\n const resultStyles = { ...styles, ...newStyles };\n\n // Collect all selector keys from both parent and child\n const newSelectorKeys = Object.keys(newStyles).filter(isSelector);\n const allSelectorKeys = new Set([...selectorKeys, ...newSelectorKeys]);\n\n for (const key of allSelectorKeys) {\n const newValue = newStyles?.[key];\n\n if (newValue === false || newValue === null) {\n delete resultStyles[key];\n } else if (newValue === undefined) {\n resultStyles[key] = styles[key];\n } else if (newValue) {\n resultStyles[key] = mergeSubElementStyles(\n styles[key] as StylesWithoutSelectors,\n newValue as StylesWithoutSelectors,\n );\n }\n }\n\n // Handle non-selector properties: state maps, null, undefined\n for (const key of Object.keys(newStyles)) {\n if (isSelector(key)) continue;\n\n const newValue = newStyles[key];\n\n if (newValue === undefined) {\n if (key in styles) {\n resultStyles[key] = styles[key];\n } else {\n delete resultStyles[key];\n }\n } else if (newValue === null) {\n delete resultStyles[key];\n } else if (isStateMap(newValue)) {\n (resultStyles as Record<string, unknown>)[key] = resolveStateMap(\n styles[key],\n newValue as Record<string, unknown>,\n );\n }\n }\n\n styles = resultStyles;\n }\n\n pos++;\n }\n\n return styles;\n}\n"],"mappings":";;;;;;AAKA,SAAgB,WAAoB;CAElC,IAAI,OAAO,WAAW,eAAe,OAAO,cAC1C,IAAI;EACF,MAAM,kBAAkB,OAAO,aAAa,QAAQ,aAAa;EACjE,IACE,oBAAoB,QACpB,gBAAgB,YAAY,MAAM,QAElC,OAAO;CAEX,QAAQ,CAGR;CAIF,IAAI,OAAO,YAAY,aAAa,OAAO;CAI3C,OAA6B;AAC/B;;;AC1BA,MAAM,SAAS;;AAGf,MAAM,kCAAkB,IAAI,IAAY;AAExC,SAAgB,KAAK,GAAG,MAAiB;CACvC,QAAQ,KAAK,QAAQ,GAAG,IAAI;AAC9B;;AAGA,SAAgB,YAAY,KAAa,SAAuB;CAC9D,IAAI,gBAAgB,IAAI,GAAG,GAAG;CAC9B,gBAAgB,IAAI,GAAG;CAEvB,IAAI,CAAC,SAAS,GAAG;CAEjB,QAAQ,KAAK,GAAG,OAAO,GAAG,SAAS;AACrC;;AAGA,SAAgB,qBAA2B;CACzC,gBAAgB,MAAM;AACxB;;;;ACvBA,SAAgB,WAAW,KAAsB;CAC/C,MAAM,QAAQ,IAAI,WAAW,CAAC;CAC9B,OACE,UAAU,MACV,UAAU,MACT,SAAS,MAAM,SAAS;AAE7B;;;ACHA,MAAM,UAAU,SAAS;AAEzB,MAAM,gBAA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