@plitzi/sdk-server 0.32.25 → 0.33.1
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/CHANGELOG.md +21 -0
- package/README.md +326 -162
- package/dist/adapters/authAdapters.d.ts +21 -0
- package/dist/adapters/authAdapters.js +12 -0
- package/dist/adapters/jsonAdapters.d.ts +15 -0
- package/dist/adapters/jsonAdapters.js +9 -4
- package/dist/core/auth/api.d.ts +148 -0
- package/dist/core/auth/api.js +286 -0
- package/dist/core/auth/authorize.d.ts +96 -0
- package/dist/core/auth/authorize.js +92 -0
- package/dist/core/auth/createAuth.d.ts +165 -0
- package/dist/core/auth/createAuth.js +105 -0
- package/dist/core/auth/credentials.d.ts +29 -0
- package/dist/core/auth/credentials.js +48 -0
- package/dist/core/auth/domains.d.ts +41 -0
- package/dist/core/auth/domains.js +78 -0
- package/dist/core/auth/identity.d.ts +108 -0
- package/dist/core/auth/identity.js +164 -0
- package/dist/core/auth/oauth/client.d.ts +5 -0
- package/dist/core/auth/oauth/client.js +47 -0
- package/dist/core/auth/oauth/index.d.ts +78 -0
- package/dist/core/auth/oauth/index.js +113 -0
- package/dist/core/auth/oauth/providers/github.d.ts +2 -0
- package/dist/core/auth/oauth/providers/github.js +48 -0
- package/dist/core/auth/oauth/providers/google.d.ts +2 -0
- package/dist/core/auth/oauth/providers/google.js +30 -0
- package/dist/core/auth/oauth/state.d.ts +23 -0
- package/dist/core/auth/oauth/state.js +55 -0
- package/dist/core/auth/oauth/types.d.ts +51 -0
- package/dist/core/auth/oauth/types.js +13 -0
- package/dist/core/auth/routes.d.ts +50 -0
- package/dist/core/auth/routes.js +129 -0
- package/dist/core/auth/session.d.ts +128 -0
- package/dist/core/auth/session.js +165 -0
- package/dist/core/auth/spaceTokens.d.ts +137 -0
- package/dist/core/auth/spaceTokens.js +212 -0
- package/dist/core/auth/tokens.d.ts +151 -0
- package/dist/core/auth/tokens.js +221 -0
- package/dist/core/createServer.d.ts +29 -0
- package/dist/core/createServer.js +28 -14
- package/dist/core/handlers/authMiddleware.d.ts +27 -0
- package/dist/core/handlers/authMiddleware.js +38 -0
- package/dist/core/handlers/authRouteHandlers.d.ts +46 -0
- package/dist/core/handlers/authRouteHandlers.js +75 -0
- package/dist/core/handlers/types.d.ts +37 -0
- package/dist/{src/core → core}/http/dispatcher.d.ts +2 -2
- package/dist/core/http/dispatcher.js +8 -6
- package/dist/core/http/navigation.d.ts +11 -0
- package/dist/core/http/navigation.js +16 -0
- package/dist/core/http/securityHeaders.js +6 -4
- package/dist/core/http/stages/authApi.d.ts +17 -0
- package/dist/core/http/stages/authApi.js +66 -0
- package/dist/core/http/stages/authRoutes.js +40 -11
- package/dist/core/http/stages/exchangeRoute.d.ts +15 -0
- package/dist/core/http/stages/exchangeRoute.js +67 -0
- package/dist/core/http/stages/health.d.ts +11 -0
- package/dist/core/http/stages/health.js +25 -3
- package/dist/core/http/stages/middlewares.d.ts +2 -0
- package/dist/core/http/stages/static.d.ts +13 -0
- package/dist/core/http/stages/static.js +21 -6
- package/dist/core/http/types.d.ts +35 -0
- package/dist/{modules/mcp/constants.js → core/previewToken.js} +1 -1
- package/dist/core/sdkAssets.d.ts +16 -0
- package/dist/core/sdkAssets.js +46 -0
- package/dist/core/server/baseServer.js +40 -5
- package/dist/core/server/pageServer.d.ts +7 -0
- package/dist/core/server/pageServer.js +13 -17
- package/dist/core/services/action.d.ts +9 -0
- package/dist/core/services/action.js +21 -0
- package/dist/core/services/registry.d.ts +3 -0
- package/dist/core/services/registry.js +9 -19
- package/dist/{src/core → core}/services/resolve.d.ts +1 -0
- package/dist/core/services/resolve.js +6 -4
- package/dist/core/services/rsc.js +3 -2
- package/dist/core/staticFiles.js +1 -1
- package/dist/{src/core → core}/transports.d.ts +3 -0
- package/dist/core/transports.js +7 -6
- package/dist/handlers.d.ts +58 -0
- package/dist/handlers.js +3 -0
- package/dist/{src/helpers → helpers}/buildResponseHelpers.d.ts +2 -1
- package/dist/helpers/buildResponseHelpers.js +13 -4
- package/dist/helpers/buildServerInfo.d.ts +3 -0
- package/dist/helpers/buildServerInfo.js +25 -3
- package/dist/{src/helpers → helpers}/cache/keys.d.ts +5 -1
- package/dist/helpers/cache/keys.js +1 -1
- package/dist/helpers/compress.d.ts +18 -0
- package/dist/helpers/compress.js +47 -11
- package/dist/helpers/offlineDataLoader.d.ts +11 -0
- package/dist/helpers/offlineDataLoader.js +15 -0
- package/dist/helpers/resolveDebugMode.d.ts +10 -0
- package/dist/helpers/resolveDebugMode.js +13 -0
- package/dist/index.d.ts +16 -2
- package/dist/index.js +9 -20
- package/dist/kernel.d.ts +41 -0
- package/dist/kernel.js +22 -0
- package/dist/middlewares/spaceDeployment.d.ts +2 -0
- package/dist/middlewares/spaceDeployment.js +2 -1
- package/dist/modules/actions/handler.d.ts +11 -0
- package/dist/modules/actions/handler.js +77 -0
- package/dist/modules/connectors/engine.d.ts +42 -0
- package/dist/modules/connectors/engine.js +221 -0
- package/dist/modules/connectors/getByPath.d.ts +8 -0
- package/dist/modules/connectors/getByPath.js +21 -0
- package/dist/modules/connectors/index.d.ts +7 -0
- package/dist/modules/connectors/projection.d.ts +18 -0
- package/dist/modules/connectors/projection.js +108 -0
- package/dist/modules/connectors/resolver.d.ts +18 -0
- package/dist/modules/connectors/resolver.js +68 -0
- package/dist/modules/connectors/types.d.ts +19 -0
- package/dist/{src/modules → modules}/rsc/handler.d.ts +2 -2
- package/dist/modules/rsc/handler.js +54 -2
- package/dist/modules/rsc/resolveRscData.d.ts +35 -0
- package/dist/modules/rsc/resolveRscData.js +74 -0
- package/dist/{src/modules → modules}/ssr/Component.d.ts +4 -1
- package/dist/modules/ssr/Component.js +10 -3
- package/dist/modules/ssr/buildBody.d.ts +9 -0
- package/dist/modules/ssr/handler.d.ts +4 -0
- package/dist/modules/ssr/handler.js +18 -1
- package/dist/{src/modules → modules}/ssr/loadPluginComponents.d.ts +5 -2
- package/dist/modules/ssr/loadPluginComponents.js +20 -2
- package/dist/{src/modules → modules}/ssr/prepareRender.d.ts +2 -2
- package/dist/modules/ssr/prepareRender.js +24 -7
- package/dist/modules/ssr/preview.d.ts +10 -0
- package/dist/modules/ssr/preview.js +5 -78
- package/dist/modules/ssr/registerExternalPlugins.js +1 -1
- package/dist/modules/ssr/streamBody.d.ts +5 -0
- package/dist/modules/ssr/streamBody.js +1 -1
- package/dist/modules/ssr/template.d.ts +2 -0
- package/dist/modules/ssr/template.js +1 -1
- package/dist/plugins/compile.js +1 -1
- package/dist/plugins/manager.js +12 -8
- package/dist/ssr.d.ts +15 -0
- package/dist/ssr.js +4 -0
- package/package.json +29 -25
- package/dist/.gitkeep +0 -0
- package/dist/core/server/mcpServer.js +0 -29
- package/dist/core/services/mcp.js +0 -27
- package/dist/core/services/oauth.js +0 -116
- package/dist/core/services/preview.js +0 -37
- package/dist/core/services/proxy.js +0 -12
- package/dist/mcp.d.ts +0 -2
- package/dist/mcp.js +0 -7
- package/dist/modules/ai/AIEngine.js +0 -120
- package/dist/modules/ai/toolkit.js +0 -59
- package/dist/modules/mcp/apps/example/view/index.tsx +0 -70
- package/dist/modules/mcp/apps/index.js +0 -16
- package/dist/modules/mcp/apps/render/index.js +0 -17
- package/dist/modules/mcp/apps/render/styles.js +0 -54
- package/dist/modules/mcp/apps/render/view/heldBatch.ts +0 -107
- package/dist/modules/mcp/apps/render/view/index.tsx +0 -314
- package/dist/modules/mcp/apps/render/view/streamProgress.ts +0 -137
- package/dist/modules/mcp/apps/shared/assets.js +0 -10
- package/dist/modules/mcp/apps/shared/bundle.js +0 -23
- package/dist/modules/mcp/apps/shared/page.js +0 -34
- package/dist/modules/mcp/apps/shared/registerApp.js +0 -43
- package/dist/modules/mcp/apps/shared/resolve.js +0 -5
- package/dist/modules/mcp/apps/shared/shell.ejs +0 -59
- package/dist/modules/mcp/apps/shared/zodEnglishOnly.js +0 -23
- package/dist/modules/mcp/catalogs/builtinCallbacks.js +0 -204
- package/dist/modules/mcp/catalogs/builtinComponents.js +0 -170
- package/dist/modules/mcp/catalogs/builtinElementCallbacks.js +0 -50
- package/dist/modules/mcp/catalogs/builtinTransformers.js +0 -148
- package/dist/modules/mcp/catalogs/builtinUtilities.js +0 -90
- package/dist/modules/mcp/catalogs/cssCatalog/border.js +0 -30
- package/dist/modules/mcp/catalogs/cssCatalog/box.js +0 -31
- package/dist/modules/mcp/catalogs/cssCatalog/helpers.js +0 -185
- package/dist/modules/mcp/catalogs/cssCatalog/index.js +0 -131
- package/dist/modules/mcp/catalogs/cssCatalog/layout.js +0 -98
- package/dist/modules/mcp/catalogs/cssCatalog/visual.js +0 -144
- package/dist/modules/mcp/catalogs/observed.js +0 -90
- package/dist/modules/mcp/catalogs/paramSpec.js +0 -69
- package/dist/modules/mcp/catalogs/registry.js +0 -89
- package/dist/modules/mcp/handler.js +0 -83
- package/dist/modules/mcp/helpers/agentPrompt.js +0 -104
- package/dist/modules/mcp/helpers/computeVersion.js +0 -16
- package/dist/modules/mcp/helpers/guide.js +0 -467
- package/dist/modules/mcp/helpers/interactions.js +0 -123
- package/dist/modules/mcp/helpers/log.js +0 -64
- package/dist/modules/mcp/helpers/opResult.js +0 -18
- package/dist/modules/mcp/helpers/space.js +0 -300
- package/dist/modules/mcp/helpers/uris.js +0 -44
- package/dist/modules/mcp/previewClient.js +0 -31
- package/dist/modules/mcp/proxy/config.js +0 -63
- package/dist/modules/mcp/proxy/fetch.js +0 -91
- package/dist/modules/mcp/proxy/grant.js +0 -67
- package/dist/modules/mcp/proxy/guard.js +0 -38
- package/dist/modules/mcp/proxy/handler.js +0 -99
- package/dist/modules/mcp/proxy/payload.js +0 -29
- package/dist/modules/mcp/proxy/rewrite.js +0 -138
- package/dist/modules/mcp/proxy/sign.js +0 -15
- package/dist/modules/mcp/proxy/types.js +0 -9
- package/dist/modules/mcp/resources/canonical.js +0 -30
- package/dist/modules/mcp/resources/core.js +0 -18
- package/dist/modules/mcp/resources/envelope.js +0 -14
- package/dist/modules/mcp/resources/primer.js +0 -31
- package/dist/modules/mcp/resources/register.js +0 -190
- package/dist/modules/mcp/resources/renderGuide.js +0 -451
- package/dist/modules/mcp/resources/router.js +0 -37
- package/dist/modules/mcp/resources/schema.js +0 -43
- package/dist/modules/mcp/resources/style.js +0 -34
- package/dist/modules/mcp/screenshotClient.js +0 -47
- package/dist/modules/mcp/server.js +0 -113
- package/dist/modules/mcp/tools/apply/dispatch.js +0 -105
- package/dist/modules/mcp/tools/apply/index.js +0 -150
- package/dist/modules/mcp/tools/apply/writeResult.js +0 -37
- package/dist/modules/mcp/tools/index.js +0 -24
- package/dist/modules/mcp/tools/operations/index.js +0 -45
- package/dist/modules/mcp/tools/operations/schema/bindings/deleteBinding.js +0 -32
- package/dist/modules/mcp/tools/operations/schema/bindings/patchBinding.js +0 -36
- package/dist/modules/mcp/tools/operations/schema/bindings/upsertBinding.js +0 -47
- package/dist/modules/mcp/tools/operations/schema/elements/deleteElement.js +0 -29
- package/dist/modules/mcp/tools/operations/schema/elements/moveElement.js +0 -41
- package/dist/modules/mcp/tools/operations/schema/elements/patchElement.js +0 -58
- package/dist/modules/mcp/tools/operations/schema/elements/repeatElement.js +0 -148
- package/dist/modules/mcp/tools/operations/schema/elements/upsertElement.js +0 -65
- package/dist/modules/mcp/tools/operations/schema/folders/deleteFolder.js +0 -30
- package/dist/modules/mcp/tools/operations/schema/folders/upsertFolder.js +0 -49
- package/dist/modules/mcp/tools/operations/schema/interactions/deleteInteraction.js +0 -52
- package/dist/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.js +0 -47
- package/dist/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.js +0 -44
- package/dist/modules/mcp/tools/operations/schema/operations.js +0 -41
- package/dist/modules/mcp/tools/operations/schema/pages/deletePage.js +0 -25
- package/dist/modules/mcp/tools/operations/schema/pages/upsertPage.js +0 -75
- package/dist/modules/mcp/tools/operations/schema/settings/patchSettings.js +0 -45
- package/dist/modules/mcp/tools/operations/schema/shared.js +0 -122
- package/dist/modules/mcp/tools/operations/schema/translator.js +0 -215
- package/dist/modules/mcp/tools/operations/schema/variables/deleteVariable.js +0 -18
- package/dist/modules/mcp/tools/operations/schema/variables/upsertVariable.js +0 -42
- package/dist/modules/mcp/tools/operations/schema/write.js +0 -109
- package/dist/modules/mcp/tools/operations/schemaIds.js +0 -54
- package/dist/modules/mcp/tools/operations/style/definitions/deleteDefinition.js +0 -21
- package/dist/modules/mcp/tools/operations/style/definitions/patchDefinition.js +0 -28
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinition.js +0 -24
- package/dist/modules/mcp/tools/operations/style/definitions/upsertDefinitions.js +0 -40
- package/dist/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.js +0 -21
- package/dist/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.js +0 -28
- package/dist/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.js +0 -24
- package/dist/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.js +0 -21
- package/dist/modules/mcp/tools/operations/style/idStyles/patchIdStyle.js +0 -28
- package/dist/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.js +0 -24
- package/dist/modules/mcp/tools/operations/style/operations.js +0 -29
- package/dist/modules/mcp/tools/operations/style/shared.js +0 -59
- package/dist/modules/mcp/tools/operations/style/translator.js +0 -101
- package/dist/modules/mcp/tools/operations/style/variables/deleteStyleVariable.js +0 -21
- package/dist/modules/mcp/tools/operations/style/variables/upsertStyleVariable.js +0 -22
- package/dist/modules/mcp/tools/operations/style/write.js +0 -108
- package/dist/modules/mcp/tools/preview.js +0 -37
- package/dist/modules/mcp/tools/read.js +0 -51
- package/dist/modules/mcp/tools/render.js +0 -184
- package/dist/modules/mcp/tools/screenshot.js +0 -83
- package/dist/modules/mcp/tools/search.js +0 -115
- package/dist/modules/mcp/tools/shared/expandOperations.js +0 -44
- package/dist/modules/mcp/tools/shared/tool.js +0 -33
- package/dist/modules/mcp/tools/shared/validator/audit.js +0 -124
- package/dist/modules/mcp/tools/shared/validator/batch.js +0 -39
- package/dist/modules/mcp/tools/shared/validator/bindings.js +0 -70
- package/dist/modules/mcp/tools/shared/validator/context.js +0 -35
- package/dist/modules/mcp/tools/shared/validator/css.js +0 -39
- package/dist/modules/mcp/tools/shared/validator/elements.js +0 -68
- package/dist/modules/mcp/tools/shared/validator/index.js +0 -246
- package/dist/modules/mcp/tools/shared/validator/interactions.js +0 -103
- package/dist/modules/mcp/tools/shared/validator/refs.js +0 -28
- package/dist/modules/mcp/tools/validate.js +0 -47
- package/dist/modules/oauth/authorize.js +0 -177
- package/dist/modules/oauth/challenge.js +0 -33
- package/dist/modules/oauth/consentPage.js +0 -118
- package/dist/modules/oauth/metadata.js +0 -69
- package/dist/modules/oauth/params.js +0 -5
- package/dist/modules/oauth/pkce.js +0 -15
- package/dist/modules/oauth/records.js +0 -46
- package/dist/modules/oauth/register.js +0 -55
- package/dist/modules/oauth/respond.js +0 -44
- package/dist/modules/oauth/token.js +0 -100
- package/dist/public/.gitkeep +0 -0
- package/dist/src/adapters/jsonAdapters.d.ts +0 -7
- package/dist/src/core/createServer.d.ts +0 -14
- package/dist/src/core/http/stages/health.d.ts +0 -2
- package/dist/src/core/http/stages/middlewares.d.ts +0 -2
- package/dist/src/core/http/stages/static.d.ts +0 -5
- package/dist/src/core/http/types.d.ts +0 -22
- package/dist/src/core/server/mcpServer.d.ts +0 -2
- package/dist/src/core/server/pageServer.d.ts +0 -10
- package/dist/src/core/services/mcp.d.ts +0 -3
- package/dist/src/core/services/oauth.d.ts +0 -18
- package/dist/src/core/services/preview.d.ts +0 -2
- package/dist/src/core/services/proxy.d.ts +0 -2
- package/dist/src/core/services/registry.d.ts +0 -4
- package/dist/src/helpers/buildServerInfo.d.ts +0 -2
- package/dist/src/helpers/compress.d.ts +0 -3
- package/dist/src/index.d.ts +0 -15
- package/dist/src/mcp.d.ts +0 -14
- package/dist/src/middlewares/spaceDeployment.d.ts +0 -2
- package/dist/src/modules/ai/AIEngine.d.ts +0 -20
- package/dist/src/modules/ai/index.d.ts +0 -4
- package/dist/src/modules/ai/toolkit.d.ts +0 -17
- package/dist/src/modules/mcp/apps/example/index.d.ts +0 -8
- package/dist/src/modules/mcp/apps/index.d.ts +0 -11
- package/dist/src/modules/mcp/apps/render/index.d.ts +0 -4
- package/dist/src/modules/mcp/apps/render/styles.d.ts +0 -10
- package/dist/src/modules/mcp/apps/shared/assets.d.ts +0 -10
- package/dist/src/modules/mcp/apps/shared/bundle.d.ts +0 -4
- package/dist/src/modules/mcp/apps/shared/index.d.ts +0 -3
- package/dist/src/modules/mcp/apps/shared/page.d.ts +0 -2
- package/dist/src/modules/mcp/apps/shared/registerApp.d.ts +0 -5
- package/dist/src/modules/mcp/apps/shared/resolve.d.ts +0 -1
- package/dist/src/modules/mcp/apps/shared/zodEnglishOnly.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/builtinCallbacks.d.ts +0 -23
- package/dist/src/modules/mcp/catalogs/builtinComponents.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/builtinElementCallbacks.d.ts +0 -20
- package/dist/src/modules/mcp/catalogs/builtinTransformers.d.ts +0 -28
- package/dist/src/modules/mcp/catalogs/builtinUtilities.d.ts +0 -18
- package/dist/src/modules/mcp/catalogs/cssCatalog/border.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/cssCatalog/box.d.ts +0 -4
- package/dist/src/modules/mcp/catalogs/cssCatalog/helpers.d.ts +0 -34
- package/dist/src/modules/mcp/catalogs/cssCatalog/index.d.ts +0 -19
- package/dist/src/modules/mcp/catalogs/cssCatalog/layout.d.ts +0 -9
- package/dist/src/modules/mcp/catalogs/cssCatalog/visual.d.ts +0 -8
- package/dist/src/modules/mcp/catalogs/index.d.ts +0 -9
- package/dist/src/modules/mcp/catalogs/observed.d.ts +0 -48
- package/dist/src/modules/mcp/catalogs/paramSpec.d.ts +0 -42
- package/dist/src/modules/mcp/catalogs/registry.d.ts +0 -35
- package/dist/src/modules/mcp/e2e/index.d.ts +0 -6
- package/dist/src/modules/mcp/e2e/mcpEndpoint.d.ts +0 -27
- package/dist/src/modules/mcp/e2e/postMessageChannel.d.ts +0 -22
- package/dist/src/modules/mcp/e2e/renderingHost.d.ts +0 -34
- package/dist/src/modules/mcp/handler.d.ts +0 -22
- package/dist/src/modules/mcp/helpers/agentPrompt.d.ts +0 -4
- package/dist/src/modules/mcp/helpers/computeVersion.d.ts +0 -1
- package/dist/src/modules/mcp/helpers/guide.d.ts +0 -4
- package/dist/src/modules/mcp/helpers/index.d.ts +0 -8
- package/dist/src/modules/mcp/helpers/interactions.d.ts +0 -30
- package/dist/src/modules/mcp/helpers/log.d.ts +0 -8
- package/dist/src/modules/mcp/helpers/opResult.d.ts +0 -13
- package/dist/src/modules/mcp/helpers/space.d.ts +0 -115
- package/dist/src/modules/mcp/helpers/uris.d.ts +0 -28
- package/dist/src/modules/mcp/index.d.ts +0 -13
- package/dist/src/modules/mcp/previewClient.d.ts +0 -13
- package/dist/src/modules/mcp/proxy/config.d.ts +0 -19
- package/dist/src/modules/mcp/proxy/fetch.d.ts +0 -18
- package/dist/src/modules/mcp/proxy/grant.d.ts +0 -25
- package/dist/src/modules/mcp/proxy/guard.d.ts +0 -6
- package/dist/src/modules/mcp/proxy/handler.d.ts +0 -8
- package/dist/src/modules/mcp/proxy/index.d.ts +0 -8
- package/dist/src/modules/mcp/proxy/payload.d.ts +0 -8
- package/dist/src/modules/mcp/proxy/rewrite.d.ts +0 -18
- package/dist/src/modules/mcp/proxy/sign.d.ts +0 -6
- package/dist/src/modules/mcp/proxy/types.d.ts +0 -45
- package/dist/src/modules/mcp/resources/canonical.d.ts +0 -6
- package/dist/src/modules/mcp/resources/core.d.ts +0 -5
- package/dist/src/modules/mcp/resources/envelope.d.ts +0 -10
- package/dist/src/modules/mcp/resources/index.d.ts +0 -8
- package/dist/src/modules/mcp/resources/primer.d.ts +0 -7
- package/dist/src/modules/mcp/resources/register.d.ts +0 -10
- package/dist/src/modules/mcp/resources/renderGuide.d.ts +0 -10
- package/dist/src/modules/mcp/resources/router.d.ts +0 -10
- package/dist/src/modules/mcp/resources/schema.d.ts +0 -5
- package/dist/src/modules/mcp/resources/style.d.ts +0 -5
- package/dist/src/modules/mcp/screenshotClient.d.ts +0 -13
- package/dist/src/modules/mcp/server.d.ts +0 -31
- package/dist/src/modules/mcp/tests/helpers.d.ts +0 -13
- package/dist/src/modules/mcp/tools/apply/dispatch.d.ts +0 -6
- package/dist/src/modules/mcp/tools/apply/index.d.ts +0 -470
- package/dist/src/modules/mcp/tools/apply/writeResult.d.ts +0 -8
- package/dist/src/modules/mcp/tools/index.d.ts +0 -18
- package/dist/src/modules/mcp/tools/operations/index.d.ts +0 -928
- package/dist/src/modules/mcp/tools/operations/schema/bindings/deleteBinding.d.ts +0 -17
- package/dist/src/modules/mcp/tools/operations/schema/bindings/patchBinding.d.ts +0 -25
- package/dist/src/modules/mcp/tools/operations/schema/bindings/upsertBinding.d.ts +0 -27
- package/dist/src/modules/mcp/tools/operations/schema/elements/deleteElement.d.ts +0 -10
- package/dist/src/modules/mcp/tools/operations/schema/elements/moveElement.d.ts +0 -16
- package/dist/src/modules/mcp/tools/operations/schema/elements/patchElement.d.ts +0 -22
- package/dist/src/modules/mcp/tools/operations/schema/elements/repeatElement.d.ts +0 -55
- package/dist/src/modules/mcp/tools/operations/schema/elements/upsertElement.d.ts +0 -16
- package/dist/src/modules/mcp/tools/operations/schema/folders/deleteFolder.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/schema/folders/upsertFolder.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/schema/index.d.ts +0 -21
- package/dist/src/modules/mcp/tools/operations/schema/interactions/deleteInteraction.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/schema/interactions/patchInteractionNode.d.ts +0 -18
- package/dist/src/modules/mcp/tools/operations/schema/interactions/upsertInteractionFlow.d.ts +0 -27
- package/dist/src/modules/mcp/tools/operations/schema/operations.d.ts +0 -229
- package/dist/src/modules/mcp/tools/operations/schema/pages/deletePage.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/schema/pages/upsertPage.d.ts +0 -14
- package/dist/src/modules/mcp/tools/operations/schema/settings/patchSettings.d.ts +0 -34
- package/dist/src/modules/mcp/tools/operations/schema/shared.d.ts +0 -92
- package/dist/src/modules/mcp/tools/operations/schema/translator.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/schema/variables/deleteVariable.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/schema/variables/upsertVariable.d.ts +0 -16
- package/dist/src/modules/mcp/tools/operations/schema/write.d.ts +0 -42
- package/dist/src/modules/mcp/tools/operations/schemaIds.d.ts +0 -6
- package/dist/src/modules/mcp/tools/operations/style/definitions/deleteDefinition.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/style/definitions/patchDefinition.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/definitions/upsertDefinition.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/definitions/upsertDefinitions.d.ts +0 -41
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/deleteGlobalStyle.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/patchGlobalStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/globalStyles/upsertGlobalStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/idStyles/deleteIdStyle.d.ts +0 -9
- package/dist/src/modules/mcp/tools/operations/style/idStyles/patchIdStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/idStyles/upsertIdStyle.d.ts +0 -37
- package/dist/src/modules/mcp/tools/operations/style/index.d.ts +0 -15
- package/dist/src/modules/mcp/tools/operations/style/operations.d.ts +0 -264
- package/dist/src/modules/mcp/tools/operations/style/shared.d.ts +0 -116
- package/dist/src/modules/mcp/tools/operations/style/translator.d.ts +0 -12
- package/dist/src/modules/mcp/tools/operations/style/variables/deleteStyleVariable.d.ts +0 -15
- package/dist/src/modules/mcp/tools/operations/style/variables/upsertStyleVariable.d.ts +0 -20
- package/dist/src/modules/mcp/tools/operations/style/write.d.ts +0 -12
- package/dist/src/modules/mcp/tools/preview.d.ts +0 -465
- package/dist/src/modules/mcp/tools/read.d.ts +0 -9
- package/dist/src/modules/mcp/tools/render.d.ts +0 -499
- package/dist/src/modules/mcp/tools/render.test.d.ts +0 -1
- package/dist/src/modules/mcp/tools/screenshot.d.ts +0 -470
- package/dist/src/modules/mcp/tools/search.d.ts +0 -15
- package/dist/src/modules/mcp/tools/shared/expandOperations.d.ts +0 -13
- package/dist/src/modules/mcp/tools/shared/tool.d.ts +0 -72
- package/dist/src/modules/mcp/tools/shared/validator/audit.d.ts +0 -4
- package/dist/src/modules/mcp/tools/shared/validator/batch.d.ts +0 -5
- package/dist/src/modules/mcp/tools/shared/validator/bindings.d.ts +0 -6
- package/dist/src/modules/mcp/tools/shared/validator/context.d.ts +0 -38
- package/dist/src/modules/mcp/tools/shared/validator/css.d.ts +0 -4
- package/dist/src/modules/mcp/tools/shared/validator/elements.d.ts +0 -7
- package/dist/src/modules/mcp/tools/shared/validator/index.d.ts +0 -8
- package/dist/src/modules/mcp/tools/shared/validator/interactions.d.ts +0 -3
- package/dist/src/modules/mcp/tools/shared/validator/refs.d.ts +0 -4
- package/dist/src/modules/mcp/tools/validate.d.ts +0 -467
- package/dist/src/modules/mcp/types/aiSchema.d.ts +0 -218
- package/dist/src/modules/mcp/types/appTypes.d.ts +0 -26
- package/dist/src/modules/mcp/types/index.d.ts +0 -5
- package/dist/src/modules/mcp/types/previewTypes.d.ts +0 -25
- package/dist/src/modules/mcp/types/screenshotTypes.d.ts +0 -29
- package/dist/src/modules/mcp/types/toolTypes.d.ts +0 -138
- package/dist/src/modules/oauth/authorize.d.ts +0 -7
- package/dist/src/modules/oauth/challenge.d.ts +0 -11
- package/dist/src/modules/oauth/consentPage.d.ts +0 -7
- package/dist/src/modules/oauth/metadata.d.ts +0 -40
- package/dist/src/modules/oauth/params.d.ts +0 -5
- package/dist/src/modules/oauth/pkce.d.ts +0 -6
- package/dist/src/modules/oauth/records.d.ts +0 -71
- package/dist/src/modules/oauth/register.d.ts +0 -5
- package/dist/src/modules/oauth/respond.d.ts +0 -13
- package/dist/src/modules/oauth/token.d.ts +0 -5
- package/dist/src/modules/ssr/buildBody.d.ts +0 -9
- package/dist/src/modules/ssr/handler.d.ts +0 -4
- package/dist/src/modules/ssr/preview.d.ts +0 -16
- package/dist/src/modules/ssr/streamBody.d.ts +0 -5
- package/dist/src/modules/ssr/template.d.ts +0 -6
- package/dist/src/standalone/alias-loader.d.mts +0 -2
- package/dist/src/standalone/plugins/ClientInfo.d.ts +0 -2
- package/dist/src/standalone/plugins/ServerInfo.d.ts +0 -2
- package/dist/src/standalone/plugins/SharedInfo.d.ts +0 -2
- package/dist/src/standalone/plugins/styles.d.ts +0 -5
- package/dist/src/standalone/register-alias.d.mts +0 -1
- package/dist/src/standalone/server.d.ts +0 -1
- package/dist/src/standalone/stubs/react-syntax-highlighter.d.mts +0 -31
- package/skills/plitzi-render/SKILL.md +0 -174
- /package/dist/{src/core/http/dispatcher.test.d.ts → core/auth/api.test.d.ts} +0 -0
- /package/dist/{src/core/server/mcpServer.test.d.ts → core/auth/authorize.test.d.ts} +0 -0
- /package/dist/{src/modules/ai/toolkit.test.d.ts → core/auth/createAuth.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/apps/apps.test.d.ts → core/auth/domains.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/apps/render/styles.test.d.ts → core/auth/identity.test.d.ts} +0 -0
- /package/dist/{src/modules → core/auth}/oauth/oauth.test.d.ts +0 -0
- /package/dist/{src/modules/mcp/catalogs/builtinTransformers.test.d.ts → core/auth/routes.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/catalogs/cssCatalog/cssCatalog.test.d.ts → core/auth/session.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/e2e/connector.test.d.ts → core/auth/spaceTokens.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/e2e/host.test.d.ts → core/auth/tokens.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/e2e/oauthConnector.test.d.ts → core/createServer.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/helpers/log.test.d.ts → core/handlers/handlers.test.d.ts} +0 -0
- /package/dist/{src/core → core}/health.d.ts +0 -0
- /package/dist/{src/modules/mcp/mcp.bench.d.ts → core/http/dispatcher.test.d.ts} +0 -0
- /package/dist/{src/core → core}/http/securityHeaders.d.ts +0 -0
- /package/dist/{src/core → core}/http/stages/authRoutes.d.ts +0 -0
- /package/dist/{src/core → core}/http/stages/pluginAssets.d.ts +0 -0
- /package/dist/{src/core → core}/mimeTypes.d.ts +0 -0
- /package/dist/{src/modules/mcp/constants.d.ts → core/previewToken.d.ts} +0 -0
- /package/dist/{src/core → core}/requestParser.d.ts +0 -0
- /package/dist/{src/core → core}/server/baseServer.d.ts +0 -0
- /package/dist/{src/modules/mcp/proxy/endpoint.test.d.ts → core/server/baseServer.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/proxy/proxy.test.d.ts → core/services/resolve.test.d.ts} +0 -0
- /package/dist/{src/core → core}/services/rsc.d.ts +0 -0
- /package/dist/{src/core → core}/services/ssr.d.ts +0 -0
- /package/dist/{src/core → core}/staticFiles.d.ts +0 -0
- /package/dist/{src/modules/mcp/proxy/wiring.test.d.ts → helpers/buildResponseHelpers.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/cache/TtlCache.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/cache/cacheManager.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/cache/defaults.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/cache/index.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/apply.test.d.ts → helpers/cache/keys.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/cache/serverCaches.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/bindings.test.d.ts → helpers/compress.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/escapeJson.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/metrics.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/normalizePlugins.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/css.test.d.ts → helpers/offlineDataLoader.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/readCookie.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/interactions.test.d.ts → helpers/resolveDebugMode.test.d.ts} +0 -0
- /package/dist/{src/helpers → helpers}/runMiddlewares.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/serverLog.d.ts +0 -0
- /package/dist/{src/middlewares → middlewares}/auth.d.ts +0 -0
- /package/dist/{src/middlewares → middlewares}/basicAuth.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/pages.test.d.ts → middlewares/spaceDeployment.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/reads.test.d.ts → modules/actions/handler.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/schemaIds.test.d.ts → modules/connectors/engine.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/search.test.d.ts → modules/connectors/projection.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/skill.test.d.ts → modules/connectors/resolver.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/styles.test.d.ts → modules/rsc/resolveRscData.test.d.ts} +0 -0
- /package/dist/{src/modules → modules}/ssr/applySSRResult.d.ts +0 -0
- /package/dist/{src/modules/mcp/tests/tools.test.d.ts → modules/ssr/loadPluginComponents.test.d.ts} +0 -0
- /package/dist/{src/modules/mcp/tests/validation.test.d.ts → modules/ssr/metering.test.d.ts} +0 -0
- /package/dist/{src/modules → modules}/ssr/registerExternalPlugins.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/compile.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/copy.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/detect.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/manager.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/validate.d.ts +0 -0
- /package/dist/{src/plugins → plugins}/validate.test.d.ts +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { expandTo4, splitPair, splitTokens } from "./helpers.js";
|
|
2
|
-
//#region src/modules/mcp/catalogs/cssCatalog/box.ts
|
|
3
|
-
var CORNERS = [
|
|
4
|
-
"top-left",
|
|
5
|
-
"top-right",
|
|
6
|
-
"bottom-right",
|
|
7
|
-
"bottom-left"
|
|
8
|
-
];
|
|
9
|
-
var expandBox = (key, value, out) => {
|
|
10
|
-
const [top, right, bottom, left] = expandTo4(splitTokens(value));
|
|
11
|
-
const prefix = key === "inset" ? "" : `${key}-`;
|
|
12
|
-
out[`${prefix}top`] = top;
|
|
13
|
-
out[`${prefix}right`] = right;
|
|
14
|
-
out[`${prefix}bottom`] = bottom;
|
|
15
|
-
out[`${prefix}left`] = left;
|
|
16
|
-
};
|
|
17
|
-
var expandBorderRadius = (value, out) => {
|
|
18
|
-
const [horizontal, vertical] = splitPair(value, "/");
|
|
19
|
-
const h = expandTo4(splitTokens(horizontal));
|
|
20
|
-
const v = vertical === void 0 ? void 0 : expandTo4(splitTokens(vertical));
|
|
21
|
-
CORNERS.forEach((corner, index) => {
|
|
22
|
-
out[`border-${corner}-radius`] = v ? `${h[index]} ${v[index]}` : h[index];
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
var expandGap = (value, out) => {
|
|
26
|
-
const [row, col = row] = splitTokens(value);
|
|
27
|
-
out["row-gap"] = row;
|
|
28
|
-
out["column-gap"] = col;
|
|
29
|
-
};
|
|
30
|
-
//#endregion
|
|
31
|
-
export { expandBorderRadius, expandBox, expandGap };
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
//#region src/modules/mcp/catalogs/cssCatalog/helpers.ts
|
|
2
|
-
var walkTopLevel = (value, onChar) => {
|
|
3
|
-
let depth = 0;
|
|
4
|
-
let quote = "";
|
|
5
|
-
for (const ch of value) {
|
|
6
|
-
if (quote) {
|
|
7
|
-
onChar(ch, false);
|
|
8
|
-
if (ch === quote) quote = "";
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
if (/["']/.test(ch)) {
|
|
12
|
-
quote = ch;
|
|
13
|
-
onChar(ch, false);
|
|
14
|
-
continue;
|
|
15
|
-
}
|
|
16
|
-
if (ch === "(") depth += 1;
|
|
17
|
-
else if (ch === ")") depth = Math.max(0, depth - 1);
|
|
18
|
-
onChar(ch, depth === 0);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
/** Split a shorthand value into whitespace-separated tokens, keeping parenthesized and quoted runs whole. */
|
|
22
|
-
var splitTokens = (value) => {
|
|
23
|
-
const tokens = [];
|
|
24
|
-
let current = "";
|
|
25
|
-
walkTopLevel(value.trim(), (ch, topLevel) => {
|
|
26
|
-
if (topLevel && /\s/.test(ch)) {
|
|
27
|
-
if (current) {
|
|
28
|
-
tokens.push(current);
|
|
29
|
-
current = "";
|
|
30
|
-
}
|
|
31
|
-
} else current += ch;
|
|
32
|
-
});
|
|
33
|
-
if (current) tokens.push(current);
|
|
34
|
-
return tokens;
|
|
35
|
-
};
|
|
36
|
-
/** Split a value on a top-level separator. Used for the comma-separated layers of transition/animation/background
|
|
37
|
-
* and for the `/` of border-radius/grid-template/grid-row. */
|
|
38
|
-
var splitOn = (value, separator) => {
|
|
39
|
-
const parts = [];
|
|
40
|
-
let current = "";
|
|
41
|
-
walkTopLevel(value, (ch, topLevel) => {
|
|
42
|
-
if (topLevel && ch === separator) {
|
|
43
|
-
parts.push(current);
|
|
44
|
-
current = "";
|
|
45
|
-
} else current += ch;
|
|
46
|
-
});
|
|
47
|
-
parts.push(current);
|
|
48
|
-
return parts.map((part) => part.trim());
|
|
49
|
-
};
|
|
50
|
-
/** Split a value on its first top-level `/` — the `a / b` form of border-radius, grid-template, background and
|
|
51
|
-
* font. Returns the half after the slash as undefined when there is none, which is what tells those expanders the
|
|
52
|
-
* second half was not declared at all. */
|
|
53
|
-
var splitPair = (value, separator) => {
|
|
54
|
-
const [first, ...rest] = splitOn(value, separator);
|
|
55
|
-
return [first, rest.length > 0 ? rest.join(separator) : void 0];
|
|
56
|
-
};
|
|
57
|
-
var TIME_RE = /^-?[\d.]+(ms|s)$/;
|
|
58
|
-
var NUMBER_RE = /^-?[\d.]+$/;
|
|
59
|
-
/** A numeric value with an optional unit or `%` — matches both `12px` and `50%`. */
|
|
60
|
-
var LENGTH_RE = /^-?[\d.]+([a-z%]*)$/;
|
|
61
|
-
var QUOTE_RE = /^['"]/;
|
|
62
|
-
/** Resolve the 1–4 value syntax shared by padding/margin/inset (top/right/bottom/left) and border-radius
|
|
63
|
-
* (top-left/top-right/bottom-right/bottom-left): 1 value fills all, 2 pair up, 3 leave the 4th mirroring the 2nd. */
|
|
64
|
-
var expandTo4 = (tokens) => {
|
|
65
|
-
const [a, b = a, c = a, d = b] = tokens;
|
|
66
|
-
return [
|
|
67
|
-
a,
|
|
68
|
-
b,
|
|
69
|
-
c,
|
|
70
|
-
d
|
|
71
|
-
];
|
|
72
|
-
};
|
|
73
|
-
var SIDES = [
|
|
74
|
-
"top",
|
|
75
|
-
"right",
|
|
76
|
-
"bottom",
|
|
77
|
-
"left"
|
|
78
|
-
];
|
|
79
|
-
var FLEX_DIRECTIONS = /* @__PURE__ */ new Set([
|
|
80
|
-
"row",
|
|
81
|
-
"row-reverse",
|
|
82
|
-
"column",
|
|
83
|
-
"column-reverse"
|
|
84
|
-
]);
|
|
85
|
-
var FLEX_WRAPS = /* @__PURE__ */ new Set([
|
|
86
|
-
"nowrap",
|
|
87
|
-
"wrap",
|
|
88
|
-
"wrap-reverse"
|
|
89
|
-
]);
|
|
90
|
-
var LIST_STYLE_TYPES = /* @__PURE__ */ new Set([
|
|
91
|
-
"disc",
|
|
92
|
-
"circle",
|
|
93
|
-
"square",
|
|
94
|
-
"decimal",
|
|
95
|
-
"decimal-leading-zero",
|
|
96
|
-
"lower-roman",
|
|
97
|
-
"upper-roman",
|
|
98
|
-
"lower-alpha",
|
|
99
|
-
"upper-alpha",
|
|
100
|
-
"lower-greek",
|
|
101
|
-
"lower-latin",
|
|
102
|
-
"upper-latin",
|
|
103
|
-
"armenian",
|
|
104
|
-
"georgian",
|
|
105
|
-
"none"
|
|
106
|
-
]);
|
|
107
|
-
var LIST_STYLE_POSITIONS = /* @__PURE__ */ new Set(["inside", "outside"]);
|
|
108
|
-
var TEXT_DECORATION_LINES = /* @__PURE__ */ new Set([
|
|
109
|
-
"underline",
|
|
110
|
-
"overline",
|
|
111
|
-
"line-through",
|
|
112
|
-
"blink",
|
|
113
|
-
"none"
|
|
114
|
-
]);
|
|
115
|
-
var TEXT_DECORATION_STYLES = /* @__PURE__ */ new Set([
|
|
116
|
-
"solid",
|
|
117
|
-
"double",
|
|
118
|
-
"dotted",
|
|
119
|
-
"dashed",
|
|
120
|
-
"wavy"
|
|
121
|
-
]);
|
|
122
|
-
var TIMING_FUNCTIONS = /* @__PURE__ */ new Set([
|
|
123
|
-
"ease",
|
|
124
|
-
"linear",
|
|
125
|
-
"ease-in",
|
|
126
|
-
"ease-out",
|
|
127
|
-
"ease-in-out",
|
|
128
|
-
"step-start",
|
|
129
|
-
"step-end"
|
|
130
|
-
]);
|
|
131
|
-
/** A timing function may also be a function call — cubic-bezier(…) or steps(…). */
|
|
132
|
-
var isTimingFunction = (token) => TIMING_FUNCTIONS.has(token) || token.startsWith("cubic-bezier(") || token.startsWith("steps(");
|
|
133
|
-
var ANIMATION_DIRECTIONS = /* @__PURE__ */ new Set([
|
|
134
|
-
"normal",
|
|
135
|
-
"reverse",
|
|
136
|
-
"alternate",
|
|
137
|
-
"alternate-reverse"
|
|
138
|
-
]);
|
|
139
|
-
var ANIMATION_FILL_MODES = /* @__PURE__ */ new Set([
|
|
140
|
-
"none",
|
|
141
|
-
"forwards",
|
|
142
|
-
"backwards",
|
|
143
|
-
"both"
|
|
144
|
-
]);
|
|
145
|
-
var ANIMATION_PLAY_STATES = /* @__PURE__ */ new Set(["running", "paused"]);
|
|
146
|
-
var FONT_STYLE_KEYWORDS = /* @__PURE__ */ new Set([
|
|
147
|
-
"normal",
|
|
148
|
-
"italic",
|
|
149
|
-
"oblique"
|
|
150
|
-
]);
|
|
151
|
-
var FONT_VARIANT_KEYWORDS = /* @__PURE__ */ new Set(["normal", "small-caps"]);
|
|
152
|
-
var FONT_WEIGHT_KEYWORDS = /* @__PURE__ */ new Set([
|
|
153
|
-
"normal",
|
|
154
|
-
"bold",
|
|
155
|
-
"bolder",
|
|
156
|
-
"lighter",
|
|
157
|
-
"100",
|
|
158
|
-
"200",
|
|
159
|
-
"300",
|
|
160
|
-
"400",
|
|
161
|
-
"500",
|
|
162
|
-
"600",
|
|
163
|
-
"700",
|
|
164
|
-
"800",
|
|
165
|
-
"900"
|
|
166
|
-
]);
|
|
167
|
-
var BORDER_STYLES = /* @__PURE__ */ new Set([
|
|
168
|
-
"none",
|
|
169
|
-
"hidden",
|
|
170
|
-
"dotted",
|
|
171
|
-
"dashed",
|
|
172
|
-
"solid",
|
|
173
|
-
"double",
|
|
174
|
-
"groove",
|
|
175
|
-
"ridge",
|
|
176
|
-
"inset",
|
|
177
|
-
"outset"
|
|
178
|
-
]);
|
|
179
|
-
var BORDER_WIDTH_KEYWORDS = /* @__PURE__ */ new Set([
|
|
180
|
-
"thin",
|
|
181
|
-
"medium",
|
|
182
|
-
"thick"
|
|
183
|
-
]);
|
|
184
|
-
//#endregion
|
|
185
|
-
export { ANIMATION_DIRECTIONS, ANIMATION_FILL_MODES, ANIMATION_PLAY_STATES, BORDER_STYLES, BORDER_WIDTH_KEYWORDS, FLEX_DIRECTIONS, FLEX_WRAPS, FONT_STYLE_KEYWORDS, FONT_VARIANT_KEYWORDS, FONT_WEIGHT_KEYWORDS, LENGTH_RE, LIST_STYLE_POSITIONS, LIST_STYLE_TYPES, NUMBER_RE, QUOTE_RE, SIDES, TEXT_DECORATION_LINES, TEXT_DECORATION_STYLES, TIME_RE, expandTo4, isTimingFunction, splitOn, splitPair, splitTokens };
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { SIDES } from "./helpers.js";
|
|
2
|
-
import { expandBorder, expandBorderGroup } from "./border.js";
|
|
3
|
-
import { expandBorderRadius, expandBox, expandGap } from "./box.js";
|
|
4
|
-
import { expandColumns, expandFlex, expandFlexFlow, expandGridArea, expandGridLine, expandGridTemplate, expandOverflow, expandPlacePair } from "./layout.js";
|
|
5
|
-
import { expandAnimation, expandBackground, expandFont, expandListStyle, expandOutline, expandTextDecoration, expandTransition } from "./visual.js";
|
|
6
|
-
import styleConstants from "@plitzi/sdk-shared/style/styleConstants";
|
|
7
|
-
//#region src/modules/mcp/catalogs/cssCatalog/index.ts
|
|
8
|
-
/** Every kebab-case CSS property Plitzi's style engine understands. Values written to a definition
|
|
9
|
-
* must use these exact keys — camelCase or unknown keys are rejected by the validator. */
|
|
10
|
-
var cssProperties = Array.from(new Set(Object.values(styleConstants))).sort();
|
|
11
|
-
var cssPropertySet = new Set(cssProperties);
|
|
12
|
-
var isCssProperty = (key) => cssPropertySet.has(key);
|
|
13
|
-
var toKebab = (key) => key.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
14
|
-
/** If a camelCase key maps to a known kebab-case property, return it — used to teach the agent the correct key. */
|
|
15
|
-
var suggestCssProperty = (key) => {
|
|
16
|
-
const kebab = toKebab(key);
|
|
17
|
-
return cssPropertySet.has(kebab) ? kebab : void 0;
|
|
18
|
-
};
|
|
19
|
-
var EXPANDERS = /* @__PURE__ */ new Map([
|
|
20
|
-
["padding", expandBox],
|
|
21
|
-
["margin", expandBox],
|
|
22
|
-
["inset", expandBox],
|
|
23
|
-
["border-radius", (_key, value, out) => expandBorderRadius(value, out)],
|
|
24
|
-
["gap", (_key, value, out) => expandGap(value, out)],
|
|
25
|
-
["border-width", (key, value, out) => expandBorderGroup(key.slice(7), value, out)],
|
|
26
|
-
["border-color", (key, value, out) => expandBorderGroup(key.slice(7), value, out)],
|
|
27
|
-
["border-style", (key, value, out) => expandBorderGroup(key.slice(7), value, out)],
|
|
28
|
-
["border", expandBorder],
|
|
29
|
-
["overflow", (_key, value, out) => expandOverflow(value, out)],
|
|
30
|
-
["flex", (_key, value, out) => expandFlex(value, out)],
|
|
31
|
-
["flex-flow", (_key, value, out) => expandFlexFlow(value, out)],
|
|
32
|
-
["place-content", (_key, value, out) => expandPlacePair("place-content", value, out)],
|
|
33
|
-
["place-items", (_key, value, out) => expandPlacePair("place-items", value, out)],
|
|
34
|
-
["place-self", (_key, value, out) => expandPlacePair("place-self", value, out)],
|
|
35
|
-
["grid-row", (_key, value, out) => expandGridLine("grid-row", value, out)],
|
|
36
|
-
["grid-column", (_key, value, out) => expandGridLine("grid-column", value, out)],
|
|
37
|
-
["grid-area", (_key, value, out) => expandGridArea(value, out)],
|
|
38
|
-
["grid", (_key, value, out) => expandGridTemplate(value, out)],
|
|
39
|
-
["grid-template", (_key, value, out) => expandGridTemplate(value, out)],
|
|
40
|
-
["columns", (_key, value, out) => expandColumns(value, out)],
|
|
41
|
-
["outline", (_key, value, out) => expandOutline(value, out)],
|
|
42
|
-
["list-style", (_key, value, out) => expandListStyle(value, out)],
|
|
43
|
-
["text-decoration", (_key, value, out) => expandTextDecoration(value, out)],
|
|
44
|
-
["transition", (_key, value, out) => expandTransition(value, out)],
|
|
45
|
-
["animation", (_key, value, out) => expandAnimation(value, out)],
|
|
46
|
-
["background", (_key, value, out) => expandBackground(value, out)],
|
|
47
|
-
["font", (_key, value, out) => expandFont(value, out)]
|
|
48
|
-
]);
|
|
49
|
-
for (const side of SIDES) EXPANDERS.set(`border-${side}`, expandBorder);
|
|
50
|
-
/** Every shorthand the MCP accepts and atomizes — advertised to the agent so it knows it may write plain CSS. */
|
|
51
|
-
var cssShorthands = Array.from(EXPANDERS.keys()).sort();
|
|
52
|
-
var expandOne = (key, raw, out) => {
|
|
53
|
-
const expand = EXPANDERS.get(key);
|
|
54
|
-
if (!expand) return false;
|
|
55
|
-
const value = String(raw).trim();
|
|
56
|
-
if (value !== "") expand(key, value, out);
|
|
57
|
-
return true;
|
|
58
|
-
};
|
|
59
|
-
/** Expand supported CSS shorthands to their longhand keys. Explicit longhands in the same map win over any
|
|
60
|
-
* expansion (so `{ padding: 8, padding-left: 0 }` keeps padding-left: 0). Unrecognized keys pass through. */
|
|
61
|
-
var expandShorthand = (css) => {
|
|
62
|
-
const expanded = {};
|
|
63
|
-
const direct = {};
|
|
64
|
-
for (const [key, value] of Object.entries(css)) if (!expandOne(key, value, expanded)) direct[key] = value;
|
|
65
|
-
return {
|
|
66
|
-
...expanded,
|
|
67
|
-
...direct
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
var REMOVAL_PROBE = new Map(Object.entries({
|
|
71
|
-
padding: "0",
|
|
72
|
-
margin: "0",
|
|
73
|
-
inset: "0",
|
|
74
|
-
"border-radius": "0 0 0 0 / 0 0 0 0",
|
|
75
|
-
gap: "0 0",
|
|
76
|
-
"border-width": "0 0 0 0",
|
|
77
|
-
"border-color": "red red red red",
|
|
78
|
-
"border-style": "solid solid solid solid",
|
|
79
|
-
border: "0 solid red",
|
|
80
|
-
overflow: "visible visible",
|
|
81
|
-
flex: "0 0 auto",
|
|
82
|
-
"flex-flow": "row nowrap",
|
|
83
|
-
"place-content": "start start",
|
|
84
|
-
"place-items": "start start",
|
|
85
|
-
"place-self": "start start",
|
|
86
|
-
"grid-row": "auto / auto",
|
|
87
|
-
"grid-column": "auto / auto",
|
|
88
|
-
"grid-area": "auto / auto / auto / auto",
|
|
89
|
-
grid: "\"a\" 0 / 0",
|
|
90
|
-
"grid-template": "\"a\" 0 / 0",
|
|
91
|
-
columns: "0 0",
|
|
92
|
-
outline: "0 solid red",
|
|
93
|
-
"list-style": "disc inside url(x)",
|
|
94
|
-
"text-decoration": "underline solid red",
|
|
95
|
-
transition: "all 0s ease 0s",
|
|
96
|
-
animation: "a 0s ease 0s 1 normal forwards running",
|
|
97
|
-
background: "red url(x) no-repeat scroll 0 0 / auto padding-box border-box",
|
|
98
|
-
font: "italic small-caps bold 0px/0 a"
|
|
99
|
-
}));
|
|
100
|
-
for (const side of SIDES) REMOVAL_PROBE.set(`border-${side}`, "0 solid red");
|
|
101
|
-
/** The longhand keys a shorthand controls — what a `null` patch value has to clear. */
|
|
102
|
-
var shorthandLonghands = (key) => {
|
|
103
|
-
const probe = REMOVAL_PROBE.get(key);
|
|
104
|
-
if (probe === void 0) return;
|
|
105
|
-
const out = {};
|
|
106
|
-
expandOne(key, probe, out);
|
|
107
|
-
return Object.keys(out);
|
|
108
|
-
};
|
|
109
|
-
/** Patch flavour of {@link expandShorthand}: a `null` value removes every longhand the key controls, so
|
|
110
|
-
* `{ padding: null }` clears all four sides rather than a `padding` key that was never stored. */
|
|
111
|
-
var expandShorthandPatch = (css) => {
|
|
112
|
-
const expanded = {};
|
|
113
|
-
const direct = {};
|
|
114
|
-
for (const [key, value] of Object.entries(css)) {
|
|
115
|
-
if (value === null) {
|
|
116
|
-
const longhands = shorthandLonghands(key);
|
|
117
|
-
if (longhands) for (const longhand of longhands) expanded[longhand] = null;
|
|
118
|
-
else direct[key] = null;
|
|
119
|
-
continue;
|
|
120
|
-
}
|
|
121
|
-
const props = {};
|
|
122
|
-
if (expandOne(key, value, props)) Object.assign(expanded, props);
|
|
123
|
-
else direct[key] = value;
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
...expanded,
|
|
127
|
-
...direct
|
|
128
|
-
};
|
|
129
|
-
};
|
|
130
|
-
//#endregion
|
|
131
|
-
export { cssProperties, cssShorthands, expandShorthand, expandShorthandPatch, isCssProperty, shorthandLonghands, suggestCssProperty };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { FLEX_DIRECTIONS, FLEX_WRAPS, LENGTH_RE, NUMBER_RE, QUOTE_RE, splitOn, splitPair, splitTokens } from "./helpers.js";
|
|
2
|
-
//#region src/modules/mcp/catalogs/cssCatalog/layout.ts
|
|
3
|
-
var expandOverflow = (value, out) => {
|
|
4
|
-
const [x, y = x] = splitTokens(value);
|
|
5
|
-
out["overflow-x"] = x;
|
|
6
|
-
out["overflow-y"] = y;
|
|
7
|
-
};
|
|
8
|
-
var FLEX_KEYWORDS = /* @__PURE__ */ new Map([
|
|
9
|
-
["none", [
|
|
10
|
-
"0",
|
|
11
|
-
"0",
|
|
12
|
-
"auto"
|
|
13
|
-
]],
|
|
14
|
-
["auto", [
|
|
15
|
-
"1",
|
|
16
|
-
"1",
|
|
17
|
-
"auto"
|
|
18
|
-
]],
|
|
19
|
-
["initial", [
|
|
20
|
-
"0",
|
|
21
|
-
"1",
|
|
22
|
-
"auto"
|
|
23
|
-
]]
|
|
24
|
-
]);
|
|
25
|
-
var writeFlex = (out, grow, shrink, basis) => {
|
|
26
|
-
out["flex-grow"] = grow;
|
|
27
|
-
out["flex-shrink"] = shrink;
|
|
28
|
-
out["flex-basis"] = basis;
|
|
29
|
-
};
|
|
30
|
-
var expandFlex = (value, out) => {
|
|
31
|
-
const tokens = splitTokens(value);
|
|
32
|
-
if (tokens.length === 1) {
|
|
33
|
-
const [only] = tokens;
|
|
34
|
-
const keyword = FLEX_KEYWORDS.get(only);
|
|
35
|
-
if (keyword) writeFlex(out, ...keyword);
|
|
36
|
-
else if (NUMBER_RE.test(only)) writeFlex(out, only, "1", "0%");
|
|
37
|
-
else writeFlex(out, "1", "1", only);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const [grow, second, third] = tokens;
|
|
41
|
-
if (!NUMBER_RE.test(grow)) return;
|
|
42
|
-
if (tokens.length === 2) if (NUMBER_RE.test(second)) writeFlex(out, grow, second, "0%");
|
|
43
|
-
else writeFlex(out, grow, "1", second);
|
|
44
|
-
else writeFlex(out, grow, second, third);
|
|
45
|
-
};
|
|
46
|
-
var expandFlexFlow = (value, out) => {
|
|
47
|
-
for (const token of splitTokens(value)) if (FLEX_DIRECTIONS.has(token)) out["flex-direction"] = token;
|
|
48
|
-
else if (FLEX_WRAPS.has(token)) out["flex-wrap"] = token;
|
|
49
|
-
};
|
|
50
|
-
var expandPlacePair = (prefix, value, out) => {
|
|
51
|
-
const [align, justify = align] = splitTokens(value);
|
|
52
|
-
const prop = prefix.slice(6);
|
|
53
|
-
out[`align-${prop}`] = align;
|
|
54
|
-
out[`justify-${prop}`] = justify;
|
|
55
|
-
};
|
|
56
|
-
var expandGridLine = (key, value, out) => {
|
|
57
|
-
const axis = key.slice(5);
|
|
58
|
-
const [start, end = "auto"] = splitOn(value, "/");
|
|
59
|
-
out[`grid-${axis}-start`] = start;
|
|
60
|
-
out[`grid-${axis}-end`] = end;
|
|
61
|
-
};
|
|
62
|
-
var expandGridArea = (value, out) => {
|
|
63
|
-
const [rowStart, colStart = rowStart, rowEnd = colStart, colEnd = rowEnd] = splitOn(value, "/");
|
|
64
|
-
out["grid-row-start"] = rowStart;
|
|
65
|
-
out["grid-column-start"] = colStart;
|
|
66
|
-
out["grid-row-end"] = rowEnd;
|
|
67
|
-
out["grid-column-end"] = colEnd;
|
|
68
|
-
};
|
|
69
|
-
var expandColumns = (value, out) => {
|
|
70
|
-
const tokens = splitTokens(value);
|
|
71
|
-
if (tokens.length === 1) {
|
|
72
|
-
const [only] = tokens;
|
|
73
|
-
if (NUMBER_RE.test(only)) out["column-count"] = only;
|
|
74
|
-
else out["column-width"] = only;
|
|
75
|
-
} else if (tokens.length >= 2) {
|
|
76
|
-
const [first, second] = tokens;
|
|
77
|
-
const [width, count] = NUMBER_RE.test(first) ? [second, first] : [first, second];
|
|
78
|
-
out["column-width"] = width;
|
|
79
|
-
out["column-count"] = count;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
var isTrackList = (tokens) => tokens.some((token) => token === "none" || token === "auto" || token === "min-content" || token === "max-content" || token.startsWith("[") || token.startsWith("minmax(") || token.startsWith("repeat(") || token.startsWith("fit-content(") || LENGTH_RE.test(token) || /^-?[\d.]+fr$/.test(token));
|
|
83
|
-
var expandGridTemplate = (value, out) => {
|
|
84
|
-
const [first, second] = splitPair(value, "/");
|
|
85
|
-
const rowTokens = splitTokens(first);
|
|
86
|
-
const areas = rowTokens.filter((token) => QUOTE_RE.test(token));
|
|
87
|
-
const sizes = rowTokens.filter((token) => !QUOTE_RE.test(token));
|
|
88
|
-
if (second !== void 0) {
|
|
89
|
-
if (second !== "") out["grid-template-columns"] = second;
|
|
90
|
-
} else if (areas.length === 0) {
|
|
91
|
-
if (isTrackList(rowTokens)) out["grid-template-columns"] = first;
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (areas.length > 0) out["grid-template-areas"] = areas.join(" ");
|
|
95
|
-
if (sizes.length > 0) out["grid-template-rows"] = sizes.join(" ");
|
|
96
|
-
};
|
|
97
|
-
//#endregion
|
|
98
|
-
export { expandColumns, expandFlex, expandFlexFlow, expandGridArea, expandGridLine, expandGridTemplate, expandOverflow, expandPlacePair };
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { ANIMATION_DIRECTIONS, ANIMATION_FILL_MODES, ANIMATION_PLAY_STATES, FONT_STYLE_KEYWORDS, FONT_VARIANT_KEYWORDS, FONT_WEIGHT_KEYWORDS, LENGTH_RE, LIST_STYLE_POSITIONS, LIST_STYLE_TYPES, NUMBER_RE, TEXT_DECORATION_LINES, TEXT_DECORATION_STYLES, TIME_RE, isTimingFunction, splitOn, splitPair, splitTokens } from "./helpers.js";
|
|
2
|
-
import { classifyBorderTokens } from "./border.js";
|
|
3
|
-
//#region src/modules/mcp/catalogs/cssCatalog/visual.ts
|
|
4
|
-
var expandLayers = (value, out, expandLayer) => {
|
|
5
|
-
const layers = splitOn(value, ",");
|
|
6
|
-
if (layers.length === 1) {
|
|
7
|
-
expandLayer(layers[0], out);
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
const perLayer = layers.map((layer) => {
|
|
11
|
-
const layerOut = {};
|
|
12
|
-
expandLayer(layer, layerOut);
|
|
13
|
-
return layerOut;
|
|
14
|
-
});
|
|
15
|
-
const keys = new Set(perLayer.flatMap((layer) => Object.keys(layer)));
|
|
16
|
-
for (const key of keys) out[key] = perLayer.map((layer) => String(layer[key] ?? "initial")).join(", ");
|
|
17
|
-
};
|
|
18
|
-
var expandOutline = (value, out) => {
|
|
19
|
-
for (const [kind, token] of Object.entries(classifyBorderTokens(value))) out[`outline-${kind}`] = token;
|
|
20
|
-
};
|
|
21
|
-
var expandListStyle = (value, out) => {
|
|
22
|
-
for (const token of splitTokens(value)) if (token.startsWith("url(")) out["list-style-image"] = token;
|
|
23
|
-
else if (LIST_STYLE_POSITIONS.has(token)) out["list-style-position"] = token;
|
|
24
|
-
else if (LIST_STYLE_TYPES.has(token)) out["list-style-type"] = token;
|
|
25
|
-
};
|
|
26
|
-
var expandTextDecoration = (value, out) => {
|
|
27
|
-
for (const token of splitTokens(value)) if (TEXT_DECORATION_LINES.has(token)) out["text-decoration-line"] = token;
|
|
28
|
-
else if (TEXT_DECORATION_STYLES.has(token)) out["text-decoration-style"] = token;
|
|
29
|
-
else out["text-decoration-color"] = token;
|
|
30
|
-
};
|
|
31
|
-
var expandTransitionLayer = (layer, out) => {
|
|
32
|
-
let foundDuration = false;
|
|
33
|
-
for (const token of splitTokens(layer)) if (isTimingFunction(token)) out["transition-timing-function"] = token;
|
|
34
|
-
else if (TIME_RE.test(token) || NUMBER_RE.test(token)) if (foundDuration) out["transition-delay"] = token;
|
|
35
|
-
else {
|
|
36
|
-
out["transition-duration"] = token;
|
|
37
|
-
foundDuration = true;
|
|
38
|
-
}
|
|
39
|
-
else if (!out["transition-property"]) out["transition-property"] = token;
|
|
40
|
-
};
|
|
41
|
-
var expandTransition = (value, out) => expandLayers(value, out, expandTransitionLayer);
|
|
42
|
-
var expandAnimationLayer = (layer, out) => {
|
|
43
|
-
let foundDuration = false;
|
|
44
|
-
for (const token of splitTokens(layer)) if (isTimingFunction(token)) out["animation-timing-function"] = token;
|
|
45
|
-
else if (TIME_RE.test(token)) if (foundDuration) out["animation-delay"] = token;
|
|
46
|
-
else {
|
|
47
|
-
out["animation-duration"] = token;
|
|
48
|
-
foundDuration = true;
|
|
49
|
-
}
|
|
50
|
-
else if (token === "infinite" || NUMBER_RE.test(token)) out["animation-iteration-count"] = token;
|
|
51
|
-
else if (ANIMATION_DIRECTIONS.has(token) && !out["animation-direction"]) out["animation-direction"] = token;
|
|
52
|
-
else if (ANIMATION_FILL_MODES.has(token) && !out["animation-fill-mode"]) out["animation-fill-mode"] = token;
|
|
53
|
-
else if (ANIMATION_PLAY_STATES.has(token) && !out["animation-play-state"]) out["animation-play-state"] = token;
|
|
54
|
-
else if (!out["animation-name"]) out["animation-name"] = token;
|
|
55
|
-
};
|
|
56
|
-
var expandAnimation = (value, out) => expandLayers(value, out, expandAnimationLayer);
|
|
57
|
-
var BACKGROUND_REPEATS = /* @__PURE__ */ new Set([
|
|
58
|
-
"repeat",
|
|
59
|
-
"no-repeat",
|
|
60
|
-
"repeat-x",
|
|
61
|
-
"repeat-y",
|
|
62
|
-
"space",
|
|
63
|
-
"round"
|
|
64
|
-
]);
|
|
65
|
-
var BACKGROUND_ATTACHMENTS = /* @__PURE__ */ new Set([
|
|
66
|
-
"scroll",
|
|
67
|
-
"fixed",
|
|
68
|
-
"local"
|
|
69
|
-
]);
|
|
70
|
-
var BACKGROUND_BOXES = /* @__PURE__ */ new Set([
|
|
71
|
-
"border-box",
|
|
72
|
-
"padding-box",
|
|
73
|
-
"content-box"
|
|
74
|
-
]);
|
|
75
|
-
var BACKGROUND_POSITIONS = /* @__PURE__ */ new Set([
|
|
76
|
-
"center",
|
|
77
|
-
"top",
|
|
78
|
-
"bottom",
|
|
79
|
-
"left",
|
|
80
|
-
"right"
|
|
81
|
-
]);
|
|
82
|
-
var isImage = (token) => token.startsWith("url(") || token.includes("-gradient(");
|
|
83
|
-
var isPosition = (token) => BACKGROUND_POSITIONS.has(token) || LENGTH_RE.test(token);
|
|
84
|
-
var isSize = (token) => token === "cover" || token === "contain" || token === "auto" || LENGTH_RE.test(token);
|
|
85
|
-
var expandBackgroundLayer = (layer, out) => {
|
|
86
|
-
const [beforeSlash, afterSlash] = splitPair(layer, "/");
|
|
87
|
-
const tokens = splitTokens(beforeSlash);
|
|
88
|
-
if (afterSlash !== void 0) {
|
|
89
|
-
let positionStart = tokens.length;
|
|
90
|
-
while (positionStart > 0 && isPosition(tokens[positionStart - 1])) positionStart -= 1;
|
|
91
|
-
const position = tokens.splice(positionStart, tokens.length - positionStart);
|
|
92
|
-
if (position.length > 0) out["background-position"] = position.join(" ");
|
|
93
|
-
const afterTokens = splitTokens(afterSlash);
|
|
94
|
-
let sizeEnd = 0;
|
|
95
|
-
while (sizeEnd < afterTokens.length && isSize(afterTokens[sizeEnd])) sizeEnd += 1;
|
|
96
|
-
if (sizeEnd > 0) out["background-size"] = afterTokens.slice(0, sizeEnd).join(" ");
|
|
97
|
-
tokens.push(...afterTokens.slice(sizeEnd));
|
|
98
|
-
}
|
|
99
|
-
const positions = [];
|
|
100
|
-
for (const token of tokens) if (isImage(token)) out["background-image"] = token;
|
|
101
|
-
else if (BACKGROUND_REPEATS.has(token)) out["background-repeat"] = token;
|
|
102
|
-
else if (token === "cover" || token === "contain") out["background-size"] = token;
|
|
103
|
-
else if (BACKGROUND_ATTACHMENTS.has(token)) out["background-attachment"] = token;
|
|
104
|
-
else if (BACKGROUND_BOXES.has(token)) if (out["background-origin"]) out["background-clip"] = token;
|
|
105
|
-
else out["background-origin"] = token;
|
|
106
|
-
else if (isPosition(token)) positions.push(token);
|
|
107
|
-
else if (!out["background-color"]) out["background-color"] = token;
|
|
108
|
-
if (positions.length > 0) out["background-position"] = positions.join(" ");
|
|
109
|
-
};
|
|
110
|
-
var expandBackground = (value, out) => expandLayers(value, out, expandBackgroundLayer);
|
|
111
|
-
var expandFont = (value, out) => {
|
|
112
|
-
const [beforeSlash, afterSlash] = splitPair(value, "/");
|
|
113
|
-
const tokens = splitTokens(beforeSlash);
|
|
114
|
-
if (afterSlash !== void 0) {
|
|
115
|
-
const [lineHeight, ...family] = splitTokens(afterSlash);
|
|
116
|
-
out["line-height"] = lineHeight;
|
|
117
|
-
if (family.length > 0) out["font-family"] = family.join(" ");
|
|
118
|
-
}
|
|
119
|
-
const family = [];
|
|
120
|
-
let foundSize = false;
|
|
121
|
-
for (const token of tokens) {
|
|
122
|
-
if (foundSize) {
|
|
123
|
-
family.push(token);
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
if (token === "normal") {
|
|
127
|
-
const slot = [
|
|
128
|
-
"font-style",
|
|
129
|
-
"font-variant",
|
|
130
|
-
"font-weight"
|
|
131
|
-
].find((prop) => !out[prop]);
|
|
132
|
-
if (slot) out[slot] = token;
|
|
133
|
-
} else if (FONT_STYLE_KEYWORDS.has(token) && !out["font-style"]) out["font-style"] = token;
|
|
134
|
-
else if (FONT_VARIANT_KEYWORDS.has(token) && !out["font-variant"]) out["font-variant"] = token;
|
|
135
|
-
else if (FONT_WEIGHT_KEYWORDS.has(token) && !out["font-weight"]) out["font-weight"] = token;
|
|
136
|
-
else if (LENGTH_RE.test(token)) {
|
|
137
|
-
out["font-size"] = token;
|
|
138
|
-
foundSize = true;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (family.length > 0) out["font-family"] = family.join(" ");
|
|
142
|
-
};
|
|
143
|
-
//#endregion
|
|
144
|
-
export { expandAnimation, expandBackground, expandFont, expandListStyle, expandOutline, expandTextDecoration, expandTransition };
|