boss-css 0.0.1 → 0.0.3

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 (268) hide show
  1. package/README.md +1 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +43 -0
  3. package/dist/_virtual/rolldown_runtime.mjs +20 -0
  4. package/dist/api/browser.cjs +54 -0
  5. package/dist/api/browser.mjs +48 -0
  6. package/dist/api/config.cjs +94 -0
  7. package/dist/api/config.mjs +91 -0
  8. package/dist/api/css.cjs +304 -0
  9. package/dist/api/css.mjs +303 -0
  10. package/dist/api/dictionary.cjs +218 -0
  11. package/dist/api/dictionary.mjs +215 -0
  12. package/dist/api/file/dts.cjs +21 -0
  13. package/dist/api/file/dts.mjs +21 -0
  14. package/dist/api/file/file.cjs +123 -0
  15. package/dist/api/file/file.mjs +120 -0
  16. package/dist/api/file/js.cjs +118 -0
  17. package/dist/api/file/js.mjs +116 -0
  18. package/dist/api/names.cjs +52 -0
  19. package/dist/api/names.mjs +46 -0
  20. package/dist/api/noopCss.cjs +37 -0
  21. package/dist/api/noopCss.mjs +36 -0
  22. package/dist/api/propTree.cjs +54 -0
  23. package/dist/api/propTree.mjs +48 -0
  24. package/dist/api/server.cjs +112 -0
  25. package/dist/api/server.mjs +106 -0
  26. package/dist/cli/build.cjs +1 -0
  27. package/dist/cli/build.mjs +3 -0
  28. package/dist/cli/index.cjs +30 -0
  29. package/dist/cli/index.mjs +29 -0
  30. package/dist/cli/tasks/build.cjs +24 -0
  31. package/dist/cli/tasks/build.mjs +23 -0
  32. package/dist/cli/tasks/choose.cjs +47 -0
  33. package/dist/cli/tasks/choose.mjs +46 -0
  34. package/dist/cli/tasks/compile.cjs +68 -0
  35. package/dist/cli/tasks/compile.mjs +67 -0
  36. package/dist/cli/tasks/dev.cjs +51 -0
  37. package/dist/cli/tasks/dev.mjs +48 -0
  38. package/dist/cli/tasks/init.cjs +1835 -0
  39. package/dist/cli/tasks/init.mjs +1831 -0
  40. package/dist/cli/tasks/watch.cjs +38 -0
  41. package/dist/cli/tasks/watch.mjs +37 -0
  42. package/dist/cli/templates/init.cjs +82 -0
  43. package/dist/cli/templates/init.mjs +78 -0
  44. package/dist/cli/types.cjs +13 -0
  45. package/dist/cli/types.mjs +13 -0
  46. package/dist/cli/utils.cjs +43 -0
  47. package/dist/cli/utils.mjs +41 -0
  48. package/dist/compile/classname-strategy.cjs +79 -0
  49. package/dist/compile/classname-strategy.mjs +77 -0
  50. package/dist/compile/classname.cjs +366 -0
  51. package/dist/compile/classname.mjs +360 -0
  52. package/dist/compile/index.cjs +238 -0
  53. package/dist/compile/index.mjs +235 -0
  54. package/dist/compile/jsx.cjs +803 -0
  55. package/dist/compile/jsx.mjs +800 -0
  56. package/dist/compile/prepared.cjs +88 -0
  57. package/dist/compile/prepared.mjs +87 -0
  58. package/dist/compile/runtime.cjs +33 -0
  59. package/dist/compile/runtime.mjs +32 -0
  60. package/dist/compile/transform.cjs +371 -0
  61. package/dist/compile/transform.mjs +369 -0
  62. package/dist/cx/index.cjs +93 -0
  63. package/dist/cx/index.mjs +85 -0
  64. package/dist/detect-fw/index.cjs +384 -0
  65. package/dist/detect-fw/index.mjs +379 -0
  66. package/dist/dev/client.cjs +39 -0
  67. package/dist/dev/client.mjs +38 -0
  68. package/dist/dev/plugin/browser.cjs +11 -0
  69. package/dist/dev/plugin/browser.mjs +9 -0
  70. package/dist/dev/plugin/server.cjs +86 -0
  71. package/dist/dev/plugin/server.mjs +78 -0
  72. package/dist/dev/port.cjs +46 -0
  73. package/dist/dev/port.mjs +43 -0
  74. package/dist/dev/runtime.cjs +28 -0
  75. package/dist/dev/runtime.mjs +29 -0
  76. package/dist/dev/server.cjs +808 -0
  77. package/dist/dev/server.mjs +805 -0
  78. package/dist/dev/shared.cjs +6 -0
  79. package/dist/dev/shared.mjs +5 -0
  80. package/dist/eslint-plugin/index.cjs +66 -0
  81. package/dist/eslint-plugin/index.mjs +66 -0
  82. package/dist/eslint-plugin/rules/classnames-only.cjs +68 -0
  83. package/dist/eslint-plugin/rules/classnames-only.mjs +68 -0
  84. package/dist/eslint-plugin/rules/format-classnames.cjs +137 -0
  85. package/dist/eslint-plugin/rules/format-classnames.mjs +136 -0
  86. package/dist/eslint-plugin/rules/no-unknown-classes.cjs +119 -0
  87. package/dist/eslint-plugin/rules/no-unknown-classes.mjs +119 -0
  88. package/dist/eslint-plugin/rules/prefer-classnames.cjs +69 -0
  89. package/dist/eslint-plugin/rules/prefer-classnames.mjs +69 -0
  90. package/dist/eslint-plugin/rules/prefer-token-values.cjs +197 -0
  91. package/dist/eslint-plugin/rules/prefer-token-values.mjs +197 -0
  92. package/dist/eslint-plugin/rules/props-only.cjs +115 -0
  93. package/dist/eslint-plugin/rules/props-only.mjs +115 -0
  94. package/dist/eslint-plugin/rules/redundant-cx.cjs +66 -0
  95. package/dist/eslint-plugin/rules/redundant-cx.mjs +66 -0
  96. package/dist/eslint-plugin/rules/require-prop-functions.cjs +130 -0
  97. package/dist/eslint-plugin/rules/require-prop-functions.mjs +130 -0
  98. package/dist/eslint-plugin/utils/api.cjs +30 -0
  99. package/dist/eslint-plugin/utils/api.mjs +29 -0
  100. package/dist/eslint-plugin/utils/ast.cjs +119 -0
  101. package/dist/eslint-plugin/utils/ast.mjs +112 -0
  102. package/dist/eslint-plugin/utils/boss-classes.cjs +185 -0
  103. package/dist/eslint-plugin/utils/boss-classes.mjs +175 -0
  104. package/dist/eslint-plugin/utils/defaults.cjs +99 -0
  105. package/dist/eslint-plugin/utils/defaults.mjs +93 -0
  106. package/dist/eslint-plugin/utils/format.cjs +20 -0
  107. package/dist/eslint-plugin/utils/format.mjs +19 -0
  108. package/dist/eslint-plugin/utils/order.cjs +76 -0
  109. package/dist/eslint-plugin/utils/order.mjs +76 -0
  110. package/dist/eslint-plugin/utils/property-order.cjs +449 -0
  111. package/dist/eslint-plugin/utils/property-order.mjs +448 -0
  112. package/dist/eslint-plugin/utils/static.cjs +36 -0
  113. package/dist/eslint-plugin/utils/static.mjs +35 -0
  114. package/dist/fontsource/directory.cjs +39588 -0
  115. package/dist/fontsource/directory.mjs +39587 -0
  116. package/dist/fontsource/server.cjs +291 -0
  117. package/dist/fontsource/server.mjs +282 -0
  118. package/dist/index.cjs +10 -0
  119. package/dist/index.mjs +6 -0
  120. package/dist/log/browser.cjs +28 -0
  121. package/dist/log/browser.mjs +28 -0
  122. package/dist/log/server.cjs +32 -0
  123. package/dist/log/server.mjs +30 -0
  124. package/dist/merge/index.cjs +590 -0
  125. package/dist/merge/index.mjs +586 -0
  126. package/dist/native/browser.cjs +78 -0
  127. package/dist/native/browser.mjs +77 -0
  128. package/dist/native/server.cjs +180 -0
  129. package/dist/native/server.mjs +176 -0
  130. package/dist/native/styleTypes.cjs +168 -0
  131. package/dist/native/styleTypes.mjs +164 -0
  132. package/dist/parser/classname/server.cjs +239 -0
  133. package/dist/parser/classname/server.mjs +232 -0
  134. package/dist/parser/jsx/browser.cjs +66 -0
  135. package/dist/parser/jsx/browser.mjs +63 -0
  136. package/dist/parser/jsx/extractCode.cjs +99 -0
  137. package/dist/parser/jsx/extractCode.mjs +98 -0
  138. package/dist/parser/jsx/extractPrepared.cjs +123 -0
  139. package/dist/parser/jsx/extractPrepared.mjs +122 -0
  140. package/dist/parser/jsx/extractProps.cjs +234 -0
  141. package/dist/parser/jsx/extractProps.mjs +232 -0
  142. package/dist/parser/jsx/isDOMProp.cjs +17 -0
  143. package/dist/parser/jsx/isDOMProp.mjs +15 -0
  144. package/dist/parser/jsx/native.cjs +110 -0
  145. package/dist/parser/jsx/native.mjs +108 -0
  146. package/dist/parser/jsx/runtime.cjs +4 -0
  147. package/dist/parser/jsx/runtime.mjs +3 -0
  148. package/dist/parser/jsx/server.cjs +278 -0
  149. package/dist/parser/jsx/server.mjs +268 -0
  150. package/dist/postcss/index.cjs +16 -0
  151. package/dist/postcss/index.mjs +16 -0
  152. package/dist/prop/at/runtime-only.cjs +90 -0
  153. package/dist/prop/at/runtime-only.mjs +88 -0
  154. package/dist/prop/at/server.cjs +282 -0
  155. package/dist/prop/at/server.mjs +268 -0
  156. package/dist/prop/at/shared.cjs +153 -0
  157. package/dist/prop/at/shared.mjs +144 -0
  158. package/dist/prop/bosswind/browser.cjs +18 -0
  159. package/dist/prop/bosswind/browser.mjs +16 -0
  160. package/dist/prop/bosswind/runtime-only.cjs +18 -0
  161. package/dist/prop/bosswind/runtime-only.mjs +16 -0
  162. package/dist/prop/bosswind/server.cjs +81 -0
  163. package/dist/prop/bosswind/server.mjs +72 -0
  164. package/dist/prop/bosswind/shared.cjs +861 -0
  165. package/dist/prop/bosswind/shared.mjs +855 -0
  166. package/dist/prop/bosswind/tailwind-theme.cjs +703 -0
  167. package/dist/prop/bosswind/tailwind-theme.mjs +702 -0
  168. package/dist/prop/child/runtime-only.cjs +18 -0
  169. package/dist/prop/child/runtime-only.mjs +15 -0
  170. package/dist/prop/child/server.cjs +81 -0
  171. package/dist/prop/child/server.mjs +72 -0
  172. package/dist/prop/css/getDtsTemplate.cjs +65 -0
  173. package/dist/prop/css/getDtsTemplate.mjs +63 -0
  174. package/dist/prop/css/runtime-only.cjs +14 -0
  175. package/dist/prop/css/runtime-only.mjs +13 -0
  176. package/dist/prop/css/server.cjs +99 -0
  177. package/dist/prop/css/server.mjs +90 -0
  178. package/dist/prop/pseudo/runtime-only.cjs +23 -0
  179. package/dist/prop/pseudo/runtime-only.mjs +21 -0
  180. package/dist/prop/pseudo/server.cjs +91 -0
  181. package/dist/prop/pseudo/server.mjs +82 -0
  182. package/dist/prop/pseudo/shared.cjs +61 -0
  183. package/dist/prop/pseudo/shared.mjs +60 -0
  184. package/dist/reset/server.cjs +34 -0
  185. package/dist/reset/server.mjs +26 -0
  186. package/dist/runtime/index.cjs +119 -0
  187. package/dist/runtime/index.mjs +118 -0
  188. package/dist/runtime/preact.cjs +4 -0
  189. package/dist/runtime/preact.mjs +3 -0
  190. package/dist/runtime/qwik.cjs +21 -0
  191. package/dist/runtime/qwik.mjs +18 -0
  192. package/dist/runtime/react.cjs +4 -0
  193. package/dist/runtime/react.mjs +3 -0
  194. package/dist/runtime/solid.cjs +15 -0
  195. package/dist/runtime/solid.mjs +14 -0
  196. package/dist/runtime/stencil.cjs +25 -0
  197. package/dist/runtime/stencil.mjs +21 -0
  198. package/dist/runtime/style.cjs +14 -0
  199. package/dist/runtime/style.mjs +13 -0
  200. package/dist/shared/boundaries.cjs +288 -0
  201. package/dist/shared/boundaries.mjs +285 -0
  202. package/dist/shared/customCss.cjs +212 -0
  203. package/dist/shared/customCss.mjs +211 -0
  204. package/dist/shared/debug.cjs +76 -0
  205. package/dist/shared/debug.mjs +74 -0
  206. package/dist/shared/file.cjs +21 -0
  207. package/dist/shared/file.mjs +19 -0
  208. package/dist/shared/framework.cjs +10 -0
  209. package/dist/shared/framework.mjs +9 -0
  210. package/dist/shared/json.cjs +58 -0
  211. package/dist/shared/json.mjs +57 -0
  212. package/dist/shared/types.cjs +11 -0
  213. package/dist/shared/types.mjs +10 -0
  214. package/dist/strategy/classic/runtime-only.cjs +190 -0
  215. package/dist/strategy/classic/runtime-only.mjs +186 -0
  216. package/dist/strategy/classname-first/runtime-only.cjs +138 -0
  217. package/dist/strategy/classname-first/runtime-only.mjs +134 -0
  218. package/dist/strategy/classname-first/server.cjs +139 -0
  219. package/dist/strategy/classname-first/server.mjs +133 -0
  220. package/dist/strategy/classname-only/server.cjs +43 -0
  221. package/dist/strategy/classname-only/server.mjs +35 -0
  222. package/dist/strategy/inline-first/browser.cjs +61 -0
  223. package/dist/strategy/inline-first/browser.mjs +58 -0
  224. package/dist/strategy/inline-first/runtime-only.cjs +159 -0
  225. package/dist/strategy/inline-first/runtime-only.mjs +155 -0
  226. package/dist/strategy/inline-first/server.cjs +92 -0
  227. package/dist/strategy/inline-first/server.mjs +83 -0
  228. package/dist/strategy/runtime/runtime-only.cjs +24 -0
  229. package/dist/strategy/runtime/runtime-only.mjs +22 -0
  230. package/dist/strategy/runtime/server.cjs +72 -0
  231. package/dist/strategy/runtime/server.mjs +63 -0
  232. package/dist/strategy/runtime-only/css.cjs +183 -0
  233. package/dist/strategy/runtime-only/css.mjs +181 -0
  234. package/dist/tasks/build.cjs +88 -0
  235. package/dist/tasks/build.mjs +84 -0
  236. package/dist/tasks/compile.cjs +12 -0
  237. package/dist/tasks/compile.mjs +12 -0
  238. package/dist/tasks/postcss.cjs +116 -0
  239. package/dist/tasks/postcss.mjs +113 -0
  240. package/dist/tasks/session.cjs +46 -0
  241. package/dist/tasks/session.mjs +42 -0
  242. package/dist/tasks/watch.cjs +102 -0
  243. package/dist/tasks/watch.mjs +99 -0
  244. package/dist/transform/cache.cjs +24 -0
  245. package/dist/transform/cache.mjs +21 -0
  246. package/dist/transform/processFile.cjs +26 -0
  247. package/dist/transform/processFile.mjs +24 -0
  248. package/dist/use/token/browser.cjs +65 -0
  249. package/dist/use/token/browser.mjs +61 -0
  250. package/dist/use/token/runtime-only.cjs +245 -0
  251. package/dist/use/token/runtime-only.mjs +239 -0
  252. package/dist/use/token/server.cjs +325 -0
  253. package/dist/use/token/server.mjs +313 -0
  254. package/dist/use/token/vars.cjs +47 -0
  255. package/dist/use/token/vars.mjs +46 -0
  256. package/package.json +300 -4
  257. package/src/api/config.d.ts +1 -0
  258. package/src/fontsource/types.d.ts +50 -0
  259. package/src/packages/document-create-element/createElement.browser.js +3 -0
  260. package/src/packages/document-create-element/createElement.js +7 -0
  261. package/src/packages/document-create-element/package.json +17 -0
  262. package/src/packages/is-css-prop/browser.js +13 -0
  263. package/src/packages/is-css-prop/index.js +13 -0
  264. package/src/packages/is-css-prop/package-lock.json +52 -0
  265. package/src/packages/is-css-prop/package.json +17 -0
  266. package/src/prop/css/csstype.json +4387 -0
  267. package/src/prop/css/package.json +3 -0
  268. package/src/reset/reset.css +259 -0
