@fluentic/style 0.1.0-beta.10 → 0.1.0-beta.12

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 (419) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/compiler/compiler/compiler.ts +8 -4
  3. package/compiler/utils/file_resolver.ts +2 -1
  4. package/dist/compiler/index.mjs +1 -1
  5. package/dist/{compiler-C3CEGGtI.mjs → compiler-mCfMhtX4.mjs} +2 -3
  6. package/dist/{compiler-C3CEGGtI.mjs.map → compiler-mCfMhtX4.mjs.map} +1 -1
  7. package/dist/{loader-_-VjzlrX.mjs → loader-DUS2i9Zb.mjs} +3 -3
  8. package/dist/loader-DUS2i9Zb.mjs.map +1 -0
  9. package/dist/{misc-B76PUnWe.mjs → misc-vGtt_SX7.mjs} +2 -2
  10. package/dist/{misc-B76PUnWe.mjs.map → misc-vGtt_SX7.mjs.map} +1 -1
  11. package/dist/plugin/farm/index.mjs +3 -3
  12. package/dist/plugin/nextjs/index.mjs +34 -18
  13. package/dist/plugin/nextjs/index.mjs.map +1 -1
  14. package/dist/plugin/nextjs/loader.mjs +4 -4
  15. package/dist/plugin/parcel/index.cjs +1 -1
  16. package/dist/plugin/parcel/index.mjs +2 -2
  17. package/dist/plugin/parcel/optimizer.cjs +1 -1
  18. package/dist/plugin/parcel/optimizer.mjs +2 -2
  19. package/dist/plugin/parcel/resolver.cjs +1 -1
  20. package/dist/plugin/parcel/resolver.mjs +2 -2
  21. package/dist/plugin/parcel/runtime.cjs +1 -1
  22. package/dist/plugin/parcel/runtime.mjs +1 -1
  23. package/dist/plugin/parcel/transformer.cjs +1 -1
  24. package/dist/plugin/parcel/transformer.mjs +2 -2
  25. package/dist/plugin/rspack/index.mjs +2 -2
  26. package/dist/plugin/vite/index.mjs +3 -3
  27. package/dist/plugin/webpack/index.mjs +2 -2
  28. package/dist/plugin/webpack/loader.mjs +2 -2
  29. package/dist/{registry-w8ET5R7v.mjs → registry-BJqMbdMu.mjs} +2 -2
  30. package/dist/{registry-w8ET5R7v.mjs.map → registry-BJqMbdMu.mjs.map} +1 -1
  31. package/dist/{shared-PK52rW6T.cjs → shared-BRUPuZdH.cjs} +2 -3
  32. package/dist/{shared-PK52rW6T.cjs.map → shared-BRUPuZdH.cjs.map} +1 -1
  33. package/dist/{shared-C_cYxNzz.mjs → shared-DDzZd0tM.mjs} +4 -4
  34. package/dist/{shared-C_cYxNzz.mjs.map → shared-DDzZd0tM.mjs.map} +1 -1
  35. package/dist/{sidecar-BhvmXYsD.mjs → sidecar-BTT0veLU.mjs} +3 -3
  36. package/dist/{sidecar-BhvmXYsD.mjs.map → sidecar-BTT0veLU.mjs.map} +1 -1
  37. package/dist/types/adapter/preact.d.ts +1 -0
  38. package/dist/types/adapter/react.d.ts +1 -0
  39. package/dist/types/adapter/solid.d.ts +1 -0
  40. package/dist/types/atomic/atRule/counterStyle.d.ts +10 -0
  41. package/dist/types/atomic/atRule/fontFace.d.ts +10 -0
  42. package/dist/types/atomic/atRule/fontPaletteValues.d.ts +10 -0
  43. package/dist/types/atomic/atRule/fontSrc.d.ts +1 -0
  44. package/dist/types/atomic/atRule/keyframes.d.ts +13 -0
  45. package/dist/types/atomic/atRule/positionTry.d.ts +13 -0
  46. package/dist/types/atomic/atRule/property.d.ts +13 -0
  47. package/dist/types/atomic/atRule/utils.d.ts +5 -0
  48. package/dist/types/atomic/className.d.ts +11 -0
  49. package/dist/types/atomic/debug/className/className.d.ts +9 -0
  50. package/dist/types/atomic/debug/className/index.d.ts +1 -0
  51. package/dist/types/atomic/debug/property/data.d.ts +3 -0
  52. package/dist/types/atomic/debug/property/index.d.ts +1 -0
  53. package/dist/types/atomic/debug/property/property.d.ts +5 -0
  54. package/dist/types/atomic/debug/selector.d.ts +2 -0
  55. package/dist/types/atomic/debug/value.d.ts +5 -0
  56. package/dist/types/atomic/element.d.ts +5 -0
  57. package/dist/types/atomic/layer/index.d.ts +3 -0
  58. package/dist/types/atomic/layer/layer.d.ts +12 -0
  59. package/dist/types/atomic/layer/types.d.ts +30 -0
  60. package/dist/types/atomic/layer/utils.d.ts +4 -0
  61. package/dist/types/atomic/property/index.d.ts +2 -0
  62. package/dist/types/atomic/property/presets.d.ts +4 -0
  63. package/dist/types/atomic/property/property.d.ts +3 -0
  64. package/dist/types/atomic/property/type_maps.d.ts +31 -0
  65. package/dist/types/atomic/property/types.d.ts +4 -0
  66. package/dist/types/atomic/rule.d.ts +5 -0
  67. package/dist/types/atomic/scope.d.ts +3 -0
  68. package/dist/types/atomic/theme.d.ts +7 -0
  69. package/dist/types/atomic/token.d.ts +7 -0
  70. package/dist/types/atomic/utils/cssIdent.d.ts +2 -0
  71. package/dist/types/atomic/utils/cssVar.d.ts +3 -0
  72. package/dist/types/atomic/utils/debug.d.ts +4 -0
  73. package/dist/types/atomic/utils/format.d.ts +5 -0
  74. package/dist/types/atomic/utils/hash.d.ts +1 -0
  75. package/dist/types/atomic/utils/selector.d.ts +6 -0
  76. package/dist/types/atomic/utils/types.d.ts +7 -0
  77. package/dist/types/atomic/value/index.d.ts +2 -0
  78. package/dist/types/atomic/value/unitless.d.ts +1 -0
  79. package/dist/types/atomic/value/value.d.ts +2 -0
  80. package/dist/types/atomic/var.d.ts +4 -0
  81. package/dist/types/builder/classname/class_name_builder.d.ts +4 -0
  82. package/dist/types/builder/classname/fns.d.ts +48 -0
  83. package/dist/types/builder/classname/index.d.ts +3 -0
  84. package/dist/types/builder/classname/types.d.ts +18 -0
  85. package/dist/types/builder/data/check_selector.d.ts +2 -0
  86. package/dist/types/builder/data/const.d.ts +26 -0
  87. package/dist/types/builder/data/create.d.ts +13 -0
  88. package/dist/types/builder/data/data.d.ts +44 -0
  89. package/dist/types/builder/data/debug.d.ts +38 -0
  90. package/dist/types/builder/data/index.d.ts +8 -0
  91. package/dist/types/builder/data/is.d.ts +16 -0
  92. package/dist/types/builder/data/merge/index.d.ts +2 -0
  93. package/dist/types/builder/data/merge/scope.d.ts +7 -0
  94. package/dist/types/builder/data/merge/style.d.ts +6 -0
  95. package/dist/types/builder/data/merge/utils.d.ts +5 -0
  96. package/dist/types/builder/data/selector.d.ts +8 -0
  97. package/dist/types/builder/data/state.d.ts +85 -0
  98. package/dist/types/builder/extract/index.d.ts +7 -0
  99. package/dist/types/builder/extract/scope.d.ts +14 -0
  100. package/dist/types/builder/extract/sheet.d.ts +10 -0
  101. package/dist/types/builder/extract/slot.d.ts +9 -0
  102. package/dist/types/builder/extract/style.d.ts +11 -0
  103. package/dist/types/builder/extract/theme.d.ts +2 -0
  104. package/dist/types/builder/extract/token.d.ts +7 -0
  105. package/dist/types/builder/extract/utils.d.ts +28 -0
  106. package/dist/types/builder/extract/withTokens.d.ts +10 -0
  107. package/dist/types/builder/index.d.ts +2 -0
  108. package/dist/types/builder/selector_override.d.ts +5 -0
  109. package/dist/types/builder/selector_override_core.d.ts +6 -0
  110. package/dist/types/builder/style_builder.d.ts +15 -0
  111. package/dist/types/builder/style_data.d.ts +8 -0
  112. package/dist/types/builder/style_fns.d.ts +14 -0
  113. package/dist/types/builder/token/data.d.ts +10 -0
  114. package/dist/types/builder/token/name.d.ts +3 -0
  115. package/dist/types/builder/token/symbols.d.ts +4 -0
  116. package/dist/types/builder/types/alias.d.ts +59 -0
  117. package/dist/types/builder/types/fns.d.ts +115 -0
  118. package/dist/types/builder/types/index.d.ts +1 -0
  119. package/dist/types/builder/types/types.d.ts +22 -0
  120. package/dist/types/builder/utils.d.ts +9 -0
  121. package/dist/types/compiler/compiler/cache.d.ts +24 -0
  122. package/dist/types/compiler/compiler/compiler.d.ts +28 -0
  123. package/dist/types/compiler/compiler/constants.d.ts +6 -0
  124. package/dist/types/compiler/compiler/index.d.ts +4 -0
  125. package/dist/types/compiler/compiler/types.d.ts +53 -0
  126. package/dist/types/compiler/cssProp.d.ts +8 -0
  127. package/dist/types/compiler/extract/collector.d.ts +8 -0
  128. package/dist/types/compiler/extract/extract.d.ts +6 -0
  129. package/dist/types/compiler/extract/index.d.ts +3 -0
  130. package/dist/types/compiler/extract/types.d.ts +22 -0
  131. package/dist/types/compiler/index.d.ts +3 -0
  132. package/dist/types/compiler/transform/cssProp/index.d.ts +1 -0
  133. package/dist/types/compiler/transform/cssProp/plugin.d.ts +13 -0
  134. package/dist/types/compiler/transform/debug/index.d.ts +2 -0
  135. package/dist/types/compiler/transform/debug/plugin.d.ts +34 -0
  136. package/dist/types/compiler/transform/debug/transform.d.ts +7 -0
  137. package/dist/types/compiler/transform/debug/utils/debug_data.d.ts +11 -0
  138. package/dist/types/compiler/transform/debug/utils/source_url.d.ts +2 -0
  139. package/dist/types/compiler/transform/evaluator/evaluator.d.ts +41 -0
  140. package/dist/types/compiler/transform/evaluator/index.d.ts +3 -0
  141. package/dist/types/compiler/transform/evaluator/tracer.d.ts +8 -0
  142. package/dist/types/compiler/transform/evaluator/types.d.ts +21 -0
  143. package/dist/types/compiler/transform/extract/chain/chain.d.ts +18 -0
  144. package/dist/types/compiler/transform/extract/chain/extract_chain.d.ts +19 -0
  145. package/dist/types/compiler/transform/extract/chain/index.d.ts +3 -0
  146. package/dist/types/compiler/transform/extract/chain/types.d.ts +32 -0
  147. package/dist/types/compiler/transform/extract/index.d.ts +2 -0
  148. package/dist/types/compiler/transform/extract/plugin.d.ts +20 -0
  149. package/dist/types/compiler/transform/extract/transform.d.ts +10 -0
  150. package/dist/types/compiler/transform/extract/utils/imports.d.ts +3 -0
  151. package/dist/types/compiler/transform/extract/utils/replacement.d.ts +9 -0
  152. package/dist/types/compiler/transform/extract/utils/slot.d.ts +4 -0
  153. package/dist/types/compiler/transform/extract/utils/state.d.ts +34 -0
  154. package/dist/types/compiler/transform/extract/utils/theme.d.ts +9 -0
  155. package/dist/types/compiler/transform/extract/utils/token.d.ts +1 -0
  156. package/dist/types/compiler/transform/index.d.ts +5 -0
  157. package/dist/types/compiler/transform/syntax/index.d.ts +5 -0
  158. package/dist/types/compiler/transform/syntax/isStaticStyleValue.d.ts +2 -0
  159. package/dist/types/compiler/transform/syntax/isStyleChainCall.d.ts +2 -0
  160. package/dist/types/compiler/transform/syntax/static_ids.d.ts +16 -0
  161. package/dist/types/compiler/transform/syntax/types.d.ts +4 -0
  162. package/dist/types/compiler/transform/syntax/utils.d.ts +5 -0
  163. package/dist/types/compiler/transform/utils/babel.d.ts +21 -0
  164. package/dist/types/compiler/transform/utils/import.d.ts +2 -0
  165. package/dist/types/compiler/transform/utils/path.d.ts +1 -0
  166. package/dist/types/compiler/transform/utils/selector.d.ts +18 -0
  167. package/dist/types/compiler/utils/constants.d.ts +68 -0
  168. package/dist/types/compiler/utils/file_resolver.d.ts +12 -0
  169. package/dist/types/compiler/utils/import_source.d.ts +28 -0
  170. package/dist/types/compiler/utils/imports.d.ts +6 -0
  171. package/dist/types/compiler/utils/path.d.ts +4 -0
  172. package/dist/types/compiler/utils/sourcemap.d.ts +36 -0
  173. package/dist/types/config/build.d.ts +20 -0
  174. package/dist/types/config/config/check.d.ts +11 -0
  175. package/dist/types/config/config/css.d.ts +23 -0
  176. package/dist/types/config/config/css_extra.d.ts +13 -0
  177. package/dist/types/config/config/debug.d.ts +14 -0
  178. package/dist/types/config/config/dev.d.ts +36 -0
  179. package/dist/types/config/config/runtime.d.ts +10 -0
  180. package/dist/types/config/configure.d.ts +12 -0
  181. package/dist/types/config/constants.d.ts +1 -0
  182. package/dist/types/config/index.d.ts +2 -0
  183. package/dist/types/config/types.d.ts +47 -0
  184. package/dist/types/config/utils.d.ts +2 -0
  185. package/dist/types/css/counterStyle.d.ts +4 -0
  186. package/dist/types/css/fontFace.d.ts +5 -0
  187. package/dist/types/css/fontPaletteValues.d.ts +4 -0
  188. package/dist/types/css/index.d.ts +9 -0
  189. package/dist/types/css/keyframes.d.ts +4 -0
  190. package/dist/types/css/positionTry.d.ts +4 -0
  191. package/dist/types/css/property.d.ts +7 -0
  192. package/dist/types/css/sheet.d.ts +7 -0
  193. package/dist/types/css/styleTarget.d.ts +9 -0
  194. package/dist/types/css/utils.d.ts +19 -0
  195. package/dist/types/dev/config.d.ts +6 -0
  196. package/dist/types/dev/fns.d.ts +14 -0
  197. package/dist/types/dev/index.d.ts +2 -0
  198. package/dist/types/dev/trace.d.ts +8 -0
  199. package/dist/types/dev/utils.d.ts +5 -0
  200. package/dist/types/dialect/extracted/index.d.ts +1 -0
  201. package/dist/types/dialect/index.d.ts +1 -0
  202. package/dist/types/dialect/namedTokens.d.ts +9 -0
  203. package/dist/types/entry/dev/adapter/preact.d.ts +1 -0
  204. package/dist/types/entry/dev/adapter/react.d.ts +1 -0
  205. package/dist/types/entry/dev/adapter/solid.d.ts +1 -0
  206. package/dist/types/entry/dev/config.d.ts +2 -0
  207. package/dist/types/entry/dev/css.d.ts +2 -0
  208. package/dist/types/entry/dev/index.d.ts +3 -0
  209. package/dist/types/entry/dev/jsx_dev_runtime.d.ts +3 -0
  210. package/dist/types/entry/dev/sheet.d.ts +1 -0
  211. package/dist/types/entry/prod/adapter/preact.d.ts +1 -0
  212. package/dist/types/entry/prod/adapter/react.d.ts +1 -0
  213. package/dist/types/entry/prod/adapter/solid.d.ts +1 -0
  214. package/dist/types/entry/prod/config.d.ts +2 -0
  215. package/dist/types/entry/prod/config_debug.d.ts +2 -0
  216. package/dist/types/entry/prod/css.d.ts +2 -0
  217. package/dist/types/entry/prod/extract.d.ts +1 -0
  218. package/dist/types/entry/prod/index.d.ts +2 -0
  219. package/dist/types/entry/prod/jsx_runtime.d.ts +2 -0
  220. package/dist/types/entry/prod/runtime.d.ts +8 -0
  221. package/dist/types/entry/rsc_dev/adapter/preact.d.ts +1 -0
  222. package/dist/types/entry/rsc_dev/adapter/react.d.ts +1 -0
  223. package/dist/types/entry/rsc_dev/adapter/solid.d.ts +1 -0
  224. package/dist/types/entry/rsc_dev/config.d.ts +2 -0
  225. package/dist/types/entry/rsc_dev/css.d.ts +2 -0
  226. package/dist/types/entry/rsc_dev/index.d.ts +2 -0
  227. package/dist/types/entry/rsc_dev/server.d.ts +10 -0
  228. package/dist/types/entry/rsc_prod/adapter/preact.d.ts +1 -0
  229. package/dist/types/entry/rsc_prod/adapter/react.d.ts +1 -0
  230. package/dist/types/entry/rsc_prod/adapter/solid.d.ts +1 -0
  231. package/dist/types/entry/rsc_prod/config.d.ts +2 -0
  232. package/dist/types/entry/rsc_prod/config_debug.d.ts +2 -0
  233. package/dist/types/entry/rsc_prod/css.d.ts +2 -0
  234. package/dist/types/entry/rsc_prod/index.d.ts +2 -0
  235. package/dist/types/entry/rsc_prod/jsx_runtime.d.ts +2 -0
  236. package/dist/types/entry/rsc_prod/runtime.d.ts +4 -0
  237. package/dist/types/entry/rsc_prod/server.d.ts +6 -0
  238. package/dist/types/entry/shared/config.d.ts +1 -0
  239. package/dist/types/entry/shared/config_debug.d.ts +1 -0
  240. package/dist/types/entry/shared/config_dev.d.ts +1 -0
  241. package/dist/types/entry/shared/dev.d.ts +1 -0
  242. package/dist/types/entry/shared/prod.d.ts +1 -0
  243. package/dist/types/entry/shared/utils.d.ts +2 -0
  244. package/dist/types/index.d.ts +9 -0
  245. package/dist/types/jsx/extracted/jsx_runtime.d.ts +7 -0
  246. package/dist/types/jsx/rsc/jsx_runtime.d.ts +7 -0
  247. package/dist/types/jsx/rsc_extracted/jsx_runtime.d.ts +2 -0
  248. package/dist/types/jsx/runtime/jsx_dev_runtime.d.ts +6 -0
  249. package/dist/types/jsx/runtime/jsx_runtime.d.ts +7 -0
  250. package/dist/types/jsx/types/index.d.ts +1 -0
  251. package/dist/types/jsx/types/preact.d.ts +12 -0
  252. package/dist/types/jsx/types/react.d.ts +10 -0
  253. package/dist/types/jsx/types/solid.d.ts +12 -0
  254. package/dist/types/jsx/utils.d.ts +19 -0
  255. package/dist/types/plugin/bundler/farm/index.d.ts +1 -0
  256. package/dist/types/plugin/bundler/farm/plugin.d.ts +91 -0
  257. package/dist/types/plugin/bundler/parcel/index.d.ts +1 -0
  258. package/dist/types/plugin/bundler/parcel/optimizer.d.ts +3 -0
  259. package/dist/types/plugin/bundler/parcel/plugin.d.ts +6 -0
  260. package/dist/types/plugin/bundler/parcel/resolver.d.ts +3 -0
  261. package/dist/types/plugin/bundler/parcel/runtime.d.ts +3 -0
  262. package/dist/types/plugin/bundler/parcel/shared.d.ts +37 -0
  263. package/dist/types/plugin/bundler/parcel/transformer.d.ts +3 -0
  264. package/dist/types/plugin/bundler/rspack/index.d.ts +1 -0
  265. package/dist/types/plugin/bundler/rspack/plugin.d.ts +7 -0
  266. package/dist/types/plugin/bundler/vite/index.d.ts +1 -0
  267. package/dist/types/plugin/bundler/vite/plugin.d.ts +6 -0
  268. package/dist/types/plugin/bundler/vite/state.d.ts +55 -0
  269. package/dist/types/plugin/bundler/webpack/index.d.ts +1 -0
  270. package/dist/types/plugin/bundler/webpack/loader.d.ts +2 -0
  271. package/dist/types/plugin/bundler/webpack/plugin.d.ts +11 -0
  272. package/dist/types/plugin/bundler/webpack/shared/loader.d.ts +31 -0
  273. package/dist/types/plugin/bundler/webpack/shared/registry.d.ts +4 -0
  274. package/dist/types/plugin/bundler/webpack/utils.d.ts +18 -0
  275. package/dist/types/plugin/nextjs/constants.d.ts +3 -0
  276. package/dist/types/plugin/nextjs/html.d.ts +1 -0
  277. package/dist/types/plugin/nextjs/index.d.ts +2 -0
  278. package/dist/types/plugin/nextjs/loader.d.ts +3 -0
  279. package/dist/types/plugin/nextjs/plugin.d.ts +5 -0
  280. package/dist/types/plugin/nextjs/types.d.ts +21 -0
  281. package/dist/types/plugin/nextjs/utils.d.ts +59 -0
  282. package/dist/types/plugin/utils/cache/css_cache.d.ts +34 -0
  283. package/dist/types/plugin/utils/cache/file.d.ts +4 -0
  284. package/dist/types/plugin/utils/cache/index.d.ts +2 -0
  285. package/dist/types/plugin/utils/compiler.d.ts +40 -0
  286. package/dist/types/plugin/utils/constants.d.ts +4 -0
  287. package/dist/types/plugin/utils/cssMarker.d.ts +4 -0
  288. package/dist/types/plugin/utils/cssOutput.d.ts +10 -0
  289. package/dist/types/plugin/utils/filter.d.ts +14 -0
  290. package/dist/types/plugin/utils/imports.d.ts +3 -0
  291. package/dist/types/plugin/utils/index.d.ts +10 -0
  292. package/dist/types/plugin/utils/injection.d.ts +3 -0
  293. package/dist/types/plugin/utils/misc.d.ts +1 -0
  294. package/dist/types/plugin/utils/runtimeEntry.d.ts +8 -0
  295. package/dist/types/plugin/utils/sidecar/index.d.ts +1 -0
  296. package/dist/types/plugin/utils/sidecar/server.d.ts +19 -0
  297. package/dist/types/plugin/utils/sidecar/sidecar.d.ts +17 -0
  298. package/dist/types/plugin/utils/sidecar/utils.d.ts +33 -0
  299. package/dist/types/plugin/utils/sourcemap.d.ts +9 -0
  300. package/dist/types/plugin/utils/virtual.d.ts +12 -0
  301. package/dist/types/presets/tailwind/classname/index.d.ts +2 -0
  302. package/dist/types/presets/tailwind/classname/transform.d.ts +8 -0
  303. package/dist/types/presets/tailwind/classname/types.d.ts +27 -0
  304. package/dist/types/presets/tailwind/index.d.ts +5 -0
  305. package/dist/types/presets/tailwind/selectors.d.ts +68 -0
  306. package/dist/types/presets/tailwind/style/index.d.ts +2 -0
  307. package/dist/types/presets/tailwind/style/transform.d.ts +8 -0
  308. package/dist/types/presets/tailwind/style/types.d.ts +149 -0
  309. package/dist/types/presets/tailwind/theme.d.ts +477 -0
  310. package/dist/types/presets/tailwind/types.d.ts +53 -0
  311. package/dist/types/runtime/adapter/utils.d.ts +12 -0
  312. package/dist/types/runtime/core/cache/combine.d.ts +6 -0
  313. package/dist/types/runtime/core/cache/combineRuntime.d.ts +1 -0
  314. package/dist/types/runtime/core/cache/item.d.ts +15 -0
  315. package/dist/types/runtime/core/cache/itemWithResolver.d.ts +4 -0
  316. package/dist/types/runtime/core/cache/pool.d.ts +16 -0
  317. package/dist/types/runtime/core/cache/prop.d.ts +19 -0
  318. package/dist/types/runtime/core/cache/propCache.d.ts +12 -0
  319. package/dist/types/runtime/core/cache/resolvedItem.d.ts +5 -0
  320. package/dist/types/runtime/core/cache/result.d.ts +9 -0
  321. package/dist/types/runtime/core/cache/stateItem.d.ts +8 -0
  322. package/dist/types/runtime/core/cache/token.d.ts +2 -0
  323. package/dist/types/runtime/core/cache/tokenValues.d.ts +26 -0
  324. package/dist/types/runtime/core/cache/utils/tree.d.ts +12 -0
  325. package/dist/types/runtime/core/cache/utils/walk.d.ts +1 -0
  326. package/dist/types/runtime/core/className.d.ts +18 -0
  327. package/dist/types/runtime/core/combinedStyle.d.ts +20 -0
  328. package/dist/types/runtime/core/createTransformElement.d.ts +4 -0
  329. package/dist/types/runtime/core/elementMarker.d.ts +12 -0
  330. package/dist/types/runtime/core/elementMarkerData.d.ts +7 -0
  331. package/dist/types/runtime/core/getClassName.d.ts +4 -0
  332. package/dist/types/runtime/core/getSheetRules.d.ts +3 -0
  333. package/dist/types/runtime/core/getToken.d.ts +3 -0
  334. package/dist/types/runtime/core/index.d.ts +5 -0
  335. package/dist/types/runtime/core/jsx.d.ts +1 -0
  336. package/dist/types/runtime/core/resolveClassNameRuntime.d.ts +8 -0
  337. package/dist/types/runtime/env.d.ts +2 -0
  338. package/dist/types/runtime/extract/combineStyle.d.ts +27 -0
  339. package/dist/types/runtime/extract/getClassName.d.ts +10 -0
  340. package/dist/types/runtime/extract/index.d.ts +6 -0
  341. package/dist/types/runtime/extract/jsx.d.ts +10 -0
  342. package/dist/types/runtime/extract/token.d.ts +5 -0
  343. package/dist/types/runtime/extract/tokenResolver.d.ts +2 -0
  344. package/dist/types/runtime/rsc/constants.d.ts +4 -0
  345. package/dist/types/runtime/rsc/dev.d.ts +6 -0
  346. package/dist/types/runtime/rsc/getClassName.d.ts +24 -0
  347. package/dist/types/runtime/rsc/index.d.ts +1 -0
  348. package/dist/types/runtime/rsc/jsx.d.ts +1 -0
  349. package/dist/types/runtime/rsc/observer.d.ts +5 -0
  350. package/dist/types/runtime/rsc/styleStore.d.ts +5 -0
  351. package/dist/types/runtime/sheet/element.d.ts +2 -0
  352. package/dist/types/runtime/sheet/global.d.ts +3 -0
  353. package/dist/types/runtime/sheet/index.d.ts +3 -0
  354. package/dist/types/runtime/sheet/insert.d.ts +5 -0
  355. package/dist/types/runtime/sheet/rule.d.ts +8 -0
  356. package/dist/types/runtime/sheet/rules.d.ts +10 -0
  357. package/dist/types/runtime/sheet/theme.d.ts +5 -0
  358. package/dist/types/runtime/style/index.d.ts +3 -0
  359. package/dist/types/runtime/style/scope.d.ts +4 -0
  360. package/dist/types/runtime/style/style.d.ts +27 -0
  361. package/dist/types/runtime/style/token.d.ts +1 -0
  362. package/dist/types/runtime/types.d.ts +28 -0
  363. package/dist/types/selector/assert.d.ts +13 -0
  364. package/dist/types/selector/index.d.ts +5 -0
  365. package/dist/types/selector/presets/default.d.ts +108 -0
  366. package/dist/types/selector/presets/index.d.ts +3 -0
  367. package/dist/types/selector/presets/minimal.d.ts +46 -0
  368. package/dist/types/selector/presets/selectors.d.ts +62 -0
  369. package/dist/types/selector/selector.d.ts +12 -0
  370. package/dist/types/selector/types.d.ts +12 -0
  371. package/dist/types/selector/validate.d.ts +5 -0
  372. package/dist/types/sheet/dev/dev_layer.d.ts +4 -0
  373. package/dist/types/sheet/dev/dev_sort.d.ts +2 -0
  374. package/dist/types/sheet/dev/index.d.ts +5 -0
  375. package/dist/types/sheet/dev/utils.d.ts +26 -0
  376. package/dist/types/sheet/index.d.ts +4 -0
  377. package/dist/types/sheet/prod.d.ts +2 -0
  378. package/dist/types/sheet/sheet.d.ts +2 -0
  379. package/dist/types/sheet/sourcemap.d.ts +11 -0
  380. package/dist/types/sheet/types.d.ts +29 -0
  381. package/dist/types/sheet/utils/dom.d.ts +5 -0
  382. package/dist/types/sheet/utils/index.d.ts +4 -0
  383. package/dist/types/sheet/utils/layer.d.ts +10 -0
  384. package/dist/types/sheet/utils/noop.d.ts +2 -0
  385. package/dist/types/sheet/utils/rule.d.ts +3 -0
  386. package/dist/types/sheet/utils/sourcemap.d.ts +12 -0
  387. package/dist/types/style/classname.d.ts +15 -0
  388. package/dist/types/style/important.d.ts +8 -0
  389. package/dist/types/style/index.d.ts +12 -0
  390. package/dist/types/style/keyframes.d.ts +10 -0
  391. package/dist/types/style/style.d.ts +426 -0
  392. package/dist/types/style/theme.d.ts +5 -0
  393. package/dist/types/style/token.d.ts +29 -0
  394. package/dist/types/style/tokens.d.ts +10 -0
  395. package/dist/types/style/transform.d.ts +21 -0
  396. package/dist/types/style/types.d.ts +22 -0
  397. package/dist/types/style/utils/expose.d.ts +8 -0
  398. package/dist/types/style/utils/index.d.ts +1 -0
  399. package/dist/types/style/value.d.ts +12 -0
  400. package/dist/types/style/valueRef.d.ts +13 -0
  401. package/dist/types/style/weight.d.ts +9 -0
  402. package/dist/types/utils/global.d.ts +4 -0
  403. package/dist/types/utils/hash.d.ts +3 -0
  404. package/dist/types/utils/id.d.ts +12 -0
  405. package/dist/types/utils/object.d.ts +10 -0
  406. package/dist/types/utils/symbol.d.ts +1 -0
  407. package/dist/types/utils/trace.d.ts +21 -0
  408. package/dist/types/utils/type.d.ts +11 -0
  409. package/dist/{utils-DND33M6y.mjs → utils-D4UympcZ.mjs} +3 -3
  410. package/dist/{utils-DND33M6y.mjs.map → utils-D4UympcZ.mjs.map} +1 -1
  411. package/dist/{utils-NdisireF.mjs → utils-D75HPJWv.mjs} +4 -4
  412. package/dist/{utils-NdisireF.mjs.map → utils-D75HPJWv.mjs.map} +1 -1
  413. package/dist/{webpack-D7QO0bKN.mjs → webpack-_BpgAUEy.mjs} +5 -5
  414. package/dist/{webpack-D7QO0bKN.mjs.map → webpack-_BpgAUEy.mjs.map} +1 -1
  415. package/jsx/types/solid.ts +8 -25
  416. package/package.json +76 -72
  417. package/plugin/bundler/webpack/shared/loader.ts +4 -0
  418. package/plugin/nextjs/plugin.ts +48 -28
  419. package/dist/loader-_-VjzlrX.mjs.map +0 -1
