@conloca/astro-cms 0.1.16 → 0.2.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/README.md +254 -301
- 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/{src → ts/src}/cms-handler.d.ts +0 -1
- package/dist/ts/src/cms-handler.d.ts.map +1 -0
- package/dist/{src → ts/src}/cms-handler.js +11 -131
- package/dist/ts/src/cms-handler.js.map +1 -0
- package/dist/ts/src/collections.d.ts +161 -0
- package/dist/ts/src/collections.d.ts.map +1 -0
- package/dist/ts/src/collections.js +178 -0
- package/dist/ts/src/collections.js.map +1 -0
- package/dist/{src → ts/src}/components/HydrationWrapper.d.ts +1 -1
- package/dist/ts/src/components/HydrationWrapper.d.ts.map +1 -0
- package/dist/{src → ts/src}/components/HydrationWrapper.js +1 -0
- package/dist/ts/src/components/HydrationWrapper.js.map +1 -0
- package/dist/{src/components/RenderWithBlocks.d.ts → ts/src/components/RenderWithFragments.d.ts} +8 -4
- 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/{src → ts/src}/components/RenderWithHydration.d.ts +6 -2
- package/dist/ts/src/components/RenderWithHydration.d.ts.map +1 -0
- package/dist/{src → ts/src}/components/RenderWithHydration.js +6 -3
- 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.map +1 -0
- package/dist/{src → ts/src}/discovery/astro-frontmatter.js +1 -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.map +1 -0
- package/dist/{src → ts/src}/discovery/extract-props-ts.js +1 -0
- package/dist/ts/src/discovery/extract-props-ts.js.map +1 -0
- package/dist/{src → ts/src}/discovery/merge-registry.d.ts +3 -3
- package/dist/ts/src/discovery/merge-registry.d.ts.map +1 -0
- package/dist/{src → ts/src}/discovery/merge-registry.js +1 -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/{src → ts/src}/discovery/scan-components.d.ts +3 -7
- package/dist/ts/src/discovery/scan-components.d.ts.map +1 -0
- package/dist/{src → ts/src}/discovery/scan-components.js +4 -6
- package/dist/ts/src/discovery/scan-components.js.map +1 -0
- package/dist/ts/src/discovery/scan-mdx.d.ts.map +1 -0
- package/dist/{src → ts/src}/discovery/scan-mdx.js +1 -0
- package/dist/ts/src/discovery/scan-mdx.js.map +1 -0
- package/dist/ts/src/discovery/scan-overrides.d.ts.map +1 -0
- package/dist/{src → ts/src}/discovery/scan-overrides.js +1 -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.map +1 -0
- package/dist/{src → ts/src}/hydration.js +1 -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 +13 -0
- package/dist/ts/src/lib/content-config-guard.d.ts.map +1 -0
- package/dist/ts/src/lib/content-config-guard.js +45 -0
- package/dist/ts/src/lib/content-config-guard.js.map +1 -0
- package/dist/ts/src/lib/hydration-scanner.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/hydration-scanner.js +1 -0
- package/dist/ts/src/lib/hydration-scanner.js.map +1 -0
- package/dist/ts/src/lib/hydration-script.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/hydration-script.js +1 -0
- package/dist/ts/src/lib/hydration-script.js.map +1 -0
- package/dist/ts/src/lib/hydration-utils.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/hydration-utils.js +1 -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/{src → ts/src}/lib/route-utils.d.ts +26 -6
- package/dist/ts/src/lib/route-utils.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/route-utils.js +33 -15
- package/dist/ts/src/lib/route-utils.js.map +1 -0
- package/dist/{src → ts/src}/lib/routing-config.d.ts +7 -1
- package/dist/ts/src/lib/routing-config.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/routing-config.js +13 -0
- package/dist/ts/src/lib/routing-config.js.map +1 -0
- package/dist/ts/src/lib/serialize-props.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/serialize-props.js +1 -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/{src → ts/src}/lib/virtual-module-generators.d.ts +0 -24
- 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/ts/src/lib/withHydration.d.ts.map +1 -0
- package/dist/{src → ts/src}/lib/withHydration.js +1 -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/{src → ts/src}/loader.js +33 -4
- package/dist/ts/src/loader.js.map +1 -0
- package/dist/ts/src/locales-helpers.d.ts.map +1 -0
- package/dist/{src → ts/src}/locales-helpers.js +1 -0
- package/dist/ts/src/locales-helpers.js.map +1 -0
- package/dist/ts/src/mime-types.d.ts.map +1 -0
- package/dist/{src → ts/src}/mime-types.js +1 -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.map +1 -0
- package/dist/{src → ts/src}/path-validation.js +1 -0
- package/dist/ts/src/path-validation.js.map +1 -0
- package/dist/{src → ts/src}/plugin-spa.d.ts +28 -10
- package/dist/ts/src/plugin-spa.d.ts.map +1 -0
- package/dist/{src → ts/src}/plugin-spa.js +301 -88
- 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.map +1 -0
- package/dist/{src → ts/src}/safe-json-stringify.js +1 -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/{src → ts/src}/site-styles/content-wrapper-endpoint.d.ts +2 -5
- package/dist/ts/src/site-styles/content-wrapper-endpoint.d.ts.map +1 -0
- package/dist/{src → ts/src}/site-styles/content-wrapper-endpoint.js +5 -8
- package/dist/ts/src/site-styles/content-wrapper-endpoint.js.map +1 -0
- package/dist/{src → ts/src}/site-styles/render-endpoint.d.ts +4 -9
- package/dist/ts/src/site-styles/render-endpoint.d.ts.map +1 -0
- package/dist/{src → ts/src}/site-styles/render-endpoint.js +1 -0
- package/dist/ts/src/site-styles/render-endpoint.js.map +1 -0
- package/dist/{src → ts/src}/site-styles/styles-endpoint.d.ts +2 -4
- package/dist/ts/src/site-styles/styles-endpoint.d.ts.map +1 -0
- package/dist/{src → ts/src}/site-styles/styles-endpoint.js +3 -5
- 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 +16 -0
- package/dist/ts/src/tiptap-html-static.d.ts.map +1 -0
- package/dist/ts/src/tiptap-html-static.js +117 -0
- package/dist/ts/src/tiptap-html-static.js.map +1 -0
- package/dist/{src → ts/src}/types.d.ts +26 -110
- 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 +12 -93
- package/node/content.ts +14 -0
- package/node/index.ts +22 -0
- package/package.json +161 -73
- package/src/asset-ref-base.ts +48 -0
- package/src/checks.ts +11 -0
- package/src/cms-handler.ts +281 -0
- package/src/collections.ts +271 -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 +53 -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/{dist/withHydration-DkKpkmzJ.d.mts → src/lib/withHydration.ts} +25 -8
- package/src/loader.ts +145 -0
- package/{dist/locales-helpers-BvYYqnJ5.d.mts → src/locales-helpers.ts} +21 -17
- 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 +1496 -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 +134 -0
- package/{dist/types-CS9neadI.d.mts → src/types.ts} +87 -124
- package/src/virtual-modules.d.ts +74 -0
- package/dist/collections-Bd7EME4b.mjs +0 -129
- package/dist/collections-Bd7EME4b.mjs.map +0 -1
- package/dist/collections.d.mts +0 -35
- package/dist/collections.d.mts.map +0 -1
- package/dist/collections.mjs +0 -2
- package/dist/components.d.mts +0 -41
- package/dist/components.d.mts.map +0 -1
- package/dist/components.mjs +0 -223
- package/dist/components.mjs.map +0 -1
- package/dist/hydration.d.mts +0 -4
- package/dist/hydration.mjs +0 -2
- package/dist/index.d.mts +0 -108
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -67
- package/dist/index.mjs.map +0 -1
- package/dist/internal/cms-handler.d.mts +0 -25
- package/dist/internal/cms-handler.d.mts.map +0 -1
- package/dist/internal/cms-handler.mjs +0 -314
- package/dist/internal/cms-handler.mjs.map +0 -1
- package/dist/lib/hydration-script.d.mts +0 -30
- package/dist/lib/hydration-script.d.mts.map +0 -1
- package/dist/lib/hydration-script.mjs +0 -84
- package/dist/lib/hydration-script.mjs.map +0 -1
- package/dist/locales-helpers-BvYYqnJ5.d.mts.map +0 -1
- package/dist/locales-helpers-qiwh7nxS.mjs +0 -54
- package/dist/locales-helpers-qiwh7nxS.mjs.map +0 -1
- package/dist/node/content.d.mts +0 -18
- package/dist/node/content.d.mts.map +0 -1
- package/dist/node/content.d.ts +0 -3
- package/dist/node/content.d.ts.map +0 -1
- package/dist/node/content.js +0 -2
- package/dist/node/content.mjs +0 -2
- package/dist/node/index.d.mts +0 -200
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -4
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.js +0 -3
- package/dist/node/index.mjs +0 -2513
- package/dist/node/index.mjs.map +0 -1
- package/dist/serialize-props-BHoNpzH6.mjs +0 -72
- package/dist/serialize-props-BHoNpzH6.mjs.map +0 -1
- package/dist/src/cms-handler.d.ts.map +0 -1
- package/dist/src/collections.d.ts +0 -32
- package/dist/src/collections.d.ts.map +0 -1
- package/dist/src/collections.js +0 -50
- package/dist/src/components/HydrationWrapper.d.ts.map +0 -1
- package/dist/src/components/RenderWithBlocks.d.ts.map +0 -1
- package/dist/src/components/RenderWithBlocks.js +0 -129
- package/dist/src/components/RenderWithHydration.d.ts.map +0 -1
- package/dist/src/components.d.ts +0 -4
- package/dist/src/components.d.ts.map +0 -1
- package/dist/src/components.js +0 -3
- package/dist/src/discovery/astro-frontmatter.d.ts.map +0 -1
- package/dist/src/discovery/extract-props-ts.d.ts.map +0 -1
- package/dist/src/discovery/merge-registry.d.ts.map +0 -1
- package/dist/src/discovery/registry-endpoint.d.ts +0 -42
- package/dist/src/discovery/registry-endpoint.d.ts.map +0 -1
- package/dist/src/discovery/registry-endpoint.js +0 -81
- package/dist/src/discovery/scan-components.d.ts.map +0 -1
- package/dist/src/discovery/scan-mdx.d.ts.map +0 -1
- package/dist/src/discovery/scan-overrides.d.ts.map +0 -1
- package/dist/src/hydration.d.ts.map +0 -1
- package/dist/src/index.d.ts +0 -11
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -25
- package/dist/src/lib/hydration-scanner.d.ts.map +0 -1
- package/dist/src/lib/hydration-script.d.ts.map +0 -1
- package/dist/src/lib/hydration-utils.d.ts.map +0 -1
- package/dist/src/lib/page-api.d.ts +0 -77
- package/dist/src/lib/page-api.d.ts.map +0 -1
- package/dist/src/lib/page-api.js +0 -121
- package/dist/src/lib/route-utils.d.ts.map +0 -1
- package/dist/src/lib/routing-config.d.ts.map +0 -1
- package/dist/src/lib/serialize-props.d.ts.map +0 -1
- package/dist/src/lib/virtual-module-generators.d.ts.map +0 -1
- package/dist/src/lib/virtual-module-generators.js +0 -263
- package/dist/src/lib/withHydration.d.ts.map +0 -1
- package/dist/src/loader.d.ts +0 -14
- package/dist/src/loader.d.ts.map +0 -1
- package/dist/src/locales-helpers.d.ts.map +0 -1
- package/dist/src/mime-types.d.ts.map +0 -1
- package/dist/src/path-validation.d.ts.map +0 -1
- package/dist/src/plugin-spa.d.ts.map +0 -1
- package/dist/src/safe-json-stringify.d.ts.map +0 -1
- package/dist/src/site-styles/content-wrapper-endpoint.d.ts.map +0 -1
- package/dist/src/site-styles/render-endpoint.d.ts.map +0 -1
- package/dist/src/site-styles/styles-endpoint.d.ts.map +0 -1
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -1
- package/dist/types-CS9neadI.d.mts.map +0 -1
- package/dist/withHydration-C256ox_6.mjs +0 -49
- package/dist/withHydration-C256ox_6.mjs.map +0 -1
- package/dist/withHydration-DkKpkmzJ.d.mts.map +0 -1
- /package/dist/{src → ts/src}/discovery/astro-frontmatter.d.ts +0 -0
- /package/dist/{src → ts/src}/discovery/extract-props-ts.d.ts +0 -0
- /package/dist/{src → ts/src}/discovery/scan-mdx.d.ts +0 -0
- /package/dist/{src → ts/src}/discovery/scan-overrides.d.ts +0 -0
- /package/dist/{src → ts/src}/hydration.d.ts +0 -0
- /package/dist/{src → ts/src}/lib/hydration-scanner.d.ts +0 -0
- /package/dist/{src → ts/src}/lib/hydration-script.d.ts +0 -0
- /package/dist/{src → ts/src}/lib/hydration-utils.d.ts +0 -0
- /package/dist/{src → ts/src}/lib/serialize-props.d.ts +0 -0
- /package/dist/{src → ts/src}/lib/withHydration.d.ts +0 -0
- /package/dist/{src → ts/src}/locales-helpers.d.ts +0 -0
- /package/dist/{src → ts/src}/mime-types.d.ts +0 -0
- /package/dist/{src → ts/src}/path-validation.d.ts +0 -0
- /package/dist/{src → ts/src}/safe-json-stringify.d.ts +0 -0
package/dist/src/lib/page-api.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { createContentAPI } from '@conloca/content-api/reader';
|
|
2
|
-
/**
|
|
3
|
-
* Error class for page not found scenarios.
|
|
4
|
-
*/
|
|
5
|
-
export class PageNotFoundError extends Error {
|
|
6
|
-
code = 'PAGE_NOT_FOUND';
|
|
7
|
-
constructor(pathname) {
|
|
8
|
-
super(`Page not found: ${pathname}`);
|
|
9
|
-
this.name = 'PageNotFoundError';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Create a PageAPI instance for loading page data.
|
|
14
|
-
*
|
|
15
|
-
* Wraps ContentAPI with a cleaner interface focused on
|
|
16
|
-
* page rendering needs.
|
|
17
|
-
*
|
|
18
|
-
* @param options - Configuration for ContentAPI initialization
|
|
19
|
-
* @returns PageAPI instance
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* const api = await createPageAPI({
|
|
24
|
-
* contentRoot: '../content',
|
|
25
|
-
* canvasDir: './canvas',
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* const pages = await api.getAllPages('pages');
|
|
29
|
-
* const page = await api.getPage('/about');
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
export async function createPageAPI(options) {
|
|
33
|
-
const contentApi = await createContentAPI({
|
|
34
|
-
contentRoot: options.contentRoot,
|
|
35
|
-
canvasDir: options.canvasDir,
|
|
36
|
-
});
|
|
37
|
-
const siteName = options.siteName || 'default';
|
|
38
|
-
const locale = options.locale || 'en';
|
|
39
|
-
// Get the site for page operations
|
|
40
|
-
const site = contentApi.getSite(siteName);
|
|
41
|
-
if (!site) {
|
|
42
|
-
throw new Error(`Site '${siteName}' not found in content configuration`);
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
async getAllPages(collection) {
|
|
46
|
-
const pages = [];
|
|
47
|
-
// Use site.listPages() generator to get all pages
|
|
48
|
-
for (const manifest of site.listPages(locale)) {
|
|
49
|
-
// Filter by collection if specified
|
|
50
|
-
if (collection && manifest.collection !== collection) {
|
|
51
|
-
continue;
|
|
52
|
-
}
|
|
53
|
-
// Get the localized data for pathname
|
|
54
|
-
const localeData = manifest.locales[locale];
|
|
55
|
-
if (!localeData)
|
|
56
|
-
continue;
|
|
57
|
-
pages.push({
|
|
58
|
-
id: manifest.id,
|
|
59
|
-
pathname: localeData.pathname || `/${manifest.id.replace(/^index$/, '')}`,
|
|
60
|
-
title: localeData.meta?.title || manifest.id,
|
|
61
|
-
collection: manifest.collection || 'pages',
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return pages;
|
|
65
|
-
},
|
|
66
|
-
async getPage(pathname, collection) {
|
|
67
|
-
// Use site.getByPathname to find the content by pathname
|
|
68
|
-
const manifest = site.getByPathname(pathname, locale);
|
|
69
|
-
if (!manifest) {
|
|
70
|
-
throw new PageNotFoundError(pathname);
|
|
71
|
-
}
|
|
72
|
-
// Optionally filter by collection
|
|
73
|
-
if (collection && manifest.collection !== collection) {
|
|
74
|
-
throw new PageNotFoundError(pathname);
|
|
75
|
-
}
|
|
76
|
-
// Get the full content with locale data
|
|
77
|
-
const content = await contentApi.getLocalized(manifest.id, locale);
|
|
78
|
-
if (!content) {
|
|
79
|
-
throw new PageNotFoundError(pathname);
|
|
80
|
-
}
|
|
81
|
-
const localeData = content.localized;
|
|
82
|
-
const meta = localeData.meta || {};
|
|
83
|
-
return {
|
|
84
|
-
id: manifest.id,
|
|
85
|
-
title: meta.title || manifest.id,
|
|
86
|
-
description: meta.description,
|
|
87
|
-
pathname,
|
|
88
|
-
puckData: localeData.content.puckData,
|
|
89
|
-
collection: manifest.collection || collection || 'pages',
|
|
90
|
-
route: {
|
|
91
|
-
// These will be overwritten by the caller with actual route info
|
|
92
|
-
name: 'pages',
|
|
93
|
-
pattern: '/[...slug]',
|
|
94
|
-
meta: {},
|
|
95
|
-
},
|
|
96
|
-
meta,
|
|
97
|
-
timestamps: {
|
|
98
|
-
created: localeData.created ? new Date(localeData.created) : undefined,
|
|
99
|
-
modified: localeData.modified ? new Date(localeData.modified) : undefined,
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
async pageExists(pathname, collection) {
|
|
104
|
-
try {
|
|
105
|
-
// Use site.getByPathname to check existence
|
|
106
|
-
const manifest = site.getByPathname(pathname, locale);
|
|
107
|
-
if (!manifest) {
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
// If collection filter specified, verify it matches
|
|
111
|
-
if (collection && manifest.collection !== collection) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
return true;
|
|
115
|
-
}
|
|
116
|
-
catch {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-utils.d.ts","sourceRoot":"","sources":["../../../src/lib/route-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,oBAY7D;AAED,UAAU,eAAe;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,WAchD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiB7F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAYlF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routing-config.d.ts","sourceRoot":"","sources":["../../../src/lib/routing-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAElF;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,kBAAkB,GAAG,SAAS,EACrC,cAAc,CAAC,EAAE,MAAM,GACtB,aAAa,GAAG,SAAS,CA0C3B;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,CAS7E;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAkB7E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"serialize-props.d.ts","sourceRoot":"","sources":["../../../src/lib/serialize-props.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-module-generators.d.ts","sourceRoot":"","sources":["../../../src/lib/virtual-module-generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAEjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,MAAM,CAe/E;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,QAAQ,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAwM3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAMvE"}
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generate the virtual:conloca-routing-config module.
|
|
3
|
-
*
|
|
4
|
-
* Returns a module that exports the resolved routing configuration as default.
|
|
5
|
-
*
|
|
6
|
-
* @param config - Resolved routing configuration with all defaults applied
|
|
7
|
-
* @returns JavaScript module code as a string
|
|
8
|
-
*/
|
|
9
|
-
export function generateRoutingConfigModule(config) {
|
|
10
|
-
return `export default ${JSON.stringify(config, null, 2)};`;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Generate the virtual:conloca-layout module.
|
|
14
|
-
*
|
|
15
|
-
* Returns a module that re-exports the layout component or exports undefined
|
|
16
|
-
* if no layout is configured.
|
|
17
|
-
*
|
|
18
|
-
* Currently uses the first route's layout. Multi-layout support is future work.
|
|
19
|
-
*
|
|
20
|
-
* @param routing - Routing configuration (may be undefined if routing disabled)
|
|
21
|
-
* @returns JavaScript module code as a string
|
|
22
|
-
*/
|
|
23
|
-
export function generateLayoutModule(routing) {
|
|
24
|
-
// Get layout from first route (for now - multi-layout is future work)
|
|
25
|
-
const routes = routing?.routes || {};
|
|
26
|
-
const firstRoute = Object.values(routes)[0];
|
|
27
|
-
const layoutPath = firstRoute?.layout;
|
|
28
|
-
if (layoutPath) {
|
|
29
|
-
// Convert relative path to absolute for Vite resolution
|
|
30
|
-
// ./src/... -> /src/...
|
|
31
|
-
const absolutePath = layoutPath.startsWith('.') ? `/${layoutPath.slice(2)}` : layoutPath;
|
|
32
|
-
return `export { default } from '${absolutePath}';`;
|
|
33
|
-
}
|
|
34
|
-
return 'export default undefined;';
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Generate the virtual:conloca-page-api module.
|
|
38
|
-
*
|
|
39
|
-
* Returns a module that provides page loading functions wrapping ContentAPI:
|
|
40
|
-
* - getAllPages(collection?) - For getStaticPaths()
|
|
41
|
-
* - getPage(pathname, collection?) - For page data loading
|
|
42
|
-
* - pageExists(pathname, collection?) - For 404 checks
|
|
43
|
-
* - contentOptions - Configuration for ContentAPI (for MDX evaluation)
|
|
44
|
-
*
|
|
45
|
-
* @param options - Configuration for ContentAPI initialization
|
|
46
|
-
* @returns JavaScript module code as a string
|
|
47
|
-
*/
|
|
48
|
-
export function generatePageApiModule(options) {
|
|
49
|
-
return `
|
|
50
|
-
import { createContentAPI } from '@conloca/content-api/reader';
|
|
51
|
-
|
|
52
|
-
// Export content options for MDX evaluation and other ContentAPI uses
|
|
53
|
-
export const contentOptions = {
|
|
54
|
-
contentRoot: '${options.contentRoot}',
|
|
55
|
-
canvasDir: '${options.canvasDir}',
|
|
56
|
-
siteName: '${options.siteName}',
|
|
57
|
-
locale: '${options.locale}',
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
// Initialize ContentAPI with configured paths
|
|
61
|
-
const contentApi = await createContentAPI({
|
|
62
|
-
contentRoot: contentOptions.contentRoot,
|
|
63
|
-
canvasDir: contentOptions.canvasDir,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
// Get site instance for page operations (configured via routing.siteName)
|
|
67
|
-
const site = contentApi.getSite(contentOptions.siteName);
|
|
68
|
-
const locale = contentOptions.locale; // Configured via routing.locale
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Get all pages for static path generation.
|
|
72
|
-
* @param collection - Optional collection filter
|
|
73
|
-
*/
|
|
74
|
-
export async function getAllPages(collection) {
|
|
75
|
-
const pages = [];
|
|
76
|
-
|
|
77
|
-
// listPages is a generator that yields ContentManifest objects
|
|
78
|
-
for (const manifest of site.listPages(locale)) {
|
|
79
|
-
// Get the localized data for pathname/title
|
|
80
|
-
const localeData = manifest.locales[locale];
|
|
81
|
-
if (!localeData) continue;
|
|
82
|
-
|
|
83
|
-
const pathname = localeData.pathname || '/' + manifest.id.replace(/^index$/, '');
|
|
84
|
-
|
|
85
|
-
// Collection resolution: explicit collection in manifest, or default 'pages'
|
|
86
|
-
const resolvedCollection = manifest.collection || 'pages';
|
|
87
|
-
|
|
88
|
-
// Filter by requested collection
|
|
89
|
-
if (collection && resolvedCollection !== collection) continue;
|
|
90
|
-
|
|
91
|
-
pages.push({
|
|
92
|
-
id: manifest.id,
|
|
93
|
-
pathname: pathname,
|
|
94
|
-
title: localeData.meta?.title || manifest.id,
|
|
95
|
-
collection: resolvedCollection,
|
|
96
|
-
meta: localeData.meta || {},
|
|
97
|
-
timestamps: {
|
|
98
|
-
created: localeData.created,
|
|
99
|
-
modified: localeData.modified,
|
|
100
|
-
},
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return pages;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Get pages matching a path prefix.
|
|
109
|
-
* @param prefix - Path prefix to match (e.g., '/blog/')
|
|
110
|
-
* @param options - Optional sort and limit settings
|
|
111
|
-
* @returns Array of PageReference objects
|
|
112
|
-
*/
|
|
113
|
-
export async function getPagesByPrefix(prefix, options = {}) {
|
|
114
|
-
const allPages = await getAllPages();
|
|
115
|
-
|
|
116
|
-
let filtered = allPages.filter(page =>
|
|
117
|
-
page.pathname.startsWith(prefix) &&
|
|
118
|
-
page.pathname !== prefix && // Exclude the listing page itself
|
|
119
|
-
page.pathname !== prefix.slice(0, -1) // Exclude without trailing slash
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
// Sort by date (newest first by default)
|
|
123
|
-
if (options.sort === 'date-desc' || !options.sort) {
|
|
124
|
-
filtered.sort((a, b) => {
|
|
125
|
-
const dateA = a.timestamps?.modified || a.timestamps?.created || new Date(0);
|
|
126
|
-
const dateB = b.timestamps?.modified || b.timestamps?.created || new Date(0);
|
|
127
|
-
return new Date(dateB).getTime() - new Date(dateA).getTime();
|
|
128
|
-
});
|
|
129
|
-
} else if (options.sort === 'date-asc') {
|
|
130
|
-
filtered.sort((a, b) => {
|
|
131
|
-
const dateA = a.timestamps?.modified || a.timestamps?.created || new Date(0);
|
|
132
|
-
const dateB = b.timestamps?.modified || b.timestamps?.created || new Date(0);
|
|
133
|
-
return new Date(dateA).getTime() - new Date(dateB).getTime();
|
|
134
|
-
});
|
|
135
|
-
} else if (options.sort === 'title') {
|
|
136
|
-
filtered.sort((a, b) => (a.title || '').localeCompare(b.title || ''));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (options.limit && options.limit > 0) {
|
|
140
|
-
filtered = filtered.slice(0, options.limit);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return filtered;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Load full page data for rendering.
|
|
148
|
-
* @param pathname - URL pathname (e.g., '/about')
|
|
149
|
-
* @param collection - Optional collection to search in
|
|
150
|
-
*/
|
|
151
|
-
export async function getPage(pathname, collection) {
|
|
152
|
-
// Use site.getByPathname which returns ContentManifest (metadata only)
|
|
153
|
-
const manifest = site.getByPathname(pathname, locale);
|
|
154
|
-
|
|
155
|
-
if (!manifest) {
|
|
156
|
-
const error = new Error(\`Page not found: \${pathname}\`);
|
|
157
|
-
error.code = 'PAGE_NOT_FOUND';
|
|
158
|
-
throw error;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// Optionally filter by collection
|
|
162
|
-
if (collection && manifest.collection !== collection) {
|
|
163
|
-
const error = new Error(\`Page not found: \${pathname}\`);
|
|
164
|
-
error.code = 'PAGE_NOT_FOUND';
|
|
165
|
-
throw error;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Get the full content with locale data
|
|
169
|
-
const content = await contentApi.getLocalized(manifest.id, locale);
|
|
170
|
-
|
|
171
|
-
if (!content) {
|
|
172
|
-
const error = new Error(\`Page not found: \${pathname}\`);
|
|
173
|
-
error.code = 'PAGE_NOT_FOUND';
|
|
174
|
-
throw error;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const localeData = content.localized;
|
|
178
|
-
const meta = localeData.meta || {};
|
|
179
|
-
|
|
180
|
-
return {
|
|
181
|
-
id: manifest.id,
|
|
182
|
-
title: meta.title || manifest.id,
|
|
183
|
-
description: meta.description,
|
|
184
|
-
pathname: pathname,
|
|
185
|
-
puckData: localeData.content?.puckData,
|
|
186
|
-
collection: manifest.collection || collection || 'pages',
|
|
187
|
-
route: {
|
|
188
|
-
name: 'pages', // Will be set by caller
|
|
189
|
-
pattern: '/[...slug]',
|
|
190
|
-
meta: {},
|
|
191
|
-
},
|
|
192
|
-
meta: meta,
|
|
193
|
-
timestamps: {
|
|
194
|
-
created: localeData.created,
|
|
195
|
-
modified: localeData.modified,
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Check if a page exists without loading full data.
|
|
202
|
-
* @param pathname - URL pathname
|
|
203
|
-
* @param collection - Optional collection filter
|
|
204
|
-
*/
|
|
205
|
-
export function pageExists(pathname, collection) {
|
|
206
|
-
// getByPathname is synchronous - returns ContentManifest | null
|
|
207
|
-
const manifest = site.getByPathname(pathname, locale);
|
|
208
|
-
|
|
209
|
-
if (!manifest) {
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
// If collection filter specified, verify it matches
|
|
214
|
-
if (collection && manifest.collection !== collection) {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return true;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Get all entries from a data collection.
|
|
223
|
-
* @param collection - Data collection name
|
|
224
|
-
* @param localeOverride - Optional locale override (defaults to configured locale)
|
|
225
|
-
* @returns Array of DataCollectionEntry objects
|
|
226
|
-
*/
|
|
227
|
-
export async function getDataCollection(collection, localeOverride) {
|
|
228
|
-
const targetLocale = localeOverride || locale;
|
|
229
|
-
const entries = [];
|
|
230
|
-
|
|
231
|
-
// List all manifests in the collection
|
|
232
|
-
for (const manifest of contentApi.data.listContent({ collection })) {
|
|
233
|
-
// Get localized data for each entry
|
|
234
|
-
const localized = await contentApi.getLocalized(manifest.id, targetLocale);
|
|
235
|
-
if (localized) {
|
|
236
|
-
entries.push({
|
|
237
|
-
id: manifest.id,
|
|
238
|
-
name: manifest.name,
|
|
239
|
-
data: localized.content?.data || {},
|
|
240
|
-
meta: manifest.meta || {},
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return entries;
|
|
246
|
-
}
|
|
247
|
-
`;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Generate the virtual:conloca-puck-config module.
|
|
251
|
-
*
|
|
252
|
-
* Returns a module that re-exports the Puck configuration.
|
|
253
|
-
* This is separate from the HMR-enabled puck-entry.js used by the CMS SPA.
|
|
254
|
-
*
|
|
255
|
-
* @param puckConfigPath - Path to the puck config module
|
|
256
|
-
* @returns JavaScript module code as a string
|
|
257
|
-
*/
|
|
258
|
-
export function generatePuckConfigModule(puckConfigPath) {
|
|
259
|
-
// Convert relative path to absolute for Vite resolution
|
|
260
|
-
// ./src/... -> /src/...
|
|
261
|
-
const absolutePath = puckConfigPath.startsWith('.') ? `/${puckConfigPath.slice(2)}` : puckConfigPath;
|
|
262
|
-
return `export { default } from '${absolutePath}';`;
|
|
263
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withHydration.d.ts","sourceRoot":"","sources":["../../../src/lib/withHydration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;IACtC,cAAc,EAAE,IAAI,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,CAAC,SAAS,EACrE,SAAS,EAAE,CAAC,EACZ,QAAQ,EAAE,qBAAqB,GAC9B,CAAC,CAeH"}
|
package/dist/src/loader.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Loader } from 'astro/loaders';
|
|
2
|
-
export interface ConlocaLoaderOptions {
|
|
3
|
-
collection?: string;
|
|
4
|
-
contentRoot: string;
|
|
5
|
-
site?: string;
|
|
6
|
-
/** Collection kind. If not provided, defaults to 'block' for 'blocks' collection, 'page' otherwise. */
|
|
7
|
-
kind?: 'page' | 'block' | 'data';
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Custom Astro content loader for Conloca CMS.
|
|
11
|
-
* Loads content from the Conloca content directory into Astro collections.
|
|
12
|
-
*/
|
|
13
|
-
export declare function conlocaLoader(options: ConlocaLoaderOptions): Loader;
|
|
14
|
-
//# sourceMappingURL=loader.d.ts.map
|
package/dist/src/loader.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/loader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAiB,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uGAAuG;IACvG,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,MAAM,CAgGnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locales-helpers.d.ts","sourceRoot":"","sources":["../../src/locales-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,aAAa,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE,GAAG,cAAc,CAKjB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC7D,GAAG,cAAc,CAOjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mime-types.d.ts","sourceRoot":"","sources":["../../src/mime-types.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAiBjD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"path-validation.d.ts","sourceRoot":"","sources":["../../src/path-validation.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAI9E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-spa.d.ts","sourceRoot":"","sources":["../../src/plugin-spa.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAK9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAgC3D,OAAO,KAAK,EAAyB,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAgC5F,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;IACnE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc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M,GAAG,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-wrapper-endpoint.d.ts","sourceRoot":"","sources":["../../../src/site-styles/content-wrapper-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,sEAAsE;AACtE,KAAK,kBAAkB,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAE7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,kBAAkB;IACjC,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB;;;kBAGc;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC;;kEAE8D;IAC9D,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACnC;;;;oDAIgD;IAChD,SAAS,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC;CACxC;AAED,wBAAgB,4BAA4B,IAAI,kBAAkB,CA+BjE;AAuCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAwEnE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"render-endpoint.d.ts","sourceRoot":"","sources":["../../../src/site-styles/render-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAGjE;;sEAEsE;AACtE,KAAK,kBAAkB,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAE7G,oEAAoE;AACpE,UAAU,eAAe;IACvB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC9D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,eAAe,EACvB,iBAAiB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC5C,kBAAkB,CA4FpB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles-endpoint.d.ts","sourceRoot":"","sources":["../../../src/site-styles/styles-endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,sEAAsE;AACtE,KAAK,kBAAkB,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAE7G;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,oBAAoB,IAAI,kBAAkB,CAgDzD;AAED,UAAU,eAAe;IACvB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CA2C5B"}
|
package/dist/src/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAA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Y;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2CK;;;;;;;;;EASf;;;;;;;;;;;;;;;EAgBA,SAAS,eAAe;;;;;;;;;;;;EAaxB;;;;;;;;;;;;EAaA;;;;;;;;;;;;;;;;;;;;EAqBA;;;;;;;;;;;;;;;;;;;;EAqBA;;;;;;;;;;;;;;;KAgBU,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqC1B;;;;;;;;;;;;;;;EAef;;;;;;;;;;;;;;;;EAiBA;;;;;;;;;;;;;;;;;EAkBA;;;;;;;;;;;;;;;;;;;EAoBA;;;;;;;;;EAUA,OAAO;;;;;;;;;;;;;;;;;EAkBP,eAAe;;;;;;;;;;;;;UAcA;;;;;;EAMf;;;;;;;;;;;EAYA;;;;;;;;EASA;;;;;;;;;EAUA;;;;;;;;;;;EAYA,UAAU;;;;;;EAOV;;;;;;;EAQA;;;;;IAKE;;;;IAKA;;;;IAKA,OAAO;;;;;;;;EAST,OAAO;;;;EAKP;;;;IAIE,UAAU;;;;IAKV,WAAW;;;;IAKX,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoDC;;;;EAIf;;;;EAKA;;;;;;;EAQA;;;;;;;;UAiBe;EACf;EACA,QAAQ,eAAe,SAAS;EAChC;EACA;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;UA6Be;;;;;;;;;;EAUf;;;;;;;EAQA;;;;;;;;;;;;;;;;;;;;;EAsBA;;;;;;;;;IASE;;;;;;IAOA;;;;;;;;;;IAWA;;;;;;;;;;;;;;;;;;;;;;UA0Ba;;;;;EAKf;;;;;;EAOA;;;;;;EAOA;;;;EAKA"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//#region src/lib/withHydration.ts
|
|
2
|
-
/**
|
|
3
|
-
* Marks a component's render function for client-side hydration.
|
|
4
|
-
*
|
|
5
|
-
* This wrapper attaches metadata to the component function, enabling:
|
|
6
|
-
* 1. Build-time discovery via static analysis of source files
|
|
7
|
-
* 2. Runtime hydration strategy determination
|
|
8
|
-
*
|
|
9
|
-
* The wrapper does NOT create a new component or add runtime overhead.
|
|
10
|
-
* It simply attaches a `__hydration` property to the existing function.
|
|
11
|
-
*
|
|
12
|
-
* **Constraint:** Hydratable components must not use `puck.renderDropZone`,
|
|
13
|
-
* `puck.isEditing`, or `puck.metadata` — the `puck` prop is stripped during
|
|
14
|
-
* serialization and not available at hydration time.
|
|
15
|
-
*
|
|
16
|
-
* @param Component - The React component to mark for hydration
|
|
17
|
-
* @param strategy - When to hydrate: 'load', 'visible', or 'idle'
|
|
18
|
-
* @returns The same component with hydration metadata attached
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```tsx
|
|
22
|
-
* // In a Puck component file (e.g., TestimonialGrid.tsx)
|
|
23
|
-
* import { withHydration } from '@conloca/astro-cms'
|
|
24
|
-
*
|
|
25
|
-
* const TestimonialGridComponent = ({ title, testimonials }) => {
|
|
26
|
-
* const [currentPage, setCurrentPage] = useState(0)
|
|
27
|
-
* // ... interactive logic
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* export const TestimonialGrid: ComponentConfig<Props> = {
|
|
31
|
-
* fields: { ... },
|
|
32
|
-
* defaultProps: { ... },
|
|
33
|
-
* render: withHydration(TestimonialGridComponent, 'visible'),
|
|
34
|
-
* }
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
function withHydration(Component, strategy) {
|
|
38
|
-
if (typeof process !== "undefined" && process.env?.CONLOCA_DISABLE_HYDRATION === "true") return Component;
|
|
39
|
-
const HydratableComponent = Component;
|
|
40
|
-
HydratableComponent.__hydration = {
|
|
41
|
-
strategy,
|
|
42
|
-
__isHydratable: true
|
|
43
|
-
};
|
|
44
|
-
return HydratableComponent;
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { withHydration as t };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=withHydration-C256ox_6.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withHydration-C256ox_6.mjs","names":[],"sources":["../src/lib/withHydration.ts"],"sourcesContent":["import type React from 'react';\n\n/**\n * Metadata attached to components marked for hydration.\n * Used by the build-time scanner and runtime hydration system.\n */\nexport interface HydrationMeta {\n strategy: 'load' | 'visible' | 'idle';\n __isHydratable: true;\n}\n\n/**\n * Hydration strategy for the withHydration wrapper.\n * Does not include 'none' since wrapping implies hydration is desired.\n */\nexport type WithHydrationStrategy = 'load' | 'visible' | 'idle';\n\n/**\n * Marks a component's render function for client-side hydration.\n *\n * This wrapper attaches metadata to the component function, enabling:\n * 1. Build-time discovery via static analysis of source files\n * 2. Runtime hydration strategy determination\n *\n * The wrapper does NOT create a new component or add runtime overhead.\n * It simply attaches a `__hydration` property to the existing function.\n *\n * **Constraint:** Hydratable components must not use `puck.renderDropZone`,\n * `puck.isEditing`, or `puck.metadata` — the `puck` prop is stripped during\n * serialization and not available at hydration time.\n *\n * @param Component - The React component to mark for hydration\n * @param strategy - When to hydrate: 'load', 'visible', or 'idle'\n * @returns The same component with hydration metadata attached\n *\n * @example\n * ```tsx\n * // In a Puck component file (e.g., TestimonialGrid.tsx)\n * import { withHydration } from '@conloca/astro-cms'\n *\n * const TestimonialGridComponent = ({ title, testimonials }) => {\n * const [currentPage, setCurrentPage] = useState(0)\n * // ... interactive logic\n * }\n *\n * export const TestimonialGrid: ComponentConfig<Props> = {\n * fields: { ... },\n * defaultProps: { ... },\n * render: withHydration(TestimonialGridComponent, 'visible'),\n * }\n * ```\n */\nexport function withHydration<T extends (props: any) => React.ReactNode>(\n Component: T,\n strategy: WithHydrationStrategy,\n): T {\n // Environment variable escape hatch for debugging\n if (typeof process !== 'undefined' && process.env?.CONLOCA_DISABLE_HYDRATION === 'true') {\n return Component;\n }\n\n // Attach metadata directly to the function object\n // This avoids creating a wrapper component and keeps bundle size minimal\n const HydratableComponent = Component as T & { __hydration: HydrationMeta };\n HydratableComponent.__hydration = {\n strategy,\n __isHydratable: true,\n };\n\n return HydratableComponent;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,cACd,WACA,UACG;CAEH,IAAI,OAAO,YAAY,eAAe,QAAQ,KAAK,8BAA8B,QAC/E,OAAO;CAKT,MAAM,sBAAsB;CAC5B,oBAAoB,cAAc;EAChC;EACA,gBAAgB;CAClB;CAEA,OAAO;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withHydration-DkKpkmzJ.d.mts","names":[],"sources":["../src/lib/withHydration.ts"],"mappings":";;;;;;UAMiB;EACf;EACA;;;;;;KAOU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCI,cAAc,WAAW,eAAe,MAAM,WAC5D,WAAW,GACX,UAAU,wBACT"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|