@conloca/astro-cms 0.1.15 → 0.2.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/README.md +259 -247
- package/dist/internal/acorn-default.mjs +11 -3
- package/dist/internal/page-handler.astro +137 -358
- package/dist/ts/node/content.d.ts +4 -0
- package/dist/ts/node/content.d.ts.map +1 -0
- package/dist/ts/node/content.js +3 -0
- package/dist/ts/node/content.js.map +1 -0
- package/dist/ts/node/index.d.ts +9 -0
- package/dist/ts/node/index.d.ts.map +1 -0
- package/dist/ts/node/index.js +14 -0
- package/dist/ts/node/index.js.map +1 -0
- package/dist/ts/src/asset-ref-base.d.ts +3 -0
- package/dist/ts/src/asset-ref-base.d.ts.map +1 -0
- package/dist/ts/src/asset-ref-base.js +48 -0
- package/dist/ts/src/asset-ref-base.js.map +1 -0
- package/dist/ts/src/checks.d.ts +7 -0
- package/dist/ts/src/checks.d.ts.map +1 -0
- package/dist/ts/src/checks.js +7 -0
- package/dist/ts/src/checks.js.map +1 -0
- package/dist/ts/src/cms-handler.d.ts +18 -0
- package/dist/ts/src/cms-handler.d.ts.map +1 -0
- package/dist/ts/src/cms-handler.js +245 -0
- package/dist/ts/src/cms-handler.js.map +1 -0
- package/dist/ts/src/collections.d.ts +160 -0
- package/dist/ts/src/collections.d.ts.map +1 -0
- package/dist/ts/src/collections.js +170 -0
- package/dist/ts/src/collections.js.map +1 -0
- package/dist/ts/src/components/HydrationWrapper.d.ts +18 -0
- package/dist/ts/src/components/HydrationWrapper.d.ts.map +1 -0
- package/dist/ts/src/components/HydrationWrapper.js +22 -0
- package/dist/ts/src/components/HydrationWrapper.js.map +1 -0
- package/dist/ts/src/components/RenderWithFragments.d.ts +27 -0
- package/dist/ts/src/components/RenderWithFragments.d.ts.map +1 -0
- package/dist/ts/src/components/RenderWithFragments.js +133 -0
- package/dist/ts/src/components/RenderWithFragments.js.map +1 -0
- package/dist/ts/src/components/RenderWithHydration.d.ts +21 -0
- package/dist/ts/src/components/RenderWithHydration.d.ts.map +1 -0
- package/dist/ts/src/components/RenderWithHydration.js +39 -0
- package/dist/ts/src/components/RenderWithHydration.js.map +1 -0
- package/dist/ts/src/components.d.ts +4 -0
- package/dist/ts/src/components.d.ts.map +1 -0
- package/dist/ts/src/components.js +4 -0
- package/dist/ts/src/components.js.map +1 -0
- package/dist/ts/src/discovery/astro-frontmatter.d.ts +18 -0
- package/dist/ts/src/discovery/astro-frontmatter.d.ts.map +1 -0
- package/dist/ts/src/discovery/astro-frontmatter.js +25 -0
- package/dist/ts/src/discovery/astro-frontmatter.js.map +1 -0
- package/dist/ts/src/discovery/discover.d.ts +43 -0
- package/dist/ts/src/discovery/discover.d.ts.map +1 -0
- package/dist/ts/src/discovery/discover.js +87 -0
- package/dist/ts/src/discovery/discover.js.map +1 -0
- package/dist/ts/src/discovery/extract-props-ts.d.ts +41 -0
- package/dist/ts/src/discovery/extract-props-ts.d.ts.map +1 -0
- package/dist/ts/src/discovery/extract-props-ts.js +232 -0
- package/dist/ts/src/discovery/extract-props-ts.js.map +1 -0
- package/dist/ts/src/discovery/merge-registry.d.ts +58 -0
- package/dist/ts/src/discovery/merge-registry.d.ts.map +1 -0
- package/dist/ts/src/discovery/merge-registry.js +333 -0
- package/dist/ts/src/discovery/merge-registry.js.map +1 -0
- package/dist/ts/src/discovery/registry-endpoint.d.ts +27 -0
- package/dist/ts/src/discovery/registry-endpoint.d.ts.map +1 -0
- package/dist/ts/src/discovery/registry-endpoint.js +76 -0
- package/dist/ts/src/discovery/registry-endpoint.js.map +1 -0
- package/dist/ts/src/discovery/scan-components.d.ts +94 -0
- package/dist/ts/src/discovery/scan-components.d.ts.map +1 -0
- package/dist/ts/src/discovery/scan-components.js +397 -0
- package/dist/ts/src/discovery/scan-components.js.map +1 -0
- package/dist/ts/src/discovery/scan-mdx.d.ts +63 -0
- package/dist/ts/src/discovery/scan-mdx.d.ts.map +1 -0
- package/dist/ts/src/discovery/scan-mdx.js +113 -0
- package/dist/ts/src/discovery/scan-mdx.js.map +1 -0
- package/dist/ts/src/discovery/scan-overrides.d.ts +71 -0
- package/dist/ts/src/discovery/scan-overrides.d.ts.map +1 -0
- package/dist/ts/src/discovery/scan-overrides.js +34 -0
- package/dist/ts/src/discovery/scan-overrides.js.map +1 -0
- package/dist/ts/src/editor-descriptors.d.ts +31 -0
- package/dist/ts/src/editor-descriptors.d.ts.map +1 -0
- package/dist/ts/src/editor-descriptors.js +84 -0
- package/dist/ts/src/editor-descriptors.js.map +1 -0
- package/dist/ts/src/handlers/collection-content-api.d.ts +32 -0
- package/dist/ts/src/handlers/collection-content-api.d.ts.map +1 -0
- package/dist/ts/src/handlers/collection-content-api.js +166 -0
- package/dist/ts/src/handlers/collection-content-api.js.map +1 -0
- package/dist/ts/src/handlers/page-render-core.d.ts +137 -0
- package/dist/ts/src/handlers/page-render-core.d.ts.map +1 -0
- package/dist/ts/src/handlers/page-render-core.js +315 -0
- package/dist/ts/src/handlers/page-render-core.js.map +1 -0
- package/dist/ts/src/hydration.d.ts +4 -0
- package/dist/ts/src/hydration.d.ts.map +1 -0
- package/dist/ts/src/hydration.js +5 -0
- package/dist/ts/src/hydration.js.map +1 -0
- package/dist/ts/src/index.d.ts +21 -0
- package/dist/ts/src/index.d.ts.map +1 -0
- package/dist/ts/src/index.js +45 -0
- package/dist/ts/src/index.js.map +1 -0
- package/dist/ts/src/internal/declared-collections.d.ts +30 -0
- package/dist/ts/src/internal/declared-collections.d.ts.map +1 -0
- package/dist/ts/src/internal/declared-collections.js +84 -0
- package/dist/ts/src/internal/declared-collections.js.map +1 -0
- package/dist/ts/src/internal/page-collection-schema.d.ts +44 -0
- package/dist/ts/src/internal/page-collection-schema.d.ts.map +1 -0
- package/dist/ts/src/internal/page-collection-schema.js +152 -0
- package/dist/ts/src/internal/page-collection-schema.js.map +1 -0
- package/dist/ts/src/lib/content-config-guard.d.ts +11 -0
- package/dist/ts/src/lib/content-config-guard.d.ts.map +1 -0
- package/dist/ts/src/lib/content-config-guard.js +41 -0
- package/dist/ts/src/lib/content-config-guard.js.map +1 -0
- package/dist/ts/src/lib/hydration-scanner.d.ts +47 -0
- package/dist/ts/src/lib/hydration-scanner.d.ts.map +1 -0
- package/dist/ts/src/lib/hydration-scanner.js +136 -0
- package/dist/ts/src/lib/hydration-scanner.js.map +1 -0
- package/dist/{lib/hydration-script.d.mts → ts/src/lib/hydration-script.d.ts} +7 -10
- package/dist/ts/src/lib/hydration-script.d.ts.map +1 -0
- package/dist/ts/src/lib/hydration-script.js +89 -0
- package/dist/ts/src/lib/hydration-script.js.map +1 -0
- package/dist/ts/src/lib/hydration-utils.d.ts +51 -0
- package/dist/ts/src/lib/hydration-utils.d.ts.map +1 -0
- package/dist/ts/src/lib/hydration-utils.js +84 -0
- package/dist/ts/src/lib/hydration-utils.js.map +1 -0
- package/dist/ts/src/lib/resolve-locale.d.ts +15 -0
- package/dist/ts/src/lib/resolve-locale.d.ts.map +1 -0
- package/dist/ts/src/lib/resolve-locale.js +16 -0
- package/dist/ts/src/lib/resolve-locale.js.map +1 -0
- package/dist/ts/src/lib/resolve-site-name.d.ts +8 -0
- package/dist/ts/src/lib/resolve-site-name.d.ts.map +1 -0
- package/dist/ts/src/lib/resolve-site-name.js +12 -0
- package/dist/ts/src/lib/resolve-site-name.js.map +1 -0
- package/dist/ts/src/lib/route-utils.d.ts +61 -0
- package/dist/ts/src/lib/route-utils.d.ts.map +1 -0
- package/dist/ts/src/lib/route-utils.js +96 -0
- package/dist/ts/src/lib/route-utils.js.map +1 -0
- package/dist/ts/src/lib/routing-config.d.ts +38 -0
- package/dist/ts/src/lib/routing-config.d.ts.map +1 -0
- package/dist/ts/src/lib/routing-config.js +106 -0
- package/dist/ts/src/lib/routing-config.js.map +1 -0
- package/dist/ts/src/lib/serialize-props.d.ts +6 -0
- package/dist/ts/src/lib/serialize-props.d.ts.map +1 -0
- package/dist/ts/src/lib/serialize-props.js +8 -0
- package/dist/ts/src/lib/serialize-props.js.map +1 -0
- package/dist/ts/src/lib/unknown-components.d.ts +21 -0
- package/dist/ts/src/lib/unknown-components.d.ts.map +1 -0
- package/dist/ts/src/lib/unknown-components.js +49 -0
- package/dist/ts/src/lib/unknown-components.js.map +1 -0
- package/dist/ts/src/lib/virtual-module-generators.d.ts +33 -0
- package/dist/ts/src/lib/virtual-module-generators.d.ts.map +1 -0
- package/dist/ts/src/lib/virtual-module-generators.js +51 -0
- package/dist/ts/src/lib/virtual-module-generators.js.map +1 -0
- package/dist/{withHydration-HIvO9ysY.d.mts → ts/src/lib/withHydration.d.ts} +7 -11
- package/dist/ts/src/lib/withHydration.d.ts.map +1 -0
- package/dist/ts/src/lib/withHydration.js +50 -0
- package/dist/ts/src/lib/withHydration.js.map +1 -0
- package/dist/ts/src/loader.d.ts +27 -0
- package/dist/ts/src/loader.d.ts.map +1 -0
- package/dist/ts/src/loader.js +118 -0
- package/dist/ts/src/loader.js.map +1 -0
- package/dist/ts/src/locales-helpers.d.ts +61 -0
- package/dist/ts/src/locales-helpers.d.ts.map +1 -0
- package/dist/ts/src/locales-helpers.js +50 -0
- package/dist/ts/src/locales-helpers.js.map +1 -0
- package/dist/ts/src/mime-types.d.ts +3 -0
- package/dist/ts/src/mime-types.d.ts.map +1 -0
- package/dist/ts/src/mime-types.js +20 -0
- package/dist/ts/src/mime-types.js.map +1 -0
- package/dist/ts/src/page-feed.d.ts +13 -0
- package/dist/ts/src/page-feed.d.ts.map +1 -0
- package/dist/ts/src/page-feed.js +20 -0
- package/dist/ts/src/page-feed.js.map +1 -0
- package/dist/ts/src/page-schemas.d.ts +6 -0
- package/dist/ts/src/page-schemas.d.ts.map +1 -0
- package/dist/ts/src/page-schemas.js +6 -0
- package/dist/ts/src/page-schemas.js.map +1 -0
- package/dist/ts/src/path-validation.d.ts +8 -0
- package/dist/ts/src/path-validation.d.ts.map +1 -0
- package/dist/ts/src/path-validation.js +13 -0
- package/dist/ts/src/path-validation.js.map +1 -0
- package/dist/ts/src/plugin-spa.d.ts +182 -0
- package/dist/ts/src/plugin-spa.d.ts.map +1 -0
- package/dist/ts/src/plugin-spa.js +1165 -0
- package/dist/ts/src/plugin-spa.js.map +1 -0
- package/dist/ts/src/puck-manifest/components-endpoint.d.ts +30 -0
- package/dist/ts/src/puck-manifest/components-endpoint.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/components-endpoint.js +54 -0
- package/dist/ts/src/puck-manifest/components-endpoint.js.map +1 -0
- package/dist/ts/src/puck-manifest/field-projection.d.ts +91 -0
- package/dist/ts/src/puck-manifest/field-projection.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/field-projection.js +422 -0
- package/dist/ts/src/puck-manifest/field-projection.js.map +1 -0
- package/dist/ts/src/puck-manifest/index.d.ts +4 -0
- package/dist/ts/src/puck-manifest/index.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/index.js +3 -0
- package/dist/ts/src/puck-manifest/index.js.map +1 -0
- package/dist/ts/src/puck-manifest/literal.d.ts +163 -0
- package/dist/ts/src/puck-manifest/literal.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/literal.js +354 -0
- package/dist/ts/src/puck-manifest/literal.js.map +1 -0
- package/dist/ts/src/puck-manifest/read-config.d.ts +42 -0
- package/dist/ts/src/puck-manifest/read-config.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/read-config.js +517 -0
- package/dist/ts/src/puck-manifest/read-config.js.map +1 -0
- package/dist/ts/src/puck-manifest/read-field.d.ts +7 -0
- package/dist/ts/src/puck-manifest/read-field.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/read-field.js +11 -0
- package/dist/ts/src/puck-manifest/read-field.js.map +1 -0
- package/dist/ts/src/puck-manifest/read-wrapper.d.ts +147 -0
- package/dist/ts/src/puck-manifest/read-wrapper.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/read-wrapper.js +889 -0
- package/dist/ts/src/puck-manifest/read-wrapper.js.map +1 -0
- package/dist/ts/src/puck-manifest/reading-budget.d.ts +50 -0
- package/dist/ts/src/puck-manifest/reading-budget.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/reading-budget.js +113 -0
- package/dist/ts/src/puck-manifest/reading-budget.js.map +1 -0
- package/dist/ts/src/puck-manifest/resolve-reference.d.ts +4 -0
- package/dist/ts/src/puck-manifest/resolve-reference.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/resolve-reference.js +4 -0
- package/dist/ts/src/puck-manifest/resolve-reference.js.map +1 -0
- package/dist/ts/src/puck-manifest/source-reference.d.ts +96 -0
- package/dist/ts/src/puck-manifest/source-reference.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/source-reference.js +424 -0
- package/dist/ts/src/puck-manifest/source-reference.js.map +1 -0
- package/dist/ts/src/puck-manifest/syntax.d.ts +29 -0
- package/dist/ts/src/puck-manifest/syntax.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/syntax.js +79 -0
- package/dist/ts/src/puck-manifest/syntax.js.map +1 -0
- package/dist/ts/src/puck-manifest/types.d.ts +145 -0
- package/dist/ts/src/puck-manifest/types.d.ts.map +1 -0
- package/dist/ts/src/puck-manifest/types.js +2 -0
- package/dist/ts/src/puck-manifest/types.js.map +1 -0
- package/dist/ts/src/safe-json-stringify.d.ts +13 -0
- package/dist/ts/src/safe-json-stringify.d.ts.map +1 -0
- package/dist/ts/src/safe-json-stringify.js +7 -0
- package/dist/ts/src/safe-json-stringify.js.map +1 -0
- package/dist/ts/src/sandbox-frame-handler.d.ts +19 -0
- package/dist/ts/src/sandbox-frame-handler.d.ts.map +1 -0
- package/dist/ts/src/sandbox-frame-handler.js +27 -0
- package/dist/ts/src/sandbox-frame-handler.js.map +1 -0
- package/dist/ts/src/site-styles/content-wrapper-endpoint.d.ts +73 -0
- package/dist/ts/src/site-styles/content-wrapper-endpoint.d.ts.map +1 -0
- package/dist/ts/src/site-styles/content-wrapper-endpoint.js +224 -0
- package/dist/ts/src/site-styles/content-wrapper-endpoint.js.map +1 -0
- package/dist/ts/src/site-styles/render-endpoint.d.ts +50 -0
- package/dist/ts/src/site-styles/render-endpoint.d.ts.map +1 -0
- package/dist/ts/src/site-styles/render-endpoint.js +264 -0
- package/dist/ts/src/site-styles/render-endpoint.js.map +1 -0
- package/dist/ts/src/site-styles/styles-endpoint.d.ts +59 -0
- package/dist/ts/src/site-styles/styles-endpoint.d.ts.map +1 -0
- package/dist/ts/src/site-styles/styles-endpoint.js +156 -0
- package/dist/ts/src/site-styles/styles-endpoint.js.map +1 -0
- package/dist/ts/src/sitemap-options.d.ts +21 -0
- package/dist/ts/src/sitemap-options.d.ts.map +1 -0
- package/dist/ts/src/sitemap-options.js +92 -0
- package/dist/ts/src/sitemap-options.js.map +1 -0
- package/dist/ts/src/tiptap-html-static.d.ts +15 -0
- package/dist/ts/src/tiptap-html-static.d.ts.map +1 -0
- package/dist/ts/src/tiptap-html-static.js +67 -0
- package/dist/ts/src/tiptap-html-static.js.map +1 -0
- package/dist/ts/src/types.d.ts +543 -0
- package/dist/ts/src/types.d.ts.map +1 -0
- package/dist/ts/src/types.js +2 -0
- package/dist/ts/src/types.js.map +1 -0
- package/dist/virtual-modules.d.ts +74 -0
- package/node/content.ts +14 -0
- package/node/index.ts +22 -0
- package/package.json +198 -56
- package/src/asset-ref-base.ts +48 -0
- package/src/checks.ts +10 -0
- package/src/cms-handler.ts +280 -0
- package/src/collections.ts +262 -0
- package/src/components/HydrationWrapper.tsx +41 -0
- package/src/components/RenderWithFragments.tsx +204 -0
- package/src/components/RenderWithHydration.tsx +55 -0
- package/src/components.ts +3 -0
- package/src/discovery/astro-frontmatter.ts +24 -0
- package/src/discovery/discover.ts +108 -0
- package/src/discovery/extract-props-ts.ts +255 -0
- package/src/discovery/merge-registry.ts +411 -0
- package/src/discovery/registry-endpoint.ts +80 -0
- package/src/discovery/scan-components.ts +458 -0
- package/src/discovery/scan-mdx.ts +190 -0
- package/src/discovery/scan-overrides.ts +92 -0
- package/src/editor-descriptors.ts +96 -0
- package/src/env.d.ts +31 -0
- package/src/handlers/collection-content-api.ts +196 -0
- package/src/handlers/page-handler.astro +320 -0
- package/src/handlers/page-render-core.ts +456 -0
- package/src/hydration.ts +7 -0
- package/src/index.ts +111 -0
- package/src/internal/acorn-default.mjs +37 -0
- package/src/internal/declared-collections.ts +98 -0
- package/src/internal/page-collection-schema.ts +210 -0
- package/src/lib/content-config-guard.ts +48 -0
- package/src/lib/hydration-scanner.ts +176 -0
- package/src/lib/hydration-script.ts +126 -0
- package/src/lib/hydration-utils.ts +120 -0
- package/src/lib/resolve-locale.ts +22 -0
- package/src/lib/resolve-site-name.ts +10 -0
- package/src/lib/route-utils.ts +106 -0
- package/src/lib/routing-config.ts +126 -0
- package/src/lib/serialize-props.ts +7 -0
- package/src/lib/unknown-components.ts +64 -0
- package/src/lib/virtual-module-generators.ts +58 -0
- package/src/lib/withHydration.ts +71 -0
- package/src/loader.ts +145 -0
- package/src/locales-helpers.ts +68 -0
- package/src/mime-types.ts +19 -0
- package/src/page-feed.ts +26 -0
- package/src/page-schemas.ts +19 -0
- package/src/path-validation.ts +13 -0
- package/src/plugin-spa.ts +1480 -0
- package/src/puck-manifest/components-endpoint.ts +55 -0
- package/src/puck-manifest/field-projection.ts +510 -0
- package/src/puck-manifest/index.ts +3 -0
- package/src/puck-manifest/literal.ts +459 -0
- package/src/puck-manifest/read-config.ts +577 -0
- package/src/puck-manifest/read-field.ts +19 -0
- package/src/puck-manifest/read-wrapper.ts +1056 -0
- package/src/puck-manifest/reading-budget.ts +127 -0
- package/src/puck-manifest/resolve-reference.ts +9 -0
- package/src/puck-manifest/source-reference.ts +484 -0
- package/src/puck-manifest/syntax.ts +104 -0
- package/src/puck-manifest/types.ts +139 -0
- package/src/safe-json-stringify.ts +17 -0
- package/src/sandbox-frame-handler.ts +31 -0
- package/src/site-styles/content-wrapper-endpoint.ts +327 -0
- package/src/site-styles/render-endpoint.ts +331 -0
- package/src/site-styles/styles-endpoint.ts +184 -0
- package/src/sitemap-options.ts +115 -0
- package/src/tiptap-html-static.ts +84 -0
- package/{dist/types-CVQNmPxF.d.mts → src/types.ts} +232 -79
- package/src/virtual-modules.d.ts +74 -0
- package/dist/collections.d.mts +0 -36
- package/dist/collections.d.mts.map +0 -1
- package/dist/collections.mjs +0 -65
- package/dist/collections.mjs.map +0 -1
- package/dist/components.d.mts +0 -46
- package/dist/components.d.mts.map +0 -1
- package/dist/components.mjs +0 -226
- package/dist/components.mjs.map +0 -1
- package/dist/hydration-scanner-B0NjYkZ_.mjs +0 -109
- package/dist/hydration-scanner-B0NjYkZ_.mjs.map +0 -1
- package/dist/hydration.d.mts +0 -4
- package/dist/hydration.mjs +0 -3
- package/dist/index.d.mts +0 -139
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -66
- package/dist/index.mjs.map +0 -1
- package/dist/internal/cms-handler.d.mts +0 -26
- package/dist/internal/cms-handler.d.mts.map +0 -1
- package/dist/internal/cms-handler.mjs +0 -267
- package/dist/internal/cms-handler.mjs.map +0 -1
- package/dist/lib/hydration-script.d.mts.map +0 -1
- package/dist/lib/hydration-script.mjs +0 -85
- package/dist/lib/hydration-script.mjs.map +0 -1
- package/dist/loader-By-AQWHc.mjs +0 -68
- package/dist/loader-By-AQWHc.mjs.map +0 -1
- package/dist/node/content.d.mts +0 -19
- package/dist/node/content.d.mts.map +0 -1
- package/dist/node/content.mjs +0 -4
- package/dist/node/index.d.mts +0 -52
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.mjs +0 -753
- package/dist/node/index.mjs.map +0 -1
- package/dist/serialize-props-Dhv_MnkY.mjs +0 -73
- package/dist/serialize-props-Dhv_MnkY.mjs.map +0 -1
- package/dist/types-CVQNmPxF.d.mts.map +0 -1
- package/dist/withHydration-EzyzBQ-Y.mjs +0 -49
- package/dist/withHydration-EzyzBQ-Y.mjs.map +0 -1
- package/dist/withHydration-HIvO9ysY.d.mts.map +0 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// Drop-in replacement for `@tiptap/html` in server bundles: same named exports,
|
|
2
|
+
// no DOM anywhere. The richtext field render imports `generateHTML`/`generateJSON`
|
|
3
|
+
// from `@tiptap/html`; its browser build needs `window`, and its `/server` build
|
|
4
|
+
// fakes one with happy-dom — whose `Window` constructor calls `node:vm`
|
|
5
|
+
// (`Script.runInContext`). Workers runtimes ship `node:vm` as a stub, so that
|
|
6
|
+
// call throws at render time and every richtext section on the page dies. The
|
|
7
|
+
// static renderer walks the ProseMirror document and writes the markup as a
|
|
8
|
+
// string instead, so the same output comes out on any engine.
|
|
9
|
+
import {
|
|
10
|
+
escapeHTML,
|
|
11
|
+
renderJSONContentToString,
|
|
12
|
+
serializeChildrenToHTMLString,
|
|
13
|
+
} from '@tiptap/static-renderer/json/html-string';
|
|
14
|
+
import { domOutputSpecToHTMLString, renderToElement } from '@tiptap/static-renderer/pm/html-string';
|
|
15
|
+
|
|
16
|
+
type RenderArgs = Parameters<typeof renderToElement<string>>[0];
|
|
17
|
+
type RichTextContent = RenderArgs['content'];
|
|
18
|
+
type RichTextExtensions = RenderArgs['extensions'];
|
|
19
|
+
type ElementSpec = Parameters<typeof domOutputSpecToHTMLString>[0];
|
|
20
|
+
|
|
21
|
+
// Void elements the HTML parser closes on its own. The static renderer writes
|
|
22
|
+
// them self-closing (`<br/>`); a DOM serializer writes `<br>`. Both parse
|
|
23
|
+
// identically, but the rendered markup is compared byte for byte against the
|
|
24
|
+
// DOM output, so normalize to the DOM spelling.
|
|
25
|
+
const VOID_ELEMENTS = /<(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)((?:\s[^>]*?)?)\/>/gi;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Drops the attributes an extension left empty. A DOM serializer skips those;
|
|
29
|
+
* the string renderer would spell them out as the text "null" (`class="null"`
|
|
30
|
+
* on every link, `type="null"` on every ordered list).
|
|
31
|
+
*/
|
|
32
|
+
function withoutEmptyAttributes(spec: ElementSpec): ElementSpec {
|
|
33
|
+
if (!Array.isArray(spec)) {
|
|
34
|
+
return spec;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const [tag, ...parts] = spec;
|
|
38
|
+
const cleaned: [string, ...unknown[]] = [
|
|
39
|
+
tag,
|
|
40
|
+
...parts.map((part: unknown, index) => {
|
|
41
|
+
// Position 0 of the rest holds the attributes, unless the element has
|
|
42
|
+
// none — then a nested element spec sits there instead.
|
|
43
|
+
if (Array.isArray(part) && typeof part[0] === 'string') {
|
|
44
|
+
return withoutEmptyAttributes(part as [string, ...unknown[]]);
|
|
45
|
+
}
|
|
46
|
+
if (index !== 0 || part === null || typeof part !== 'object') {
|
|
47
|
+
return part;
|
|
48
|
+
}
|
|
49
|
+
return Object.fromEntries(Object.entries(part).filter(([, value]) => value !== null && value !== undefined));
|
|
50
|
+
}),
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
return cleaned;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Generates HTML from a ProseMirror JSON document, without a DOM. */
|
|
57
|
+
export function generateHTML(doc: RichTextContent, extensions: RichTextExtensions): string {
|
|
58
|
+
const html = renderToElement<string>({
|
|
59
|
+
// The string renderer's own generic defaults describe plain JSON marks;
|
|
60
|
+
// this walk hands it ProseMirror ones. Same function, narrower input.
|
|
61
|
+
renderer: renderJSONContentToString as RenderArgs['renderer'],
|
|
62
|
+
domOutputSpecToElement: (spec) => domOutputSpecToHTMLString(withoutEmptyAttributes(spec)),
|
|
63
|
+
mapDefinedTypes: {
|
|
64
|
+
doc: ({ children }) => serializeChildrenToHTMLString(children),
|
|
65
|
+
text: ({ node }) => escapeHTML(node.text ?? ''),
|
|
66
|
+
},
|
|
67
|
+
content: doc,
|
|
68
|
+
extensions,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return html.replace(VOID_ELEMENTS, '<$1$2>');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Parsing an HTML string back into ProseMirror JSON needs a real HTML parser,
|
|
76
|
+
* which no DOM-free server runtime provides. Richtext values written by the
|
|
77
|
+
* editor are already ProseMirror JSON, so this only trips on hand-authored HTML
|
|
78
|
+
* strings — and says so instead of failing deep inside a fake DOM.
|
|
79
|
+
*/
|
|
80
|
+
export function generateJSON(_html: string, _extensions: RichTextExtensions): Record<string, unknown> {
|
|
81
|
+
throw new Error(
|
|
82
|
+
'generateJSON cannot parse HTML without a DOM. Store richtext values as tiptap JSON documents instead of HTML strings.',
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DataBindingConfig, PageReference } from '@conloca/content-api';
|
|
2
|
+
import type { Data } from '@puckeditor/core';
|
|
2
3
|
|
|
3
|
-
//#region src/types.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Hydration strategy for Puck components in production.
|
|
6
6
|
*
|
|
@@ -22,7 +22,10 @@ import { Data } from "@puckeditor/core";
|
|
|
22
22
|
* - 'visible': Hydrate when component enters viewport (client:visible)
|
|
23
23
|
* - 'idle': Hydrate when browser is idle (client:idle)
|
|
24
24
|
*/
|
|
25
|
-
type HydrationStrategy = 'none' | 'load' | 'visible' | 'idle';
|
|
25
|
+
export type HydrationStrategy = 'none' | 'load' | 'visible' | 'idle';
|
|
26
|
+
|
|
27
|
+
export type { ContentFragmentSectionProps } from '@conloca/cms-spa';
|
|
28
|
+
|
|
26
29
|
/**
|
|
27
30
|
* Configuration for Conloca's content page routing system.
|
|
28
31
|
*
|
|
@@ -64,7 +67,7 @@ type HydrationStrategy = 'none' | 'load' | 'visible' | 'idle';
|
|
|
64
67
|
* });
|
|
65
68
|
* ```
|
|
66
69
|
*/
|
|
67
|
-
interface RoutingConfig {
|
|
70
|
+
export interface RoutingConfig {
|
|
68
71
|
/**
|
|
69
72
|
* Whether routing is enabled.
|
|
70
73
|
*
|
|
@@ -74,6 +77,7 @@ interface RoutingConfig {
|
|
|
74
77
|
* @default true (when routing config object is provided)
|
|
75
78
|
*/
|
|
76
79
|
enabled?: boolean;
|
|
80
|
+
|
|
77
81
|
/**
|
|
78
82
|
* Route definitions mapping URL patterns to content collections.
|
|
79
83
|
*
|
|
@@ -89,18 +93,22 @@ interface RoutingConfig {
|
|
|
89
93
|
* @default { pages: { pattern: '/[...slug]', collection: 'pages', prerender: true } }
|
|
90
94
|
*/
|
|
91
95
|
routes?: Record<string, RouteConfig>;
|
|
96
|
+
|
|
92
97
|
/**
|
|
93
98
|
* Behavior when a route pattern matches but no content exists.
|
|
94
99
|
*
|
|
95
|
-
* - '404': Return a 404 response (standard behavior)
|
|
96
|
-
* - 'passthrough':
|
|
100
|
+
* - '404': Return a bare 404 response (standard behavior)
|
|
101
|
+
* - 'passthrough': Hand the miss back to Astro's own error handling, which
|
|
102
|
+
* renders the site's /404 route (prerendered included) with a real 404
|
|
103
|
+
* status — never a redirect or a soft-404
|
|
97
104
|
*
|
|
98
|
-
* 'passthrough' is useful when
|
|
99
|
-
*
|
|
105
|
+
* 'passthrough' is useful when the site has its own designed /404 page
|
|
106
|
+
* that should answer for paths the CMS doesn't know.
|
|
100
107
|
*
|
|
101
108
|
* @default '404'
|
|
102
109
|
*/
|
|
103
110
|
fallback?: '404' | 'passthrough';
|
|
111
|
+
|
|
104
112
|
/**
|
|
105
113
|
* What to do when an injected route conflicts with an existing file-based route.
|
|
106
114
|
*
|
|
@@ -113,6 +121,7 @@ interface RoutingConfig {
|
|
|
113
121
|
* @default 'warn'
|
|
114
122
|
*/
|
|
115
123
|
onConflict?: 'warn' | 'error' | 'silent';
|
|
124
|
+
|
|
116
125
|
/**
|
|
117
126
|
* Site name for content resolution.
|
|
118
127
|
*
|
|
@@ -133,6 +142,7 @@ interface RoutingConfig {
|
|
|
133
142
|
* @default 'default'
|
|
134
143
|
*/
|
|
135
144
|
siteName?: string;
|
|
145
|
+
|
|
136
146
|
/**
|
|
137
147
|
* Default locale for content resolution.
|
|
138
148
|
*
|
|
@@ -154,6 +164,7 @@ interface RoutingConfig {
|
|
|
154
164
|
*/
|
|
155
165
|
locale?: string;
|
|
156
166
|
}
|
|
167
|
+
|
|
157
168
|
/**
|
|
158
169
|
* Shorthand for enabling routing with all defaults.
|
|
159
170
|
*
|
|
@@ -167,7 +178,8 @@ interface RoutingConfig {
|
|
|
167
178
|
* }
|
|
168
179
|
* ```
|
|
169
180
|
*/
|
|
170
|
-
type RoutingConfigInput = boolean | RoutingConfig;
|
|
181
|
+
export type RoutingConfigInput = boolean | RoutingConfig;
|
|
182
|
+
|
|
171
183
|
/**
|
|
172
184
|
* Configuration for a single route mapping.
|
|
173
185
|
*
|
|
@@ -203,7 +215,7 @@ type RoutingConfigInput = boolean | RoutingConfig;
|
|
|
203
215
|
* }
|
|
204
216
|
* ```
|
|
205
217
|
*/
|
|
206
|
-
interface RouteConfig {
|
|
218
|
+
export interface RouteConfig {
|
|
207
219
|
/**
|
|
208
220
|
* Astro route pattern for URL matching.
|
|
209
221
|
*
|
|
@@ -217,8 +229,14 @@ interface RouteConfig {
|
|
|
217
229
|
*
|
|
218
230
|
* IMPORTANT: Pattern must start with '/'
|
|
219
231
|
* IMPORTANT: Catch-all patterns ([...param]) capture everything after the prefix
|
|
232
|
+
* IMPORTANT: The parameter name must be unique among the site's routes — Astro's
|
|
233
|
+
* runtime resolves a page's stylesheets by route name, so a Conloca route named
|
|
234
|
+
* like another integration's (Starlight's docs route is '/[...slug]') breaks
|
|
235
|
+
* the styling of one or the other in server output or when rendered on demand.
|
|
236
|
+
* Conloca fails such a build; pick another name, e.g. '/[...page]'.
|
|
220
237
|
*/
|
|
221
238
|
pattern: string;
|
|
239
|
+
|
|
222
240
|
/**
|
|
223
241
|
* Content collection to use for this route.
|
|
224
242
|
*
|
|
@@ -235,6 +253,7 @@ interface RouteConfig {
|
|
|
235
253
|
* @default 'pages'
|
|
236
254
|
*/
|
|
237
255
|
collection?: string;
|
|
256
|
+
|
|
238
257
|
/**
|
|
239
258
|
* Path to the Astro layout component.
|
|
240
259
|
*
|
|
@@ -252,6 +271,7 @@ interface RouteConfig {
|
|
|
252
271
|
* @example './src/layouts/BlogLayout.tsx'
|
|
253
272
|
*/
|
|
254
273
|
layout?: string;
|
|
274
|
+
|
|
255
275
|
/**
|
|
256
276
|
* Whether to statically generate pages at build time.
|
|
257
277
|
*
|
|
@@ -271,6 +291,7 @@ interface RouteConfig {
|
|
|
271
291
|
* @default true
|
|
272
292
|
*/
|
|
273
293
|
prerender?: boolean;
|
|
294
|
+
|
|
274
295
|
/**
|
|
275
296
|
* Additional route metadata passed to the page handler.
|
|
276
297
|
*
|
|
@@ -280,6 +301,7 @@ interface RouteConfig {
|
|
|
280
301
|
* @example { showSidebar: true, theme: 'dark' }
|
|
281
302
|
*/
|
|
282
303
|
meta?: Record<string, unknown>;
|
|
304
|
+
|
|
283
305
|
/**
|
|
284
306
|
* Data binding configuration for this route.
|
|
285
307
|
*
|
|
@@ -298,94 +320,225 @@ interface RouteConfig {
|
|
|
298
320
|
*/
|
|
299
321
|
dataBindings?: DataBindingConfig;
|
|
300
322
|
}
|
|
323
|
+
|
|
301
324
|
/**
|
|
302
|
-
*
|
|
325
|
+
* Complete page data for rendering.
|
|
303
326
|
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
327
|
+
* This is what the page-handler.astro receives after
|
|
328
|
+
* loading content from the matched route.
|
|
306
329
|
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
* routes: {
|
|
312
|
-
* pages: {
|
|
313
|
-
* pattern: '/[...slug]',
|
|
314
|
-
* dataBindings: {
|
|
315
|
-
* collections: ['team', 'testimonials'],
|
|
316
|
-
* },
|
|
317
|
-
* },
|
|
318
|
-
* },
|
|
319
|
-
* },
|
|
320
|
-
* });
|
|
321
|
-
* ```
|
|
330
|
+
* Contains:
|
|
331
|
+
* - Puck editor data for rendering
|
|
332
|
+
* - Page metadata for SEO/layouts
|
|
333
|
+
* - Route information for context
|
|
322
334
|
*/
|
|
323
|
-
interface
|
|
335
|
+
export interface PageData {
|
|
324
336
|
/**
|
|
325
|
-
*
|
|
337
|
+
* Unique page identifier from the content collection.
|
|
326
338
|
*
|
|
327
|
-
*
|
|
328
|
-
|
|
329
|
-
|
|
339
|
+
* Typically matches the URL path (e.g., 'about', 'blog/post-1').
|
|
340
|
+
*/
|
|
341
|
+
id: string;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Page title from content metadata.
|
|
345
|
+
*
|
|
346
|
+
* Used for:
|
|
347
|
+
* - <title> tag
|
|
348
|
+
* - Layout heading
|
|
349
|
+
* - Navigation/breadcrumbs
|
|
330
350
|
*
|
|
331
|
-
*
|
|
351
|
+
* May be undefined if page has no title set.
|
|
332
352
|
*/
|
|
333
|
-
|
|
353
|
+
title?: string;
|
|
354
|
+
|
|
334
355
|
/**
|
|
335
|
-
*
|
|
356
|
+
* Page description for SEO.
|
|
336
357
|
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
358
|
+
* Used for:
|
|
359
|
+
* - <meta name="description">
|
|
360
|
+
* - Social sharing previews
|
|
339
361
|
*/
|
|
340
|
-
|
|
362
|
+
description?: string;
|
|
363
|
+
|
|
341
364
|
/**
|
|
342
|
-
*
|
|
365
|
+
* URL pathname for this page.
|
|
343
366
|
*
|
|
344
|
-
*
|
|
345
|
-
* useful for blog listings, category pages, and site navigation.
|
|
367
|
+
* Always starts with '/' and matches the route pattern.
|
|
346
368
|
*
|
|
347
|
-
* @example
|
|
348
|
-
*
|
|
349
|
-
* {
|
|
350
|
-
* pattern: '/blog',
|
|
351
|
-
* dataBindings: {
|
|
352
|
-
* pages: {
|
|
353
|
-
* prefix: '/blog/',
|
|
354
|
-
* sort: 'date-desc',
|
|
355
|
-
* limit: 10,
|
|
356
|
-
* },
|
|
357
|
-
* },
|
|
358
|
-
* }
|
|
359
|
-
* ```
|
|
369
|
+
* @example '/about'
|
|
370
|
+
* @example '/blog/my-first-post'
|
|
360
371
|
*/
|
|
361
|
-
|
|
372
|
+
pathname: string;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Puck editor data for rendering.
|
|
376
|
+
*
|
|
377
|
+
* This is the Data object from @puckeditor/core containing:
|
|
378
|
+
* - root: Root component props
|
|
379
|
+
* - content: Array of component instances
|
|
380
|
+
* - zones: Named drop zones with nested content
|
|
381
|
+
*
|
|
382
|
+
* Passed directly to <Render config={} data={puckData} />
|
|
383
|
+
*/
|
|
384
|
+
puckData: Data;
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Content collection this page belongs to.
|
|
388
|
+
*
|
|
389
|
+
* @example 'pages', 'posts', 'docs'
|
|
390
|
+
*/
|
|
391
|
+
collection: string;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* Route configuration that matched this page.
|
|
395
|
+
*
|
|
396
|
+
* Includes the pattern, layout path, and any meta.
|
|
397
|
+
* Useful for conditional rendering based on route.
|
|
398
|
+
*/
|
|
399
|
+
route: {
|
|
362
400
|
/**
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
* Only pages whose pathname starts with this prefix are included.
|
|
366
|
-
* The listing page itself is excluded.
|
|
367
|
-
*
|
|
368
|
-
* @example '/blog/' matches '/blog/post-1', '/blog/post-2'
|
|
401
|
+
* Route identifier from the config.
|
|
402
|
+
* @example 'pages', 'blog'
|
|
369
403
|
*/
|
|
370
|
-
|
|
404
|
+
name: string;
|
|
405
|
+
|
|
371
406
|
/**
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
* Useful for showing "latest N posts" on a homepage or sidebar.
|
|
407
|
+
* Original pattern from RouteConfig.
|
|
375
408
|
*/
|
|
376
|
-
|
|
409
|
+
pattern: string;
|
|
410
|
+
|
|
377
411
|
/**
|
|
378
|
-
*
|
|
379
|
-
*
|
|
380
|
-
* - 'date-desc': Newest first (by modified/created date)
|
|
381
|
-
* - 'date-asc': Oldest first
|
|
382
|
-
* - 'title': Alphabetical by title
|
|
383
|
-
*
|
|
384
|
-
* @default 'date-desc'
|
|
412
|
+
* Route-specific metadata if configured.
|
|
385
413
|
*/
|
|
386
|
-
|
|
414
|
+
meta?: Record<string, unknown>;
|
|
387
415
|
};
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Additional page metadata from content.
|
|
419
|
+
*
|
|
420
|
+
* Custom fields stored in the page's frontmatter/metadata.
|
|
421
|
+
* Schema depends on the site's content configuration.
|
|
422
|
+
*/
|
|
423
|
+
meta?: Record<string, unknown>;
|
|
424
|
+
|
|
425
|
+
/** The page's dates, as on PageReference. */
|
|
426
|
+
timestamps?: PageReference['timestamps'];
|
|
388
427
|
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Props passed to layout components wrapping page content.
|
|
431
|
+
*
|
|
432
|
+
* Layouts receive common props (title, description) that work with
|
|
433
|
+
* most existing layouts. No special Conloca-specific layout needed.
|
|
434
|
+
* A layout that needs more of the page's settings (an Open Graph image,
|
|
435
|
+
* structured data) reads them from `page` instead of looking the page up
|
|
436
|
+
* again, because a second lookup would have to repeat the handler's language,
|
|
437
|
+
* publication and preview rules.
|
|
438
|
+
*
|
|
439
|
+
* @example Astro layout usage
|
|
440
|
+
* ```astro
|
|
441
|
+
* ---
|
|
442
|
+
* interface Props {
|
|
443
|
+
* title: string;
|
|
444
|
+
* description?: string;
|
|
445
|
+
* }
|
|
446
|
+
*
|
|
447
|
+
* const { title, description } = Astro.props;
|
|
448
|
+
* ---
|
|
449
|
+
*
|
|
450
|
+
* <html>
|
|
451
|
+
* <head>
|
|
452
|
+
* <title>{title}</title>
|
|
453
|
+
* {description && <meta name="description" content={description} />}
|
|
454
|
+
* </head>
|
|
455
|
+
* <body>
|
|
456
|
+
* <slot />
|
|
457
|
+
* </body>
|
|
458
|
+
* </html>
|
|
459
|
+
* ```
|
|
460
|
+
*
|
|
461
|
+
* @example React layout usage
|
|
462
|
+
* ```tsx
|
|
463
|
+
* interface LayoutProps {
|
|
464
|
+
* title: string;
|
|
465
|
+
* description?: string;
|
|
466
|
+
* children: React.ReactNode;
|
|
467
|
+
* }
|
|
468
|
+
*
|
|
469
|
+
* export default function Layout({ title, children }: LayoutProps) {
|
|
470
|
+
* return (
|
|
471
|
+
* <div className="layout">
|
|
472
|
+
* <header>
|
|
473
|
+
* <h1>{title}</h1>
|
|
474
|
+
* </header>
|
|
475
|
+
* <main>{children}</main>
|
|
476
|
+
* </div>
|
|
477
|
+
* );
|
|
478
|
+
* }
|
|
479
|
+
* ```
|
|
480
|
+
*/
|
|
481
|
+
export interface LayoutProps {
|
|
482
|
+
/**
|
|
483
|
+
* Page title for the document head.
|
|
484
|
+
*/
|
|
485
|
+
title: string;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Page description for SEO meta tag.
|
|
489
|
+
*/
|
|
490
|
+
description?: string;
|
|
491
|
+
|
|
492
|
+
/**
|
|
493
|
+
* The page being rendered, with its settings in `meta`: the version in the
|
|
494
|
+
* route's language that the handler matched, published or the draft a
|
|
495
|
+
* preview renders.
|
|
496
|
+
*/
|
|
497
|
+
page: PageReference;
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* The rendered Puck content.
|
|
501
|
+
*
|
|
502
|
+
* In Astro layouts, use <slot /> instead of {children}.
|
|
503
|
+
* In React layouts, render {children} in the content area.
|
|
504
|
+
*/
|
|
505
|
+
children?: unknown; // astro.JSX.Element | React.ReactNode
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Layout component type for Astro.
|
|
510
|
+
*
|
|
511
|
+
* Layouts must accept LayoutProps and render a page shell
|
|
512
|
+
* with the provided content.
|
|
513
|
+
*/
|
|
514
|
+
export type LayoutComponent = (props: LayoutProps) => unknown;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Resolved routing configuration with all fields required.
|
|
518
|
+
*
|
|
519
|
+
* This is what the page handler receives via the virtual module,
|
|
520
|
+
* with all defaults applied.
|
|
521
|
+
*/
|
|
522
|
+
export interface ResolvedRoutingConfig {
|
|
523
|
+
enabled: boolean;
|
|
524
|
+
routes: Record<string, Required<RouteConfig>>;
|
|
525
|
+
fallback: '404' | 'passthrough';
|
|
526
|
+
onConflict: 'warn' | 'error' | 'silent';
|
|
527
|
+
/** Site name for content resolution. */
|
|
528
|
+
siteName: string;
|
|
529
|
+
/** Default locale for content resolution. */
|
|
530
|
+
locale: string;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// Data context and binding types re-exported from content-api (canonical source)
|
|
534
|
+
export type {
|
|
535
|
+
DataBindingConfig,
|
|
536
|
+
DataCollectionEntry,
|
|
537
|
+
DataContext,
|
|
538
|
+
EditorDataBindings,
|
|
539
|
+
PageReference,
|
|
540
|
+
} from '@conloca/content-api';
|
|
541
|
+
|
|
389
542
|
/**
|
|
390
543
|
* Configuration for a page creation template.
|
|
391
544
|
*
|
|
@@ -405,29 +558,29 @@ interface DataBindingConfig {
|
|
|
405
558
|
* });
|
|
406
559
|
* ```
|
|
407
560
|
*/
|
|
408
|
-
interface TemplateConfig {
|
|
561
|
+
export interface TemplateConfig {
|
|
409
562
|
/**
|
|
410
563
|
* Display label shown in the template dropdown.
|
|
411
564
|
* @example 'Blog Post', 'Landing Page', 'Documentation'
|
|
412
565
|
*/
|
|
413
566
|
label: string;
|
|
567
|
+
|
|
414
568
|
/**
|
|
415
569
|
* Puck component name to pre-drop into the page.
|
|
416
570
|
* Must match a component registered in the site's puck.config.
|
|
417
571
|
* @example 'BlogPostTemplate', 'LandingPageTemplate'
|
|
418
572
|
*/
|
|
419
573
|
component: string;
|
|
574
|
+
|
|
420
575
|
/**
|
|
421
576
|
* Optional path prefix to auto-apply when this template is selected.
|
|
422
577
|
* If the user's path doesn't start with this prefix, it's added.
|
|
423
578
|
* @example '/blog/' will turn '/my-post' into '/blog/my-post'
|
|
424
579
|
*/
|
|
425
580
|
pathPrefix?: string;
|
|
581
|
+
|
|
426
582
|
/**
|
|
427
583
|
* Optional description shown in the dropdown.
|
|
428
584
|
*/
|
|
429
585
|
description?: string;
|
|
430
586
|
}
|
|
431
|
-
//#endregion
|
|
432
|
-
export { RoutingConfigInput as n, TemplateConfig as r, HydrationStrategy as t };
|
|
433
|
-
//# sourceMappingURL=types-CVQNmPxF.d.mts.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type declarations for Conloca virtual modules.
|
|
3
|
+
*
|
|
4
|
+
* These modules are generated at build/dev time by the Vite plugin
|
|
5
|
+
* and provide routing configuration, layout components and Puck config
|
|
6
|
+
* to page handlers.
|
|
7
|
+
*
|
|
8
|
+
* Every type import lives INSIDE its `declare module` block so this file has
|
|
9
|
+
* no top-level import/export: a file that is itself a module turns these into
|
|
10
|
+
* augmentations of modules that must already resolve, which they never do.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Virtual module: virtual:conloca-routing-config
|
|
15
|
+
*
|
|
16
|
+
* Provides resolved routing configuration to page handlers.
|
|
17
|
+
* All defaults are applied before this module is generated.
|
|
18
|
+
*/
|
|
19
|
+
declare module 'virtual:conloca-routing-config' {
|
|
20
|
+
import type { ResolvedRoutingConfig } from '@conloca/astro-cms';
|
|
21
|
+
|
|
22
|
+
const config: ResolvedRoutingConfig;
|
|
23
|
+
export default config;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Virtual module: virtual:conloca-layout
|
|
28
|
+
*
|
|
29
|
+
* Provides the layout component for content pages.
|
|
30
|
+
* Returns undefined if no layout is configured.
|
|
31
|
+
*
|
|
32
|
+
* Currently uses the first route's layout - multi-layout support
|
|
33
|
+
* is planned for future versions.
|
|
34
|
+
*/
|
|
35
|
+
declare module 'virtual:conloca-layout' {
|
|
36
|
+
import type { LayoutProps } from '@conloca/astro-cms';
|
|
37
|
+
|
|
38
|
+
type LayoutComponent = ((props: LayoutProps) => unknown) | undefined;
|
|
39
|
+
|
|
40
|
+
const Layout: LayoutComponent;
|
|
41
|
+
export default Layout;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Virtual module: virtual:conloca-puck-config
|
|
46
|
+
*
|
|
47
|
+
* Provides Puck configuration for static page rendering.
|
|
48
|
+
*
|
|
49
|
+
* This is separate from the HMR-enabled puck-entry.js used by
|
|
50
|
+
* the CMS SPA. It's a simple re-export without React refresh
|
|
51
|
+
* preamble since it's used for SSG builds.
|
|
52
|
+
*/
|
|
53
|
+
declare module 'virtual:conloca-puck-config' {
|
|
54
|
+
import type { Config } from '@puckeditor/core';
|
|
55
|
+
|
|
56
|
+
const config: Config;
|
|
57
|
+
export default config;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Virtual module: virtual:conloca-hydration-entry
|
|
62
|
+
*
|
|
63
|
+
* Client-side script that handles progressive hydration of interactive
|
|
64
|
+
* components. Loaded only when a page contains hydratable components.
|
|
65
|
+
*/
|
|
66
|
+
declare module 'virtual:conloca-hydration-entry' {}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Virtual module: virtual:conloca-hydration-registry
|
|
70
|
+
*
|
|
71
|
+
* Maps component names to dynamic import functions for lazy-loading
|
|
72
|
+
* hydratable components on the client.
|
|
73
|
+
*/
|
|
74
|
+
declare module 'virtual:conloca-hydration-registry' {}
|
package/dist/collections.d.mts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineCollection } from "astro:content";
|
|
2
|
-
|
|
3
|
-
//#region src/collections.d.ts
|
|
4
|
-
declare const ALL_BLOCKS_COLLECTION = "__conloca_blocks";
|
|
5
|
-
/**
|
|
6
|
-
* Options for createConlocaCollections().
|
|
7
|
-
*/
|
|
8
|
-
interface CreateConlocaCollectionsOptions {
|
|
9
|
-
/** Path to content root directory. @default './content' */
|
|
10
|
-
contentRoot?: string;
|
|
11
|
-
/** Site name for multi-site setups. @default 'default' */
|
|
12
|
-
site?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Return type of createConlocaCollections().
|
|
16
|
-
*/
|
|
17
|
-
interface ConlocaCollectionsResult {
|
|
18
|
-
/** Astro Content Collections definitions - export this as `collections` */
|
|
19
|
-
collections: Record<string, ReturnType<typeof defineCollection>>;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Creates Astro Content Collections by discovering from indexed content.
|
|
23
|
-
* Uses content-api to find collections that have content.
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```typescript
|
|
27
|
-
* // src/content.config.ts
|
|
28
|
-
* import { createConlocaCollections } from '@conloca/astro-cms/node/content';
|
|
29
|
-
*
|
|
30
|
-
* export const { collections } = await createConlocaCollections();
|
|
31
|
-
* ```
|
|
32
|
-
*/
|
|
33
|
-
declare function createConlocaCollections(options?: CreateConlocaCollectionsOptions): Promise<ConlocaCollectionsResult>;
|
|
34
|
-
//#endregion
|
|
35
|
-
export { ALL_BLOCKS_COLLECTION, ConlocaCollectionsResult, CreateConlocaCollectionsOptions, createConlocaCollections };
|
|
36
|
-
//# sourceMappingURL=collections.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"collections.d.mts","names":[],"sources":["../src/collections.ts"],"mappings":";;;cAKa,qBAAA;;AAAb;;UAKiB,+BAAA;EALiB;EAOhC,WAAA;EAFe;EAIf,IAAA;AAAA;;;AAMF;UAAiB,wBAAA;;EAEf,WAAA,EAAa,MAAA,SAAe,UAAA,QAAkB,gBAAA;AAAA;;;;;;;;;;AAehD;;;iBAAsB,wBAAA,CACpB,OAAA,GAAS,+BAAA,GACR,OAAA,CAAQ,wBAAA"}
|