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
package/dist/lib/shared/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
extractStringValue,
|
|
3
|
-
generateFilenameFromItem,
|
|
4
|
-
generateUniqueFilename,
|
|
5
|
-
rewriteComponentRefs,
|
|
6
|
-
slugify
|
|
7
|
-
} from "../../chunks/chunk-QB2LNO4W.js";
|
|
8
1
|
import {
|
|
9
2
|
CMS_DRAFT_SUFFIX,
|
|
10
3
|
COMMENT_STATUSES,
|
|
4
|
+
CONFIG_AREAS,
|
|
5
|
+
CURRENT_PERMISSIONS_VERSION,
|
|
6
|
+
PERMISSION_ROLES,
|
|
11
7
|
PathTraversalError,
|
|
8
|
+
RESOURCE_KINDS,
|
|
12
9
|
SAFE_IDENTIFIER_REGEX,
|
|
13
10
|
VARIABLE_GROUPS,
|
|
14
11
|
VARIABLE_GROUP_VALUES,
|
|
@@ -17,34 +14,50 @@ import {
|
|
|
17
14
|
buildPageUrlForLocale,
|
|
18
15
|
buildSlugIndex,
|
|
19
16
|
collectComponentLibraries,
|
|
17
|
+
createLogger,
|
|
20
18
|
createTypeSafetyError,
|
|
21
19
|
createValidationError,
|
|
22
20
|
extractFamilyName,
|
|
21
|
+
extractStringValue,
|
|
23
22
|
filterLibrariesByContext,
|
|
24
23
|
findPageBySlug,
|
|
25
24
|
fontFaceCss,
|
|
26
25
|
fontPreloadLinks,
|
|
26
|
+
generateFilenameFromItem,
|
|
27
27
|
generateInlineStyleTag,
|
|
28
28
|
generateLibraryTags,
|
|
29
29
|
generateScriptTag,
|
|
30
30
|
generateShortCssVar,
|
|
31
31
|
generateStylesheetTag,
|
|
32
|
+
generateUniqueFilename,
|
|
32
33
|
getDefaultScalingType,
|
|
33
34
|
getGroupAbbreviation,
|
|
34
35
|
getGroupForProperty,
|
|
35
36
|
getLocaleLinks,
|
|
37
|
+
getLogLevel,
|
|
36
38
|
isBasePropDefinition,
|
|
37
39
|
isListPropDefinition,
|
|
38
40
|
isPathWithinRoot,
|
|
39
41
|
isReservedDraftFilename,
|
|
40
42
|
isSafePathSegment,
|
|
41
43
|
isValidIdentifier,
|
|
44
|
+
logger,
|
|
42
45
|
mergeLibraries,
|
|
43
46
|
resolvePaletteColor,
|
|
44
47
|
resolveSafePath,
|
|
45
48
|
resolveSlugToPageId,
|
|
49
|
+
rewriteComponentRefs,
|
|
50
|
+
setLogLevel,
|
|
51
|
+
setLogSink,
|
|
52
|
+
slugify,
|
|
46
53
|
translatePath
|
|
47
|
-
} from "../../chunks/chunk-
|
|
54
|
+
} from "../../chunks/chunk-QWTQZHG3.js";
|
|
55
|
+
import {
|
|
56
|
+
NETLIFY_LOCALE_404_BEGIN,
|
|
57
|
+
NETLIFY_LOCALE_404_END,
|
|
58
|
+
netlifyLocale404Redirects,
|
|
59
|
+
syncNetlifyLocale404Block
|
|
60
|
+
} from "../../chunks/chunk-2AR55GYH.js";
|
|
48
61
|
import {
|
|
49
62
|
CSS_PROPERTIES,
|
|
50
63
|
CSS_PROPERTIES_DEFINITION,
|
|
@@ -59,11 +72,8 @@ import {
|
|
|
59
72
|
getPropertyType,
|
|
60
73
|
getPropertyValues,
|
|
61
74
|
isVisualModeProperty,
|
|
62
|
-
isVisualModeRowVisible
|
|
63
|
-
|
|
64
|
-
logRuntimeError,
|
|
65
|
-
setErrorHandler
|
|
66
|
-
} from "../../chunks/chunk-H3GJ4H2U.js";
|
|
75
|
+
isVisualModeRowVisible
|
|
76
|
+
} from "../../chunks/chunk-XTKNX4FW.js";
|
|
67
77
|
import {
|
|
68
78
|
BaseComponentRegistry,
|
|
69
79
|
BaseNodeTypeRegistry,
|
|
@@ -78,7 +88,11 @@ import {
|
|
|
78
88
|
ComponentDefinitionSchema,
|
|
79
89
|
ComponentInstanceNodeType,
|
|
80
90
|
ComponentNodeSchema,
|
|
91
|
+
DEFAULT_BREAKPOINTS,
|
|
92
|
+
DEFAULT_FLUID_RANGE,
|
|
81
93
|
DEFAULT_PREFETCH_CONFIG,
|
|
94
|
+
DEFAULT_RESPONSIVE_SCALES,
|
|
95
|
+
DEFAULT_SITE_MARGIN,
|
|
82
96
|
DESIGN_VIEWPORT_VARS,
|
|
83
97
|
EmbedNodeType,
|
|
84
98
|
HtmlNodeType,
|
|
@@ -97,6 +111,7 @@ import {
|
|
|
97
111
|
ROOT_STRING,
|
|
98
112
|
RegistryManager,
|
|
99
113
|
ResponsiveStyleObjectSchema,
|
|
114
|
+
SCALABLE_CSS_PROPERTIES,
|
|
100
115
|
SSRNodeTypeRegistry,
|
|
101
116
|
SSRRegistry,
|
|
102
117
|
SlotMarkerType,
|
|
@@ -110,10 +125,15 @@ import {
|
|
|
110
125
|
applyContainerPattern,
|
|
111
126
|
booleanField,
|
|
112
127
|
breakpointToViewportWidth,
|
|
128
|
+
buildFluidClamp,
|
|
129
|
+
buildFluidClampWithExplicitMin,
|
|
130
|
+
buildFluidPropertyValue,
|
|
113
131
|
buildItemUrl,
|
|
114
132
|
buildParentPaths,
|
|
133
|
+
buildSiteMarginClamp,
|
|
115
134
|
buildTemplateContext,
|
|
116
135
|
builtInNodeTypes,
|
|
136
|
+
calculateResponsiveValue,
|
|
117
137
|
canHaveChildren,
|
|
118
138
|
canHaveStyle,
|
|
119
139
|
classToStyle,
|
|
@@ -136,8 +156,12 @@ import {
|
|
|
136
156
|
generateRuleForClass,
|
|
137
157
|
generateSingleClassCSS,
|
|
138
158
|
generateUtilityCSS,
|
|
159
|
+
getAllBreakpointNames,
|
|
139
160
|
getAllDynamicClasses,
|
|
140
161
|
getAvailableBreakpoints,
|
|
162
|
+
getBreakpointLabel,
|
|
163
|
+
getBreakpointName,
|
|
164
|
+
getBreakpointValues,
|
|
141
165
|
getChildPath,
|
|
142
166
|
getComponentName,
|
|
143
167
|
getDisplayName,
|
|
@@ -147,6 +171,10 @@ import {
|
|
|
147
171
|
getNodeTypeDefinition,
|
|
148
172
|
getParentPath,
|
|
149
173
|
getPathDepth,
|
|
174
|
+
getPreviewPointValues,
|
|
175
|
+
getResponsiveValues,
|
|
176
|
+
getScaleMultiplier,
|
|
177
|
+
getSmallestBreakpointName,
|
|
150
178
|
getStyleValue,
|
|
151
179
|
getTagName,
|
|
152
180
|
getVariableName,
|
|
@@ -159,19 +187,23 @@ import {
|
|
|
159
187
|
hasItemTemplates,
|
|
160
188
|
hydrateRegistry,
|
|
161
189
|
imageField,
|
|
190
|
+
init_errorLogger,
|
|
162
191
|
init_registry,
|
|
163
192
|
init_schemas,
|
|
164
193
|
isAncestorPath,
|
|
165
194
|
isBooleanMapping,
|
|
166
195
|
isCMSListNode,
|
|
196
|
+
isClassableStyleValue,
|
|
167
197
|
isComponentNode,
|
|
168
198
|
isCssNamedColor,
|
|
169
199
|
isCurrentLink,
|
|
200
|
+
isCustomNode,
|
|
170
201
|
isDynamicClass,
|
|
171
202
|
isElementClassName,
|
|
172
203
|
isEmbedNode,
|
|
173
204
|
isEmptyContainer,
|
|
174
205
|
isHtmlNode,
|
|
206
|
+
isIslandNode,
|
|
175
207
|
isItemContext,
|
|
176
208
|
isItemDraftForLocale,
|
|
177
209
|
isItemFullyPublished,
|
|
@@ -193,18 +225,27 @@ import {
|
|
|
193
225
|
isTemplateContext,
|
|
194
226
|
isValidNodeType,
|
|
195
227
|
isVoidElement,
|
|
228
|
+
keywordValues,
|
|
229
|
+
logNetworkError,
|
|
230
|
+
logRuntimeError,
|
|
196
231
|
markAsSlotContent,
|
|
197
232
|
mergeResponsiveStyles,
|
|
233
|
+
normalizeBreakpointConfig,
|
|
234
|
+
normalizeBreakpointVariant,
|
|
198
235
|
normalizePath,
|
|
199
236
|
normalizePathInput,
|
|
200
237
|
normalizeStyle,
|
|
201
238
|
numberField,
|
|
202
239
|
parseElementClassName,
|
|
240
|
+
parseMultiValue,
|
|
241
|
+
parseValue,
|
|
203
242
|
pathToLegacyString,
|
|
204
243
|
pathToString,
|
|
205
244
|
pathsEqual,
|
|
245
|
+
presetClassReverse,
|
|
206
246
|
processItemPropsTemplate,
|
|
207
247
|
processItemTemplate,
|
|
248
|
+
propertyMap,
|
|
208
249
|
registerBuiltInNodeTypes,
|
|
209
250
|
registerDynamicStyle,
|
|
210
251
|
registerStyleValue,
|
|
@@ -213,16 +254,25 @@ import {
|
|
|
213
254
|
resolveItemsTemplate,
|
|
214
255
|
resolvePropsFromDefinition,
|
|
215
256
|
resolveTemplateRawValue,
|
|
257
|
+
resolveVariableValueAtBreakpoint,
|
|
216
258
|
responsiveStylesToClasses,
|
|
217
259
|
rewriteViewportUnits,
|
|
218
260
|
richTextMarkerToHtml,
|
|
261
|
+
scalePropertyValue,
|
|
262
|
+
scaleValue,
|
|
219
263
|
selectField,
|
|
220
264
|
serializeRegistry,
|
|
265
|
+
setErrorHandler,
|
|
221
266
|
setGlobalTemplateContext,
|
|
222
267
|
shortHash,
|
|
223
268
|
singularize,
|
|
224
269
|
sortClassesByPropertyOrder,
|
|
270
|
+
splitStyleByClassability,
|
|
271
|
+
splitVariantPrefix,
|
|
272
|
+
staticUtilityReverse,
|
|
225
273
|
stringToPath,
|
|
274
|
+
styleHasMapping,
|
|
275
|
+
styleObjectToCSS,
|
|
226
276
|
stylesToClasses,
|
|
227
277
|
textField,
|
|
228
278
|
textareaField,
|
|
@@ -240,48 +290,24 @@ import {
|
|
|
240
290
|
validatePath,
|
|
241
291
|
validatePropDefinition,
|
|
242
292
|
validateStructuredComponentDefinition
|
|
243
|
-
} from "../../chunks/chunk-
|
|
293
|
+
} from "../../chunks/chunk-2IIQK7T3.js";
|
|
244
294
|
import {
|
|
245
|
-
DEFAULT_BREAKPOINTS,
|
|
246
|
-
DEFAULT_FLUID_RANGE,
|
|
247
295
|
DEFAULT_I18N_CONFIG,
|
|
248
|
-
DEFAULT_RESPONSIVE_SCALES,
|
|
249
|
-
DEFAULT_SITE_MARGIN,
|
|
250
|
-
SCALABLE_CSS_PROPERTIES,
|
|
251
|
-
buildFluidClamp,
|
|
252
|
-
buildFluidClampWithExplicitMin,
|
|
253
|
-
buildFluidPropertyValue,
|
|
254
296
|
buildLocalizedPath,
|
|
255
|
-
buildSiteMarginClamp,
|
|
256
|
-
calculateResponsiveValue,
|
|
257
297
|
clearStoredLocale,
|
|
258
298
|
extractLocaleFromPath,
|
|
259
299
|
findLocaleByCode,
|
|
260
|
-
getAllBreakpointNames,
|
|
261
|
-
getBreakpointLabel,
|
|
262
|
-
getBreakpointName,
|
|
263
|
-
getBreakpointValues,
|
|
264
300
|
getLocaleCodes,
|
|
265
|
-
getPreviewPointValues,
|
|
266
|
-
getResponsiveValues,
|
|
267
|
-
getScaleMultiplier,
|
|
268
|
-
getSmallestBreakpointName,
|
|
269
301
|
getStoredLocale,
|
|
270
302
|
isI18nValue,
|
|
271
303
|
isValidLocaleCode,
|
|
272
304
|
migrateI18nConfig,
|
|
273
|
-
normalizeBreakpointConfig,
|
|
274
305
|
parseLocaleFromPath,
|
|
275
|
-
parseMultiValue,
|
|
276
|
-
parseValue,
|
|
277
306
|
resolveI18nInProps,
|
|
278
307
|
resolveI18nValue,
|
|
279
308
|
resolveTranslation,
|
|
280
|
-
resolveVariableValueAtBreakpoint,
|
|
281
|
-
scalePropertyValue,
|
|
282
|
-
scaleValue,
|
|
283
309
|
setStoredLocale
|
|
284
|
-
} from "../../chunks/chunk-
|
|
310
|
+
} from "../../chunks/chunk-4ZRU52J2.js";
|
|
285
311
|
import {
|
|
286
312
|
RICH_TEXT_ALLOWED_ATTRS,
|
|
287
313
|
RICH_TEXT_ALLOWED_TAGS,
|
|
@@ -289,7 +315,7 @@ import {
|
|
|
289
315
|
htmlToTiptap,
|
|
290
316
|
isTiptapDocument,
|
|
291
317
|
tiptapToHtml
|
|
292
|
-
} from "../../chunks/chunk-
|
|
318
|
+
} from "../../chunks/chunk-5X4HCN7J.js";
|
|
293
319
|
import {
|
|
294
320
|
API_ROUTES,
|
|
295
321
|
DEFAULT_COMPONENT_TYPES,
|
|
@@ -311,7 +337,7 @@ import {
|
|
|
311
337
|
TREE_SCROLL_DELAY_MS,
|
|
312
338
|
WEBSOCKET_STATES,
|
|
313
339
|
init_constants
|
|
314
|
-
} from "../../chunks/chunk-
|
|
340
|
+
} from "../../chunks/chunk-AR7LHIFY.js";
|
|
315
341
|
import "../../chunks/chunk-KSBZ2L7C.js";
|
|
316
342
|
|
|
317
343
|
// lib/shared/index.ts
|
|
@@ -363,15 +389,16 @@ function getParentAndIndexFromPath(path, pageData) {
|
|
|
363
389
|
let lastIndex = -1;
|
|
364
390
|
for (let i = 1; i < pathArray.length; i++) {
|
|
365
391
|
const childIndex = pathArray[i];
|
|
392
|
+
if (childIndex === void 0) return null;
|
|
366
393
|
if (!current || !("children" in current) || !Array.isArray(current.children)) {
|
|
367
394
|
return null;
|
|
368
395
|
}
|
|
369
|
-
if (isNaN(childIndex) || childIndex < 0 || childIndex >= current.children.length) {
|
|
396
|
+
if (Number.isNaN(childIndex) || childIndex < 0 || childIndex >= current.children.length) {
|
|
370
397
|
return null;
|
|
371
398
|
}
|
|
372
399
|
parent = current;
|
|
373
400
|
const child = current.children[childIndex];
|
|
374
|
-
if (typeof child === "string") {
|
|
401
|
+
if (child === void 0 || typeof child === "string") {
|
|
375
402
|
return null;
|
|
376
403
|
}
|
|
377
404
|
current = child;
|
|
@@ -385,6 +412,25 @@ function getParentAndIndexFromPath(path, pageData) {
|
|
|
385
412
|
}
|
|
386
413
|
return null;
|
|
387
414
|
}
|
|
415
|
+
function findPathToNodeByReference(pageData, target) {
|
|
416
|
+
const root = getRootData(pageData);
|
|
417
|
+
if (!root) return null;
|
|
418
|
+
const stack = [{ node: root, path: [0] }];
|
|
419
|
+
while (stack.length > 0) {
|
|
420
|
+
const { node, path } = stack.pop();
|
|
421
|
+
if (node === target) return path;
|
|
422
|
+
const children = "children" in node ? node.children : void 0;
|
|
423
|
+
if (Array.isArray(children)) {
|
|
424
|
+
for (let i = 0; i < children.length; i++) {
|
|
425
|
+
const child = children[i];
|
|
426
|
+
if (child && typeof child === "object") {
|
|
427
|
+
stack.push({ node: child, path: [...path, i] });
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
388
434
|
function extractStructureWithoutStyles(node) {
|
|
389
435
|
if (!node || typeof node === "string") {
|
|
390
436
|
return node;
|
|
@@ -486,7 +532,7 @@ function isPageDataParent(parent) {
|
|
|
486
532
|
function isComponentNodeParent(parent) {
|
|
487
533
|
if (!parent) return false;
|
|
488
534
|
const nodeType = parent.type;
|
|
489
|
-
return "type" in parent && ("tag" in parent || "component" in parent || nodeType === "slot" || nodeType === "link" || nodeType === "embed" || nodeType === "cms-list" || // Legacy support for migration
|
|
535
|
+
return "type" in parent && ("tag" in parent || "component" in parent || nodeType === "slot" || nodeType === "link" || nodeType === "embed" || nodeType === "custom" || nodeType === "island" || nodeType === "cms-list" || // Legacy support for migration
|
|
490
536
|
nodeType === "list");
|
|
491
537
|
}
|
|
492
538
|
function getParentChildren(parent) {
|
|
@@ -551,6 +597,7 @@ function findSlotMarkerPath(structure, currentPath = [0]) {
|
|
|
551
597
|
}
|
|
552
598
|
for (let i = 0; i < structure.children.length; i++) {
|
|
553
599
|
const child = structure.children[i];
|
|
600
|
+
if (typeof child === "string") continue;
|
|
554
601
|
if (isSlotMarker(child)) {
|
|
555
602
|
return [...currentPath, i];
|
|
556
603
|
}
|
|
@@ -572,15 +619,15 @@ function calculateRenderedPath(logicalPath, currentNode, globalComponentRegistry
|
|
|
572
619
|
let postSlotDepth = -1;
|
|
573
620
|
if (navigationHistory && navigationHistory.length > 0) {
|
|
574
621
|
const currentContext = navigationHistory[navigationHistory.length - 1];
|
|
575
|
-
const instanceChildren = currentContext
|
|
622
|
+
const instanceChildren = currentContext?.instanceChildren;
|
|
576
623
|
const instanceChildrenCount = Array.isArray(instanceChildren) ? instanceChildren.length : 0;
|
|
577
624
|
if (instanceChildrenCount > 0) {
|
|
578
625
|
const rootSlotPath = findSlotMarkerPath(currentNode);
|
|
579
626
|
if (rootSlotPath && rootSlotPath.length > 1) {
|
|
580
627
|
const markerDepth = rootSlotPath.length - 1;
|
|
581
628
|
if (logicalPath.length > markerDepth) {
|
|
582
|
-
const indexAtMarkerLevel = logicalPath[markerDepth];
|
|
583
|
-
const markerIndex = rootSlotPath[markerDepth];
|
|
629
|
+
const indexAtMarkerLevel = logicalPath[markerDepth] ?? 0;
|
|
630
|
+
const markerIndex = rootSlotPath[markerDepth] ?? 0;
|
|
584
631
|
if (indexAtMarkerLevel > markerIndex) {
|
|
585
632
|
postSlotOffset = instanceChildrenCount - 1;
|
|
586
633
|
postSlotDepth = markerDepth;
|
|
@@ -592,13 +639,14 @@ function calculateRenderedPath(logicalPath, currentNode, globalComponentRegistry
|
|
|
592
639
|
let renderedPath = [0];
|
|
593
640
|
let node = currentNode;
|
|
594
641
|
for (let i = 1; i < logicalPath.length; i++) {
|
|
595
|
-
|
|
642
|
+
const originalIndex = logicalPath[i] ?? 0;
|
|
643
|
+
let childIndex = originalIndex;
|
|
596
644
|
if (i === postSlotDepth && postSlotOffset > 0) {
|
|
597
645
|
childIndex += postSlotOffset;
|
|
598
646
|
}
|
|
599
647
|
if (!node || !hasChildren(node)) break;
|
|
600
648
|
const children = node.children;
|
|
601
|
-
const childNode = children[
|
|
649
|
+
const childNode = children[originalIndex];
|
|
602
650
|
if (isComponentNode(node)) {
|
|
603
651
|
const componentName = node.component;
|
|
604
652
|
const componentDef = globalComponentRegistry?.get?.(componentName);
|
|
@@ -606,7 +654,7 @@ function calculateRenderedPath(logicalPath, currentNode, globalComponentRegistry
|
|
|
606
654
|
const slotPath = findSlotMarkerPath(componentDef.component.structure);
|
|
607
655
|
if (slotPath && slotPath.length > 1) {
|
|
608
656
|
const prefix = slotPath.slice(1, -1);
|
|
609
|
-
const slotIndex = slotPath[slotPath.length - 1];
|
|
657
|
+
const slotIndex = slotPath[slotPath.length - 1] ?? 0;
|
|
610
658
|
renderedPath = [...renderedPath, ...prefix, slotIndex + childIndex];
|
|
611
659
|
} else {
|
|
612
660
|
renderedPath = [...renderedPath, childIndex];
|
|
@@ -617,16 +665,17 @@ function calculateRenderedPath(logicalPath, currentNode, globalComponentRegistry
|
|
|
617
665
|
} else {
|
|
618
666
|
renderedPath = [...renderedPath, childIndex];
|
|
619
667
|
}
|
|
620
|
-
node = childNode;
|
|
668
|
+
node = typeof childNode === "string" ? void 0 : childNode;
|
|
621
669
|
}
|
|
622
670
|
return renderedPath;
|
|
623
671
|
}
|
|
624
672
|
function computeCumulativeInstancePath(navigationHistory) {
|
|
625
673
|
if (!navigationHistory || navigationHistory.length === 0) return null;
|
|
626
|
-
let cumulative = navigationHistory[0]
|
|
674
|
+
let cumulative = navigationHistory[0]?.componentInstanceRenderedPath ?? navigationHistory[0]?.componentInstancePath ?? null;
|
|
627
675
|
if (!cumulative) return null;
|
|
628
676
|
for (let i = 1; i < navigationHistory.length; i++) {
|
|
629
|
-
const
|
|
677
|
+
const entry = navigationHistory[i];
|
|
678
|
+
const next = entry?.componentInstanceRenderedPath ?? entry?.componentInstancePath;
|
|
630
679
|
if (next) {
|
|
631
680
|
cumulative = [...cumulative, ...next.slice(1)];
|
|
632
681
|
}
|
|
@@ -638,7 +687,7 @@ function buildTreePathsWithRendered(pageData, globalComponentRegistry, navigatio
|
|
|
638
687
|
if (!rootData) return [];
|
|
639
688
|
const cumulativeInstancePath = computeCumulativeInstancePath(navigationHistory);
|
|
640
689
|
const result = [];
|
|
641
|
-
const hostInstanceChildrenCount = navigationHistory && navigationHistory.length > 0 ? Array.isArray(navigationHistory[navigationHistory.length - 1]
|
|
690
|
+
const hostInstanceChildrenCount = navigationHistory && navigationHistory.length > 0 ? Array.isArray(navigationHistory[navigationHistory.length - 1]?.instanceChildren) ? navigationHistory[navigationHistory.length - 1].instanceChildren.length : 0 : 0;
|
|
642
691
|
function traverse(node, currentPath = [0]) {
|
|
643
692
|
const needsPathCalculation = globalComponentRegistry || navigationHistory && navigationHistory.length > 0;
|
|
644
693
|
const renderedPath = needsPathCalculation ? calculateRenderedPath(currentPath, rootData, globalComponentRegistry, navigationHistory) : currentPath;
|
|
@@ -666,7 +715,7 @@ function buildTreePathsWithRendered(pageData, globalComponentRegistry, navigatio
|
|
|
666
715
|
function expandSlotRenderedPaths(slotRenderedPath, instanceChildrenCount) {
|
|
667
716
|
if (instanceChildrenCount <= 0 || slotRenderedPath.length === 0) return [];
|
|
668
717
|
const prefix = slotRenderedPath.slice(0, -1);
|
|
669
|
-
const slotIdx = slotRenderedPath[slotRenderedPath.length - 1];
|
|
718
|
+
const slotIdx = slotRenderedPath[slotRenderedPath.length - 1] ?? 0;
|
|
670
719
|
const out = [];
|
|
671
720
|
for (let i = 0; i < instanceChildrenCount; i++) {
|
|
672
721
|
out.push([...prefix, slotIdx + i]);
|
|
@@ -676,7 +725,7 @@ function expandSlotRenderedPaths(slotRenderedPath, instanceChildrenCount) {
|
|
|
676
725
|
function buildComponentTreePaths(componentStructure, globalComponentRegistry, navigationHistory) {
|
|
677
726
|
const result = [];
|
|
678
727
|
const cumulativeInstancePath = computeCumulativeInstancePath(navigationHistory);
|
|
679
|
-
const hostInstanceChildrenCount = navigationHistory && navigationHistory.length > 0 ? Array.isArray(navigationHistory[navigationHistory.length - 1]
|
|
728
|
+
const hostInstanceChildrenCount = navigationHistory && navigationHistory.length > 0 ? Array.isArray(navigationHistory[navigationHistory.length - 1]?.instanceChildren) ? navigationHistory[navigationHistory.length - 1].instanceChildren.length : 0 : 0;
|
|
680
729
|
function traverse(node, currentPath = [0]) {
|
|
681
730
|
const needsPathCalculation = globalComponentRegistry || navigationHistory && navigationHistory.length > 0;
|
|
682
731
|
const renderedPath = needsPathCalculation ? calculateRenderedPath(currentPath, componentStructure, globalComponentRegistry, navigationHistory) : currentPath;
|
|
@@ -747,8 +796,18 @@ var CommentNodeIdentitySchema = z2.object({
|
|
|
747
796
|
name: z2.string().min(1),
|
|
748
797
|
label: z2.string().optional()
|
|
749
798
|
});
|
|
799
|
+
var CommentNodeRefSegmentSchema = z2.object({
|
|
800
|
+
kind: z2.enum(["component", "node"]),
|
|
801
|
+
name: z2.string().min(1),
|
|
802
|
+
nth: z2.number().int().nonnegative()
|
|
803
|
+
});
|
|
750
804
|
var CommentAnchorSchema = z2.object({
|
|
805
|
+
// Type + occurrence path (move-resilient source of truth). Must be declared
|
|
806
|
+
// (z.object strips unknown keys) so it round-trips to disk.
|
|
807
|
+
nodeRef: z2.array(CommentNodeRefSegmentSchema).optional(),
|
|
751
808
|
nodePath: z2.array(z2.number().int().nonnegative()),
|
|
809
|
+
// CMS-list item path disambiguating which list copy the element belongs to.
|
|
810
|
+
cmsItemIndexPath: z2.array(z2.number().int().nonnegative()).optional(),
|
|
752
811
|
nodeIdentity: CommentNodeIdentitySchema,
|
|
753
812
|
offsetXPercent: z2.number().min(0).max(1),
|
|
754
813
|
offsetYPercent: z2.number().min(0).max(1),
|
|
@@ -788,6 +847,126 @@ function validateComment(data) {
|
|
|
788
847
|
return { valid: false, errors: zodToValidationErrors(result.error) };
|
|
789
848
|
}
|
|
790
849
|
|
|
850
|
+
// lib/shared/validation/permissionsValidators.ts
|
|
851
|
+
import { z as z3 } from "zod";
|
|
852
|
+
var PermissionRoleSchema = z3.enum(PERMISSION_ROLES);
|
|
853
|
+
var PermissionRuleSchema = z3.object({
|
|
854
|
+
pages: z3.array(z3.string()).optional(),
|
|
855
|
+
components: z3.array(z3.string()).optional(),
|
|
856
|
+
cms: z3.array(z3.string()).optional(),
|
|
857
|
+
config: z3.array(z3.string()).optional()
|
|
858
|
+
});
|
|
859
|
+
var PermissionGrantSchema = z3.object({
|
|
860
|
+
role: PermissionRoleSchema.optional(),
|
|
861
|
+
allow: PermissionRuleSchema.optional()
|
|
862
|
+
});
|
|
863
|
+
var PermissionsPolicySchema = z3.object({
|
|
864
|
+
// Forward-tolerant: accept any positive version; the resolver only knows v1.
|
|
865
|
+
version: z3.number().int().min(1),
|
|
866
|
+
defaultRole: PermissionRoleSchema.optional(),
|
|
867
|
+
members: z3.record(z3.string(), PermissionGrantSchema).optional(),
|
|
868
|
+
teams: z3.record(z3.string(), PermissionGrantSchema).optional()
|
|
869
|
+
});
|
|
870
|
+
function zodToValidationErrors2(zodError) {
|
|
871
|
+
return zodError.errors.map((err) => ({
|
|
872
|
+
path: err.path.join(".") || "root",
|
|
873
|
+
message: err.message,
|
|
874
|
+
code: "INVALID_TYPE"
|
|
875
|
+
}));
|
|
876
|
+
}
|
|
877
|
+
function validatePermissionsPolicy(data) {
|
|
878
|
+
const result = PermissionsPolicySchema.safeParse(data);
|
|
879
|
+
if (result.success) {
|
|
880
|
+
return { valid: true, data: result.data };
|
|
881
|
+
}
|
|
882
|
+
return { valid: false, errors: zodToValidationErrors2(result.error) };
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
// lib/shared/permissions.ts
|
|
886
|
+
var ROLE_RANK = { viewer: 0, editor: 1, admin: 2 };
|
|
887
|
+
var RULE_KEY = {
|
|
888
|
+
page: "pages",
|
|
889
|
+
component: "components",
|
|
890
|
+
cms: "cms",
|
|
891
|
+
config: "config"
|
|
892
|
+
};
|
|
893
|
+
function emptyAllow() {
|
|
894
|
+
return { pages: [], components: [], cms: [], config: [] };
|
|
895
|
+
}
|
|
896
|
+
function higherRole(a, b) {
|
|
897
|
+
return ROLE_RANK[b] > ROLE_RANK[a] ? b : a;
|
|
898
|
+
}
|
|
899
|
+
function grantRole(grant) {
|
|
900
|
+
if (grant.role) return grant.role;
|
|
901
|
+
return grant.allow ? "editor" : "viewer";
|
|
902
|
+
}
|
|
903
|
+
function mergeAllow(grants) {
|
|
904
|
+
const merged = emptyAllow();
|
|
905
|
+
for (const grant of grants) {
|
|
906
|
+
const allow = grant.allow;
|
|
907
|
+
if (!allow) continue;
|
|
908
|
+
for (const kind of Object.keys(merged)) {
|
|
909
|
+
const patterns = allow[kind];
|
|
910
|
+
if (patterns) merged[kind].push(...patterns);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
for (const kind of Object.keys(merged)) {
|
|
914
|
+
merged[kind] = [...new Set(merged[kind])];
|
|
915
|
+
}
|
|
916
|
+
return merged;
|
|
917
|
+
}
|
|
918
|
+
var REGEX_SPECIALS = /[.+?^${}()|[\]\\]/g;
|
|
919
|
+
function matchesPermissionPattern(pattern, value) {
|
|
920
|
+
if (pattern === value) return true;
|
|
921
|
+
if (!pattern.includes("*")) return false;
|
|
922
|
+
const source = pattern.split("*").map((segment) => segment.replace(REGEX_SPECIALS, "\\$&")).join(".*");
|
|
923
|
+
return new RegExp(`^${source}$`).test(value);
|
|
924
|
+
}
|
|
925
|
+
function matchesAnyPermissionPattern(patterns, value) {
|
|
926
|
+
return !!patterns && patterns.some((pattern) => matchesPermissionPattern(pattern, value));
|
|
927
|
+
}
|
|
928
|
+
function resolvePermissions(policy, identity) {
|
|
929
|
+
const login = identity.login ?? null;
|
|
930
|
+
const isRepoAdmin = identity.isRepoAdmin === true;
|
|
931
|
+
if (!policy) {
|
|
932
|
+
return {
|
|
933
|
+
login,
|
|
934
|
+
role: "admin",
|
|
935
|
+
isAdmin: true,
|
|
936
|
+
canManagePolicy: login == null || isRepoAdmin,
|
|
937
|
+
allow: emptyAllow()
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
const grants = [];
|
|
941
|
+
const lookupLogin = login?.toLowerCase() ?? null;
|
|
942
|
+
if (lookupLogin && policy.members) {
|
|
943
|
+
for (const [key, grant] of Object.entries(policy.members)) {
|
|
944
|
+
if (key.toLowerCase() === lookupLogin) grants.push(grant);
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
if (policy.teams && identity.teams && identity.teams.length > 0) {
|
|
948
|
+
const teamSet = new Set(identity.teams.map((team) => team.toLowerCase()));
|
|
949
|
+
for (const [key, grant] of Object.entries(policy.teams)) {
|
|
950
|
+
if (teamSet.has(key.toLowerCase())) grants.push(grant);
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
const defaultRole = policy.defaultRole ?? "viewer";
|
|
954
|
+
const baseRole = grants.length === 0 ? defaultRole : grants.reduce((acc, g) => higherRole(acc, grantRole(g)), "viewer");
|
|
955
|
+
const isAdmin = isRepoAdmin || baseRole === "admin";
|
|
956
|
+
return {
|
|
957
|
+
login,
|
|
958
|
+
role: isAdmin ? "admin" : baseRole,
|
|
959
|
+
isAdmin,
|
|
960
|
+
canManagePolicy: isAdmin,
|
|
961
|
+
allow: mergeAllow(grants)
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
function canEdit(resolved, ref) {
|
|
965
|
+
if (resolved.isAdmin) return true;
|
|
966
|
+
if (resolved.role === "viewer") return false;
|
|
967
|
+
return matchesAnyPermissionPattern(resolved.allow[RULE_KEY[ref.kind]], ref.id);
|
|
968
|
+
}
|
|
969
|
+
|
|
791
970
|
// lib/shared/utils.ts
|
|
792
971
|
function deepClone(obj) {
|
|
793
972
|
return structuredClone(obj);
|
|
@@ -807,7 +986,20 @@ function isEditableElement() {
|
|
|
807
986
|
}
|
|
808
987
|
if (activeElement.tagName === "INPUT") {
|
|
809
988
|
const inputType = activeElement.type.toLowerCase();
|
|
810
|
-
const textInputTypes = [
|
|
989
|
+
const textInputTypes = [
|
|
990
|
+
"text",
|
|
991
|
+
"password",
|
|
992
|
+
"email",
|
|
993
|
+
"number",
|
|
994
|
+
"search",
|
|
995
|
+
"tel",
|
|
996
|
+
"url",
|
|
997
|
+
"date",
|
|
998
|
+
"time",
|
|
999
|
+
"datetime-local",
|
|
1000
|
+
"month",
|
|
1001
|
+
"week"
|
|
1002
|
+
];
|
|
811
1003
|
return textInputTypes.includes(inputType);
|
|
812
1004
|
}
|
|
813
1005
|
let element = activeElement;
|
|
@@ -912,11 +1104,14 @@ function isColorVariable(value) {
|
|
|
912
1104
|
}
|
|
913
1105
|
function extractVariableName(value) {
|
|
914
1106
|
const match = value.match(/^var\(--([^)]+)\)$/);
|
|
915
|
-
return match ? match[1] : null;
|
|
1107
|
+
return match ? match[1] ?? null : null;
|
|
916
1108
|
}
|
|
917
1109
|
function createVariableReference(variableName) {
|
|
918
1110
|
return `var(--${variableName})`;
|
|
919
1111
|
}
|
|
1112
|
+
function colorTokenName(value, colors) {
|
|
1113
|
+
return extractVariableName(value) ?? (value && colors?.[value] ? value : null);
|
|
1114
|
+
}
|
|
920
1115
|
function resolveColorVariable(value, colorMap) {
|
|
921
1116
|
if (!isColorVariable(value)) {
|
|
922
1117
|
return String(value);
|
|
@@ -959,6 +1154,9 @@ function isAppError(error) {
|
|
|
959
1154
|
return typeof error === "object" && error !== null && "category" in error && "code" in error && "message" in error;
|
|
960
1155
|
}
|
|
961
1156
|
|
|
1157
|
+
// lib/shared/index.ts
|
|
1158
|
+
init_errorLogger();
|
|
1159
|
+
|
|
962
1160
|
// lib/shared/colorConversions.ts
|
|
963
1161
|
var HEX_RE = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
964
1162
|
var RGB_RE = /^rgb\(\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*\)$/i;
|
|
@@ -975,18 +1173,18 @@ function parseCssRgb(value) {
|
|
|
975
1173
|
const m = value.trim().match(RGB_RE);
|
|
976
1174
|
if (!m) return null;
|
|
977
1175
|
return {
|
|
978
|
-
r: clamp(parseInt(m[1], 10), 0, 255),
|
|
979
|
-
g: clamp(parseInt(m[2], 10), 0, 255),
|
|
980
|
-
b: clamp(parseInt(m[3], 10), 0, 255)
|
|
1176
|
+
r: clamp(parseInt(m[1] ?? "", 10), 0, 255),
|
|
1177
|
+
g: clamp(parseInt(m[2] ?? "", 10), 0, 255),
|
|
1178
|
+
b: clamp(parseInt(m[3] ?? "", 10), 0, 255)
|
|
981
1179
|
};
|
|
982
1180
|
}
|
|
983
1181
|
function parseCssHsl(value) {
|
|
984
1182
|
const m = value.trim().match(HSL_RE);
|
|
985
1183
|
if (!m) return null;
|
|
986
1184
|
return {
|
|
987
|
-
h: clamp(parseFloat(m[1]), 0, 360),
|
|
988
|
-
s: clamp(parseFloat(m[2]), 0, 100),
|
|
989
|
-
l: clamp(parseFloat(m[3]), 0, 100)
|
|
1185
|
+
h: clamp(parseFloat(m[1] ?? ""), 0, 360),
|
|
1186
|
+
s: clamp(parseFloat(m[2] ?? ""), 0, 100),
|
|
1187
|
+
l: clamp(parseFloat(m[3] ?? ""), 0, 100)
|
|
990
1188
|
};
|
|
991
1189
|
}
|
|
992
1190
|
function rgbToCssString(rgb) {
|
|
@@ -998,9 +1196,9 @@ function hslToCssString(hsl) {
|
|
|
998
1196
|
function expandHex(hex) {
|
|
999
1197
|
const h = hex.replace("#", "");
|
|
1000
1198
|
if (h.length === 3) {
|
|
1001
|
-
return
|
|
1199
|
+
return `#${h[0]}${h[0]}${h[1]}${h[1]}${h[2]}${h[2]}`;
|
|
1002
1200
|
}
|
|
1003
|
-
return
|
|
1201
|
+
return `#${h}`;
|
|
1004
1202
|
}
|
|
1005
1203
|
function hexToRgb(hex) {
|
|
1006
1204
|
const h = expandHex(hex).replace("#", "");
|
|
@@ -1014,7 +1212,7 @@ function rgbToHex(rgb) {
|
|
|
1014
1212
|
const r = clamp(Math.round(rgb.r), 0, 255);
|
|
1015
1213
|
const g = clamp(Math.round(rgb.g), 0, 255);
|
|
1016
1214
|
const b = clamp(Math.round(rgb.b), 0, 255);
|
|
1017
|
-
return
|
|
1215
|
+
return `#${((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1)}`;
|
|
1018
1216
|
}
|
|
1019
1217
|
function rgbToHsl(rgb) {
|
|
1020
1218
|
const r = rgb.r / 255;
|
|
@@ -1090,16 +1288,22 @@ function parseGradient(cssValue) {
|
|
|
1090
1288
|
const v = cssValue.trim();
|
|
1091
1289
|
let match;
|
|
1092
1290
|
let type;
|
|
1093
|
-
|
|
1291
|
+
const linearMatch = v.match(LINEAR_RE);
|
|
1292
|
+
const radialMatch = linearMatch ? null : v.match(RADIAL_RE);
|
|
1293
|
+
const conicMatch = linearMatch || radialMatch ? null : v.match(CONIC_RE);
|
|
1294
|
+
if (linearMatch) {
|
|
1295
|
+
match = linearMatch;
|
|
1094
1296
|
type = "linear";
|
|
1095
|
-
} else if (
|
|
1297
|
+
} else if (radialMatch) {
|
|
1298
|
+
match = radialMatch;
|
|
1096
1299
|
type = "radial";
|
|
1097
|
-
} else if (
|
|
1300
|
+
} else if (conicMatch) {
|
|
1301
|
+
match = conicMatch;
|
|
1098
1302
|
type = "conic";
|
|
1099
1303
|
} else {
|
|
1100
1304
|
return null;
|
|
1101
1305
|
}
|
|
1102
|
-
const inner = match[1];
|
|
1306
|
+
const inner = match[1] ?? "";
|
|
1103
1307
|
const parts = splitGradientArgs(inner);
|
|
1104
1308
|
let angle = type === "linear" ? 180 : 0;
|
|
1105
1309
|
let shape;
|
|
@@ -1132,7 +1336,7 @@ function parseGradient(cssValue) {
|
|
|
1132
1336
|
if (first) {
|
|
1133
1337
|
const fromAngle = first.match(/^from\s+(\d+(?:\.\d+)?)deg/i);
|
|
1134
1338
|
if (fromAngle) {
|
|
1135
|
-
angle = parseFloat(fromAngle[1]);
|
|
1339
|
+
angle = parseFloat(fromAngle[1] ?? "");
|
|
1136
1340
|
stopsStartIndex = 1;
|
|
1137
1341
|
}
|
|
1138
1342
|
}
|
|
@@ -1142,9 +1346,7 @@ function parseGradient(cssValue) {
|
|
|
1142
1346
|
return { type, angle, shape, stops };
|
|
1143
1347
|
}
|
|
1144
1348
|
function buildGradientCss(config) {
|
|
1145
|
-
const stopStrings = config.stops.map(
|
|
1146
|
-
(s) => `${s.color} ${Math.round(s.position)}%`
|
|
1147
|
-
);
|
|
1349
|
+
const stopStrings = config.stops.map((s) => `${s.color} ${Math.round(s.position)}%`);
|
|
1148
1350
|
switch (config.type) {
|
|
1149
1351
|
case "linear": {
|
|
1150
1352
|
return `linear-gradient(${config.angle}deg, ${stopStrings.join(", ")})`;
|
|
@@ -1178,7 +1380,7 @@ function splitGradientArgs(inner) {
|
|
|
1178
1380
|
}
|
|
1179
1381
|
function parseAngle(part) {
|
|
1180
1382
|
const m = part.match(/^(-?\d+(?:\.\d+)?)deg$/i);
|
|
1181
|
-
return m ? parseFloat(m[1]) : null;
|
|
1383
|
+
return m ? parseFloat(m[1] ?? "") : null;
|
|
1182
1384
|
}
|
|
1183
1385
|
function directionToAngle(direction) {
|
|
1184
1386
|
const d = direction.trim().toLowerCase();
|
|
@@ -1198,14 +1400,14 @@ function parseStops(parts) {
|
|
|
1198
1400
|
const stops = [];
|
|
1199
1401
|
const total = parts.length;
|
|
1200
1402
|
for (let i = 0; i < total; i++) {
|
|
1201
|
-
const part = parts[i]
|
|
1403
|
+
const part = parts[i]?.trim();
|
|
1202
1404
|
if (!part) continue;
|
|
1203
1405
|
const posMatch = part.match(/\s+(\d+(?:\.\d+)?)%\s*$/);
|
|
1204
1406
|
let color;
|
|
1205
1407
|
let position;
|
|
1206
1408
|
if (posMatch) {
|
|
1207
1409
|
color = part.slice(0, posMatch.index).trim();
|
|
1208
|
-
position = parseFloat(posMatch[1]);
|
|
1410
|
+
position = parseFloat(posMatch[1] ?? "");
|
|
1209
1411
|
} else {
|
|
1210
1412
|
color = part;
|
|
1211
1413
|
position = total <= 1 ? 0 : i / (total - 1) * 100;
|
|
@@ -1221,7 +1423,7 @@ function parseSortExpression(expr) {
|
|
|
1221
1423
|
const parts = expr.split(",").map((p) => p.trim()).filter(Boolean);
|
|
1222
1424
|
const sorts = parts.map((part) => {
|
|
1223
1425
|
const tokens = part.split(/\s+/);
|
|
1224
|
-
const field = tokens[0];
|
|
1426
|
+
const field = tokens[0] ?? "";
|
|
1225
1427
|
const order = tokens[1]?.toLowerCase() === "desc" ? "desc" : "asc";
|
|
1226
1428
|
return { field, order };
|
|
1227
1429
|
});
|
|
@@ -1241,15 +1443,18 @@ function parseFilterExpression(expr) {
|
|
|
1241
1443
|
if (condition) conditions.push(condition);
|
|
1242
1444
|
}
|
|
1243
1445
|
if (conditions.length === 0) return void 0;
|
|
1244
|
-
|
|
1245
|
-
|
|
1446
|
+
const first = conditions[0];
|
|
1447
|
+
if (conditions.length === 1 && first && (!first.operator || first.operator === "eq")) {
|
|
1448
|
+
return { [first.field]: first.value };
|
|
1246
1449
|
}
|
|
1247
|
-
return conditions.length === 1 ?
|
|
1450
|
+
return conditions.length === 1 && first ? first : conditions;
|
|
1248
1451
|
}
|
|
1249
1452
|
function parseFilterLine(line) {
|
|
1250
1453
|
const match = line.match(/^(\w+)\s*(==|!=|<>|>=|<=|=|>|<|contains|~|in|gte|lte|neq|gt|lt|eq)\s*(.+)$/i);
|
|
1251
1454
|
if (!match) return null;
|
|
1252
|
-
const
|
|
1455
|
+
const field = match[1] ?? "";
|
|
1456
|
+
const op = match[2] ?? "";
|
|
1457
|
+
const rawValue = match[3] ?? "";
|
|
1253
1458
|
const operator = normalizeOperator(op);
|
|
1254
1459
|
const value = parseValue2(rawValue.trim(), operator);
|
|
1255
1460
|
if (operator === "eq") {
|
|
@@ -1262,21 +1467,21 @@ function normalizeOperator(op) {
|
|
|
1262
1467
|
const map = {
|
|
1263
1468
|
"=": "eq",
|
|
1264
1469
|
"==": "eq",
|
|
1265
|
-
|
|
1470
|
+
eq: "eq",
|
|
1266
1471
|
"!=": "neq",
|
|
1267
1472
|
"<>": "neq",
|
|
1268
|
-
|
|
1473
|
+
neq: "neq",
|
|
1269
1474
|
">": "gt",
|
|
1270
|
-
|
|
1475
|
+
gt: "gt",
|
|
1271
1476
|
">=": "gte",
|
|
1272
|
-
|
|
1477
|
+
gte: "gte",
|
|
1273
1478
|
"<": "lt",
|
|
1274
|
-
|
|
1479
|
+
lt: "lt",
|
|
1275
1480
|
"<=": "lte",
|
|
1276
|
-
|
|
1277
|
-
|
|
1481
|
+
lte: "lte",
|
|
1482
|
+
contains: "contains",
|
|
1278
1483
|
"~": "contains",
|
|
1279
|
-
|
|
1484
|
+
in: "in"
|
|
1280
1485
|
};
|
|
1281
1486
|
return map[normalized] || "eq";
|
|
1282
1487
|
}
|
|
@@ -1293,7 +1498,7 @@ function parseScalarValue(raw) {
|
|
|
1293
1498
|
if (raw.toLowerCase() === "true") return true;
|
|
1294
1499
|
if (raw.toLowerCase() === "false") return false;
|
|
1295
1500
|
const num = Number(raw);
|
|
1296
|
-
if (!isNaN(num) && raw !== "") return num;
|
|
1501
|
+
if (!Number.isNaN(num) && raw !== "") return num;
|
|
1297
1502
|
if (raw.startsWith('"') && raw.endsWith('"') || raw.startsWith("'") && raw.endsWith("'")) {
|
|
1298
1503
|
return raw.slice(1, -1);
|
|
1299
1504
|
}
|
|
@@ -1314,14 +1519,14 @@ function serializeFilterExpression(filter) {
|
|
|
1314
1519
|
}
|
|
1315
1520
|
function operatorToString(op) {
|
|
1316
1521
|
const map = {
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1522
|
+
eq: "=",
|
|
1523
|
+
neq: "!=",
|
|
1524
|
+
gt: ">",
|
|
1525
|
+
gte: ">=",
|
|
1526
|
+
lt: "<",
|
|
1527
|
+
lte: "<=",
|
|
1528
|
+
contains: "contains",
|
|
1529
|
+
in: "in"
|
|
1325
1530
|
};
|
|
1326
1531
|
return map[op] || "=";
|
|
1327
1532
|
}
|
|
@@ -1339,7 +1544,7 @@ function serializeValue(value) {
|
|
|
1339
1544
|
// lib/shared/hrefRefs.ts
|
|
1340
1545
|
function rewriteHref(value, oldHref, newHref) {
|
|
1341
1546
|
if (value === oldHref) return newHref;
|
|
1342
|
-
if (value.startsWith(oldHref
|
|
1547
|
+
if (value.startsWith(`${oldHref}/`) || value.startsWith(`${oldHref}?`) || value.startsWith(`${oldHref}#`)) {
|
|
1343
1548
|
return newHref + value.substring(oldHref.length);
|
|
1344
1549
|
}
|
|
1345
1550
|
return null;
|
|
@@ -1404,10 +1609,12 @@ export {
|
|
|
1404
1609
|
CMS_COLLECTION_ID_REGEX,
|
|
1405
1610
|
CMS_DRAFT_SUFFIX,
|
|
1406
1611
|
COMMENT_STATUSES,
|
|
1612
|
+
CONFIG_AREAS,
|
|
1407
1613
|
CSS_NAMED_COLORS,
|
|
1408
1614
|
CSS_PROPERTIES,
|
|
1409
1615
|
CSS_PROPERTIES_DEFINITION,
|
|
1410
1616
|
CSS_PROPERTY_GROUPS,
|
|
1617
|
+
CURRENT_PERMISSIONS_VERSION,
|
|
1411
1618
|
ClientNodeTypeRegistry,
|
|
1412
1619
|
ClientRegistry,
|
|
1413
1620
|
CommentAnchorSchema,
|
|
@@ -1447,16 +1654,24 @@ export {
|
|
|
1447
1654
|
LinkNodeType,
|
|
1448
1655
|
LocaleListNodeType,
|
|
1449
1656
|
MAX_PORT_ATTEMPTS,
|
|
1657
|
+
NETLIFY_LOCALE_404_BEGIN,
|
|
1658
|
+
NETLIFY_LOCALE_404_END,
|
|
1450
1659
|
NODE_TYPE,
|
|
1451
1660
|
NOT_FOUND_TIMEOUT_MS,
|
|
1452
1661
|
NodeTypeManager,
|
|
1662
|
+
PERMISSION_ROLES,
|
|
1453
1663
|
PageDataSchema,
|
|
1454
1664
|
PageDataWithComponentSchema,
|
|
1455
1665
|
PageMetaDataSchema,
|
|
1456
1666
|
PathConversionError,
|
|
1457
1667
|
PathTraversalError,
|
|
1668
|
+
PermissionGrantSchema,
|
|
1669
|
+
PermissionRoleSchema,
|
|
1670
|
+
PermissionRuleSchema,
|
|
1671
|
+
PermissionsPolicySchema,
|
|
1458
1672
|
PropDefinitionSchema,
|
|
1459
1673
|
RAW_HTML_PREFIX,
|
|
1674
|
+
RESOURCE_KINDS,
|
|
1460
1675
|
RICH_TEXT_ALLOWED_ATTRS,
|
|
1461
1676
|
RICH_TEXT_ALLOWED_TAGS,
|
|
1462
1677
|
ROOT_0_STRING,
|
|
@@ -1508,6 +1723,7 @@ export {
|
|
|
1508
1723
|
builtInNodeTypes,
|
|
1509
1724
|
calculateInsertionIndex,
|
|
1510
1725
|
calculateResponsiveValue,
|
|
1726
|
+
canEdit,
|
|
1511
1727
|
canHaveChildren,
|
|
1512
1728
|
canHaveStyle,
|
|
1513
1729
|
classToStyle,
|
|
@@ -1515,12 +1731,14 @@ export {
|
|
|
1515
1731
|
clearRegistry,
|
|
1516
1732
|
clearStoredLocale,
|
|
1517
1733
|
collectComponentLibraries,
|
|
1734
|
+
colorTokenName,
|
|
1518
1735
|
componentHasSlot,
|
|
1519
1736
|
computeCumulativeInstancePath,
|
|
1520
1737
|
convertComponentPathToPagePath,
|
|
1521
1738
|
convertPagePathToComponentPath,
|
|
1522
1739
|
countHrefRefs,
|
|
1523
1740
|
createError,
|
|
1741
|
+
createLogger,
|
|
1524
1742
|
createNodeType,
|
|
1525
1743
|
createStyleMappingFromProps,
|
|
1526
1744
|
createTypeSafetyError,
|
|
@@ -1546,6 +1764,7 @@ export {
|
|
|
1546
1764
|
findLocaleByCode,
|
|
1547
1765
|
findPageBySlug,
|
|
1548
1766
|
findPathData,
|
|
1767
|
+
findPathToNodeByReference,
|
|
1549
1768
|
fontFaceCss,
|
|
1550
1769
|
fontPreloadLinks,
|
|
1551
1770
|
generateAllInteractiveCSS,
|
|
@@ -1579,6 +1798,7 @@ export {
|
|
|
1579
1798
|
getGroupForProperty,
|
|
1580
1799
|
getLocaleCodes,
|
|
1581
1800
|
getLocaleLinks,
|
|
1801
|
+
getLogLevel,
|
|
1582
1802
|
getNestedValue,
|
|
1583
1803
|
getNodeTypeDefinition,
|
|
1584
1804
|
getParentAndIndexFromPath,
|
|
@@ -1619,12 +1839,14 @@ export {
|
|
|
1619
1839
|
isBasePropDefinition,
|
|
1620
1840
|
isBooleanMapping,
|
|
1621
1841
|
isCMSListNode,
|
|
1842
|
+
isClassableStyleValue,
|
|
1622
1843
|
isColorProperty,
|
|
1623
1844
|
isColorVariable,
|
|
1624
1845
|
isComponentNode,
|
|
1625
1846
|
isComponentNodeParent,
|
|
1626
1847
|
isCssNamedColor,
|
|
1627
1848
|
isCurrentLink,
|
|
1849
|
+
isCustomNode,
|
|
1628
1850
|
isDynamicClass,
|
|
1629
1851
|
isEditableElement,
|
|
1630
1852
|
isElementClassName,
|
|
@@ -1633,6 +1855,7 @@ export {
|
|
|
1633
1855
|
isGradientValue,
|
|
1634
1856
|
isHtmlNode,
|
|
1635
1857
|
isI18nValue,
|
|
1858
|
+
isIslandNode,
|
|
1636
1859
|
isItemContext,
|
|
1637
1860
|
isItemDraftForLocale,
|
|
1638
1861
|
isItemFullyPublished,
|
|
@@ -1667,13 +1890,19 @@ export {
|
|
|
1667
1890
|
isVisualModeProperty,
|
|
1668
1891
|
isVisualModeRowVisible,
|
|
1669
1892
|
isVoidElement,
|
|
1893
|
+
keywordValues,
|
|
1670
1894
|
logNetworkError,
|
|
1671
1895
|
logRuntimeError,
|
|
1896
|
+
logger,
|
|
1672
1897
|
markAsSlotContent,
|
|
1898
|
+
matchesAnyPermissionPattern,
|
|
1899
|
+
matchesPermissionPattern,
|
|
1673
1900
|
mergeLibraries,
|
|
1674
1901
|
mergeResponsiveStyles,
|
|
1675
1902
|
migrateI18nConfig,
|
|
1903
|
+
netlifyLocale404Redirects,
|
|
1676
1904
|
normalizeBreakpointConfig,
|
|
1905
|
+
normalizeBreakpointVariant,
|
|
1677
1906
|
normalizeChildrenArray,
|
|
1678
1907
|
normalizePath,
|
|
1679
1908
|
normalizePathInput,
|
|
@@ -1691,8 +1920,10 @@ export {
|
|
|
1691
1920
|
pathToLegacyString,
|
|
1692
1921
|
pathToString,
|
|
1693
1922
|
pathsEqual,
|
|
1923
|
+
presetClassReverse,
|
|
1694
1924
|
processItemPropsTemplate,
|
|
1695
1925
|
processItemTemplate,
|
|
1926
|
+
propertyMap,
|
|
1696
1927
|
registerBuiltInNodeTypes,
|
|
1697
1928
|
registerDynamicStyle,
|
|
1698
1929
|
registerStyleValue,
|
|
@@ -1704,6 +1935,7 @@ export {
|
|
|
1704
1935
|
resolveI18nValue,
|
|
1705
1936
|
resolveItemsTemplate,
|
|
1706
1937
|
resolvePaletteColor,
|
|
1938
|
+
resolvePermissions,
|
|
1707
1939
|
resolvePropsFromDefinition,
|
|
1708
1940
|
resolveSafePath,
|
|
1709
1941
|
resolveSlugToPageId,
|
|
@@ -1726,14 +1958,22 @@ export {
|
|
|
1726
1958
|
serializeSortExpression,
|
|
1727
1959
|
setErrorHandler,
|
|
1728
1960
|
setGlobalTemplateContext,
|
|
1961
|
+
setLogLevel,
|
|
1962
|
+
setLogSink,
|
|
1729
1963
|
setParentChildren,
|
|
1730
1964
|
setStoredLocale,
|
|
1731
1965
|
shortHash,
|
|
1732
1966
|
singularize,
|
|
1733
1967
|
slugify,
|
|
1734
1968
|
sortClassesByPropertyOrder,
|
|
1969
|
+
splitStyleByClassability,
|
|
1970
|
+
splitVariantPrefix,
|
|
1971
|
+
staticUtilityReverse,
|
|
1735
1972
|
stringToPath,
|
|
1973
|
+
styleHasMapping,
|
|
1974
|
+
styleObjectToCSS,
|
|
1736
1975
|
stylesToClasses,
|
|
1976
|
+
syncNetlifyLocale404Block,
|
|
1737
1977
|
textField,
|
|
1738
1978
|
textareaField,
|
|
1739
1979
|
tiptapToHtml,
|
|
@@ -1753,6 +1993,7 @@ export {
|
|
|
1753
1993
|
validatePageDataWithComponent,
|
|
1754
1994
|
validatePageMetaData,
|
|
1755
1995
|
validatePath,
|
|
1996
|
+
validatePermissionsPolicy,
|
|
1756
1997
|
validatePropDefinition,
|
|
1757
1998
|
validateStructuredComponentDefinition,
|
|
1758
1999
|
wait
|