@@ -0,0 +1,16 @@
1
+ import { runPostcss } from "../tasks/postcss.mjs";
2
+
3
+ //#region src/postcss/index.ts
4
+ function postcssPlugin(options = {}) {
5
+ return {
6
+ postcssPlugin: "boss-postcss-plugin",
7
+ plugins: [async (root, result) => {
8
+ await runPostcss(root, result, options);
9
+ }]
10
+ };
11
+ }
12
+ postcssPlugin.postcss = true;
13
+ var postcss_default = postcssPlugin;
14
+
15
+ //#endregion
16
+ export { postcss_default as default };
@@ -0,0 +1,90 @@
1
+ const require_shared = require('./shared.cjs');
2
+
3
+ //#region src/prop/at/runtime-only.ts
4
+ const atValuesCache = /* @__PURE__ */ new WeakMap();
5
+ const buildQuery = (from, to) => {
6
+ if (from === null && to === null) return "";
7
+ if (from === null) return `@media screen and (max-width: ${to}px)`;
8
+ if (to === null) return `@media screen and (min-width: ${from}px)`;
9
+ return `@media screen and (min-width: ${from}px) and (max-width: ${to}px)`;
10
+ };
11
+ const getAtValues = (api) => {
12
+ if (atValuesCache.has(api)) return atValuesCache.get(api);
13
+ const values = new Map(require_shared.baseAtValues);
14
+ const breakpoints = getAtBreakpoints(api);
15
+ Object.entries(breakpoints).forEach(([name, [from, to]]) => {
16
+ values.set(name, buildQuery(from, to));
17
+ if (!name.endsWith("+") && !name.endsWith("-")) {
18
+ values.set(`${name}+`, buildQuery(from, null));
19
+ values.set(`${name}-`, buildQuery(null, to));
20
+ }
21
+ });
22
+ atValuesCache.set(api, values);
23
+ return values;
24
+ };
25
+ const getAtBreakpoints = (api) => ({
26
+ ...require_shared.defaultBreakpoints,
27
+ ...api.breakpoints ?? {}
28
+ });
29
+ const getContainerInfo = (contexts) => {
30
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
31
+ const info = require_shared.parseContainerContext(contexts[i]);
32
+ if (info) return {
33
+ ...info,
34
+ index: i
35
+ };
36
+ }
37
+ return null;
38
+ };
39
+ const resolveMediaQuery = (api, key) => {
40
+ const direct = getAtValues(api).get(key);
41
+ if (direct) return direct;
42
+ const range = require_shared.parseRangeKey(key, getAtBreakpoints(api), api.unit ?? "px");
43
+ if (range) return require_shared.buildMediaQuery(range) ?? key;
44
+ return key;
45
+ };
46
+ const resolveContainerQuery = (api, key, name) => {
47
+ if (key.startsWith("@")) return key;
48
+ const range = require_shared.parseRangeKey(key, getAtBreakpoints(api), api.unit ?? "px");
49
+ if (range) return require_shared.buildContainerQuery(range, name);
50
+ return `${name ? `@container ${name}` : "@container"} ${key}`;
51
+ };
52
+ const resolveAtQuery = (api, contexts) => {
53
+ const atIndex = contexts.lastIndexOf("at");
54
+ if (atIndex !== -1 && contexts[atIndex + 1]) {
55
+ const containerInfo$1 = require_shared.parseContainerContext(contexts[atIndex + 1]);
56
+ if (containerInfo$1) {
57
+ const key$1 = contexts[atIndex + 2];
58
+ if (!key$1) return null;
59
+ return resolveContainerQuery(api, key$1, containerInfo$1.name);
60
+ }
61
+ const key = contexts[atIndex + 1];
62
+ return resolveMediaQuery(api, key);
63
+ }
64
+ const containerInfo = getContainerInfo(contexts);
65
+ if (containerInfo) {
66
+ const key = contexts[containerInfo.index + 1];
67
+ if (key) return resolveContainerQuery(api, key, containerInfo.name);
68
+ }
69
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
70
+ const key = contexts[i];
71
+ if (key.startsWith("@")) return key;
72
+ const range = require_shared.parseRangeKey(key, getAtBreakpoints(api), api.unit ?? "px");
73
+ if (range) return require_shared.buildMediaQuery(range) ?? key;
74
+ const values = getAtValues(api);
75
+ if (values.has(key)) return values.get(key);
76
+ }
77
+ return null;
78
+ };
79
+ const name = "at";
80
+ const onInit = (api) => {
81
+ api.breakpoints = {
82
+ ...require_shared.defaultBreakpoints,
83
+ ...api.breakpoints ?? {}
84
+ };
85
+ };
86
+
87
+ //#endregion
88
+ exports.name = name;
89
+ exports.onInit = onInit;
90
+ exports.resolveAtQuery = resolveAtQuery;
@@ -0,0 +1,88 @@
1
+ import { baseAtValues, buildContainerQuery, buildMediaQuery, defaultBreakpoints, parseContainerContext, parseRangeKey } from "./shared.mjs";
2
+
3
+ //#region src/prop/at/runtime-only.ts
4
+ const atValuesCache = /* @__PURE__ */ new WeakMap();
5
+ const buildQuery = (from, to) => {
6
+ if (from === null && to === null) return "";
7
+ if (from === null) return `@media screen and (max-width: ${to}px)`;
8
+ if (to === null) return `@media screen and (min-width: ${from}px)`;
9
+ return `@media screen and (min-width: ${from}px) and (max-width: ${to}px)`;
10
+ };
11
+ const getAtValues = (api) => {
12
+ if (atValuesCache.has(api)) return atValuesCache.get(api);
13
+ const values = new Map(baseAtValues);
14
+ const breakpoints = getAtBreakpoints(api);
15
+ Object.entries(breakpoints).forEach(([name, [from, to]]) => {
16
+ values.set(name, buildQuery(from, to));
17
+ if (!name.endsWith("+") && !name.endsWith("-")) {
18
+ values.set(`${name}+`, buildQuery(from, null));
19
+ values.set(`${name}-`, buildQuery(null, to));
20
+ }
21
+ });
22
+ atValuesCache.set(api, values);
23
+ return values;
24
+ };
25
+ const getAtBreakpoints = (api) => ({
26
+ ...defaultBreakpoints,
27
+ ...api.breakpoints ?? {}
28
+ });
29
+ const getContainerInfo = (contexts) => {
30
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
31
+ const info = parseContainerContext(contexts[i]);
32
+ if (info) return {
33
+ ...info,
34
+ index: i
35
+ };
36
+ }
37
+ return null;
38
+ };
39
+ const resolveMediaQuery = (api, key) => {
40
+ const direct = getAtValues(api).get(key);
41
+ if (direct) return direct;
42
+ const range = parseRangeKey(key, getAtBreakpoints(api), api.unit ?? "px");
43
+ if (range) return buildMediaQuery(range) ?? key;
44
+ return key;
45
+ };
46
+ const resolveContainerQuery = (api, key, name) => {
47
+ if (key.startsWith("@")) return key;
48
+ const range = parseRangeKey(key, getAtBreakpoints(api), api.unit ?? "px");
49
+ if (range) return buildContainerQuery(range, name);
50
+ return `${name ? `@container ${name}` : "@container"} ${key}`;
51
+ };
52
+ const resolveAtQuery = (api, contexts) => {
53
+ const atIndex = contexts.lastIndexOf("at");
54
+ if (atIndex !== -1 && contexts[atIndex + 1]) {
55
+ const containerInfo$1 = parseContainerContext(contexts[atIndex + 1]);
56
+ if (containerInfo$1) {
57
+ const key$1 = contexts[atIndex + 2];
58
+ if (!key$1) return null;
59
+ return resolveContainerQuery(api, key$1, containerInfo$1.name);
60
+ }
61
+ const key = contexts[atIndex + 1];
62
+ return resolveMediaQuery(api, key);
63
+ }
64
+ const containerInfo = getContainerInfo(contexts);
65
+ if (containerInfo) {
66
+ const key = contexts[containerInfo.index + 1];
67
+ if (key) return resolveContainerQuery(api, key, containerInfo.name);
68
+ }
69
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
70
+ const key = contexts[i];
71
+ if (key.startsWith("@")) return key;
72
+ const range = parseRangeKey(key, getAtBreakpoints(api), api.unit ?? "px");
73
+ if (range) return buildMediaQuery(range) ?? key;
74
+ const values = getAtValues(api);
75
+ if (values.has(key)) return values.get(key);
76
+ }
77
+ return null;
78
+ };
79
+ const name = "at";
80
+ const onInit = (api) => {
81
+ api.breakpoints = {
82
+ ...defaultBreakpoints,
83
+ ...api.breakpoints ?? {}
84
+ };
85
+ };
86
+
87
+ //#endregion
88
+ export { name, onInit, resolveAtQuery };
@@ -0,0 +1,282 @@
1
+ const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
+ const require_prop_pseudo_server = require('../pseudo/server.cjs');
3
+ const require_shared = require('./shared.cjs');
4
+ let _emotion_hash = require("@emotion/hash");
5
+ _emotion_hash = require_rolldown_runtime.__toESM(_emotion_hash);
6
+
7
+ //#region src/prop/at/server.ts
8
+ var server_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
9
+ DOWN: () => DOWN,
10
+ UP: () => UP,
11
+ dependencies: () => dependencies,
12
+ name: () => name,
13
+ onBoot: () => onBoot,
14
+ onProp: () => onProp,
15
+ onReady: () => onReady,
16
+ values: () => values
17
+ });
18
+ const UP = "+";
19
+ const DOWN = "-";
20
+ const name = "at";
21
+ const dependencies = new Set([
22
+ "at",
23
+ "container",
24
+ "keyframes"
25
+ ]);
26
+ const values = new Map([...require_shared.baseAtValues]);
27
+ const onBoot = async (api) => {
28
+ const baseBreakpoints = {
29
+ ...require_shared.defaultBreakpoints,
30
+ ...api.breakpoints ?? {}
31
+ };
32
+ api.breakpoints = { ...baseBreakpoints };
33
+ const breakpoints = api.breakpoints;
34
+ Object.entries(breakpoints).forEach(([name, [from, to]]) => [
35
+ ["", [from, to]],
36
+ [UP, [from, null]],
37
+ [DOWN, [null, to]]
38
+ ].forEach(([symbol, fromTo]) => breakpoints[`${name}${symbol}`] = fromTo));
39
+ Object.entries(breakpoints).forEach(([name, [from, to]]) => {
40
+ dependencies.add(name);
41
+ if (from === null) values.set(name, `@media screen and (max-width: ${to}px)`);
42
+ else if (to === null) values.set(name, `@media screen and (min-width: ${from}px)`);
43
+ else values.set(name, `@media screen and (min-width: ${from}px) and (max-width: ${to}px)`);
44
+ });
45
+ Array.from(values.keys()).forEach((name) => dependencies.add(name));
46
+ api.file.js.dts.set("body", `pseudo:AtPropsShorthandsInterfaceStart`, `export interface $$AtPropsShorthands {`);
47
+ for (const name of dependencies) {
48
+ if (name === "container") continue;
49
+ const description = name === "keyframes" ? "@keyframes" : values.get(name) ?? "";
50
+ const prop = {
51
+ property: name,
52
+ aliases: [name],
53
+ description
54
+ };
55
+ api.dictionary.set(name, prop);
56
+ name !== "at" && api.file.js.dts.set("body", `at:${name}:description`, prop.description).set("body", `at:${name}:declaration`, ` "${name}"?: ${name === "keyframes" ? "$$KeyframesProps" : "$$FinalProps"}\n`);
57
+ }
58
+ api.file.js.dts.set("body", `pseudo:AtPropsShorthandsInterfaceEnd`, `}`).set("body", "$$:KeyframesProps", `export type $$KeyframesProps = {
59
+ [key: string]: $$FinalProps
60
+ }`).set("body", "$$:AtNamedProps", `export type $$AtNamedProps = {
61
+ [key in \`container_\${string}\`]?: StandardProperties['container'] | $$FinalProps
62
+ } & {
63
+ [key in \`keyframes_\${string}\`]?: $$KeyframesProps
64
+ }`).set("body", `$$:AtProps`, `export type $$AtProps = {
65
+ at?: {
66
+ [key: string]: $$FinalProps | $$KeyframesProps
67
+ } & { [key: \`keyframes \${string}\`]: $$KeyframesProps } & $$AtPropsShorthands & $$AtNamedProps
68
+ } & $$AtPropsShorthands & $$AtNamedProps`).replace("body", `$$:FinalProps`, (v) => `${v} & $$AtProps`);
69
+ const runtimeConfig = api.runtime;
70
+ if (Boolean(runtimeConfig && (runtimeConfig.only !== void 0 || runtimeConfig.strategy))) {
71
+ api.file.js.importAndConfig({
72
+ name: "onInit",
73
+ from: "boss-css/prop/at/runtime-only"
74
+ }, () => true);
75
+ api.file.js.config({
76
+ from: "boss-css/prop/at/runtime-only",
77
+ config: { breakpoints: baseBreakpoints }
78
+ }, () => true);
79
+ }
80
+ };
81
+ const onReady = async (api) => {
82
+ const updateFinalProps = (value) => {
83
+ const content = typeof value === "string" ? value : value?.content;
84
+ if (typeof content !== "string") return value;
85
+ if (!content.includes("StandardProperties")) return content;
86
+ if (content.includes(`Omit<StandardProperties, 'container'>`)) return content;
87
+ return content.replace(" & StandardProperties", () => {
88
+ return ` & Omit<StandardProperties, 'container'> & { container?: StandardProperties['container'] | $$FinalProps }`;
89
+ });
90
+ };
91
+ api.file.js.dts.replace("body", "$$:FinalProps", updateFinalProps);
92
+ };
93
+ const isContainerContext = (value) => Boolean(require_shared.parseContainerContext(value));
94
+ const isKeyframesContext = (value) => Boolean(require_shared.parseKeyframesContext(value));
95
+ const getContainerInfo = (contexts) => {
96
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
97
+ const info = require_shared.parseContainerContext(contexts[i]);
98
+ if (info) return info;
99
+ }
100
+ return null;
101
+ };
102
+ const getContainerInfoWithIndex = (contexts) => {
103
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
104
+ const info = require_shared.parseContainerContext(contexts[i]);
105
+ if (info) return {
106
+ ...info,
107
+ index: i
108
+ };
109
+ }
110
+ return null;
111
+ };
112
+ const resolveMediaQuery = (api, key) => {
113
+ const direct = values.get(key);
114
+ if (direct) return direct;
115
+ const range = require_shared.parseRangeKey(key, api.breakpoints ?? {}, api.unit ?? "px");
116
+ if (range) return require_shared.buildMediaQuery(range) ?? key;
117
+ return key;
118
+ };
119
+ const resolveContainerQuery = (api, key, name) => {
120
+ if (key.startsWith("@")) return key;
121
+ const range = require_shared.parseRangeKey(key, api.breakpoints ?? {}, api.unit ?? "px");
122
+ if (range) return require_shared.buildContainerQuery(range, name);
123
+ return `${name ? `@container ${name}` : "@container"} ${key}`;
124
+ };
125
+ const resolveAtQuery = (api, contexts, key) => {
126
+ const containerInfo = getContainerInfo(contexts);
127
+ if (containerInfo) return resolveContainerQuery(api, key, containerInfo.name);
128
+ return resolveMediaQuery(api, key);
129
+ };
130
+ const resolveQueryFromContexts = (api, contexts) => {
131
+ const atIndex = contexts.lastIndexOf("at");
132
+ if (atIndex !== -1 && contexts[atIndex + 1]) {
133
+ const containerInfo$1 = require_shared.parseContainerContext(contexts[atIndex + 1]);
134
+ if (containerInfo$1) {
135
+ const key$1 = contexts[atIndex + 2];
136
+ if (!key$1) return null;
137
+ return resolveContainerQuery(api, key$1, containerInfo$1.name);
138
+ }
139
+ const key = contexts[atIndex + 1];
140
+ return resolveMediaQuery(api, key);
141
+ }
142
+ const containerInfo = getContainerInfoWithIndex(contexts);
143
+ if (containerInfo) {
144
+ const key = contexts[containerInfo.index + 1];
145
+ if (key) return resolveContainerQuery(api, key, containerInfo.name);
146
+ }
147
+ for (let i = contexts.length - 1; i >= 0; i -= 1) {
148
+ const key = contexts[i];
149
+ if (key.startsWith("@")) return key;
150
+ const range = require_shared.parseRangeKey(key, api.breakpoints ?? {}, api.unit ?? "px");
151
+ if (range) return require_shared.buildMediaQuery(range) ?? key;
152
+ const direct = values.get(key);
153
+ if (direct) return direct;
154
+ }
155
+ return null;
156
+ };
157
+ const buildAutoKeyframesName = (api, contexts) => {
158
+ return `kf-${(0, _emotion_hash.default)(`${api.selectorPrefix ?? ""}|${contexts.join("|")}`)}`;
159
+ };
160
+ const onProp = async (api, { name, prop, contexts, preferVariables, file }) => {
161
+ const isAt = name === "at";
162
+ const contextName = prop?.named ? `${name} ${prop.named}` : name;
163
+ const handleKeyframes = async (entries, activeContexts) => {
164
+ const keyframesContext = activeContexts.at(-1);
165
+ if (!keyframesContext) return;
166
+ const keyframesInfo = require_shared.parseKeyframesContext(keyframesContext);
167
+ if (!keyframesInfo) return;
168
+ const keyframesName = keyframesInfo.name ?? buildAutoKeyframesName(api, activeContexts);
169
+ const query = resolveQueryFromContexts(api, activeContexts);
170
+ const frames = /* @__PURE__ */ new Map();
171
+ const selectors = /* @__PURE__ */ new Set();
172
+ for (const [step, stepProp] of Object.entries(entries)) {
173
+ if (!stepProp?.value || typeof stepProp.value !== "object" || Array.isArray(stepProp.value)) continue;
174
+ const normalizedStep = require_shared.normalizeKeyframeStep(step);
175
+ if (!normalizedStep) continue;
176
+ const stepContexts = [...activeContexts, step];
177
+ const stepEntries = stepProp.value;
178
+ for (const [propName, propValue] of Object.entries(stepEntries)) {
179
+ if (!propValue || typeof propValue !== "object" || Array.isArray(propValue)) continue;
180
+ const resolved = api.dictionary.resolve(propName);
181
+ const descriptor = resolved.descriptor;
182
+ const isCustomProperty = typeof propName === "string" && propName.startsWith("--");
183
+ if (!descriptor?.isCSSProp && !isCustomProperty) continue;
184
+ const propertyName = isCustomProperty ? propName : descriptor?.property ?? api.camelCaseToDash(propName);
185
+ const selectorValue = propValue.selectorValue ?? (preferVariables ? null : propValue.value);
186
+ const classToken = propValue.classToken;
187
+ const resolvedName = resolved?.name ?? propName;
188
+ const className = classToken ? null : api.contextToClassName(resolvedName, selectorValue, stepContexts, true, api.selectorPrefix);
189
+ const baseSelector = classToken ? api.classTokenToSelector(classToken) : `.${className}`;
190
+ const pseudoChain = stepContexts.filter((context) => require_prop_pseudo_server.dependencies.has(context));
191
+ const baseWithPseudos = pseudoChain.length ? `${baseSelector}:${pseudoChain.join(":")}` : baseSelector;
192
+ const selector = api.applyChildSelectors(baseWithPseudos, stepContexts);
193
+ selectors.add(selector);
194
+ const value = propValue.value === null ? `var(${api.contextToCSSVariable(resolvedName, null, stepContexts, api.selectorPrefix)})` : String(api.dictionary.toValue(propValue.value, propertyName));
195
+ if (!frames.has(normalizedStep)) frames.set(normalizedStep, /* @__PURE__ */ new Map());
196
+ frames.get(normalizedStep)?.set(propertyName, value);
197
+ }
198
+ }
199
+ if (!frames.size) return;
200
+ api.css.addRule(require_shared.buildKeyframesRule(keyframesName, frames), query);
201
+ const needsImportant = api.strategy === "inline-first" && preferVariables === true && activeContexts.length > 0;
202
+ for (const selector of selectors) {
203
+ api.css.selector({
204
+ selector,
205
+ query
206
+ });
207
+ api.css.rule("animation-name", keyframesName, needsImportant ? { important: true } : void 0);
208
+ api.css.write();
209
+ }
210
+ };
211
+ const processEntries = async (entries, nextContexts) => {
212
+ for (const [key, styleProp] of Object.entries(entries)) {
213
+ if (!styleProp?.value || typeof styleProp.value !== "object" || Array.isArray(styleProp.value)) continue;
214
+ const styleEntries = styleProp.value;
215
+ if (isContainerContext(key)) {
216
+ nextContexts.push(key);
217
+ await processEntries(styleEntries, nextContexts);
218
+ nextContexts.pop();
219
+ continue;
220
+ }
221
+ if (isKeyframesContext(key)) {
222
+ nextContexts.push(key);
223
+ await handleKeyframes(styleEntries, nextContexts);
224
+ nextContexts.pop();
225
+ continue;
226
+ }
227
+ nextContexts.push(key);
228
+ const query = resolveAtQuery(api, nextContexts, key);
229
+ for (const i in styleEntries) {
230
+ const entry = styleEntries[i];
231
+ const classToken = entry?.classToken;
232
+ const resolved = api.dictionary.resolve(i);
233
+ const resolvedName = resolved.descriptor ? resolved.name : i;
234
+ if (resolved.suffix) {
235
+ entry.named = resolved.suffix;
236
+ entry.rawName = resolved.raw;
237
+ }
238
+ const selectorValue = entry?.selectorValue ?? (preferVariables ? null : entry.value);
239
+ const className = classToken ? null : api.contextToClassName(resolvedName, selectorValue, nextContexts, true, api.selectorPrefix);
240
+ const baseSelector = classToken ? api.classTokenToSelector(classToken) : `.${className}`;
241
+ const pseudoChain = nextContexts.filter((context) => require_prop_pseudo_server.dependencies.has(context));
242
+ const baseWithPseudos = pseudoChain.length ? `${baseSelector}:${pseudoChain.join(":")}` : baseSelector;
243
+ const selector = api.applyChildSelectors(baseWithPseudos, nextContexts);
244
+ if (query && entry && !entry.query) entry.query = query;
245
+ api.css.selector({
246
+ selector,
247
+ query
248
+ });
249
+ await api.trigger("onProp", {
250
+ name: resolvedName,
251
+ prop: entry,
252
+ contexts: nextContexts,
253
+ preferVariables,
254
+ file
255
+ }, ({ dependencies }) => {
256
+ return !dependencies || dependencies.has(resolvedName);
257
+ });
258
+ if (api.css.current) api.css.write();
259
+ }
260
+ nextContexts.pop();
261
+ }
262
+ };
263
+ if (isAt) contexts.push(name);
264
+ await processEntries(isAt ? prop.value : { [contextName]: { value: prop.value } }, contexts);
265
+ if (isAt) contexts.pop();
266
+ };
267
+
268
+ //#endregion
269
+ exports.DOWN = DOWN;
270
+ exports.UP = UP;
271
+ exports.dependencies = dependencies;
272
+ exports.name = name;
273
+ exports.onBoot = onBoot;
274
+ exports.onProp = onProp;
275
+ exports.onReady = onReady;
276
+ Object.defineProperty(exports, 'server_exports', {
277
+ enumerable: true,
278
+ get: function () {
279
+ return server_exports;
280
+ }
281
+ });
282
+ exports.values = values;