meno-core 1.0.53 → 1.1.0

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 (415) hide show
  1. package/.claude/settings.local.json +1 -3
  2. package/bin/cli.ts +66 -261
  3. package/build-astro.ts +150 -128
  4. package/dist/bin/cli.js +42 -185
  5. package/dist/bin/cli.js.map +2 -2
  6. package/dist/chunks/chunk-2AR55GYH.js +42 -0
  7. package/dist/chunks/chunk-2AR55GYH.js.map +7 -0
  8. package/dist/chunks/{chunk-JGWFTO6P.js → chunk-2IIQK7T3.js} +2624 -1389
  9. package/dist/chunks/chunk-2IIQK7T3.js.map +7 -0
  10. package/dist/chunks/chunk-4ZRU52J2.js +169 -0
  11. package/dist/chunks/chunk-4ZRU52J2.js.map +7 -0
  12. package/dist/chunks/{chunk-UB44F4Z2.js → chunk-5X4HCN7J.js} +5 -7
  13. package/dist/chunks/chunk-5X4HCN7J.js.map +7 -0
  14. package/dist/chunks/{chunk-WQFG7PAH.js → chunk-7CCVOL5M.js} +15 -19
  15. package/dist/chunks/chunk-7CCVOL5M.js.map +7 -0
  16. package/dist/chunks/{chunk-YBLHKYFF.js → chunk-AR7LHIFY.js} +8 -2
  17. package/dist/chunks/chunk-AR7LHIFY.js.map +7 -0
  18. package/dist/chunks/{chunk-O3NAGJP4.js → chunk-NUP7H7D3.js} +135 -41
  19. package/dist/chunks/chunk-NUP7H7D3.js.map +7 -0
  20. package/dist/chunks/{chunk-X754AHS5.js → chunk-QWTQZHG3.js} +194 -90
  21. package/dist/chunks/chunk-QWTQZHG3.js.map +7 -0
  22. package/dist/chunks/{chunk-H3GJ4H2U.js → chunk-XTKNX4FW.js} +216 -87
  23. package/dist/chunks/chunk-XTKNX4FW.js.map +7 -0
  24. package/dist/chunks/{fs-JGINUXGL.js → fs-G3ANWEFP.js} +2 -2
  25. package/dist/lib/client/index.js +1003 -475
  26. package/dist/lib/client/index.js.map +3 -3
  27. package/dist/lib/server/index.js +14393 -6371
  28. package/dist/lib/server/index.js.map +4 -4
  29. package/dist/lib/shared/index.js +342 -101
  30. package/dist/lib/shared/index.js.map +4 -4
  31. package/dist/lib/shared/richtext/index.js +1 -1
  32. package/dist/lib/test-utils/index.js +64 -80
  33. package/dist/lib/test-utils/index.js.map +2 -2
  34. package/entries/client-router.tsx +10 -8
  35. package/lib/client/ClientInitializer.ts +8 -8
  36. package/lib/client/ErrorBoundary.test.tsx +246 -186
  37. package/lib/client/ErrorBoundary.tsx +183 -132
  38. package/lib/client/componentRegistry.test.ts +96 -108
  39. package/lib/client/componentRegistry.ts +1 -3
  40. package/lib/client/contexts/ThemeContext.tsx +3 -2
  41. package/lib/client/core/ComponentBuilder.test.ts +663 -560
  42. package/lib/client/core/ComponentBuilder.ts +427 -155
  43. package/lib/client/core/ComponentRenderer.test.tsx +2 -4
  44. package/lib/client/core/ComponentRenderer.tsx +46 -33
  45. package/lib/client/core/builders/embedBuilder.ts +242 -54
  46. package/lib/client/core/builders/linkBuilder.ts +72 -45
  47. package/lib/client/core/builders/linkNodeBuilder.ts +79 -54
  48. package/lib/client/core/builders/listBuilder.ts +155 -89
  49. package/lib/client/core/builders/localeListBuilder.ts +97 -62
  50. package/lib/client/core/builders/types.ts +5 -5
  51. package/lib/client/core/cmsTemplateProcessor.ts +8 -9
  52. package/lib/client/elementRegistry.ts +3 -3
  53. package/lib/client/fontFamiliesService.test.ts +2 -10
  54. package/lib/client/fontFamiliesService.ts +3 -3
  55. package/lib/client/hmr/HMRManager.tsx +47 -30
  56. package/lib/client/hmrCssReload.ts +49 -14
  57. package/lib/client/hmrWebSocket.ts +14 -19
  58. package/lib/client/hooks/useColorVariables.test.ts +21 -21
  59. package/lib/client/hooks/useColorVariables.ts +23 -18
  60. package/lib/client/hooks/usePropertyAutocomplete.ts +4 -6
  61. package/lib/client/hooks/useVariables.ts +6 -4
  62. package/lib/client/hydration/HydrationUtils.test.ts +24 -25
  63. package/lib/client/hydration/HydrationUtils.ts +3 -4
  64. package/lib/client/i18nConfigService.test.ts +2 -7
  65. package/lib/client/i18nConfigService.ts +2 -2
  66. package/lib/client/meno-filter/MenoFilter.test.ts +47 -49
  67. package/lib/client/meno-filter/MenoFilter.ts +14 -15
  68. package/lib/client/meno-filter/bindings.ts +18 -43
  69. package/lib/client/meno-filter/init.ts +4 -4
  70. package/lib/client/meno-filter/renderer.ts +30 -32
  71. package/lib/client/meno-filter/script.generated.ts +1 -3
  72. package/lib/client/meno-filter/ui.ts +4 -6
  73. package/lib/client/meno-filter/updates.ts +18 -23
  74. package/lib/client/meno-filter/utils.ts +1 -1
  75. package/lib/client/navigation.test.ts +174 -178
  76. package/lib/client/navigation.ts +0 -1
  77. package/lib/client/responsiveStyleResolver.knownTokens.test.ts +71 -0
  78. package/lib/client/responsiveStyleResolver.test.ts +234 -232
  79. package/lib/client/responsiveStyleResolver.ts +74 -20
  80. package/lib/client/routing/RouteLoader.test.ts +24 -25
  81. package/lib/client/routing/RouteLoader.ts +27 -35
  82. package/lib/client/routing/Router.tsx +210 -153
  83. package/lib/client/scripts/ScriptExecutor.test.ts +157 -158
  84. package/lib/client/scripts/ScriptExecutor.ts +18 -36
  85. package/lib/client/services/PrefetchService.test.ts +3 -3
  86. package/lib/client/services/PrefetchService.ts +23 -29
  87. package/lib/client/styleProcessor.test.ts +9 -9
  88. package/lib/client/styleProcessor.ts +24 -15
  89. package/lib/client/styles/StyleInjector.test.ts +122 -115
  90. package/lib/client/styles/StyleInjector.ts +10 -7
  91. package/lib/client/styles/UtilityClassCollector.ts +62 -28
  92. package/lib/client/styles/cspNonce.test.ts +2 -5
  93. package/lib/client/templateEngine.test.ts +554 -488
  94. package/lib/client/templateEngine.ts +203 -73
  95. package/lib/client/theme.test.ts +1 -1
  96. package/lib/client/theme.ts +0 -1
  97. package/lib/client/utils/toast.ts +0 -1
  98. package/lib/server/__integration__/api-routes.test.ts +8 -4
  99. package/lib/server/__integration__/cms-integration.test.ts +1 -4
  100. package/lib/server/__integration__/server-lifecycle.test.ts +4 -5
  101. package/lib/server/__integration__/ssr-rendering.test.ts +47 -37
  102. package/lib/server/__integration__/static-assets.test.ts +3 -3
  103. package/lib/server/__integration__/test-helpers.ts +87 -74
  104. package/lib/server/ab/generateFunctions.ts +12 -10
  105. package/lib/server/astro/cmsPageEmitter.ts +26 -42
  106. package/lib/server/astro/componentEmitter.ts +35 -43
  107. package/lib/server/astro/cssCollector.ts +10 -26
  108. package/lib/server/astro/nodeToAstro.test.ts +1754 -34
  109. package/lib/server/astro/nodeToAstro.ts +232 -216
  110. package/lib/server/astro/normalizeOrphanTemplateProps.test.ts +115 -119
  111. package/lib/server/astro/normalizeOrphanTemplateProps.ts +11 -18
  112. package/lib/server/astro/pageEmitter.ts +9 -13
  113. package/lib/server/astro/tailwindMapper.test.ts +10 -37
  114. package/lib/server/astro/tailwindMapper.ts +33 -40
  115. package/lib/server/astro/templateTransformer.ts +17 -20
  116. package/lib/server/createServer.ts +7 -19
  117. package/lib/server/cssGenerator.test.ts +35 -44
  118. package/lib/server/cssGenerator.ts +8 -19
  119. package/lib/server/fileWatcher.test.ts +164 -13
  120. package/lib/server/fileWatcher.ts +209 -124
  121. package/lib/server/index.ts +14 -17
  122. package/lib/server/jsonLoader.test.ts +39 -2
  123. package/lib/server/jsonLoader.ts +39 -34
  124. package/lib/server/middleware/cors.test.ts +21 -21
  125. package/lib/server/middleware/cors.ts +28 -4
  126. package/lib/server/middleware/errorHandler.test.ts +7 -5
  127. package/lib/server/middleware/errorHandler.ts +3 -8
  128. package/lib/server/middleware/index.ts +0 -1
  129. package/lib/server/middleware/logger.test.ts +10 -8
  130. package/lib/server/middleware/logger.ts +17 -29
  131. package/lib/server/migrateTemplates.ts +3 -3
  132. package/lib/server/pageCache.test.ts +76 -77
  133. package/lib/server/pageCache.ts +0 -1
  134. package/lib/server/projectContext.ts +5 -4
  135. package/lib/server/providers/fileSystemCMSProvider.test.ts +142 -99
  136. package/lib/server/providers/fileSystemCMSProvider.ts +62 -38
  137. package/lib/server/routes/api/cms.test.ts +26 -14
  138. package/lib/server/routes/api/cms.ts +9 -14
  139. package/lib/server/routes/api/colors.test.ts +2 -2
  140. package/lib/server/routes/api/components.ts +31 -35
  141. package/lib/server/routes/api/config.ts +3 -4
  142. package/lib/server/routes/api/core-routes.ts +49 -76
  143. package/lib/server/routes/api/enums.test.ts +2 -2
  144. package/lib/server/routes/api/functions.ts +9 -17
  145. package/lib/server/routes/api/index.ts +3 -6
  146. package/lib/server/routes/api/pages.ts +8 -11
  147. package/lib/server/routes/api/shared.test.ts +1 -1
  148. package/lib/server/routes/api/shared.ts +12 -9
  149. package/lib/server/routes/api/variables.test.ts +3 -5
  150. package/lib/server/routes/api/variables.ts +1 -1
  151. package/lib/server/routes/index.ts +25 -28
  152. package/lib/server/routes/pages.ts +35 -31
  153. package/lib/server/routes/static.ts +17 -6
  154. package/lib/server/runtime/bundler.ts +98 -61
  155. package/lib/server/runtime/fs.ts +16 -26
  156. package/lib/server/runtime/httpServer.ts +8 -12
  157. package/lib/server/services/ColorService.test.ts +3 -3
  158. package/lib/server/services/ColorService.ts +37 -29
  159. package/lib/server/services/EnumService.test.ts +4 -8
  160. package/lib/server/services/EnumService.ts +11 -3
  161. package/lib/server/services/VariableService.test.ts +8 -12
  162. package/lib/server/services/VariableService.ts +11 -3
  163. package/lib/server/services/cmsService.test.ts +158 -120
  164. package/lib/server/services/cmsService.ts +36 -146
  165. package/lib/server/services/componentService.test.ts +125 -45
  166. package/lib/server/services/componentService.ts +70 -46
  167. package/lib/server/services/configService.test.ts +22 -45
  168. package/lib/server/services/configService.ts +50 -27
  169. package/lib/server/services/fileWatcherService.ts +42 -8
  170. package/lib/server/services/index.ts +0 -1
  171. package/lib/server/services/pageService.test.ts +8 -10
  172. package/lib/server/services/pageService.ts +32 -18
  173. package/lib/server/ssr/attributeBuilder.ts +18 -8
  174. package/lib/server/ssr/buildErrorOverlay.ts +11 -12
  175. package/lib/server/ssr/clientDataInjector.ts +7 -21
  176. package/lib/server/ssr/cmsSSRProcessor.ts +4 -8
  177. package/lib/server/ssr/cssCollector.ts +1 -1
  178. package/lib/server/ssr/errorOverlay.test.ts +1 -1
  179. package/lib/server/ssr/errorOverlay.ts +3 -9
  180. package/lib/server/ssr/htmlGenerator.nonce.test.ts +9 -14
  181. package/lib/server/ssr/htmlGenerator.test.ts +120 -44
  182. package/lib/server/ssr/htmlGenerator.ts +126 -91
  183. package/lib/server/ssr/imageMetadata.test.ts +3 -1
  184. package/lib/server/ssr/imageMetadata.ts +27 -21
  185. package/lib/server/ssr/jsCollector.test.ts +8 -18
  186. package/lib/server/ssr/jsCollector.ts +3 -8
  187. package/lib/server/ssr/liveReloadIntegration.test.ts +76 -36
  188. package/lib/server/ssr/metaTagGenerator.ts +2 -2
  189. package/lib/server/ssr/ssrRenderer.branches.test.ts +1103 -0
  190. package/lib/server/ssr/ssrRenderer.test.ts +316 -256
  191. package/lib/server/ssr/ssrRenderer.ts +795 -243
  192. package/lib/server/ssrRenderer.test.ts +1048 -954
  193. package/lib/server/utils/jsonLineMapper.test.ts +28 -28
  194. package/lib/server/utils/jsonLineMapper.ts +7 -7
  195. package/lib/server/validateStyleCoverage.ts +18 -21
  196. package/lib/server/websocketManager.ts +28 -19
  197. package/lib/shared/attributeNodeUtils.test.ts +15 -15
  198. package/lib/shared/attributeNodeUtils.ts +5 -12
  199. package/lib/shared/breakpoints.test.ts +5 -5
  200. package/lib/shared/breakpoints.ts +4 -11
  201. package/lib/shared/cmsQuery.test.ts +81 -0
  202. package/lib/shared/cmsQuery.ts +92 -0
  203. package/lib/shared/cmsQueryParser.test.ts +50 -42
  204. package/lib/shared/cmsQueryParser.ts +60 -38
  205. package/lib/shared/colorConversions.ts +9 -9
  206. package/lib/shared/colorVariableUtils.test.ts +27 -5
  207. package/lib/shared/colorVariableUtils.ts +21 -12
  208. package/lib/shared/componentRefs.ts +1 -5
  209. package/lib/shared/constants.test.ts +3 -3
  210. package/lib/shared/constants.ts +8 -8
  211. package/lib/shared/cssGeneration.test.ts +285 -144
  212. package/lib/shared/cssGeneration.ts +217 -531
  213. package/lib/shared/cssNamedColors.ts +152 -30
  214. package/lib/shared/cssProperties.test.ts +69 -70
  215. package/lib/shared/cssProperties.ts +298 -114
  216. package/lib/shared/elementClassName.test.ts +109 -109
  217. package/lib/shared/elementClassName.ts +3 -3
  218. package/lib/shared/elementUtils.ts +12 -16
  219. package/lib/shared/errorLogger.test.ts +12 -12
  220. package/lib/shared/errorLogger.ts +2 -10
  221. package/lib/shared/errors.test.ts +2 -13
  222. package/lib/shared/errors.ts +2 -8
  223. package/lib/shared/expressionEvaluator.test.ts +145 -0
  224. package/lib/shared/expressionEvaluator.ts +52 -24
  225. package/lib/shared/fontLoader.test.ts +32 -18
  226. package/lib/shared/fontLoader.ts +2 -2
  227. package/lib/shared/friendlyError.ts +2 -3
  228. package/lib/shared/gradientUtils.test.ts +3 -7
  229. package/lib/shared/gradientUtils.ts +17 -14
  230. package/lib/shared/hrefRefs.test.ts +2 -2
  231. package/lib/shared/hrefRefs.ts +2 -10
  232. package/lib/shared/i18n.test.ts +4 -4
  233. package/lib/shared/i18n.ts +18 -38
  234. package/lib/shared/index.ts +27 -0
  235. package/lib/shared/inlineSvgStyleRules.ts +14 -13
  236. package/lib/shared/interactiveStyleMappings.test.ts +32 -54
  237. package/lib/shared/interactiveStyleMappings.ts +11 -24
  238. package/lib/shared/interactiveStyles.test.ts +165 -188
  239. package/lib/shared/interfaces/contentProvider.ts +1 -1
  240. package/lib/shared/itemTemplateUtils.test.ts +11 -17
  241. package/lib/shared/itemTemplateUtils.ts +27 -39
  242. package/lib/shared/jsonRepair.ts +16 -10
  243. package/lib/shared/libraryLoader.test.ts +21 -55
  244. package/lib/shared/libraryLoader.ts +7 -22
  245. package/lib/shared/linkUtils.ts +1 -1
  246. package/lib/shared/logger.test.ts +66 -0
  247. package/lib/shared/logger.ts +94 -0
  248. package/lib/shared/markdown.ts +25 -0
  249. package/lib/shared/netlifyLocale404.test.ts +179 -0
  250. package/lib/shared/netlifyLocale404.ts +110 -0
  251. package/lib/shared/nodeUtils.test.ts +28 -16
  252. package/lib/shared/nodeUtils.ts +76 -23
  253. package/lib/shared/pathArrayUtils.test.ts +1 -2
  254. package/lib/shared/pathArrayUtils.ts +1 -1
  255. package/lib/shared/pathSecurity.ts +2 -2
  256. package/lib/shared/pathUtils.test.ts +4 -6
  257. package/lib/shared/pathUtils.ts +42 -49
  258. package/lib/shared/paths/Path.test.ts +2 -2
  259. package/lib/shared/paths/Path.ts +0 -1
  260. package/lib/shared/paths/PathConverter.test.ts +1 -1
  261. package/lib/shared/paths/PathConverter.ts +17 -20
  262. package/lib/shared/paths/PathUtils.ts +13 -13
  263. package/lib/shared/paths/PathValidator.test.ts +2 -15
  264. package/lib/shared/paths/PathValidator.ts +12 -10
  265. package/lib/shared/paths/index.ts +1 -2
  266. package/lib/shared/permissions.test.ts +168 -0
  267. package/lib/shared/permissions.ts +162 -0
  268. package/lib/shared/propResolver.test.ts +240 -244
  269. package/lib/shared/propResolver.ts +15 -26
  270. package/lib/shared/pxToRem.test.ts +7 -6
  271. package/lib/shared/pxToRem.ts +2 -5
  272. package/lib/shared/registry/BaseNodeTypeRegistry.test.ts +12 -6
  273. package/lib/shared/registry/ClientRegistry.ts +0 -2
  274. package/lib/shared/registry/ComponentRegistry.test.ts +46 -32
  275. package/lib/shared/registry/ComponentRegistry.ts +12 -9
  276. package/lib/shared/registry/NodeTypeDefinition.ts +16 -9
  277. package/lib/shared/registry/RegistryManager.ts +1 -2
  278. package/lib/shared/registry/SSRRegistry.ts +0 -2
  279. package/lib/shared/registry/createNodeType.ts +7 -9
  280. package/lib/shared/registry/defineNodeType.ts +2 -6
  281. package/lib/shared/registry/fieldPresets.ts +3 -1
  282. package/lib/shared/registry/index.ts +0 -1
  283. package/lib/shared/registry/nodeTypes/ComponentInstanceNodeType.ts +14 -15
  284. package/lib/shared/registry/nodeTypes/CustomNodeType.ts +103 -0
  285. package/lib/shared/registry/nodeTypes/EmbedNodeType.ts +18 -11
  286. package/lib/shared/registry/nodeTypes/HtmlNodeType.ts +48 -19
  287. package/lib/shared/registry/nodeTypes/IslandNodeType.ts +129 -0
  288. package/lib/shared/registry/nodeTypes/LinkNodeType.ts +21 -19
  289. package/lib/shared/registry/nodeTypes/ListNodeType.ts +117 -77
  290. package/lib/shared/registry/nodeTypes/LocaleListNodeType.ts +27 -21
  291. package/lib/shared/registry/nodeTypes/MarkdownNodeType.ts +78 -0
  292. package/lib/shared/registry/nodeTypes/SlotMarkerType.ts +12 -8
  293. package/lib/shared/registry/nodeTypes/index.ts +26 -3
  294. package/lib/shared/responsiveScaling.test.ts +16 -34
  295. package/lib/shared/responsiveScaling.ts +61 -42
  296. package/lib/shared/responsiveStyleUtils.test.ts +0 -1
  297. package/lib/shared/responsiveStyleUtils.ts +11 -13
  298. package/lib/shared/richtext/htmlToTiptap.test.ts +139 -130
  299. package/lib/shared/richtext/htmlToTiptap.ts +2 -4
  300. package/lib/shared/richtext/tiptapToHtml.test.ts +5 -6
  301. package/lib/shared/richtext/types.ts +1 -8
  302. package/lib/shared/slugTranslator.test.ts +13 -13
  303. package/lib/shared/slugTranslator.ts +12 -16
  304. package/lib/shared/slugify.ts +9 -15
  305. package/lib/shared/styleNodeUtils.test.ts +8 -8
  306. package/lib/shared/styleNodeUtils.ts +18 -20
  307. package/lib/shared/styleUtils.test.ts +87 -61
  308. package/lib/shared/styleUtils.ts +5 -6
  309. package/lib/shared/themeDefaults.test.ts +11 -14
  310. package/lib/shared/themeDefaults.ts +3 -4
  311. package/lib/shared/tree/PathBuilder.test.ts +63 -145
  312. package/lib/shared/tree/PathBuilder.ts +59 -47
  313. package/lib/shared/treePathUtils.test.ts +51 -12
  314. package/lib/shared/treePathUtils.ts +91 -60
  315. package/lib/shared/types/api.ts +105 -8
  316. package/lib/shared/types/cms.test.ts +34 -0
  317. package/lib/shared/types/cms.ts +90 -34
  318. package/lib/shared/types/comment.ts +49 -16
  319. package/lib/shared/types/components.ts +51 -25
  320. package/lib/shared/types/errors.test.ts +1 -6
  321. package/lib/shared/types/errors.ts +3 -7
  322. package/lib/shared/types/experiments.ts +28 -28
  323. package/lib/shared/types/index.ts +25 -2
  324. package/lib/shared/types/permissions.ts +139 -0
  325. package/lib/shared/types/styles.ts +0 -1
  326. package/lib/shared/types/variables.test.ts +4 -13
  327. package/lib/shared/types/variables.ts +51 -30
  328. package/lib/shared/types.ts +1 -2
  329. package/lib/shared/utilityClassConfig.ts +751 -321
  330. package/lib/shared/utilityClassMapper.durability.test.ts +117 -0
  331. package/lib/shared/utilityClassMapper.test.ts +433 -95
  332. package/lib/shared/utilityClassMapper.ts +322 -249
  333. package/lib/shared/utilityClassNames.test.ts +38 -0
  334. package/lib/shared/utilityClassNames.ts +458 -0
  335. package/lib/shared/utils.test.ts +2 -10
  336. package/lib/shared/utils.ts +19 -10
  337. package/lib/shared/validation/cmsValidators.ts +2 -1
  338. package/lib/shared/validation/commentValidators.test.ts +53 -0
  339. package/lib/shared/validation/commentValidators.ts +12 -1
  340. package/lib/shared/validation/index.ts +1 -0
  341. package/lib/shared/validation/permissionsValidators.test.ts +49 -0
  342. package/lib/shared/validation/permissionsValidators.ts +49 -0
  343. package/lib/shared/validation/propValidator.test.ts +19 -21
  344. package/lib/shared/validation/propValidator.ts +13 -18
  345. package/lib/shared/validation/schemas.test.ts +64 -32
  346. package/lib/shared/validation/schemas.ts +616 -345
  347. package/lib/shared/validation/validators.test.ts +3 -8
  348. package/lib/shared/validation/validators.ts +89 -68
  349. package/lib/shared/viewportUnits.integration.test.ts +14 -10
  350. package/lib/shared/viewportUnits.test.ts +24 -23
  351. package/lib/shared/viewportUnits.ts +12 -5
  352. package/lib/test-utils/dom-setup.ts +1 -1
  353. package/lib/test-utils/factories/ConsoleMockFactory.ts +10 -14
  354. package/lib/test-utils/factories/DomMockFactory.ts +17 -23
  355. package/lib/test-utils/factories/EventMockFactory.ts +7 -13
  356. package/lib/test-utils/factories/FetchMockFactory.ts +39 -57
  357. package/lib/test-utils/factories/ServerMockFactory.ts +6 -10
  358. package/lib/test-utils/factories/StoreMockFactory.ts +18 -29
  359. package/lib/test-utils/fixtures.ts +45 -45
  360. package/lib/test-utils/helpers/asyncHelpers.test.ts +15 -18
  361. package/lib/test-utils/helpers/asyncHelpers.ts +11 -20
  362. package/lib/test-utils/helpers.ts +1 -5
  363. package/lib/test-utils/index.ts +0 -4
  364. package/lib/test-utils/mockFactories.ts +13 -19
  365. package/lib/test-utils/mocks.ts +6 -4
  366. package/package.json +3 -5
  367. package/scripts/build-for-publish.mjs +2 -4
  368. package/scripts/build-meno-filter.ts +4 -7
  369. package/tsconfig.json +1 -0
  370. package/vite.config.ts +4 -4
  371. package/build-next.ts +0 -1361
  372. package/build-static.test.ts +0 -424
  373. package/build-static.ts +0 -1074
  374. package/dist/build-static.js +0 -36
  375. package/dist/chunks/chunk-2MHDV5BF.js +0 -251
  376. package/dist/chunks/chunk-2MHDV5BF.js.map +0 -7
  377. package/dist/chunks/chunk-AZQYF6KE.js +0 -559
  378. package/dist/chunks/chunk-AZQYF6KE.js.map +0 -7
  379. package/dist/chunks/chunk-GZHGVVW3.js +0 -322
  380. package/dist/chunks/chunk-GZHGVVW3.js.map +0 -7
  381. package/dist/chunks/chunk-H3GJ4H2U.js.map +0 -7
  382. package/dist/chunks/chunk-I7YIGZXT.js +0 -467
  383. package/dist/chunks/chunk-I7YIGZXT.js.map +0 -7
  384. package/dist/chunks/chunk-IGYR22T6.js +0 -6192
  385. package/dist/chunks/chunk-IGYR22T6.js.map +0 -7
  386. package/dist/chunks/chunk-JGP5A3Y5.js +0 -1136
  387. package/dist/chunks/chunk-JGP5A3Y5.js.map +0 -7
  388. package/dist/chunks/chunk-JGWFTO6P.js.map +0 -7
  389. package/dist/chunks/chunk-O3NAGJP4.js.map +0 -7
  390. package/dist/chunks/chunk-QB2LNO4W.js +0 -77
  391. package/dist/chunks/chunk-QB2LNO4W.js.map +0 -7
  392. package/dist/chunks/chunk-R6XHAFBF.js +0 -3821
  393. package/dist/chunks/chunk-R6XHAFBF.js.map +0 -7
  394. package/dist/chunks/chunk-UB44F4Z2.js.map +0 -7
  395. package/dist/chunks/chunk-WQFG7PAH.js.map +0 -7
  396. package/dist/chunks/chunk-X754AHS5.js.map +0 -7
  397. package/dist/chunks/chunk-YBLHKYFF.js.map +0 -7
  398. package/dist/chunks/configService-R3OGU2UD.js +0 -13
  399. package/dist/chunks/configService-R3OGU2UD.js.map +0 -7
  400. package/dist/chunks/constants-STK2YBIW.js +0 -46
  401. package/dist/chunks/constants-STK2YBIW.js.map +0 -7
  402. package/dist/chunks/fs-JGINUXGL.js.map +0 -7
  403. package/dist/entries/server-router.js +0 -67
  404. package/dist/entries/server-router.js.map +0 -7
  405. package/entries/server-router.tsx +0 -81
  406. package/lib/server/providers/fileSystemPageProvider.ts +0 -160
  407. package/lib/server/webflow/buildWebflow.ts +0 -635
  408. package/lib/server/webflow/index.ts +0 -23
  409. package/lib/server/webflow/nodeToWebflow.test.ts +0 -3170
  410. package/lib/server/webflow/nodeToWebflow.ts +0 -2435
  411. package/lib/server/webflow/styleMapper.test.ts +0 -389
  412. package/lib/server/webflow/styleMapper.ts +0 -695
  413. package/lib/server/webflow/templateWrapper.ts +0 -49
  414. package/lib/server/webflow/types.ts +0 -396
  415. /package/dist/{build-static.js.map → chunks/fs-G3ANWEFP.js.map} +0 -0