@@ -0,0 +1,10 @@
1
+ export declare function clone<T>(data: T | null | undefined): T;
2
+ export declare function merge<T>(data1: T | null | undefined, data2: T | null | undefined): T;
3
+ export declare function assign(target: unknown, data: object): void;
4
+ export declare function set(target: unknown, field: string | symbol, data: unknown): void;
5
+ export declare function get(target: unknown, field: string | symbol): unknown;
6
+ export declare function unsetAll(obj: object): void;
7
+ export declare function hasOwn(target: object, field: PropertyKey): boolean;
8
+ export declare function toArray<T>(value: T | T[] | null | undefined): T[];
9
+ export declare function isFunction(value: unknown): value is Function;
10
+ export declare function isPromiseLike<T>(value: T | Promise<T>): value is Promise<T>;
@@ -0,0 +1 @@
1
+ export declare function symbol<T extends symbol>(name: string): T;
@@ -0,0 +1,21 @@
1
+ export declare function traceMarker(fn: unknown, name: string): void;
2
+ export type TraceCallsite = {
3
+ stack: string;
4
+ filePath: string;
5
+ sourceUrl?: string;
6
+ sourceContent?: string;
7
+ line: number;
8
+ column: number;
9
+ };
10
+ export declare function traceCallsite(): TraceCallsite | null;
11
+ export declare function normalizeCallsiteSourceUrl(source: string): string;
12
+ export type TraceErrorOptions = TraceAdjustErrorOptions & {
13
+ stack?: string | null;
14
+ name?: string | null;
15
+ };
16
+ export declare function traceError(message: string | null, options?: TraceErrorOptions): Error;
17
+ export type TraceAdjustErrorOptions = {
18
+ offset?: number;
19
+ limit?: number;
20
+ };
21
+ export declare function traceAdjustError(error: Error, options?: TraceAdjustErrorOptions): Error;
@@ -0,0 +1,11 @@
1
+ export declare const UniqueSymbol: unique symbol;
2
+ export type RecursiveArray<T> = readonly (T | RecursiveArray<T>)[];
3
+ export type MaybeArray<T> = T | readonly T[];
4
+ export type OmitProps<T, K extends keyof T> = Omit<T, K>;
5
+ export type ReplaceProps<T, R extends Partial<Record<keyof T, any>>> = Omit<T, keyof R> & R;
6
+ export type Collapse = {
7
+ readonly [UniqueSymbol]?: never;
8
+ };
9
+ export type Type<T> = (type?: T) => null;
10
+ export declare function type<T>(_?: T): null;
11
+ export declare function constant<const T>(data: T): T;
@@ -1,5 +1,5 @@
1
- import { s as normalizePath } from "./compiler-C3CEGGtI.mjs";
2
- import { n as STYLE_IMPORTS, t as createWebpackRegistry } from "./registry-w8ET5R7v.mjs";
1
+ import { s as normalizePath } from "./compiler-mCfMhtX4.mjs";
2
+ import { n as STYLE_IMPORTS, t as createWebpackRegistry } from "./registry-BJqMbdMu.mjs";
3
3
  import { createRequire } from "node:module";
