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.
- package/.claude/settings.local.json +1 -3
- package/bin/cli.ts +66 -261
- package/build-astro.ts +150 -128
- package/dist/bin/cli.js +42 -185
- package/dist/bin/cli.js.map +2 -2
- package/dist/chunks/chunk-2AR55GYH.js +42 -0
- package/dist/chunks/chunk-2AR55GYH.js.map +7 -0
- package/dist/chunks/{chunk-JGWFTO6P.js → chunk-2IIQK7T3.js} +2624 -1389
- package/dist/chunks/chunk-2IIQK7T3.js.map +7 -0
- package/dist/chunks/chunk-4ZRU52J2.js +169 -0
- package/dist/chunks/chunk-4ZRU52J2.js.map +7 -0
- package/dist/chunks/{chunk-UB44F4Z2.js → chunk-5X4HCN7J.js} +5 -7
- package/dist/chunks/chunk-5X4HCN7J.js.map +7 -0
- package/dist/chunks/{chunk-WQFG7PAH.js → chunk-7CCVOL5M.js} +15 -19
- package/dist/chunks/chunk-7CCVOL5M.js.map +7 -0
- package/dist/chunks/{chunk-YBLHKYFF.js → chunk-AR7LHIFY.js} +8 -2
- package/dist/chunks/chunk-AR7LHIFY.js.map +7 -0
- package/dist/chunks/{chunk-O3NAGJP4.js → chunk-NUP7H7D3.js} +135 -41
- package/dist/chunks/chunk-NUP7H7D3.js.map +7 -0
- package/dist/chunks/{chunk-X754AHS5.js → chunk-QWTQZHG3.js} +194 -90
- package/dist/chunks/chunk-QWTQZHG3.js.map +7 -0
- package/dist/chunks/{chunk-H3GJ4H2U.js → chunk-XTKNX4FW.js} +216 -87
- package/dist/chunks/chunk-XTKNX4FW.js.map +7 -0
- package/dist/chunks/{fs-JGINUXGL.js → fs-G3ANWEFP.js} +2 -2
- package/dist/lib/client/index.js +1003 -475
- package/dist/lib/client/index.js.map +3 -3
- package/dist/lib/server/index.js +14393 -6371
- package/dist/lib/server/index.js.map +4 -4
- package/dist/lib/shared/index.js +342 -101
- package/dist/lib/shared/index.js.map +4 -4
- package/dist/lib/shared/richtext/index.js +1 -1
- package/dist/lib/test-utils/index.js +64 -80
- package/dist/lib/test-utils/index.js.map +2 -2
- package/entries/client-router.tsx +10 -8
- package/lib/client/ClientInitializer.ts +8 -8
- package/lib/client/ErrorBoundary.test.tsx +246 -186
- package/lib/client/ErrorBoundary.tsx +183 -132
- package/lib/client/componentRegistry.test.ts +96 -108
- package/lib/client/componentRegistry.ts +1 -3
- package/lib/client/contexts/ThemeContext.tsx +3 -2
- package/lib/client/core/ComponentBuilder.test.ts +663 -560
- package/lib/client/core/ComponentBuilder.ts +427 -155
- package/lib/client/core/ComponentRenderer.test.tsx +2 -4
- package/lib/client/core/ComponentRenderer.tsx +46 -33
- package/lib/client/core/builders/embedBuilder.ts +242 -54
- package/lib/client/core/builders/linkBuilder.ts +72 -45
- package/lib/client/core/builders/linkNodeBuilder.ts +79 -54
- package/lib/client/core/builders/listBuilder.ts +155 -89
- package/lib/client/core/builders/localeListBuilder.ts +97 -62
- package/lib/client/core/builders/types.ts +5 -5
- package/lib/client/core/cmsTemplateProcessor.ts +8 -9
- package/lib/client/elementRegistry.ts +3 -3
- package/lib/client/fontFamiliesService.test.ts +2 -10
- package/lib/client/fontFamiliesService.ts +3 -3
- package/lib/client/hmr/HMRManager.tsx +47 -30
- package/lib/client/hmrCssReload.ts +49 -14
- package/lib/client/hmrWebSocket.ts +14 -19
- package/lib/client/hooks/useColorVariables.test.ts +21 -21
- package/lib/client/hooks/useColorVariables.ts +23 -18
- package/lib/client/hooks/usePropertyAutocomplete.ts +4 -6
- package/lib/client/hooks/useVariables.ts +6 -4
- package/lib/client/hydration/HydrationUtils.test.ts +24 -25
- package/lib/client/hydration/HydrationUtils.ts +3 -4
- package/lib/client/i18nConfigService.test.ts +2 -7
- package/lib/client/i18nConfigService.ts +2 -2
- package/lib/client/meno-filter/MenoFilter.test.ts +47 -49
- package/lib/client/meno-filter/MenoFilter.ts +14 -15
- package/lib/client/meno-filter/bindings.ts +18 -43
- package/lib/client/meno-filter/init.ts +4 -4
- package/lib/client/meno-filter/renderer.ts +30 -32
- package/lib/client/meno-filter/script.generated.ts +1 -3
- package/lib/client/meno-filter/ui.ts +4 -6
- package/lib/client/meno-filter/updates.ts +18 -23
- package/lib/client/meno-filter/utils.ts +1 -1
- package/lib/client/navigation.test.ts +174 -178
- package/lib/client/navigation.ts +0 -1
- package/lib/client/responsiveStyleResolver.knownTokens.test.ts +71 -0
- package/lib/client/responsiveStyleResolver.test.ts +234 -232
- package/lib/client/responsiveStyleResolver.ts +74 -20
- package/lib/client/routing/RouteLoader.test.ts +24 -25
- package/lib/client/routing/RouteLoader.ts +27 -35
- package/lib/client/routing/Router.tsx +210 -153
- package/lib/client/scripts/ScriptExecutor.test.ts +157 -158
- package/lib/client/scripts/ScriptExecutor.ts +18 -36
- package/lib/client/services/PrefetchService.test.ts +3 -3
- package/lib/client/services/PrefetchService.ts +23 -29
- package/lib/client/styleProcessor.test.ts +9 -9
- package/lib/client/styleProcessor.ts +24 -15
- package/lib/client/styles/StyleInjector.test.ts +122 -115
- package/lib/client/styles/StyleInjector.ts +10 -7
- package/lib/client/styles/UtilityClassCollector.ts +62 -28
- package/lib/client/styles/cspNonce.test.ts +2 -5
- package/lib/client/templateEngine.test.ts +554 -488
- package/lib/client/templateEngine.ts +203 -73
- package/lib/client/theme.test.ts +1 -1
- package/lib/client/theme.ts +0 -1
- package/lib/client/utils/toast.ts +0 -1
- package/lib/server/__integration__/api-routes.test.ts +8 -4
- package/lib/server/__integration__/cms-integration.test.ts +1 -4
- package/lib/server/__integration__/server-lifecycle.test.ts +4 -5
- package/lib/server/__integration__/ssr-rendering.test.ts +47 -37
- package/lib/server/__integration__/static-assets.test.ts +3 -3
- package/lib/server/__integration__/test-helpers.ts +87 -74
- package/lib/server/ab/generateFunctions.ts +12 -10
- package/lib/server/astro/cmsPageEmitter.ts +26 -42
- package/lib/server/astro/componentEmitter.ts +35 -43
- package/lib/server/astro/cssCollector.ts +10 -26
- package/lib/server/astro/nodeToAstro.test.ts +1754 -34
- package/lib/server/astro/nodeToAstro.ts +232 -216
- package/lib/server/astro/normalizeOrphanTemplateProps.test.ts +115 -119
- package/lib/server/astro/normalizeOrphanTemplateProps.ts +11 -18
- package/lib/server/astro/pageEmitter.ts +9 -13
- package/lib/server/astro/tailwindMapper.test.ts +10 -37
- package/lib/server/astro/tailwindMapper.ts +33 -40
- package/lib/server/astro/templateTransformer.ts +17 -20
- package/lib/server/createServer.ts +7 -19
- package/lib/server/cssGenerator.test.ts +35 -44
- package/lib/server/cssGenerator.ts +8 -19
- package/lib/server/fileWatcher.test.ts +164 -13
- package/lib/server/fileWatcher.ts +209 -124
- package/lib/server/index.ts +14 -17
- package/lib/server/jsonLoader.test.ts +39 -2
- package/lib/server/jsonLoader.ts +39 -34
- package/lib/server/middleware/cors.test.ts +21 -21
- package/lib/server/middleware/cors.ts +28 -4
- package/lib/server/middleware/errorHandler.test.ts +7 -5
- package/lib/server/middleware/errorHandler.ts +3 -8
- package/lib/server/middleware/index.ts +0 -1
- package/lib/server/middleware/logger.test.ts +10 -8
- package/lib/server/middleware/logger.ts +17 -29
- package/lib/server/migrateTemplates.ts +3 -3
- package/lib/server/pageCache.test.ts +76 -77
- package/lib/server/pageCache.ts +0 -1
- package/lib/server/projectContext.ts +5 -4
- package/lib/server/providers/fileSystemCMSProvider.test.ts +142 -99
- package/lib/server/providers/fileSystemCMSProvider.ts +62 -38
- package/lib/server/routes/api/cms.test.ts +26 -14
- package/lib/server/routes/api/cms.ts +9 -14
- package/lib/server/routes/api/colors.test.ts +2 -2
- package/lib/server/routes/api/components.ts +31 -35
- package/lib/server/routes/api/config.ts +3 -4
- package/lib/server/routes/api/core-routes.ts +49 -76
- package/lib/server/routes/api/enums.test.ts +2 -2
- package/lib/server/routes/api/functions.ts +9 -17
- package/lib/server/routes/api/index.ts +3 -6
- package/lib/server/routes/api/pages.ts +8 -11
- package/lib/server/routes/api/shared.test.ts +1 -1
- package/lib/server/routes/api/shared.ts +12 -9
- package/lib/server/routes/api/variables.test.ts +3 -5
- package/lib/server/routes/api/variables.ts +1 -1
- package/lib/server/routes/index.ts +25 -28
- package/lib/server/routes/pages.ts +35 -31
- package/lib/server/routes/static.ts +17 -6
- package/lib/server/runtime/bundler.ts +98 -61
- package/lib/server/runtime/fs.ts +16 -26
- package/lib/server/runtime/httpServer.ts +8 -12
- package/lib/server/services/ColorService.test.ts +3 -3
- package/lib/server/services/ColorService.ts +37 -29
- package/lib/server/services/EnumService.test.ts +4 -8
- package/lib/server/services/EnumService.ts +11 -3
- package/lib/server/services/VariableService.test.ts +8 -12
- package/lib/server/services/VariableService.ts +11 -3
- package/lib/server/services/cmsService.test.ts +158 -120
- package/lib/server/services/cmsService.ts +36 -146
- package/lib/server/services/componentService.test.ts +125 -45
- package/lib/server/services/componentService.ts +70 -46
- package/lib/server/services/configService.test.ts +22 -45
- package/lib/server/services/configService.ts +50 -27
- package/lib/server/services/fileWatcherService.ts +42 -8
- package/lib/server/services/index.ts +0 -1
- package/lib/server/services/pageService.test.ts +8 -10
- package/lib/server/services/pageService.ts +32 -18
- package/lib/server/ssr/attributeBuilder.ts +18 -8
- package/lib/server/ssr/buildErrorOverlay.ts +11 -12
- package/lib/server/ssr/clientDataInjector.ts +7 -21
- package/lib/server/ssr/cmsSSRProcessor.ts +4 -8
- package/lib/server/ssr/cssCollector.ts +1 -1
- package/lib/server/ssr/errorOverlay.test.ts +1 -1
- package/lib/server/ssr/errorOverlay.ts +3 -9
- package/lib/server/ssr/htmlGenerator.nonce.test.ts +9 -14
- package/lib/server/ssr/htmlGenerator.test.ts +120 -44
- package/lib/server/ssr/htmlGenerator.ts +126 -91
- package/lib/server/ssr/imageMetadata.test.ts +3 -1
- package/lib/server/ssr/imageMetadata.ts +27 -21
- package/lib/server/ssr/jsCollector.test.ts +8 -18
- package/lib/server/ssr/jsCollector.ts +3 -8
- package/lib/server/ssr/liveReloadIntegration.test.ts +76 -36
- package/lib/server/ssr/metaTagGenerator.ts +2 -2
- package/lib/server/ssr/ssrRenderer.branches.test.ts +1103 -0
- package/lib/server/ssr/ssrRenderer.test.ts +316 -256
- package/lib/server/ssr/ssrRenderer.ts +795 -243
- package/lib/server/ssrRenderer.test.ts +1048 -954
- package/lib/server/utils/jsonLineMapper.test.ts +28 -28
- package/lib/server/utils/jsonLineMapper.ts +7 -7
- package/lib/server/validateStyleCoverage.ts +18 -21
- package/lib/server/websocketManager.ts +28 -19
- package/lib/shared/attributeNodeUtils.test.ts +15 -15
- package/lib/shared/attributeNodeUtils.ts +5 -12
- package/lib/shared/breakpoints.test.ts +5 -5
- package/lib/shared/breakpoints.ts +4 -11
- package/lib/shared/cmsQuery.test.ts +81 -0
- package/lib/shared/cmsQuery.ts +92 -0
- package/lib/shared/cmsQueryParser.test.ts +50 -42
- package/lib/shared/cmsQueryParser.ts +60 -38
- package/lib/shared/colorConversions.ts +9 -9
- package/lib/shared/colorVariableUtils.test.ts +27 -5
- package/lib/shared/colorVariableUtils.ts +21 -12
- package/lib/shared/componentRefs.ts +1 -5
- package/lib/shared/constants.test.ts +3 -3
- package/lib/shared/constants.ts +8 -8
- package/lib/shared/cssGeneration.test.ts +285 -144
- package/lib/shared/cssGeneration.ts +217 -531
- package/lib/shared/cssNamedColors.ts +152 -30
- package/lib/shared/cssProperties.test.ts +69 -70
- package/lib/shared/cssProperties.ts +298 -114
- package/lib/shared/elementClassName.test.ts +109 -109
- package/lib/shared/elementClassName.ts +3 -3
- package/lib/shared/elementUtils.ts +12 -16
- package/lib/shared/errorLogger.test.ts +12 -12
- package/lib/shared/errorLogger.ts +2 -10
- package/lib/shared/errors.test.ts +2 -13
- package/lib/shared/errors.ts +2 -8
- package/lib/shared/expressionEvaluator.test.ts +145 -0
- package/lib/shared/expressionEvaluator.ts +52 -24
- package/lib/shared/fontLoader.test.ts +32 -18
- package/lib/shared/fontLoader.ts +2 -2
- package/lib/shared/friendlyError.ts +2 -3
- package/lib/shared/gradientUtils.test.ts +3 -7
- package/lib/shared/gradientUtils.ts +17 -14
- package/lib/shared/hrefRefs.test.ts +2 -2
- package/lib/shared/hrefRefs.ts +2 -10
- package/lib/shared/i18n.test.ts +4 -4
- package/lib/shared/i18n.ts +18 -38
- package/lib/shared/index.ts +27 -0
- package/lib/shared/inlineSvgStyleRules.ts +14 -13
- package/lib/shared/interactiveStyleMappings.test.ts +32 -54
- package/lib/shared/interactiveStyleMappings.ts +11 -24
- package/lib/shared/interactiveStyles.test.ts +165 -188
- package/lib/shared/interfaces/contentProvider.ts +1 -1
- package/lib/shared/itemTemplateUtils.test.ts +11 -17
- package/lib/shared/itemTemplateUtils.ts +27 -39
- package/lib/shared/jsonRepair.ts +16 -10
- package/lib/shared/libraryLoader.test.ts +21 -55
- package/lib/shared/libraryLoader.ts +7 -22
- package/lib/shared/linkUtils.ts +1 -1
- package/lib/shared/logger.test.ts +66 -0
- package/lib/shared/logger.ts +94 -0
- package/lib/shared/markdown.ts +25 -0
- package/lib/shared/netlifyLocale404.test.ts +179 -0
- package/lib/shared/netlifyLocale404.ts +110 -0
- package/lib/shared/nodeUtils.test.ts +28 -16
- package/lib/shared/nodeUtils.ts +76 -23
- package/lib/shared/pathArrayUtils.test.ts +1 -2
- package/lib/shared/pathArrayUtils.ts +1 -1
- package/lib/shared/pathSecurity.ts +2 -2
- package/lib/shared/pathUtils.test.ts +4 -6
- package/lib/shared/pathUtils.ts +42 -49
- package/lib/shared/paths/Path.test.ts +2 -2
- package/lib/shared/paths/Path.ts +0 -1
- package/lib/shared/paths/PathConverter.test.ts +1 -1
- package/lib/shared/paths/PathConverter.ts +17 -20
- package/lib/shared/paths/PathUtils.ts +13 -13
- package/lib/shared/paths/PathValidator.test.ts +2 -15
- package/lib/shared/paths/PathValidator.ts +12 -10
- package/lib/shared/paths/index.ts +1 -2
- package/lib/shared/permissions.test.ts +168 -0
- package/lib/shared/permissions.ts +162 -0
- package/lib/shared/propResolver.test.ts +240 -244
- package/lib/shared/propResolver.ts +15 -26
- package/lib/shared/pxToRem.test.ts +7 -6
- package/lib/shared/pxToRem.ts +2 -5
- package/lib/shared/registry/BaseNodeTypeRegistry.test.ts +12 -6
- package/lib/shared/registry/ClientRegistry.ts +0 -2
- package/lib/shared/registry/ComponentRegistry.test.ts +46 -32
- package/lib/shared/registry/ComponentRegistry.ts +12 -9
- package/lib/shared/registry/NodeTypeDefinition.ts +16 -9
- package/lib/shared/registry/RegistryManager.ts +1 -2
- package/lib/shared/registry/SSRRegistry.ts +0 -2
- package/lib/shared/registry/createNodeType.ts +7 -9
- package/lib/shared/registry/defineNodeType.ts +2 -6
- package/lib/shared/registry/fieldPresets.ts +3 -1
- package/lib/shared/registry/index.ts +0 -1
- package/lib/shared/registry/nodeTypes/ComponentInstanceNodeType.ts +14 -15
- package/lib/shared/registry/nodeTypes/CustomNodeType.ts +103 -0
- package/lib/shared/registry/nodeTypes/EmbedNodeType.ts +18 -11
- package/lib/shared/registry/nodeTypes/HtmlNodeType.ts +48 -19
- package/lib/shared/registry/nodeTypes/IslandNodeType.ts +129 -0
- package/lib/shared/registry/nodeTypes/LinkNodeType.ts +21 -19
- package/lib/shared/registry/nodeTypes/ListNodeType.ts +117 -77
- package/lib/shared/registry/nodeTypes/LocaleListNodeType.ts +27 -21
- package/lib/shared/registry/nodeTypes/MarkdownNodeType.ts +78 -0
- package/lib/shared/registry/nodeTypes/SlotMarkerType.ts +12 -8
- package/lib/shared/registry/nodeTypes/index.ts +26 -3
- package/lib/shared/responsiveScaling.test.ts +16 -34
- package/lib/shared/responsiveScaling.ts +61 -42
- package/lib/shared/responsiveStyleUtils.test.ts +0 -1
- package/lib/shared/responsiveStyleUtils.ts +11 -13
- package/lib/shared/richtext/htmlToTiptap.test.ts +139 -130
- package/lib/shared/richtext/htmlToTiptap.ts +2 -4
- package/lib/shared/richtext/tiptapToHtml.test.ts +5 -6
- package/lib/shared/richtext/types.ts +1 -8
- package/lib/shared/slugTranslator.test.ts +13 -13
- package/lib/shared/slugTranslator.ts +12 -16
- package/lib/shared/slugify.ts +9 -15
- package/lib/shared/styleNodeUtils.test.ts +8 -8
- package/lib/shared/styleNodeUtils.ts +18 -20
- package/lib/shared/styleUtils.test.ts +87 -61
- package/lib/shared/styleUtils.ts +5 -6
- package/lib/shared/themeDefaults.test.ts +11 -14
- package/lib/shared/themeDefaults.ts +3 -4
- package/lib/shared/tree/PathBuilder.test.ts +63 -145
- package/lib/shared/tree/PathBuilder.ts +59 -47
- package/lib/shared/treePathUtils.test.ts +51 -12
- package/lib/shared/treePathUtils.ts +91 -60
- package/lib/shared/types/api.ts +105 -8
- package/lib/shared/types/cms.test.ts +34 -0
- package/lib/shared/types/cms.ts +90 -34
- package/lib/shared/types/comment.ts +49 -16
- package/lib/shared/types/components.ts +51 -25
- package/lib/shared/types/errors.test.ts +1 -6
- package/lib/shared/types/errors.ts +3 -7
- package/lib/shared/types/experiments.ts +28 -28
- package/lib/shared/types/index.ts +25 -2
- package/lib/shared/types/permissions.ts +139 -0
- package/lib/shared/types/styles.ts +0 -1
- package/lib/shared/types/variables.test.ts +4 -13
- package/lib/shared/types/variables.ts +51 -30
- package/lib/shared/types.ts +1 -2
- package/lib/shared/utilityClassConfig.ts +751 -321
- package/lib/shared/utilityClassMapper.durability.test.ts +117 -0
- package/lib/shared/utilityClassMapper.test.ts +433 -95
- package/lib/shared/utilityClassMapper.ts +322 -249
- package/lib/shared/utilityClassNames.test.ts +38 -0
- package/lib/shared/utilityClassNames.ts +458 -0
- package/lib/shared/utils.test.ts +2 -10
- package/lib/shared/utils.ts +19 -10
- package/lib/shared/validation/cmsValidators.ts +2 -1
- package/lib/shared/validation/commentValidators.test.ts +53 -0
- package/lib/shared/validation/commentValidators.ts +12 -1
- package/lib/shared/validation/index.ts +1 -0
- package/lib/shared/validation/permissionsValidators.test.ts +49 -0
- package/lib/shared/validation/permissionsValidators.ts +49 -0
- package/lib/shared/validation/propValidator.test.ts +19 -21
- package/lib/shared/validation/propValidator.ts +13 -18
- package/lib/shared/validation/schemas.test.ts +64 -32
- package/lib/shared/validation/schemas.ts +616 -345
- package/lib/shared/validation/validators.test.ts +3 -8
- package/lib/shared/validation/validators.ts +89 -68
- package/lib/shared/viewportUnits.integration.test.ts +14 -10
- package/lib/shared/viewportUnits.test.ts +24 -23
- package/lib/shared/viewportUnits.ts +12 -5
- package/lib/test-utils/dom-setup.ts +1 -1
- package/lib/test-utils/factories/ConsoleMockFactory.ts +10 -14
- package/lib/test-utils/factories/DomMockFactory.ts +17 -23
- package/lib/test-utils/factories/EventMockFactory.ts +7 -13
- package/lib/test-utils/factories/FetchMockFactory.ts +39 -57
- package/lib/test-utils/factories/ServerMockFactory.ts +6 -10
- package/lib/test-utils/factories/StoreMockFactory.ts +18 -29
- package/lib/test-utils/fixtures.ts +45 -45
- package/lib/test-utils/helpers/asyncHelpers.test.ts +15 -18
- package/lib/test-utils/helpers/asyncHelpers.ts +11 -20
- package/lib/test-utils/helpers.ts +1 -5
- package/lib/test-utils/index.ts +0 -4
- package/lib/test-utils/mockFactories.ts +13 -19
- package/lib/test-utils/mocks.ts +6 -4
- package/package.json +3 -5
- package/scripts/build-for-publish.mjs +2 -4
- package/scripts/build-meno-filter.ts +4 -7
- package/tsconfig.json +1 -0
- package/vite.config.ts +4 -4
- package/build-next.ts +0 -1361
- package/build-static.test.ts +0 -424
- package/build-static.ts +0 -1074
- package/dist/build-static.js +0 -36
- package/dist/chunks/chunk-2MHDV5BF.js +0 -251
- package/dist/chunks/chunk-2MHDV5BF.js.map +0 -7
- package/dist/chunks/chunk-AZQYF6KE.js +0 -559
- package/dist/chunks/chunk-AZQYF6KE.js.map +0 -7
- package/dist/chunks/chunk-GZHGVVW3.js +0 -322
- package/dist/chunks/chunk-GZHGVVW3.js.map +0 -7
- package/dist/chunks/chunk-H3GJ4H2U.js.map +0 -7
- package/dist/chunks/chunk-I7YIGZXT.js +0 -467
- package/dist/chunks/chunk-I7YIGZXT.js.map +0 -7
- package/dist/chunks/chunk-IGYR22T6.js +0 -6192
- package/dist/chunks/chunk-IGYR22T6.js.map +0 -7
- package/dist/chunks/chunk-JGP5A3Y5.js +0 -1136
- package/dist/chunks/chunk-JGP5A3Y5.js.map +0 -7
- package/dist/chunks/chunk-JGWFTO6P.js.map +0 -7
- package/dist/chunks/chunk-O3NAGJP4.js.map +0 -7
- package/dist/chunks/chunk-QB2LNO4W.js +0 -77
- package/dist/chunks/chunk-QB2LNO4W.js.map +0 -7
- package/dist/chunks/chunk-R6XHAFBF.js +0 -3821
- package/dist/chunks/chunk-R6XHAFBF.js.map +0 -7
- package/dist/chunks/chunk-UB44F4Z2.js.map +0 -7
- package/dist/chunks/chunk-WQFG7PAH.js.map +0 -7
- package/dist/chunks/chunk-X754AHS5.js.map +0 -7
- package/dist/chunks/chunk-YBLHKYFF.js.map +0 -7
- package/dist/chunks/configService-R3OGU2UD.js +0 -13
- package/dist/chunks/configService-R3OGU2UD.js.map +0 -7
- package/dist/chunks/constants-STK2YBIW.js +0 -46
- package/dist/chunks/constants-STK2YBIW.js.map +0 -7
- package/dist/chunks/fs-JGINUXGL.js.map +0 -7
- package/dist/entries/server-router.js +0 -67
- package/dist/entries/server-router.js.map +0 -7
- package/entries/server-router.tsx +0 -81
- package/lib/server/providers/fileSystemPageProvider.ts +0 -160
- package/lib/server/webflow/buildWebflow.ts +0 -635
- package/lib/server/webflow/index.ts +0 -23
- package/lib/server/webflow/nodeToWebflow.test.ts +0 -3170
- package/lib/server/webflow/nodeToWebflow.ts +0 -2435
- package/lib/server/webflow/styleMapper.test.ts +0 -389
- package/lib/server/webflow/styleMapper.ts +0 -695
- package/lib/server/webflow/templateWrapper.ts +0 -49
- package/lib/server/webflow/types.ts +0 -396
- /package/dist/{build-static.js.map → chunks/fs-G3ANWEFP.js.map} +0 -0
|
@@ -1,46 +1,96 @@
|
|
|
1
1
|
import {
|
|
2
|
-
DEFAULT_BREAKPOINTS,
|
|
3
|
-
DEFAULT_FLUID_RANGE,
|
|
4
2
|
DEFAULT_I18N_CONFIG,
|
|
5
|
-
SCALABLE_CSS_PROPERTIES,
|
|
6
|
-
applyRemConversion,
|
|
7
|
-
buildFluidClampWithExplicitMin,
|
|
8
|
-
buildFluidPropertyValue,
|
|
9
|
-
convertPxToRem,
|
|
10
|
-
getBreakpointName,
|
|
11
|
-
getBreakpointValues,
|
|
12
|
-
getScaleMultiplier,
|
|
13
|
-
getSmallestBreakpointName,
|
|
14
3
|
isI18nValue,
|
|
15
|
-
parseValue,
|
|
16
4
|
resolveI18nInProps,
|
|
17
|
-
resolveI18nValue
|
|
18
|
-
|
|
19
|
-
shouldConvertProperty
|
|
20
|
-
} from "./chunk-AZQYF6KE.js";
|
|
5
|
+
resolveI18nValue
|
|
6
|
+
} from "./chunk-4ZRU52J2.js";
|
|
21
7
|
import {
|
|
22
8
|
isTiptapDocument,
|
|
23
9
|
tiptapToHtml
|
|
24
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5X4HCN7J.js";
|
|
25
11
|
import {
|
|
26
12
|
NODE_TYPE,
|
|
27
13
|
init_constants
|
|
28
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AR7LHIFY.js";
|
|
29
15
|
import {
|
|
30
16
|
__esm,
|
|
31
17
|
__export,
|
|
32
18
|
__toCommonJS
|
|
33
19
|
} from "./chunk-KSBZ2L7C.js";
|
|
34
20
|
|
|
21
|
+
// lib/shared/errorLogger.ts
|
|
22
|
+
function setErrorHandler(handler) {
|
|
23
|
+
errorHandler = handler;
|
|
24
|
+
}
|
|
25
|
+
function isDevelopment() {
|
|
26
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV) {
|
|
27
|
+
return process.env.NODE_ENV === "development";
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function logRuntimeError(location, error, context) {
|
|
32
|
+
const entry = {
|
|
33
|
+
location,
|
|
34
|
+
category: "runtime",
|
|
35
|
+
error,
|
|
36
|
+
context,
|
|
37
|
+
timestamp: Date.now()
|
|
38
|
+
};
|
|
39
|
+
if (isDevelopment()) {
|
|
40
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
41
|
+
console.error(`[${location}] ${errorMessage}`, context ?? "");
|
|
42
|
+
}
|
|
43
|
+
errorHandler?.(entry);
|
|
44
|
+
}
|
|
45
|
+
function logNetworkError(location, error, context) {
|
|
46
|
+
const entry = {
|
|
47
|
+
location,
|
|
48
|
+
category: "network",
|
|
49
|
+
error,
|
|
50
|
+
context,
|
|
51
|
+
timestamp: Date.now()
|
|
52
|
+
};
|
|
53
|
+
if (isDevelopment()) {
|
|
54
|
+
console.error(`[${location}] Network error:`, error, context ?? "");
|
|
55
|
+
}
|
|
56
|
+
errorHandler?.(entry);
|
|
57
|
+
}
|
|
58
|
+
var errorHandler;
|
|
59
|
+
var init_errorLogger = __esm({
|
|
60
|
+
"lib/shared/errorLogger.ts"() {
|
|
61
|
+
"use strict";
|
|
62
|
+
errorHandler = null;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
35
66
|
// lib/shared/validation/schemas.ts
|
|
36
67
|
import { z } from "zod";
|
|
37
|
-
var BasePropTypeSchema, PropTypeSchema, I18nValueObjectSchema, BasePropDefinitionSchema, EnumsConfigSchema, ListItemSchemaSchema, ListPropDefinitionSchema, PropDefinitionSchema, StyleMappingSchema, BooleanMappingSchema, IfConditionSchema, LinkMappingSchema, HtmlMappingSchema, StyleObjectSchema, ResponsiveStyleObjectSchema, StyleValueSchema, InteractiveStyleRuleSchema, InteractiveStylesSchema, SlotMarkerSchema, ComponentNodeSchema, HtmlNodeSchema, ComponentInstanceNodeSchema, EmbedNodeSchema, LinkNodeSchema, LocaleListNodeSchema, ListNodeSchemaBasic, ScriptLoadModeSchema, LibraryPositionSchema, ScriptTypeSchema, JSLibraryConfigSchema, CSSLibraryConfigSchema, LibrariesConfigSchema, StructuredComponentDefinitionSchema, ComponentDefinitionSchema, I18nOrStringSchema, LibraryMergeModeSchema, PageLibrariesConfigSchema, CustomCodeConfigSchema, PageMetaDataBaseSchema, PageMetaDataSchema, LineRangeSchema, JSONPageSchema, PageDataWithComponentSchema, PageDataSchema, CMSFieldTypeSchema, CMSFieldDefinitionSchema, CMSClientDataStrategySchema, CMSClientDataConfigSchema, CMSSchemaSchema, CMSItemSchema, CMSDraftItemSchema, CMSFilterConditionSchema, CMSSortConfigSchema, CMSListQuerySchema, CMSListNodeSchema, PageCmsConfigSchema, PageMetaDataWithCMSSchema;
|
|
68
|
+
var BasePropTypeSchema, PropTypeSchema, I18nValueObjectSchema, BasePropDefinitionSchema, EnumsConfigSchema, ListItemSchemaSchema, ListPropDefinitionSchema, PropDefinitionSchema, StyleMappingSchema, BooleanMappingSchema, VerbatimCodeSchema, IfConditionSchema, LinkMappingSchema, HtmlMappingSchema, StyleObjectSchema, ResponsiveStyleObjectSchema, StyleValueSchema, InteractiveStyleRuleSchema, InteractiveStylesSchema, SlotMarkerSchema, ComponentNodeSchema, HtmlNodeSchema, ComponentInstanceNodeSchema, EmbedNodeSchema, LinkNodeSchema, LocaleListNodeSchema, ListNodeSchemaBasic, IslandNodeSchema, MarkdownNodeSchema, CustomNodeSchema, ScriptLoadModeSchema, LibraryPositionSchema, ScriptTypeSchema, JSLibraryConfigSchema, CSSLibraryConfigSchema, LibrariesConfigSchema, StructuredComponentDefinitionSchema, ComponentDefinitionSchema, I18nOrStringSchema, LibraryMergeModeSchema, PageLibrariesConfigSchema, CustomCodeConfigSchema, SitemapPageConfigSchema, PageMetaDataBaseSchema, PageMetaDataSchema, LineRangeSchema, JSONPageSchema, PageDataWithComponentSchema, PageDataSchema, CMSFieldTypeSchema, CMSFieldDefinitionSchema, CMSClientDataStrategySchema, CMSClientDataConfigSchema, CMSSchemaSchema, CMSItemSchema, CMSDraftItemSchema, CMSFilterConditionSchema, CMSSortConfigSchema, CMSListQuerySchema, CMSListNodeSchema, PageCmsConfigSchema, PageDataSourceSchema, PageDataConfigSchema, PageMetaDataWithCMSSchema;
|
|
38
69
|
var init_schemas = __esm({
|
|
39
70
|
"lib/shared/validation/schemas.ts"() {
|
|
40
71
|
"use strict";
|
|
41
72
|
init_constants();
|
|
42
|
-
BasePropTypeSchema = z.enum([
|
|
43
|
-
|
|
73
|
+
BasePropTypeSchema = z.enum([
|
|
74
|
+
"string",
|
|
75
|
+
"select",
|
|
76
|
+
"boolean",
|
|
77
|
+
"number",
|
|
78
|
+
"link",
|
|
79
|
+
"file",
|
|
80
|
+
"rich-text",
|
|
81
|
+
"embed"
|
|
82
|
+
]);
|
|
83
|
+
PropTypeSchema = z.enum([
|
|
84
|
+
"string",
|
|
85
|
+
"select",
|
|
86
|
+
"boolean",
|
|
87
|
+
"number",
|
|
88
|
+
"link",
|
|
89
|
+
"file",
|
|
90
|
+
"rich-text",
|
|
91
|
+
"embed",
|
|
92
|
+
"list"
|
|
93
|
+
]);
|
|
44
94
|
I18nValueObjectSchema = z.object({
|
|
45
95
|
_i18n: z.literal(true)
|
|
46
96
|
}).passthrough();
|
|
@@ -68,19 +118,21 @@ var init_schemas = __esm({
|
|
|
68
118
|
itemSchema: ListItemSchemaSchema,
|
|
69
119
|
// List-item field values can be any primitive, a link object, an `_i18n`
|
|
70
120
|
// object (resolved by the SSR pipeline), or null.
|
|
71
|
-
default: z.array(
|
|
72
|
-
z.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
121
|
+
default: z.array(
|
|
122
|
+
z.record(
|
|
123
|
+
z.string(),
|
|
124
|
+
z.union([
|
|
125
|
+
z.string(),
|
|
126
|
+
z.number(),
|
|
127
|
+
z.boolean(),
|
|
128
|
+
z.object({ href: z.string(), target: z.string().optional() }),
|
|
129
|
+
I18nValueObjectSchema,
|
|
130
|
+
z.null()
|
|
131
|
+
])
|
|
132
|
+
)
|
|
133
|
+
).optional()
|
|
79
134
|
}).passthrough();
|
|
80
|
-
PropDefinitionSchema = z.union([
|
|
81
|
-
ListPropDefinitionSchema,
|
|
82
|
-
BasePropDefinitionSchema
|
|
83
|
-
]);
|
|
135
|
+
PropDefinitionSchema = z.union([ListPropDefinitionSchema, BasePropDefinitionSchema]);
|
|
84
136
|
StyleMappingSchema = z.object({
|
|
85
137
|
_mapping: z.literal(true),
|
|
86
138
|
prop: z.string(),
|
|
@@ -91,18 +143,18 @@ var init_schemas = __esm({
|
|
|
91
143
|
prop: z.string(),
|
|
92
144
|
values: z.record(z.string(), z.boolean())
|
|
93
145
|
}).passthrough();
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
z.string(),
|
|
97
|
-
BooleanMappingSchema
|
|
98
|
-
]);
|
|
146
|
+
VerbatimCodeSchema = z.object({ _code: z.literal(true), expr: z.string() }).passthrough();
|
|
147
|
+
IfConditionSchema = z.union([z.boolean(), z.string(), BooleanMappingSchema, VerbatimCodeSchema]);
|
|
99
148
|
LinkMappingSchema = z.object({
|
|
100
149
|
_mapping: z.literal(true),
|
|
101
150
|
prop: z.string(),
|
|
102
|
-
values: z.record(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
151
|
+
values: z.record(
|
|
152
|
+
z.string(),
|
|
153
|
+
z.object({
|
|
154
|
+
href: z.string(),
|
|
155
|
+
target: z.string().optional()
|
|
156
|
+
})
|
|
157
|
+
).optional()
|
|
106
158
|
}).passthrough();
|
|
107
159
|
HtmlMappingSchema = z.object({
|
|
108
160
|
_mapping: z.literal(true),
|
|
@@ -111,21 +163,14 @@ var init_schemas = __esm({
|
|
|
111
163
|
}).passthrough();
|
|
112
164
|
StyleObjectSchema = z.record(
|
|
113
165
|
z.string(),
|
|
114
|
-
z.union([
|
|
115
|
-
z.string(),
|
|
116
|
-
z.number(),
|
|
117
|
-
StyleMappingSchema
|
|
118
|
-
])
|
|
166
|
+
z.union([z.string(), z.number(), StyleMappingSchema])
|
|
119
167
|
);
|
|
120
168
|
ResponsiveStyleObjectSchema = z.object({
|
|
121
169
|
base: StyleObjectSchema.optional(),
|
|
122
170
|
tablet: StyleObjectSchema.optional(),
|
|
123
171
|
mobile: StyleObjectSchema.optional()
|
|
124
172
|
}).passthrough();
|
|
125
|
-
StyleValueSchema = z.union([
|
|
126
|
-
StyleObjectSchema,
|
|
127
|
-
ResponsiveStyleObjectSchema
|
|
128
|
-
]);
|
|
173
|
+
StyleValueSchema = z.union([StyleObjectSchema, ResponsiveStyleObjectSchema]);
|
|
129
174
|
InteractiveStyleRuleSchema = z.object({
|
|
130
175
|
name: z.string().optional(),
|
|
131
176
|
prefix: z.string().optional(),
|
|
@@ -134,110 +179,176 @@ var init_schemas = __esm({
|
|
|
134
179
|
previewProp: z.string().optional()
|
|
135
180
|
});
|
|
136
181
|
InteractiveStylesSchema = z.array(InteractiveStyleRuleSchema);
|
|
137
|
-
SlotMarkerSchema = z.lazy(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
z.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
z.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
z.
|
|
199
|
-
z.string(),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
182
|
+
SlotMarkerSchema = z.lazy(
|
|
183
|
+
() => z.object({
|
|
184
|
+
type: z.literal(NODE_TYPE.SLOT),
|
|
185
|
+
default: z.union([
|
|
186
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
187
|
+
z.string(),
|
|
188
|
+
I18nValueObjectSchema
|
|
189
|
+
]).optional()
|
|
190
|
+
}).passthrough()
|
|
191
|
+
);
|
|
192
|
+
HtmlNodeSchema = z.lazy(
|
|
193
|
+
() => z.object({
|
|
194
|
+
type: z.literal(NODE_TYPE.NODE),
|
|
195
|
+
tag: z.string(),
|
|
196
|
+
label: z.string().optional(),
|
|
197
|
+
if: IfConditionSchema.optional(),
|
|
198
|
+
style: StyleValueSchema.optional(),
|
|
199
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
200
|
+
generateElementClass: z.boolean().optional(),
|
|
201
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema, VerbatimCodeSchema])).optional(),
|
|
202
|
+
props: z.record(z.string(), z.any()).optional(),
|
|
203
|
+
// Allow props for backward compatibility
|
|
204
|
+
children: z.union([
|
|
205
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
206
|
+
z.string(),
|
|
207
|
+
I18nValueObjectSchema
|
|
208
|
+
]).optional()
|
|
209
|
+
}).passthrough()
|
|
210
|
+
);
|
|
211
|
+
ComponentInstanceNodeSchema = z.lazy(
|
|
212
|
+
() => z.object({
|
|
213
|
+
type: z.literal(NODE_TYPE.COMPONENT),
|
|
214
|
+
component: z.string(),
|
|
215
|
+
label: z.string().optional(),
|
|
216
|
+
if: IfConditionSchema.optional(),
|
|
217
|
+
props: z.record(z.string(), z.any()).optional(),
|
|
218
|
+
style: StyleValueSchema.optional(),
|
|
219
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
220
|
+
generateElementClass: z.boolean().optional(),
|
|
221
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema, VerbatimCodeSchema])).optional(),
|
|
222
|
+
children: z.union([
|
|
223
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
224
|
+
z.string(),
|
|
225
|
+
I18nValueObjectSchema
|
|
226
|
+
]).optional()
|
|
227
|
+
}).passthrough()
|
|
228
|
+
);
|
|
229
|
+
EmbedNodeSchema = z.lazy(
|
|
230
|
+
() => z.object({
|
|
231
|
+
type: z.literal(NODE_TYPE.EMBED),
|
|
232
|
+
html: z.union([z.string(), HtmlMappingSchema, I18nValueObjectSchema]),
|
|
233
|
+
label: z.string().optional(),
|
|
234
|
+
if: IfConditionSchema.optional(),
|
|
235
|
+
style: StyleValueSchema.optional(),
|
|
236
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
237
|
+
generateElementClass: z.boolean().optional(),
|
|
238
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema, VerbatimCodeSchema])).optional()
|
|
239
|
+
}).passthrough()
|
|
240
|
+
);
|
|
241
|
+
LinkNodeSchema = z.lazy(
|
|
242
|
+
() => z.object({
|
|
243
|
+
type: z.literal(NODE_TYPE.LINK),
|
|
244
|
+
href: z.union([z.string(), LinkMappingSchema, I18nValueObjectSchema]),
|
|
245
|
+
label: z.string().optional(),
|
|
246
|
+
if: IfConditionSchema.optional(),
|
|
247
|
+
style: StyleValueSchema.optional(),
|
|
248
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
249
|
+
generateElementClass: z.boolean().optional(),
|
|
250
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema, VerbatimCodeSchema])).optional(),
|
|
251
|
+
children: z.union([
|
|
252
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
253
|
+
z.string(),
|
|
254
|
+
I18nValueObjectSchema
|
|
255
|
+
]).optional()
|
|
256
|
+
}).passthrough()
|
|
257
|
+
);
|
|
258
|
+
LocaleListNodeSchema = z.lazy(
|
|
259
|
+
() => z.object({
|
|
260
|
+
type: z.literal(NODE_TYPE.LOCALE_LIST),
|
|
261
|
+
label: z.string().optional(),
|
|
262
|
+
if: IfConditionSchema.optional(),
|
|
263
|
+
style: StyleValueSchema.optional(),
|
|
264
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
265
|
+
generateElementClass: z.boolean().optional(),
|
|
266
|
+
itemStyle: StyleValueSchema.optional(),
|
|
267
|
+
activeItemStyle: StyleValueSchema.optional(),
|
|
268
|
+
separatorStyle: StyleValueSchema.optional(),
|
|
269
|
+
showCurrent: z.boolean().optional(),
|
|
270
|
+
showSeparator: z.boolean().optional(),
|
|
271
|
+
showFlag: z.boolean().optional(),
|
|
272
|
+
flagStyle: StyleValueSchema.optional(),
|
|
273
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema, VerbatimCodeSchema])).optional()
|
|
274
|
+
}).passthrough()
|
|
275
|
+
);
|
|
276
|
+
ListNodeSchemaBasic = z.lazy(
|
|
277
|
+
() => z.object({
|
|
278
|
+
type: z.union([z.literal(NODE_TYPE.LIST), z.literal("cms-list")]),
|
|
279
|
+
// Support both for migration
|
|
280
|
+
sourceType: z.enum(["prop", "collection", "remote", "sanity", "expression"]).optional(),
|
|
281
|
+
// defaults to 'prop'
|
|
282
|
+
source: z.string().optional(),
|
|
283
|
+
// Source prop name or collection name
|
|
284
|
+
collection: z.string().optional(),
|
|
285
|
+
// Legacy field for cms-list migration
|
|
286
|
+
// Remote-source options (sourceType: 'remote')
|
|
287
|
+
url: z.string().optional(),
|
|
288
|
+
// HTTP/JSON endpoint
|
|
289
|
+
path: z.string().optional(),
|
|
290
|
+
// dot-path into the response to the items array
|
|
291
|
+
// Sanity-source options (sourceType: 'sanity')
|
|
292
|
+
documentType: z.string().optional(),
|
|
293
|
+
// Sanity document `_type`
|
|
294
|
+
slugField: z.string().optional(),
|
|
295
|
+
// field used as the URL slug
|
|
296
|
+
label: z.string().optional(),
|
|
297
|
+
if: IfConditionSchema.optional(),
|
|
298
|
+
itemAs: z.string().optional(),
|
|
299
|
+
// Collection-specific options
|
|
300
|
+
items: z.union([z.string(), z.array(z.string())]).optional(),
|
|
301
|
+
filter: z.unknown().optional(),
|
|
302
|
+
sort: z.unknown().optional(),
|
|
303
|
+
limit: z.number().optional(),
|
|
304
|
+
offset: z.number().optional(),
|
|
305
|
+
excludeCurrentItem: z.boolean().optional(),
|
|
306
|
+
emitTemplate: z.boolean().optional(),
|
|
307
|
+
children: z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])).optional()
|
|
308
|
+
}).passthrough()
|
|
309
|
+
);
|
|
310
|
+
IslandNodeSchema = z.lazy(
|
|
311
|
+
() => z.object({
|
|
312
|
+
type: z.literal(NODE_TYPE.ISLAND),
|
|
313
|
+
src: z.string(),
|
|
314
|
+
client: z.object({
|
|
315
|
+
directive: z.enum(["load", "idle", "visible", "media", "only"]),
|
|
316
|
+
value: z.string().optional()
|
|
317
|
+
}).passthrough().optional(),
|
|
318
|
+
props: z.record(z.string(), z.any()).optional(),
|
|
319
|
+
if: IfConditionSchema.optional(),
|
|
320
|
+
children: z.union([
|
|
321
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
322
|
+
z.string(),
|
|
323
|
+
I18nValueObjectSchema
|
|
324
|
+
]).optional()
|
|
325
|
+
}).passthrough()
|
|
326
|
+
);
|
|
327
|
+
MarkdownNodeSchema = z.lazy(
|
|
328
|
+
() => z.object({
|
|
329
|
+
type: z.literal(NODE_TYPE.MARKDOWN),
|
|
330
|
+
source: z.string(),
|
|
331
|
+
label: z.string().optional(),
|
|
332
|
+
if: IfConditionSchema.optional(),
|
|
333
|
+
style: StyleValueSchema.optional(),
|
|
334
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
335
|
+
generateElementClass: z.boolean().optional(),
|
|
336
|
+
attributes: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), I18nValueObjectSchema, VerbatimCodeSchema])).optional()
|
|
337
|
+
}).passthrough()
|
|
338
|
+
);
|
|
339
|
+
CustomNodeSchema = z.lazy(
|
|
340
|
+
() => z.object({
|
|
341
|
+
type: z.literal(NODE_TYPE.CUSTOM),
|
|
342
|
+
src: z.string(),
|
|
343
|
+
props: z.record(z.string(), z.any()).optional(),
|
|
344
|
+
if: IfConditionSchema.optional(),
|
|
345
|
+
children: z.union([
|
|
346
|
+
z.array(z.union([ComponentNodeSchema, z.string(), I18nValueObjectSchema])),
|
|
347
|
+
z.string(),
|
|
348
|
+
I18nValueObjectSchema
|
|
349
|
+
]).optional()
|
|
350
|
+
}).passthrough()
|
|
351
|
+
);
|
|
241
352
|
ComponentNodeSchema = z.union([
|
|
242
353
|
HtmlNodeSchema,
|
|
243
354
|
ComponentInstanceNodeSchema,
|
|
@@ -245,7 +356,13 @@ var init_schemas = __esm({
|
|
|
245
356
|
EmbedNodeSchema,
|
|
246
357
|
LinkNodeSchema,
|
|
247
358
|
LocaleListNodeSchema,
|
|
248
|
-
ListNodeSchemaBasic
|
|
359
|
+
ListNodeSchemaBasic,
|
|
360
|
+
IslandNodeSchema,
|
|
361
|
+
MarkdownNodeSchema,
|
|
362
|
+
CustomNodeSchema,
|
|
363
|
+
// A verbatim-code marker is a valid child node (renders natively at build; nothing in the
|
|
364
|
+
// editor preview) — a meno-astro component with any `{_code}` child must validate to open.
|
|
365
|
+
VerbatimCodeSchema
|
|
249
366
|
]);
|
|
250
367
|
ScriptLoadModeSchema = z.enum(["async", "defer"]);
|
|
251
368
|
LibraryPositionSchema = z.enum(["head", "body-end"]);
|
|
@@ -304,6 +421,11 @@ var init_schemas = __esm({
|
|
|
304
421
|
bodyStart: z.string().optional(),
|
|
305
422
|
bodyEnd: z.string().optional()
|
|
306
423
|
}).passthrough();
|
|
424
|
+
SitemapPageConfigSchema = z.object({
|
|
425
|
+
priority: z.number().optional(),
|
|
426
|
+
changefreq: z.enum(["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"]).optional(),
|
|
427
|
+
exclude: z.boolean().optional()
|
|
428
|
+
}).passthrough();
|
|
307
429
|
PageMetaDataBaseSchema = z.object({
|
|
308
430
|
title: I18nOrStringSchema.optional(),
|
|
309
431
|
description: I18nOrStringSchema.optional(),
|
|
@@ -315,7 +437,11 @@ var init_schemas = __esm({
|
|
|
315
437
|
slugs: z.record(z.string(), z.string()).optional(),
|
|
316
438
|
draft: z.boolean().optional(),
|
|
317
439
|
libraries: PageLibrariesConfigSchema.optional(),
|
|
318
|
-
customCode: CustomCodeConfigSchema.optional()
|
|
440
|
+
customCode: CustomCodeConfigSchema.optional(),
|
|
441
|
+
viewTransitions: z.boolean().optional(),
|
|
442
|
+
noindex: z.boolean().optional(),
|
|
443
|
+
prerender: z.boolean().optional(),
|
|
444
|
+
sitemap: SitemapPageConfigSchema.optional()
|
|
319
445
|
}).passthrough();
|
|
320
446
|
PageMetaDataSchema = PageMetaDataBaseSchema;
|
|
321
447
|
LineRangeSchema = z.object({
|
|
@@ -326,12 +452,18 @@ var init_schemas = __esm({
|
|
|
326
452
|
components: z.record(z.string(), ComponentDefinitionSchema).optional(),
|
|
327
453
|
root: ComponentNodeSchema.optional(),
|
|
328
454
|
meta: PageMetaDataSchema.optional(),
|
|
329
|
-
_lineMap: z.record(z.string(), LineRangeSchema).optional()
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
455
|
+
_lineMap: z.record(z.string(), LineRangeSchema).optional(),
|
|
456
|
+
// Marks a page whose source is outside the meno-astro dialect (read-only in the editor).
|
|
457
|
+
// Explicit (not just .passthrough()) so it survives a future tightening of this schema.
|
|
458
|
+
_unsupported: z.object({ reason: z.string() }).passthrough().optional()
|
|
459
|
+
}).passthrough().refine(
|
|
460
|
+
(data) => {
|
|
461
|
+
return data.meta !== void 0 || data.components !== void 0 || data.root !== void 0;
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
message: "JSONPage must have at least one of: meta, components, or root"
|
|
465
|
+
}
|
|
466
|
+
);
|
|
335
467
|
PageDataWithComponentSchema = z.object({
|
|
336
468
|
component: z.object({
|
|
337
469
|
structure: ComponentNodeSchema.optional(),
|
|
@@ -341,10 +473,7 @@ var init_schemas = __esm({
|
|
|
341
473
|
acceptsStyles: z.boolean().optional()
|
|
342
474
|
}).passthrough()
|
|
343
475
|
}).passthrough();
|
|
344
|
-
PageDataSchema = z.union([
|
|
345
|
-
PageDataWithComponentSchema,
|
|
346
|
-
JSONPageSchema
|
|
347
|
-
]);
|
|
476
|
+
PageDataSchema = z.union([PageDataWithComponentSchema, JSONPageSchema]);
|
|
348
477
|
CMSFieldTypeSchema = z.enum([
|
|
349
478
|
"string",
|
|
350
479
|
"text",
|
|
@@ -378,10 +507,12 @@ var init_schemas = __esm({
|
|
|
378
507
|
CMSSchemaSchema = z.object({
|
|
379
508
|
id: z.string(),
|
|
380
509
|
name: z.string(),
|
|
381
|
-
|
|
382
|
-
|
|
510
|
+
// Optional: a data-only collection (no per-item route) omits both.
|
|
511
|
+
slugField: z.string().optional(),
|
|
512
|
+
urlPattern: z.string().optional(),
|
|
383
513
|
fields: z.record(CMSFieldDefinitionSchema),
|
|
384
|
-
clientData: CMSClientDataConfigSchema.optional()
|
|
514
|
+
clientData: CMSClientDataConfigSchema.optional(),
|
|
515
|
+
rss: z.boolean().optional()
|
|
385
516
|
}).passthrough();
|
|
386
517
|
CMSItemSchema = z.object({
|
|
387
518
|
_id: z.string(),
|
|
@@ -406,11 +537,7 @@ var init_schemas = __esm({
|
|
|
406
537
|
});
|
|
407
538
|
CMSListQuerySchema = z.object({
|
|
408
539
|
collection: z.string(),
|
|
409
|
-
filter: z.union([
|
|
410
|
-
CMSFilterConditionSchema,
|
|
411
|
-
z.array(CMSFilterConditionSchema),
|
|
412
|
-
z.record(z.unknown())
|
|
413
|
-
]).optional(),
|
|
540
|
+
filter: z.union([CMSFilterConditionSchema, z.array(CMSFilterConditionSchema), z.record(z.unknown())]).optional(),
|
|
414
541
|
sort: z.union([CMSSortConfigSchema, z.array(CMSSortConfigSchema)]).optional(),
|
|
415
542
|
limit: z.number().positive().optional(),
|
|
416
543
|
offset: z.number().nonnegative().optional()
|
|
@@ -421,11 +548,7 @@ var init_schemas = __esm({
|
|
|
421
548
|
if: IfConditionSchema.optional(),
|
|
422
549
|
itemAs: z.string().optional(),
|
|
423
550
|
items: z.union([z.string(), z.array(z.string())]).optional(),
|
|
424
|
-
filter: z.union([
|
|
425
|
-
CMSFilterConditionSchema,
|
|
426
|
-
z.array(CMSFilterConditionSchema),
|
|
427
|
-
z.record(z.unknown())
|
|
428
|
-
]).optional(),
|
|
551
|
+
filter: z.union([CMSFilterConditionSchema, z.array(CMSFilterConditionSchema), z.record(z.unknown())]).optional(),
|
|
429
552
|
sort: z.union([CMSSortConfigSchema, z.array(CMSSortConfigSchema)]).optional(),
|
|
430
553
|
limit: z.number().positive().optional(),
|
|
431
554
|
offset: z.number().nonnegative().optional(),
|
|
@@ -435,9 +558,23 @@ var init_schemas = __esm({
|
|
|
435
558
|
PageCmsConfigSchema = z.object({
|
|
436
559
|
id: z.string(),
|
|
437
560
|
name: z.string(),
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
561
|
+
// Optional: a data-only collection (no per-item route) omits both.
|
|
562
|
+
slugField: z.string().optional(),
|
|
563
|
+
urlPattern: z.string().optional(),
|
|
564
|
+
fields: z.record(CMSFieldDefinitionSchema),
|
|
565
|
+
rss: z.boolean().optional()
|
|
566
|
+
}).passthrough();
|
|
567
|
+
PageDataSourceSchema = z.object({
|
|
568
|
+
type: z.literal("fetch"),
|
|
569
|
+
url: z.string(),
|
|
570
|
+
method: z.literal("GET").optional(),
|
|
571
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
572
|
+
path: z.string().optional(),
|
|
573
|
+
fields: z.record(z.enum(["string", "number", "boolean", "date", "image", "object"])).optional(),
|
|
574
|
+
cardinality: z.enum(["object", "list"]).optional()
|
|
575
|
+
}).passthrough();
|
|
576
|
+
PageDataConfigSchema = z.object({
|
|
577
|
+
sources: z.record(z.string(), PageDataSourceSchema)
|
|
441
578
|
}).passthrough();
|
|
442
579
|
PageMetaDataWithCMSSchema = z.object({
|
|
443
580
|
title: z.union([z.string(), z.object({ _i18n: z.literal(true) }).passthrough()]).optional(),
|
|
@@ -448,11 +585,18 @@ var init_schemas = __esm({
|
|
|
448
585
|
ogImage: z.string().optional(),
|
|
449
586
|
ogType: z.string().optional(),
|
|
450
587
|
slugs: z.record(z.string(), z.string()).optional(),
|
|
451
|
-
source: z.enum(["static", "cms"]).optional(),
|
|
588
|
+
source: z.enum(["static", "cms", "ssr"]).optional(),
|
|
452
589
|
cms: PageCmsConfigSchema.optional(),
|
|
590
|
+
data: PageDataConfigSchema.optional(),
|
|
591
|
+
routeParams: z.array(z.string()).optional(),
|
|
592
|
+
routePreview: z.record(z.string(), z.string()).optional(),
|
|
453
593
|
draft: z.boolean().optional(),
|
|
454
594
|
libraries: PageLibrariesConfigSchema.optional(),
|
|
455
|
-
customCode: CustomCodeConfigSchema.optional()
|
|
595
|
+
customCode: CustomCodeConfigSchema.optional(),
|
|
596
|
+
viewTransitions: z.boolean().optional(),
|
|
597
|
+
noindex: z.boolean().optional(),
|
|
598
|
+
prerender: z.boolean().optional(),
|
|
599
|
+
sitemap: SitemapPageConfigSchema.optional()
|
|
456
600
|
}).passthrough();
|
|
457
601
|
}
|
|
458
602
|
});
|
|
@@ -462,6 +606,7 @@ var BaseComponentRegistry;
|
|
|
462
606
|
var init_ComponentRegistry = __esm({
|
|
463
607
|
"lib/shared/registry/ComponentRegistry.ts"() {
|
|
464
608
|
"use strict";
|
|
609
|
+
init_errorLogger();
|
|
465
610
|
BaseComponentRegistry = class {
|
|
466
611
|
registry = {};
|
|
467
612
|
listeners = /* @__PURE__ */ new Set();
|
|
@@ -536,6 +681,7 @@ var init_ComponentRegistry = __esm({
|
|
|
536
681
|
try {
|
|
537
682
|
listener();
|
|
538
683
|
} catch (err) {
|
|
684
|
+
logRuntimeError("ComponentRegistry.notify", err);
|
|
539
685
|
}
|
|
540
686
|
}
|
|
541
687
|
}
|
|
@@ -1130,10 +1276,7 @@ var init_HtmlNodeType = __esm({
|
|
|
1130
1276
|
attributes: z2.record(z2.string(), z2.union([z2.string(), z2.number(), z2.boolean()])).optional(),
|
|
1131
1277
|
props: z2.record(z2.string(), z2.any()).optional(),
|
|
1132
1278
|
// Backward compatibility
|
|
1133
|
-
children: z2.union([
|
|
1134
|
-
z2.array(z2.union([ComponentNodeSchemaRef, z2.string()])),
|
|
1135
|
-
z2.string()
|
|
1136
|
-
]).optional()
|
|
1279
|
+
children: z2.union([z2.array(z2.union([ComponentNodeSchemaRef, z2.string()])), z2.string()]).optional()
|
|
1137
1280
|
}).passthrough();
|
|
1138
1281
|
HtmlNodeType = createNodeType({
|
|
1139
1282
|
type: "node",
|
|
@@ -1154,7 +1297,22 @@ var init_HtmlNodeType = __esm({
|
|
|
1154
1297
|
if (node.tag === "form") {
|
|
1155
1298
|
props.onSubmit = (e) => e.preventDefault();
|
|
1156
1299
|
}
|
|
1157
|
-
const voidElements = [
|
|
1300
|
+
const voidElements = [
|
|
1301
|
+
"img",
|
|
1302
|
+
"br",
|
|
1303
|
+
"hr",
|
|
1304
|
+
"input",
|
|
1305
|
+
"meta",
|
|
1306
|
+
"link",
|
|
1307
|
+
"area",
|
|
1308
|
+
"base",
|
|
1309
|
+
"col",
|
|
1310
|
+
"embed",
|
|
1311
|
+
"param",
|
|
1312
|
+
"source",
|
|
1313
|
+
"track",
|
|
1314
|
+
"wbr"
|
|
1315
|
+
];
|
|
1158
1316
|
if (voidElements.includes(node.tag.toLowerCase())) {
|
|
1159
1317
|
return h(node.tag, props);
|
|
1160
1318
|
}
|
|
@@ -1168,7 +1326,22 @@ var init_HtmlNodeType = __esm({
|
|
|
1168
1326
|
},
|
|
1169
1327
|
ssrRenderer: (node, context) => {
|
|
1170
1328
|
const childrenHTML = context.renderChildren(node.children, context);
|
|
1171
|
-
const voidElements = [
|
|
1329
|
+
const voidElements = [
|
|
1330
|
+
"img",
|
|
1331
|
+
"br",
|
|
1332
|
+
"hr",
|
|
1333
|
+
"input",
|
|
1334
|
+
"meta",
|
|
1335
|
+
"link",
|
|
1336
|
+
"area",
|
|
1337
|
+
"base",
|
|
1338
|
+
"col",
|
|
1339
|
+
"embed",
|
|
1340
|
+
"param",
|
|
1341
|
+
"source",
|
|
1342
|
+
"track",
|
|
1343
|
+
"wbr"
|
|
1344
|
+
];
|
|
1172
1345
|
if (voidElements.includes(node.tag.toLowerCase())) {
|
|
1173
1346
|
return `<${node.tag} />`;
|
|
1174
1347
|
}
|
|
@@ -1206,10 +1379,7 @@ var init_ComponentInstanceNodeType = __esm({
|
|
|
1206
1379
|
generateElementClass: z3.boolean().optional(),
|
|
1207
1380
|
// Generate element class without styles (for custom CSS)
|
|
1208
1381
|
attributes: z3.record(z3.string(), z3.union([z3.string(), z3.number(), z3.boolean()])).optional(),
|
|
1209
|
-
children: z3.union([
|
|
1210
|
-
z3.array(z3.union([ComponentNodeSchemaRef2, z3.string()])),
|
|
1211
|
-
z3.string()
|
|
1212
|
-
]).optional()
|
|
1382
|
+
children: z3.union([z3.array(z3.union([ComponentNodeSchemaRef2, z3.string()])), z3.string()]).optional()
|
|
1213
1383
|
}).passthrough();
|
|
1214
1384
|
ComponentInstanceNodeType = createNodeType({
|
|
1215
1385
|
type: "component",
|
|
@@ -1257,10 +1427,7 @@ var init_SlotMarkerType = __esm({
|
|
|
1257
1427
|
init_createNodeType();
|
|
1258
1428
|
SlotMarkerSchemaInternal = z4.object({
|
|
1259
1429
|
type: z4.literal("slot"),
|
|
1260
|
-
default: z4.union([
|
|
1261
|
-
z4.array(z4.any()),
|
|
1262
|
-
z4.string()
|
|
1263
|
-
]).optional()
|
|
1430
|
+
default: z4.union([z4.array(z4.any()), z4.string()]).optional()
|
|
1264
1431
|
}).passthrough();
|
|
1265
1432
|
SlotMarkerType = createNodeType({
|
|
1266
1433
|
type: "slot",
|
|
@@ -1270,7 +1437,12 @@ var init_SlotMarkerType = __esm({
|
|
|
1270
1437
|
defaultValues: {},
|
|
1271
1438
|
treeDisplay: {
|
|
1272
1439
|
icon: "SLOT_MARKER",
|
|
1273
|
-
|
|
1440
|
+
// Show the slot's name so multiple named slots in a component are distinguishable
|
|
1441
|
+
// (e.g. `slot: header`). Unnamed (default) slots stay just `slot`.
|
|
1442
|
+
getLabel: (node) => {
|
|
1443
|
+
const name = node.name;
|
|
1444
|
+
return typeof name === "string" && name ? `slot: ${name}` : "slot";
|
|
1445
|
+
}
|
|
1274
1446
|
},
|
|
1275
1447
|
clientRenderer: (_node, _context) => {
|
|
1276
1448
|
return null;
|
|
@@ -1371,10 +1543,7 @@ var init_LinkNodeType = __esm({
|
|
|
1371
1543
|
generateElementClass: z6.boolean().optional(),
|
|
1372
1544
|
// Generate element class without styles (for custom CSS)
|
|
1373
1545
|
attributes: z6.record(z6.string(), z6.union([z6.string(), z6.number(), z6.boolean()])).optional(),
|
|
1374
|
-
children: z6.union([
|
|
1375
|
-
z6.array(z6.union([ComponentNodeSchemaRef3, z6.string()])),
|
|
1376
|
-
z6.string()
|
|
1377
|
-
]).optional()
|
|
1546
|
+
children: z6.union([z6.array(z6.union([ComponentNodeSchemaRef3, z6.string()])), z6.string()]).optional()
|
|
1378
1547
|
}).passthrough();
|
|
1379
1548
|
LinkNodeType = createNodeType({
|
|
1380
1549
|
type: "link",
|
|
@@ -1390,9 +1559,7 @@ var init_LinkNodeType = __esm({
|
|
|
1390
1559
|
icon: "LINK",
|
|
1391
1560
|
getLabel: () => "Link"
|
|
1392
1561
|
},
|
|
1393
|
-
editableFields: [
|
|
1394
|
-
urlField({ name: "href", label: "Link URL", required: true })
|
|
1395
|
-
],
|
|
1562
|
+
editableFields: [urlField({ name: "href", label: "Link URL", required: true })],
|
|
1396
1563
|
clientRenderer: (node, context) => {
|
|
1397
1564
|
const children = context.buildChildren(
|
|
1398
1565
|
node.children,
|
|
@@ -1463,10 +1630,14 @@ var init_LocaleListNodeType = __esm({
|
|
|
1463
1630
|
getLabel: () => "LocaleList"
|
|
1464
1631
|
},
|
|
1465
1632
|
clientRenderer: (_node, context) => {
|
|
1466
|
-
return h5(
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1633
|
+
return h5(
|
|
1634
|
+
"div",
|
|
1635
|
+
{
|
|
1636
|
+
key: context.key,
|
|
1637
|
+
"data-locale-list": "true"
|
|
1638
|
+
},
|
|
1639
|
+
"[Locale List]"
|
|
1640
|
+
);
|
|
1470
1641
|
},
|
|
1471
1642
|
ssrRenderer: (_node, _context) => {
|
|
1472
1643
|
return '<div class="locale-list">[Locale List]</div>';
|
|
@@ -1499,10 +1670,12 @@ var init_ListNodeType = __esm({
|
|
|
1499
1670
|
field: z8.string(),
|
|
1500
1671
|
order: z8.enum(["asc", "desc"]).optional()
|
|
1501
1672
|
}),
|
|
1502
|
-
z8.array(
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1673
|
+
z8.array(
|
|
1674
|
+
z8.object({
|
|
1675
|
+
field: z8.string(),
|
|
1676
|
+
order: z8.enum(["asc", "desc"]).optional()
|
|
1677
|
+
})
|
|
1678
|
+
)
|
|
1506
1679
|
]);
|
|
1507
1680
|
ListNodeSchemaInternal = z8.object({
|
|
1508
1681
|
type: z8.literal("list"),
|
|
@@ -1510,14 +1683,36 @@ var init_ListNodeType = __esm({
|
|
|
1510
1683
|
* Data source type:
|
|
1511
1684
|
* - 'prop': Read items from component props (default)
|
|
1512
1685
|
* - 'collection': Query items from CMS collection
|
|
1686
|
+
* - 'remote': Fetch items from a public HTTP/JSON endpoint at build/SSR time
|
|
1687
|
+
* - 'sanity': Fetch a Sanity document type via GROQ at build/SSR time (read-only, public dataset)
|
|
1688
|
+
* - 'expression': Iterate a verbatim JS expression (`source`) that yields an array — a
|
|
1689
|
+
* `.map()` over arbitrary frontmatter data (e.g. an Astro Action / supabase query) the
|
|
1690
|
+
* dialect can't model as a prop/collection. The item template (`children` + `itemAs`) IS
|
|
1691
|
+
* editable; the source itself is a read-only black box (edit it in the .astro frontmatter).
|
|
1692
|
+
* The editor has no data for it, so it renders empty in the design canvas (real Astro play
|
|
1693
|
+
* renders it for real at build/SSR).
|
|
1513
1694
|
*/
|
|
1514
|
-
sourceType: z8.enum(["prop", "collection"]).default("prop"),
|
|
1695
|
+
sourceType: z8.enum(["prop", "collection", "remote", "sanity", "expression"]).default("prop"),
|
|
1515
1696
|
/**
|
|
1516
|
-
* Source identifier:
|
|
1697
|
+
* Source identifier (sourceType 'prop'/'collection'/'expression'; 'remote' uses `url`):
|
|
1517
1698
|
* - For sourceType 'prop': Prop name (e.g., "items") or template expression (e.g., "{{category.items}}")
|
|
1518
1699
|
* - For sourceType 'collection': Collection name (e.g., "posts", "authors")
|
|
1700
|
+
* - For sourceType 'expression': the verbatim JS expression iterated by `.map()` (e.g. "notes?")
|
|
1701
|
+
*/
|
|
1702
|
+
source: z8.string().optional(),
|
|
1703
|
+
// Remote-only options (sourceType: 'remote')
|
|
1704
|
+
/** HTTP(S) endpoint returning JSON, fetched at build/SSR time (e.g. a public REST API). */
|
|
1705
|
+
url: z8.string().optional(),
|
|
1706
|
+
/**
|
|
1707
|
+
* Dot-path into the JSON response to reach the items array (e.g. "data.items").
|
|
1708
|
+
* Empty/absent = the response body is itself the array.
|
|
1519
1709
|
*/
|
|
1520
|
-
|
|
1710
|
+
path: z8.string().optional(),
|
|
1711
|
+
// Sanity-only options (sourceType: 'sanity')
|
|
1712
|
+
/** Sanity document `_type` to fetch (`*[_type == "<documentType>"]`). projectId/dataset come from project config. */
|
|
1713
|
+
documentType: z8.string().optional(),
|
|
1714
|
+
/** Field used as the URL slug (for synthesizing item links); defaults to 'slug'. */
|
|
1715
|
+
slugField: z8.string().optional(),
|
|
1521
1716
|
label: z8.string().optional(),
|
|
1522
1717
|
// Custom label displayed in structure tree
|
|
1523
1718
|
if: IfConditionSchema.optional(),
|
|
@@ -1532,11 +1727,7 @@ var init_ListNodeType = __esm({
|
|
|
1532
1727
|
/** Direct item IDs or template expression for referenced items (e.g., "{{post.authorId}}") */
|
|
1533
1728
|
items: z8.union([z8.string(), z8.array(z8.string())]).optional(),
|
|
1534
1729
|
/** Filter conditions */
|
|
1535
|
-
filter: z8.union([
|
|
1536
|
-
CMSFilterConditionSchema2,
|
|
1537
|
-
z8.array(CMSFilterConditionSchema2),
|
|
1538
|
-
z8.record(z8.unknown())
|
|
1539
|
-
]).optional(),
|
|
1730
|
+
filter: z8.union([CMSFilterConditionSchema2, z8.array(CMSFilterConditionSchema2), z8.record(z8.unknown())]).optional(),
|
|
1540
1731
|
/** Sort configuration */
|
|
1541
1732
|
sort: CMSSortConfigSchema2.optional(),
|
|
1542
1733
|
/** Exclude the current CMS item from the list (useful for "related items" sections) */
|
|
@@ -1574,8 +1765,9 @@ var init_ListNodeType = __esm({
|
|
|
1574
1765
|
getLabel: (node) => {
|
|
1575
1766
|
const listNode = node;
|
|
1576
1767
|
const sourceType = listNode.sourceType || "prop";
|
|
1577
|
-
const prefix = sourceType === "collection" ? "CMS List" : "List";
|
|
1578
|
-
|
|
1768
|
+
const prefix = sourceType === "collection" ? "CMS List" : sourceType === "remote" ? "Remote List" : sourceType === "sanity" ? "Sanity List" : sourceType === "expression" ? "Loop" : "List";
|
|
1769
|
+
const src = sourceType === "remote" ? listNode.url : sourceType === "sanity" ? listNode.documentType : listNode.source;
|
|
1770
|
+
return src ? `${prefix}: ${src}` : prefix;
|
|
1579
1771
|
}
|
|
1580
1772
|
},
|
|
1581
1773
|
clientRenderer: (node, context) => {
|
|
@@ -1586,20 +1778,24 @@ var init_ListNodeType = __esm({
|
|
|
1586
1778
|
const borderColor = isCollection ? "rgba(139, 92, 246, 0.5)" : "rgba(59, 130, 246, 0.5)";
|
|
1587
1779
|
const textColor = isCollection ? "#8b5cf6" : "#3b82f6";
|
|
1588
1780
|
const label = isCollection ? "CMS List" : "List";
|
|
1589
|
-
return h6(
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1781
|
+
return h6(
|
|
1782
|
+
"div",
|
|
1783
|
+
{
|
|
1784
|
+
key: context.key,
|
|
1785
|
+
"data-list": "true",
|
|
1786
|
+
"data-source-type": sourceType,
|
|
1787
|
+
"data-source": sourceType === "remote" ? listNode.url : sourceType === "sanity" ? listNode.documentType : listNode.source,
|
|
1788
|
+
style: {
|
|
1789
|
+
padding: "8px 12px",
|
|
1790
|
+
background: bgColor,
|
|
1791
|
+
border: `1px dashed ${borderColor}`,
|
|
1792
|
+
borderRadius: "4px",
|
|
1793
|
+
color: textColor,
|
|
1794
|
+
fontSize: "12px"
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
`[${label}: ${listNode.source || "No source"}]`
|
|
1798
|
+
);
|
|
1603
1799
|
},
|
|
1604
1800
|
ssrRenderer: (_node, _context) => {
|
|
1605
1801
|
return "<!-- list rendered by processList -->";
|
|
@@ -1614,7 +1810,7 @@ var init_ListNodeType = __esm({
|
|
|
1614
1810
|
label: "Source Type",
|
|
1615
1811
|
type: "select",
|
|
1616
1812
|
required: false,
|
|
1617
|
-
options: ["prop", "collection"]
|
|
1813
|
+
options: ["prop", "collection", "remote", "sanity"]
|
|
1618
1814
|
},
|
|
1619
1815
|
{
|
|
1620
1816
|
name: "source",
|
|
@@ -1635,6 +1831,240 @@ var init_ListNodeType = __esm({
|
|
|
1635
1831
|
}
|
|
1636
1832
|
});
|
|
1637
1833
|
|
|
1834
|
+
// lib/shared/registry/nodeTypes/IslandNodeType.ts
|
|
1835
|
+
import { z as z9 } from "zod";
|
|
1836
|
+
import { createElement as h7 } from "react";
|
|
1837
|
+
function islandName(src) {
|
|
1838
|
+
const base = src.split("/").pop() ?? src;
|
|
1839
|
+
return base.replace(/\.(tsx|jsx|vue|svelte)$/i, "") || base;
|
|
1840
|
+
}
|
|
1841
|
+
function islandChildren(node) {
|
|
1842
|
+
const { children } = node;
|
|
1843
|
+
if (Array.isArray(children)) return children.length > 0 ? children : void 0;
|
|
1844
|
+
if (typeof children === "string") return children.length > 0 ? children : void 0;
|
|
1845
|
+
return void 0;
|
|
1846
|
+
}
|
|
1847
|
+
function escapeHtml(value) {
|
|
1848
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1849
|
+
}
|
|
1850
|
+
var IslandClientDirectiveSchema, IslandNodeSchemaInternal, IslandNodeType;
|
|
1851
|
+
var init_IslandNodeType = __esm({
|
|
1852
|
+
"lib/shared/registry/nodeTypes/IslandNodeType.ts"() {
|
|
1853
|
+
"use strict";
|
|
1854
|
+
init_schemas();
|
|
1855
|
+
init_createNodeType();
|
|
1856
|
+
init_fieldPresets();
|
|
1857
|
+
IslandClientDirectiveSchema = z9.object({
|
|
1858
|
+
directive: z9.enum(["load", "idle", "visible", "media", "only"]),
|
|
1859
|
+
value: z9.string().optional()
|
|
1860
|
+
}).passthrough();
|
|
1861
|
+
IslandNodeSchemaInternal = z9.object({
|
|
1862
|
+
type: z9.literal("island"),
|
|
1863
|
+
// Path to the framework component file relative to `src/islands/`
|
|
1864
|
+
// (e.g. "Counter.tsx", "widgets/Chart.vue"). The extension derives the
|
|
1865
|
+
// framework, which drives the Astro integration that gets provisioned.
|
|
1866
|
+
src: z9.string(),
|
|
1867
|
+
client: IslandClientDirectiveSchema.optional(),
|
|
1868
|
+
props: z9.record(z9.string(), z9.any()).optional(),
|
|
1869
|
+
if: IfConditionSchema.optional(),
|
|
1870
|
+
// Conditional rendering - skip node when false
|
|
1871
|
+
// Slotted children (rendered server-side into the island's <slot/>).
|
|
1872
|
+
children: z9.union([z9.array(z9.any()), z9.string()]).optional()
|
|
1873
|
+
}).passthrough();
|
|
1874
|
+
IslandNodeType = createNodeType({
|
|
1875
|
+
type: "island",
|
|
1876
|
+
displayName: "Island",
|
|
1877
|
+
category: "special",
|
|
1878
|
+
schema: IslandNodeSchemaInternal,
|
|
1879
|
+
defaultValues: {
|
|
1880
|
+
src: "",
|
|
1881
|
+
client: { directive: "load" }
|
|
1882
|
+
},
|
|
1883
|
+
treeDisplay: {
|
|
1884
|
+
icon: "COMPONENT",
|
|
1885
|
+
getLabel: (node) => `Island: ${islandName(node.src) || "?"}`
|
|
1886
|
+
},
|
|
1887
|
+
editableFields: [
|
|
1888
|
+
textField({ name: "src", label: "Island file", required: true, placeholder: "Counter.tsx" }),
|
|
1889
|
+
selectField({
|
|
1890
|
+
name: "client.directive",
|
|
1891
|
+
label: "Hydration",
|
|
1892
|
+
// The empty-value entry clears `client` entirely → a server-rendered island
|
|
1893
|
+
// with zero JS (a valid Astro pattern); the rest map to `client:<directive>`.
|
|
1894
|
+
options: [{ value: "", label: "None (server-only, no JS)" }, "load", "idle", "visible", "media", "only"]
|
|
1895
|
+
})
|
|
1896
|
+
],
|
|
1897
|
+
// meno-core can't run a framework component. Instead of a loud highlight box
|
|
1898
|
+
// (which made island-heavy pages unreadable), render the island's slotted
|
|
1899
|
+
// children as normal content and fall back to a quiet inline marker when there
|
|
1900
|
+
// are none. The wrapper keeps `data-island` for selection/identification only.
|
|
1901
|
+
// Real hydration is play/build only.
|
|
1902
|
+
clientRenderer: (node, context) => {
|
|
1903
|
+
const children = islandChildren(node);
|
|
1904
|
+
const inner = children ? context.buildChildren(children, context.elementPath) : h7("span", { style: { color: "#9ca3af", fontSize: "13px" } }, islandName(node.src) || "?");
|
|
1905
|
+
return h7("div", { key: context.key, "data-island": node.src, style: { display: "contents" } }, inner);
|
|
1906
|
+
},
|
|
1907
|
+
ssrRenderer: (node, context) => {
|
|
1908
|
+
const children = islandChildren(node);
|
|
1909
|
+
const inner = children ? context.renderChildren(children, context) : `<span style="color:#9ca3af;font-size:13px">${escapeHtml(islandName(node.src) || "?")}</span>`;
|
|
1910
|
+
return `<div data-island="${escapeHtml(node.src)}" style="display:contents">${inner}</div>`;
|
|
1911
|
+
},
|
|
1912
|
+
capabilities: {
|
|
1913
|
+
canHaveChildren: true,
|
|
1914
|
+
canHaveStyle: false,
|
|
1915
|
+
canHaveAttributes: false,
|
|
1916
|
+
requiresProps: ["src"]
|
|
1917
|
+
}
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
});
|
|
1921
|
+
|
|
1922
|
+
// lib/shared/markdown.ts
|
|
1923
|
+
import MarkdownIt from "markdown-it";
|
|
1924
|
+
function renderMarkdown(source) {
|
|
1925
|
+
if (typeof source !== "string" || source.trim() === "") return "";
|
|
1926
|
+
return md.render(source);
|
|
1927
|
+
}
|
|
1928
|
+
var md;
|
|
1929
|
+
var init_markdown = __esm({
|
|
1930
|
+
"lib/shared/markdown.ts"() {
|
|
1931
|
+
"use strict";
|
|
1932
|
+
md = new MarkdownIt({ html: true, linkify: true, breaks: false });
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
|
|
1936
|
+
// lib/shared/registry/nodeTypes/MarkdownNodeType.ts
|
|
1937
|
+
import { z as z10 } from "zod";
|
|
1938
|
+
import { createElement as h8 } from "react";
|
|
1939
|
+
var MarkdownNodeSchemaInternal, MarkdownNodeType;
|
|
1940
|
+
var init_MarkdownNodeType = __esm({
|
|
1941
|
+
"lib/shared/registry/nodeTypes/MarkdownNodeType.ts"() {
|
|
1942
|
+
"use strict";
|
|
1943
|
+
init_markdown();
|
|
1944
|
+
init_schemas();
|
|
1945
|
+
init_createNodeType();
|
|
1946
|
+
init_fieldPresets();
|
|
1947
|
+
MarkdownNodeSchemaInternal = z10.object({
|
|
1948
|
+
type: z10.literal("markdown"),
|
|
1949
|
+
source: z10.string(),
|
|
1950
|
+
// verbatim Markdown source (whitespace-significant)
|
|
1951
|
+
label: z10.string().optional(),
|
|
1952
|
+
// Custom label displayed in structure tree
|
|
1953
|
+
if: IfConditionSchema.optional(),
|
|
1954
|
+
// Conditional rendering - skip node when false
|
|
1955
|
+
style: StyleValueSchema.optional(),
|
|
1956
|
+
interactiveStyles: InteractiveStylesSchema.optional(),
|
|
1957
|
+
generateElementClass: z10.boolean().optional(),
|
|
1958
|
+
attributes: z10.record(z10.string(), z10.union([z10.string(), z10.number(), z10.boolean()])).optional()
|
|
1959
|
+
}).passthrough();
|
|
1960
|
+
MarkdownNodeType = createNodeType({
|
|
1961
|
+
type: "markdown",
|
|
1962
|
+
displayName: "Markdown",
|
|
1963
|
+
category: "content",
|
|
1964
|
+
schema: MarkdownNodeSchemaInternal,
|
|
1965
|
+
defaultValues: {
|
|
1966
|
+
source: "",
|
|
1967
|
+
style: { base: {} }
|
|
1968
|
+
},
|
|
1969
|
+
treeDisplay: {
|
|
1970
|
+
icon: "HTML_ELEMENT",
|
|
1971
|
+
getLabel: () => "Markdown"
|
|
1972
|
+
},
|
|
1973
|
+
editableFields: [
|
|
1974
|
+
textareaField({
|
|
1975
|
+
name: "source",
|
|
1976
|
+
label: "Markdown",
|
|
1977
|
+
required: true,
|
|
1978
|
+
placeholder: "# Heading\n\nWrite **markdown** here\u2026"
|
|
1979
|
+
})
|
|
1980
|
+
],
|
|
1981
|
+
clientRenderer: (node, context) => {
|
|
1982
|
+
return h8("div", {
|
|
1983
|
+
key: context.key,
|
|
1984
|
+
dangerouslySetInnerHTML: { __html: renderMarkdown(node.source) }
|
|
1985
|
+
});
|
|
1986
|
+
},
|
|
1987
|
+
ssrRenderer: (node, _context) => {
|
|
1988
|
+
return `<div>${renderMarkdown(node.source)}</div>`;
|
|
1989
|
+
},
|
|
1990
|
+
capabilities: {
|
|
1991
|
+
canHaveChildren: false,
|
|
1992
|
+
requiresProps: ["source"]
|
|
1993
|
+
}
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
});
|
|
1997
|
+
|
|
1998
|
+
// lib/shared/registry/nodeTypes/CustomNodeType.ts
|
|
1999
|
+
import { z as z11 } from "zod";
|
|
2000
|
+
import { createElement as h9 } from "react";
|
|
2001
|
+
function customName(src) {
|
|
2002
|
+
const base = src.split("/").pop() ?? src;
|
|
2003
|
+
return base.replace(/\.astro$/i, "") || base;
|
|
2004
|
+
}
|
|
2005
|
+
function customChildren(node) {
|
|
2006
|
+
const { children } = node;
|
|
2007
|
+
if (Array.isArray(children)) return children.length > 0 ? children : void 0;
|
|
2008
|
+
if (typeof children === "string") return children.length > 0 ? children : void 0;
|
|
2009
|
+
return void 0;
|
|
2010
|
+
}
|
|
2011
|
+
function escapeHtml2(value) {
|
|
2012
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2013
|
+
}
|
|
2014
|
+
var CustomNodeSchemaInternal, CustomNodeType;
|
|
2015
|
+
var init_CustomNodeType = __esm({
|
|
2016
|
+
"lib/shared/registry/nodeTypes/CustomNodeType.ts"() {
|
|
2017
|
+
"use strict";
|
|
2018
|
+
init_schemas();
|
|
2019
|
+
init_createNodeType();
|
|
2020
|
+
init_fieldPresets();
|
|
2021
|
+
CustomNodeSchemaInternal = z11.object({
|
|
2022
|
+
type: z11.literal("custom"),
|
|
2023
|
+
// Path to the hand-authored .astro component relative to `src/custom/`
|
|
2024
|
+
// (e.g. "Fancy.astro", "widgets/Banner.astro").
|
|
2025
|
+
src: z11.string(),
|
|
2026
|
+
props: z11.record(z11.string(), z11.any()).optional(),
|
|
2027
|
+
if: IfConditionSchema.optional(),
|
|
2028
|
+
// Conditional rendering - skip node when false
|
|
2029
|
+
// Slotted children (rendered server-side into the component's default <slot/>).
|
|
2030
|
+
children: z11.union([z11.array(z11.any()), z11.string()]).optional()
|
|
2031
|
+
}).passthrough();
|
|
2032
|
+
CustomNodeType = createNodeType({
|
|
2033
|
+
type: "custom",
|
|
2034
|
+
displayName: "Custom Component",
|
|
2035
|
+
category: "special",
|
|
2036
|
+
schema: CustomNodeSchemaInternal,
|
|
2037
|
+
defaultValues: {
|
|
2038
|
+
src: ""
|
|
2039
|
+
},
|
|
2040
|
+
treeDisplay: {
|
|
2041
|
+
icon: "COMPONENT",
|
|
2042
|
+
getLabel: (node) => `Custom: ${customName(node.src) || "?"}`
|
|
2043
|
+
},
|
|
2044
|
+
editableFields: [textField({ name: "src", label: "Custom .astro file", required: true, placeholder: "Fancy.astro" })],
|
|
2045
|
+
// meno-core can't run a foreign `.astro` file. Render the slotted children as normal
|
|
2046
|
+
// content and fall back to a quiet inline marker when there are none. The wrapper keeps
|
|
2047
|
+
// `data-custom` for selection/identification only. Real rendering is play/build only.
|
|
2048
|
+
clientRenderer: (node, context) => {
|
|
2049
|
+
const children = customChildren(node);
|
|
2050
|
+
const inner = children ? context.buildChildren(children, context.elementPath) : h9("span", { style: { color: "#9ca3af", fontSize: "13px" } }, customName(node.src) || "?");
|
|
2051
|
+
return h9("div", { key: context.key, "data-custom": node.src, style: { display: "contents" } }, inner);
|
|
2052
|
+
},
|
|
2053
|
+
ssrRenderer: (node, context) => {
|
|
2054
|
+
const children = customChildren(node);
|
|
2055
|
+
const inner = children ? context.renderChildren(children, context) : `<span style="color:#9ca3af;font-size:13px">${escapeHtml2(customName(node.src) || "?")}</span>`;
|
|
2056
|
+
return `<div data-custom="${escapeHtml2(node.src)}" style="display:contents">${inner}</div>`;
|
|
2057
|
+
},
|
|
2058
|
+
capabilities: {
|
|
2059
|
+
canHaveChildren: true,
|
|
2060
|
+
canHaveStyle: false,
|
|
2061
|
+
canHaveAttributes: false,
|
|
2062
|
+
requiresProps: ["src"]
|
|
2063
|
+
}
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2067
|
+
|
|
1638
2068
|
// lib/shared/registry/nodeTypes/index.ts
|
|
1639
2069
|
function registerBuiltInNodeTypes() {
|
|
1640
2070
|
globalNodeTypeManager.registerAll(builtInNodeTypes);
|
|
@@ -1651,6 +2081,9 @@ var init_nodeTypes = __esm({
|
|
|
1651
2081
|
init_LinkNodeType();
|
|
1652
2082
|
init_LocaleListNodeType();
|
|
1653
2083
|
init_ListNodeType();
|
|
2084
|
+
init_IslandNodeType();
|
|
2085
|
+
init_MarkdownNodeType();
|
|
2086
|
+
init_CustomNodeType();
|
|
1654
2087
|
init_HtmlNodeType();
|
|
1655
2088
|
init_ComponentInstanceNodeType();
|
|
1656
2089
|
init_SlotMarkerType();
|
|
@@ -1658,6 +2091,9 @@ var init_nodeTypes = __esm({
|
|
|
1658
2091
|
init_LinkNodeType();
|
|
1659
2092
|
init_LocaleListNodeType();
|
|
1660
2093
|
init_ListNodeType();
|
|
2094
|
+
init_IslandNodeType();
|
|
2095
|
+
init_MarkdownNodeType();
|
|
2096
|
+
init_CustomNodeType();
|
|
1661
2097
|
builtInNodeTypes = [
|
|
1662
2098
|
HtmlNodeType,
|
|
1663
2099
|
ComponentInstanceNodeType,
|
|
@@ -1665,7 +2101,10 @@ var init_nodeTypes = __esm({
|
|
|
1665
2101
|
EmbedNodeType,
|
|
1666
2102
|
LinkNodeType,
|
|
1667
2103
|
LocaleListNodeType,
|
|
1668
|
-
ListNodeType
|
|
2104
|
+
ListNodeType,
|
|
2105
|
+
IslandNodeType,
|
|
2106
|
+
MarkdownNodeType,
|
|
2107
|
+
CustomNodeType
|
|
1669
2108
|
];
|
|
1670
2109
|
}
|
|
1671
2110
|
});
|
|
@@ -1718,28 +2157,334 @@ var init_registry = __esm({
|
|
|
1718
2157
|
}
|
|
1719
2158
|
});
|
|
1720
2159
|
|
|
1721
|
-
// lib/shared/
|
|
1722
|
-
var
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
hoverDebounce: 65,
|
|
1726
|
-
maxCacheSize: 10,
|
|
1727
|
-
cacheTTL: 5 * 60 * 1e3,
|
|
1728
|
-
// 5 minutes
|
|
1729
|
-
respectSaveData: true,
|
|
1730
|
-
slowConnectionThreshold: 2
|
|
2160
|
+
// lib/shared/breakpoints.ts
|
|
2161
|
+
var DEFAULT_BREAKPOINTS = {
|
|
2162
|
+
tablet: { breakpoint: 1024, previewPoint: 768 },
|
|
2163
|
+
mobile: { breakpoint: 540, previewPoint: 375 }
|
|
1731
2164
|
};
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
2165
|
+
function normalizeBreakpointConfig(input) {
|
|
2166
|
+
const result = {};
|
|
2167
|
+
for (const [name, value] of Object.entries(input)) {
|
|
2168
|
+
if (typeof value === "number") {
|
|
2169
|
+
result[name] = { breakpoint: value, previewPoint: value };
|
|
2170
|
+
} else if (typeof value === "object" && value !== null) {
|
|
2171
|
+
result[name] = {
|
|
2172
|
+
breakpoint: value.breakpoint,
|
|
2173
|
+
previewPoint: value.previewPoint ?? value.breakpoint,
|
|
2174
|
+
...value.label !== void 0 && { label: value.label }
|
|
2175
|
+
};
|
|
2176
|
+
}
|
|
2177
|
+
}
|
|
2178
|
+
return result;
|
|
1741
2179
|
}
|
|
1742
|
-
function
|
|
2180
|
+
function getBreakpointValues(config) {
|
|
2181
|
+
const result = {};
|
|
2182
|
+
for (const [name, entry] of Object.entries(config)) {
|
|
2183
|
+
result[name] = entry.breakpoint;
|
|
2184
|
+
}
|
|
2185
|
+
return result;
|
|
2186
|
+
}
|
|
2187
|
+
function getPreviewPointValues(config) {
|
|
2188
|
+
const result = {};
|
|
2189
|
+
for (const [name, entry] of Object.entries(config)) {
|
|
2190
|
+
result[name] = entry.previewPoint;
|
|
2191
|
+
}
|
|
2192
|
+
return result;
|
|
2193
|
+
}
|
|
2194
|
+
function getAllBreakpointNames(breakpoints = DEFAULT_BREAKPOINTS) {
|
|
2195
|
+
const names = ["base"];
|
|
2196
|
+
const breakpointEntries = Object.entries(breakpoints);
|
|
2197
|
+
breakpointEntries.sort((a, b) => b[1].breakpoint - a[1].breakpoint);
|
|
2198
|
+
for (const [name] of breakpointEntries) {
|
|
2199
|
+
names.push(name);
|
|
2200
|
+
}
|
|
2201
|
+
return names;
|
|
2202
|
+
}
|
|
2203
|
+
function getBreakpointName(viewportWidth, breakpoints = DEFAULT_BREAKPOINTS) {
|
|
2204
|
+
const breakpointEntries = Object.entries(breakpoints);
|
|
2205
|
+
breakpointEntries.sort((a, b) => a[1].breakpoint - b[1].breakpoint);
|
|
2206
|
+
for (const [name, entry] of breakpointEntries) {
|
|
2207
|
+
if (viewportWidth <= entry.breakpoint) {
|
|
2208
|
+
return name;
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
return "base";
|
|
2212
|
+
}
|
|
2213
|
+
function getBreakpointLabel(name, breakpoints = DEFAULT_BREAKPOINTS) {
|
|
2214
|
+
if (name === "base") {
|
|
2215
|
+
return "Desktop";
|
|
2216
|
+
}
|
|
2217
|
+
const entry = breakpoints[name];
|
|
2218
|
+
if (entry?.label) {
|
|
2219
|
+
return entry.label;
|
|
2220
|
+
}
|
|
2221
|
+
return name.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase()).trim();
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
// lib/shared/responsiveScaling.ts
|
|
2225
|
+
var DEFAULT_FLUID_RANGE = { min: 320, max: 1440 };
|
|
2226
|
+
var DEFAULT_SITE_MARGIN = { min: 16, max: 32 };
|
|
2227
|
+
function getScaleCategory(property) {
|
|
2228
|
+
const propertyStr = property;
|
|
2229
|
+
if (property === "fontSize") return "fontSize";
|
|
2230
|
+
if (propertyStr.startsWith("padding")) return "padding";
|
|
2231
|
+
if (propertyStr.startsWith("margin")) return "margin";
|
|
2232
|
+
if (property === "gap" || property === "rowGap" || property === "columnGap") return "gap";
|
|
2233
|
+
if (propertyStr === "borderRadius" || propertyStr.startsWith("border") && propertyStr.includes("Radius"))
|
|
2234
|
+
return "borderRadius";
|
|
2235
|
+
if (property === "width" || property === "height" || property === "maxWidth" || property === "maxHeight" || property === "minWidth" || property === "minHeight")
|
|
2236
|
+
return "size";
|
|
2237
|
+
return null;
|
|
2238
|
+
}
|
|
2239
|
+
function parseValue(valueStr) {
|
|
2240
|
+
const match = valueStr.trim().match(/^(-?[\d.]+)(px|rem|em|%|pt)$/);
|
|
2241
|
+
if (!match) return null;
|
|
2242
|
+
return {
|
|
2243
|
+
value: parseFloat(match[1] ?? ""),
|
|
2244
|
+
unit: match[2] ?? ""
|
|
2245
|
+
};
|
|
2246
|
+
}
|
|
2247
|
+
var SCALABLE_CSS_PROPERTIES = /* @__PURE__ */ new Set([
|
|
2248
|
+
"padding",
|
|
2249
|
+
"padding-left",
|
|
2250
|
+
"padding-right",
|
|
2251
|
+
"padding-top",
|
|
2252
|
+
"padding-bottom",
|
|
2253
|
+
"paddingLeft",
|
|
2254
|
+
"paddingRight",
|
|
2255
|
+
"paddingTop",
|
|
2256
|
+
"paddingBottom",
|
|
2257
|
+
"margin",
|
|
2258
|
+
"margin-left",
|
|
2259
|
+
"margin-right",
|
|
2260
|
+
"margin-top",
|
|
2261
|
+
"margin-bottom",
|
|
2262
|
+
"marginLeft",
|
|
2263
|
+
"marginRight",
|
|
2264
|
+
"marginTop",
|
|
2265
|
+
"marginBottom",
|
|
2266
|
+
"font-size",
|
|
2267
|
+
"fontSize",
|
|
2268
|
+
"gap",
|
|
2269
|
+
"row-gap",
|
|
2270
|
+
"column-gap",
|
|
2271
|
+
"rowGap",
|
|
2272
|
+
"columnGap",
|
|
2273
|
+
"border-radius",
|
|
2274
|
+
"borderRadius",
|
|
2275
|
+
"border-top-left-radius",
|
|
2276
|
+
"border-top-right-radius",
|
|
2277
|
+
"border-bottom-left-radius",
|
|
2278
|
+
"border-bottom-right-radius",
|
|
2279
|
+
"borderTopLeftRadius",
|
|
2280
|
+
"borderTopRightRadius",
|
|
2281
|
+
"borderBottomLeftRadius",
|
|
2282
|
+
"borderBottomRightRadius",
|
|
2283
|
+
"width",
|
|
2284
|
+
"height",
|
|
2285
|
+
"max-width",
|
|
2286
|
+
"max-height",
|
|
2287
|
+
"min-width",
|
|
2288
|
+
"min-height",
|
|
2289
|
+
"maxWidth",
|
|
2290
|
+
"maxHeight",
|
|
2291
|
+
"minWidth",
|
|
2292
|
+
"minHeight"
|
|
2293
|
+
]);
|
|
2294
|
+
function calculateResponsiveValue(baseValue, baseReference, scale) {
|
|
2295
|
+
if (Math.abs(baseValue) <= baseReference) {
|
|
2296
|
+
return Math.round(baseValue);
|
|
2297
|
+
}
|
|
2298
|
+
const scaled = baseValue + (baseValue - baseReference) * (scale - 1);
|
|
2299
|
+
return Math.round(scaled);
|
|
2300
|
+
}
|
|
2301
|
+
function getScaleMultiplier(scales, property, breakpoint) {
|
|
2302
|
+
const category = getScaleCategory(property);
|
|
2303
|
+
if (!category || !scales[category]) return null;
|
|
2304
|
+
const scaleConfig = scales[category];
|
|
2305
|
+
return scaleConfig?.[breakpoint] ?? null;
|
|
2306
|
+
}
|
|
2307
|
+
function parseMultiValue(valueStr) {
|
|
2308
|
+
const normalized = valueStr.replace(/(?<=\w)-(?=\d|auto|inherit|initial|unset)/g, " ");
|
|
2309
|
+
return normalized.trim().split(/\s+/).filter((v) => v.length > 0);
|
|
2310
|
+
}
|
|
2311
|
+
function scaleValue(valueStr, baseReference, scale) {
|
|
2312
|
+
const parsed = parseValue(valueStr);
|
|
2313
|
+
if (!parsed) return null;
|
|
2314
|
+
if (parsed.unit === "%" || parsed.unit === "em") {
|
|
2315
|
+
return valueStr.trim();
|
|
2316
|
+
}
|
|
2317
|
+
const scaledValue = calculateResponsiveValue(parsed.value, baseReference, scale);
|
|
2318
|
+
return `${scaledValue}${parsed.unit}`;
|
|
2319
|
+
}
|
|
2320
|
+
function scalePropertyValue(valueStr, baseReference, scale) {
|
|
2321
|
+
const parts = parseMultiValue(valueStr);
|
|
2322
|
+
if (parts.length === 0) return null;
|
|
2323
|
+
const scaledParts = parts.map((part) => {
|
|
2324
|
+
const scaled = scaleValue(part, baseReference, scale);
|
|
2325
|
+
if (scaled !== null) {
|
|
2326
|
+
return scaled;
|
|
2327
|
+
}
|
|
2328
|
+
return part;
|
|
2329
|
+
});
|
|
2330
|
+
return scaledParts.join(" ");
|
|
2331
|
+
}
|
|
2332
|
+
function getResponsiveValues(baseValue, property, scales, breakpointNames) {
|
|
2333
|
+
if (!scales.enabled) {
|
|
2334
|
+
return { base: baseValue };
|
|
2335
|
+
}
|
|
2336
|
+
const result = {
|
|
2337
|
+
base: baseValue
|
|
2338
|
+
};
|
|
2339
|
+
const baseRef = scales.baseReference || 16;
|
|
2340
|
+
const breakpoints = breakpointNames ?? ["tablet", "mobile"];
|
|
2341
|
+
for (const breakpointName of breakpoints) {
|
|
2342
|
+
const scale = getScaleMultiplier(scales, property, breakpointName);
|
|
2343
|
+
if (scale !== null) {
|
|
2344
|
+
result[breakpointName] = scalePropertyValue(baseValue, baseRef, scale);
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
return result;
|
|
2348
|
+
}
|
|
2349
|
+
function resolveVariableValueAtBreakpoint(variable, breakpoint, responsiveScales) {
|
|
2350
|
+
if (breakpoint === "base") return variable.value;
|
|
2351
|
+
const override = variable.scales?.[breakpoint];
|
|
2352
|
+
if (override !== void 0) return override;
|
|
2353
|
+
if (responsiveScales?.enabled && variable.type !== "none") {
|
|
2354
|
+
const scale = getScaleMultiplier(responsiveScales, variable.type, breakpoint);
|
|
2355
|
+
if (scale !== null) {
|
|
2356
|
+
const baseRef = responsiveScales.baseReference || 16;
|
|
2357
|
+
const scaled = scalePropertyValue(variable.value, baseRef, scale);
|
|
2358
|
+
if (scaled !== null) return scaled;
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
return variable.value;
|
|
2362
|
+
}
|
|
2363
|
+
function getSmallestBreakpointName(breakpoints) {
|
|
2364
|
+
if (!breakpoints) return null;
|
|
2365
|
+
const entries = Object.entries(breakpoints);
|
|
2366
|
+
const firstEntry = entries[0];
|
|
2367
|
+
if (entries.length === 0 || firstEntry === void 0) return null;
|
|
2368
|
+
let smallestName = firstEntry[0];
|
|
2369
|
+
let smallestWidth = firstEntry[1].breakpoint;
|
|
2370
|
+
for (const [name, cfg] of entries) {
|
|
2371
|
+
if (cfg.breakpoint < smallestWidth) {
|
|
2372
|
+
smallestWidth = cfg.breakpoint;
|
|
2373
|
+
smallestName = name;
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
return smallestName;
|
|
2377
|
+
}
|
|
2378
|
+
function buildFluidClamp(baseValue, unit, scale, vpMin, vpMax, baseReference = 16) {
|
|
2379
|
+
const max = baseValue;
|
|
2380
|
+
const min = calculateResponsiveValue(baseValue, baseReference, scale);
|
|
2381
|
+
if (min === max || vpMax === vpMin) {
|
|
2382
|
+
return `${formatNumber(max)}${unit}`;
|
|
2383
|
+
}
|
|
2384
|
+
const unitToPx = unit === "rem" ? 16 : 1;
|
|
2385
|
+
const minPx = min * unitToPx;
|
|
2386
|
+
const maxPx = max * unitToPx;
|
|
2387
|
+
const slopePx = (maxPx - minPx) / (vpMax - vpMin);
|
|
2388
|
+
const interceptPx = minPx - slopePx * vpMin;
|
|
2389
|
+
const interceptInUnit = interceptPx / unitToPx;
|
|
2390
|
+
const slopeVw = slopePx * 100;
|
|
2391
|
+
return `clamp(${formatNumber(min)}${unit}, ${formatNumber(interceptInUnit)}${unit} + ${formatNumber(slopeVw)}vw, ${formatNumber(max)}${unit})`;
|
|
2392
|
+
}
|
|
2393
|
+
function buildFluidClampWithExplicitMin(minValue, maxValue, unit, vpMin, vpMax) {
|
|
2394
|
+
if (minValue === maxValue || vpMax === vpMin) {
|
|
2395
|
+
return `${formatNumber(maxValue)}${unit}`;
|
|
2396
|
+
}
|
|
2397
|
+
const unitToPx = unit === "rem" ? 16 : 1;
|
|
2398
|
+
const minPx = minValue * unitToPx;
|
|
2399
|
+
const maxPx = maxValue * unitToPx;
|
|
2400
|
+
const slopePx = (maxPx - minPx) / (vpMax - vpMin);
|
|
2401
|
+
const interceptPx = minPx - slopePx * vpMin;
|
|
2402
|
+
const interceptInUnit = interceptPx / unitToPx;
|
|
2403
|
+
const slopeVw = slopePx * 100;
|
|
2404
|
+
return `clamp(${formatNumber(minValue)}${unit}, ${formatNumber(interceptInUnit)}${unit} + ${formatNumber(slopeVw)}vw, ${formatNumber(maxValue)}${unit})`;
|
|
2405
|
+
}
|
|
2406
|
+
function formatNumber(n) {
|
|
2407
|
+
if (Number.isInteger(n)) return String(n);
|
|
2408
|
+
return Number(n.toFixed(4)).toString();
|
|
2409
|
+
}
|
|
2410
|
+
function buildSiteMarginClamp(siteMargin, fluidRange) {
|
|
2411
|
+
const { min, max } = siteMargin;
|
|
2412
|
+
const { min: vpMin, max: vpMax } = fluidRange;
|
|
2413
|
+
if (min === max || vpMax === vpMin) {
|
|
2414
|
+
return `${formatNumber(max)}px`;
|
|
2415
|
+
}
|
|
2416
|
+
const slopePx = (max - min) / (vpMax - vpMin);
|
|
2417
|
+
const interceptPx = min - slopePx * vpMin;
|
|
2418
|
+
const slopeVw = slopePx * 100;
|
|
2419
|
+
return `clamp(${formatNumber(min)}px, ${formatNumber(interceptPx)}px + ${formatNumber(slopeVw)}vw, ${formatNumber(max)}px)`;
|
|
2420
|
+
}
|
|
2421
|
+
function buildFluidPropertyValue(valueStr, scale, vpMin, vpMax, baseReference = 16) {
|
|
2422
|
+
const parts = parseMultiValue(valueStr);
|
|
2423
|
+
if (parts.length === 0) return null;
|
|
2424
|
+
let anyScaled = false;
|
|
2425
|
+
const out = parts.map((part) => {
|
|
2426
|
+
const parsed = parseValue(part);
|
|
2427
|
+
if (!parsed) return part;
|
|
2428
|
+
if (parsed.unit === "%" || parsed.unit === "em") return part;
|
|
2429
|
+
anyScaled = true;
|
|
2430
|
+
return buildFluidClamp(parsed.value, parsed.unit, scale, vpMin, vpMax, baseReference);
|
|
2431
|
+
});
|
|
2432
|
+
return anyScaled ? out.join(" ") : null;
|
|
2433
|
+
}
|
|
2434
|
+
var DEFAULT_RESPONSIVE_SCALES = {
|
|
2435
|
+
enabled: false,
|
|
2436
|
+
mode: "breakpoints",
|
|
2437
|
+
baseReference: 16,
|
|
2438
|
+
fluidRange: { ...DEFAULT_FLUID_RANGE },
|
|
2439
|
+
siteMargin: { ...DEFAULT_SITE_MARGIN },
|
|
2440
|
+
fontSize: {
|
|
2441
|
+
tablet: 0.88,
|
|
2442
|
+
mobile: 0.75
|
|
2443
|
+
},
|
|
2444
|
+
padding: {
|
|
2445
|
+
tablet: 0.75,
|
|
2446
|
+
mobile: 0.5
|
|
2447
|
+
},
|
|
2448
|
+
margin: {
|
|
2449
|
+
tablet: 0.7,
|
|
2450
|
+
mobile: 0.45
|
|
2451
|
+
},
|
|
2452
|
+
gap: {
|
|
2453
|
+
tablet: 0.65,
|
|
2454
|
+
mobile: 0.4
|
|
2455
|
+
},
|
|
2456
|
+
borderRadius: {
|
|
2457
|
+
tablet: 0.85,
|
|
2458
|
+
mobile: 0.7
|
|
2459
|
+
},
|
|
2460
|
+
size: {
|
|
2461
|
+
tablet: 0.9,
|
|
2462
|
+
mobile: 0.75
|
|
2463
|
+
}
|
|
2464
|
+
};
|
|
2465
|
+
|
|
2466
|
+
// lib/shared/types/prefetch.ts
|
|
2467
|
+
var DEFAULT_PREFETCH_CONFIG = {
|
|
2468
|
+
enabled: false,
|
|
2469
|
+
defaultStrategy: "hover",
|
|
2470
|
+
hoverDebounce: 65,
|
|
2471
|
+
maxCacheSize: 10,
|
|
2472
|
+
cacheTTL: 5 * 60 * 1e3,
|
|
2473
|
+
// 5 minutes
|
|
2474
|
+
respectSaveData: true,
|
|
2475
|
+
slowConnectionThreshold: 2
|
|
2476
|
+
};
|
|
2477
|
+
|
|
2478
|
+
// lib/shared/validation/validators.ts
|
|
2479
|
+
init_schemas();
|
|
2480
|
+
function zodToValidationErrors(zodError) {
|
|
2481
|
+
return zodError.errors.map((err) => ({
|
|
2482
|
+
path: err.path.join(".") || "root",
|
|
2483
|
+
message: err.message,
|
|
2484
|
+
code: "INVALID_TYPE"
|
|
2485
|
+
}));
|
|
2486
|
+
}
|
|
2487
|
+
function validatePropDefinition(propDef) {
|
|
1743
2488
|
try {
|
|
1744
2489
|
const result = PropDefinitionSchema.safeParse(propDef);
|
|
1745
2490
|
if (result.success) {
|
|
@@ -1749,11 +2494,13 @@ function validatePropDefinition(propDef) {
|
|
|
1749
2494
|
} catch (error) {
|
|
1750
2495
|
return {
|
|
1751
2496
|
valid: false,
|
|
1752
|
-
errors: [
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
2497
|
+
errors: [
|
|
2498
|
+
{
|
|
2499
|
+
path: "root",
|
|
2500
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2501
|
+
code: "UNKNOWN"
|
|
2502
|
+
}
|
|
2503
|
+
]
|
|
1757
2504
|
};
|
|
1758
2505
|
}
|
|
1759
2506
|
}
|
|
@@ -1767,11 +2514,13 @@ function validateComponentNode(node) {
|
|
|
1767
2514
|
} catch (error) {
|
|
1768
2515
|
return {
|
|
1769
2516
|
valid: false,
|
|
1770
|
-
errors: [
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
2517
|
+
errors: [
|
|
2518
|
+
{
|
|
2519
|
+
path: "root",
|
|
2520
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2521
|
+
code: "UNKNOWN"
|
|
2522
|
+
}
|
|
2523
|
+
]
|
|
1775
2524
|
};
|
|
1776
2525
|
}
|
|
1777
2526
|
}
|
|
@@ -1785,11 +2534,13 @@ function validateStructuredComponentDefinition(def) {
|
|
|
1785
2534
|
} catch (error) {
|
|
1786
2535
|
return {
|
|
1787
2536
|
valid: false,
|
|
1788
|
-
errors: [
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
2537
|
+
errors: [
|
|
2538
|
+
{
|
|
2539
|
+
path: "root",
|
|
2540
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2541
|
+
code: "UNKNOWN"
|
|
2542
|
+
}
|
|
2543
|
+
]
|
|
1793
2544
|
};
|
|
1794
2545
|
}
|
|
1795
2546
|
}
|
|
@@ -1803,11 +2554,13 @@ function validateComponentDefinition(def) {
|
|
|
1803
2554
|
} catch (error) {
|
|
1804
2555
|
return {
|
|
1805
2556
|
valid: false,
|
|
1806
|
-
errors: [
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
2557
|
+
errors: [
|
|
2558
|
+
{
|
|
2559
|
+
path: "root",
|
|
2560
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2561
|
+
code: "UNKNOWN"
|
|
2562
|
+
}
|
|
2563
|
+
]
|
|
1811
2564
|
};
|
|
1812
2565
|
}
|
|
1813
2566
|
}
|
|
@@ -1821,11 +2574,13 @@ function validatePageData(data) {
|
|
|
1821
2574
|
} catch (error) {
|
|
1822
2575
|
return {
|
|
1823
2576
|
valid: false,
|
|
1824
|
-
errors: [
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
2577
|
+
errors: [
|
|
2578
|
+
{
|
|
2579
|
+
path: "root",
|
|
2580
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2581
|
+
code: "UNKNOWN"
|
|
2582
|
+
}
|
|
2583
|
+
]
|
|
1829
2584
|
};
|
|
1830
2585
|
}
|
|
1831
2586
|
}
|
|
@@ -1839,11 +2594,13 @@ function validatePageDataWithComponent(data) {
|
|
|
1839
2594
|
} catch (error) {
|
|
1840
2595
|
return {
|
|
1841
2596
|
valid: false,
|
|
1842
|
-
errors: [
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
2597
|
+
errors: [
|
|
2598
|
+
{
|
|
2599
|
+
path: "root",
|
|
2600
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2601
|
+
code: "UNKNOWN"
|
|
2602
|
+
}
|
|
2603
|
+
]
|
|
1847
2604
|
};
|
|
1848
2605
|
}
|
|
1849
2606
|
}
|
|
@@ -1857,11 +2614,13 @@ function validatePageMetaData(data) {
|
|
|
1857
2614
|
} catch (error) {
|
|
1858
2615
|
return {
|
|
1859
2616
|
valid: false,
|
|
1860
|
-
errors: [
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
2617
|
+
errors: [
|
|
2618
|
+
{
|
|
2619
|
+
path: "root",
|
|
2620
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2621
|
+
code: "UNKNOWN"
|
|
2622
|
+
}
|
|
2623
|
+
]
|
|
1865
2624
|
};
|
|
1866
2625
|
}
|
|
1867
2626
|
}
|
|
@@ -1875,11 +2634,13 @@ function validateCMSSchema(data) {
|
|
|
1875
2634
|
} catch (error) {
|
|
1876
2635
|
return {
|
|
1877
2636
|
valid: false,
|
|
1878
|
-
errors: [
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
2637
|
+
errors: [
|
|
2638
|
+
{
|
|
2639
|
+
path: "root",
|
|
2640
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2641
|
+
code: "UNKNOWN"
|
|
2642
|
+
}
|
|
2643
|
+
]
|
|
1883
2644
|
};
|
|
1884
2645
|
}
|
|
1885
2646
|
}
|
|
@@ -1893,11 +2654,13 @@ function validateCMSItem(data) {
|
|
|
1893
2654
|
} catch (error) {
|
|
1894
2655
|
return {
|
|
1895
2656
|
valid: false,
|
|
1896
|
-
errors: [
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2657
|
+
errors: [
|
|
2658
|
+
{
|
|
2659
|
+
path: "root",
|
|
2660
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2661
|
+
code: "UNKNOWN"
|
|
2662
|
+
}
|
|
2663
|
+
]
|
|
1901
2664
|
};
|
|
1902
2665
|
}
|
|
1903
2666
|
}
|
|
@@ -1911,11 +2674,13 @@ function validateCMSDraftItem(data) {
|
|
|
1911
2674
|
} catch (error) {
|
|
1912
2675
|
return {
|
|
1913
2676
|
valid: false,
|
|
1914
|
-
errors: [
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
2677
|
+
errors: [
|
|
2678
|
+
{
|
|
2679
|
+
path: "root",
|
|
2680
|
+
message: error instanceof Error ? error.message : "Unknown validation error",
|
|
2681
|
+
code: "UNKNOWN"
|
|
2682
|
+
}
|
|
2683
|
+
]
|
|
1919
2684
|
};
|
|
1920
2685
|
}
|
|
1921
2686
|
}
|
|
@@ -1935,18 +2700,29 @@ var IRREGULAR_PLURALS = {
|
|
|
1935
2700
|
vertices: "vertex",
|
|
1936
2701
|
matrices: "matrix"
|
|
1937
2702
|
};
|
|
1938
|
-
function
|
|
2703
|
+
function toIdentifier(name) {
|
|
2704
|
+
if (/^[A-Za-z_$][A-Za-z0-9_$]*$/.test(name)) return name;
|
|
2705
|
+
const parts = name.split(/[^A-Za-z0-9]+/).filter(Boolean);
|
|
2706
|
+
if (parts.length === 0) return "item";
|
|
2707
|
+
const camel = parts[0] + parts.slice(1).map((p) => p[0].toUpperCase() + p.slice(1)).join("");
|
|
2708
|
+
return /^[0-9]/.test(camel) ? `_${camel}` : camel;
|
|
2709
|
+
}
|
|
2710
|
+
function singularizeRaw(collection) {
|
|
1939
2711
|
if (IRREGULAR_PLURALS[collection]) {
|
|
1940
2712
|
return IRREGULAR_PLURALS[collection];
|
|
1941
2713
|
}
|
|
1942
2714
|
if (collection.endsWith("ies")) {
|
|
1943
|
-
return collection.slice(0, -3)
|
|
2715
|
+
return `${collection.slice(0, -3)}y`;
|
|
1944
2716
|
}
|
|
1945
2717
|
if (collection.endsWith("ses") || collection.endsWith("xes") || collection.endsWith("zes") || collection.endsWith("ches") || collection.endsWith("shes")) {
|
|
1946
2718
|
return collection.slice(0, -2);
|
|
1947
2719
|
}
|
|
1948
2720
|
return collection.endsWith("s") ? collection.slice(0, -1) : collection;
|
|
1949
2721
|
}
|
|
2722
|
+
function singularize(collection) {
|
|
2723
|
+
if (typeof collection !== "string" || collection === "") return "item";
|
|
2724
|
+
return toIdentifier(singularizeRaw(collection));
|
|
2725
|
+
}
|
|
1950
2726
|
function isItemDraftForLocale(item, locale) {
|
|
1951
2727
|
return item._draftLocales?.includes(locale) === true;
|
|
1952
2728
|
}
|
|
@@ -1990,6 +2766,10 @@ function evaluateNode(node, context) {
|
|
|
1990
2766
|
const left2 = evaluateNode(binaryNode.left, context);
|
|
1991
2767
|
return left2 ? left2 : evaluateNode(binaryNode.right, context);
|
|
1992
2768
|
}
|
|
2769
|
+
if (binaryNode.operator === "??") {
|
|
2770
|
+
const left2 = evaluateNode(binaryNode.left, context);
|
|
2771
|
+
return left2 === null || left2 === void 0 ? evaluateNode(binaryNode.right, context) : left2;
|
|
2772
|
+
}
|
|
1993
2773
|
const left = evaluateNode(binaryNode.left, context);
|
|
1994
2774
|
const right = evaluateNode(binaryNode.right, context);
|
|
1995
2775
|
switch (binaryNode.operator) {
|
|
@@ -2047,9 +2827,7 @@ function evaluateNode(node, context) {
|
|
|
2047
2827
|
}
|
|
2048
2828
|
case "ArrayExpression": {
|
|
2049
2829
|
const arrayNode = node;
|
|
2050
|
-
return arrayNode.elements.map(
|
|
2051
|
-
(el) => el ? evaluateNode(el, context) : void 0
|
|
2052
|
-
);
|
|
2830
|
+
return arrayNode.elements.map((el) => el ? evaluateNode(el, context) : void 0);
|
|
2053
2831
|
}
|
|
2054
2832
|
case "CallExpression": {
|
|
2055
2833
|
throw new Error("Function calls are not supported in template expressions");
|
|
@@ -2169,7 +2947,7 @@ function buildEvalContext(ctx) {
|
|
|
2169
2947
|
return evalContext;
|
|
2170
2948
|
}
|
|
2171
2949
|
function processItemTemplate(text, ctx, resolveValue) {
|
|
2172
|
-
|
|
2950
|
+
const result = text.replace(/\{\{([^}]+)\}\}/g, (match, expression) => {
|
|
2173
2951
|
const trimmed = expression.trim();
|
|
2174
2952
|
if (isComplexExpression(trimmed)) {
|
|
2175
2953
|
const evalContext = buildEvalContext(ctx);
|
|
@@ -2205,7 +2983,8 @@ function processItemTemplate(text, ctx, resolveValue) {
|
|
|
2205
2983
|
function resolveCompleteTemplateRaw(template, ctx, resolveValue) {
|
|
2206
2984
|
const match = template.match(/^\{\{(\w+)\.([^}]+)\}\}$/);
|
|
2207
2985
|
if (!match) return void 0;
|
|
2208
|
-
const
|
|
2986
|
+
const varName = match[1] ?? "";
|
|
2987
|
+
const fieldPath = match[2] ?? "";
|
|
2209
2988
|
const trimmedField = fieldPath.trim();
|
|
2210
2989
|
if (/[?:<>=!&|+\-*/%]/.test(trimmedField)) return void 0;
|
|
2211
2990
|
const item = ctx[varName];
|
|
@@ -2251,7 +3030,8 @@ function resolveItemsTemplate(template, ctx) {
|
|
|
2251
3030
|
if (!match) {
|
|
2252
3031
|
return template;
|
|
2253
3032
|
}
|
|
2254
|
-
const
|
|
3033
|
+
const varName = match[1] ?? "";
|
|
3034
|
+
const fieldPath = match[2] ?? "";
|
|
2255
3035
|
const item = ctx[varName];
|
|
2256
3036
|
if (!item || typeof item !== "object") {
|
|
2257
3037
|
return void 0;
|
|
@@ -2268,7 +3048,8 @@ function resolveItemsTemplate(template, ctx) {
|
|
|
2268
3048
|
function resolveTemplateRawValue(template, ctx) {
|
|
2269
3049
|
const match = template.match(/^\{\{(\w+)\.([^}]+)\}\}$/);
|
|
2270
3050
|
if (!match) return void 0;
|
|
2271
|
-
const
|
|
3051
|
+
const varName = match[1] ?? "";
|
|
3052
|
+
const fieldPath = match[2] ?? "";
|
|
2272
3053
|
const item = ctx[varName];
|
|
2273
3054
|
if (!item || typeof item !== "object") return void 0;
|
|
2274
3055
|
return getNestedValue(item, fieldPath.trim());
|
|
@@ -2306,6 +3087,7 @@ function buildItemUrl(urlPattern, item, slugField, locale, i18nConfig) {
|
|
|
2306
3087
|
return urlPattern.replace("{{slug}}", String(slug));
|
|
2307
3088
|
}
|
|
2308
3089
|
function addItemUrl(item, schema, locale, i18nConfig) {
|
|
3090
|
+
if (!schema.urlPattern || !schema.slugField) return item;
|
|
2309
3091
|
return {
|
|
2310
3092
|
...item,
|
|
2311
3093
|
_url: buildItemUrl(schema.urlPattern, item, schema.slugField, locale, i18nConfig)
|
|
@@ -2481,7 +3263,8 @@ function extractNodeProperties(node) {
|
|
|
2481
3263
|
}
|
|
2482
3264
|
function isLikelyComponentTag(tag) {
|
|
2483
3265
|
if (!tag) return false;
|
|
2484
|
-
|
|
3266
|
+
const first = tag[0];
|
|
3267
|
+
return first !== void 0 && first === first.toUpperCase() && first !== first.toLowerCase();
|
|
2485
3268
|
}
|
|
2486
3269
|
function isSlotMarker(node) {
|
|
2487
3270
|
return node?.type === NODE_TYPE.SLOT;
|
|
@@ -2514,6 +3297,12 @@ function isLinkNode(node) {
|
|
|
2514
3297
|
function isLocaleListNode(node) {
|
|
2515
3298
|
return node?.type === NODE_TYPE.LOCALE_LIST;
|
|
2516
3299
|
}
|
|
3300
|
+
function isIslandNode(node) {
|
|
3301
|
+
return node?.type === NODE_TYPE.ISLAND;
|
|
3302
|
+
}
|
|
3303
|
+
function isCustomNode(node) {
|
|
3304
|
+
return node?.type === NODE_TYPE.CUSTOM;
|
|
3305
|
+
}
|
|
2517
3306
|
function isCMSListNode(node) {
|
|
2518
3307
|
if (node === null || typeof node !== "object") return false;
|
|
2519
3308
|
const n = node;
|
|
@@ -2525,10 +3314,10 @@ function isListNode(node) {
|
|
|
2525
3314
|
return n.type === NODE_TYPE.LIST || n.type === "cms-list";
|
|
2526
3315
|
}
|
|
2527
3316
|
function isValidNodeType(type) {
|
|
2528
|
-
return type === NODE_TYPE.NODE || type === NODE_TYPE.COMPONENT || type === NODE_TYPE.SLOT || type === NODE_TYPE.EMBED || type === NODE_TYPE.LINK || type === NODE_TYPE.LOCALE_LIST || type === NODE_TYPE.LIST || type === "cms-list";
|
|
3317
|
+
return type === NODE_TYPE.NODE || type === NODE_TYPE.COMPONENT || type === NODE_TYPE.SLOT || type === NODE_TYPE.EMBED || type === NODE_TYPE.LINK || type === NODE_TYPE.LOCALE_LIST || type === NODE_TYPE.LIST || type === NODE_TYPE.ISLAND || type === NODE_TYPE.CUSTOM || type === NODE_TYPE.MARKDOWN || type === "cms-list";
|
|
2529
3318
|
}
|
|
2530
3319
|
function canHaveChildren(node) {
|
|
2531
|
-
return node !== null && node !== void 0 && !isSlotMarker(node);
|
|
3320
|
+
return node !== null && node !== void 0 && !isSlotMarker(node) && node._code !== true;
|
|
2532
3321
|
}
|
|
2533
3322
|
function canHaveStyle(node) {
|
|
2534
3323
|
return node !== null && node !== void 0 && !isSlotMarker(node);
|
|
@@ -2624,7 +3413,7 @@ function coerceValue(value, expectedType) {
|
|
|
2624
3413
|
}
|
|
2625
3414
|
if (typeof value === "string") {
|
|
2626
3415
|
const num = Number(value);
|
|
2627
|
-
if (!isNaN(num) && isFinite(num)) {
|
|
3416
|
+
if (!Number.isNaN(num) && Number.isFinite(num)) {
|
|
2628
3417
|
return num;
|
|
2629
3418
|
}
|
|
2630
3419
|
}
|
|
@@ -2830,7 +3619,7 @@ function resolveComponentProps(options) {
|
|
|
2830
3619
|
result = resolveI18nInProps(result, locale, i18nConfig);
|
|
2831
3620
|
}
|
|
2832
3621
|
return wrapRichTextProps(result, propDefs);
|
|
2833
|
-
} catch (
|
|
3622
|
+
} catch (_error) {
|
|
2834
3623
|
const resolvedProps = {};
|
|
2835
3624
|
for (const [propName, propDef] of Object.entries(propDefs)) {
|
|
2836
3625
|
if (propDef && typeof propDef === "object" && "default" in propDef) {
|
|
@@ -2861,58 +3650,141 @@ function resolvePropsFromDefinition(componentDef, passedProps = {}, children = [
|
|
|
2861
3650
|
});
|
|
2862
3651
|
}
|
|
2863
3652
|
|
|
2864
|
-
// lib/shared/styleValueRegistry.ts
|
|
2865
|
-
var registry = /* @__PURE__ */ new Map();
|
|
2866
|
-
var dynamicRegistry = /* @__PURE__ */ new Map();
|
|
2867
|
-
function registerStyleValue(className, value) {
|
|
2868
|
-
registry.set(className, value);
|
|
2869
|
-
}
|
|
2870
|
-
function registerDynamicStyle(className, property, value) {
|
|
2871
|
-
dynamicRegistry.set(className, { property, value });
|
|
2872
|
-
}
|
|
2873
|
-
function getStyleValue(className) {
|
|
2874
|
-
return registry.get(className);
|
|
2875
|
-
}
|
|
2876
|
-
function getDynamicStyle(className) {
|
|
2877
|
-
return dynamicRegistry.get(className);
|
|
2878
|
-
}
|
|
2879
|
-
function isDynamicClass(className) {
|
|
2880
|
-
return dynamicRegistry.has(className);
|
|
2881
|
-
}
|
|
2882
|
-
function getAllDynamicClasses() {
|
|
2883
|
-
return Array.from(dynamicRegistry.keys());
|
|
2884
|
-
}
|
|
2885
|
-
function clearRegistry() {
|
|
2886
|
-
registry.clear();
|
|
2887
|
-
dynamicRegistry.clear();
|
|
2888
|
-
}
|
|
2889
|
-
function serializeRegistry() {
|
|
2890
|
-
return JSON.stringify({
|
|
2891
|
-
standard: Array.from(registry.entries()),
|
|
2892
|
-
dynamic: Array.from(dynamicRegistry.entries())
|
|
2893
|
-
});
|
|
2894
|
-
}
|
|
2895
|
-
function hydrateRegistry(data) {
|
|
2896
|
-
const parsed = JSON.parse(data);
|
|
2897
|
-
if (Array.isArray(parsed)) {
|
|
2898
|
-
for (const [key, value] of parsed) {
|
|
2899
|
-
registry.set(key, value);
|
|
2900
|
-
}
|
|
2901
|
-
} else {
|
|
2902
|
-
if (parsed.standard) {
|
|
2903
|
-
for (const [key, value] of parsed.standard) {
|
|
2904
|
-
registry.set(key, value);
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
if (parsed.dynamic) {
|
|
2908
|
-
for (const [key, value] of parsed.dynamic) {
|
|
2909
|
-
dynamicRegistry.set(key, value);
|
|
2910
|
-
}
|
|
2911
|
-
}
|
|
2912
|
-
}
|
|
2913
|
-
}
|
|
2914
|
-
|
|
2915
3653
|
// lib/shared/utilityClassConfig.ts
|
|
3654
|
+
var propertyOrder = [
|
|
3655
|
+
// Padding
|
|
3656
|
+
"padding",
|
|
3657
|
+
"paddingTop",
|
|
3658
|
+
"paddingRight",
|
|
3659
|
+
"paddingBottom",
|
|
3660
|
+
"paddingLeft",
|
|
3661
|
+
"paddingInline",
|
|
3662
|
+
"paddingBlock",
|
|
3663
|
+
// Margin
|
|
3664
|
+
"margin",
|
|
3665
|
+
"marginTop",
|
|
3666
|
+
"marginRight",
|
|
3667
|
+
"marginBottom",
|
|
3668
|
+
"marginLeft",
|
|
3669
|
+
"marginInline",
|
|
3670
|
+
"marginBlock",
|
|
3671
|
+
// Display & Layout
|
|
3672
|
+
"display",
|
|
3673
|
+
"flexDirection",
|
|
3674
|
+
"justifyContent",
|
|
3675
|
+
"alignItems",
|
|
3676
|
+
"alignContent",
|
|
3677
|
+
"flex",
|
|
3678
|
+
"flexWrap",
|
|
3679
|
+
"gap",
|
|
3680
|
+
"rowGap",
|
|
3681
|
+
"columnGap",
|
|
3682
|
+
// Sizing
|
|
3683
|
+
"width",
|
|
3684
|
+
"height",
|
|
3685
|
+
"maxWidth",
|
|
3686
|
+
"maxHeight",
|
|
3687
|
+
"minWidth",
|
|
3688
|
+
"minHeight",
|
|
3689
|
+
"aspectRatio",
|
|
3690
|
+
// Colors & Background
|
|
3691
|
+
"backgroundColor",
|
|
3692
|
+
"background",
|
|
3693
|
+
"backgroundImage",
|
|
3694
|
+
"color",
|
|
3695
|
+
// Borders & Radius
|
|
3696
|
+
"border",
|
|
3697
|
+
"borderRadius",
|
|
3698
|
+
"borderTop",
|
|
3699
|
+
"borderRight",
|
|
3700
|
+
"borderBottom",
|
|
3701
|
+
"borderLeft",
|
|
3702
|
+
"borderTopLeftRadius",
|
|
3703
|
+
"borderTopRightRadius",
|
|
3704
|
+
"borderBottomLeftRadius",
|
|
3705
|
+
"borderBottomRightRadius",
|
|
3706
|
+
"borderColor",
|
|
3707
|
+
// Text
|
|
3708
|
+
"fontSize",
|
|
3709
|
+
"fontWeight",
|
|
3710
|
+
"fontFamily",
|
|
3711
|
+
"textAlign",
|
|
3712
|
+
"textDecoration",
|
|
3713
|
+
"textTransform",
|
|
3714
|
+
"lineHeight",
|
|
3715
|
+
"letterSpacing",
|
|
3716
|
+
"wordBreak",
|
|
3717
|
+
"overflowWrap",
|
|
3718
|
+
"textIndent",
|
|
3719
|
+
"verticalAlign",
|
|
3720
|
+
"whiteSpace",
|
|
3721
|
+
// Lists
|
|
3722
|
+
"listStyle",
|
|
3723
|
+
"listStyleType",
|
|
3724
|
+
"listStylePosition",
|
|
3725
|
+
// Transform & Effects
|
|
3726
|
+
"opacity",
|
|
3727
|
+
"transform",
|
|
3728
|
+
"transformOrigin",
|
|
3729
|
+
"boxShadow",
|
|
3730
|
+
"textShadow",
|
|
3731
|
+
"filter",
|
|
3732
|
+
"backdropFilter",
|
|
3733
|
+
"backfaceVisibility",
|
|
3734
|
+
"mixBlendMode",
|
|
3735
|
+
"clipPath",
|
|
3736
|
+
// Positioning
|
|
3737
|
+
"position",
|
|
3738
|
+
"top",
|
|
3739
|
+
"right",
|
|
3740
|
+
"bottom",
|
|
3741
|
+
"left",
|
|
3742
|
+
"inset",
|
|
3743
|
+
"zIndex",
|
|
3744
|
+
// Grid Layout
|
|
3745
|
+
"gridTemplateColumns",
|
|
3746
|
+
"gridTemplateRows",
|
|
3747
|
+
"gridTemplateAreas",
|
|
3748
|
+
"gridGap",
|
|
3749
|
+
"gridAutoFlow",
|
|
3750
|
+
"gridColumn",
|
|
3751
|
+
"gridRow",
|
|
3752
|
+
"gridArea",
|
|
3753
|
+
"gridAutoRows",
|
|
3754
|
+
"gridAutoColumns",
|
|
3755
|
+
"justifyItems",
|
|
3756
|
+
"justifySelf",
|
|
3757
|
+
"placeContent",
|
|
3758
|
+
"placeItems",
|
|
3759
|
+
"placeSelf",
|
|
3760
|
+
// Flexbox extras
|
|
3761
|
+
"flexGrow",
|
|
3762
|
+
"flexShrink",
|
|
3763
|
+
"flexBasis",
|
|
3764
|
+
"order",
|
|
3765
|
+
"alignSelf",
|
|
3766
|
+
// Outline
|
|
3767
|
+
"outline",
|
|
3768
|
+
"outlineWidth",
|
|
3769
|
+
"outlineStyle",
|
|
3770
|
+
"outlineColor",
|
|
3771
|
+
"outlineOffset",
|
|
3772
|
+
// Other
|
|
3773
|
+
"overflow",
|
|
3774
|
+
"overflowX",
|
|
3775
|
+
"overflowY",
|
|
3776
|
+
"cursor",
|
|
3777
|
+
"pointerEvents",
|
|
3778
|
+
"userSelect",
|
|
3779
|
+
"transition",
|
|
3780
|
+
"objectFit",
|
|
3781
|
+
"objectPosition",
|
|
3782
|
+
"boxSizing",
|
|
3783
|
+
"visibility",
|
|
3784
|
+
"resize",
|
|
3785
|
+
"scrollBehavior",
|
|
3786
|
+
"accentColor"
|
|
3787
|
+
];
|
|
2916
3788
|
var propertyMap = {
|
|
2917
3789
|
// Padding
|
|
2918
3790
|
padding: "p",
|
|
@@ -2930,122 +3802,84 @@ var propertyMap = {
|
|
|
2930
3802
|
marginLeft: "ml",
|
|
2931
3803
|
marginInline: "mx",
|
|
2932
3804
|
marginBlock: "my",
|
|
2933
|
-
//
|
|
2934
|
-
display: "d",
|
|
2935
|
-
flexDirection: "fd",
|
|
2936
|
-
justifyContent: "jc",
|
|
2937
|
-
alignItems: "ai",
|
|
2938
|
-
alignContent: "ac",
|
|
3805
|
+
// Flexbox
|
|
2939
3806
|
flex: "flex",
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
3807
|
+
gap: "gap",
|
|
3808
|
+
rowGap: "gap-y",
|
|
3809
|
+
columnGap: "gap-x",
|
|
3810
|
+
flexGrow: "grow",
|
|
3811
|
+
flexShrink: "shrink",
|
|
3812
|
+
flexBasis: "basis",
|
|
3813
|
+
order: "order",
|
|
2944
3814
|
// Sizing
|
|
2945
3815
|
width: "w",
|
|
2946
3816
|
height: "h",
|
|
2947
|
-
maxWidth: "
|
|
2948
|
-
maxHeight: "
|
|
2949
|
-
minWidth: "
|
|
2950
|
-
minHeight: "
|
|
2951
|
-
aspectRatio: "
|
|
3817
|
+
maxWidth: "max-w",
|
|
3818
|
+
maxHeight: "max-h",
|
|
3819
|
+
minWidth: "min-w",
|
|
3820
|
+
minHeight: "min-h",
|
|
3821
|
+
aspectRatio: "aspect",
|
|
2952
3822
|
// Colors & Background
|
|
2953
|
-
backgroundColor: "
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
color: "c",
|
|
3823
|
+
backgroundColor: "bg",
|
|
3824
|
+
backgroundImage: "bg",
|
|
3825
|
+
color: "text",
|
|
2957
3826
|
// Borders & Radius
|
|
2958
|
-
border: "
|
|
2959
|
-
|
|
2960
|
-
borderTop: "
|
|
3827
|
+
border: "border",
|
|
3828
|
+
borderColor: "border",
|
|
3829
|
+
borderTop: "border-t",
|
|
2961
3830
|
borderRight: "border-r",
|
|
2962
|
-
borderBottom: "
|
|
2963
|
-
borderLeft: "
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
3831
|
+
borderBottom: "border-b",
|
|
3832
|
+
borderLeft: "border-l",
|
|
3833
|
+
borderRadius: "rounded",
|
|
3834
|
+
borderTopLeftRadius: "rounded-tl",
|
|
3835
|
+
borderTopRightRadius: "rounded-tr",
|
|
3836
|
+
borderBottomLeftRadius: "rounded-bl",
|
|
3837
|
+
borderBottomRightRadius: "rounded-br",
|
|
2969
3838
|
// Text
|
|
2970
|
-
fontSize: "
|
|
2971
|
-
fontWeight: "
|
|
2972
|
-
fontFamily: "
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
letterSpacing: "ls",
|
|
2978
|
-
wordBreak: "wb",
|
|
2979
|
-
overflowWrap: "ow",
|
|
2980
|
-
textIndent: "ti",
|
|
2981
|
-
verticalAlign: "va",
|
|
2982
|
-
whiteSpace: "whs",
|
|
3839
|
+
fontSize: "text",
|
|
3840
|
+
fontWeight: "font",
|
|
3841
|
+
fontFamily: "font",
|
|
3842
|
+
lineHeight: "leading",
|
|
3843
|
+
letterSpacing: "tracking",
|
|
3844
|
+
textIndent: "indent",
|
|
3845
|
+
verticalAlign: "align",
|
|
2983
3846
|
// Lists
|
|
2984
|
-
|
|
2985
|
-
listStyleType: "lstt",
|
|
2986
|
-
listStylePosition: "lstp",
|
|
3847
|
+
listStyleType: "list",
|
|
2987
3848
|
// Transform & Effects
|
|
2988
|
-
opacity: "
|
|
2989
|
-
transform: "
|
|
2990
|
-
transformOrigin: "
|
|
2991
|
-
boxShadow: "
|
|
2992
|
-
textShadow: "
|
|
2993
|
-
filter: "
|
|
2994
|
-
backdropFilter: "
|
|
2995
|
-
backfaceVisibility: "bfv",
|
|
2996
|
-
mixBlendMode: "mbm",
|
|
2997
|
-
clipPath: "cp",
|
|
3849
|
+
opacity: "opacity",
|
|
3850
|
+
transform: "transform",
|
|
3851
|
+
transformOrigin: "origin",
|
|
3852
|
+
boxShadow: "shadow",
|
|
3853
|
+
textShadow: "text-shadow",
|
|
3854
|
+
filter: "filter",
|
|
3855
|
+
backdropFilter: "backdrop-filter",
|
|
2998
3856
|
// Positioning
|
|
2999
|
-
position: "pos",
|
|
3000
3857
|
top: "top",
|
|
3001
|
-
right: "
|
|
3002
|
-
bottom: "
|
|
3003
|
-
left: "
|
|
3004
|
-
inset: "
|
|
3858
|
+
right: "right",
|
|
3859
|
+
bottom: "bottom",
|
|
3860
|
+
left: "left",
|
|
3861
|
+
inset: "inset",
|
|
3005
3862
|
zIndex: "z",
|
|
3006
3863
|
// Grid Layout
|
|
3007
|
-
gridTemplateColumns: "
|
|
3008
|
-
gridTemplateRows: "
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
gridRow: "gr",
|
|
3014
|
-
gridArea: "ga",
|
|
3015
|
-
gridAutoRows: "gar",
|
|
3016
|
-
gridAutoColumns: "gac",
|
|
3017
|
-
justifyItems: "ji",
|
|
3018
|
-
justifySelf: "jse",
|
|
3019
|
-
placeContent: "plc",
|
|
3020
|
-
placeItems: "pli",
|
|
3021
|
-
placeSelf: "pls",
|
|
3022
|
-
// Flexbox extras
|
|
3023
|
-
flexGrow: "fg",
|
|
3024
|
-
flexShrink: "fsh",
|
|
3025
|
-
flexBasis: "fb",
|
|
3026
|
-
order: "ord",
|
|
3027
|
-
alignSelf: "as",
|
|
3864
|
+
gridTemplateColumns: "grid-cols",
|
|
3865
|
+
gridTemplateRows: "grid-rows",
|
|
3866
|
+
gridColumn: "col",
|
|
3867
|
+
gridRow: "row",
|
|
3868
|
+
gridAutoRows: "auto-rows",
|
|
3869
|
+
gridAutoColumns: "auto-cols",
|
|
3028
3870
|
// Outline
|
|
3029
|
-
outline: "
|
|
3030
|
-
outlineWidth: "
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
outlineOffset: "olo",
|
|
3871
|
+
outline: "outline",
|
|
3872
|
+
outlineWidth: "outline",
|
|
3873
|
+
outlineColor: "outline",
|
|
3874
|
+
outlineOffset: "outline-offset",
|
|
3034
3875
|
// Other
|
|
3035
|
-
overflow: "
|
|
3036
|
-
overflowX: "
|
|
3037
|
-
overflowY: "
|
|
3038
|
-
cursor: "
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
objectFit: "objf",
|
|
3043
|
-
objectPosition: "objp",
|
|
3044
|
-
boxSizing: "bsz",
|
|
3045
|
-
visibility: "vis",
|
|
3046
|
-
resize: "rsz",
|
|
3047
|
-
scrollBehavior: "scb",
|
|
3048
|
-
accentColor: "acc"
|
|
3876
|
+
overflow: "overflow",
|
|
3877
|
+
overflowX: "overflow-x",
|
|
3878
|
+
overflowY: "overflow-y",
|
|
3879
|
+
cursor: "cursor",
|
|
3880
|
+
transition: "transition",
|
|
3881
|
+
objectPosition: "object",
|
|
3882
|
+
accentColor: "accent"
|
|
3049
3883
|
};
|
|
3050
3884
|
var prefixToCSSProperty = {
|
|
3051
3885
|
// Spacing
|
|
@@ -3063,251 +3897,482 @@ var prefixToCSSProperty = {
|
|
|
3063
3897
|
ml: "margin-left",
|
|
3064
3898
|
mx: "margin",
|
|
3065
3899
|
my: "margin",
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3900
|
+
gap: "gap",
|
|
3901
|
+
"gap-y": "row-gap",
|
|
3902
|
+
"gap-x": "column-gap",
|
|
3069
3903
|
// Sizing
|
|
3070
3904
|
w: "width",
|
|
3071
3905
|
h: "height",
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3906
|
+
"max-w": "max-width",
|
|
3907
|
+
"max-h": "max-height",
|
|
3908
|
+
"min-w": "min-width",
|
|
3909
|
+
"min-h": "min-height",
|
|
3910
|
+
aspect: "aspect-ratio",
|
|
3077
3911
|
// Colors & Background
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
c: "color",
|
|
3082
|
-
bc: "border-color",
|
|
3912
|
+
bg: "background-color",
|
|
3913
|
+
text: "color",
|
|
3914
|
+
accent: "accent-color",
|
|
3083
3915
|
// Borders
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
brtl: "border-top-left-radius",
|
|
3087
|
-
brtr: "border-top-right-radius",
|
|
3088
|
-
brbl: "border-bottom-left-radius",
|
|
3089
|
-
brbr: "border-bottom-right-radius",
|
|
3090
|
-
bt: "border-top",
|
|
3091
|
-
bb: "border-bottom",
|
|
3092
|
-
bl: "border-left",
|
|
3916
|
+
border: "border",
|
|
3917
|
+
"border-t": "border-top",
|
|
3093
3918
|
"border-r": "border-right",
|
|
3919
|
+
"border-b": "border-bottom",
|
|
3920
|
+
"border-l": "border-left",
|
|
3921
|
+
rounded: "border-radius",
|
|
3922
|
+
"rounded-tl": "border-top-left-radius",
|
|
3923
|
+
"rounded-tr": "border-top-right-radius",
|
|
3924
|
+
"rounded-bl": "border-bottom-left-radius",
|
|
3925
|
+
"rounded-br": "border-bottom-right-radius",
|
|
3094
3926
|
// Text
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
tt: "text-transform",
|
|
3101
|
-
lh: "line-height",
|
|
3102
|
-
ls: "letter-spacing",
|
|
3103
|
-
wb: "word-break",
|
|
3104
|
-
ow: "overflow-wrap",
|
|
3105
|
-
ti: "text-indent",
|
|
3106
|
-
va: "vertical-align",
|
|
3107
|
-
whs: "white-space",
|
|
3927
|
+
font: "font-weight",
|
|
3928
|
+
leading: "line-height",
|
|
3929
|
+
tracking: "letter-spacing",
|
|
3930
|
+
indent: "text-indent",
|
|
3931
|
+
align: "vertical-align",
|
|
3108
3932
|
// Lists
|
|
3109
|
-
|
|
3110
|
-
lstt: "list-style-type",
|
|
3111
|
-
lstp: "list-style-position",
|
|
3112
|
-
// Display
|
|
3113
|
-
d: "display",
|
|
3933
|
+
list: "list-style-type",
|
|
3114
3934
|
// Flexbox
|
|
3115
|
-
fd: "flex-direction",
|
|
3116
|
-
jc: "justify-content",
|
|
3117
|
-
ai: "align-items",
|
|
3118
|
-
ac: "align-content",
|
|
3119
|
-
as: "align-self",
|
|
3120
3935
|
flex: "flex",
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
ord: "order",
|
|
3936
|
+
grow: "flex-grow",
|
|
3937
|
+
shrink: "flex-shrink",
|
|
3938
|
+
basis: "flex-basis",
|
|
3939
|
+
order: "order",
|
|
3126
3940
|
// Grid
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
gr: "grid-row",
|
|
3134
|
-
ga: "grid-area",
|
|
3135
|
-
gar: "grid-auto-rows",
|
|
3136
|
-
gac: "grid-auto-columns",
|
|
3137
|
-
ji: "justify-items",
|
|
3138
|
-
jse: "justify-self",
|
|
3139
|
-
plc: "place-content",
|
|
3140
|
-
pli: "place-items",
|
|
3141
|
-
pls: "place-self",
|
|
3941
|
+
"grid-cols": "grid-template-columns",
|
|
3942
|
+
"grid-rows": "grid-template-rows",
|
|
3943
|
+
col: "grid-column",
|
|
3944
|
+
row: "grid-row",
|
|
3945
|
+
"auto-rows": "grid-auto-rows",
|
|
3946
|
+
"auto-cols": "grid-auto-columns",
|
|
3142
3947
|
// Effects
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
bfv: "backface-visibility",
|
|
3151
|
-
mbm: "mix-blend-mode",
|
|
3152
|
-
cp: "clip-path",
|
|
3948
|
+
opacity: "opacity",
|
|
3949
|
+
transform: "transform",
|
|
3950
|
+
origin: "transform-origin",
|
|
3951
|
+
shadow: "box-shadow",
|
|
3952
|
+
"text-shadow": "text-shadow",
|
|
3953
|
+
filter: "filter",
|
|
3954
|
+
"backdrop-filter": "backdrop-filter",
|
|
3153
3955
|
// Positioning
|
|
3154
|
-
pos: "position",
|
|
3155
3956
|
top: "top",
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3957
|
+
right: "right",
|
|
3958
|
+
bottom: "bottom",
|
|
3959
|
+
left: "left",
|
|
3960
|
+
inset: "inset",
|
|
3160
3961
|
z: "z-index",
|
|
3161
3962
|
// Outline
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
ols: "outline-style",
|
|
3165
|
-
olc: "outline-color",
|
|
3166
|
-
olo: "outline-offset",
|
|
3963
|
+
outline: "outline",
|
|
3964
|
+
"outline-offset": "outline-offset",
|
|
3167
3965
|
// Other
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
tn: "transition",
|
|
3175
|
-
objf: "object-fit",
|
|
3176
|
-
objp: "object-position",
|
|
3177
|
-
bsz: "box-sizing",
|
|
3178
|
-
vis: "visibility",
|
|
3179
|
-
rsz: "resize",
|
|
3180
|
-
scb: "scroll-behavior",
|
|
3181
|
-
acc: "accent-color"
|
|
3966
|
+
overflow: "overflow",
|
|
3967
|
+
"overflow-x": "overflow-x",
|
|
3968
|
+
"overflow-y": "overflow-y",
|
|
3969
|
+
cursor: "cursor",
|
|
3970
|
+
transition: "transition",
|
|
3971
|
+
object: "object-position"
|
|
3182
3972
|
};
|
|
3183
|
-
var
|
|
3973
|
+
var staticUtilities = {
|
|
3184
3974
|
display: {
|
|
3185
|
-
flex: "
|
|
3186
|
-
grid: "
|
|
3187
|
-
block: "
|
|
3188
|
-
inline: "
|
|
3189
|
-
"inline-block": "
|
|
3190
|
-
none: "
|
|
3191
|
-
"inline-flex": "
|
|
3192
|
-
"inline-grid": "
|
|
3975
|
+
flex: "flex",
|
|
3976
|
+
grid: "grid",
|
|
3977
|
+
block: "block",
|
|
3978
|
+
inline: "inline",
|
|
3979
|
+
"inline-block": "inline-block",
|
|
3980
|
+
none: "hidden",
|
|
3981
|
+
"inline-flex": "inline-flex",
|
|
3982
|
+
"inline-grid": "inline-grid",
|
|
3983
|
+
table: "table",
|
|
3984
|
+
contents: "contents",
|
|
3985
|
+
"flow-root": "flow-root",
|
|
3986
|
+
"list-item": "list-item"
|
|
3193
3987
|
},
|
|
3194
3988
|
flexDirection: {
|
|
3195
|
-
column: "
|
|
3196
|
-
row: "
|
|
3989
|
+
column: "flex-col",
|
|
3990
|
+
row: "flex-row",
|
|
3991
|
+
"column-reverse": "flex-col-reverse",
|
|
3992
|
+
"row-reverse": "flex-row-reverse"
|
|
3993
|
+
},
|
|
3994
|
+
flexWrap: {
|
|
3995
|
+
wrap: "flex-wrap",
|
|
3996
|
+
nowrap: "flex-nowrap",
|
|
3997
|
+
"wrap-reverse": "flex-wrap-reverse"
|
|
3998
|
+
},
|
|
3999
|
+
flex: {
|
|
4000
|
+
"1": "flex-1",
|
|
4001
|
+
auto: "flex-auto",
|
|
4002
|
+
none: "flex-none",
|
|
4003
|
+
initial: "flex-initial"
|
|
4004
|
+
},
|
|
4005
|
+
flexGrow: {
|
|
4006
|
+
"1": "grow",
|
|
4007
|
+
"0": "grow-0"
|
|
4008
|
+
},
|
|
4009
|
+
flexShrink: {
|
|
4010
|
+
"1": "shrink",
|
|
4011
|
+
"0": "shrink-0"
|
|
3197
4012
|
},
|
|
3198
4013
|
justifyContent: {
|
|
3199
|
-
center: "
|
|
3200
|
-
"flex-start": "
|
|
3201
|
-
|
|
3202
|
-
"
|
|
3203
|
-
|
|
3204
|
-
"space-
|
|
4014
|
+
center: "justify-center",
|
|
4015
|
+
"flex-start": "justify-start",
|
|
4016
|
+
start: "justify-start",
|
|
4017
|
+
"flex-end": "justify-end",
|
|
4018
|
+
end: "justify-end",
|
|
4019
|
+
"space-between": "justify-between",
|
|
4020
|
+
"space-around": "justify-around",
|
|
4021
|
+
"space-evenly": "justify-evenly",
|
|
4022
|
+
stretch: "justify-stretch",
|
|
4023
|
+
normal: "justify-normal"
|
|
3205
4024
|
},
|
|
3206
4025
|
alignItems: {
|
|
3207
|
-
center: "
|
|
3208
|
-
"flex-start": "
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
4026
|
+
center: "items-center",
|
|
4027
|
+
"flex-start": "items-start",
|
|
4028
|
+
start: "items-start",
|
|
4029
|
+
"flex-end": "items-end",
|
|
4030
|
+
end: "items-end",
|
|
4031
|
+
stretch: "items-stretch",
|
|
4032
|
+
baseline: "items-baseline"
|
|
4033
|
+
},
|
|
4034
|
+
alignContent: {
|
|
4035
|
+
center: "content-center",
|
|
4036
|
+
"flex-start": "content-start",
|
|
4037
|
+
start: "content-start",
|
|
4038
|
+
"flex-end": "content-end",
|
|
4039
|
+
end: "content-end",
|
|
4040
|
+
"space-between": "content-between",
|
|
4041
|
+
"space-around": "content-around",
|
|
4042
|
+
"space-evenly": "content-evenly",
|
|
4043
|
+
stretch: "content-stretch",
|
|
4044
|
+
normal: "content-normal"
|
|
4045
|
+
},
|
|
4046
|
+
alignSelf: {
|
|
4047
|
+
auto: "self-auto",
|
|
4048
|
+
center: "self-center",
|
|
4049
|
+
"flex-start": "self-start",
|
|
4050
|
+
start: "self-start",
|
|
4051
|
+
"flex-end": "self-end",
|
|
4052
|
+
end: "self-end",
|
|
4053
|
+
stretch: "self-stretch",
|
|
4054
|
+
baseline: "self-baseline"
|
|
4055
|
+
},
|
|
4056
|
+
justifyItems: {
|
|
4057
|
+
center: "justify-items-center",
|
|
4058
|
+
start: "justify-items-start",
|
|
4059
|
+
end: "justify-items-end",
|
|
4060
|
+
stretch: "justify-items-stretch"
|
|
4061
|
+
},
|
|
4062
|
+
justifySelf: {
|
|
4063
|
+
auto: "justify-self-auto",
|
|
4064
|
+
center: "justify-self-center",
|
|
4065
|
+
start: "justify-self-start",
|
|
4066
|
+
end: "justify-self-end",
|
|
4067
|
+
stretch: "justify-self-stretch"
|
|
4068
|
+
},
|
|
4069
|
+
placeContent: {
|
|
4070
|
+
center: "place-content-center",
|
|
4071
|
+
start: "place-content-start",
|
|
4072
|
+
end: "place-content-end",
|
|
4073
|
+
"space-between": "place-content-between",
|
|
4074
|
+
"space-around": "place-content-around",
|
|
4075
|
+
"space-evenly": "place-content-evenly",
|
|
4076
|
+
stretch: "place-content-stretch"
|
|
4077
|
+
},
|
|
4078
|
+
placeItems: {
|
|
4079
|
+
center: "place-items-center",
|
|
4080
|
+
start: "place-items-start",
|
|
4081
|
+
end: "place-items-end",
|
|
4082
|
+
stretch: "place-items-stretch"
|
|
4083
|
+
},
|
|
4084
|
+
placeSelf: {
|
|
4085
|
+
auto: "place-self-auto",
|
|
4086
|
+
center: "place-self-center",
|
|
4087
|
+
start: "place-self-start",
|
|
4088
|
+
end: "place-self-end",
|
|
4089
|
+
stretch: "place-self-stretch"
|
|
4090
|
+
},
|
|
4091
|
+
position: {
|
|
4092
|
+
static: "static",
|
|
4093
|
+
fixed: "fixed",
|
|
4094
|
+
absolute: "absolute",
|
|
4095
|
+
relative: "relative",
|
|
4096
|
+
sticky: "sticky"
|
|
3212
4097
|
},
|
|
3213
4098
|
overflow: {
|
|
3214
|
-
hidden: "
|
|
3215
|
-
auto: "
|
|
3216
|
-
scroll: "
|
|
3217
|
-
visible: "
|
|
4099
|
+
hidden: "overflow-hidden",
|
|
4100
|
+
auto: "overflow-auto",
|
|
4101
|
+
scroll: "overflow-scroll",
|
|
4102
|
+
visible: "overflow-visible",
|
|
4103
|
+
clip: "overflow-clip"
|
|
4104
|
+
},
|
|
4105
|
+
overflowX: {
|
|
4106
|
+
hidden: "overflow-x-hidden",
|
|
4107
|
+
auto: "overflow-x-auto",
|
|
4108
|
+
scroll: "overflow-x-scroll",
|
|
4109
|
+
visible: "overflow-x-visible",
|
|
4110
|
+
clip: "overflow-x-clip"
|
|
4111
|
+
},
|
|
4112
|
+
overflowY: {
|
|
4113
|
+
hidden: "overflow-y-hidden",
|
|
4114
|
+
auto: "overflow-y-auto",
|
|
4115
|
+
scroll: "overflow-y-scroll",
|
|
4116
|
+
visible: "overflow-y-visible",
|
|
4117
|
+
clip: "overflow-y-clip"
|
|
3218
4118
|
},
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
4119
|
+
textAlign: {
|
|
4120
|
+
left: "text-left",
|
|
4121
|
+
center: "text-center",
|
|
4122
|
+
right: "text-right",
|
|
4123
|
+
justify: "text-justify",
|
|
4124
|
+
start: "text-start",
|
|
4125
|
+
end: "text-end"
|
|
4126
|
+
},
|
|
4127
|
+
textDecoration: {
|
|
4128
|
+
underline: "underline",
|
|
4129
|
+
overline: "overline",
|
|
4130
|
+
"line-through": "line-through",
|
|
4131
|
+
none: "no-underline"
|
|
4132
|
+
},
|
|
4133
|
+
textTransform: {
|
|
4134
|
+
uppercase: "uppercase",
|
|
4135
|
+
lowercase: "lowercase",
|
|
4136
|
+
capitalize: "capitalize",
|
|
4137
|
+
none: "normal-case"
|
|
4138
|
+
},
|
|
4139
|
+
whiteSpace: {
|
|
4140
|
+
normal: "whitespace-normal",
|
|
4141
|
+
nowrap: "whitespace-nowrap",
|
|
4142
|
+
pre: "whitespace-pre",
|
|
4143
|
+
"pre-wrap": "whitespace-pre-wrap",
|
|
4144
|
+
"pre-line": "whitespace-pre-line",
|
|
4145
|
+
"break-spaces": "whitespace-break-spaces"
|
|
4146
|
+
},
|
|
4147
|
+
wordBreak: {
|
|
4148
|
+
normal: "break-normal",
|
|
4149
|
+
"break-all": "break-all",
|
|
4150
|
+
"keep-all": "break-keep",
|
|
4151
|
+
"break-word": "break-word"
|
|
4152
|
+
},
|
|
4153
|
+
overflowWrap: {
|
|
4154
|
+
normal: "wrap-normal",
|
|
4155
|
+
"break-word": "wrap-break-word",
|
|
4156
|
+
anywhere: "wrap-anywhere"
|
|
4157
|
+
},
|
|
4158
|
+
fontWeight: {
|
|
4159
|
+
normal: "font-normal",
|
|
4160
|
+
bold: "font-bold",
|
|
4161
|
+
bolder: "font-bolder",
|
|
4162
|
+
lighter: "font-lighter"
|
|
4163
|
+
},
|
|
4164
|
+
color: {
|
|
4165
|
+
transparent: "text-transparent",
|
|
4166
|
+
currentColor: "text-current",
|
|
4167
|
+
inherit: "text-inherit"
|
|
4168
|
+
},
|
|
4169
|
+
backgroundColor: {
|
|
4170
|
+
transparent: "bg-transparent",
|
|
4171
|
+
currentColor: "bg-current",
|
|
4172
|
+
inherit: "bg-inherit"
|
|
4173
|
+
},
|
|
4174
|
+
backgroundImage: {
|
|
4175
|
+
none: "bg-none"
|
|
4176
|
+
},
|
|
4177
|
+
borderColor: {
|
|
4178
|
+
transparent: "border-transparent",
|
|
4179
|
+
currentColor: "border-current",
|
|
4180
|
+
inherit: "border-inherit"
|
|
3222
4181
|
},
|
|
3223
4182
|
pointerEvents: {
|
|
3224
|
-
none: "
|
|
3225
|
-
auto: "
|
|
4183
|
+
none: "pointer-events-none",
|
|
4184
|
+
auto: "pointer-events-auto"
|
|
3226
4185
|
},
|
|
3227
4186
|
userSelect: {
|
|
3228
|
-
none: "
|
|
3229
|
-
auto: "
|
|
3230
|
-
text: "
|
|
3231
|
-
all: "
|
|
4187
|
+
none: "select-none",
|
|
4188
|
+
auto: "select-auto",
|
|
4189
|
+
text: "select-text",
|
|
4190
|
+
all: "select-all"
|
|
3232
4191
|
},
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
"
|
|
3239
|
-
}
|
|
3240
|
-
|
|
3241
|
-
|
|
4192
|
+
objectFit: {
|
|
4193
|
+
contain: "object-contain",
|
|
4194
|
+
cover: "object-cover",
|
|
4195
|
+
fill: "object-fill",
|
|
4196
|
+
none: "object-none",
|
|
4197
|
+
"scale-down": "object-scale-down"
|
|
4198
|
+
},
|
|
4199
|
+
boxSizing: {
|
|
4200
|
+
"border-box": "box-border",
|
|
4201
|
+
"content-box": "box-content"
|
|
4202
|
+
},
|
|
4203
|
+
visibility: {
|
|
4204
|
+
visible: "visible",
|
|
4205
|
+
hidden: "invisible",
|
|
4206
|
+
collapse: "collapse"
|
|
4207
|
+
},
|
|
4208
|
+
resize: {
|
|
4209
|
+
both: "resize",
|
|
4210
|
+
horizontal: "resize-x",
|
|
4211
|
+
vertical: "resize-y",
|
|
4212
|
+
none: "resize-none"
|
|
4213
|
+
},
|
|
4214
|
+
scrollBehavior: {
|
|
4215
|
+
smooth: "scroll-smooth",
|
|
4216
|
+
auto: "scroll-auto"
|
|
4217
|
+
},
|
|
4218
|
+
gridAutoFlow: {
|
|
4219
|
+
row: "grid-flow-row",
|
|
4220
|
+
column: "grid-flow-col",
|
|
4221
|
+
dense: "grid-flow-dense",
|
|
4222
|
+
"row dense": "grid-flow-row-dense",
|
|
4223
|
+
"column dense": "grid-flow-col-dense"
|
|
4224
|
+
},
|
|
4225
|
+
listStyleType: {
|
|
4226
|
+
none: "list-none",
|
|
4227
|
+
disc: "list-disc",
|
|
4228
|
+
decimal: "list-decimal"
|
|
4229
|
+
},
|
|
4230
|
+
listStylePosition: {
|
|
4231
|
+
inside: "list-inside",
|
|
4232
|
+
outside: "list-outside"
|
|
4233
|
+
},
|
|
4234
|
+
backfaceVisibility: {
|
|
4235
|
+
visible: "backface-visible",
|
|
4236
|
+
hidden: "backface-hidden"
|
|
4237
|
+
},
|
|
4238
|
+
transition: {
|
|
4239
|
+
none: "transition-none"
|
|
4240
|
+
},
|
|
4241
|
+
transform: {
|
|
4242
|
+
none: "transform-none"
|
|
4243
|
+
},
|
|
4244
|
+
boxShadow: {
|
|
4245
|
+
none: "shadow-none"
|
|
4246
|
+
},
|
|
4247
|
+
outline: {
|
|
4248
|
+
none: "outline-none"
|
|
4249
|
+
}
|
|
4250
|
+
};
|
|
4251
|
+
var SPACING_SCALE = {
|
|
4252
|
+
"0": "0px",
|
|
4253
|
+
px: "1px",
|
|
4254
|
+
"0.5": "2px",
|
|
4255
|
+
"1": "4px",
|
|
4256
|
+
"1.5": "6px",
|
|
4257
|
+
"2": "8px",
|
|
4258
|
+
"2.5": "10px",
|
|
4259
|
+
"3": "12px",
|
|
4260
|
+
"3.5": "14px",
|
|
4261
|
+
"4": "16px",
|
|
4262
|
+
"5": "20px",
|
|
4263
|
+
"6": "24px",
|
|
4264
|
+
"7": "28px",
|
|
4265
|
+
"8": "32px",
|
|
4266
|
+
"9": "36px",
|
|
4267
|
+
"10": "40px",
|
|
4268
|
+
"11": "44px",
|
|
4269
|
+
"12": "48px",
|
|
4270
|
+
"14": "56px",
|
|
4271
|
+
"16": "64px",
|
|
4272
|
+
"20": "80px",
|
|
4273
|
+
"24": "96px",
|
|
4274
|
+
"28": "112px",
|
|
4275
|
+
"32": "128px",
|
|
4276
|
+
"36": "144px",
|
|
4277
|
+
"40": "160px",
|
|
4278
|
+
"44": "176px",
|
|
4279
|
+
"48": "192px",
|
|
4280
|
+
"52": "208px",
|
|
4281
|
+
"56": "224px",
|
|
4282
|
+
"60": "240px",
|
|
4283
|
+
"64": "256px",
|
|
4284
|
+
"72": "288px",
|
|
4285
|
+
"80": "320px",
|
|
4286
|
+
"96": "384px"
|
|
3242
4287
|
};
|
|
3243
|
-
var
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
"
|
|
3253
|
-
|
|
3254
|
-
"
|
|
3255
|
-
"
|
|
3256
|
-
"
|
|
3257
|
-
"
|
|
3258
|
-
"
|
|
3259
|
-
"
|
|
3260
|
-
"
|
|
3261
|
-
"
|
|
3262
|
-
"
|
|
3263
|
-
"
|
|
3264
|
-
"
|
|
3265
|
-
"
|
|
3266
|
-
"
|
|
3267
|
-
"
|
|
3268
|
-
"
|
|
3269
|
-
"
|
|
3270
|
-
"
|
|
3271
|
-
"
|
|
3272
|
-
"
|
|
3273
|
-
"
|
|
3274
|
-
"
|
|
3275
|
-
"
|
|
3276
|
-
"
|
|
3277
|
-
"
|
|
3278
|
-
"
|
|
3279
|
-
"
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
"
|
|
3295
|
-
"
|
|
3296
|
-
|
|
3297
|
-
"
|
|
3298
|
-
|
|
3299
|
-
"
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
4288
|
+
var SPACING_SCALE_REVERSE = (() => {
|
|
4289
|
+
const reverse = {};
|
|
4290
|
+
for (const [step, length] of Object.entries(SPACING_SCALE)) {
|
|
4291
|
+
reverse[length] = step;
|
|
4292
|
+
}
|
|
4293
|
+
return reverse;
|
|
4294
|
+
})();
|
|
4295
|
+
var SPACING_SCALE_ROOTS = /* @__PURE__ */ new Set([
|
|
4296
|
+
"p",
|
|
4297
|
+
"pt",
|
|
4298
|
+
"pr",
|
|
4299
|
+
"pb",
|
|
4300
|
+
"pl",
|
|
4301
|
+
"px",
|
|
4302
|
+
"py",
|
|
4303
|
+
"m",
|
|
4304
|
+
"mt",
|
|
4305
|
+
"mr",
|
|
4306
|
+
"mb",
|
|
4307
|
+
"ml",
|
|
4308
|
+
"mx",
|
|
4309
|
+
"my",
|
|
4310
|
+
"gap",
|
|
4311
|
+
"gap-x",
|
|
4312
|
+
"gap-y",
|
|
4313
|
+
"top",
|
|
4314
|
+
"right",
|
|
4315
|
+
"bottom",
|
|
4316
|
+
"left",
|
|
4317
|
+
"inset",
|
|
4318
|
+
"w",
|
|
4319
|
+
"h",
|
|
4320
|
+
"min-w",
|
|
4321
|
+
"min-h",
|
|
4322
|
+
"max-w",
|
|
4323
|
+
"max-h",
|
|
4324
|
+
"basis"
|
|
4325
|
+
]);
|
|
4326
|
+
var COLOR_TOKEN_ROOTS = /* @__PURE__ */ new Set(["text", "bg", "border", "accent", "outline"]);
|
|
4327
|
+
var staticUtilityReverse = (() => {
|
|
4328
|
+
const reverse = {};
|
|
4329
|
+
for (const [prop, values] of Object.entries(staticUtilities)) {
|
|
4330
|
+
for (const [value, className] of Object.entries(values)) {
|
|
4331
|
+
if (!reverse[className]) {
|
|
4332
|
+
reverse[className] = { prop, value };
|
|
4333
|
+
}
|
|
4334
|
+
}
|
|
4335
|
+
}
|
|
4336
|
+
return reverse;
|
|
4337
|
+
})();
|
|
4338
|
+
var keywordValues = {
|
|
4339
|
+
w: { auto: "auto", full: "100%", screen: "100vw", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4340
|
+
h: { auto: "auto", full: "100%", screen: "100vh", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4341
|
+
"max-w": { full: "100%", none: "none", screen: "100vw", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4342
|
+
"max-h": { full: "100%", none: "none", screen: "100vh", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4343
|
+
"min-w": { auto: "auto", full: "100%", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4344
|
+
"min-h": { auto: "auto", full: "100%", screen: "100vh", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4345
|
+
m: { auto: "auto" },
|
|
4346
|
+
mt: { auto: "auto" },
|
|
4347
|
+
mr: { auto: "auto" },
|
|
4348
|
+
mb: { auto: "auto" },
|
|
4349
|
+
ml: { auto: "auto" },
|
|
4350
|
+
mx: { auto: "auto" },
|
|
4351
|
+
my: { auto: "auto" },
|
|
4352
|
+
top: { auto: "auto", full: "100%" },
|
|
4353
|
+
right: { auto: "auto", full: "100%" },
|
|
4354
|
+
bottom: { auto: "auto", full: "100%" },
|
|
4355
|
+
left: { auto: "auto", full: "100%" },
|
|
4356
|
+
inset: { auto: "auto", full: "100%" },
|
|
4357
|
+
basis: { auto: "auto", full: "100%" },
|
|
4358
|
+
rounded: { none: "0", full: "9999px" },
|
|
4359
|
+
"rounded-tl": { none: "0", full: "9999px" },
|
|
4360
|
+
"rounded-tr": { none: "0", full: "9999px" },
|
|
4361
|
+
"rounded-bl": { none: "0", full: "9999px" },
|
|
4362
|
+
"rounded-br": { none: "0", full: "9999px" },
|
|
4363
|
+
z: { auto: "auto" },
|
|
4364
|
+
leading: { normal: "normal" },
|
|
4365
|
+
tracking: { normal: "normal" }
|
|
3310
4366
|
};
|
|
4367
|
+
var genericKeywordRoots = /* @__PURE__ */ new Set(["cursor", "align", "origin", "object", "list"]);
|
|
4368
|
+
var integerValueRoots = /* @__PURE__ */ new Set(["z", "order", "flex", "grow", "shrink"]);
|
|
4369
|
+
var colorTokenProps = /* @__PURE__ */ new Set([
|
|
4370
|
+
"color",
|
|
4371
|
+
"backgroundColor",
|
|
4372
|
+
"borderColor",
|
|
4373
|
+
"accentColor",
|
|
4374
|
+
"outlineColor"
|
|
4375
|
+
]);
|
|
3311
4376
|
var shadowPresets = {
|
|
3312
4377
|
"0": "none",
|
|
3313
4378
|
"1": "0 1px 2px rgba(0, 0, 0, 0.05)",
|
|
@@ -3323,125 +4388,590 @@ var borderPresets = {
|
|
|
3323
4388
|
"0": "1px solid var(--border)",
|
|
3324
4389
|
"1": "1px solid var(--border-light)"
|
|
3325
4390
|
};
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
translateY: "ty",
|
|
3331
|
-
translateX: "tx",
|
|
3332
|
-
translate: "t",
|
|
3333
|
-
scale: "sc",
|
|
3334
|
-
scaleX: "scx",
|
|
3335
|
-
scaleY: "scy",
|
|
3336
|
-
rotate: "ro",
|
|
3337
|
-
skew: "sk",
|
|
3338
|
-
skewX: "skx",
|
|
3339
|
-
skewY: "sky",
|
|
3340
|
-
repeat: "re",
|
|
3341
|
-
minmax: "mm",
|
|
3342
|
-
calc: "ca"
|
|
3343
|
-
};
|
|
3344
|
-
function isStyleMapping(value) {
|
|
3345
|
-
return typeof value === "object" && value !== null && "_mapping" in value && value._mapping === true;
|
|
3346
|
-
}
|
|
3347
|
-
function sanitizeClassValue(value) {
|
|
3348
|
-
return value.replace(/\s+/g, "-").replace(/[()]/g, "").replace(/,/g, "_").replace(/%/g, "p").replace(/\./g, "d").replace(/[^\w-]/g, "");
|
|
3349
|
-
}
|
|
3350
|
-
function shortHash(input) {
|
|
3351
|
-
let hash = 2166136261;
|
|
3352
|
-
for (let i = 0; i < input.length; i++) {
|
|
3353
|
-
hash ^= input.charCodeAt(i);
|
|
3354
|
-
hash = Math.imul(hash, 16777619);
|
|
4391
|
+
var presetClassReverse = (() => {
|
|
4392
|
+
const reverse = {};
|
|
4393
|
+
for (const [key, value] of Object.entries(shadowPresets)) {
|
|
4394
|
+
reverse[`shadow-${key}`] = { prop: "boxShadow", value };
|
|
3355
4395
|
}
|
|
3356
|
-
|
|
3357
|
-
}
|
|
3358
|
-
function hasIllegalClassChars(className) {
|
|
3359
|
-
return /[^\w-]/.test(className);
|
|
3360
|
-
}
|
|
3361
|
-
function propertyValueToClass(prop, value) {
|
|
3362
|
-
const prefix = propertyMap[prop];
|
|
3363
|
-
if (!prefix) {
|
|
3364
|
-
const stringValue2 = String(value);
|
|
3365
|
-
const dynamicPrefix = prop.replace(/([A-Z])/g, "-$1").toLowerCase().split("-").filter(Boolean).map((word) => word.slice(0, 2)).join("");
|
|
3366
|
-
const sanitizedValue = sanitizeClassValue(stringValue2);
|
|
3367
|
-
const className2 = `${dynamicPrefix}-${sanitizedValue}`;
|
|
3368
|
-
const cssProperty = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
3369
|
-
registerDynamicStyle(className2, cssProperty, value);
|
|
3370
|
-
return className2;
|
|
4396
|
+
for (const [key, value] of Object.entries(gradientPresets)) {
|
|
4397
|
+
reverse[`bg-gradient-${key}`] = { prop: "background", value };
|
|
3371
4398
|
}
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
stringValue = stringValue.split(",").map((font) => {
|
|
3375
|
-
const trimmed = font.trim();
|
|
3376
|
-
if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
3377
|
-
return trimmed.slice(1, -1);
|
|
3378
|
-
}
|
|
3379
|
-
return trimmed;
|
|
3380
|
-
}).join(", ");
|
|
4399
|
+
for (const [key, value] of Object.entries(borderPresets)) {
|
|
4400
|
+
reverse[`border-preset-${key}`] = { prop: "border", value };
|
|
3381
4401
|
}
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
4402
|
+
return reverse;
|
|
4403
|
+
})();
|
|
4404
|
+
|
|
4405
|
+
// lib/shared/cssNamedColors.ts
|
|
4406
|
+
var CSS_NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
4407
|
+
// CSS Level 4 named colors
|
|
4408
|
+
"aliceblue",
|
|
4409
|
+
"antiquewhite",
|
|
4410
|
+
"aqua",
|
|
4411
|
+
"aquamarine",
|
|
4412
|
+
"azure",
|
|
4413
|
+
"beige",
|
|
4414
|
+
"bisque",
|
|
4415
|
+
"black",
|
|
4416
|
+
"blanchedalmond",
|
|
4417
|
+
"blue",
|
|
4418
|
+
"blueviolet",
|
|
4419
|
+
"brown",
|
|
4420
|
+
"burlywood",
|
|
4421
|
+
"cadetblue",
|
|
4422
|
+
"chartreuse",
|
|
4423
|
+
"chocolate",
|
|
4424
|
+
"coral",
|
|
4425
|
+
"cornflowerblue",
|
|
4426
|
+
"cornsilk",
|
|
4427
|
+
"crimson",
|
|
4428
|
+
"cyan",
|
|
4429
|
+
"darkblue",
|
|
4430
|
+
"darkcyan",
|
|
4431
|
+
"darkgoldenrod",
|
|
4432
|
+
"darkgray",
|
|
4433
|
+
"darkgreen",
|
|
4434
|
+
"darkgrey",
|
|
4435
|
+
"darkkhaki",
|
|
4436
|
+
"darkmagenta",
|
|
4437
|
+
"darkolivegreen",
|
|
4438
|
+
"darkorange",
|
|
4439
|
+
"darkorchid",
|
|
4440
|
+
"darkred",
|
|
4441
|
+
"darksalmon",
|
|
4442
|
+
"darkseagreen",
|
|
4443
|
+
"darkslateblue",
|
|
4444
|
+
"darkslategray",
|
|
4445
|
+
"darkslategrey",
|
|
4446
|
+
"darkturquoise",
|
|
4447
|
+
"darkviolet",
|
|
4448
|
+
"deeppink",
|
|
4449
|
+
"deepskyblue",
|
|
4450
|
+
"dimgray",
|
|
4451
|
+
"dimgrey",
|
|
4452
|
+
"dodgerblue",
|
|
4453
|
+
"firebrick",
|
|
4454
|
+
"floralwhite",
|
|
4455
|
+
"forestgreen",
|
|
4456
|
+
"fuchsia",
|
|
4457
|
+
"gainsboro",
|
|
4458
|
+
"ghostwhite",
|
|
4459
|
+
"gold",
|
|
4460
|
+
"goldenrod",
|
|
4461
|
+
"gray",
|
|
4462
|
+
"green",
|
|
4463
|
+
"greenyellow",
|
|
4464
|
+
"grey",
|
|
4465
|
+
"honeydew",
|
|
4466
|
+
"hotpink",
|
|
4467
|
+
"indianred",
|
|
4468
|
+
"indigo",
|
|
4469
|
+
"ivory",
|
|
4470
|
+
"khaki",
|
|
4471
|
+
"lavender",
|
|
4472
|
+
"lavenderblush",
|
|
4473
|
+
"lawngreen",
|
|
4474
|
+
"lemonchiffon",
|
|
4475
|
+
"lightblue",
|
|
4476
|
+
"lightcoral",
|
|
4477
|
+
"lightcyan",
|
|
4478
|
+
"lightgoldenrodyellow",
|
|
4479
|
+
"lightgray",
|
|
4480
|
+
"lightgreen",
|
|
4481
|
+
"lightgrey",
|
|
4482
|
+
"lightpink",
|
|
4483
|
+
"lightsalmon",
|
|
4484
|
+
"lightseagreen",
|
|
4485
|
+
"lightskyblue",
|
|
4486
|
+
"lightslategray",
|
|
4487
|
+
"lightslategrey",
|
|
4488
|
+
"lightsteelblue",
|
|
4489
|
+
"lightyellow",
|
|
4490
|
+
"lime",
|
|
4491
|
+
"limegreen",
|
|
4492
|
+
"linen",
|
|
4493
|
+
"magenta",
|
|
4494
|
+
"maroon",
|
|
4495
|
+
"mediumaquamarine",
|
|
4496
|
+
"mediumblue",
|
|
4497
|
+
"mediumorchid",
|
|
4498
|
+
"mediumpurple",
|
|
4499
|
+
"mediumseagreen",
|
|
4500
|
+
"mediumslateblue",
|
|
4501
|
+
"mediumspringgreen",
|
|
4502
|
+
"mediumturquoise",
|
|
4503
|
+
"mediumvioletred",
|
|
4504
|
+
"midnightblue",
|
|
4505
|
+
"mintcream",
|
|
4506
|
+
"mistyrose",
|
|
4507
|
+
"moccasin",
|
|
4508
|
+
"navajowhite",
|
|
4509
|
+
"navy",
|
|
4510
|
+
"oldlace",
|
|
4511
|
+
"olive",
|
|
4512
|
+
"olivedrab",
|
|
4513
|
+
"orange",
|
|
4514
|
+
"orangered",
|
|
4515
|
+
"orchid",
|
|
4516
|
+
"palegoldenrod",
|
|
4517
|
+
"palegreen",
|
|
4518
|
+
"paleturquoise",
|
|
4519
|
+
"palevioletred",
|
|
4520
|
+
"papayawhip",
|
|
4521
|
+
"peachpuff",
|
|
4522
|
+
"peru",
|
|
4523
|
+
"pink",
|
|
4524
|
+
"plum",
|
|
4525
|
+
"powderblue",
|
|
4526
|
+
"purple",
|
|
4527
|
+
"rebeccapurple",
|
|
4528
|
+
"red",
|
|
4529
|
+
"rosybrown",
|
|
4530
|
+
"royalblue",
|
|
4531
|
+
"saddlebrown",
|
|
4532
|
+
"salmon",
|
|
4533
|
+
"sandybrown",
|
|
4534
|
+
"seagreen",
|
|
4535
|
+
"seashell",
|
|
4536
|
+
"sienna",
|
|
4537
|
+
"silver",
|
|
4538
|
+
"skyblue",
|
|
4539
|
+
"slateblue",
|
|
4540
|
+
"slategray",
|
|
4541
|
+
"slategrey",
|
|
4542
|
+
"snow",
|
|
4543
|
+
"springgreen",
|
|
4544
|
+
"steelblue",
|
|
4545
|
+
"tan",
|
|
4546
|
+
"teal",
|
|
4547
|
+
"thistle",
|
|
4548
|
+
"tomato",
|
|
4549
|
+
"turquoise",
|
|
4550
|
+
"violet",
|
|
4551
|
+
"wheat",
|
|
4552
|
+
"white",
|
|
4553
|
+
"whitesmoke",
|
|
4554
|
+
"yellow",
|
|
4555
|
+
"yellowgreen",
|
|
4556
|
+
// CSS color keywords
|
|
4557
|
+
"transparent",
|
|
4558
|
+
"currentcolor",
|
|
4559
|
+
// CSS-wide keywords (should never be wrapped in var())
|
|
4560
|
+
"inherit",
|
|
4561
|
+
"initial",
|
|
4562
|
+
"unset",
|
|
4563
|
+
"revert"
|
|
4564
|
+
]);
|
|
4565
|
+
function isCssNamedColor(value) {
|
|
4566
|
+
return CSS_NAMED_COLORS.has(value.toLowerCase());
|
|
4567
|
+
}
|
|
4568
|
+
|
|
4569
|
+
// lib/shared/utilityClassNames.ts
|
|
4570
|
+
var SORTED_ROOTS = Object.keys(prefixToCSSProperty).sort((a, b) => b.length - a.length);
|
|
4571
|
+
function camelToKebab(prop) {
|
|
4572
|
+
return prop.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
4573
|
+
}
|
|
4574
|
+
var kebabToCamelMap = (() => {
|
|
4575
|
+
const map = {};
|
|
4576
|
+
for (const prop of propertyOrder) {
|
|
4577
|
+
map[camelToKebab(prop)] = prop;
|
|
4578
|
+
}
|
|
4579
|
+
return map;
|
|
4580
|
+
})();
|
|
4581
|
+
function cssPropertyToCamel(property) {
|
|
4582
|
+
return kebabToCamelMap[property] ?? property.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
4583
|
+
}
|
|
4584
|
+
var ROOT_CAMEL_OVERRIDES = {
|
|
4585
|
+
px: "paddingInline",
|
|
4586
|
+
py: "paddingBlock",
|
|
4587
|
+
mx: "marginInline",
|
|
4588
|
+
my: "marginBlock"
|
|
4589
|
+
};
|
|
4590
|
+
function transformOutsideUrl(input, transform) {
|
|
4591
|
+
let result = "";
|
|
4592
|
+
let i = 0;
|
|
4593
|
+
const lower = input.toLowerCase();
|
|
4594
|
+
while (i < input.length) {
|
|
4595
|
+
const idx = lower.indexOf("url(", i);
|
|
4596
|
+
if (idx === -1) {
|
|
4597
|
+
result += transform(input.slice(i));
|
|
4598
|
+
break;
|
|
4599
|
+
}
|
|
4600
|
+
result += transform(input.slice(i, idx));
|
|
4601
|
+
let depth = 0;
|
|
4602
|
+
let j = idx + 3;
|
|
4603
|
+
for (; j < input.length; j++) {
|
|
4604
|
+
if (input[j] === "(") depth++;
|
|
4605
|
+
else if (input[j] === ")") {
|
|
4606
|
+
depth--;
|
|
4607
|
+
if (depth === 0) {
|
|
4608
|
+
j++;
|
|
4609
|
+
break;
|
|
4610
|
+
}
|
|
4611
|
+
}
|
|
4612
|
+
}
|
|
4613
|
+
result += input.slice(idx, j);
|
|
4614
|
+
i = j;
|
|
3388
4615
|
}
|
|
3389
|
-
|
|
3390
|
-
|
|
4616
|
+
return result;
|
|
4617
|
+
}
|
|
4618
|
+
function encodeArbitraryValue(value) {
|
|
4619
|
+
let ok = true;
|
|
4620
|
+
const encoded = transformOutsideUrl(value, (segment) => {
|
|
4621
|
+
if (/["'\\[\]]/.test(segment)) ok = false;
|
|
4622
|
+
return segment.replace(/_/g, "\\_").replace(/\s+/g, "_");
|
|
4623
|
+
});
|
|
4624
|
+
if (!ok) return null;
|
|
4625
|
+
const guardTarget = encoded.replace(/^\[|\]$/g, "").replace(/\\_/g, "");
|
|
4626
|
+
if (/[\s"'\\[\]]/.test(guardTarget)) return null;
|
|
4627
|
+
return encoded;
|
|
4628
|
+
}
|
|
4629
|
+
function decodeArbitraryValue(encoded) {
|
|
4630
|
+
return transformOutsideUrl(encoded, (segment) => segment.replace(/\\_|_/g, (m) => m === "\\_" ? "_" : " "));
|
|
4631
|
+
}
|
|
4632
|
+
var FONT_SIZE_KEYWORDS = /* @__PURE__ */ new Set([
|
|
4633
|
+
"xx-small",
|
|
4634
|
+
"x-small",
|
|
4635
|
+
"small",
|
|
4636
|
+
"medium",
|
|
4637
|
+
"large",
|
|
4638
|
+
"x-large",
|
|
4639
|
+
"xx-large",
|
|
4640
|
+
"xxx-large",
|
|
4641
|
+
"larger",
|
|
4642
|
+
"smaller"
|
|
4643
|
+
]);
|
|
4644
|
+
function isColorValue(value) {
|
|
4645
|
+
if (value.startsWith("#") || value.startsWith("var(")) return true;
|
|
4646
|
+
if (/^(rgb|rgba|hsl|hsla|oklch|oklab|lab|lch|hwb|color|color-mix)\(/i.test(value)) return true;
|
|
4647
|
+
if (value === "transparent" || value === "currentColor" || value === "currentcolor") return true;
|
|
4648
|
+
return isCssNamedColor(value);
|
|
4649
|
+
}
|
|
4650
|
+
function isBareColorTokenName(value) {
|
|
4651
|
+
if (!/^[a-zA-Z][\w-]*$/.test(value)) return false;
|
|
4652
|
+
if (isColorValue(value)) return false;
|
|
4653
|
+
if (/^[a-z]+-\d/i.test(value)) return false;
|
|
4654
|
+
return true;
|
|
4655
|
+
}
|
|
4656
|
+
function isFontSizeValue(value) {
|
|
4657
|
+
if (/^[\d.+-]/.test(value)) return true;
|
|
4658
|
+
if (/^(calc|clamp|min|max)\(/i.test(value)) return true;
|
|
4659
|
+
return FONT_SIZE_KEYWORDS.has(value);
|
|
4660
|
+
}
|
|
4661
|
+
function isFontWeightValue(value) {
|
|
4662
|
+
return /^\d+(\.\d+)?$/.test(value);
|
|
4663
|
+
}
|
|
4664
|
+
function isImageValue(value) {
|
|
4665
|
+
return /^(url|linear-gradient|radial-gradient|conic-gradient|repeating-linear-gradient|repeating-radial-gradient|repeating-conic-gradient|image-set|cross-fade|element)\(/i.test(
|
|
4666
|
+
value
|
|
4667
|
+
);
|
|
4668
|
+
}
|
|
4669
|
+
function isLengthValue(value) {
|
|
4670
|
+
return /^-?[\d.]+[a-z%]*$/i.test(value);
|
|
4671
|
+
}
|
|
4672
|
+
function hasTopLevelWhitespace(value) {
|
|
4673
|
+
let depth = 0;
|
|
4674
|
+
for (let i = 0; i < value.length; i++) {
|
|
4675
|
+
const ch = value[i] ?? "";
|
|
4676
|
+
if (ch === "(") depth++;
|
|
4677
|
+
else if (ch === ")") depth = Math.max(0, depth - 1);
|
|
4678
|
+
else if (depth === 0 && /\s/.test(ch)) return true;
|
|
3391
4679
|
}
|
|
3392
|
-
|
|
3393
|
-
|
|
4680
|
+
return false;
|
|
4681
|
+
}
|
|
4682
|
+
function resolveRootProperty(root, value) {
|
|
4683
|
+
switch (root) {
|
|
4684
|
+
case "text":
|
|
4685
|
+
return isFontSizeValue(value) ? "font-size" : "color";
|
|
4686
|
+
case "font":
|
|
4687
|
+
return isFontWeightValue(value) ? "font-weight" : "font-family";
|
|
4688
|
+
case "bg":
|
|
4689
|
+
return isImageValue(value) ? "background-image" : "background-color";
|
|
4690
|
+
case "border":
|
|
4691
|
+
return isColorValue(value) && !hasTopLevelWhitespace(value) ? "border-color" : "border";
|
|
4692
|
+
case "outline": {
|
|
4693
|
+
if (hasTopLevelWhitespace(value) || value === "none") return "outline";
|
|
4694
|
+
if (isColorValue(value)) return "outline-color";
|
|
4695
|
+
if (isLengthValue(value)) return "outline-width";
|
|
4696
|
+
return "outline";
|
|
4697
|
+
}
|
|
4698
|
+
default:
|
|
4699
|
+
return prefixToCSSProperty[root] ?? root;
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
function splitVariantPrefix(className) {
|
|
4703
|
+
const match = className.match(/^([a-z][a-z0-9_-]*):(.+)$/);
|
|
4704
|
+
if (match) {
|
|
4705
|
+
return { breakpoint: match[1] ?? null, base: match[2] ?? className };
|
|
4706
|
+
}
|
|
4707
|
+
return { breakpoint: null, base: className };
|
|
4708
|
+
}
|
|
4709
|
+
var DESKTOP_FIRST_VARIANT_PREFIX = "max-";
|
|
4710
|
+
var BREAKPOINT_NAME_TO_CLASS = { tablet: "lg", mobile: "sm" };
|
|
4711
|
+
var CLASS_NAME_TO_BREAKPOINT = { lg: "tablet", sm: "mobile" };
|
|
4712
|
+
function breakpointClassPrefix(breakpointName) {
|
|
4713
|
+
const lower = breakpointName.toLowerCase();
|
|
4714
|
+
const aliased = BREAKPOINT_NAME_TO_CLASS[lower] ?? lower;
|
|
4715
|
+
return `${DESKTOP_FIRST_VARIANT_PREFIX}${aliased}:`;
|
|
4716
|
+
}
|
|
4717
|
+
function breakpointClassPrefixes(breakpointName) {
|
|
4718
|
+
const lower = breakpointName.toLowerCase();
|
|
4719
|
+
const aliased = BREAKPOINT_NAME_TO_CLASS[lower];
|
|
4720
|
+
const prefixes = [`${DESKTOP_FIRST_VARIANT_PREFIX}${lower}:`, `${lower}:`];
|
|
4721
|
+
if (aliased) prefixes.unshift(`${DESKTOP_FIRST_VARIANT_PREFIX}${aliased}:`);
|
|
4722
|
+
return prefixes;
|
|
4723
|
+
}
|
|
4724
|
+
function normalizeBreakpointVariant(variant) {
|
|
4725
|
+
if (variant?.startsWith(DESKTOP_FIRST_VARIANT_PREFIX)) {
|
|
4726
|
+
const bare = variant.slice(DESKTOP_FIRST_VARIANT_PREFIX.length);
|
|
4727
|
+
return CLASS_NAME_TO_BREAKPOINT[bare] ?? bare;
|
|
4728
|
+
}
|
|
4729
|
+
return variant;
|
|
4730
|
+
}
|
|
4731
|
+
var HASH_VALUE_RE = /^h[0-9a-z]+$/;
|
|
4732
|
+
function parseUtilityClass(className, knownTokens) {
|
|
4733
|
+
const stat = staticUtilityReverse[className];
|
|
4734
|
+
if (stat) {
|
|
4735
|
+
return { property: camelToKebab(stat.prop), value: stat.value, root: null, kind: "static" };
|
|
4736
|
+
}
|
|
4737
|
+
const preset = presetClassReverse[className];
|
|
4738
|
+
if (preset) {
|
|
4739
|
+
return { property: camelToKebab(preset.prop), value: preset.value, root: null, kind: "preset" };
|
|
4740
|
+
}
|
|
4741
|
+
const arbProp = className.match(/^\[([a-z-]+):(.+)\]$/);
|
|
4742
|
+
if (arbProp) {
|
|
4743
|
+
return {
|
|
4744
|
+
property: arbProp[1] ?? "",
|
|
4745
|
+
value: decodeArbitraryValue(arbProp[2] ?? ""),
|
|
4746
|
+
root: null,
|
|
4747
|
+
kind: "arbitrary-property"
|
|
4748
|
+
};
|
|
3394
4749
|
}
|
|
3395
|
-
|
|
3396
|
-
className
|
|
4750
|
+
for (const root of SORTED_ROOTS) {
|
|
4751
|
+
if (!className.startsWith(`${root}-`)) continue;
|
|
4752
|
+
const rest = className.slice(root.length + 1);
|
|
4753
|
+
if (!rest) continue;
|
|
4754
|
+
const parsed = parseRootValue(root, rest, knownTokens);
|
|
4755
|
+
if (parsed) return parsed;
|
|
3397
4756
|
}
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
4757
|
+
return null;
|
|
4758
|
+
}
|
|
4759
|
+
function parseRootValue(root, rest, knownTokens) {
|
|
4760
|
+
if (rest.startsWith("[") && rest.endsWith("]") && rest.length > 2) {
|
|
4761
|
+
const value = decodeArbitraryValue(rest.slice(1, -1));
|
|
4762
|
+
return { property: resolveRootProperty(root, value), value, root, kind: "arbitrary" };
|
|
4763
|
+
}
|
|
4764
|
+
const varMatch = rest.match(/^\((?:([a-z-]+):)?(--[\w-]+)\)$/);
|
|
4765
|
+
if (varMatch) {
|
|
4766
|
+
const hint = varMatch[1];
|
|
4767
|
+
const value = `var(${varMatch[2]})`;
|
|
4768
|
+
let property;
|
|
4769
|
+
if (root === "text") {
|
|
4770
|
+
property = hint === "length" ? "font-size" : "color";
|
|
4771
|
+
} else if (root === "font") {
|
|
4772
|
+
property = hint === "number" ? "font-weight" : "font-family";
|
|
4773
|
+
} else {
|
|
4774
|
+
property = resolveRootProperty(root, value);
|
|
3405
4775
|
}
|
|
4776
|
+
return { property, value, root, kind: "var" };
|
|
3406
4777
|
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
4778
|
+
const keyword = keywordValues[root]?.[rest];
|
|
4779
|
+
if (keyword !== void 0) {
|
|
4780
|
+
return { property: resolveRootProperty(root, keyword), value: keyword, root, kind: "keyword" };
|
|
4781
|
+
}
|
|
4782
|
+
if (genericKeywordRoots.has(root) && /^[a-z][a-z-]*$/.test(rest)) {
|
|
4783
|
+
return { property: resolveRootProperty(root, rest), value: rest, root, kind: "keyword" };
|
|
4784
|
+
}
|
|
4785
|
+
if (SPACING_SCALE_ROOTS.has(root)) {
|
|
4786
|
+
const scaleVal = SPACING_SCALE[rest];
|
|
4787
|
+
if (scaleVal !== void 0) {
|
|
4788
|
+
return { property: resolveRootProperty(root, scaleVal), value: scaleVal, root, kind: "keyword" };
|
|
3412
4789
|
}
|
|
3413
4790
|
}
|
|
3414
|
-
if (
|
|
3415
|
-
|
|
4791
|
+
if (integerValueRoots.has(root) && /^-?\d+$/.test(rest)) {
|
|
4792
|
+
return { property: prefixToCSSProperty[root] ?? root, value: rest, root, kind: "numeric" };
|
|
3416
4793
|
}
|
|
3417
|
-
if (
|
|
3418
|
-
|
|
4794
|
+
if (root === "opacity" && /^\d{1,3}$/.test(rest)) {
|
|
4795
|
+
return { property: "opacity", value: String(Number(rest) / 100), root, kind: "numeric" };
|
|
3419
4796
|
}
|
|
3420
|
-
if (
|
|
3421
|
-
const
|
|
3422
|
-
|
|
4797
|
+
if (COLOR_TOKEN_ROOTS.has(root) && knownTokens?.has(rest)) {
|
|
4798
|
+
const value = `var(--${rest})`;
|
|
4799
|
+
return { property: resolveRootProperty(root, value), value, root, kind: "var" };
|
|
3423
4800
|
}
|
|
3424
|
-
if (
|
|
3425
|
-
|
|
3426
|
-
className = `${prefix}-${spacedValue}`;
|
|
4801
|
+
if (HASH_VALUE_RE.test(rest)) {
|
|
4802
|
+
return { property: prefixToCSSProperty[root] ?? root, value: null, root, kind: "hash" };
|
|
3427
4803
|
}
|
|
3428
|
-
|
|
3429
|
-
|
|
4804
|
+
return null;
|
|
4805
|
+
}
|
|
4806
|
+
|
|
4807
|
+
// lib/shared/styleValueRegistry.ts
|
|
4808
|
+
var registry = /* @__PURE__ */ new Map();
|
|
4809
|
+
var dynamicRegistry = /* @__PURE__ */ new Map();
|
|
4810
|
+
function registerStyleValue(className, value) {
|
|
4811
|
+
registry.set(className, value);
|
|
4812
|
+
}
|
|
4813
|
+
function registerDynamicStyle(className, property, value) {
|
|
4814
|
+
dynamicRegistry.set(className, { property, value });
|
|
4815
|
+
}
|
|
4816
|
+
function getStyleValue(className) {
|
|
4817
|
+
return registry.get(className);
|
|
4818
|
+
}
|
|
4819
|
+
function getDynamicStyle(className) {
|
|
4820
|
+
return dynamicRegistry.get(className);
|
|
4821
|
+
}
|
|
4822
|
+
function isDynamicClass(className) {
|
|
4823
|
+
return dynamicRegistry.has(className);
|
|
4824
|
+
}
|
|
4825
|
+
function getAllDynamicClasses() {
|
|
4826
|
+
return Array.from(dynamicRegistry.keys());
|
|
4827
|
+
}
|
|
4828
|
+
function clearRegistry() {
|
|
4829
|
+
registry.clear();
|
|
4830
|
+
dynamicRegistry.clear();
|
|
4831
|
+
}
|
|
4832
|
+
function serializeRegistry() {
|
|
4833
|
+
return JSON.stringify({
|
|
4834
|
+
standard: Array.from(registry.entries()),
|
|
4835
|
+
dynamic: Array.from(dynamicRegistry.entries())
|
|
4836
|
+
});
|
|
4837
|
+
}
|
|
4838
|
+
function hydrateRegistry(data) {
|
|
4839
|
+
const parsed = JSON.parse(data);
|
|
4840
|
+
if (Array.isArray(parsed)) {
|
|
4841
|
+
for (const [key, value] of parsed) {
|
|
4842
|
+
registry.set(key, value);
|
|
4843
|
+
}
|
|
4844
|
+
} else {
|
|
4845
|
+
if (parsed.standard) {
|
|
4846
|
+
for (const [key, value] of parsed.standard) {
|
|
4847
|
+
registry.set(key, value);
|
|
4848
|
+
}
|
|
4849
|
+
}
|
|
4850
|
+
if (parsed.dynamic) {
|
|
4851
|
+
for (const [key, value] of parsed.dynamic) {
|
|
4852
|
+
dynamicRegistry.set(key, value);
|
|
4853
|
+
}
|
|
4854
|
+
}
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
|
|
4858
|
+
// lib/shared/utilityClassMapper.ts
|
|
4859
|
+
function isStyleMapping(value) {
|
|
4860
|
+
return typeof value === "object" && value !== null && "_mapping" in value && value._mapping === true;
|
|
4861
|
+
}
|
|
4862
|
+
function shortHash(input) {
|
|
4863
|
+
let hash = 2166136261;
|
|
4864
|
+
for (let i = 0; i < input.length; i++) {
|
|
4865
|
+
hash ^= input.charCodeAt(i);
|
|
4866
|
+
hash = Math.imul(hash, 16777619);
|
|
4867
|
+
}
|
|
4868
|
+
return (hash >>> 0).toString(36);
|
|
4869
|
+
}
|
|
4870
|
+
function rootFormMisresolves(root, prop, value) {
|
|
4871
|
+
const parsedProp = ROOT_CAMEL_OVERRIDES[root] ?? cssPropertyToCamel(resolveRootProperty(root, value));
|
|
4872
|
+
return parsedProp !== prop;
|
|
4873
|
+
}
|
|
4874
|
+
function propertyValueToClass(prop, value) {
|
|
4875
|
+
let stringValue = String(value);
|
|
4876
|
+
if (prop === "fontFamily") {
|
|
4877
|
+
stringValue = stringValue.split(",").map((font) => {
|
|
4878
|
+
const trimmed = font.trim();
|
|
4879
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
4880
|
+
return trimmed.slice(1, -1);
|
|
4881
|
+
}
|
|
4882
|
+
return trimmed;
|
|
4883
|
+
}).join(", ");
|
|
4884
|
+
}
|
|
4885
|
+
const staticClass = staticUtilities[prop]?.[stringValue];
|
|
4886
|
+
if (staticClass) {
|
|
4887
|
+
registerStyleValue(staticClass, stringValue);
|
|
4888
|
+
return staticClass;
|
|
4889
|
+
}
|
|
4890
|
+
const shadowPreset = shadowPresets[stringValue];
|
|
4891
|
+
if (prop === "boxShadow" && shadowPreset) {
|
|
4892
|
+
const className2 = `shadow-${stringValue}`;
|
|
4893
|
+
registerStyleValue(className2, shadowPreset);
|
|
4894
|
+
return className2;
|
|
4895
|
+
}
|
|
4896
|
+
const gradientPreset = gradientPresets[stringValue];
|
|
4897
|
+
if ((prop === "background" || prop === "backgroundImage") && gradientPreset) {
|
|
4898
|
+
const className2 = `bg-gradient-${stringValue}`;
|
|
4899
|
+
registerStyleValue(className2, gradientPreset);
|
|
4900
|
+
return className2;
|
|
4901
|
+
}
|
|
4902
|
+
const borderPreset = borderPresets[stringValue];
|
|
4903
|
+
if (prop === "border" && borderPreset) {
|
|
4904
|
+
const className2 = `border-preset-${stringValue}`;
|
|
4905
|
+
registerStyleValue(className2, borderPreset);
|
|
4906
|
+
return className2;
|
|
3430
4907
|
}
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
4908
|
+
const root = propertyMap[prop];
|
|
4909
|
+
if (!root) {
|
|
4910
|
+
const cssProperty = camelToKebab(prop);
|
|
4911
|
+
const encoded = encodeArbitraryValue(stringValue);
|
|
4912
|
+
const className2 = encoded != null ? `[${cssProperty}:${encoded}]` : `${cssProperty}-h${shortHash(stringValue)}`;
|
|
4913
|
+
registerDynamicStyle(className2, cssProperty, value);
|
|
4914
|
+
return className2;
|
|
4915
|
+
}
|
|
4916
|
+
let className = null;
|
|
4917
|
+
const kwTable = keywordValues[root];
|
|
4918
|
+
if (kwTable) {
|
|
4919
|
+
for (const [keyword, cssValue] of Object.entries(kwTable)) {
|
|
4920
|
+
if (cssValue === stringValue) {
|
|
4921
|
+
className = `${root}-${keyword}`;
|
|
4922
|
+
break;
|
|
4923
|
+
}
|
|
4924
|
+
}
|
|
4925
|
+
}
|
|
4926
|
+
if (!className && genericKeywordRoots.has(root) && /^[a-z][a-z-]*$/.test(stringValue)) {
|
|
4927
|
+
className = `${root}-${stringValue}`;
|
|
4928
|
+
}
|
|
4929
|
+
if (!className && integerValueRoots.has(root) && /^-?\d+$/.test(stringValue)) {
|
|
4930
|
+
className = `${root}-${stringValue}`;
|
|
4931
|
+
}
|
|
4932
|
+
if (!className && prop === "opacity") {
|
|
4933
|
+
const num = Number(stringValue);
|
|
4934
|
+
if (Number.isFinite(num) && num >= 0 && num <= 1) {
|
|
4935
|
+
const scaled = Math.round(num * 100);
|
|
4936
|
+
if (Math.abs(num * 100 - scaled) < 1e-9) {
|
|
4937
|
+
className = `opacity-${scaled}`;
|
|
4938
|
+
}
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
if (!className && SPACING_SCALE_ROOTS.has(root)) {
|
|
4942
|
+
const step = SPACING_SCALE_REVERSE[stringValue];
|
|
4943
|
+
if (step !== void 0) {
|
|
4944
|
+
className = `${root}-${step}`;
|
|
4945
|
+
}
|
|
3434
4946
|
}
|
|
3435
4947
|
if (!className) {
|
|
3436
|
-
|
|
4948
|
+
const varMatch = stringValue.match(/^var\((--[\w-]+)\)$/);
|
|
4949
|
+
if (varMatch) {
|
|
4950
|
+
const varName = (varMatch[1] ?? "").slice(2);
|
|
4951
|
+
if (prop === "fontSize") className = `text-(length:${varMatch[1]})`;
|
|
4952
|
+
else if (prop === "fontWeight") className = `font-(number:${varMatch[1]})`;
|
|
4953
|
+
else if (rootFormMisresolves(root, prop, stringValue)) {
|
|
4954
|
+
className = `[${camelToKebab(prop)}:${stringValue}]`;
|
|
4955
|
+
} else if (colorTokenProps.has(prop) && isBareColorTokenName(varName)) {
|
|
4956
|
+
className = `${root}-${varName}`;
|
|
4957
|
+
} else className = `${root}-(${varMatch[1]})`;
|
|
4958
|
+
}
|
|
3437
4959
|
}
|
|
3438
|
-
if (
|
|
3439
|
-
className = `${
|
|
4960
|
+
if (!className && colorTokenProps.has(prop) && isBareColorTokenName(stringValue)) {
|
|
4961
|
+
className = `${root}-${stringValue}`;
|
|
4962
|
+
}
|
|
4963
|
+
if (!className) {
|
|
4964
|
+
const encoded = encodeArbitraryValue(stringValue);
|
|
4965
|
+
if (encoded != null) {
|
|
4966
|
+
className = rootFormMisresolves(root, prop, stringValue) ? `[${camelToKebab(prop)}:${encoded}]` : `${root}-[${encoded}]`;
|
|
4967
|
+
}
|
|
4968
|
+
}
|
|
4969
|
+
if (!className) {
|
|
4970
|
+
className = `${root}-h${shortHash(stringValue)}`;
|
|
3440
4971
|
}
|
|
3441
4972
|
registerStyleValue(className, value);
|
|
3442
4973
|
return className;
|
|
3443
4974
|
}
|
|
3444
|
-
var propertyOrder = Object.keys(propertyMap);
|
|
3445
4975
|
function stylesToClasses(styles) {
|
|
3446
4976
|
if (!styles) return [];
|
|
3447
4977
|
const sortedProps = Object.keys(styles).sort((a, b) => {
|
|
@@ -3454,6 +4984,7 @@ function stylesToClasses(styles) {
|
|
|
3454
4984
|
const classes = [];
|
|
3455
4985
|
for (const prop of sortedProps) {
|
|
3456
4986
|
const value = styles[prop];
|
|
4987
|
+
if (value === void 0) continue;
|
|
3457
4988
|
if (isStyleMapping(value)) continue;
|
|
3458
4989
|
const className = propertyValueToClass(prop, value);
|
|
3459
4990
|
if (className) {
|
|
@@ -3516,11 +5047,7 @@ function responsiveStylesToClasses(styles, options) {
|
|
|
3516
5047
|
let baseSource = responsiveStyles.base;
|
|
3517
5048
|
let mobileSource = responsiveStyles.mobile;
|
|
3518
5049
|
if (fluidActive && responsiveScales?.enabled === true && baseSource && mobileSource) {
|
|
3519
|
-
const { patchedBase, patchedMobile } = consumeMobileIntoBaseClamp(
|
|
3520
|
-
baseSource,
|
|
3521
|
-
mobileSource,
|
|
3522
|
-
responsiveScales
|
|
3523
|
-
);
|
|
5050
|
+
const { patchedBase, patchedMobile } = consumeMobileIntoBaseClamp(baseSource, mobileSource, responsiveScales);
|
|
3524
5051
|
baseSource = patchedBase;
|
|
3525
5052
|
mobileSource = patchedMobile;
|
|
3526
5053
|
}
|
|
@@ -3531,12 +5058,14 @@ function responsiveStylesToClasses(styles, options) {
|
|
|
3531
5058
|
if (responsiveStyles.tablet) {
|
|
3532
5059
|
const tablet = fluidActive ? transformContainerIntent(responsiveStyles.tablet) : responsiveStyles.tablet;
|
|
3533
5060
|
const tabletClasses = stylesToClasses(tablet);
|
|
3534
|
-
|
|
5061
|
+
const prefix = breakpointClassPrefix("tablet");
|
|
5062
|
+
classes.push(...tabletClasses.map((cls) => `${prefix}${cls}`));
|
|
3535
5063
|
}
|
|
3536
5064
|
if (mobileSource && Object.keys(mobileSource).length > 0) {
|
|
3537
5065
|
const mobile = fluidActive ? transformContainerIntent(mobileSource) : mobileSource;
|
|
3538
5066
|
const mobileClasses = stylesToClasses(mobile);
|
|
3539
|
-
|
|
5067
|
+
const prefix = breakpointClassPrefix("mobile");
|
|
5068
|
+
classes.push(...mobileClasses.map((cls) => `${prefix}${cls}`));
|
|
3540
5069
|
}
|
|
3541
5070
|
} else {
|
|
3542
5071
|
const flat = fluidActive ? transformContainerIntent(styles) : styles;
|
|
@@ -3544,54 +5073,48 @@ function responsiveStylesToClasses(styles, options) {
|
|
|
3544
5073
|
}
|
|
3545
5074
|
return classes;
|
|
3546
5075
|
}
|
|
3547
|
-
function classToStyle(className) {
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
responsivePrefix = "t";
|
|
3552
|
-
cleanClass = className.slice(2);
|
|
3553
|
-
} else if (className.startsWith("mob-")) {
|
|
3554
|
-
responsivePrefix = "mob";
|
|
3555
|
-
cleanClass = className.slice(4);
|
|
5076
|
+
function classToStyle(className, knownTokens) {
|
|
5077
|
+
const { base: cleanClass } = splitVariantPrefix(className);
|
|
5078
|
+
if (staticUtilityReverse[cleanClass]) {
|
|
5079
|
+
return staticUtilityReverse[cleanClass];
|
|
3556
5080
|
}
|
|
3557
|
-
if (
|
|
3558
|
-
return
|
|
5081
|
+
if (presetClassReverse[cleanClass]) {
|
|
5082
|
+
return presetClassReverse[cleanClass];
|
|
3559
5083
|
}
|
|
3560
|
-
const
|
|
3561
|
-
if (!
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
if (val === prefix) {
|
|
3566
|
-
prop = key;
|
|
3567
|
-
break;
|
|
5084
|
+
const parsed = parseUtilityClass(cleanClass, knownTokens);
|
|
5085
|
+
if (!parsed) {
|
|
5086
|
+
const dynamic = getDynamicStyle(cleanClass);
|
|
5087
|
+
if (dynamic) {
|
|
5088
|
+
return { prop: cssPropertyToCamel(dynamic.property), value: String(dynamic.value) };
|
|
3568
5089
|
}
|
|
5090
|
+
return null;
|
|
3569
5091
|
}
|
|
3570
|
-
if (
|
|
3571
|
-
|
|
3572
|
-
const registered = getStyleValue(cleanClass);
|
|
3573
|
-
if (registered != null) {
|
|
3574
|
-
return { prop, value: String(registered) };
|
|
3575
|
-
}
|
|
5092
|
+
if (parsed.kind === "arbitrary-property") {
|
|
5093
|
+
return { prop: cssPropertyToCamel(parsed.property), value: parsed.value };
|
|
3576
5094
|
}
|
|
3577
|
-
if (
|
|
3578
|
-
|
|
5095
|
+
if (parsed.kind === "hash") {
|
|
5096
|
+
const registered = getStyleValue(cleanClass);
|
|
5097
|
+
if (registered == null) return null;
|
|
5098
|
+
const value2 = String(registered);
|
|
5099
|
+
const root2 = parsed.root;
|
|
5100
|
+
const prop2 = ROOT_CAMEL_OVERRIDES[root2] ?? cssPropertyToCamel(resolveRootProperty(root2, value2));
|
|
5101
|
+
return { prop: prop2, value: value2 };
|
|
5102
|
+
}
|
|
5103
|
+
const root = parsed.root;
|
|
5104
|
+
const prop = root && ROOT_CAMEL_OVERRIDES[root] ? ROOT_CAMEL_OVERRIDES[root] : cssPropertyToCamel(parsed.property);
|
|
5105
|
+
let value = parsed.value;
|
|
5106
|
+
if (parsed.kind === "var" && colorTokenProps.has(prop)) {
|
|
5107
|
+
value = value.replace(/^var\(--([\w-]+)\)$/, "$1");
|
|
3579
5108
|
}
|
|
3580
5109
|
return { prop, value };
|
|
3581
5110
|
}
|
|
3582
|
-
function classesToStyles(classes) {
|
|
5111
|
+
function classesToStyles(classes, knownTokens) {
|
|
3583
5112
|
const styles = { base: {}, tablet: {}, mobile: {} };
|
|
3584
5113
|
for (const className of classes) {
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
cleanClass = className.slice(2);
|
|
3590
|
-
} else if (className.startsWith("mob-")) {
|
|
3591
|
-
breakpoint = "mobile";
|
|
3592
|
-
cleanClass = className.slice(4);
|
|
3593
|
-
}
|
|
3594
|
-
const styleEntry = classToStyle(cleanClass);
|
|
5114
|
+
const { breakpoint: variant, base: cleanClass } = splitVariantPrefix(className);
|
|
5115
|
+
const bp = normalizeBreakpointVariant(variant);
|
|
5116
|
+
const breakpoint = bp === "tablet" ? "tablet" : bp === "mobile" ? "mobile" : "base";
|
|
5117
|
+
const styleEntry = classToStyle(cleanClass, knownTokens);
|
|
3595
5118
|
if (styleEntry) {
|
|
3596
5119
|
if (!styles[breakpoint]) {
|
|
3597
5120
|
styles[breakpoint] = {};
|
|
@@ -3601,7 +5124,53 @@ function classesToStyles(classes) {
|
|
|
3601
5124
|
}
|
|
3602
5125
|
if (Object.keys(styles.tablet || {}).length === 0) delete styles.tablet;
|
|
3603
5126
|
if (Object.keys(styles.mobile || {}).length === 0) delete styles.mobile;
|
|
3604
|
-
|
|
5127
|
+
const hasAny = Object.keys(styles.base || {}).length > 0 || Object.keys(styles.tablet || {}).length > 0 || Object.keys(styles.mobile || {}).length > 0;
|
|
5128
|
+
return hasAny ? styles : null;
|
|
5129
|
+
}
|
|
5130
|
+
function isClassableStyleValue(value) {
|
|
5131
|
+
if (typeof value === "number") return true;
|
|
5132
|
+
if (typeof value === "string") return !value.includes("{{");
|
|
5133
|
+
return false;
|
|
5134
|
+
}
|
|
5135
|
+
function splitStyleBucket(bucket) {
|
|
5136
|
+
const classable = {};
|
|
5137
|
+
const residual = {};
|
|
5138
|
+
for (const [k, v] of Object.entries(bucket)) {
|
|
5139
|
+
if (isClassableStyleValue(v)) classable[k] = v;
|
|
5140
|
+
else residual[k] = v;
|
|
5141
|
+
}
|
|
5142
|
+
return { classable, residual };
|
|
5143
|
+
}
|
|
5144
|
+
function splitStyleByClassability(style) {
|
|
5145
|
+
if (!style || typeof style !== "object") return { classable: null, residual: null };
|
|
5146
|
+
if (isResponsiveStyle(style)) {
|
|
5147
|
+
const classable = {};
|
|
5148
|
+
const residual = {};
|
|
5149
|
+
for (const [bp, bucket] of Object.entries(style)) {
|
|
5150
|
+
if (!bucket || typeof bucket !== "object") continue;
|
|
5151
|
+
const split2 = splitStyleBucket(bucket);
|
|
5152
|
+
if (Object.keys(split2.classable).length > 0) classable[bp] = split2.classable;
|
|
5153
|
+
if (Object.keys(split2.residual).length > 0) residual[bp] = split2.residual;
|
|
5154
|
+
}
|
|
5155
|
+
return {
|
|
5156
|
+
classable: Object.keys(classable).length > 0 ? classable : null,
|
|
5157
|
+
residual: Object.keys(residual).length > 0 ? residual : null
|
|
5158
|
+
};
|
|
5159
|
+
}
|
|
5160
|
+
const split = splitStyleBucket(style);
|
|
5161
|
+
return {
|
|
5162
|
+
classable: Object.keys(split.classable).length > 0 ? { base: split.classable } : null,
|
|
5163
|
+
residual: Object.keys(split.residual).length > 0 ? { base: split.residual } : null
|
|
5164
|
+
};
|
|
5165
|
+
}
|
|
5166
|
+
function styleHasMapping(style) {
|
|
5167
|
+
if (!style || typeof style !== "object") return false;
|
|
5168
|
+
const buckets = isResponsiveStyle(style) ? Object.values(style) : [style];
|
|
5169
|
+
for (const bucket of buckets) {
|
|
5170
|
+
if (!bucket || typeof bucket !== "object") continue;
|
|
5171
|
+
for (const v of Object.values(bucket)) if (isStyleMapping(v)) return true;
|
|
5172
|
+
}
|
|
5173
|
+
return false;
|
|
3605
5174
|
}
|
|
3606
5175
|
|
|
3607
5176
|
// lib/shared/paths/Path.ts
|
|
@@ -3634,12 +5203,8 @@ function validatePath(path) {
|
|
|
3634
5203
|
}
|
|
3635
5204
|
for (let i = 0; i < path.length; i++) {
|
|
3636
5205
|
const value = path[i];
|
|
3637
|
-
if (typeof value !== "number" || isNaN(value) || !isFinite(value)) {
|
|
3638
|
-
throw new InvalidPathError(
|
|
3639
|
-
`Invalid path value at index ${i}: expected number, got ${typeof value}`,
|
|
3640
|
-
path,
|
|
3641
|
-
i
|
|
3642
|
-
);
|
|
5206
|
+
if (typeof value !== "number" || Number.isNaN(value) || !Number.isFinite(value)) {
|
|
5207
|
+
throw new InvalidPathError(`Invalid path value at index ${i}: expected number, got ${typeof value}`, path, i);
|
|
3643
5208
|
}
|
|
3644
5209
|
}
|
|
3645
5210
|
}
|
|
@@ -3666,7 +5231,7 @@ function stringToPath(str) {
|
|
|
3666
5231
|
}
|
|
3667
5232
|
return str.split(",").map((s) => {
|
|
3668
5233
|
const num = parseInt(s, 10);
|
|
3669
|
-
if (isNaN(num)) {
|
|
5234
|
+
if (Number.isNaN(num)) {
|
|
3670
5235
|
throw new PathConversionError(`Invalid numeric index: ${s}`, str);
|
|
3671
5236
|
}
|
|
3672
5237
|
return num;
|
|
@@ -3691,9 +5256,9 @@ function domPathStringToTreePath(domPath) {
|
|
|
3691
5256
|
const path = [0];
|
|
3692
5257
|
for (let i = 0; i < parts.length; i++) {
|
|
3693
5258
|
if (parts[i] === CHILDREN_TOKEN && i + 1 < parts.length) {
|
|
3694
|
-
const indexStr = parts[i + 1];
|
|
5259
|
+
const indexStr = parts[i + 1] ?? "";
|
|
3695
5260
|
const index = parseInt(indexStr, 10);
|
|
3696
|
-
if (!isNaN(index) && indexStr === String(index)) {
|
|
5261
|
+
if (!Number.isNaN(index) && indexStr === String(index)) {
|
|
3697
5262
|
path.push(index);
|
|
3698
5263
|
i++;
|
|
3699
5264
|
}
|
|
@@ -3727,6 +5292,7 @@ function calculateChildrenExpansionOffset(componentPath, componentStructure, ins
|
|
|
3727
5292
|
let currentNode = componentStructure;
|
|
3728
5293
|
for (let i = 1; i < componentPath.length; i++) {
|
|
3729
5294
|
const index = componentPath[i];
|
|
5295
|
+
if (index === void 0) break;
|
|
3730
5296
|
if (!currentNode || !Array.isArray(currentNode.children)) {
|
|
3731
5297
|
break;
|
|
3732
5298
|
}
|
|
@@ -3792,12 +5358,12 @@ function convertPagePathToComponentPath(pagePath, componentInstancePath, compone
|
|
|
3792
5358
|
if (suffix.length > 0 && componentStructure && Array.isArray(instanceChildren)) {
|
|
3793
5359
|
const childrenCount = instanceChildren.length;
|
|
3794
5360
|
if (Array.isArray(componentStructure.children) && componentStructure.children.length > 0 && isSlotMarker(componentStructure.children[0])) {
|
|
3795
|
-
const pageFirstIndex = suffix[0];
|
|
5361
|
+
const pageFirstIndex = suffix[0] ?? 0;
|
|
3796
5362
|
if (pageFirstIndex < childrenCount) {
|
|
3797
5363
|
adjustedSuffix = suffix;
|
|
3798
5364
|
} else {
|
|
3799
5365
|
const offset = childrenCount - 1;
|
|
3800
|
-
adjustedSuffix = [
|
|
5366
|
+
adjustedSuffix = [pageFirstIndex - offset, ...suffix.slice(1)];
|
|
3801
5367
|
}
|
|
3802
5368
|
}
|
|
3803
5369
|
}
|
|
@@ -3811,7 +5377,7 @@ function convertComponentPathToPagePath(componentPath, componentInstancePath, co
|
|
|
3811
5377
|
const offset = calculateChildrenExpansionOffset(componentPath, componentStructure, instanceChildren);
|
|
3812
5378
|
let adjustedSuffix = suffix;
|
|
3813
5379
|
if (offset > 0 && suffix.length > 0) {
|
|
3814
|
-
adjustedSuffix = [suffix[0] + offset, ...suffix.slice(1)];
|
|
5380
|
+
adjustedSuffix = [(suffix[0] ?? 0) + offset, ...suffix.slice(1)];
|
|
3815
5381
|
}
|
|
3816
5382
|
return [...componentInstancePath, ...adjustedSuffix];
|
|
3817
5383
|
}
|
|
@@ -3845,8 +5411,8 @@ function parseElementClassName(className) {
|
|
|
3845
5411
|
if (!match) return null;
|
|
3846
5412
|
return {
|
|
3847
5413
|
fileType: match[1] === "c" ? "component" : "page",
|
|
3848
|
-
fileName: match[2],
|
|
3849
|
-
elementName: match[3]
|
|
5414
|
+
fileName: match[2] ?? "",
|
|
5415
|
+
elementName: match[3] ?? ""
|
|
3850
5416
|
};
|
|
3851
5417
|
}
|
|
3852
5418
|
|
|
@@ -3858,9 +5424,7 @@ function getVariableName(index) {
|
|
|
3858
5424
|
return `--is-${index}`;
|
|
3859
5425
|
}
|
|
3860
5426
|
function hasAnyMappings(style) {
|
|
3861
|
-
const isResponsive = "base" in style || Object.keys(style).some(
|
|
3862
|
-
(key) => key === "base" || key === "tablet" || key === "mobile"
|
|
3863
|
-
);
|
|
5427
|
+
const isResponsive = "base" in style || Object.keys(style).some((key) => key === "base" || key === "tablet" || key === "mobile");
|
|
3864
5428
|
if (isResponsive) {
|
|
3865
5429
|
const responsive = style;
|
|
3866
5430
|
for (const breakpointStyle of Object.values(responsive)) {
|
|
@@ -3889,9 +5453,7 @@ function extractInteractiveStyleMappings(interactiveStyles) {
|
|
|
3889
5453
|
let variableIndex = 0;
|
|
3890
5454
|
const resolvedStyles = interactiveStyles.map((rule, ruleIndex) => {
|
|
3891
5455
|
const style = rule.style;
|
|
3892
|
-
const isResponsive = "base" in style || Object.keys(style).some(
|
|
3893
|
-
(key) => key === "base" || key === "tablet" || key === "mobile"
|
|
3894
|
-
);
|
|
5456
|
+
const isResponsive = "base" in style || Object.keys(style).some((key) => key === "base" || key === "tablet" || key === "mobile");
|
|
3895
5457
|
if (isResponsive) {
|
|
3896
5458
|
const responsive = style;
|
|
3897
5459
|
const resolvedResponsive = {};
|
|
@@ -3977,7 +5539,7 @@ function createStyleMappingFromProps(componentPropDefs, currentValue) {
|
|
|
3977
5539
|
mappingValues[opt] = "";
|
|
3978
5540
|
});
|
|
3979
5541
|
} else {
|
|
3980
|
-
mappingValues
|
|
5542
|
+
mappingValues.default = currentValue;
|
|
3981
5543
|
}
|
|
3982
5544
|
return {
|
|
3983
5545
|
_mapping: true,
|
|
@@ -3988,7 +5550,7 @@ function createStyleMappingFromProps(componentPropDefs, currentValue) {
|
|
|
3988
5550
|
|
|
3989
5551
|
// lib/shared/linkUtils.ts
|
|
3990
5552
|
function normalizePath(path) {
|
|
3991
|
-
let normalized = path.split("?")[0].split("#")[0];
|
|
5553
|
+
let normalized = (path.split("?")[0] ?? "").split("#")[0] ?? "";
|
|
3992
5554
|
if (normalized.length > 1 && normalized.endsWith("/")) {
|
|
3993
5555
|
normalized = normalized.slice(0, -1);
|
|
3994
5556
|
}
|
|
@@ -4000,7 +5562,7 @@ function isCurrentLink(href, currentPagePath) {
|
|
|
4000
5562
|
}
|
|
4001
5563
|
|
|
4002
5564
|
// lib/shared/viewportUnits.ts
|
|
4003
|
-
var VIEWPORT_UNIT_RE = /(?<![\w
|
|
5565
|
+
var VIEWPORT_UNIT_RE = /(?<![\w\-[])(-?\d*\.?\d+)(s|l|d)?(vh|vw)\b/g;
|
|
4004
5566
|
function rewriteViewportUnits(input) {
|
|
4005
5567
|
if (!input) return input;
|
|
4006
5568
|
return input.replace(VIEWPORT_UNIT_RE, (_match, num, sizeKw, axis) => {
|
|
@@ -4100,195 +5662,69 @@ function toFriendlyError(input) {
|
|
|
4100
5662
|
};
|
|
4101
5663
|
}
|
|
4102
5664
|
|
|
4103
|
-
// lib/shared/
|
|
4104
|
-
var
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
"
|
|
4120
|
-
"
|
|
4121
|
-
"
|
|
4122
|
-
"
|
|
4123
|
-
"
|
|
4124
|
-
"
|
|
4125
|
-
"
|
|
4126
|
-
"
|
|
4127
|
-
"
|
|
4128
|
-
"
|
|
4129
|
-
"darkgoldenrod",
|
|
4130
|
-
"darkgray",
|
|
4131
|
-
"darkgreen",
|
|
4132
|
-
"darkgrey",
|
|
4133
|
-
"darkkhaki",
|
|
4134
|
-
"darkmagenta",
|
|
4135
|
-
"darkolivegreen",
|
|
4136
|
-
"darkorange",
|
|
4137
|
-
"darkorchid",
|
|
4138
|
-
"darkred",
|
|
4139
|
-
"darksalmon",
|
|
4140
|
-
"darkseagreen",
|
|
4141
|
-
"darkslateblue",
|
|
4142
|
-
"darkslategray",
|
|
4143
|
-
"darkslategrey",
|
|
4144
|
-
"darkturquoise",
|
|
4145
|
-
"darkviolet",
|
|
4146
|
-
"deeppink",
|
|
4147
|
-
"deepskyblue",
|
|
4148
|
-
"dimgray",
|
|
4149
|
-
"dimgrey",
|
|
4150
|
-
"dodgerblue",
|
|
4151
|
-
"firebrick",
|
|
4152
|
-
"floralwhite",
|
|
4153
|
-
"forestgreen",
|
|
4154
|
-
"fuchsia",
|
|
4155
|
-
"gainsboro",
|
|
4156
|
-
"ghostwhite",
|
|
4157
|
-
"gold",
|
|
4158
|
-
"goldenrod",
|
|
4159
|
-
"gray",
|
|
4160
|
-
"green",
|
|
4161
|
-
"greenyellow",
|
|
4162
|
-
"grey",
|
|
4163
|
-
"honeydew",
|
|
4164
|
-
"hotpink",
|
|
4165
|
-
"indianred",
|
|
4166
|
-
"indigo",
|
|
4167
|
-
"ivory",
|
|
4168
|
-
"khaki",
|
|
4169
|
-
"lavender",
|
|
4170
|
-
"lavenderblush",
|
|
4171
|
-
"lawngreen",
|
|
4172
|
-
"lemonchiffon",
|
|
4173
|
-
"lightblue",
|
|
4174
|
-
"lightcoral",
|
|
4175
|
-
"lightcyan",
|
|
4176
|
-
"lightgoldenrodyellow",
|
|
4177
|
-
"lightgray",
|
|
4178
|
-
"lightgreen",
|
|
4179
|
-
"lightgrey",
|
|
4180
|
-
"lightpink",
|
|
4181
|
-
"lightsalmon",
|
|
4182
|
-
"lightseagreen",
|
|
4183
|
-
"lightskyblue",
|
|
4184
|
-
"lightslategray",
|
|
4185
|
-
"lightslategrey",
|
|
4186
|
-
"lightsteelblue",
|
|
4187
|
-
"lightyellow",
|
|
4188
|
-
"lime",
|
|
4189
|
-
"limegreen",
|
|
4190
|
-
"linen",
|
|
4191
|
-
"magenta",
|
|
4192
|
-
"maroon",
|
|
4193
|
-
"mediumaquamarine",
|
|
4194
|
-
"mediumblue",
|
|
4195
|
-
"mediumorchid",
|
|
4196
|
-
"mediumpurple",
|
|
4197
|
-
"mediumseagreen",
|
|
4198
|
-
"mediumslateblue",
|
|
4199
|
-
"mediumspringgreen",
|
|
4200
|
-
"mediumturquoise",
|
|
4201
|
-
"mediumvioletred",
|
|
4202
|
-
"midnightblue",
|
|
4203
|
-
"mintcream",
|
|
4204
|
-
"mistyrose",
|
|
4205
|
-
"moccasin",
|
|
4206
|
-
"navajowhite",
|
|
4207
|
-
"navy",
|
|
4208
|
-
"oldlace",
|
|
4209
|
-
"olive",
|
|
4210
|
-
"olivedrab",
|
|
4211
|
-
"orange",
|
|
4212
|
-
"orangered",
|
|
4213
|
-
"orchid",
|
|
4214
|
-
"palegoldenrod",
|
|
4215
|
-
"palegreen",
|
|
4216
|
-
"paleturquoise",
|
|
4217
|
-
"palevioletred",
|
|
4218
|
-
"papayawhip",
|
|
4219
|
-
"peachpuff",
|
|
4220
|
-
"peru",
|
|
4221
|
-
"pink",
|
|
4222
|
-
"plum",
|
|
4223
|
-
"powderblue",
|
|
4224
|
-
"purple",
|
|
4225
|
-
"rebeccapurple",
|
|
4226
|
-
"red",
|
|
4227
|
-
"rosybrown",
|
|
4228
|
-
"royalblue",
|
|
4229
|
-
"saddlebrown",
|
|
4230
|
-
"salmon",
|
|
4231
|
-
"sandybrown",
|
|
4232
|
-
"seagreen",
|
|
4233
|
-
"seashell",
|
|
4234
|
-
"sienna",
|
|
4235
|
-
"silver",
|
|
4236
|
-
"skyblue",
|
|
4237
|
-
"slateblue",
|
|
4238
|
-
"slategray",
|
|
4239
|
-
"slategrey",
|
|
4240
|
-
"snow",
|
|
4241
|
-
"springgreen",
|
|
4242
|
-
"steelblue",
|
|
4243
|
-
"tan",
|
|
4244
|
-
"teal",
|
|
4245
|
-
"thistle",
|
|
4246
|
-
"tomato",
|
|
4247
|
-
"turquoise",
|
|
4248
|
-
"violet",
|
|
4249
|
-
"wheat",
|
|
4250
|
-
"white",
|
|
4251
|
-
"whitesmoke",
|
|
4252
|
-
"yellow",
|
|
4253
|
-
"yellowgreen",
|
|
4254
|
-
// CSS color keywords
|
|
4255
|
-
"transparent",
|
|
4256
|
-
"currentcolor",
|
|
4257
|
-
// CSS-wide keywords (should never be wrapped in var())
|
|
4258
|
-
"inherit",
|
|
4259
|
-
"initial",
|
|
4260
|
-
"unset",
|
|
4261
|
-
"revert"
|
|
5665
|
+
// lib/shared/pxToRem.ts
|
|
5666
|
+
var DEFAULT_REM_CONFIG = {
|
|
5667
|
+
enabled: false,
|
|
5668
|
+
baseFontSize: 16
|
|
5669
|
+
};
|
|
5670
|
+
var PX_REGEX = /(-?\d*\.?\d+)px/g;
|
|
5671
|
+
function convertPxToRem(cssValue, baseFontSize) {
|
|
5672
|
+
return cssValue.replace(PX_REGEX, (_, num) => {
|
|
5673
|
+
const px = parseFloat(num);
|
|
5674
|
+
if (px === 0) return "0";
|
|
5675
|
+
const rem = px / baseFontSize;
|
|
5676
|
+
const rounded = parseFloat(rem.toFixed(4));
|
|
5677
|
+
return `${rounded}rem`;
|
|
5678
|
+
});
|
|
5679
|
+
}
|
|
5680
|
+
var PX_KEEP_PROPERTIES = /* @__PURE__ */ new Set([
|
|
5681
|
+
"border-width",
|
|
5682
|
+
"border-top-width",
|
|
5683
|
+
"border-right-width",
|
|
5684
|
+
"border-bottom-width",
|
|
5685
|
+
"border-left-width",
|
|
5686
|
+
"outline-width",
|
|
5687
|
+
"outline-offset",
|
|
5688
|
+
"border",
|
|
5689
|
+
"box-shadow",
|
|
5690
|
+
"text-shadow"
|
|
4262
5691
|
]);
|
|
4263
|
-
function
|
|
4264
|
-
return
|
|
5692
|
+
function shouldConvertProperty(cssProperty) {
|
|
5693
|
+
return !PX_KEEP_PROPERTIES.has(cssProperty);
|
|
5694
|
+
}
|
|
5695
|
+
function applyRemConversion(declarations, remConfig) {
|
|
5696
|
+
if (!remConfig?.enabled) return declarations;
|
|
5697
|
+
return declarations.split(";").map((decl) => {
|
|
5698
|
+
const trimmed = decl.trim();
|
|
5699
|
+
if (!trimmed) return "";
|
|
5700
|
+
const colonIndex = trimmed.indexOf(":");
|
|
5701
|
+
if (colonIndex === -1) return trimmed;
|
|
5702
|
+
const property = trimmed.substring(0, colonIndex).trim();
|
|
5703
|
+
const value = trimmed.substring(colonIndex + 1).trim();
|
|
5704
|
+
if (shouldConvertProperty(property)) {
|
|
5705
|
+
return `${property}: ${convertPxToRem(value, remConfig.baseFontSize)}`;
|
|
5706
|
+
}
|
|
5707
|
+
return trimmed;
|
|
5708
|
+
}).filter(Boolean).join("; ");
|
|
4265
5709
|
}
|
|
4266
5710
|
|
|
4267
5711
|
// lib/shared/cssGeneration.ts
|
|
4268
|
-
var SORTED_PREFIXES = Object.keys(prefixToCSSProperty).sort((a, b) => b.length - a.length);
|
|
4269
5712
|
var cssPropertyOrderMap = (() => {
|
|
4270
5713
|
const map = /* @__PURE__ */ new Map();
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
5714
|
+
for (let i = 0; i < propertyOrder.length; i++) {
|
|
5715
|
+
const prop = propertyOrder[i];
|
|
5716
|
+
if (prop === void 0) continue;
|
|
5717
|
+
const kebab = camelToKebab(prop);
|
|
5718
|
+
if (!map.has(kebab)) map.set(kebab, i);
|
|
4275
5719
|
}
|
|
4276
5720
|
return map;
|
|
4277
5721
|
})();
|
|
4278
5722
|
function getClassPropertyOrder(className) {
|
|
4279
|
-
const
|
|
4280
|
-
if (
|
|
4281
|
-
const idx = cssPropertyOrderMap.get(
|
|
5723
|
+
const parsed = parseUtilityClass(className);
|
|
5724
|
+
if (parsed) {
|
|
5725
|
+
const idx = cssPropertyOrderMap.get(parsed.property);
|
|
4282
5726
|
if (idx !== void 0) return idx;
|
|
4283
5727
|
}
|
|
4284
|
-
const rule = utilityClassRules[className];
|
|
4285
|
-
if (rule) {
|
|
4286
|
-
const propMatch = rule.match(/^([a-z-]+):/);
|
|
4287
|
-
if (propMatch) {
|
|
4288
|
-
const idx = cssPropertyOrderMap.get(propMatch[1]);
|
|
4289
|
-
if (idx !== void 0) return idx;
|
|
4290
|
-
}
|
|
4291
|
-
}
|
|
4292
5728
|
return Infinity;
|
|
4293
5729
|
}
|
|
4294
5730
|
function sortClassesByPropertyOrder(classes) {
|
|
@@ -4298,18 +5734,18 @@ function getResponsiveMode(scales) {
|
|
|
4298
5734
|
return scales?.mode ?? "breakpoints";
|
|
4299
5735
|
}
|
|
4300
5736
|
var AUTO_RESPONSIVE_TYPE_MAP = {
|
|
4301
|
-
|
|
5737
|
+
padding: "padding",
|
|
4302
5738
|
"padding-left": "padding",
|
|
4303
5739
|
"padding-right": "padding",
|
|
4304
5740
|
"padding-top": "padding",
|
|
4305
5741
|
"padding-bottom": "padding",
|
|
4306
|
-
|
|
5742
|
+
margin: "margin",
|
|
4307
5743
|
"margin-left": "margin",
|
|
4308
5744
|
"margin-right": "margin",
|
|
4309
5745
|
"margin-top": "margin",
|
|
4310
5746
|
"margin-bottom": "margin",
|
|
4311
5747
|
"font-size": "fontSize",
|
|
4312
|
-
|
|
5748
|
+
gap: "gap",
|
|
4313
5749
|
"row-gap": "gap",
|
|
4314
5750
|
"column-gap": "gap",
|
|
4315
5751
|
"border-radius": "borderRadius",
|
|
@@ -4317,239 +5753,98 @@ var AUTO_RESPONSIVE_TYPE_MAP = {
|
|
|
4317
5753
|
"border-top-right-radius": "borderRadius",
|
|
4318
5754
|
"border-bottom-left-radius": "borderRadius",
|
|
4319
5755
|
"border-bottom-right-radius": "borderRadius",
|
|
4320
|
-
|
|
4321
|
-
|
|
5756
|
+
width: "size",
|
|
5757
|
+
height: "size",
|
|
4322
5758
|
"max-width": "size",
|
|
4323
5759
|
"max-height": "size",
|
|
4324
5760
|
"min-width": "size",
|
|
4325
5761
|
"min-height": "size"
|
|
4326
5762
|
};
|
|
4327
5763
|
function escapeCSSClassName(className) {
|
|
4328
|
-
return className.replace(/[
|
|
4329
|
-
}
|
|
4330
|
-
var utilityClassRules = {
|
|
4331
|
-
// Display utilities (short forms from specialValueMappings)
|
|
4332
|
-
f: "display: flex;",
|
|
4333
|
-
"fd-col": "flex-direction: column;",
|
|
4334
|
-
"fd-row": "flex-direction: row;",
|
|
4335
|
-
g: "display: grid;",
|
|
4336
|
-
b: "display: block;",
|
|
4337
|
-
i: "display: inline;",
|
|
4338
|
-
ib: "display: inline-block;",
|
|
4339
|
-
h: "display: none;",
|
|
4340
|
-
"if": "display: inline-flex;",
|
|
4341
|
-
ig: "display: inline-grid;",
|
|
4342
|
-
// Justify Content (short forms)
|
|
4343
|
-
"jc-c": "justify-content: center;",
|
|
4344
|
-
"jc-s": "justify-content: flex-start;",
|
|
4345
|
-
"jc-e": "justify-content: flex-end;",
|
|
4346
|
-
"jc-b": "justify-content: space-between;",
|
|
4347
|
-
"jc-a": "justify-content: space-around;",
|
|
4348
|
-
"jc-ev": "justify-content: space-evenly;",
|
|
4349
|
-
// Align Items (short forms)
|
|
4350
|
-
"ai-c": "align-items: center;",
|
|
4351
|
-
"ai-s": "align-items: flex-start;",
|
|
4352
|
-
"ai-e": "align-items: flex-end;",
|
|
4353
|
-
"ai-st": "align-items: stretch;",
|
|
4354
|
-
"ai-b": "align-items: baseline;",
|
|
4355
|
-
// Overflow (short forms)
|
|
4356
|
-
"o-h": "overflow: hidden;",
|
|
4357
|
-
"o-a": "overflow: auto;",
|
|
4358
|
-
"o-s": "overflow: scroll;",
|
|
4359
|
-
"o-v": "overflow: visible;",
|
|
4360
|
-
// Cursor (full forms)
|
|
4361
|
-
"cursor-pointer": "cursor: pointer;",
|
|
4362
|
-
"cursor-default": "cursor: default;",
|
|
4363
|
-
// Pointer events
|
|
4364
|
-
"pe-none": "pointer-events: none;",
|
|
4365
|
-
"pe-auto": "pointer-events: auto;",
|
|
4366
|
-
// User select
|
|
4367
|
-
"us-none": "user-select: none;",
|
|
4368
|
-
"us-auto": "user-select: auto;",
|
|
4369
|
-
"us-text": "user-select: text;",
|
|
4370
|
-
"us-all": "user-select: all;",
|
|
4371
|
-
// White space
|
|
4372
|
-
"whs-normal": "white-space: normal;",
|
|
4373
|
-
"whs-nowrap": "white-space: nowrap;",
|
|
4374
|
-
"whs-pre": "white-space: pre;",
|
|
4375
|
-
"whs-pre-wrap": "white-space: pre-wrap;",
|
|
4376
|
-
"whs-pre-line": "white-space: pre-line;",
|
|
4377
|
-
// Shadow presets
|
|
4378
|
-
"sh-0": "box-shadow: none;",
|
|
4379
|
-
"sh-1": "box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);",
|
|
4380
|
-
"sh-2": "box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);",
|
|
4381
|
-
"sh-3": "box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);",
|
|
4382
|
-
"sh-4": "box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);",
|
|
4383
|
-
// Gradient presets
|
|
4384
|
-
"gr-1": "background: linear-gradient(90deg, rgba(10,22,40,0.85) 0%, rgba(10,22,40,0.2) 100%);",
|
|
4385
|
-
"gr-2": "background: linear-gradient(0deg, #a9e8fd, #00aee8 25%, #0f1335 72%);",
|
|
4386
|
-
// Border presets
|
|
4387
|
-
"bd-0": "border: 1px solid var(--border);",
|
|
4388
|
-
"bd-1": "border: 1px solid var(--border-light);"
|
|
4389
|
-
// Note: CSS functions (blur, translateY, scale, rotate, repeat) are now handled
|
|
4390
|
-
// dynamically via the styleValueRegistry - no need to hardcode specific values here
|
|
4391
|
-
};
|
|
4392
|
-
function extractPropertyAndValue(className) {
|
|
4393
|
-
for (const knownPrefix of SORTED_PREFIXES) {
|
|
4394
|
-
if (className.startsWith(knownPrefix + "-")) {
|
|
4395
|
-
const classValue = className.substring(knownPrefix.length + 1);
|
|
4396
|
-
const cssProp = prefixToCSSProperty[knownPrefix];
|
|
4397
|
-
if (cssProp) {
|
|
4398
|
-
if (/^h[0-9a-z]+$/.test(classValue)) {
|
|
4399
|
-
return null;
|
|
4400
|
-
}
|
|
4401
|
-
return { property: cssProp, value: classValue };
|
|
4402
|
-
}
|
|
4403
|
-
}
|
|
4404
|
-
}
|
|
4405
|
-
return null;
|
|
5764
|
+
return className.replace(/[^a-zA-Z0-9_-]/g, "\\$&");
|
|
4406
5765
|
}
|
|
4407
|
-
|
|
4408
|
-
const
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
if (!className.startsWith(knownPrefix + "-")) continue;
|
|
4412
|
-
const classValue = className.substring(knownPrefix.length + 1);
|
|
4413
|
-
if (!/^h[0-9a-z]+$/.test(classValue)) continue;
|
|
4414
|
-
const cssProp = prefixToCSSProperty[knownPrefix];
|
|
4415
|
-
if (!cssProp) continue;
|
|
4416
|
-
const registered = getStyleValue(className);
|
|
4417
|
-
if (registered == null || registered === "") continue;
|
|
4418
|
-
return { property: cssProp, value: String(registered) };
|
|
5766
|
+
var utilityClassRules = (() => {
|
|
5767
|
+
const rules = {};
|
|
5768
|
+
for (const [className, entry] of Object.entries(staticUtilityReverse)) {
|
|
5769
|
+
rules[className] = `${camelToKebab(entry.prop)}: ${entry.value};`;
|
|
4419
5770
|
}
|
|
4420
|
-
|
|
4421
|
-
}
|
|
4422
|
-
|
|
5771
|
+
for (const [className, entry] of Object.entries(presetClassReverse)) {
|
|
5772
|
+
rules[className] = `${camelToKebab(entry.prop)}: ${entry.value};`;
|
|
5773
|
+
}
|
|
5774
|
+
return rules;
|
|
5775
|
+
})();
|
|
5776
|
+
function resolveScalablePropertyValue(className) {
|
|
5777
|
+
const parsed = parseUtilityClass(className);
|
|
5778
|
+
if (!parsed) return null;
|
|
5779
|
+
if (parsed.value != null) return { property: parsed.property, value: parsed.value };
|
|
5780
|
+
const registered = getStyleValue(className);
|
|
5781
|
+
if (registered == null || registered === "") return null;
|
|
5782
|
+
const value = String(registered);
|
|
5783
|
+
const property = parsed.root ? resolveRootProperty(parsed.root, value) : parsed.property;
|
|
5784
|
+
return { property, value };
|
|
5785
|
+
}
|
|
5786
|
+
var borderSideMap = {
|
|
5787
|
+
"border-t": "border-top",
|
|
5788
|
+
"border-r": "border-right",
|
|
5789
|
+
"border-b": "border-bottom",
|
|
5790
|
+
"border-l": "border-left"
|
|
5791
|
+
};
|
|
5792
|
+
function generateRuleForClass(className, knownTokens) {
|
|
4423
5793
|
if (utilityClassRules[className]) {
|
|
4424
5794
|
return utilityClassRules[className];
|
|
4425
5795
|
}
|
|
4426
|
-
|
|
4427
|
-
|
|
4428
|
-
for (const knownPrefix of SORTED_PREFIXES) {
|
|
4429
|
-
if (className.startsWith(knownPrefix + "-")) {
|
|
4430
|
-
prefix = knownPrefix;
|
|
4431
|
-
classValue = className.substring(knownPrefix.length + 1);
|
|
4432
|
-
break;
|
|
4433
|
-
}
|
|
4434
|
-
}
|
|
4435
|
-
if (!prefix || !classValue) {
|
|
5796
|
+
const parsed = parseUtilityClass(className, knownTokens);
|
|
5797
|
+
if (!parsed) {
|
|
4436
5798
|
const dynamicStyle = getDynamicStyle(className);
|
|
4437
5799
|
if (dynamicStyle) {
|
|
4438
5800
|
return `${dynamicStyle.property}: ${dynamicStyle.value};`;
|
|
4439
5801
|
}
|
|
4440
5802
|
return null;
|
|
4441
5803
|
}
|
|
4442
|
-
|
|
4443
|
-
if (!cssProp) {
|
|
5804
|
+
if (parsed.kind === "arbitrary-property") {
|
|
4444
5805
|
const dynamicStyle = getDynamicStyle(className);
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
}
|
|
4448
|
-
return null;
|
|
5806
|
+
const value2 = dynamicStyle ? dynamicStyle.value : parsed.value;
|
|
5807
|
+
return `${parsed.property}: ${value2};`;
|
|
4449
5808
|
}
|
|
4450
|
-
const
|
|
4451
|
-
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
const
|
|
4460
|
-
|
|
4461
|
-
return `${side}-width: ${width}; ${side}-style: ${borderStyle};`;
|
|
4462
|
-
}
|
|
4463
|
-
const originalValue = getStyleValue(className);
|
|
4464
|
-
if (originalValue !== void 0) {
|
|
4465
|
-
return `${cssProp}: ${originalValue};`;
|
|
4466
|
-
}
|
|
4467
|
-
if (prefix === "b" && classValue.includes("-")) {
|
|
4468
|
-
const parts = classValue.split("-");
|
|
4469
|
-
const width = parts[0];
|
|
4470
|
-
const borderStyle = parts[1] || "solid";
|
|
4471
|
-
const borderColor = parts[2] ? `var(--${parts[2]})` : "currentColor";
|
|
4472
|
-
return `border: ${width} ${borderStyle} ${borderColor};`;
|
|
4473
|
-
}
|
|
4474
|
-
if (prefix === "br" && classValue.includes("-") && !classValue.match(/^\d+px$/)) {
|
|
4475
|
-
return `border-radius: var(--${classValue});`;
|
|
4476
|
-
}
|
|
4477
|
-
let value = classValue;
|
|
4478
|
-
const valuePattern = /\d|auto|inherit|initial|unset|solid|dashed|dotted|double|groove|ridge|inset|outset|none|hidden|minmax|repeat|clamp|calc|min|max|fit-content|var/;
|
|
4479
|
-
const hasParentheses = value.includes("(");
|
|
4480
|
-
if (hasParentheses) {
|
|
4481
|
-
let result = "";
|
|
4482
|
-
let depth = 0;
|
|
4483
|
-
let afterComma = false;
|
|
4484
|
-
for (let i = 0; i < value.length; i++) {
|
|
4485
|
-
const char = value[i];
|
|
4486
|
-
if (char === "(") {
|
|
4487
|
-
depth++;
|
|
4488
|
-
result += char;
|
|
4489
|
-
afterComma = false;
|
|
4490
|
-
} else if (char === ")") {
|
|
4491
|
-
depth--;
|
|
4492
|
-
result += char;
|
|
4493
|
-
afterComma = false;
|
|
4494
|
-
} else if (char === ",") {
|
|
4495
|
-
result += char;
|
|
4496
|
-
afterComma = true;
|
|
4497
|
-
} else if (char === "-" && afterComma && depth > 0) {
|
|
4498
|
-
if (value[i + 1] === "-") {
|
|
4499
|
-
result += " ";
|
|
4500
|
-
} else {
|
|
4501
|
-
result += " ";
|
|
4502
|
-
}
|
|
4503
|
-
afterComma = false;
|
|
4504
|
-
} else if (char === "-" && depth > 0 && i > 0) {
|
|
4505
|
-
const rest = value.substring(i + 1);
|
|
4506
|
-
if (valuePattern.test(rest[0] || "")) {
|
|
4507
|
-
result += " ";
|
|
4508
|
-
} else {
|
|
4509
|
-
result += char;
|
|
4510
|
-
}
|
|
4511
|
-
afterComma = false;
|
|
4512
|
-
} else if (char === "-" && depth === 0 && i > 0) {
|
|
4513
|
-
const rest = value.substring(i + 1);
|
|
4514
|
-
if (valuePattern.test(rest[0] || "")) {
|
|
4515
|
-
result += " ";
|
|
4516
|
-
} else {
|
|
4517
|
-
result += char;
|
|
4518
|
-
}
|
|
4519
|
-
afterComma = false;
|
|
4520
|
-
} else {
|
|
4521
|
-
result += char;
|
|
4522
|
-
afterComma = false;
|
|
4523
|
-
}
|
|
4524
|
-
}
|
|
4525
|
-
value = result;
|
|
4526
|
-
} else if (value.startsWith("-")) {
|
|
4527
|
-
value = value[0] + value.substring(1).replace(new RegExp(`-(?=${valuePattern.source})`, "g"), " ");
|
|
5809
|
+
const root = parsed.root;
|
|
5810
|
+
let value;
|
|
5811
|
+
let property = parsed.property;
|
|
5812
|
+
if (parsed.kind === "hash") {
|
|
5813
|
+
const registered = getStyleValue(className);
|
|
5814
|
+
if (registered == null) return null;
|
|
5815
|
+
value = String(registered);
|
|
5816
|
+
if (root) property = resolveRootProperty(root, value);
|
|
5817
|
+
} else if (parsed.kind === "arbitrary") {
|
|
5818
|
+
const registered = getStyleValue(className);
|
|
5819
|
+
value = registered !== void 0 ? String(registered) : parsed.value;
|
|
4528
5820
|
} else {
|
|
4529
|
-
value = value
|
|
5821
|
+
value = parsed.value;
|
|
4530
5822
|
}
|
|
4531
|
-
|
|
4532
|
-
if (prefix === "px") {
|
|
5823
|
+
if (root === "px") {
|
|
4533
5824
|
return `padding-left: ${value}; padding-right: ${value};`;
|
|
4534
5825
|
}
|
|
4535
|
-
if (
|
|
5826
|
+
if (root === "py") {
|
|
4536
5827
|
return `padding-top: ${value}; padding-bottom: ${value};`;
|
|
4537
5828
|
}
|
|
4538
|
-
if (
|
|
5829
|
+
if (root === "mx") {
|
|
4539
5830
|
return `margin-left: ${value}; margin-right: ${value};`;
|
|
4540
5831
|
}
|
|
4541
|
-
if (
|
|
5832
|
+
if (root === "my") {
|
|
4542
5833
|
return `margin-top: ${value}; margin-bottom: ${value};`;
|
|
4543
5834
|
}
|
|
4544
|
-
if (
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
5835
|
+
if (root && borderSideMap[root] && property !== "border-color") {
|
|
5836
|
+
const side = borderSideMap[root];
|
|
5837
|
+
const tokens = value.split(/\s+/).filter(Boolean);
|
|
5838
|
+
if (tokens.length >= 2) {
|
|
5839
|
+
const declarations = [`${side}-width: ${tokens[0]};`, `${side}-style: ${tokens[1]};`];
|
|
5840
|
+
if (tokens[2]) {
|
|
5841
|
+
declarations.push(`${side}-color: ${tokens.slice(2).join(" ")};`);
|
|
4548
5842
|
}
|
|
4549
|
-
return
|
|
5843
|
+
return declarations.join(" ");
|
|
4550
5844
|
}
|
|
5845
|
+
return `${side}: ${value};`;
|
|
4551
5846
|
}
|
|
4552
|
-
return `${
|
|
5847
|
+
return `${property}: ${value};`;
|
|
4553
5848
|
}
|
|
4554
5849
|
function applyFluidToUtilityRule(rule, className, responsiveScales, breakpoints) {
|
|
4555
5850
|
const propValue = resolveScalablePropertyValue(className);
|
|
@@ -4564,13 +5859,7 @@ function applyFluidToUtilityRule(rule, className, responsiveScales, breakpoints)
|
|
|
4564
5859
|
if (scale == null || scale === 1) return rule;
|
|
4565
5860
|
const range = responsiveScales.fluidRange ?? DEFAULT_FLUID_RANGE;
|
|
4566
5861
|
const baseRef = responsiveScales.baseReference ?? 16;
|
|
4567
|
-
const fluidValue = buildFluidPropertyValue(
|
|
4568
|
-
propValue.value,
|
|
4569
|
-
scale,
|
|
4570
|
-
range.min,
|
|
4571
|
-
range.max,
|
|
4572
|
-
baseRef
|
|
4573
|
-
);
|
|
5862
|
+
const fluidValue = buildFluidPropertyValue(propValue.value, scale, range.min, range.max, baseRef);
|
|
4574
5863
|
if (!fluidValue) return rule;
|
|
4575
5864
|
return `${propValue.property}: ${fluidValue};`;
|
|
4576
5865
|
}
|
|
@@ -4589,22 +5878,12 @@ function applyFluidToStyle(style, responsiveScales, breakpoints) {
|
|
|
4589
5878
|
out[prop] = value;
|
|
4590
5879
|
continue;
|
|
4591
5880
|
}
|
|
4592
|
-
const scale = getScaleMultiplier(
|
|
4593
|
-
responsiveScales,
|
|
4594
|
-
prop,
|
|
4595
|
-
smallest
|
|
4596
|
-
);
|
|
5881
|
+
const scale = getScaleMultiplier(responsiveScales, prop, smallest);
|
|
4597
5882
|
if (scale == null || scale === 1) {
|
|
4598
5883
|
out[prop] = value;
|
|
4599
5884
|
continue;
|
|
4600
5885
|
}
|
|
4601
|
-
const fluidValue = buildFluidPropertyValue(
|
|
4602
|
-
String(value),
|
|
4603
|
-
scale,
|
|
4604
|
-
range.min,
|
|
4605
|
-
range.max,
|
|
4606
|
-
baseRef
|
|
4607
|
-
);
|
|
5886
|
+
const fluidValue = buildFluidPropertyValue(String(value), scale, range.min, range.max, baseRef);
|
|
4608
5887
|
out[prop] = fluidValue ?? value;
|
|
4609
5888
|
}
|
|
4610
5889
|
return out;
|
|
@@ -4625,31 +5904,30 @@ function applyContainerPattern(style, fluidActive) {
|
|
|
4625
5904
|
marginRight: "auto"
|
|
4626
5905
|
};
|
|
4627
5906
|
}
|
|
4628
|
-
function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, responsiveScales, remConfig) {
|
|
5907
|
+
function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, responsiveScales, remConfig, knownTokens) {
|
|
4629
5908
|
const css = [];
|
|
4630
5909
|
const baseClasses = /* @__PURE__ */ new Set();
|
|
4631
5910
|
const autoResponsiveClasses = /* @__PURE__ */ new Set();
|
|
4632
5911
|
const breakpointValues = getBreakpointValues(breakpoints);
|
|
4633
5912
|
const responsiveClasses = {};
|
|
4634
5913
|
for (const [breakpointName, breakpointValue] of Object.entries(breakpointValues)) {
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
5914
|
+
for (const prefix of breakpointClassPrefixes(breakpointName)) {
|
|
5915
|
+
responsiveClasses[prefix] = {
|
|
5916
|
+
classes: /* @__PURE__ */ new Set(),
|
|
5917
|
+
breakpointName,
|
|
5918
|
+
value: breakpointValue
|
|
5919
|
+
};
|
|
4638
5920
|
}
|
|
4639
|
-
responsiveClasses[prefix] = {
|
|
4640
|
-
classes: /* @__PURE__ */ new Set(),
|
|
4641
|
-
breakpointName,
|
|
4642
|
-
value: breakpointValue
|
|
4643
|
-
};
|
|
4644
5921
|
}
|
|
4645
5922
|
for (const className of usedClasses) {
|
|
4646
5923
|
let matched = false;
|
|
4647
5924
|
for (const prefix of Object.keys(responsiveClasses)) {
|
|
4648
|
-
if (className.startsWith(
|
|
4649
|
-
const potentialClass = className.substring(prefix.length
|
|
4650
|
-
const rule = generateRuleForClass(potentialClass);
|
|
4651
|
-
|
|
4652
|
-
|
|
5925
|
+
if (className.startsWith(prefix) && className.length > prefix.length) {
|
|
5926
|
+
const potentialClass = className.substring(prefix.length);
|
|
5927
|
+
const rule = generateRuleForClass(potentialClass, knownTokens);
|
|
5928
|
+
const bucket = responsiveClasses[prefix];
|
|
5929
|
+
if (rule && bucket) {
|
|
5930
|
+
bucket.classes.add(potentialClass);
|
|
4653
5931
|
matched = true;
|
|
4654
5932
|
break;
|
|
4655
5933
|
}
|
|
@@ -4671,7 +5949,7 @@ function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, resp
|
|
|
4671
5949
|
const mode = getResponsiveMode(responsiveScales);
|
|
4672
5950
|
const fluidActive = responsiveScales?.enabled === true && mode === "fluid";
|
|
4673
5951
|
for (const className of sortClassesByPropertyOrder(baseClasses)) {
|
|
4674
|
-
let rule = generateRuleForClass(className);
|
|
5952
|
+
let rule = generateRuleForClass(className, knownTokens);
|
|
4675
5953
|
if (rule) {
|
|
4676
5954
|
if (fluidActive && autoResponsiveClasses.has(className)) {
|
|
4677
5955
|
rule = applyFluidToUtilityRule(rule, className, responsiveScales, breakpoints);
|
|
@@ -4683,7 +5961,7 @@ function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, resp
|
|
|
4683
5961
|
}
|
|
4684
5962
|
const autoResponsiveMediaQueries = {};
|
|
4685
5963
|
if (responsiveScales?.enabled && !fluidActive) {
|
|
4686
|
-
for (const className of autoResponsiveClasses) {
|
|
5964
|
+
for (const className of sortClassesByPropertyOrder(autoResponsiveClasses)) {
|
|
4687
5965
|
const propValue = resolveScalablePropertyValue(className);
|
|
4688
5966
|
if (!propValue) continue;
|
|
4689
5967
|
const category = AUTO_RESPONSIVE_TYPE_MAP[propValue.property];
|
|
@@ -4712,7 +5990,7 @@ function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, resp
|
|
|
4712
5990
|
}
|
|
4713
5991
|
}
|
|
4714
5992
|
const sortedAutoResponsive = Object.entries(autoResponsiveMediaQueries).sort(([, a], [, b]) => b.value - a.value);
|
|
4715
|
-
for (const [
|
|
5993
|
+
for (const [, mq] of sortedAutoResponsive) {
|
|
4716
5994
|
if (mq.classes.length === 0) continue;
|
|
4717
5995
|
css.push(`@media (max-width: ${mq.value}px) {`);
|
|
4718
5996
|
for (const { className, rule } of mq.classes) {
|
|
@@ -4723,12 +6001,12 @@ function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, resp
|
|
|
4723
6001
|
const sortedManualResponsive = Object.entries(responsiveClasses).filter(([, info]) => info.classes.size > 0).sort(([, a], [, b]) => b.value - a.value);
|
|
4724
6002
|
for (const [prefix, breakpointInfo] of sortedManualResponsive) {
|
|
4725
6003
|
const rules = [];
|
|
4726
|
-
for (const className of breakpointInfo.classes) {
|
|
4727
|
-
const rule = generateRuleForClass(className);
|
|
6004
|
+
for (const className of sortClassesByPropertyOrder(breakpointInfo.classes)) {
|
|
6005
|
+
const rule = generateRuleForClass(className, knownTokens);
|
|
4728
6006
|
if (rule) {
|
|
4729
|
-
const escapedClassName = escapeCSSClassName(className);
|
|
6007
|
+
const escapedClassName = escapeCSSClassName(`${prefix}${className}`);
|
|
4730
6008
|
const finalRule = applyRemConversion(rule, remConfig);
|
|
4731
|
-
rules.push(` .${
|
|
6009
|
+
rules.push(` .${escapedClassName} { ${finalRule} }`);
|
|
4732
6010
|
}
|
|
4733
6011
|
}
|
|
4734
6012
|
if (rules.length > 0) {
|
|
@@ -4739,29 +6017,27 @@ function generateUtilityCSS(usedClasses, breakpoints = DEFAULT_BREAKPOINTS, resp
|
|
|
4739
6017
|
}
|
|
4740
6018
|
return css.join("\n");
|
|
4741
6019
|
}
|
|
4742
|
-
function generateSingleClassCSS(className, breakpoints = DEFAULT_BREAKPOINTS, responsiveScales, remConfig) {
|
|
6020
|
+
function generateSingleClassCSS(className, breakpoints = DEFAULT_BREAKPOINTS, responsiveScales, remConfig, knownTokens) {
|
|
4743
6021
|
const breakpointValues = getBreakpointValues(breakpoints);
|
|
4744
6022
|
const css = [];
|
|
4745
6023
|
const responsivePrefixes = {};
|
|
4746
6024
|
for (const [breakpointName, breakpointValue] of Object.entries(breakpointValues)) {
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
prefix = "mob";
|
|
6025
|
+
for (const prefix of breakpointClassPrefixes(breakpointName)) {
|
|
6026
|
+
responsivePrefixes[prefix] = { breakpointName, value: breakpointValue };
|
|
4750
6027
|
}
|
|
4751
|
-
responsivePrefixes[prefix] = { breakpointName, value: breakpointValue };
|
|
4752
6028
|
}
|
|
4753
6029
|
let matched = false;
|
|
4754
6030
|
for (const prefix of Object.keys(responsivePrefixes)) {
|
|
4755
|
-
if (className.startsWith(
|
|
4756
|
-
const potentialClass = className.substring(prefix.length
|
|
4757
|
-
const rule = generateRuleForClass(potentialClass);
|
|
4758
|
-
|
|
6031
|
+
if (className.startsWith(prefix) && className.length > prefix.length) {
|
|
6032
|
+
const potentialClass = className.substring(prefix.length);
|
|
6033
|
+
const rule = generateRuleForClass(potentialClass, knownTokens);
|
|
6034
|
+
const responsivePrefix = responsivePrefixes[prefix];
|
|
6035
|
+
if (rule && responsivePrefix) {
|
|
4759
6036
|
const escapedClassName = escapeCSSClassName(className);
|
|
4760
|
-
const
|
|
4761
|
-
const bpValue = responsivePrefixes[prefix].value;
|
|
6037
|
+
const bpValue = responsivePrefix.value;
|
|
4762
6038
|
const finalRule = applyRemConversion(rule, remConfig);
|
|
4763
6039
|
css.push(`@media (max-width: ${bpValue}px) {
|
|
4764
|
-
.${
|
|
6040
|
+
.${escapedClassName} { ${finalRule} }
|
|
4765
6041
|
}`);
|
|
4766
6042
|
matched = true;
|
|
4767
6043
|
break;
|
|
@@ -4769,7 +6045,7 @@ function generateSingleClassCSS(className, breakpoints = DEFAULT_BREAKPOINTS, re
|
|
|
4769
6045
|
}
|
|
4770
6046
|
}
|
|
4771
6047
|
if (!matched) {
|
|
4772
|
-
let rule = generateRuleForClass(className);
|
|
6048
|
+
let rule = generateRuleForClass(className, knownTokens);
|
|
4773
6049
|
if (!rule) return "";
|
|
4774
6050
|
const mode = getResponsiveMode(responsiveScales);
|
|
4775
6051
|
const fluidActive = responsiveScales?.enabled === true && mode === "fluid";
|
|
@@ -4797,9 +6073,11 @@ function generateSingleClassCSS(className, breakpoints = DEFAULT_BREAKPOINTS, re
|
|
|
4797
6073
|
const scaledValue = scalePropertyValue(propValue.value, baseRef, scale);
|
|
4798
6074
|
if (!scaledValue) continue;
|
|
4799
6075
|
const finalScaledValue = remConfig?.enabled && shouldConvertProperty(propValue.property) ? convertPxToRem(scaledValue, remConfig.baseFontSize) : scaledValue;
|
|
4800
|
-
css.push(
|
|
6076
|
+
css.push(
|
|
6077
|
+
`@media (max-width: ${breakpointValue}px) {
|
|
4801
6078
|
.${escapedClassName} { ${propValue.property}: ${finalScaledValue}; }
|
|
4802
|
-
}`
|
|
6079
|
+
}`
|
|
6080
|
+
);
|
|
4803
6081
|
}
|
|
4804
6082
|
}
|
|
4805
6083
|
}
|
|
@@ -4808,91 +6086,21 @@ function generateSingleClassCSS(className, breakpoints = DEFAULT_BREAKPOINTS, re
|
|
|
4808
6086
|
}
|
|
4809
6087
|
return css.join("\n");
|
|
4810
6088
|
}
|
|
4811
|
-
function extractUtilityClassesFromHTML(html) {
|
|
6089
|
+
function extractUtilityClassesFromHTML(html, knownTokens) {
|
|
4812
6090
|
const classes = /* @__PURE__ */ new Set();
|
|
4813
6091
|
const classRegex = /class="([^"]*)"/g;
|
|
4814
|
-
let match;
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
"f",
|
|
4819
|
-
"fd-col",
|
|
4820
|
-
"fd-row",
|
|
4821
|
-
"g",
|
|
4822
|
-
"b",
|
|
4823
|
-
"i",
|
|
4824
|
-
"ib",
|
|
4825
|
-
"h",
|
|
4826
|
-
"if",
|
|
4827
|
-
"ig",
|
|
4828
|
-
// Justify content
|
|
4829
|
-
"jc-c",
|
|
4830
|
-
"jc-s",
|
|
4831
|
-
"jc-e",
|
|
4832
|
-
"jc-b",
|
|
4833
|
-
"jc-a",
|
|
4834
|
-
// Align items
|
|
4835
|
-
"ai-c",
|
|
4836
|
-
"ai-s",
|
|
4837
|
-
"ai-e",
|
|
4838
|
-
"ai-b",
|
|
4839
|
-
// Overflow
|
|
4840
|
-
"o-h",
|
|
4841
|
-
"o-a",
|
|
4842
|
-
"o-s",
|
|
4843
|
-
"o-v",
|
|
4844
|
-
// Cursor
|
|
4845
|
-
"cursor-pointer",
|
|
4846
|
-
"cursor-default",
|
|
4847
|
-
// White space
|
|
4848
|
-
"whs-normal",
|
|
4849
|
-
"whs-nowrap",
|
|
4850
|
-
"whs-pre",
|
|
4851
|
-
"whs-pre-wrap",
|
|
4852
|
-
"whs-pre-line"
|
|
4853
|
-
]);
|
|
4854
|
-
while ((match = classRegex.exec(html)) !== null) {
|
|
4855
|
-
const classString = match[1];
|
|
4856
|
-
const classList = classString.split(/\s+/);
|
|
6092
|
+
let match = classRegex.exec(html);
|
|
6093
|
+
while (match !== null) {
|
|
6094
|
+
const classList = (match[1] ?? "").split(/\s+/);
|
|
6095
|
+
match = classRegex.exec(html);
|
|
4857
6096
|
for (const className of classList) {
|
|
4858
|
-
if (!className
|
|
4859
|
-
|
|
6097
|
+
if (!className) continue;
|
|
6098
|
+
const { base } = splitVariantPrefix(className);
|
|
6099
|
+
if (parseUtilityClass(base, knownTokens)) {
|
|
4860
6100
|
classes.add(className);
|
|
4861
6101
|
continue;
|
|
4862
6102
|
}
|
|
4863
|
-
|
|
4864
|
-
let hasResponsivePrefix = false;
|
|
4865
|
-
if (className.startsWith("mob-") && className.length > 4) {
|
|
4866
|
-
classToCheck = className.substring(4);
|
|
4867
|
-
hasResponsivePrefix = true;
|
|
4868
|
-
} else if (className.length > 2 && className.charAt(1) === "-" && className.match(/^[a-z]-/)) {
|
|
4869
|
-
const firstChar = className.charAt(0);
|
|
4870
|
-
if (["t", "s", "x", "u"].includes(firstChar)) {
|
|
4871
|
-
classToCheck = className.substring(2);
|
|
4872
|
-
hasResponsivePrefix = true;
|
|
4873
|
-
}
|
|
4874
|
-
}
|
|
4875
|
-
for (const prefix of knownPrefixes) {
|
|
4876
|
-
if (classToCheck === prefix) {
|
|
4877
|
-
classes.add(className);
|
|
4878
|
-
break;
|
|
4879
|
-
} else if (classToCheck.startsWith(prefix + "-")) {
|
|
4880
|
-
classes.add(className);
|
|
4881
|
-
break;
|
|
4882
|
-
}
|
|
4883
|
-
}
|
|
4884
|
-
if (hasResponsivePrefix && !classes.has(className)) {
|
|
4885
|
-
for (const specialPrefix of specialPrefixes) {
|
|
4886
|
-
if (classToCheck === specialPrefix) {
|
|
4887
|
-
classes.add(className);
|
|
4888
|
-
break;
|
|
4889
|
-
} else if (classToCheck.startsWith(specialPrefix + "-")) {
|
|
4890
|
-
classes.add(className);
|
|
4891
|
-
break;
|
|
4892
|
-
}
|
|
4893
|
-
}
|
|
4894
|
-
}
|
|
4895
|
-
if (!classes.has(className) && isDynamicClass(className)) {
|
|
6103
|
+
if (isDynamicClass(className) || isDynamicClass(base)) {
|
|
4896
6104
|
classes.add(className);
|
|
4897
6105
|
}
|
|
4898
6106
|
}
|
|
@@ -4926,9 +6134,7 @@ function generateInteractiveCSS(elementClass, interactiveStyles, breakpoints = D
|
|
|
4926
6134
|
for (const rule of interactiveStyles) {
|
|
4927
6135
|
const { prefix, postfix, style } = rule;
|
|
4928
6136
|
const fullSelector = `${prefix || ""}.${elementClass}${postfix || ""}`;
|
|
4929
|
-
const sortedBreakpoints = Object.entries(breakpointValues).sort(
|
|
4930
|
-
([, a], [, b]) => b - a
|
|
4931
|
-
);
|
|
6137
|
+
const sortedBreakpoints = Object.entries(breakpointValues).sort(([, a], [, b]) => b - a);
|
|
4932
6138
|
if (isResponsiveStyle2(style)) {
|
|
4933
6139
|
const responsive = style;
|
|
4934
6140
|
if (responsive.base && Object.keys(responsive.base).length > 0) {
|
|
@@ -4962,9 +6168,7 @@ function generateInteractiveCSS(elementClass, interactiveStyles, breakpoints = D
|
|
|
4962
6168
|
if (merged && Object.keys(merged).length > 0) {
|
|
4963
6169
|
const properties = applyRemConversion(styleObjectToCSS(merged), remConfig);
|
|
4964
6170
|
if (properties) {
|
|
4965
|
-
css.push(
|
|
4966
|
-
`@media (max-width: ${breakpointValue}px) { ${fullSelector} { ${properties}; } }`
|
|
4967
|
-
);
|
|
6171
|
+
css.push(`@media (max-width: ${breakpointValue}px) { ${fullSelector} { ${properties}; } }`);
|
|
4968
6172
|
}
|
|
4969
6173
|
}
|
|
4970
6174
|
}
|
|
@@ -4982,18 +6186,11 @@ function generateInteractiveCSS(elementClass, interactiveStyles, breakpoints = D
|
|
|
4982
6186
|
}
|
|
4983
6187
|
if (scalingEnabled && !fluidActive) {
|
|
4984
6188
|
for (const [breakpointName, breakpointValue] of sortedBreakpoints) {
|
|
4985
|
-
const scaled = scaleStyleForBreakpoint(
|
|
4986
|
-
flatStyle,
|
|
4987
|
-
responsiveScales,
|
|
4988
|
-
breakpointName,
|
|
4989
|
-
/* @__PURE__ */ new Set()
|
|
4990
|
-
);
|
|
6189
|
+
const scaled = scaleStyleForBreakpoint(flatStyle, responsiveScales, breakpointName, /* @__PURE__ */ new Set());
|
|
4991
6190
|
if (Object.keys(scaled).length === 0) continue;
|
|
4992
6191
|
const scaledProps = applyRemConversion(styleObjectToCSS(scaled), remConfig);
|
|
4993
6192
|
if (!scaledProps) continue;
|
|
4994
|
-
css.push(
|
|
4995
|
-
`@media (max-width: ${breakpointValue}px) { ${fullSelector} { ${scaledProps}; } }`
|
|
4996
|
-
);
|
|
6193
|
+
css.push(`@media (max-width: ${breakpointValue}px) { ${fullSelector} { ${scaledProps}; } }`);
|
|
4997
6194
|
}
|
|
4998
6195
|
}
|
|
4999
6196
|
}
|
|
@@ -5010,11 +6207,7 @@ function scaleStyleForBreakpoint(baseStyle, responsiveScales, breakpointName, sk
|
|
|
5010
6207
|
if (value == null) continue;
|
|
5011
6208
|
const strValue = String(value);
|
|
5012
6209
|
if (strValue === "") continue;
|
|
5013
|
-
const scale = getScaleMultiplier(
|
|
5014
|
-
responsiveScales,
|
|
5015
|
-
property,
|
|
5016
|
-
breakpointName
|
|
5017
|
-
);
|
|
6210
|
+
const scale = getScaleMultiplier(responsiveScales, property, breakpointName);
|
|
5018
6211
|
if (scale == null) continue;
|
|
5019
6212
|
const scaledValue = scalePropertyValue(strValue, baseRef, scale);
|
|
5020
6213
|
if (scaledValue == null || scaledValue === strValue) continue;
|
|
@@ -5034,6 +6227,35 @@ function generateAllInteractiveCSS(interactiveStylesMap, breakpoints = DEFAULT_B
|
|
|
5034
6227
|
}
|
|
5035
6228
|
|
|
5036
6229
|
export {
|
|
6230
|
+
DEFAULT_BREAKPOINTS,
|
|
6231
|
+
normalizeBreakpointConfig,
|
|
6232
|
+
getBreakpointValues,
|
|
6233
|
+
getPreviewPointValues,
|
|
6234
|
+
getAllBreakpointNames,
|
|
6235
|
+
getBreakpointName,
|
|
6236
|
+
getBreakpointLabel,
|
|
6237
|
+
DEFAULT_FLUID_RANGE,
|
|
6238
|
+
DEFAULT_SITE_MARGIN,
|
|
6239
|
+
parseValue,
|
|
6240
|
+
SCALABLE_CSS_PROPERTIES,
|
|
6241
|
+
calculateResponsiveValue,
|
|
6242
|
+
getScaleMultiplier,
|
|
6243
|
+
parseMultiValue,
|
|
6244
|
+
scaleValue,
|
|
6245
|
+
scalePropertyValue,
|
|
6246
|
+
getResponsiveValues,
|
|
6247
|
+
resolveVariableValueAtBreakpoint,
|
|
6248
|
+
getSmallestBreakpointName,
|
|
6249
|
+
buildFluidClamp,
|
|
6250
|
+
buildFluidClampWithExplicitMin,
|
|
6251
|
+
buildSiteMarginClamp,
|
|
6252
|
+
buildFluidPropertyValue,
|
|
6253
|
+
DEFAULT_RESPONSIVE_SCALES,
|
|
6254
|
+
DEFAULT_REM_CONFIG,
|
|
6255
|
+
setErrorHandler,
|
|
6256
|
+
logRuntimeError,
|
|
6257
|
+
logNetworkError,
|
|
6258
|
+
init_errorLogger,
|
|
5037
6259
|
DEFAULT_PREFETCH_CONFIG,
|
|
5038
6260
|
PropDefinitionSchema,
|
|
5039
6261
|
StyleMappingSchema,
|
|
@@ -5134,6 +6356,8 @@ export {
|
|
|
5134
6356
|
isEmbedNode,
|
|
5135
6357
|
isLinkNode,
|
|
5136
6358
|
isLocaleListNode,
|
|
6359
|
+
isIslandNode,
|
|
6360
|
+
isCustomNode,
|
|
5137
6361
|
isCMSListNode,
|
|
5138
6362
|
isListNode,
|
|
5139
6363
|
isValidNodeType,
|
|
@@ -5154,6 +6378,15 @@ export {
|
|
|
5154
6378
|
isRichTextMarker,
|
|
5155
6379
|
richTextMarkerToHtml,
|
|
5156
6380
|
resolvePropsFromDefinition,
|
|
6381
|
+
propertyMap,
|
|
6382
|
+
staticUtilityReverse,
|
|
6383
|
+
keywordValues,
|
|
6384
|
+
presetClassReverse,
|
|
6385
|
+
CSS_NAMED_COLORS,
|
|
6386
|
+
isCssNamedColor,
|
|
6387
|
+
splitVariantPrefix,
|
|
6388
|
+
breakpointClassPrefixes,
|
|
6389
|
+
normalizeBreakpointVariant,
|
|
5157
6390
|
registerStyleValue,
|
|
5158
6391
|
registerDynamicStyle,
|
|
5159
6392
|
getStyleValue,
|
|
@@ -5167,6 +6400,9 @@ export {
|
|
|
5167
6400
|
responsiveStylesToClasses,
|
|
5168
6401
|
classToStyle,
|
|
5169
6402
|
classesToStyles,
|
|
6403
|
+
isClassableStyleValue,
|
|
6404
|
+
splitStyleByClassability,
|
|
6405
|
+
styleHasMapping,
|
|
5170
6406
|
ROOT_STRING,
|
|
5171
6407
|
ROOT_0_STRING,
|
|
5172
6408
|
CHILDREN_SEPARATOR,
|
|
@@ -5203,15 +6439,14 @@ export {
|
|
|
5203
6439
|
rewriteViewportUnits,
|
|
5204
6440
|
DESIGN_VIEWPORT_VARS,
|
|
5205
6441
|
toFriendlyError,
|
|
5206
|
-
CSS_NAMED_COLORS,
|
|
5207
|
-
isCssNamedColor,
|
|
5208
6442
|
sortClassesByPropertyOrder,
|
|
5209
6443
|
generateRuleForClass,
|
|
5210
6444
|
applyContainerPattern,
|
|
5211
6445
|
generateUtilityCSS,
|
|
5212
6446
|
generateSingleClassCSS,
|
|
5213
6447
|
extractUtilityClassesFromHTML,
|
|
6448
|
+
styleObjectToCSS,
|
|
5214
6449
|
generateInteractiveCSS,
|
|
5215
6450
|
generateAllInteractiveCSS
|
|
5216
6451
|
};
|
|
5217
|
-
//# sourceMappingURL=chunk-
|
|
6452
|
+
//# sourceMappingURL=chunk-2IIQK7T3.js.map
|