@@ -10,9 +10,7 @@ import type { I18nValue, I18nConfig, LocaleConfig } from './types/components';
10
10
  */
11
11
  export const DEFAULT_I18N_CONFIG: I18nConfig = {
12
12
  defaultLocale: 'en',
13
- locales: [
14
- { code: 'en', name: 'English', nativeName: 'English', langTag: 'en-US' }
15
- ],
13
+ locales: [{ code: 'en', name: 'English', nativeName: 'English', langTag: 'en-US' }],
16
14
  };
17
15
 
18
16
  // ============================================
@@ -23,21 +21,21 @@ export const DEFAULT_I18N_CONFIG: I18nConfig = {
23
21
  * Get array of locale codes from config
24
22
  */
25
23
  export function getLocaleCodes(config: I18nConfig): string[] {
26
- return config.locales.map(loc => loc.code);
24
+ return config.locales.map((loc) => loc.code);
27
25
  }
28
26
 
29
27
  /**
30
28
  * Find a locale config by its code
31
29
  */
32
30
  export function findLocaleByCode(config: I18nConfig, code: string): LocaleConfig | undefined {
33
- return config.locales.find(loc => loc.code === code);
31
+ return config.locales.find((loc) => loc.code === code);
34
32
  }
35
33
 
36
34
  /**
37
35
  * Check if a locale code is valid/exists in config
38
36
  */
39
37
  export function isValidLocaleCode(config: I18nConfig, code: string): boolean {
40
- return config.locales.some(loc => loc.code === code);
38
+ return config.locales.some((loc) => loc.code === code);
41
39
  }
42
40
 
43
41
  // ============================================
@@ -112,11 +110,7 @@ export function isI18nValue(value: unknown): value is I18nValue {
112
110
  * Fallback order: exact locale -> default locale -> first available -> empty
113
111
  * Works with any value type (strings, arrays for list props, etc.)
114
112
  */
115
- export function resolveTranslation(
116
- value: I18nValue,
117
- locale: string,
118
- config: I18nConfig
119
- ): unknown {
113
+ export function resolveTranslation(value: I18nValue, locale: string, config: I18nConfig): unknown {
120
114
  // Try exact locale match (any type - string, array, etc.)
121
115
  if (locale in value && value[locale] !== undefined && locale !== '_i18n') {
122
116
  return value[locale];
@@ -136,9 +130,7 @@ export function resolveTranslation(
136
130
 
137
131
  // Return empty string for string i18n, empty array for list i18n
138
132
  // Check if any value is an array to determine the type
139
- const hasArrayValue = Object.entries(value).some(
140
- ([k, v]) => k !== '_i18n' && Array.isArray(v)
141
- );
133
+ const hasArrayValue = Object.entries(value).some(([k, v]) => k !== '_i18n' && Array.isArray(v));
142
134
  return hasArrayValue ? [] : '';
143
135
  }
144
136
 
@@ -146,11 +138,7 @@ export function resolveTranslation(
146
138
  * Resolve a value that might be an I18nValue or a regular value
147
139
  * Returns the original value if not an I18nValue
148
140
  */
149
- export function resolveI18nValue(
150
- value: unknown,
151
- locale: string,
152
- config: I18nConfig
153
- ): unknown {
141
+ export function resolveI18nValue(value: unknown, locale: string, config: I18nConfig): unknown {
154
142
  if (isI18nValue(value)) {
155
143
  return resolveTranslation(value, locale, config);
156
144
  }
@@ -163,7 +151,7 @@ export function resolveI18nValue(
163
151
  export function resolveI18nInProps(
164
152
  props: Record<string, unknown>,
165
153
  locale: string,
166
- config: I18nConfig
154
+ config: I18nConfig,
167
155
  ): Record<string, unknown> {
168
156
  const resolved: Record<string, unknown> = {};
169
157
 
@@ -171,16 +159,10 @@ export function resolveI18nInProps(
171
159
  if (isI18nValue(value)) {
172
160
  resolved[key] = resolveTranslation(value, locale, config);
173
161
  } else if (Array.isArray(value)) {
174
- resolved[key] = value.map((item) =>
175
- isI18nValue(item) ? resolveTranslation(item, locale, config) : item
176
- );
162
+ resolved[key] = value.map((item) => (isI18nValue(item) ? resolveTranslation(item, locale, config) : item));
177
163
  } else if (typeof value === 'object' && value !== null) {
178
164
  // Recursively resolve nested objects (but not I18nValue which is already handled)
179
- resolved[key] = resolveI18nInProps(
180
- value as Record<string, unknown>,
181
- locale,
182
- config
183
- );
165
+ resolved[key] = resolveI18nInProps(value as Record<string, unknown>, locale, config);
184
166
  } else {
185
167
  resolved[key] = value;
186
168
  }
@@ -195,15 +177,16 @@ export function resolveI18nInProps(
195
177
  */
196
178
  export function extractLocaleFromPath(
197
179
  path: string,
198
- config: I18nConfig
180
+ config: I18nConfig,
199
181
  ): { locale: string | null; pathWithoutLocale: string } {
200
182
  // Remove leading slash and split
201
183
  const cleanPath = path.startsWith('/') ? path.slice(1) : path;
202
184
  const segments = cleanPath.split('/');
203
185
 
204
- if (segments.length > 0 && isValidLocaleCode(config, segments[0])) {
205
- const locale = segments[0];
206
- const pathWithoutLocale = '/' + segments.slice(1).join('/');
186
+ const firstSegment = segments[0];
187
+ if (firstSegment !== undefined && isValidLocaleCode(config, firstSegment)) {
188
+ const locale = firstSegment;
189
+ const pathWithoutLocale = `/${segments.slice(1).join('/')}`;
207
190
  return { locale, pathWithoutLocale: pathWithoutLocale || '/' };
208
191
  }
209
192
 
@@ -215,7 +198,7 @@ export function extractLocaleFromPath(
215
198
  * e.g., ('/about', 'pl') -> '/pl/about'
216
199
  */
217
200
  export function buildLocalizedPath(path: string, locale: string): string {
218
- const cleanPath = path.startsWith('/') ? path : '/' + path;
201
+ const cleanPath = path.startsWith('/') ? path : `/${path}`;
219
202
  return `/${locale}${cleanPath === '/' ? '' : cleanPath}`;
220
203
  }
221
204
 
@@ -235,17 +218,14 @@ export interface LocaleContext {
235
218
  * Parse locale from path and return full context with effective locale
236
219
  * Combines extractLocaleFromPath + defaultLocale resolution in one call
237
220
  */
238
- export function parseLocaleFromPath(
239
- path: string,
240
- config: I18nConfig
241
- ): LocaleContext {
221
+ export function parseLocaleFromPath(path: string, config: I18nConfig): LocaleContext {
242
222
  const { locale, pathWithoutLocale } = extractLocaleFromPath(path, config);
243
223
  const effectiveLocale = locale || config.defaultLocale;
244
224
 
245
225
  return {
246
226
  locale: effectiveLocale,
247
227
  pathWithoutLocale,
248
- isDefaultLocale: effectiveLocale === config.defaultLocale
228
+ isDefaultLocale: effectiveLocale === config.defaultLocale,
249
229
  };
250
230
  }
251
231
 
@@ -26,6 +26,10 @@ export * from './viewportUnits';
26
26
  export * from './colorProperties';
27
27
  export * from './cssNamedColors';
28
28
  export * from './utilityClassMapper';
29
+ export { splitVariantPrefix, normalizeBreakpointVariant } from './utilityClassNames';
30
+ // Utility-class catalog pieces — the seed for the Styles panel's class-bar autocomplete (§13 Phase 5).
31
+ // Selective (not `export *`) to keep the barrel collision-free.
32
+ export { propertyMap, staticUtilityReverse, keywordValues, presetClassReverse } from './utilityClassConfig';
29
33
  export * from './elementClassName';
30
34
  export * from './styleValueRegistry';
31
35
 
@@ -86,8 +90,17 @@ export {
86
90
  CommentThreadEntrySchema,
87
91
  CommentNodeIdentitySchema,
88
92
  validateComment,
93
+ // Permissions validators
94
+ PermissionRoleSchema,
95
+ PermissionRuleSchema,
96
+ PermissionGrantSchema,
97
+ PermissionsPolicySchema,
98
+ validatePermissionsPolicy,
89
99
  } from './validation';
90
100
 
101
+ // Permission resolver (pure)
102
+ export * from './permissions';
103
+
91
104
  // Utils
92
105
  export * from './utils';
93
106
 
@@ -116,6 +129,10 @@ export { isSupportedTemplateExpression } from './expressionEvaluator';
116
129
  // Path security utilities
117
130
  export * from './pathSecurity';
118
131
 
132
+ // Netlify locale-scoped 404 rules + the managed netlify.toml block (shared by
133
+ // every netlify.toml producer and the studio save-config sync)
134
+ export * from './netlifyLocale404';
135
+
119
136
  // Interactive style mapping utilities
120
137
  export * from './interactiveStyleMappings';
121
138
 
@@ -126,6 +143,16 @@ export * from './richtext';
126
143
  export * from './errors';
127
144
  export * from './friendlyError';
128
145
  export { logRuntimeError, logNetworkError, setErrorHandler } from './errorLogger';
146
+ export {
147
+ createLogger,
148
+ logger,
149
+ setLogLevel,
150
+ getLogLevel,
151
+ setLogSink,
152
+ type Logger,
153
+ type LogLevel,
154
+ type LogRecord,
155
+ } from './logger';
129
156
 
130
157
  // Global template context
131
158
  export * from './globalTemplateContext';
@@ -53,29 +53,30 @@ function rewriteSvgBlock(svgBlock: string): string {
53
53
  const classDeclarations = new Map<string, string>();
54
54
  const styleBlocksHandled: string[] = [];
55
55
 
56
- let m: RegExpExecArray | null;
57
- while ((m = styleBlockRe.exec(svgBlock)) !== null) {
56
+ let m: RegExpExecArray | null = styleBlockRe.exec(svgBlock);
57
+ while (m !== null) {
58
58
  const fullStyleTag = m[0];
59
- const rawContent = m[1];
59
+ const rawContent = m[1] ?? '';
60
+ m = styleBlockRe.exec(svgBlock);
60
61
  // Strip CDATA wrapper if present (DOMPurify already unwraps it, but the
61
62
  // pre-sanitize call path may see one).
62
- const content = stripCssComments(
63
- rawContent.replace(/^\s*<!\[CDATA\[/, '').replace(/\]\]>\s*$/, '')
64
- );
63
+ const content = stripCssComments(rawContent.replace(/^\s*<!\[CDATA\[/, '').replace(/\]\]>\s*$/, ''));
65
64
 
66
65
  // Pull out every simple `.cls { ... }` rule we can match.
67
66
  const localClasses = new Map<string, string>();
68
67
  let remaining = content;
69
- let ruleMatch: RegExpExecArray | null;
70
68
  const ruleRe = new RegExp(RULE_RE.source, 'g');
71
- while ((ruleMatch = ruleRe.exec(content)) !== null) {
72
- const className = ruleMatch[1];
73
- const body = ruleMatch[2].trim().replace(/;\s*$/, '');
69
+ let ruleMatch: RegExpExecArray | null = ruleRe.exec(content);
70
+ while (ruleMatch !== null) {
71
+ const className = ruleMatch[1] ?? '';
72
+ const body = (ruleMatch[2] ?? '').trim().replace(/;\s*$/, '');
73
+ const matchedRule = ruleMatch[0];
74
+ ruleMatch = ruleRe.exec(content);
74
75
  // Skip rules whose body contains a `{` — that means we mis-bracketed.
75
76
  if (body.includes('{')) continue;
76
77
  const prev = localClasses.get(className);
77
78
  localClasses.set(className, prev ? mergeIntoStyleAttr(prev, body) : body);
78
- remaining = remaining.replace(ruleMatch[0], '');
79
+ remaining = remaining.replace(matchedRule, '');
79
80
  }
80
81
 
81
82
  // If anything non-trivial is left in the <style> body, leave the block
@@ -99,12 +100,12 @@ function rewriteSvgBlock(svgBlock: string): string {
99
100
  for (const [className, decls] of classDeclarations) {
100
101
  const elementRe = new RegExp(
101
102
  `(<[A-Za-z][\\w-]*\\b[^>]*?\\sclass="[^"]*\\b${escapeForRegex(className)}\\b[^"]*"[^>]*?)(/?>)`,
102
- 'g'
103
+ 'g',
103
104
  );
104
105
  out = out.replace(elementRe, (_full, openHead: string, closing: string) => {
105
106
  const styleAttrMatch = openHead.match(/\sstyle="([^"]*)"/);
106
107
  if (styleAttrMatch) {
107
- const merged = mergeIntoStyleAttr(styleAttrMatch[1], decls);
108
+ const merged = mergeIntoStyleAttr(styleAttrMatch[1] ?? '', decls);
108
109
  return openHead.replace(/\sstyle="[^"]*"/, ` style="${merged}"`) + closing;
109
110
  }
110
111
  return `${openHead} style="${decls}"${closing}`;
@@ -46,9 +46,7 @@ describe('interactiveStyleMappings', () => {
46
46
  });
47
47
 
48
48
  it('returns false when no mappings present', () => {
49
- const styles: InteractiveStyles = [
50
- { postfix: ':hover', style: { base: { backgroundColor: '#0070f3' } } },
51
- ];
49
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: '#0070f3' } } }];
52
50
  expect(hasInteractiveStyleMappings(styles)).toBe(false);
53
51
  });
54
52
 
@@ -89,9 +87,7 @@ describe('interactiveStyleMappings', () => {
89
87
 
90
88
  describe('extractInteractiveStyleMappings', () => {
91
89
  it('returns unchanged styles when no mappings', () => {
92
- const styles: InteractiveStyles = [
93
- { postfix: ':hover', style: { base: { backgroundColor: '#0070f3' } } },
94
- ];
90
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: '#0070f3' } } }];
95
91
 
96
92
  const { resolvedStyles, mappings } = extractInteractiveStyleMappings(styles);
97
93
 
@@ -106,9 +102,7 @@ describe('interactiveStyleMappings', () => {
106
102
  values: { primary: '#0070f3', secondary: '#gray' },
107
103
  };
108
104
 
109
- const styles: InteractiveStyles = [
110
- { postfix: ':hover', style: { backgroundColor: mapping } },
111
- ];
105
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { backgroundColor: mapping } }];
112
106
 
113
107
  const { resolvedStyles, mappings } = extractInteractiveStyleMappings(styles);
114
108
 
@@ -121,7 +115,7 @@ describe('interactiveStyleMappings', () => {
121
115
  variableIndex: 0,
122
116
  });
123
117
 
124
- expect(resolvedStyles[0].style).toEqual({
118
+ expect(resolvedStyles[0]!.style).toEqual({
125
119
  backgroundColor: 'var(--is-0)',
126
120
  });
127
121
  });
@@ -133,17 +127,15 @@ describe('interactiveStyleMappings', () => {
133
127
  values: { primary: '#0070f3' },
134
128
  };
135
129
 
136
- const styles: InteractiveStyles = [
137
- { postfix: ':hover', style: { base: { backgroundColor: mapping } } },
138
- ];
130
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: mapping } } }];
139
131
 
140
132
  const { resolvedStyles, mappings } = extractInteractiveStyleMappings(styles);
141
133
 
142
134
  expect(mappings).toHaveLength(1);
143
- expect(mappings[0].breakpoint).toBe('base');
144
- expect(mappings[0].variableIndex).toBe(0);
135
+ expect(mappings[0]!.breakpoint).toBe('base');
136
+ expect(mappings[0]!.variableIndex).toBe(0);
145
137
 
146
- expect((resolvedStyles[0].style as any).base).toEqual({
138
+ expect((resolvedStyles[0]!.style as any).base).toEqual({
147
139
  backgroundColor: 'var(--is-0)',
148
140
  });
149
141
  });
@@ -179,14 +171,14 @@ describe('interactiveStyleMappings', () => {
179
171
  const { resolvedStyles, mappings } = extractInteractiveStyleMappings(styles);
180
172
 
181
173
  expect(mappings).toHaveLength(3);
182
- expect(mappings[0].breakpoint).toBe('base');
183
- expect(mappings[0].variableIndex).toBe(0);
184
- expect(mappings[1].breakpoint).toBe('tablet');
185
- expect(mappings[1].variableIndex).toBe(1);
186
- expect(mappings[2].breakpoint).toBe('mobile');
187
- expect(mappings[2].variableIndex).toBe(2);
188
-
189
- const resolved = resolvedStyles[0].style as any;
174
+ expect(mappings[0]!.breakpoint).toBe('base');
175
+ expect(mappings[0]!.variableIndex).toBe(0);
176
+ expect(mappings[1]!.breakpoint).toBe('tablet');
177
+ expect(mappings[1]!.variableIndex).toBe(1);
178
+ expect(mappings[2]!.breakpoint).toBe('mobile');
179
+ expect(mappings[2]!.variableIndex).toBe(2);
180
+
181
+ const resolved = resolvedStyles[0]!.style as any;
190
182
  expect(resolved.base.backgroundColor).toBe('var(--is-0)');
191
183
  expect(resolved.tablet.backgroundColor).toBe('var(--is-1)');
192
184
  expect(resolved.mobile.backgroundColor).toBe('var(--is-2)');
@@ -216,7 +208,7 @@ describe('interactiveStyleMappings', () => {
216
208
  expect(mappings).toHaveLength(2);
217
209
  // Note: order depends on Object.entries iteration order
218
210
 
219
- const resolved = resolvedStyles[0].style as any;
211
+ const resolved = resolvedStyles[0]!.style as any;
220
212
  expect(resolved.base.backgroundColor).toMatch(/var\(--is-\d+\)/);
221
213
  expect(resolved.base.color).toMatch(/var\(--is-\d+\)/);
222
214
  });
@@ -245,7 +237,7 @@ describe('interactiveStyleMappings', () => {
245
237
 
246
238
  expect(mappings).toHaveLength(1);
247
239
 
248
- const resolved = resolvedStyles[0].style as any;
240
+ const resolved = resolvedStyles[0]!.style as any;
249
241
  expect(resolved.base.backgroundColor).toBe('var(--is-0)');
250
242
  expect(resolved.base.transform).toBe('scale(1.05)');
251
243
  expect(resolved.base.opacity).toBe('0.9');
@@ -271,13 +263,13 @@ describe('interactiveStyleMappings', () => {
271
263
  const { resolvedStyles, mappings } = extractInteractiveStyleMappings(styles);
272
264
 
273
265
  expect(mappings).toHaveLength(2);
274
- expect(mappings[0].ruleIndex).toBe(0);
275
- expect(mappings[0].variableIndex).toBe(0);
276
- expect(mappings[1].ruleIndex).toBe(1);
277
- expect(mappings[1].variableIndex).toBe(1);
266
+ expect(mappings[0]!.ruleIndex).toBe(0);
267
+ expect(mappings[0]!.variableIndex).toBe(0);
268
+ expect(mappings[1]!.ruleIndex).toBe(1);
269
+ expect(mappings[1]!.variableIndex).toBe(1);
278
270
 
279
- expect((resolvedStyles[0].style as any).base.backgroundColor).toBe('var(--is-0)');
280
- expect((resolvedStyles[1].style as any).base.backgroundColor).toBe('var(--is-1)');
271
+ expect((resolvedStyles[0]!.style as any).base.backgroundColor).toBe('var(--is-0)');
272
+ expect((resolvedStyles[1]!.style as any).base.backgroundColor).toBe('var(--is-1)');
281
273
  });
282
274
 
283
275
  it('preserves postfix in resolved styles', () => {
@@ -287,13 +279,11 @@ describe('interactiveStyleMappings', () => {
287
279
  values: { primary: '#0070f3' },
288
280
  };
289
281
 
290
- const styles: InteractiveStyles = [
291
- { postfix: ':hover', style: { base: { backgroundColor: mapping } } },
292
- ];
282
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: mapping } } }];
293
283
 
294
284
  const { resolvedStyles } = extractInteractiveStyleMappings(styles);
295
285
 
296
- expect(resolvedStyles[0].postfix).toBe(':hover');
286
+ expect(resolvedStyles[0]!.postfix).toBe(':hover');
297
287
  });
298
288
  });
299
289
 
@@ -305,9 +295,7 @@ describe('interactiveStyleMappings', () => {
305
295
  values: { primary: '#0070f3', secondary: '#gray' },
306
296
  };
307
297
 
308
- const styles: InteractiveStyles = [
309
- { postfix: ':hover', style: { base: { backgroundColor: mapping } } },
310
- ];
298
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: mapping } } }];
311
299
 
312
300
  const { mappings } = extractInteractiveStyleMappings(styles);
313
301
  const cssVariables = resolveExtractedMappings(mappings, { variant: 'primary' });
@@ -351,9 +339,7 @@ describe('interactiveStyleMappings', () => {
351
339
  values: { primary: '#0070f3', secondary: '#gray' },
352
340
  };
353
341
 
354
- const styles: InteractiveStyles = [
355
- { postfix: ':hover', style: { base: { backgroundColor: mapping } } },
356
- ];
342
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: mapping } } }];
357
343
 
358
344
  const { mappings } = extractInteractiveStyleMappings(styles);
359
345
  const cssVariables = resolveExtractedMappings(mappings, { variant: 'purple' });
@@ -368,9 +354,7 @@ describe('interactiveStyleMappings', () => {
368
354
  values: { primary: '#0070f3' },
369
355
  };
370
356
 
371
- const styles: InteractiveStyles = [
372
- { postfix: ':hover', style: { base: { backgroundColor: mapping } } },
373
- ];
357
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: mapping } } }];
374
358
 
375
359
  const { mappings } = extractInteractiveStyleMappings(styles);
376
360
  const cssVariables = resolveExtractedMappings(mappings, {});
@@ -385,9 +369,7 @@ describe('interactiveStyleMappings', () => {
385
369
  values: { primary: '#0070f3' },
386
370
  };
387
371
 
388
- const styles: InteractiveStyles = [
389
- { postfix: ':hover', style: { base: { backgroundColor: mapping } } },
390
- ];
372
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { backgroundColor: mapping } } }];
391
373
 
392
374
  const { mappings } = extractInteractiveStyleMappings(styles);
393
375
  const cssVariables = resolveExtractedMappings(mappings, { variant: null });
@@ -402,9 +384,7 @@ describe('interactiveStyleMappings', () => {
402
384
  values: { true: '0.5', false: '1' },
403
385
  };
404
386
 
405
- const styles: InteractiveStyles = [
406
- { postfix: ':hover', style: { base: { opacity: mapping } } },
407
- ];
387
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { opacity: mapping } } }];
408
388
 
409
389
  const { mappings } = extractInteractiveStyleMappings(styles);
410
390
  const cssVariables = resolveExtractedMappings(mappings, { disabled: true });
@@ -419,9 +399,7 @@ describe('interactiveStyleMappings', () => {
419
399
  values: { '1': '10px', '2': '20px', '3': '30px' },
420
400
  };
421
401
 
422
- const styles: InteractiveStyles = [
423
- { postfix: ':hover', style: { base: { padding: mapping } } },
424
- ];
402
+ const styles: InteractiveStyles = [{ postfix: ':hover', style: { base: { padding: mapping } } }];
425
403
 
426
404
  const { mappings } = extractInteractiveStyleMappings(styles);
427
405
  const cssVariables = resolveExtractedMappings(mappings, { size: 2 });
@@ -12,13 +12,7 @@
12
12
  * // resolvedStyles[0].style.base.backgroundColor === 'var(--is-0)'
13
13
  */
14
14
 
15
- import type {
16
- InteractiveStyles,
17
- InteractiveStyleRule,
18
- StyleMapping,
19
- StyleObject,
20
- ResponsiveStyleObject,
21
- } from './types/styles';
15
+ import type { InteractiveStyles, StyleMapping, StyleObject, ResponsiveStyleObject } from './types/styles';
22
16
  import type { PropDefinition } from './types/components';
23
17
 
24
18
  /**
@@ -26,10 +20,7 @@ import type { PropDefinition } from './types/components';
26
20
  */
27
21
  export function isStyleMapping(value: unknown): value is StyleMapping {
28
22
  return (
29
- typeof value === 'object' &&
30
- value !== null &&
31
- '_mapping' in value &&
32
- (value as StyleMapping)._mapping === true
23
+ typeof value === 'object' && value !== null && '_mapping' in value && (value as StyleMapping)._mapping === true
33
24
  );
34
25
  }
35
26
 
@@ -72,9 +63,8 @@ export function getVariableName(index: number): string {
72
63
  */
73
64
  function hasAnyMappings(style: StyleObject | ResponsiveStyleObject): boolean {
74
65
  // Check if it's a responsive style (has 'base' or known breakpoint keys)
75
- const isResponsive = 'base' in style || Object.keys(style).some(key =>
76
- key === 'base' || key === 'tablet' || key === 'mobile'
77
- );
66
+ const isResponsive =
67
+ 'base' in style || Object.keys(style).some((key) => key === 'base' || key === 'tablet' || key === 'mobile');
78
68
 
79
69
  if (isResponsive) {
80
70
  const responsive = style as ResponsiveStyleObject;
@@ -111,9 +101,7 @@ export function hasInteractiveStyleMappings(interactiveStyles: InteractiveStyles
111
101
  * @param interactiveStyles - Array of interactive style rules
112
102
  * @returns Object with resolved styles (var() references) and extracted mappings
113
103
  */
114
- export function extractInteractiveStyleMappings(
115
- interactiveStyles: InteractiveStyles
116
- ): ExtractionResult {
104
+ export function extractInteractiveStyleMappings(interactiveStyles: InteractiveStyles): ExtractionResult {
117
105
  const mappings: ExtractedMapping[] = [];
118
106
  let variableIndex = 0;
119
107
 
@@ -121,9 +109,8 @@ export function extractInteractiveStyleMappings(
121
109
  const style = rule.style;
122
110
 
123
111
  // Check if it's a responsive style
124
- const isResponsive = 'base' in style || Object.keys(style).some(key =>
125
- key === 'base' || key === 'tablet' || key === 'mobile'
126
- );
112
+ const isResponsive =
113
+ 'base' in style || Object.keys(style).some((key) => key === 'base' || key === 'tablet' || key === 'mobile');
127
114
 
128
115
  if (isResponsive) {
129
116
  const responsive = style as ResponsiveStyleObject;
@@ -203,7 +190,7 @@ export function extractInteractiveStyleMappings(
203
190
  */
204
191
  export function resolveExtractedMappings(
205
192
  mappings: ExtractedMapping[],
206
- props: Record<string, unknown>
193
+ props: Record<string, unknown>,
207
194
  ): Record<string, string> {
208
195
  const cssVariables: Record<string, string> = {};
209
196
 
@@ -250,7 +237,7 @@ export function resolveExtractedMappings(
250
237
  */
251
238
  export function createStyleMappingFromProps(
252
239
  componentPropDefs: Record<string, PropDefinition>,
253
- currentValue: string | number
240
+ currentValue: string | number,
254
241
  ): StyleMapping | null {
255
242
  // Find a prop to map to (prefer 'variant' if it exists, otherwise use first prop)
256
243
  const propToMap = componentPropDefs.variant ? 'variant' : Object.keys(componentPropDefs)[0];
@@ -273,12 +260,12 @@ export function createStyleMappingFromProps(
273
260
  });
274
261
  } else {
275
262
  // No options, create a default mapping
276
- mappingValues['default'] = currentValue;
263
+ mappingValues.default = currentValue;
277
264
  }
278
265
 
279
266
  return {
280
267
  _mapping: true,
281
268
  prop: propToMap,
282
- values: mappingValues
269
+ values: mappingValues,
283
270
  };
284
271
  }