4
4
  import path from "node:path";
5
5
  //#region plugin/bundler/webpack/utils.ts
@@ -46,4 +46,4 @@ function prependEntryImport(entryImport, runtimeFilePath) {
46
46
  //#endregion
47
47
  export { prependWebpackRuntimeEntry as a, hasWebpackCssMarker as i, getStylePackageDistPath as n, replaceWebpackCssMarker as o, getTransformLoaderPath as r, webpackRegistry as s, createWebpackRuntimeModuleSource as t };
48
48
 
49
- //# sourceMappingURL=utils-DND33M6y.mjs.map
49
+ //# sourceMappingURL=utils-D4UympcZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-DND33M6y.mjs","names":[],"sources":["../plugin/bundler/webpack/utils.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport path from 'node:path';\nimport type { EntryNormalized } from 'webpack';\nimport { normalizePath } from '../../../compiler/utils/path';\nimport { SIDECAR_URL_GLOBAL_SYMBOL } from '../../../config/utils';\nimport type { PluginCompiler } from '../../utils';\nimport { STYLE_IMPORTS } from '../../utils/imports';\nimport { createWebpackRegistry } from './shared/registry';\n\ntype WebpackStaticEntry = Exclude<EntryNormalized, () => Promise<unknown>>;\ntype WebpackEntryDescription = WebpackStaticEntry[string];\n\nexport type WebpackLoaderState = {\n transform: PluginCompiler['transform'];\n};\n\nexport const webpackRegistry = createWebpackRegistry('webpack.registry');\n\nexport function getTransformLoaderPath() {\n return createRequire(import.meta.url).resolve(STYLE_IMPORTS.Plugin + '/webpack/loader');\n}\n\nexport function getStylePackageDistPath() {\n return path.resolve(path.dirname(getTransformLoaderPath()), '../..');\n}\n\nexport function createWebpackRuntimeModuleSource(\n extract: boolean,\n cssFilePath: string | null,\n options: {\n runtimeImportPath?: string | null;\n sidecarUrl?: string | null;\n } = {},\n) {\n return [\n extract && cssFilePath && `import ${JSON.stringify(normalizePath(cssFilePath))};`,\n options.sidecarUrl && options.runtimeImportPath && `import ${JSON.stringify(options.runtimeImportPath)};`,\n options.sidecarUrl &&\n `globalThis[Symbol.for(${JSON.stringify(SIDECAR_URL_GLOBAL_SYMBOL)})] = ${JSON.stringify(options.sidecarUrl)};`,\n '',\n ].filter(Boolean).join('\\n');\n}\n\nexport function replaceWebpackCssMarker(\n source: string,\n marker: string,\n css: string,\n) {\n return source.replace(marker, css);\n}\n\nexport function hasWebpackCssMarker(source: string, marker: string) {\n return source.includes(marker);\n}\n\nexport function prependWebpackRuntimeEntry(\n entry: EntryNormalized,\n runtimeFilePath: string,\n): EntryNormalized {\n if (typeof entry === 'function') {\n return async () => prependWebpackRuntimeStaticEntry(await entry(), runtimeFilePath);\n }\n\n return prependWebpackRuntimeStaticEntry(entry, runtimeFilePath);\n}\n\nfunction prependWebpackRuntimeStaticEntry(\n entry: WebpackStaticEntry,\n runtimeFilePath: string,\n): WebpackStaticEntry {\n const result: WebpackStaticEntry = {};\n\n for (const [key, value] of Object.entries(entry)) {\n result[key] = prependWebpackRuntimeEntryDescription(value, runtimeFilePath);\n }\n\n return result;\n}\n\nfunction prependWebpackRuntimeEntryDescription(\n entry: WebpackEntryDescription,\n runtimeFilePath: string,\n): WebpackEntryDescription {\n if (!entry.import) return entry;\n\n return {\n ...entry,\n import: prependEntryImport(entry.import, runtimeFilePath),\n };\n}\n\nfunction prependEntryImport(entryImport: string[], runtimeFilePath: string) {\n return entryImport.includes(runtimeFilePath)\n ? entryImport\n : [runtimeFilePath, ...entryImport];\n}\n"],"mappings":";;;;;AAgBA,MAAa,kBAAkB,sBAAsB,kBAAkB;AAEvE,SAAgB,yBAAyB;CACvC,OAAO,cAAc,OAAO,KAAK,GAAG,EAAE,QAAQ,cAAc,SAAS,iBAAiB;AACxF;AAEA,SAAgB,0BAA0B;CACxC,OAAO,KAAK,QAAQ,KAAK,QAAQ,uBAAuB,CAAC,GAAG,OAAO;AACrE;AAEA,SAAgB,iCACd,SACA,aACA,UAGI,CAAC,GACL;CACA,OAAO;EACL,WAAW,eAAe,UAAU,KAAK,UAAU,cAAc,WAAW,CAAC,EAAE;EAC/E,QAAQ,cAAc,QAAQ,qBAAqB,UAAU,KAAK,UAAU,QAAQ,iBAAiB,EAAE;EACvG,QAAQ,cACR,yBAAyB,KAAK,UAAA,4BAAmC,EAAE,OAAO,KAAK,UAAU,QAAQ,UAAU,EAAE;EAC7G;CACF,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AAC7B;AAEA,SAAgB,wBACd,QACA,QACA,KACA;CACA,OAAO,OAAO,QAAQ,QAAQ,GAAG;AACnC;AAEA,SAAgB,oBAAoB,QAAgB,QAAgB;CAClE,OAAO,OAAO,SAAS,MAAM;AAC/B;AAEA,SAAgB,2BACd,OACA,iBACiB;CACjB,IAAI,OAAO,UAAU,YACnB,OAAO,YAAY,iCAAiC,MAAM,MAAM,GAAG,eAAe;CAGpF,OAAO,iCAAiC,OAAO,eAAe;AAChE;AAEA,SAAS,iCACP,OACA,iBACoB;CACpB,MAAM,SAA6B,CAAC;CAEpC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,OAAO,OAAO,sCAAsC,OAAO,eAAe;CAG5E,OAAO;AACT;AAEA,SAAS,sCACP,OACA,iBACyB;CACzB,IAAI,CAAC,MAAM,QAAQ,OAAO;CAE1B,OAAO;EACL,GAAG;EACH,QAAQ,mBAAmB,MAAM,QAAQ,eAAe;CAC1D;AACF;AAEA,SAAS,mBAAmB,aAAuB,iBAAyB;CAC1E,OAAO,YAAY,SAAS,eAAe,IACvC,cACA,CAAC,iBAAiB,GAAG,WAAW;AACtC"}
1
+ {"version":3,"file":"utils-D4UympcZ.mjs","names":[],"sources":["../plugin/bundler/webpack/utils.ts"],"sourcesContent":["import { createRequire } from 'node:module';\nimport path from 'node:path';\nimport type { EntryNormalized } from 'webpack';\nimport { normalizePath } from '../../../compiler/utils/path';\nimport { SIDECAR_URL_GLOBAL_SYMBOL } from '../../../config/utils';\nimport type { PluginCompiler } from '../../utils';\nimport { STYLE_IMPORTS } from '../../utils/imports';\nimport { createWebpackRegistry } from './shared/registry';\n\ntype WebpackStaticEntry = Exclude<EntryNormalized, () => Promise<unknown>>;\ntype WebpackEntryDescription = WebpackStaticEntry[string];\n\nexport type WebpackLoaderState = {\n transform: PluginCompiler['transform'];\n};\n\nexport const webpackRegistry = createWebpackRegistry('webpack.registry');\n\nexport function getTransformLoaderPath() {\n return createRequire(import.meta.url).resolve(STYLE_IMPORTS.Plugin + '/webpack/loader');\n}\n\nexport function getStylePackageDistPath() {\n return path.resolve(path.dirname(getTransformLoaderPath()), '../..');\n}\n\nexport function createWebpackRuntimeModuleSource(\n extract: boolean,\n cssFilePath: string | null,\n options: {\n runtimeImportPath?: string | null;\n sidecarUrl?: string | null;\n } = {},\n) {\n return [\n extract && cssFilePath && `import ${JSON.stringify(normalizePath(cssFilePath))};`,\n options.sidecarUrl && options.runtimeImportPath && `import ${JSON.stringify(options.runtimeImportPath)};`,\n options.sidecarUrl &&\n `globalThis[Symbol.for(${JSON.stringify(SIDECAR_URL_GLOBAL_SYMBOL)})] = ${JSON.stringify(options.sidecarUrl)};`,\n '',\n ].filter(Boolean).join('\\n');\n}\n\nexport function replaceWebpackCssMarker(\n source: string,\n marker: string,\n css: string,\n) {\n return source.replace(marker, css);\n}\n\nexport function hasWebpackCssMarker(source: string, marker: string) {\n return source.includes(marker);\n}\n\nexport function prependWebpackRuntimeEntry(\n entry: EntryNormalized,\n runtimeFilePath: string,\n): EntryNormalized {\n if (typeof entry === 'function') {\n return async () => prependWebpackRuntimeStaticEntry(await entry(), runtimeFilePath);\n }\n\n return prependWebpackRuntimeStaticEntry(entry, runtimeFilePath);\n}\n\nfunction prependWebpackRuntimeStaticEntry(\n entry: WebpackStaticEntry,\n runtimeFilePath: string,\n): WebpackStaticEntry {\n const result: WebpackStaticEntry = {};\n\n for (const [key, value] of Object.entries(entry)) {\n result[key] = prependWebpackRuntimeEntryDescription(value, runtimeFilePath);\n }\n\n return result;\n}\n\nfunction prependWebpackRuntimeEntryDescription(\n entry: WebpackEntryDescription,\n runtimeFilePath: string,\n): WebpackEntryDescription {\n if (!entry.import) return entry;\n\n return {\n ...entry,\n import: prependEntryImport(entry.import, runtimeFilePath),\n };\n}\n\nfunction prependEntryImport(entryImport: string[], runtimeFilePath: string) {\n return entryImport.includes(runtimeFilePath)\n ? entryImport\n : [runtimeFilePath, ...entryImport];\n}\n"],"mappings":";;;;;AAgBA,MAAa,kBAAkB,sBAAsB,kBAAkB;AAEvE,SAAgB,yBAAyB;CACvC,OAAO,cAAc,OAAO,KAAK,GAAG,EAAE,QAAQ,cAAc,SAAS,iBAAiB;AACxF;AAEA,SAAgB,0BAA0B;CACxC,OAAO,KAAK,QAAQ,KAAK,QAAQ,uBAAuB,CAAC,GAAG,OAAO;AACrE;AAEA,SAAgB,iCACd,SACA,aACA,UAGI,CAAC,GACL;CACA,OAAO;EACL,WAAW,eAAe,UAAU,KAAK,UAAU,cAAc,WAAW,CAAC,EAAE;EAC/E,QAAQ,cAAc,QAAQ,qBAAqB,UAAU,KAAK,UAAU,QAAQ,iBAAiB,EAAE;EACvG,QAAQ,cACR,yBAAyB,KAAK,UAAA,4BAAmC,EAAE,OAAO,KAAK,UAAU,QAAQ,UAAU,EAAE;EAC7G;CACF,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI;AAC7B;AAEA,SAAgB,wBACd,QACA,QACA,KACA;CACA,OAAO,OAAO,QAAQ,QAAQ,GAAG;AACnC;AAEA,SAAgB,oBAAoB,QAAgB,QAAgB;CAClE,OAAO,OAAO,SAAS,MAAM;AAC/B;AAEA,SAAgB,2BACd,OACA,iBACiB;CACjB,IAAI,OAAO,UAAU,YACnB,OAAO,YAAY,iCAAiC,MAAM,MAAM,GAAG,eAAe;CAGpF,OAAO,iCAAiC,OAAO,eAAe;AAChE;AAEA,SAAS,iCACP,OACA,iBACoB;CACpB,MAAM,SAA6B,CAAC;CAEpC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAC7C,OAAO,OAAO,sCAAsC,OAAO,eAAe;CAG5E,OAAO;AACT;AAEA,SAAS,sCACP,OACA,iBACyB;CACzB,IAAI,CAAC,MAAM,QAAQ,OAAO;CAE1B,OAAO;EACL,GAAG;EACH,QAAQ,mBAAmB,MAAM,QAAQ,eAAe;CAC1D;AACF;AAEA,SAAS,mBAAmB,aAAuB,iBAAyB;CAC1E,OAAO,YAAY,SAAS,eAAe,IACvC,cACA,CAAC,iBAAiB,GAAG,WAAW;AACtC"}
@@ -1,6 +1,6 @@
1
- import { c as getStyleFnMeta, s as normalizePath } from "./compiler-C3CEGGtI.mjs";
2
- import { f as resolvePluginSourcemapOptions, h as getPluginBuildDevConfig, m as getPluginBuildConfig } from "./misc-B76PUnWe.mjs";
3
- import { n as STYLE_IMPORTS, t as createWebpackRegistry } from "./registry-w8ET5R7v.mjs";
1
+ import { c as getStyleFnMeta, s as normalizePath } from "./compiler-mCfMhtX4.mjs";
2
+ import { f as resolvePluginSourcemapOptions, h as getPluginBuildDevConfig, m as getPluginBuildConfig } from "./misc-vGtt_SX7.mjs";
3
+ import { n as STYLE_IMPORTS, t as createWebpackRegistry } from "./registry-BJqMbdMu.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { createHash } from "node:crypto";
6
6
  import fs from "node:fs";
@@ -179,4 +179,4 @@ function replaceCssMarkerAsset(args) {
179
179
  //#endregion
180
180
  export { DEV_CSS_ROUTE as _, createNextBuildDevConfig as a, getNextCacheDir as c, isAppLayoutFile as d, nextRegistry as f, CSS_ENTRY_IMPORT_PATH as g, resolveNextCompilerOptions as h, createNextBuildConfig as i, getNextPrecollectCacheSubdir as l, replaceCssMarkerAsset as m, addAliases as n, createNextConfigHash as o, removeUndefinedValues as p, addWebpackPlugin as r, createSerializableImportSources as s, NEXT_COMPILER_IDS as t, getTransformLoaderPath as u, LOADER_IMPORT_PATH as v };
181
181
 
182
- //# sourceMappingURL=utils-NdisireF.mjs.map
182
+ //# sourceMappingURL=utils-D75HPJWv.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-NdisireF.mjs","names":[],"sources":["../plugin/nextjs/constants.ts","../plugin/nextjs/utils.ts"],"sourcesContent":["import { STYLE_IMPORTS } from '../utils/imports';\n\nexport const DEV_CSS_ROUTE = '/__fluentic/dev.css';\n\nexport const LOADER_IMPORT_PATH = STYLE_IMPORTS.Plugin + '/nextjs/loader';\n\nexport const CSS_ENTRY_IMPORT_PATH = STYLE_IMPORTS.Plugin + '/nextjs/bundle.css';\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { Compilation, Compiler, WebpackPluginInstance } from 'webpack';\nimport type { Compiler as PluginCompiler } from '../../compiler';\nimport type { ImportSource } from '../../compiler/utils/import_source';\nimport { normalizePath } from '../../compiler/utils/path';\nimport type { BuildConfig, BuildDevConfig } from '../../config/build';\nimport { getStyleFnMeta } from '../../style/style';\nimport { createWebpackRegistry } from '../bundler/webpack/shared/registry';\nimport type { FileCssCache } from '../utils/cache';\nimport type { PluginOptions as BasePluginOptions } from '../utils/compiler';\nimport type { TransformFilter } from '../utils/filter';\nimport { getPluginBuildConfig, getPluginBuildDevConfig } from '../utils/runtimeEntry';\nimport type { SourcemapSidecar } from '../utils/sidecar';\nimport { resolvePluginSourcemapOptions } from '../utils/sourcemap';\nimport { LOADER_IMPORT_PATH } from './constants';\nimport type { PluginOptions, WebpackConfiguration } from './types';\n\nexport const nextRegistry = createWebpackRegistry('nextjs.registry');\n\nexport const PRECOLLECT_CACHE_DIRS = {\n dev: 'nextjs/precollect/dev',\n prod: 'nextjs/precollect/prod',\n};\n\nexport const NEXT_COMPILER_IDS = {\n turbopack: 'nextjs:turbopack',\n webpackServer: 'nextjs:webpack-server',\n webpackClient: 'nextjs:webpack-client',\n};\n\nexport type { PluginCompiler };\n\nexport type NextLoaderState = {\n compiler: PluginCompiler;\n filter: TransformFilter;\n dev: boolean;\n isServer: boolean;\n configHash: string;\n devCssHref: string | null;\n cssEntryImportPath: string;\n cssCache: Pick<FileCssCache, 'setFileCss'> | null;\n};\n\nexport type NextWebpackEntryValue = string | string[] | {\n import?: string | string[];\n [key: string]: unknown;\n};\n\nexport function getTransformLoaderPath() {\n return createRequire(import.meta.url).resolve(LOADER_IMPORT_PATH);\n}\n\nexport function getNextCacheDir(rootDir: string, cacheDir?: string) {\n return cacheDir ?? path.join(rootDir, '.next/cache/fluentic-style');\n}\n\nexport function getNextPrecollectCacheSubdir(dev: boolean) {\n return dev ? PRECOLLECT_CACHE_DIRS.dev : PRECOLLECT_CACHE_DIRS.prod;\n}\n\nexport function createNextBuildConfig(options: PluginOptions): BuildConfig {\n return getPluginBuildConfig(options);\n}\n\nexport function createNextBuildDevConfig(options: PluginOptions): BuildDevConfig | null {\n return getPluginBuildDevConfig(options);\n}\n\nexport function createNextConfigHash(\n buildConfig: BuildConfig,\n dev: boolean,\n importSources?: readonly ImportSource[] | null,\n) {\n const values = [\n createPackageCacheIdentity(),\n dev ? 'dev' : 'prod',\n buildConfig.hoist ? 'hoist' : 'no-hoist',\n JSON.stringify(createSerializableImportSources(importSources)),\n ];\n\n return createHash('sha256').update(values.join('\\0')).digest('hex');\n}\n\nfunction createPackageCacheIdentity() {\n const require = createRequire(import.meta.url);\n let entryPath = '';\n\n try {\n entryPath = require.resolve('@fluentic/style/plugin/nextjs');\n } catch {\n entryPath = fileURLToPath(import.meta.url);\n }\n\n const packageInfo = findPackageInfo(entryPath);\n const parts = [\n packageInfo.version,\n normalizePath(packageInfo.packageRoot),\n normalizePath(entryPath),\n getStatIdentity(packageInfo.packageJsonPath),\n getStatIdentity(entryPath),\n ];\n\n return parts.join('\\0');\n}\n\nfunction findPackageInfo(entryPath: string) {\n let current = path.dirname(entryPath);\n\n while (true) {\n const packageJsonPath = path.join(current, 'package.json');\n\n try {\n const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as {\n name?: string;\n version?: string;\n };\n\n if (pkg.name === '@fluentic/style') {\n return {\n packageRoot: current,\n packageJsonPath,\n version: pkg.version ?? '',\n };\n }\n } catch {\n // Keep walking toward the filesystem root.\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n current = parent;\n }\n\n return {\n packageRoot: path.dirname(entryPath),\n packageJsonPath: '',\n version: '',\n };\n}\n\nfunction getStatIdentity(filePath: string) {\n if (!filePath) return '';\n\n try {\n const stat = fs.statSync(filePath);\n return `${stat.size}:${stat.mtimeMs}`;\n } catch {\n return '';\n }\n}\n\nexport function createSerializableImportSources(\n importSources: readonly ImportSource[] | null | undefined,\n): ImportSource[] | undefined {\n if (!importSources?.length) return undefined;\n\n const result: ImportSource[] = [];\n\n for (const entry of importSources) {\n if (entry.check) continue;\n\n const source = serializeImportSourcePattern(entry.source);\n const name = entry.name;\n const meta = entry.meta ?? (entry.styleFn ? getStyleFnMeta(entry.styleFn) : null);\n\n if (!meta) continue;\n if (entry.source !== undefined && source === undefined) continue;\n\n result.push(removeUndefinedValues({\n source,\n name,\n meta,\n }));\n }\n\n return result.length ? result : undefined;\n}\n\nfunction serializeImportSourcePattern(\n source: ImportSource['source'],\n): string | string[] | undefined {\n if (source === undefined) return undefined;\n\n if (Array.isArray(source)) {\n const result: string[] = [];\n\n for (const item of source) {\n if (typeof item !== 'string') return undefined;\n result.push(item);\n }\n\n return result;\n }\n\n return typeof source === 'string' ? source : undefined;\n}\n\nexport function resolveNextCompilerOptions(\n options: PluginOptions,\n sidecar: SourcemapSidecar | null,\n buildConfig: BuildConfig,\n buildDevConfig: BuildDevConfig | null,\n dev: boolean,\n): BasePluginOptions {\n const resolved = resolvePluginSourcemapOptions({\n ...options,\n devSourcemap: dev ? 'sidecarServer' : 'sourceUrl',\n }, sidecar);\n\n return {\n ...resolved,\n css: {\n ...resolved.css,\n ...buildConfig.css,\n },\n dev: {\n ...resolved.dev,\n ...buildDevConfig,\n },\n };\n}\n\nexport function removeUndefinedValues<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map((item) => removeUndefinedValues(item)) as T;\n }\n\n if (!value || typeof value !== 'object') {\n return value;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, item] of Object.entries(value)) {\n if (item !== undefined) {\n result[key] = removeUndefinedValues(item);\n }\n }\n\n return result as T;\n}\n\nexport function prependClientEntry(entry: unknown, moduleId: string) {\n if (typeof entry === 'function') {\n return async () => prependClientEntry(await entry(), moduleId);\n }\n\n if (!entry || typeof entry !== 'object') return entry;\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(entry)) {\n result[key] = prependEntryValue(value as NextWebpackEntryValue, moduleId);\n }\n\n return result;\n}\n\nexport function prependEntryValue(entry: NextWebpackEntryValue, moduleId: string): NextWebpackEntryValue {\n if (typeof entry === 'string') {\n return entry === moduleId ? entry : [moduleId, entry];\n }\n\n if (Array.isArray(entry)) {\n return entry.includes(moduleId) ? entry : [moduleId, ...entry];\n }\n\n const imports = entry.import;\n if (!imports) return { ...entry, import: moduleId };\n\n return {\n ...entry,\n import: Array.isArray(imports)\n ? imports.includes(moduleId) ? imports : [moduleId, ...imports]\n : imports === moduleId\n ? imports\n : [moduleId, imports],\n };\n}\n\nexport function isAppLayoutFile(filePath: string) {\n return /\\/app\\/(?:[^/]+\\/)*layout\\.[cm]?[jt]sx?$/.test(normalizePath(filePath));\n}\n\nexport function hasCssMarker(source: string, marker: string) {\n return source.includes(marker);\n}\n\nexport function replaceCssMarker(source: string, marker: string, css: string) {\n return source.split(marker).join(css);\n}\n\nexport function addAliases(config: WebpackConfiguration, aliases: Record<string, string>) {\n if (!config.resolve) config.resolve = {};\n if (!config.resolve.alias) config.resolve.alias = {};\n Object.assign(config.resolve.alias, aliases);\n}\n\nexport function addWebpackPlugin(config: WebpackConfiguration, plugin: WebpackPluginInstance) {\n if (!config.plugins) config.plugins = [];\n config.plugins.push(plugin);\n}\n\nexport function replaceCssMarkerAsset(args: {\n compiler: Compiler;\n compilation: Compilation;\n css: string;\n marker: string;\n}) {\n for (const asset of args.compilation.getAssets()) {\n if (!asset.name.endsWith('.css')) continue;\n\n const source = asset.source.source().toString();\n if (!hasCssMarker(source, args.marker)) continue;\n\n args.compilation.updateAsset(\n asset.name,\n new args.compiler.webpack.sources.RawSource(\n replaceCssMarker(source, args.marker, args.css),\n ),\n );\n\n return true;\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;AAEA,MAAa,gBAAgB;AAE7B,MAAa,qBAAqB,cAAc,SAAS;AAEzD,MAAa,wBAAwB,cAAc,SAAS;;;ACe5D,MAAa,eAAe,sBAAsB,iBAAiB;AAEnE,MAAa,wBAAwB;CACnC,KAAK;CACL,MAAM;AACR;AAEA,MAAa,oBAAoB;CAC/B,WAAW;CACX,eAAe;CACf,eAAe;AACjB;AAoBA,SAAgB,yBAAyB;CACvC,OAAO,cAAc,OAAO,KAAK,GAAG,EAAE,QAAQ,kBAAkB;AAClE;AAEA,SAAgB,gBAAgB,SAAiB,UAAmB;CAClE,OAAO,YAAY,KAAK,KAAK,SAAS,4BAA4B;AACpE;AAEA,SAAgB,6BAA6B,KAAc;CACzD,OAAO,MAAM,sBAAsB,MAAM,sBAAsB;AACjE;AAEA,SAAgB,sBAAsB,SAAqC;CACzE,OAAO,qBAAqB,OAAO;AACrC;AAEA,SAAgB,yBAAyB,SAA+C;CACtF,OAAO,wBAAwB,OAAO;AACxC;AAEA,SAAgB,qBACd,aACA,KACA,eACA;CACA,MAAM,SAAS;EACb,2BAA2B;EAC3B,MAAM,QAAQ;EACd,YAAY,QAAQ,UAAU;EAC9B,KAAK,UAAU,gCAAgC,aAAa,CAAC;CAC/D;CAEA,OAAO,WAAW,QAAQ,EAAE,OAAO,OAAO,KAAK,IAAI,CAAC,EAAE,OAAO,KAAK;AACpE;AAEA,SAAS,6BAA6B;CACpC,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;CAC7C,IAAI,YAAY;CAEhB,IAAI;EACF,YAAY,QAAQ,QAAQ,+BAA+B;CAC7D,Q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G;AACtC;AAEA,SAAgB,WAAW,QAA8B,SAAiC;CACxF,IAAI,CAAC,OAAO,SAAS,OAAO,UAAU,CAAC;CACvC,IAAI,CAAC,OAAO,QAAQ,OAAO,OAAO,QAAQ,QAAQ,CAAC;CACnD,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO;AAC7C;AAEA,SAAgB,iBAAiB,QAA8B,QAA+B;CAC5F,IAAI,CAAC,OAAO,SAAS,OAAO,UAAU,CAAC;CACvC,OAAO,QAAQ,KAAK,MAAM;AAC5B;AAEA,SAAgB,sBAAsB,MAKnC;CACD,KAAK,MAAM,SAAS,KAAK,YAAY,UAAU,GAAG;EAChD,IAAI,CAAC,MAAM,KAAK,SAAS,MAAM,GAAG;EAElC,MAAM,SAAS,MAAM,OAAO,OAAO,EAAE,SAAS;EAC9C,IAAI,CAAC,aAAa,QAAQ,KAAK,MAAM,GAAG;EAExC,KAAK,YAAY,YACf,MAAM,MACN,IAAI,KAAK,SAAS,QAAQ,QAAQ,UAChC,iBAAiB,QAAQ,KAAK,QAAQ,KAAK,GAAG,CAChD,CACF;EAEA,OAAO;CACT;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"utils-D75HPJWv.mjs","names":[],"sources":["../plugin/nextjs/constants.ts","../plugin/nextjs/utils.ts"],"sourcesContent":["import { STYLE_IMPORTS } from '../utils/imports';\n\nexport const DEV_CSS_ROUTE = '/__fluentic/dev.css';\n\nexport const LOADER_IMPORT_PATH = STYLE_IMPORTS.Plugin + '/nextjs/loader';\n\nexport const CSS_ENTRY_IMPORT_PATH = STYLE_IMPORTS.Plugin + '/nextjs/bundle.css';\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport type { Compilation, Compiler, WebpackPluginInstance } from 'webpack';\nimport type { Compiler as PluginCompiler } from '../../compiler';\nimport type { ImportSource } from '../../compiler/utils/import_source';\nimport { normalizePath } from '../../compiler/utils/path';\nimport type { BuildConfig, BuildDevConfig } from '../../config/build';\nimport { getStyleFnMeta } from '../../style/style';\nimport { createWebpackRegistry } from '../bundler/webpack/shared/registry';\nimport type { FileCssCache } from '../utils/cache';\nimport type { PluginOptions as BasePluginOptions } from '../utils/compiler';\nimport type { TransformFilter } from '../utils/filter';\nimport { getPluginBuildConfig, getPluginBuildDevConfig } from '../utils/runtimeEntry';\nimport type { SourcemapSidecar } from '../utils/sidecar';\nimport { resolvePluginSourcemapOptions } from '../utils/sourcemap';\nimport { LOADER_IMPORT_PATH } from './constants';\nimport type { PluginOptions, WebpackConfiguration } from './types';\n\nexport const nextRegistry = createWebpackRegistry('nextjs.registry');\n\nexport const PRECOLLECT_CACHE_DIRS = {\n dev: 'nextjs/precollect/dev',\n prod: 'nextjs/precollect/prod',\n};\n\nexport const NEXT_COMPILER_IDS = {\n turbopack: 'nextjs:turbopack',\n webpackServer: 'nextjs:webpack-server',\n webpackClient: 'nextjs:webpack-client',\n};\n\nexport type { PluginCompiler };\n\nexport type NextLoaderState = {\n compiler: PluginCompiler;\n filter: TransformFilter;\n dev: boolean;\n isServer: boolean;\n configHash: string;\n devCssHref: string | null;\n cssEntryImportPath: string;\n cssCache: Pick<FileCssCache, 'setFileCss'> | null;\n};\n\nexport type NextWebpackEntryValue = string | string[] | {\n import?: string | string[];\n [key: string]: unknown;\n};\n\nexport function getTransformLoaderPath() {\n return createRequire(import.meta.url).resolve(LOADER_IMPORT_PATH);\n}\n\nexport function getNextCacheDir(rootDir: string, cacheDir?: string) {\n return cacheDir ?? path.join(rootDir, '.next/cache/fluentic-style');\n}\n\nexport function getNextPrecollectCacheSubdir(dev: boolean) {\n return dev ? PRECOLLECT_CACHE_DIRS.dev : PRECOLLECT_CACHE_DIRS.prod;\n}\n\nexport function createNextBuildConfig(options: PluginOptions): BuildConfig {\n return getPluginBuildConfig(options);\n}\n\nexport function createNextBuildDevConfig(options: PluginOptions): BuildDevConfig | null {\n return getPluginBuildDevConfig(options);\n}\n\nexport function createNextConfigHash(\n buildConfig: BuildConfig,\n dev: boolean,\n importSources?: readonly ImportSource[] | null,\n) {\n const values = [\n createPackageCacheIdentity(),\n dev ? 'dev' : 'prod',\n buildConfig.hoist ? 'hoist' : 'no-hoist',\n JSON.stringify(createSerializableImportSources(importSources)),\n ];\n\n return createHash('sha256').update(values.join('\\0')).digest('hex');\n}\n\nfunction createPackageCacheIdentity() {\n const require = createRequire(import.meta.url);\n let entryPath = '';\n\n try {\n entryPath = require.resolve('@fluentic/style/plugin/nextjs');\n } catch {\n entryPath = fileURLToPath(import.meta.url);\n }\n\n const packageInfo = findPackageInfo(entryPath);\n const parts = [\n packageInfo.version,\n normalizePath(packageInfo.packageRoot),\n normalizePath(entryPath),\n getStatIdentity(packageInfo.packageJsonPath),\n getStatIdentity(entryPath),\n ];\n\n return parts.join('\\0');\n}\n\nfunction findPackageInfo(entryPath: string) {\n let current = path.dirname(entryPath);\n\n while (true) {\n const packageJsonPath = path.join(current, 'package.json');\n\n try {\n const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as {\n name?: string;\n version?: string;\n };\n\n if (pkg.name === '@fluentic/style') {\n return {\n packageRoot: current,\n packageJsonPath,\n version: pkg.version ?? '',\n };\n }\n } catch {\n // Keep walking toward the filesystem root.\n }\n\n const parent = path.dirname(current);\n if (parent === current) break;\n current = parent;\n }\n\n return {\n packageRoot: path.dirname(entryPath),\n packageJsonPath: '',\n version: '',\n };\n}\n\nfunction getStatIdentity(filePath: string) {\n if (!filePath) return '';\n\n try {\n const stat = fs.statSync(filePath);\n return `${stat.size}:${stat.mtimeMs}`;\n } catch {\n return '';\n }\n}\n\nexport function createSerializableImportSources(\n importSources: readonly ImportSource[] | null | undefined,\n): ImportSource[] | undefined {\n if (!importSources?.length) return undefined;\n\n const result: ImportSource[] = [];\n\n for (const entry of importSources) {\n if (entry.check) continue;\n\n const source = serializeImportSourcePattern(entry.source);\n const name = entry.name;\n const meta = entry.meta ?? (entry.styleFn ? getStyleFnMeta(entry.styleFn) : null);\n\n if (!meta) continue;\n if (entry.source !== undefined && source === undefined) continue;\n\n result.push(removeUndefinedValues({\n source,\n name,\n meta,\n }));\n }\n\n return result.length ? result : undefined;\n}\n\nfunction serializeImportSourcePattern(\n source: ImportSource['source'],\n): string | string[] | undefined {\n if (source === undefined) return undefined;\n\n if (Array.isArray(source)) {\n const result: string[] = [];\n\n for (const item of source) {\n if (typeof item !== 'string') return undefined;\n result.push(item);\n }\n\n return result;\n }\n\n return typeof source === 'string' ? source : undefined;\n}\n\nexport function resolveNextCompilerOptions(\n options: PluginOptions,\n sidecar: SourcemapSidecar | null,\n buildConfig: BuildConfig,\n buildDevConfig: BuildDevConfig | null,\n dev: boolean,\n): BasePluginOptions {\n const resolved = resolvePluginSourcemapOptions({\n ...options,\n devSourcemap: dev ? 'sidecarServer' : 'sourceUrl',\n }, sidecar);\n\n return {\n ...resolved,\n css: {\n ...resolved.css,\n ...buildConfig.css,\n },\n dev: {\n ...resolved.dev,\n ...buildDevConfig,\n },\n };\n}\n\nexport function removeUndefinedValues<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map((item) => removeUndefinedValues(item)) as T;\n }\n\n if (!value || typeof value !== 'object') {\n return value;\n }\n\n const result: Record<string, unknown> = {};\n\n for (const [key, item] of Object.entries(value)) {\n if (item !== undefined) {\n result[key] = removeUndefinedValues(item);\n }\n }\n\n return result as T;\n}\n\nexport function prependClientEntry(entry: unknown, moduleId: string) {\n if (typeof entry === 'function') {\n return async () => prependClientEntry(await entry(), moduleId);\n }\n\n if (!entry || typeof entry !== 'object') return entry;\n\n const result: Record<string, unknown> = {};\n\n for (const [key, value] of Object.entries(entry)) {\n result[key] = prependEntryValue(value as NextWebpackEntryValue, moduleId);\n }\n\n return result;\n}\n\nexport function prependEntryValue(entry: NextWebpackEntryValue, moduleId: string): NextWebpackEntryValue {\n if (typeof entry === 'string') {\n return entry === moduleId ? entry : [moduleId, entry];\n }\n\n if (Array.isArray(entry)) {\n return entry.includes(moduleId) ? entry : [moduleId, ...entry];\n }\n\n const imports = entry.import;\n if (!imports) return { ...entry, import: moduleId };\n\n return {\n ...entry,\n import: Array.isArray(imports)\n ? imports.includes(moduleId) ? imports : [moduleId, ...imports]\n : imports === moduleId\n ? imports\n : [moduleId, imports],\n };\n}\n\nexport function isAppLayoutFile(filePath: string) {\n return /\\/app\\/(?:[^/]+\\/)*layout\\.[cm]?[jt]sx?$/.test(normalizePath(filePath));\n}\n\nexport function hasCssMarker(source: string, marker: string) {\n return source.includes(marker);\n}\n\nexport function replaceCssMarker(source: string, marker: string, css: string) {\n return source.split(marker).join(css);\n}\n\nexport function addAliases(config: WebpackConfiguration, aliases: Record<string, string>) {\n if (!config.resolve) config.resolve = {};\n if (!config.resolve.alias) config.resolve.alias = {};\n Object.assign(config.resolve.alias, aliases);\n}\n\nexport function addWebpackPlugin(config: WebpackConfiguration, plugin: WebpackPluginInstance) {\n if (!config.plugins) config.plugins = [];\n config.plugins.push(plugin);\n}\n\nexport function replaceCssMarkerAsset(args: {\n compiler: Compiler;\n compilation: Compilation;\n css: string;\n marker: string;\n}) {\n for (const asset of args.compilation.getAssets()) {\n if (!asset.name.endsWith('.css')) continue;\n\n const source = asset.source.source().toString();\n if (!hasCssMarker(source, args.marker)) continue;\n\n args.compilation.updateAsset(\n asset.name,\n new args.compiler.webpack.sources.RawSource(\n replaceCssMarker(source, args.marker, args.css),\n ),\n );\n\n return true;\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;AAEA,MAAa,gBAAgB;AAE7B,MAAa,qBAAqB,cAAc,SAAS;AAEzD,MAAa,wBAAwB,cAAc,SAAS;;;ACe5D,MAAa,eAAe,sBAAsB,iBAAiB;AAEnE,MAAa,wBAAwB;CACnC,KAAK;CACL,MAAM;AACR;AAEA,MAAa,oBAAoB;CAC/B,WAAW;CACX,eAAe;CACf,eAAe;AACjB;AAoBA,SAAgB,yBAAyB;CACvC,OAAO,cAAc,OAAO,KAAK,GAAG,EAAE,QAA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AExC,KAAK,YAAY,YACf,MAAM,MACN,IAAI,KAAK,SAAS,QAAQ,QAAQ,UAChC,iBAAiB,QAAQ,KAAK,QAAQ,KAAK,GAAG,CAChD,CACF;EAEA,OAAO;CACT;CAEA,OAAO;AACT"}
@@ -1,7 +1,7 @@
1
- import { r as getStyleRuntimeImportPath } from "./compiler-C3CEGGtI.mjs";
2
- import { C as createPluginCompiler, D as DEFAULT_TRANSFORM_INCLUDE, E as DEFAULT_TRANSFORM_EXCLUDE, I as writePluginCacheFile, M as EXTRACTED_CSS_MARKER, P as PLUGIN_NAME, S as createCompilerId, T as invalidateFiles, _ as getStyleRuntimeMode, d as resolvePluginSourcemapFilePath, g as getStyleEntryDefines, h as getPluginBuildDevConfig, j as BUNDLE_CSS_FILE, m as getPluginBuildConfig, t as formatError, u as resolveDevSourcemapMode, w as getPluginCacheDir, y as transformCssOutput } from "./misc-B76PUnWe.mjs";
3
- import { t as getSourcemapSidecar } from "./sidecar-BhvmXYsD.mjs";
4
- import { a as prependWebpackRuntimeEntry, i as hasWebpackCssMarker, n as getStylePackageDistPath, o as replaceWebpackCssMarker, r as getTransformLoaderPath, s as webpackRegistry, t as createWebpackRuntimeModuleSource } from "./utils-DND33M6y.mjs";
1
+ import { r as getStyleRuntimeImportPath } from "./compiler-mCfMhtX4.mjs";
2
+ import { C as createPluginCompiler, D as DEFAULT_TRANSFORM_INCLUDE, E as DEFAULT_TRANSFORM_EXCLUDE, I as writePluginCacheFile, M as EXTRACTED_CSS_MARKER, P as PLUGIN_NAME, S as createCompilerId, T as invalidateFiles, _ as getStyleRuntimeMode, d as resolvePluginSourcemapFilePath, g as getStyleEntryDefines, h as getPluginBuildDevConfig, j as BUNDLE_CSS_FILE, m as getPluginBuildConfig, t as formatError, u as resolveDevSourcemapMode, w as getPluginCacheDir, y as transformCssOutput } from "./misc-vGtt_SX7.mjs";
3
+ import { t as getSourcemapSidecar } from "./sidecar-BTT0veLU.mjs";
4
+ import { a as prependWebpackRuntimeEntry, i as hasWebpackCssMarker, n as getStylePackageDistPath, o as replaceWebpackCssMarker, r as getTransformLoaderPath, s as webpackRegistry, t as createWebpackRuntimeModuleSource } from "./utils-D4UympcZ.mjs";
5
5
  //#region plugin/bundler/webpack/plugin.ts
6
6
  const WEBPACK_RUNTIME_FILE = "webpack-runtime.js";
7
7
  function plugin(options = {}) {
@@ -104,4 +104,4 @@ function isRspackCompiler(compiler) {
104
104
  //#endregion
105
105
  export { plugin as t };
106
106
 
107
- //# sourceMappingURL=webpack-D7QO0bKN.mjs.map
107
+ //# sourceMappingURL=webpack-_BpgAUEy.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-D7QO0bKN.mjs","names":[],"sources":["../plugin/bundler/webpack/plugin.ts"],"sourcesContent":["import type { Compiler, RuleSetRule, WebpackPluginInstance } from 'webpack';\nimport { getStyleRuntimeImportPath } from '../../../compiler/utils/imports';\nimport {\n BUNDLE_CSS_FILE,\n createCompilerId,\n createPluginCompiler,\n DEFAULT_TRANSFORM_EXCLUDE,\n DEFAULT_TRANSFORM_INCLUDE,\n EXTRACTED_CSS_MARKER,\n getPluginCacheDir,\n invalidateFiles,\n PLUGIN_NAME,\n type PluginOptions,\n resolvePluginSourcemapFilePath,\n transformCssOutput,\n writePluginCacheFile,\n} from '../../utils';\nimport { formatError } from '../../utils/misc';\nimport {\n getPluginBuildConfig,\n getPluginBuildDevConfig,\n getStyleEntryDefines,\n getStyleRuntimeMode,\n} from '../../utils/runtimeEntry';\nimport { getSourcemapSidecar } from '../../utils/sidecar';\nimport { resolveDevSourcemapMode } from '../../utils/sourcemap';\nimport {\n createWebpackRuntimeModuleSource,\n getStylePackageDistPath,\n getTransformLoaderPath,\n hasWebpackCssMarker,\n prependWebpackRuntimeEntry,\n replaceWebpackCssMarker,\n type WebpackLoaderState,\n webpackRegistry,\n} from './utils';\n\nexport { CssPropPresets } from '../../utils';\nexport type { CompilerCssPropOptions, PluginOptions } from '../../utils';\n\nconst WEBPACK_RUNTIME_FILE = 'webpack-runtime.js';\n\nexport default plugin;\n\nexport function plugin(options: PluginOptions = {}) {\n return new WebpackPlugin(options);\n}\n\nclass WebpackPlugin implements WebpackPluginInstance {\n private readonly options: PluginOptions;\n\n constructor(options: PluginOptions = {}) {\n this.options = options;\n }\n\n apply(compiler: Compiler) {\n const dev = compiler.options.mode === 'development';\n const extract = !dev;\n\n const buildConfig = getPluginBuildConfig(this.options);\n const buildDevConfig = getPluginBuildDevConfig(this.options);\n const cacheDir = getPluginCacheDir(compiler.context, this.options.cacheDir);\n const devSourcemap = resolveDevSourcemapMode(this.options.devSourcemap, dev);\n\n const sourcemapSidecar = devSourcemap === 'sidecarServer'\n ? getSourcemapSidecar({ projectDir: compiler.context, cacheDir })\n : null;\n\n const getSourcemapFilePath = resolvePluginSourcemapFilePath(\n this.options.getSourcemapFilePath,\n sourcemapSidecar,\n );\n\n const runtimeMode = getStyleRuntimeMode(dev);\n const useRuntimeSidecarUrl = isRspackCompiler(compiler) && devSourcemap === 'sidecarServer';\n\n const createRuntimeSource = (sidecarUrl: string | null = null) =>\n createWebpackRuntimeModuleSource(\n extract,\n cssFilePath,\n useRuntimeSidecarUrl\n ? {\n runtimeImportPath: getStyleRuntimeImportPath(runtimeMode),\n sidecarUrl,\n }\n : undefined,\n );\n\n const state = createPluginCompiler({\n projectDir: compiler.context,\n cacheDir,\n dev,\n options: { ...this.options, devSourcemap, getSourcemapFilePath },\n runtimeMode,\n });\n\n const cssFilePath = extract\n ? writePluginCacheFile(state, BUNDLE_CSS_FILE, EXTRACTED_CSS_MARKER)\n : null;\n\n const runtimeFilePath = writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(),\n );\n\n const compilerId = createCompilerId('webpack');\n\n webpackRegistry.setEntry<WebpackLoaderState>(compilerId, {\n transform: state.transform,\n });\n\n compiler.options.entry = prependWebpackRuntimeEntry(\n compiler.options.entry,\n runtimeFilePath,\n );\n\n addTransformLoader(compiler, this.options, compilerId);\n\n const entryDefines = getStyleEntryDefines(buildConfig, buildDevConfig, null);\n\n compiler.options.plugins ??= [];\n compiler.options.plugins.push(\n new compiler.webpack.DefinePlugin(entryDefines),\n );\n\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await sourcemapSidecar?.ensureStarted();\n\n Object.assign(\n entryDefines,\n getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sourcemapSidecar?.getBaseUrl() || null,\n ),\n );\n writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(sourcemapSidecar?.getBaseUrl() || null),\n );\n });\n\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async (watchCompiler) => {\n await sourcemapSidecar?.ensureStarted();\n Object.assign(\n entryDefines,\n getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sourcemapSidecar?.getBaseUrl() || null,\n ),\n );\n writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(sourcemapSidecar?.getBaseUrl() || null),\n );\n\n const files = watchCompiler.modifiedFiles;\n if (!files || !files.size) return;\n\n invalidateFiles(state.compiler, files);\n state.filter.clear();\n });\n\n compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {\n if (dev) return;\n\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n async () => {\n const css = await transformCssOutput(\n state.compiler.getExtractedCss(),\n this.options.cssOutput,\n BUNDLE_CSS_FILE,\n );\n if (!css) return;\n\n for (const asset of compilation.getAssets()) {\n if (!asset.name.endsWith('.css')) continue;\n\n const source = asset.source.source().toString();\n if (!hasWebpackCssMarker(source, EXTRACTED_CSS_MARKER)) continue;\n\n compilation.updateAsset(\n asset.name,\n new compiler.webpack.sources.RawSource(\n replaceWebpackCssMarker(source, EXTRACTED_CSS_MARKER, css),\n ),\n );\n\n return;\n }\n\n compilation.warnings.push(\n new Error(formatError(\n 'No CSS asset containing the Fluentic marker was emitted by Webpack, so extracted CSS could not be attached. ' +\n 'Make sure your Webpack config handles CSS imports so Webpack owns the output filename, hashing, and runtime loading.',\n )),\n );\n },\n );\n });\n }\n}\n\nfunction addTransformLoader(\n compiler: Compiler,\n options: PluginOptions,\n compilerId: string,\n) {\n const loader = {\n loader: getTransformLoaderPath(),\n options: { ...options, compilerId },\n };\n\n const rule: RuleSetRule = {\n use: [loader],\n enforce: 'pre',\n test: DEFAULT_TRANSFORM_INCLUDE,\n exclude: options.include ? undefined : [\n DEFAULT_TRANSFORM_EXCLUDE,\n getStylePackageDistPath(),\n ],\n };\n\n compiler.options.module.rules.unshift(rule);\n}\n\nfunction isRspackCompiler(compiler: Compiler) {\n const webpack = compiler.webpack as typeof compiler.webpack & {\n rspackVersion?: unknown;\n };\n\n return typeof webpack.rspackVersion === 'string';\n}\n"],"mappings":";;;;;AAwCA,MAAM,uBAAuB;AAI7B,SAAgB,OAAO,UAAyB,CAAC,GAAG;CAClD,OAAO,IAAI,cAAc,OAAO;AAClC;AAEA,IAAM,gBAAN,MAAqD;CAGnD,YAAY,UAAyB,CAAC,GAAG;EACvC,KAAK,UAAU;CACjB;CAEA,MAAM,UAAoB;EACxB,MAAM,MAAM,SAAS,QAAQ,SAAS;EACtC,MAAM,UAAU,CAAC;EAEjB,MAAM,cAAc,qBAAqB,KAAK,OAAO;EACrD,MAAM,iBAAiB,wBAAwB,KAAK,OAAO;EAC3D,MAAM,WAAW,kBAAkB,SAAS,SAAS,KAAK,QAAQ,QAAQ;EAC1E,MAAM,eAAe,wBAAwB,KAAK,QAAQ,cAAc,GAAG;EAE3E,MAAM,mBAAmB,iBAAiB,kBACtC,oBAAoB;GAAE,YAAY,SAAS;GAAS;EAAS,CAAC,IAC9D;EAEJ,MAAM,uBAAuB,+BAC3B,KAAK,QAAQ,sBACb,gBACF;EAEA,MAAM,cAAc,oBAAoB,GAAG;EAC3C,MAAM,uBAAuB,iBAAiB,QAAQ,KAAK,iBAA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,MAAM;EACrB,CAAC;EAED,SAAS,MAAM,gBAAgB,IAAI,cAAc,gBAAgB;GAC/D,IAAI,KAAK;GAET,YAAY,MAAM,cAAc,WAC9B;IACE,MAAM;IACN,OAAO,SAAS,QAAQ,YAAY;GACtC,GACA,YAAY;IACV,MAAM,MAAM,MAAM,mBAChB,MAAM,SAAS,gBAAgB,GAC/B,KAAK,QAAQ,WACb,eACF;IACA,IAAI,CAAC,KAAK;IAEV,KAAK,MAAM,SAAS,YAAY,UAAU,GAAG;KAC3C,IAAI,CAAC,MAAM,KAAK,SAAS,MAAM,GAAG;KAElC,MAAM,SAAS,MAAM,OAAO,OAAO,EAAE,SAAS;KAC9C,IAAI,CAAC,oBAAoB,QAAA,oDAA4B,GAAG;KAExD,YAAY,YACV,MAAM,MACN,IAAI,SAAS,QAAQ,QAAQ,UAC3B,wBAAwB,QAAQ,sBAAsB,GAAG,CAC3D,CACF;KAEA;IACF;IAEA,YAAY,SAAS,KACnB,IAAI,MAAM,YACR,kOAEF,CAAC,CACH;GACF,CACF;EACF,CAAC;CACH;AACF;AAEA,SAAS,mBACP,UACA,SACA,YACA;CAMA,MAAM,OAAoB;EACxB,KAAK,CAAC;GALN,QAAQ,uBAAuB;GAC/B,SAAS;IAAE,GAAG;IAAS;GAAW;EAIvB,CAAC;EACZ,SAAS;EACT,MAAM;EACN,SAAS,QAAQ,UAAU,KAAA,IAAY,CACrC,2BACA,wBAAwB,CAC1B;CACF;CAEA,SAAS,QAAQ,OAAO,MAAM,QAAQ,IAAI;AAC5C;AAEA,SAAS,iBAAiB,UAAoB;CAK5C,OAAO,OAJS,SAAS,QAIH,kBAAkB;AAC1C"}
1
+ {"version":3,"file":"webpack-_BpgAUEy.mjs","names":[],"sources":["../plugin/bundler/webpack/plugin.ts"],"sourcesContent":["import type { Compiler, RuleSetRule, WebpackPluginInstance } from 'webpack';\nimport { getStyleRuntimeImportPath } from '../../../compiler/utils/imports';\nimport {\n BUNDLE_CSS_FILE,\n createCompilerId,\n createPluginCompiler,\n DEFAULT_TRANSFORM_EXCLUDE,\n DEFAULT_TRANSFORM_INCLUDE,\n EXTRACTED_CSS_MARKER,\n getPluginCacheDir,\n invalidateFiles,\n PLUGIN_NAME,\n type PluginOptions,\n resolvePluginSourcemapFilePath,\n transformCssOutput,\n writePluginCacheFile,\n} from '../../utils';\nimport { formatError } from '../../utils/misc';\nimport {\n getPluginBuildConfig,\n getPluginBuildDevConfig,\n getStyleEntryDefines,\n getStyleRuntimeMode,\n} from '../../utils/runtimeEntry';\nimport { getSourcemapSidecar } from '../../utils/sidecar';\nimport { resolveDevSourcemapMode } from '../../utils/sourcemap';\nimport {\n createWebpackRuntimeModuleSource,\n getStylePackageDistPath,\n getTransformLoaderPath,\n hasWebpackCssMarker,\n prependWebpackRuntimeEntry,\n replaceWebpackCssMarker,\n type WebpackLoaderState,\n webpackRegistry,\n} from './utils';\n\nexport { CssPropPresets } from '../../utils';\nexport type { CompilerCssPropOptions, PluginOptions } from '../../utils';\n\nconst WEBPACK_RUNTIME_FILE = 'webpack-runtime.js';\n\nexport default plugin;\n\nexport function plugin(options: PluginOptions = {}) {\n return new WebpackPlugin(options);\n}\n\nclass WebpackPlugin implements WebpackPluginInstance {\n private readonly options: PluginOptions;\n\n constructor(options: PluginOptions = {}) {\n this.options = options;\n }\n\n apply(compiler: Compiler) {\n const dev = compiler.options.mode === 'development';\n const extract = !dev;\n\n const buildConfig = getPluginBuildConfig(this.options);\n const buildDevConfig = getPluginBuildDevConfig(this.options);\n const cacheDir = getPluginCacheDir(compiler.context, this.options.cacheDir);\n const devSourcemap = resolveDevSourcemapMode(this.options.devSourcemap, dev);\n\n const sourcemapSidecar = devSourcemap === 'sidecarServer'\n ? getSourcemapSidecar({ projectDir: compiler.context, cacheDir })\n : null;\n\n const getSourcemapFilePath = resolvePluginSourcemapFilePath(\n this.options.getSourcemapFilePath,\n sourcemapSidecar,\n );\n\n const runtimeMode = getStyleRuntimeMode(dev);\n const useRuntimeSidecarUrl = isRspackCompiler(compiler) && devSourcemap === 'sidecarServer';\n\n const createRuntimeSource = (sidecarUrl: string | null = null) =>\n createWebpackRuntimeModuleSource(\n extract,\n cssFilePath,\n useRuntimeSidecarUrl\n ? {\n runtimeImportPath: getStyleRuntimeImportPath(runtimeMode),\n sidecarUrl,\n }\n : undefined,\n );\n\n const state = createPluginCompiler({\n projectDir: compiler.context,\n cacheDir,\n dev,\n options: { ...this.options, devSourcemap, getSourcemapFilePath },\n runtimeMode,\n });\n\n const cssFilePath = extract\n ? writePluginCacheFile(state, BUNDLE_CSS_FILE, EXTRACTED_CSS_MARKER)\n : null;\n\n const runtimeFilePath = writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(),\n );\n\n const compilerId = createCompilerId('webpack');\n\n webpackRegistry.setEntry<WebpackLoaderState>(compilerId, {\n transform: state.transform,\n });\n\n compiler.options.entry = prependWebpackRuntimeEntry(\n compiler.options.entry,\n runtimeFilePath,\n );\n\n addTransformLoader(compiler, this.options, compilerId);\n\n const entryDefines = getStyleEntryDefines(buildConfig, buildDevConfig, null);\n\n compiler.options.plugins ??= [];\n compiler.options.plugins.push(\n new compiler.webpack.DefinePlugin(entryDefines),\n );\n\n compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n await sourcemapSidecar?.ensureStarted();\n\n Object.assign(\n entryDefines,\n getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sourcemapSidecar?.getBaseUrl() || null,\n ),\n );\n writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(sourcemapSidecar?.getBaseUrl() || null),\n );\n });\n\n compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async (watchCompiler) => {\n await sourcemapSidecar?.ensureStarted();\n Object.assign(\n entryDefines,\n getStyleEntryDefines(\n buildConfig,\n buildDevConfig,\n sourcemapSidecar?.getBaseUrl() || null,\n ),\n );\n writePluginCacheFile(\n state,\n WEBPACK_RUNTIME_FILE,\n createRuntimeSource(sourcemapSidecar?.getBaseUrl() || null),\n );\n\n const files = watchCompiler.modifiedFiles;\n if (!files || !files.size) return;\n\n invalidateFiles(state.compiler, files);\n state.filter.clear();\n });\n\n compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {\n if (dev) return;\n\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,\n },\n async () => {\n const css = await transformCssOutput(\n state.compiler.getExtractedCss(),\n this.options.cssOutput,\n BUNDLE_CSS_FILE,\n );\n if (!css) return;\n\n for (const asset of compilation.getAssets()) {\n if (!asset.name.endsWith('.css')) continue;\n\n const source = asset.source.source().toString();\n if (!hasWebpackCssMarker(source, EXTRACTED_CSS_MARKER)) continue;\n\n compilation.updateAsset(\n asset.name,\n new compiler.webpack.sources.RawSource(\n replaceWebpackCssMarker(source, EXTRACTED_CSS_MARKER, css),\n ),\n );\n\n return;\n }\n\n compilation.warnings.push(\n new Error(formatError(\n 'No CSS asset containing the Fluentic marker was emitted by Webpack, so extracted CSS could not be attached. ' +\n 'Make sure your Webpack config handles CSS imports so Webpack owns the output filename, hashing, and runtime loading.',\n )),\n );\n },\n );\n });\n }\n}\n\nfunction addTransformLoader(\n compiler: Compiler,\n options: PluginOptions,\n compilerId: string,\n) {\n const loader = {\n loader: getTransformLoaderPath(),\n options: { ...options, compilerId },\n };\n\n const rule: RuleSetRule = {\n use: [loader],\n enforce: 'pre',\n test: DEFAULT_TRANSFORM_INCLUDE,\n exclude: options.include ? undefined : [\n DEFAULT_TRANSFORM_EXCLUDE,\n getStylePackageDistPath(),\n ],\n };\n\n compiler.options.module.rules.unshift(rule);\n}\n\nfunction isRspackCompiler(compiler: Compiler) {\n const webpack = compiler.webpack as typeof compiler.webpack & {\n rspackVersion?: unknown;\n };\n\n return typeof webpack.rspackVersion === 'string';\n}\n"],"mappings":";;;;;AAwCA,MAAM,uBAAuB;AAI7B,SAAgB,OAA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AS,KACnB,IAAI,MAAM,YACR,kOAEF,CAAC,CACH;GACF,CACF;EACF,CAAC;CACH;AACF;AAEA,SAAS,mBACP,UACA,SACA,YACA;CAMA,MAAM,OAAoB;EACxB,KAAK,CAAC;GALN,QAAQ,uBAAuB;GAC/B,SAAS;IAAE,GAAG;IAAS;GAAW;EAIvB,CAAC;EACZ,SAAS;EACT,MAAM;EACN,SAAS,QAAQ,UAAU,KAAA,IAAY,CACrC,2BACA,wBAAwB,CAC1B;CACF;CAEA,SAAS,QAAQ,OAAO,MAAM,QAAQ,IAAI;AAC5C;AAEA,SAAS,iBAAiB,UAAoB;CAK5C,OAAO,OAJS,SAAS,QAIH,kBAAkB;AAC1C"}
@@ -1,32 +1,15 @@
1
- declare module 'solid-js/types/jsx' {
2
- namespace JSX {
3
- interface RuntimeAttributes {
4
- css?: import('../../runtime/types').StyleProp;
5
- }
6
-
7
- interface HTMLAttributes<_T> extends RuntimeAttributes {}
8
- interface SVGAttributes<_T> extends RuntimeAttributes {}
9
- }
10
- }
1
+ import 'solid-js/jsx-runtime';
2
+ import type { StyleProp } from '../../runtime/types';
11
3
 
12
4
  declare module 'solid-js/jsx-runtime' {
13
5
  namespace JSX {
14
- interface RuntimeAttributes {
15
- css?: import('../../runtime/types').StyleProp;
6
+ // oxlint-disable-next-line no-unused-vars
7
+ interface HTMLAttributes<T> {
8
+ css?: StyleProp;
16
9
  }
17
-
18
- interface HTMLAttributes<_T> extends RuntimeAttributes {}
19
- interface SVGAttributes<_T> extends RuntimeAttributes {}
20
- }
21
- }
22
-
23
- declare module 'solid-js' {
24
- namespace JSX {
25
- interface RuntimeAttributes {
26
- css?: import('../../runtime/types').StyleProp;
10
+ // oxlint-disable-next-line no-unused-vars
11
+ interface CoreSVGAttributes<T> {
12
+ css?: StyleProp;
27
13
  }
28
-
29
- interface HTMLAttributes<_T> extends RuntimeAttributes {}
30
- interface SVGAttributes<_T> extends RuntimeAttributes {}
31
14
  }
32
15
  }