@conloca/astro-cms 0.1.15 → 0.1.16

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.
Files changed (160) hide show
  1. package/README.md +65 -5
  2. package/dist/collections-Bd7EME4b.mjs +129 -0
  3. package/dist/collections-Bd7EME4b.mjs.map +1 -0
  4. package/dist/collections.d.mts +0 -1
  5. package/dist/collections.d.mts.map +1 -1
  6. package/dist/collections.mjs +1 -64
  7. package/dist/components.d.mts +2 -7
  8. package/dist/components.d.mts.map +1 -1
  9. package/dist/components.mjs +3 -6
  10. package/dist/components.mjs.map +1 -1
  11. package/dist/hydration.d.mts +2 -2
  12. package/dist/hydration.mjs +2 -3
  13. package/dist/index.d.mts +6 -37
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +7 -6
  16. package/dist/index.mjs.map +1 -1
  17. package/dist/internal/cms-handler.d.mts +0 -1
  18. package/dist/internal/cms-handler.d.mts.map +1 -1
  19. package/dist/internal/cms-handler.mjs +55 -8
  20. package/dist/internal/cms-handler.mjs.map +1 -1
  21. package/dist/lib/hydration-script.d.mts +1 -2
  22. package/dist/lib/hydration-script.d.mts.map +1 -1
  23. package/dist/lib/hydration-script.mjs +1 -2
  24. package/dist/lib/hydration-script.mjs.map +1 -1
  25. package/dist/locales-helpers-BvYYqnJ5.d.mts +64 -0
  26. package/dist/locales-helpers-BvYYqnJ5.d.mts.map +1 -0
  27. package/dist/locales-helpers-qiwh7nxS.mjs +54 -0
  28. package/dist/locales-helpers-qiwh7nxS.mjs.map +1 -0
  29. package/dist/node/content.d.mts +0 -1
  30. package/dist/node/content.d.mts.map +1 -1
  31. package/dist/node/content.d.ts +3 -0
  32. package/dist/node/content.d.ts.map +1 -0
  33. package/dist/node/content.js +2 -0
  34. package/dist/node/content.mjs +2 -4
  35. package/dist/node/index.d.mts +151 -3
  36. package/dist/node/index.d.mts.map +1 -1
  37. package/dist/node/index.d.ts +4 -0
  38. package/dist/node/index.d.ts.map +1 -0
  39. package/dist/node/index.js +3 -0
  40. package/dist/node/index.mjs +1857 -97
  41. package/dist/node/index.mjs.map +1 -1
  42. package/dist/{serialize-props-Dhv_MnkY.mjs → serialize-props-BHoNpzH6.mjs} +2 -3
  43. package/dist/{serialize-props-Dhv_MnkY.mjs.map → serialize-props-BHoNpzH6.mjs.map} +1 -1
  44. package/dist/src/cms-handler.d.ts +19 -0
  45. package/dist/src/cms-handler.d.ts.map +1 -0
  46. package/dist/src/cms-handler.js +366 -0
  47. package/dist/src/collections.d.ts +32 -0
  48. package/dist/src/collections.d.ts.map +1 -0
  49. package/dist/src/collections.js +50 -0
  50. package/dist/src/components/HydrationWrapper.d.ts +18 -0
  51. package/dist/src/components/HydrationWrapper.d.ts.map +1 -0
  52. package/dist/src/components/HydrationWrapper.js +21 -0
  53. package/dist/src/components/RenderWithBlocks.d.ts +23 -0
  54. package/dist/src/components/RenderWithBlocks.d.ts.map +1 -0
  55. package/dist/src/components/RenderWithBlocks.js +129 -0
  56. package/dist/src/components/RenderWithHydration.d.ts +17 -0
  57. package/dist/src/components/RenderWithHydration.d.ts.map +1 -0
  58. package/dist/src/components/RenderWithHydration.js +36 -0
  59. package/dist/src/components.d.ts +4 -0
  60. package/dist/src/components.d.ts.map +1 -0
  61. package/dist/src/components.js +3 -0
  62. package/dist/src/discovery/astro-frontmatter.d.ts +18 -0
  63. package/dist/src/discovery/astro-frontmatter.d.ts.map +1 -0
  64. package/dist/src/discovery/astro-frontmatter.js +24 -0
  65. package/dist/src/discovery/extract-props-ts.d.ts +41 -0
  66. package/dist/src/discovery/extract-props-ts.d.ts.map +1 -0
  67. package/dist/src/discovery/extract-props-ts.js +231 -0
  68. package/dist/src/discovery/merge-registry.d.ts +58 -0
  69. package/dist/src/discovery/merge-registry.d.ts.map +1 -0
  70. package/dist/src/discovery/merge-registry.js +332 -0
  71. package/dist/src/discovery/registry-endpoint.d.ts +42 -0
  72. package/dist/src/discovery/registry-endpoint.d.ts.map +1 -0
  73. package/dist/src/discovery/registry-endpoint.js +81 -0
  74. package/dist/src/discovery/scan-components.d.ts +98 -0
  75. package/dist/src/discovery/scan-components.d.ts.map +1 -0
  76. package/dist/src/discovery/scan-components.js +399 -0
  77. package/dist/src/discovery/scan-mdx.d.ts +63 -0
  78. package/dist/src/discovery/scan-mdx.d.ts.map +1 -0
  79. package/dist/src/discovery/scan-mdx.js +112 -0
  80. package/dist/src/discovery/scan-overrides.d.ts +71 -0
  81. package/dist/src/discovery/scan-overrides.d.ts.map +1 -0
  82. package/dist/src/discovery/scan-overrides.js +33 -0
  83. package/dist/src/hydration.d.ts +4 -0
  84. package/dist/src/hydration.d.ts.map +1 -0
  85. package/dist/src/hydration.js +4 -0
  86. package/dist/src/index.d.ts +11 -0
  87. package/dist/src/index.d.ts.map +1 -0
  88. package/dist/src/index.js +25 -0
  89. package/dist/src/lib/hydration-scanner.d.ts +47 -0
  90. package/dist/src/lib/hydration-scanner.d.ts.map +1 -0
  91. package/dist/src/lib/hydration-scanner.js +135 -0
  92. package/dist/src/lib/hydration-script.d.ts +28 -0
  93. package/dist/src/lib/hydration-script.d.ts.map +1 -0
  94. package/dist/src/lib/hydration-script.js +88 -0
  95. package/dist/src/lib/hydration-utils.d.ts +51 -0
  96. package/dist/src/lib/hydration-utils.d.ts.map +1 -0
  97. package/dist/src/lib/hydration-utils.js +83 -0
  98. package/dist/src/lib/page-api.d.ts +77 -0
  99. package/dist/src/lib/page-api.d.ts.map +1 -0
  100. package/dist/src/lib/page-api.js +121 -0
  101. package/dist/src/lib/route-utils.d.ts +41 -0
  102. package/dist/src/lib/route-utils.d.ts.map +1 -0
  103. package/dist/src/lib/route-utils.js +78 -0
  104. package/dist/src/lib/routing-config.d.ts +32 -0
  105. package/dist/src/lib/routing-config.d.ts.map +1 -0
  106. package/dist/src/lib/routing-config.js +93 -0
  107. package/dist/src/lib/serialize-props.d.ts +6 -0
  108. package/dist/src/lib/serialize-props.d.ts.map +1 -0
  109. package/dist/src/lib/serialize-props.js +7 -0
  110. package/dist/src/lib/virtual-module-generators.d.ts +57 -0
  111. package/dist/src/lib/virtual-module-generators.d.ts.map +1 -0
  112. package/dist/src/lib/virtual-module-generators.js +263 -0
  113. package/dist/src/lib/withHydration.d.ts +51 -0
  114. package/dist/src/lib/withHydration.d.ts.map +1 -0
  115. package/dist/src/lib/withHydration.js +49 -0
  116. package/dist/src/loader.d.ts +14 -0
  117. package/dist/src/loader.d.ts.map +1 -0
  118. package/dist/src/loader.js +89 -0
  119. package/dist/src/locales-helpers.d.ts +61 -0
  120. package/dist/src/locales-helpers.d.ts.map +1 -0
  121. package/dist/src/locales-helpers.js +49 -0
  122. package/dist/src/mime-types.d.ts +3 -0
  123. package/dist/src/mime-types.d.ts.map +1 -0
  124. package/dist/src/mime-types.js +19 -0
  125. package/dist/src/path-validation.d.ts +8 -0
  126. package/dist/src/path-validation.d.ts.map +1 -0
  127. package/dist/src/path-validation.js +12 -0
  128. package/dist/src/plugin-spa.d.ts +164 -0
  129. package/dist/src/plugin-spa.d.ts.map +1 -0
  130. package/dist/src/plugin-spa.js +972 -0
  131. package/dist/src/safe-json-stringify.d.ts +13 -0
  132. package/dist/src/safe-json-stringify.d.ts.map +1 -0
  133. package/dist/src/safe-json-stringify.js +6 -0
  134. package/dist/src/site-styles/content-wrapper-endpoint.d.ts +76 -0
  135. package/dist/src/site-styles/content-wrapper-endpoint.d.ts.map +1 -0
  136. package/dist/src/site-styles/content-wrapper-endpoint.js +227 -0
  137. package/dist/src/site-styles/render-endpoint.d.ts +55 -0
  138. package/dist/src/site-styles/render-endpoint.d.ts.map +1 -0
  139. package/dist/src/site-styles/render-endpoint.js +263 -0
  140. package/dist/src/site-styles/styles-endpoint.d.ts +61 -0
  141. package/dist/src/site-styles/styles-endpoint.d.ts.map +1 -0
  142. package/dist/src/site-styles/styles-endpoint.js +158 -0
  143. package/dist/src/types.d.ts +627 -0
  144. package/dist/src/types.d.ts.map +1 -0
  145. package/dist/src/types.js +1 -0
  146. package/dist/{types-CVQNmPxF.d.mts → types-CS9neadI.d.mts} +193 -3
  147. package/dist/types-CS9neadI.d.mts.map +1 -0
  148. package/dist/virtual-modules.d.ts +155 -0
  149. package/dist/{withHydration-EzyzBQ-Y.mjs → withHydration-C256ox_6.mjs} +2 -2
  150. package/dist/{withHydration-EzyzBQ-Y.mjs.map → withHydration-C256ox_6.mjs.map} +1 -1
  151. package/dist/{withHydration-HIvO9ysY.d.mts → withHydration-DkKpkmzJ.d.mts} +1 -2
  152. package/dist/withHydration-DkKpkmzJ.d.mts.map +1 -0
  153. package/package.json +82 -26
  154. package/dist/collections.mjs.map +0 -1
  155. package/dist/hydration-scanner-B0NjYkZ_.mjs +0 -109
  156. package/dist/hydration-scanner-B0NjYkZ_.mjs.map +0 -1
  157. package/dist/loader-By-AQWHc.mjs +0 -68
  158. package/dist/loader-By-AQWHc.mjs.map +0 -1
  159. package/dist/types-CVQNmPxF.d.mts.map +0 -1
  160. package/dist/withHydration-HIvO9ysY.d.mts.map +0 -1
package/README.md CHANGED
@@ -5,6 +5,61 @@ managing content using Puck's drag-and-drop editor, allowing developers to creat
5
5
  maintaining full control over their content structure. The CMS integrates seamlessly into your Astro development
6
6
  workflow, accessible at `/__cms` routes without requiring authentication or complex setup.
7
7
 
8
+ ## MDX component registry
9
+
10
+ Hosts can register JSX components (their own, or third-party ones like Starlight's `<Steps>`, `<Tabs>`, `<Card>`) with
11
+ the MDX editor so authors get typed insert affordances and optional auto-import injection. The registry is wired through
12
+ the same `schemasPath` option that already loads `pageSchemas` — add an `mdxComponents` export to the file and the CMS
13
+ picks it up at boot (and on HMR).
14
+
15
+ ```ts
16
+ // src/schemas.ts
17
+ import { defineMdxComponents } from '@conloca/astro-cms';
18
+
19
+ export const pageSchemas = {
20
+ /* existing entries */
21
+ };
22
+
23
+ export const mdxComponents = defineMdxComponents([
24
+ {
25
+ name: 'Steps',
26
+ kind: 'flow',
27
+ hasChildren: true,
28
+ insert: { label: 'Steps', description: 'Numbered step-by-step list', icon: 'list-ordered' },
29
+ defaults: { children: '1. First step\n2. Second step\n3. Third step' },
30
+ import: { from: '@astrojs/starlight/components' },
31
+ },
32
+ // …other components your site uses
33
+ ]);
34
+ ```
35
+
36
+ Starlight components are declared the same way as any other component — the CMS does not ship Starlight descriptors.
37
+ Copy the props you need from each component's source (e.g.
38
+ `node_modules/@astrojs/starlight/user-components/<Component>.astro`).
39
+
40
+ In the editor, registered components appear in two places:
41
+
42
+ - A slash menu, opened by typing `/` in the body. Filter by name, label, description, or keywords.
43
+ - A toolbar dropdown next to the admonition button, listing block-level (`kind: 'flow'`) components.
44
+
45
+ ### Auto-import injection (and its pruning caveat)
46
+
47
+ Setting `import: { from: '<module>' }` on a descriptor opts the component into automatic import injection: whenever the
48
+ component appears in the document, the CMS save serializer emits the matching `import { Name } from '<module>'` line at
49
+ the top of the file (after frontmatter).
50
+
51
+ **Important: the editor rebuilds the import block on every save from components actually referenced in the tree.**
52
+ Imports for unused components are dropped. So are non-JSX imports — type imports, side-effect imports
53
+ (`import './styles.css'`), and helper-function imports — because the editor does not consider them "referred to" by a
54
+ JSX node. This is a hard constraint of the underlying `@mdxeditor/editor` export pipeline
55
+ ([`exportMarkdownFromLexical.js:98-148`](../../node_modules/@mdxeditor/editor/dist/exportMarkdownFromLexical.js)), not a
56
+ policy choice.
57
+
58
+ For Starlight-flavored docs (where MDX only imports Starlight components from `@astrojs/starlight/components`) the
59
+ behavior matches authorial intent — imports follow usage. For richer MDX that relies on type or side-effect imports,
60
+ edit those files in your IDE rather than the CMS, or omit `import.from` from your descriptors so the editor does not
61
+ claim ownership of the import line.
62
+
8
63
  ## How Astro Integrations Are Built
9
64
 
10
65
  Based on research of official Astro integrations:
@@ -131,12 +186,14 @@ React:
131
186
 
132
187
  ### How .astro Components Work
133
188
 
134
- 1. **Compilation Process** ([astro/packages/astro/src/vite-plugin-astro/compile.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-astro/compile.ts)):
189
+ 1. **Compilation Process**
190
+ ([astro/packages/astro/src/vite-plugin-astro/compile.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-astro/compile.ts)):
135
191
  - .astro files are transformed by `@astrojs/compiler` into TypeScript/JavaScript
136
192
  - The output is an `AstroComponentFactory` function, not a React component
137
193
  - Components include metadata for hydration, slots, and server-side rendering
138
194
 
139
- 2. **Component Factory Structure** ([astro/packages/astro/src/runtime/server/render/astro/factory.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/runtime/server/render/astro/factory.ts)):
195
+ 2. **Component Factory Structure**
196
+ ([astro/packages/astro/src/runtime/server/render/astro/factory.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/runtime/server/render/astro/factory.ts)):
140
197
 
141
198
  ```typescript
142
199
  interface AstroComponentFactory {
@@ -147,7 +204,8 @@ React:
147
204
  }
148
205
  ```
149
206
 
150
- 3. **Container API** ([astro/packages/astro/src/container/index.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/container/index.ts)):
207
+ 3. **Container API**
208
+ ([astro/packages/astro/src/container/index.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/container/index.ts)):
151
209
  - Provides `experimental_AstroContainer` for programmatic rendering
152
210
  - Can render .astro components to HTML strings via `renderToString()`
153
211
  - Server-side only - returns static HTML, not React components
@@ -243,12 +301,14 @@ which can also be used in Astro pages via the React integration.
243
301
 
244
302
  Based on analysis of the Astro source code:
245
303
 
246
- 1. **Compilation Pipeline** ([astro/packages/astro/src/vite-plugin-astro/index.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-astro/index.ts)):
304
+ 1. **Compilation Pipeline**
305
+ ([astro/packages/astro/src/vite-plugin-astro/index.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-astro/index.ts)):
247
306
  - `@astrojs/compiler` transforms .astro files into JavaScript
248
307
  - `vite-plugin-astro` orchestrates this compilation
249
308
  - The plugin integrates with Vite's module system
250
309
 
251
- 2. **HMR Implementation** ([astro/packages/astro/src/vite-plugin-astro/hmr.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-astro/hmr.ts)):
310
+ 2. **HMR Implementation**
311
+ ([astro/packages/astro/src/vite-plugin-astro/hmr.ts](https://github.com/withastro/astro/blob/main/packages/astro/src/vite-plugin-astro/hmr.ts)):
252
312
  - Vite watches for file changes and triggers `handleHotUpdate`
253
313
  - Astro optimizes HMR for specific change types:
254
314
  - Style-only changes: Only CSS virtual modules are invalidated
@@ -0,0 +1,129 @@
1
+ import { blockMetaSchema, dataMetaSchema, pageMetaSchema } from "@conloca/content-api/schemas";
2
+ import { defineCollection } from "astro:content";
3
+ import { createContentAPI } from "@conloca/content-api/reader";
4
+ //#region src/loader.ts
5
+ /**
6
+ * Custom Astro content loader for Conloca CMS.
7
+ * Loads content from the Conloca content directory into Astro collections.
8
+ */
9
+ function conlocaLoader(options) {
10
+ return {
11
+ name: "conloca-loader",
12
+ async load(context) {
13
+ const { store, parseData, generateDigest, logger } = context;
14
+ const api = await createContentAPI({ contentRoot: options.contentRoot });
15
+ const kind = options.kind ?? (options.collection === "blocks" ? "block" : "page");
16
+ const content = Array.from(api.listAllContent({
17
+ collection: options.collection,
18
+ kind,
19
+ site: kind === "page" ? options.site : void 0
20
+ }));
21
+ store.clear();
22
+ for (const manifest of content) {
23
+ if (kind === "page" && manifest.type === "mdx") continue;
24
+ for (const [locale, localeVersion] of Object.entries(manifest.locales)) {
25
+ if (!localeVersion) continue;
26
+ const entryId = `${manifest.id}/${locale}`;
27
+ let dataContent;
28
+ let mdxContent;
29
+ let puckData;
30
+ if (kind === "data") {
31
+ const fullContent = await api.getLocalized(manifest.id, locale);
32
+ if (fullContent?.localized.content?.data) dataContent = fullContent.localized.content.data;
33
+ } else if (kind === "block") {
34
+ const fullContent = await api.getLocalized(manifest.id, locale);
35
+ if (fullContent?.localized.content?.mdx) mdxContent = fullContent.localized.content.mdx;
36
+ } else if (kind === "page") {
37
+ const fullContent = await api.getLocalized(manifest.id, locale);
38
+ if (fullContent?.localized.content?.puckData) puckData = fullContent.localized.content.puckData;
39
+ }
40
+ const data = {
41
+ id: manifest.id,
42
+ locale,
43
+ ...localeVersion.pathname && { pathname: localeVersion.pathname },
44
+ ...localeVersion.name && { name: localeVersion.name },
45
+ ...localeVersion.meta,
46
+ created: localeVersion.created,
47
+ modified: localeVersion.modified,
48
+ publishAt: localeVersion.publishAt,
49
+ unpublishAt: localeVersion.unpublishAt,
50
+ ...dataContent && { data: dataContent }
51
+ };
52
+ if (mdxContent !== void 0) data.mdx = mdxContent;
53
+ if (puckData !== void 0) data.puckData = puckData;
54
+ const parsedData = await parseData({
55
+ id: entryId,
56
+ data
57
+ });
58
+ store.set({
59
+ id: entryId,
60
+ data: parsedData,
61
+ digest: generateDigest(localeVersion.etag)
62
+ });
63
+ }
64
+ }
65
+ logger.info(`Loaded ${store.keys().length} entries from ${options.collection || `${kind} content`}`);
66
+ }
67
+ };
68
+ }
69
+ //#endregion
70
+ //#region src/collections.ts
71
+ const ALL_BLOCKS_COLLECTION = "__conloca_blocks";
72
+ /**
73
+ * Creates Astro Content Collections by discovering from indexed content.
74
+ * Uses content-api to find collections that have content.
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * // src/content.config.ts
79
+ * import { createConlocaCollections } from '@conloca/astro-cms/node/content';
80
+ *
81
+ * export const { collections } = await createConlocaCollections();
82
+ * ```
83
+ */
84
+ async function createConlocaCollections(options = {}) {
85
+ const { contentRoot = "./content", site = "default" } = options;
86
+ const api = await createContentAPI({ contentRoot });
87
+ const collections = {};
88
+ collections[ALL_BLOCKS_COLLECTION] = defineCollection({
89
+ loader: conlocaLoader({
90
+ contentRoot,
91
+ site,
92
+ kind: "block"
93
+ }),
94
+ schema: blockMetaSchema.passthrough()
95
+ });
96
+ for (const name of api.blocks.collections) collections[name] = defineCollection({
97
+ loader: conlocaLoader({
98
+ collection: name,
99
+ contentRoot,
100
+ site,
101
+ kind: "block"
102
+ }),
103
+ schema: blockMetaSchema.passthrough()
104
+ });
105
+ for (const name of api.data.collections) collections[name] = defineCollection({
106
+ loader: conlocaLoader({
107
+ collection: name,
108
+ contentRoot,
109
+ site,
110
+ kind: "data"
111
+ }),
112
+ schema: dataMetaSchema.passthrough()
113
+ });
114
+ const siteCollections = api.getSite(site)?.collections ?? /* @__PURE__ */ new Set();
115
+ for (const name of siteCollections) collections[name] = defineCollection({
116
+ loader: conlocaLoader({
117
+ collection: name,
118
+ contentRoot,
119
+ site,
120
+ kind: "page"
121
+ }),
122
+ schema: pageMetaSchema.passthrough()
123
+ });
124
+ return { collections };
125
+ }
126
+ //#endregion
127
+ export { createConlocaCollections as n, conlocaLoader as r, ALL_BLOCKS_COLLECTION as t };
128
+
129
+ //# sourceMappingURL=collections-Bd7EME4b.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections-Bd7EME4b.mjs","names":[],"sources":["../src/loader.ts","../src/collections.ts"],"sourcesContent":["import { createContentAPI } from '@conloca/content-api/reader';\nimport type { Loader, LoaderContext } from 'astro/loaders';\n\nexport interface ConlocaLoaderOptions {\n collection?: string;\n contentRoot: string;\n site?: string;\n /** Collection kind. If not provided, defaults to 'block' for 'blocks' collection, 'page' otherwise. */\n kind?: 'page' | 'block' | 'data';\n}\n\n/**\n * Custom Astro content loader for Conloca CMS.\n * Loads content from the Conloca content directory into Astro collections.\n */\nexport function conlocaLoader(options: ConlocaLoaderOptions): Loader {\n return {\n name: 'conloca-loader',\n async load(context: LoaderContext): Promise<void> {\n const { store, parseData, generateDigest, logger } = context;\n\n // Create content API instance\n const api = await createContentAPI({ contentRoot: options.contentRoot });\n\n // Use provided kind, or fall back to inferring from collection name\n const kind = options.kind ?? (options.collection === 'blocks' ? 'block' : 'page');\n\n // List all content for this collection\n // Note: blocks and data don't have a site, so only pass site for pages\n const content = Array.from(\n api.listAllContent({\n collection: options.collection,\n kind,\n site: kind === 'page' ? options.site : undefined,\n }),\n );\n\n store.clear();\n\n for (const manifest of content) {\n // Skip type:'mdx' pages — they're owned by an external renderer\n // (any Astro loader reading from a site's `mdxPages` path in\n // sites.json, such as Starlight's stock docsLoader) and would\n // otherwise collide with the puck-page route handler.\n if (kind === 'page' && manifest.type === 'mdx') continue;\n\n for (const [locale, localeVersion] of Object.entries(manifest.locales)) {\n if (!localeVersion) continue;\n\n const entryId = `${manifest.id}/${locale}`;\n\n // For data and page collections, fetch full content to get the actual content fields\n let dataContent: Record<string, unknown> | undefined;\n let mdxContent: string | undefined;\n let puckData: unknown | undefined;\n\n if (kind === 'data') {\n const fullContent = await api.getLocalized(manifest.id, locale);\n if (fullContent?.localized.content?.data) {\n dataContent = fullContent.localized.content.data;\n }\n } else if (kind === 'block') {\n const fullContent = await api.getLocalized(manifest.id, locale);\n if (fullContent?.localized.content?.mdx) {\n mdxContent = fullContent.localized.content.mdx;\n }\n } else if (kind === 'page') {\n // For page collections, fetch full content to get puckData\n // This enables getCollection('pages') to return entries with puckData included\n const fullContent = await api.getLocalized(manifest.id, locale);\n if (fullContent?.localized.content?.puckData) {\n puckData = fullContent.localized.content.puckData;\n }\n }\n\n const data: Record<string, unknown> = {\n id: manifest.id,\n locale,\n ...(localeVersion.pathname && { pathname: localeVersion.pathname }),\n ...(localeVersion.name && { name: localeVersion.name }),\n ...localeVersion.meta,\n created: localeVersion.created,\n modified: localeVersion.modified,\n publishAt: localeVersion.publishAt,\n unpublishAt: localeVersion.unpublishAt,\n // Include the data content for data collections\n ...(dataContent && { data: dataContent }),\n };\n\n if (mdxContent !== undefined) {\n data.mdx = mdxContent;\n }\n\n // Include puckData for page collections (added separately to avoid spread type issues)\n if (puckData !== undefined) {\n data.puckData = puckData;\n }\n\n const parsedData = await parseData({ id: entryId, data });\n\n store.set({\n id: entryId,\n data: parsedData,\n digest: generateDigest(localeVersion.etag),\n });\n }\n }\n\n logger.info(`Loaded ${store.keys().length} entries from ${options.collection || `${kind} content`}`);\n },\n };\n}\n","import { defineCollection } from 'astro:content';\nimport { createContentAPI } from '@conloca/content-api/reader';\nimport { blockMetaSchema, dataMetaSchema, pageMetaSchema } from '@conloca/content-api/schemas';\nimport { conlocaLoader } from './loader';\n\nexport const ALL_BLOCKS_COLLECTION = '__conloca_blocks';\n\n/**\n * Options for createConlocaCollections().\n */\nexport interface CreateConlocaCollectionsOptions {\n /** Path to content root directory. @default './content' */\n contentRoot?: string;\n /** Site name for multi-site setups. @default 'default' */\n site?: string;\n}\n\n/**\n * Return type of createConlocaCollections().\n */\nexport interface ConlocaCollectionsResult {\n /** Astro Content Collections definitions - export this as `collections` */\n collections: Record<string, ReturnType<typeof defineCollection>>;\n}\n\n/**\n * Creates Astro Content Collections by discovering from indexed content.\n * Uses content-api to find collections that have content.\n *\n * @example\n * ```typescript\n * // src/content.config.ts\n * import { createConlocaCollections } from '@conloca/astro-cms/node/content';\n *\n * export const { collections } = await createConlocaCollections();\n * ```\n */\nexport async function createConlocaCollections(\n options: CreateConlocaCollectionsOptions = {},\n): Promise<ConlocaCollectionsResult> {\n const { contentRoot = './content', site = 'default' } = options;\n\n const api = await createContentAPI({ contentRoot });\n const collections: Record<string, ReturnType<typeof defineCollection>> = {};\n\n collections[ALL_BLOCKS_COLLECTION] = defineCollection({\n loader: conlocaLoader({ contentRoot, site, kind: 'block' }),\n schema: blockMetaSchema.passthrough() as never,\n });\n\n // Add block collections\n for (const name of api.blocks.collections) {\n collections[name] = defineCollection({\n loader: conlocaLoader({ collection: name, contentRoot, site, kind: 'block' }),\n // Cast needed: Astro uses Zod v3 BaseSchema types, our schemas are Zod v4\n schema: blockMetaSchema.passthrough() as never,\n });\n }\n\n // Add data collections\n for (const name of api.data.collections) {\n collections[name] = defineCollection({\n loader: conlocaLoader({ collection: name, contentRoot, site, kind: 'data' }),\n schema: dataMetaSchema.passthrough() as never,\n });\n }\n\n // Add page collections for this site\n const siteCollections = api.getSite(site)?.collections ?? new Set<string>();\n for (const name of siteCollections) {\n collections[name] = defineCollection({\n loader: conlocaLoader({ collection: name, contentRoot, site, kind: 'page' }),\n schema: pageMetaSchema.passthrough() as never,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AC,EAAE,+BAAe,IAAI,IAAY;CAC1E,KAAK,MAAM,QAAQ,iBACjB,YAAY,QAAQ,iBAAiB;EACnC,QAAQ,cAAc;GAAE,YAAY;GAAM;GAAa;GAAM,MAAM;EAAO,CAAC;EAC3E,QAAQ,eAAe,YAAY;CACrC,CAAC;CAGH,OAAO,EAAE,YAAY;AACvB"}
@@ -1,5 +1,4 @@
1
1
  import { defineCollection } from "astro:content";
2
-
3
2
  //#region src/collections.d.ts
4
3
  declare const ALL_BLOCKS_COLLECTION = "__conloca_blocks";
5
4
  /**
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"collections.d.mts","names":[],"sources":["../src/collections.ts"],"mappings":";;cAKa;;;;UAKI;;EAEf;;EAEA;;;;;UAMe;;EAEf,aAAa,eAAe,kBAAkB;;;;;;;;;;;;;;iBAe1B,yBACpB,UAAS,kCACR,QAAQ"}
@@ -1,65 +1,2 @@
1
- import { t as conlocaLoader } from "./loader-By-AQWHc.mjs";
2
- import { blockMetaSchema, dataMetaSchema, pageMetaSchema } from "@conloca/content-api/schemas";
3
- import { defineCollection } from "astro:content";
4
- import { createContentAPI } from "@conloca/content-api/reader";
5
-
6
- //#region src/collections.ts
7
- const ALL_BLOCKS_COLLECTION = "__conloca_blocks";
8
- /**
9
- * Creates Astro Content Collections by discovering from indexed content.
10
- * Uses content-api to find collections that have content.
11
- *
12
- * @example
13
- * ```typescript
14
- * // src/content.config.ts
15
- * import { createConlocaCollections } from '@conloca/astro-cms/node/content';
16
- *
17
- * export const { collections } = await createConlocaCollections();
18
- * ```
19
- */
20
- async function createConlocaCollections(options = {}) {
21
- const { contentRoot = "./content", site = "default" } = options;
22
- const api = await createContentAPI({ contentRoot });
23
- const collections = {};
24
- collections[ALL_BLOCKS_COLLECTION] = defineCollection({
25
- loader: conlocaLoader({
26
- contentRoot,
27
- site,
28
- kind: "block"
29
- }),
30
- schema: blockMetaSchema.passthrough()
31
- });
32
- for (const name of api.blocks.collections) collections[name] = defineCollection({
33
- loader: conlocaLoader({
34
- collection: name,
35
- contentRoot,
36
- site,
37
- kind: "block"
38
- }),
39
- schema: blockMetaSchema.passthrough()
40
- });
41
- for (const name of api.data.collections) collections[name] = defineCollection({
42
- loader: conlocaLoader({
43
- collection: name,
44
- contentRoot,
45
- site,
46
- kind: "data"
47
- }),
48
- schema: dataMetaSchema.passthrough()
49
- });
50
- const siteCollections = api.getSite(site)?.collections ?? /* @__PURE__ */ new Set();
51
- for (const name of siteCollections) collections[name] = defineCollection({
52
- loader: conlocaLoader({
53
- collection: name,
54
- contentRoot,
55
- site,
56
- kind: "page"
57
- }),
58
- schema: pageMetaSchema.passthrough()
59
- });
60
- return { collections };
61
- }
62
-
63
- //#endregion
1
+ import { n as createConlocaCollections, t as ALL_BLOCKS_COLLECTION } from "./collections-Bd7EME4b.mjs";
64
2
  export { ALL_BLOCKS_COLLECTION, createConlocaCollections };
65
- //# sourceMappingURL=collections.mjs.map
@@ -1,8 +1,6 @@
1
1
  import { MDXBlockEvaluationResult, evaluateMDXBlocks } from "@conloca/mdx/node";
2
- import { Config, Data } from "@puckeditor/core";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
4
2
  import { ComponentType } from "react";
5
-
3
+ import { Config, Data } from "@puckeditor/core";
6
4
  //#region src/components/RenderWithBlocks.d.ts
7
5
  interface MDXComponent {
8
6
  id: string;
@@ -37,10 +35,7 @@ interface RenderWithHydrationProps {
37
35
  *
38
36
  * Non-hydratable components render without any wrapper overhead.
39
37
  */
40
- declare function RenderWithHydration({
41
- config,
42
- data
43
- }: RenderWithHydrationProps): react_jsx_runtime0.JSX.Element;
38
+ declare function RenderWithHydration({ config, data }: RenderWithHydrationProps): import("react/jsx-runtime").JSX.Element;
44
39
  //#endregion
45
40
  export { RenderWithHydration, createPageRendererWithBlocks, evaluateMDXBlocks };
46
41
  //# sourceMappingURL=components.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.mts","names":[],"sources":["../src/components/RenderWithBlocks.tsx","../src/components/RenderWithHydration.tsx"],"mappings":";;;;;;UAQU,YAAA;EACR,EAAA;EACA,KAAA;EACA,SAAA,EAAW,aAAA;AAAA;;;;;;;;;AAsMb;;;;iBAAgB,4BAAA,CACd,MAAA,EAAQ,MAAA,EACR,IAAA,EAAM,IAAA,EACN,aAAA,GAAgB,wBAAA,GAA2B,YAAA,MAC1C,aAAA;;;UChNO,wBAAA;EACR,MAAA,EAAQ,MAAA;EACR,IAAA,EAAM,IAAA;AAAA;;ADHmC;;;;;;;;iBCe3B,mBAAA,CAAA;EAAsB,MAAA;EAAQ;AAAA,GAAQ,wBAAA,GAAwB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"components.d.mts","names":[],"sources":["../src/components/RenderWithBlocks.tsx","../src/components/RenderWithHydration.tsx"],"mappings":";;;;UAQU;EACR;EACA;EACA,WAAW;;;;;;;;;;;;;;iBAsMG,6BACd,QAAQ,QACR,MAAM,MACN,gBAAgB,2BAA2B,kBAC1C;;;UChNO;EACR,QAAQ;EACR,MAAM;;;;;;;;;;;iBAYQ,sBAAsB,QAAQ,QAAQ,uDAAwB,IAAA"}
@@ -1,9 +1,8 @@
1
- import { i as isHydratable, r as hasHydratableComponents, t as serializeProps } from "./serialize-props-Dhv_MnkY.mjs";
1
+ import { i as isHydratable, r as hasHydratableComponents, t as serializeProps } from "./serialize-props-BHoNpzH6.mjs";
2
2
  import { evaluateMDXBlocks } from "@conloca/mdx/node";
3
- import { Render } from "@puckeditor/core";
3
+ import { Render } from "@puckeditor/core/rsc";
4
4
  import cn from "clsx";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
-
7
6
  //#region src/components/HydrationWrapper.tsx
8
7
  /**
9
8
  * Wraps hydratable components with data attributes for browser hydration.
@@ -23,7 +22,6 @@ function HydrationWrapper({ componentName, strategy, props, children }) {
23
22
  children
24
23
  });
25
24
  }
26
-
27
25
  //#endregion
28
26
  //#region src/components/RenderWithHydration.tsx
29
27
  /**
@@ -57,7 +55,6 @@ function RenderWithHydration({ config, data }) {
57
55
  data
58
56
  });
59
57
  }
60
-
61
58
  //#endregion
62
59
  //#region src/components/RenderWithBlocks.tsx
63
60
  function isRenderableBlock(block) {
@@ -220,7 +217,7 @@ function createPageRendererWithBlocks(config, data, mdxComponents) {
220
217
  });
221
218
  };
222
219
  }
223
-
224
220
  //#endregion
225
221
  export { RenderWithHydration, createPageRendererWithBlocks, evaluateMDXBlocks };
222
+
226
223
  //# sourceMappingURL=components.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.mjs","names":[],"sources":["../src/components/HydrationWrapper.tsx","../src/components/RenderWithHydration.tsx","../src/components/RenderWithBlocks.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { serializeProps } from '../lib/serialize-props.js';\nimport type { HydrationStrategy } from '../types.js';\n\ninterface HydrationWrapperProps {\n componentName: string;\n strategy: HydrationStrategy;\n props: Record<string, unknown>;\n children: ReactNode;\n}\n\n/**\n * Wraps hydratable components with data attributes for browser hydration.\n *\n * When strategy is 'none', renders children directly without wrapper overhead.\n * Otherwise, wraps in a div with data-hydrate attributes that the browser\n * hydration script uses to find and hydrate components.\n */\nexport function HydrationWrapper({ componentName, strategy, props, children }: HydrationWrapperProps) {\n // No hydration needed - render children directly without wrapper\n if (strategy === 'none') {\n return <>{children}</>;\n }\n\n // Strip Puck-internal props that aren't needed for hydration.\n // `puck` contains functions (renderDropZone) that can't survive JSON serialization\n // and would crash on hydration if a component called them.\n const { puck: _puck, ...hydrateProps } = props as Record<string, unknown> & { puck?: unknown };\n\n // Wrap with hydration markers for the browser script to find\n return (\n <div\n style={{ display: 'contents' }}\n data-hydrate={componentName}\n data-hydrate-strategy={strategy}\n data-props={serializeProps(hydrateProps)}\n >\n {children}\n </div>\n );\n}\n","import type { Config, Data } from '@puckeditor/core';\nimport { Render } from '@puckeditor/core';\nimport { isHydratable } from '../lib/hydration-utils.js';\nimport { HydrationWrapper } from './HydrationWrapper.js';\n\ninterface RenderWithHydrationProps {\n config: Config;\n data: Data;\n}\n\n/**\n * Wrapper around Puck's Render component that adds hydration support.\n *\n * For each component with a hydration strategy configured, wraps the\n * component's render output with HydrationWrapper to add data-hydrate\n * attributes for browser-side hydration.\n *\n * Non-hydratable components render without any wrapper overhead.\n */\nexport function RenderWithHydration({ config, data }: RenderWithHydrationProps) {\n // Create wrapped config with hydration-aware render functions\n const wrappedConfig: Config = {\n ...config,\n components: Object.fromEntries(\n Object.entries(config.components).map(([name, componentConfig]) => {\n const strategy = isHydratable(name, config);\n\n if (strategy === 'none') {\n // No wrapping needed - component stays static\n return [name, componentConfig];\n }\n\n // Wrap the render function so its output becomes HydrationWrapper children\n const originalRender = componentConfig.render;\n return [\n name,\n {\n ...componentConfig,\n render: (props) => (\n <HydrationWrapper componentName={name} strategy={strategy} props={props}>\n {originalRender(props)}\n </HydrationWrapper>\n ),\n },\n ];\n }),\n ),\n };\n\n return <Render config={wrappedConfig} data={data} />;\n}\n","import type { MDXBlockEvaluationResult } from '@conloca/mdx/node';\nimport type { ComponentConfig, Config, Data } from '@puckeditor/core';\nimport { Render } from '@puckeditor/core';\nimport cn from 'clsx';\nimport type { ComponentType } from 'react';\nimport { hasHydratableComponents } from '../lib/hydration-utils.js';\nimport { RenderWithHydration } from './RenderWithHydration.js';\n\ninterface MDXComponent {\n id: string;\n title: string;\n Component: ComponentType;\n}\n\nfunction isRenderableBlock(block: MDXBlockEvaluationResult | MDXComponent): block is MDXComponent {\n return 'Component' in block && !('ok' in block);\n}\n\ninterface RenderWithBlocksProps {\n config: Config;\n data: Data;\n mdxComponents: MDXComponent[];\n}\n\ninterface ContentBlockSectionProps {\n title?: string;\n subtitle?: string;\n label?: string;\n blockId: string;\n width?: 'narrow' | 'default';\n tone?: 'transparent' | 'subtle';\n}\n\nconst contentBlockWidthClasses: Record<NonNullable<ContentBlockSectionProps['width']>, string> = {\n narrow: 'max-w-3xl',\n default: 'max-w-4xl',\n};\n\nconst contentBlockToneClasses: Record<NonNullable<ContentBlockSectionProps['tone']>, string> = {\n transparent: '',\n subtle:\n 'rounded-3xl border border-surface-200/80 bg-surface-100/70 p-6 sm:p-8 dark:border-surface-800/60 dark:bg-surface-900/50',\n};\n\nfunction createFailedBlockComponent(block: Extract<MDXBlockEvaluationResult, { ok: false }>): ComponentType {\n return function FailedBlockComponent() {\n return (\n <div className=\"p-4 bg-red-50 border border-red-200 rounded text-red-600\">\n <p className=\"font-semibold mb-2\">MDX Block Error</p>\n <p className=\"text-sm\">Block: {block.id}</p>\n <p className=\"text-xs mt-2\">{block.error.message}</p>\n </div>\n );\n };\n}\n\nfunction resolveRenderableBlocks(blocks: (MDXBlockEvaluationResult | MDXComponent)[]): MDXComponent[] {\n return blocks.map((block) => {\n if (isRenderableBlock(block)) {\n return block;\n }\n\n if (block.ok) {\n return block;\n }\n\n return {\n id: block.id,\n title: block.title,\n Component: createFailedBlockComponent(block),\n };\n });\n}\n\n// ── Main Component ──────────────────────────────────────────────────────────\n\n/**\n * Internal component for rendering Puck pages with MDX blocks.\n *\n * Enhances the Puck config by:\n * 1. Registering each MDX block as a dynamic Puck component (`Block_{id}`)\n * 2. Overriding ContentBlockSection's render to resolve blockId → actual MDX content\n *\n * MDX blocks are passed as React components (not HTML strings), which:\n * - Avoids dangerouslySetInnerHTML security risks\n * - More efficient (no HTML conversion round-trip)\n * - Type-safe with proper React component types\n *\n * @internal\n */\nfunction RenderWithBlocks({ config, data, mdxComponents }: RenderWithBlocksProps) {\n // Build enhanced config with MDX blocks\n const blockComponents: Record<string, ComponentConfig> = {};\n const blockCategoryList: string[] = [];\n const blockComponentMap = new Map(mdxComponents.map((block) => [block.id, block]));\n\n // Create component configs for each block\n mdxComponents.forEach((block) => {\n const componentKey = `Block_${block.id}`;\n\n // Capture component in closure - Puck doesn't persist defaultProps reliably\n const BlockComponent = block.Component;\n\n blockComponents[componentKey] = {\n label: block.title,\n fields: {},\n defaultProps: {},\n render: () => {\n // Use blockId and BlockComponent from closure - no prop dependency\n return (\n <div className=\"mdx-content conloca-prose max-w-none\">\n <BlockComponent />\n </div>\n );\n },\n };\n blockCategoryList.push(componentKey);\n });\n\n // Merge with existing config\n const existingCategories = config.categories || {};\n const existingComponents = config.components || {};\n const contentBlockSection = existingComponents.ContentBlockSection as\n | ComponentConfig<ContentBlockSectionProps>\n | undefined;\n\n const enhancedContentBlockSection = contentBlockSection\n ? {\n ...contentBlockSection,\n render: ({\n blockId,\n label,\n title,\n subtitle,\n tone = 'transparent',\n width = 'default',\n }: ContentBlockSectionProps) => {\n const selectedBlock = blockComponentMap.get(blockId);\n const SelectedBlockComponent = selectedBlock?.Component;\n\n return (\n <section className=\"pb-16 sm:pb-20\">\n <div className={cn('mx-auto px-4 sm:px-6 lg:px-8', contentBlockWidthClasses[width])}>\n {label ? (\n <p className=\"mb-4 text-sm font-medium uppercase tracking-[0.18em] text-brand-700 dark:text-brand-300\">\n {label}\n </p>\n ) : null}\n {title && (\n <h2 className=\"text-2xl sm:text-3xl font-bold text-surface-900 dark:text-white mb-4\">{title}</h2>\n )}\n {subtitle && (\n <p className=\"text-surface-500 dark:text-surface-400 text-sm leading-relaxed mb-6\">{subtitle}</p>\n )}\n <div className={cn(contentBlockToneClasses[tone])}>\n {SelectedBlockComponent && (\n <div className=\"mdx-content conloca-prose max-w-none\">\n <SelectedBlockComponent />\n </div>\n )}\n </div>\n </div>\n </section>\n );\n },\n }\n : undefined;\n\n // Merge block components with existing config components\n const mergedComponents = {\n ...existingComponents,\n ...(enhancedContentBlockSection && { ContentBlockSection: enhancedContentBlockSection }),\n ...blockComponents,\n } as Config['components'];\n\n const enhancedConfig: Config = {\n ...config,\n categories: {\n ...existingCategories,\n blocks: {\n title: 'Content Blocks',\n components: blockCategoryList,\n },\n },\n components: mergedComponents,\n };\n\n // Check if page has hydratable components\n const needsHydration = hasHydratableComponents(data, enhancedConfig);\n\n if (needsHydration) {\n return <RenderWithHydration config={enhancedConfig} data={data} />;\n }\n\n return <Render config={enhancedConfig} data={data} />;\n}\n\n/**\n * Factory function to create a PageRenderer with MDX components baked in via closure.\n *\n * This approach avoids dangerouslySetInnerHTML by keeping React components as components\n * throughout the rendering pipeline. Components are captured in the closure and don't\n * need to be passed as props (which Astro can't serialize).\n *\n * @param config - The Puck configuration with component definitions\n * @param data - Puck page data containing component tree\n * @param mdxComponents - Array of evaluated MDX block results\n * @returns A PageRenderer component with no props needed (components in closure)\n */\nexport function createPageRendererWithBlocks(\n config: Config,\n data: Data,\n mdxComponents: (MDXBlockEvaluationResult | MDXComponent)[],\n): ComponentType {\n const renderableBlocks = resolveRenderableBlocks(mdxComponents);\n\n // Capture components in closure - no need to pass as props\n return function PageRendererWithBlocks() {\n return <RenderWithBlocks config={config} data={data} mdxComponents={renderableBlocks} />;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,iBAAiB,EAAE,eAAe,UAAU,OAAO,YAAmC;AAEpG,KAAI,aAAa,OACf,QAAO,gCAAG,WAAY;CAMxB,MAAM,EAAE,MAAM,OAAO,GAAG,iBAAiB;AAGzC,QACE,oBAAC;EACC,OAAO,EAAE,SAAS,YAAY;EAC9B,gBAAc;EACd,yBAAuB;EACvB,cAAY,eAAe,aAAa;EAEvC;GACG;;;;;;;;;;;;;;ACnBV,SAAgB,oBAAoB,EAAE,QAAQ,QAAkC;AA8B9E,QAAO,oBAAC;EAAO,QA5Be;GAC5B,GAAG;GACH,YAAY,OAAO,YACjB,OAAO,QAAQ,OAAO,WAAW,CAAC,KAAK,CAAC,MAAM,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;GAAc;GAAM,eAAe;IAAoB"}
1
+ {"version":3,"file":"components.mjs","names":[],"sources":["../src/components/HydrationWrapper.tsx","../src/components/RenderWithHydration.tsx","../src/components/RenderWithBlocks.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { serializeProps } from '../lib/serialize-props.js';\nimport type { HydrationStrategy } from '../types.js';\n\ninterface HydrationWrapperProps {\n componentName: string;\n strategy: HydrationStrategy;\n props: Record<string, unknown>;\n children: ReactNode;\n}\n\n/**\n * Wraps hydratable components with data attributes for browser hydration.\n *\n * When strategy is 'none', renders children directly without wrapper overhead.\n * Otherwise, wraps in a div with data-hydrate attributes that the browser\n * hydration script uses to find and hydrate components.\n */\nexport function HydrationWrapper({ componentName, strategy, props, children }: HydrationWrapperProps) {\n // No hydration needed - render children directly without wrapper\n if (strategy === 'none') {\n return <>{children}</>;\n }\n\n // Strip Puck-internal props that aren't needed for hydration.\n // `puck` contains functions (renderDropZone) that can't survive JSON serialization\n // and would crash on hydration if a component called them.\n const { puck: _puck, ...hydrateProps } = props as Record<string, unknown> & { puck?: unknown };\n\n // Wrap with hydration markers for the browser script to find\n return (\n <div\n style={{ display: 'contents' }}\n data-hydrate={componentName}\n data-hydrate-strategy={strategy}\n data-props={serializeProps(hydrateProps)}\n >\n {children}\n </div>\n );\n}\n","import type { Config, Data } from '@puckeditor/core';\nimport { Render } from '@puckeditor/core/rsc';\nimport { isHydratable } from '../lib/hydration-utils.js';\nimport { HydrationWrapper } from './HydrationWrapper.js';\n\ninterface RenderWithHydrationProps {\n config: Config;\n data: Data;\n}\n\n/**\n * Wrapper around Puck's Render component that adds hydration support.\n *\n * For each component with a hydration strategy configured, wraps the\n * component's render output with HydrationWrapper to add data-hydrate\n * attributes for browser-side hydration.\n *\n * Non-hydratable components render without any wrapper overhead.\n */\nexport function RenderWithHydration({ config, data }: RenderWithHydrationProps) {\n // Create wrapped config with hydration-aware render functions\n const wrappedConfig: Config = {\n ...config,\n components: Object.fromEntries(\n Object.entries(config.components).map(([name, componentConfig]) => {\n const strategy = isHydratable(name, config);\n\n if (strategy === 'none') {\n // No wrapping needed - component stays static\n return [name, componentConfig];\n }\n\n // Wrap the render function so its output becomes HydrationWrapper children\n const originalRender = componentConfig.render;\n return [\n name,\n {\n ...componentConfig,\n render: (props) => (\n <HydrationWrapper componentName={name} strategy={strategy} props={props}>\n {originalRender(props)}\n </HydrationWrapper>\n ),\n },\n ];\n }),\n ),\n };\n\n return <Render config={wrappedConfig} data={data} />;\n}\n","import type { MDXBlockEvaluationResult } from '@conloca/mdx/node';\nimport type { ComponentConfig, Config, Data } from '@puckeditor/core';\nimport { Render } from '@puckeditor/core/rsc';\nimport cn from 'clsx';\nimport type { ComponentType } from 'react';\nimport { hasHydratableComponents } from '../lib/hydration-utils.js';\nimport { RenderWithHydration } from './RenderWithHydration.js';\n\ninterface MDXComponent {\n id: string;\n title: string;\n Component: ComponentType;\n}\n\nfunction isRenderableBlock(block: MDXBlockEvaluationResult | MDXComponent): block is MDXComponent {\n return 'Component' in block && !('ok' in block);\n}\n\ninterface RenderWithBlocksProps {\n config: Config;\n data: Data;\n mdxComponents: MDXComponent[];\n}\n\ninterface ContentBlockSectionProps {\n title?: string;\n subtitle?: string;\n label?: string;\n blockId: string;\n width?: 'narrow' | 'default';\n tone?: 'transparent' | 'subtle';\n}\n\nconst contentBlockWidthClasses: Record<NonNullable<ContentBlockSectionProps['width']>, string> = {\n narrow: 'max-w-3xl',\n default: 'max-w-4xl',\n};\n\nconst contentBlockToneClasses: Record<NonNullable<ContentBlockSectionProps['tone']>, string> = {\n transparent: '',\n subtle:\n 'rounded-3xl border border-surface-200/80 bg-surface-100/70 p-6 sm:p-8 dark:border-surface-800/60 dark:bg-surface-900/50',\n};\n\nfunction createFailedBlockComponent(block: Extract<MDXBlockEvaluationResult, { ok: false }>): ComponentType {\n return function FailedBlockComponent() {\n return (\n <div className=\"p-4 bg-red-50 border border-red-200 rounded text-red-600\">\n <p className=\"font-semibold mb-2\">MDX Block Error</p>\n <p className=\"text-sm\">Block: {block.id}</p>\n <p className=\"text-xs mt-2\">{block.error.message}</p>\n </div>\n );\n };\n}\n\nfunction resolveRenderableBlocks(blocks: (MDXBlockEvaluationResult | MDXComponent)[]): MDXComponent[] {\n return blocks.map((block) => {\n if (isRenderableBlock(block)) {\n return block;\n }\n\n if (block.ok) {\n return block;\n }\n\n return {\n id: block.id,\n title: block.title,\n Component: createFailedBlockComponent(block),\n };\n });\n}\n\n// ── Main Component ──────────────────────────────────────────────────────────\n\n/**\n * Internal component for rendering Puck pages with MDX blocks.\n *\n * Enhances the Puck config by:\n * 1. Registering each MDX block as a dynamic Puck component (`Block_{id}`)\n * 2. Overriding ContentBlockSection's render to resolve blockId → actual MDX content\n *\n * MDX blocks are passed as React components (not HTML strings), which:\n * - Avoids dangerouslySetInnerHTML security risks\n * - More efficient (no HTML conversion round-trip)\n * - Type-safe with proper React component types\n *\n * @internal\n */\nfunction RenderWithBlocks({ config, data, mdxComponents }: RenderWithBlocksProps) {\n // Build enhanced config with MDX blocks\n const blockComponents: Record<string, ComponentConfig> = {};\n const blockCategoryList: string[] = [];\n const blockComponentMap = new Map(mdxComponents.map((block) => [block.id, block]));\n\n // Create component configs for each block\n mdxComponents.forEach((block) => {\n const componentKey = `Block_${block.id}`;\n\n // Capture component in closure - Puck doesn't persist defaultProps reliably\n const BlockComponent = block.Component;\n\n blockComponents[componentKey] = {\n label: block.title,\n fields: {},\n defaultProps: {},\n render: () => {\n // Use blockId and BlockComponent from closure - no prop dependency\n return (\n <div className=\"mdx-content conloca-prose max-w-none\">\n <BlockComponent />\n </div>\n );\n },\n };\n blockCategoryList.push(componentKey);\n });\n\n // Merge with existing config\n const existingCategories = config.categories || {};\n const existingComponents = config.components || {};\n const contentBlockSection = existingComponents.ContentBlockSection as\n | ComponentConfig<ContentBlockSectionProps>\n | undefined;\n\n const enhancedContentBlockSection = contentBlockSection\n ? {\n ...contentBlockSection,\n render: ({\n blockId,\n label,\n title,\n subtitle,\n tone = 'transparent',\n width = 'default',\n }: ContentBlockSectionProps) => {\n const selectedBlock = blockComponentMap.get(blockId);\n const SelectedBlockComponent = selectedBlock?.Component;\n\n return (\n <section className=\"pb-16 sm:pb-20\">\n <div className={cn('mx-auto px-4 sm:px-6 lg:px-8', contentBlockWidthClasses[width])}>\n {label ? (\n <p className=\"mb-4 text-sm font-medium uppercase tracking-[0.18em] text-brand-700 dark:text-brand-300\">\n {label}\n </p>\n ) : null}\n {title && (\n <h2 className=\"text-2xl sm:text-3xl font-bold text-surface-900 dark:text-white mb-4\">{title}</h2>\n )}\n {subtitle && (\n <p className=\"text-surface-500 dark:text-surface-400 text-sm leading-relaxed mb-6\">{subtitle}</p>\n )}\n <div className={cn(contentBlockToneClasses[tone])}>\n {SelectedBlockComponent && (\n <div className=\"mdx-content conloca-prose max-w-none\">\n <SelectedBlockComponent />\n </div>\n )}\n </div>\n </div>\n </section>\n );\n },\n }\n : undefined;\n\n // Merge block components with existing config components\n const mergedComponents = {\n ...existingComponents,\n ...(enhancedContentBlockSection && { ContentBlockSection: enhancedContentBlockSection }),\n ...blockComponents,\n } as Config['components'];\n\n const enhancedConfig: Config = {\n ...config,\n categories: {\n ...existingCategories,\n blocks: {\n title: 'Content Blocks',\n components: blockCategoryList,\n },\n },\n components: mergedComponents,\n };\n\n // Check if page has hydratable components\n const needsHydration = hasHydratableComponents(data, enhancedConfig);\n\n if (needsHydration) {\n return <RenderWithHydration config={enhancedConfig} data={data} />;\n }\n\n return <Render config={enhancedConfig} data={data} />;\n}\n\n/**\n * Factory function to create a PageRenderer with MDX components baked in via closure.\n *\n * This approach avoids dangerouslySetInnerHTML by keeping React components as components\n * throughout the rendering pipeline. Components are captured in the closure and don't\n * need to be passed as props (which Astro can't serialize).\n *\n * @param config - The Puck configuration with component definitions\n * @param data - Puck page data containing component tree\n * @param mdxComponents - Array of evaluated MDX block results\n * @returns A PageRenderer component with no props needed (components in closure)\n */\nexport function createPageRendererWithBlocks(\n config: Config,\n data: Data,\n mdxComponents: (MDXBlockEvaluationResult | MDXComponent)[],\n): ComponentType {\n const renderableBlocks = resolveRenderableBlocks(mdxComponents);\n\n // Capture components in closure - no need to pass as props\n return function PageRendererWithBlocks() {\n return <RenderWithBlocks config={config} data={data} mdxComponents={renderableBlocks} />;\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAgB,iBAAiB,EAAE,eAAe,UAAU,OAAO,YAAmC;CAEpG,IAAI,aAAa,QACf,OAAO,oBAAA,UAAA,EAAG,SAAW,CAAA;CAMvB,MAAM,EAAE,MAAM,OAAO,GAAG,iBAAiB;CAGzC,OACE,oBAAC,OAAD;EACE,OAAO,EAAE,SAAS,WAAW;EAC7B,gBAAc;EACd,yBAAuB;EACvB,cAAY,eAAe,YAAY;EAEtC;CACE,CAAA;AAET;;;;;;;;;;;;ACrBA,SAAgB,oBAAoB,EAAE,QAAQ,QAAkC;CA8B9E,OAAO,oBAAC,QAAD;EAAQ,QAAQ;GA3BrB,GAAG;GACH,YAAY,OAAO,YACjB,OAAO,QAAQ,OAAO,UAAU,CAAC,CAAC,KAAK,CAAC,MAAM,qBAAqB;IACjE,MAAM,WAAW,aAAa,MAAM,MAAM;IAE1C,IAAI,aAAa,QAEf,OAAO,CAAC,MAAM,eAAe;IAI/B,MAAM,iBAAiB,gBAAgB;IACvC,OAAO,CACL,MACA;KACE,GAAG;KACH,SAAS,UACP,oBAAC,kBAAD;MAAkB,eAAe;MAAgB;MAAiB;MAC/D,UAAA,eAAe,KAAK;KACL,CAAA;IAEtB,CACF;GACF,CAAC,CACH;EAGiC;EAAS;CAAO,CAAA;AACrD;;;ACpCA,SAAS,kBAAkB,OAAuE;CAChG,OAAO,eAAe,SAAS,EAAE,QAAQ;AAC3C;AAiBA,MAAM,2BAA2F;CAC/F,QAAQ;CACR,SAAS;AACX;AAEA,MAAM,0BAAyF;CAC7F,aAAa;CACb,QACE;AACJ;AAEA,SAAS,2BAA2B,OAAwE;CAC1G,OAAO,SAAS,uBAAuB;EAC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AI,OACD,CAAC,EAAE;GAE9C,OACE,oBAAC,WAAD;IAAS,WAAU;IACjB,UAAA,qBAAC,OAAD;KAAK,WAAW,GAAG,gCAAgC,yBAAyB,MAAM;KAAlF,UAAA;MACG,QACC,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA;MACA,CAAA,IACD;MACH,SACC,oBAAC,MAAD;OAAI,WAAU;OAAwE,UAAA;MAAU,CAAA;MAEjG,YACC,oBAAC,KAAD;OAAG,WAAU;OAAuE,UAAA;MAAY,CAAA;MAElG,oBAAC,OAAD;OAAK,WAAW,GAAG,wBAAwB,KAAK;OAC7C,UAAA,0BACC,oBAAC,OAAD;QAAK,WAAU;QACb,UAAA,oBAAC,wBAAD,CAAyB,CAAA;OACtB,CAAA;MAEJ,CAAA;KACF;;GACE,CAAA;EAEb;CACF,IACA,KAAA;CAGJ,MAAM,mBAAmB;EACvB,GAAG;EACH,GAAI,+BAA+B,EAAE,qBAAqB,4BAA4B;EACtF,GAAG;CACL;CAEA,MAAM,iBAAyB;EAC7B,GAAG;EACH,YAAY;GACV,GAAG;GACH,QAAQ;IACN,OAAO;IACP,YAAY;GACd;EACF;EACA,YAAY;CACd;CAKA,IAFuB,wBAAwB,MAAM,cAEpC,GACf,OAAO,oBAAC,qBAAD;EAAqB,QAAQ;EAAsB;CAAO,CAAA;CAGnE,OAAO,oBAAC,QAAD;EAAQ,QAAQ;EAAsB;CAAO,CAAA;AACtD;;;;;;;;;;;;;AAcA,SAAgB,6BACd,QACA,MACA,eACe;CACf,MAAM,mBAAmB,wBAAwB,aAAa;CAG9D,OAAO,SAAS,yBAAyB;EACvC,OAAO,oBAAC,kBAAD;GAA0B;GAAc;GAAM,eAAe;EAAmB,CAAA;CACzF;AACF"}
@@ -1,4 +1,4 @@
1
- import { t as HydrationStrategy } from "./types-CVQNmPxF.mjs";
2
- import { n as WithHydrationStrategy, r as withHydration, t as HydrationMeta } from "./withHydration-HIvO9ysY.mjs";
1
+ import { n as HydrationStrategy } from "./types-CS9neadI.mjs";
3
2
  import { ComponentRegistry } from "./lib/hydration-script.mjs";
3
+ import { n as WithHydrationStrategy, r as withHydration, t as HydrationMeta } from "./withHydration-DkKpkmzJ.mjs";
4
4
  export { type ComponentRegistry, type HydrationMeta, type HydrationStrategy, type WithHydrationStrategy, withHydration };
@@ -1,3 +1,2 @@
1
- import { t as withHydration } from "./withHydration-EzyzBQ-Y.mjs";
2
-
3
- export { withHydration };
1
+ import { t as withHydration } from "./withHydration-C256ox_6.mjs";
2
+ export { withHydration };
package/dist/index.d.mts CHANGED
@@ -1,42 +1,11 @@
1
- import { r as TemplateConfig, t as HydrationStrategy } from "./types-CVQNmPxF.mjs";
2
- import { n as WithHydrationStrategy, r as withHydration, t as HydrationMeta } from "./withHydration-HIvO9ysY.mjs";
1
+ import { n as localesFromAstroI18n, r as localesFromStarlight, t as ConlocaLocales } from "./locales-helpers-BvYYqnJ5.mjs";
2
+ import { a as PageReference, c as TemplateConfig, i as PageData, n as HydrationStrategy, o as ResolvedRoutingConfig, r as LayoutProps, t as DataCollectionEntry } from "./types-CS9neadI.mjs";
3
3
  import { ComponentRegistry } from "./lib/hydration-script.mjs";
4
+ import { n as WithHydrationStrategy, r as withHydration, t as HydrationMeta } from "./withHydration-DkKpkmzJ.mjs";
5
+ import { MdxComponentDescriptor, MdxComponentInsertHint, MdxComponentProp, MdxComponents, MdxJsxComponentDescriptor, MdxSnippetDescriptor, defineMdxComponents, readStringAttribute, writeStringAttribute } from "@conloca/cms-spa/mdx-components";
6
+ import { CoreFieldsMode, FieldHint, FieldHintCommon, FieldHintVariant, FieldHints, PageSchemaDescriptor, PageSchemaEntry, PageSchemaGroup, PageSchemas, definePageSchema } from "@conloca/cms-spa/page-schemas";
4
7
  import { BlockMeta, PageMeta, blockMetaSchema, pageMetaSchema } from "@conloca/content-api/schemas";
5
8
  import { Config, Data } from "@puckeditor/core";
6
-
7
- //#region src/lib/hydration-scanner.d.ts
8
- /**
9
- * Result of scanning a component file for withHydration usage.
10
- */
11
- interface HydrationDiscovery {
12
- /** Component name derived from filename (PascalCase) */
13
- componentName: string;
14
- /** Absolute path to the component file */
15
- filePath: string;
16
- /** Hydration strategy extracted from withHydration call */
17
- strategy: 'load' | 'visible' | 'idle';
18
- }
19
- /**
20
- * Scans component directories for files using withHydration wrapper.
21
- *
22
- * This function performs static analysis to discover components marked
23
- * for hydration, without executing any component code.
24
- *
25
- * @param componentPaths - Relative paths to scan (e.g., ['src/components/puck'])
26
- * @param projectRoot - Absolute path to the project root
27
- * @returns Array of discovered hydratable components with their strategies
28
- *
29
- * @example
30
- * ```typescript
31
- * const discoveries = await scanForHydratableComponents(
32
- * ['src/components/puck'],
33
- * '/path/to/project'
34
- * )
35
- * // => [{ componentName: 'TestimonialGrid', filePath: '...', strategy: 'visible' }]
36
- * ```
37
- */
38
- declare function scanForHydratableComponents(componentPaths: string[], projectRoot: string): Promise<HydrationDiscovery[]>;
39
- //#endregion
40
9
  //#region src/lib/hydration-utils.d.ts
41
10
  /**
42
11
  * Extended ComponentConfig with hydration support.
@@ -135,5 +104,5 @@ declare function pathnameFromSlug(slug: string | undefined, pattern: string): st
135
104
  */
136
105
  declare function serializeProps(props: Record<string, unknown>): string;
137
106
  //#endregion
138
- export { type BlockMeta, type ComponentRegistry, type HydratableComponent, type HydratableComponentConfig, type HydrationDiscovery, type HydrationMeta, type HydrationStrategy, type PageMeta, type TemplateConfig, type WithHydrationStrategy, blockMetaSchema, extractSlugFromPathname, findHydratableComponents, hasHydratableComponents, isHydratable, isPublished, pageMetaSchema, pathnameFromSlug, scanForHydratableComponents, serializeProps, toDate, withHydration };
107
+ export { type BlockMeta, type ComponentRegistry, type ConlocaLocales, type CoreFieldsMode, type DataCollectionEntry, type FieldHint, type FieldHintCommon, type FieldHintVariant, type FieldHints, type HydratableComponent, type HydratableComponentConfig, type HydrationMeta, type HydrationStrategy, type LayoutProps, type MdxComponentDescriptor, type MdxComponentInsertHint, type MdxComponentProp, type MdxComponents, type MdxJsxComponentDescriptor, type MdxSnippetDescriptor, type PageData, type PageMeta, type PageReference, type PageSchemaDescriptor, type PageSchemaEntry, type PageSchemaGroup, type PageSchemas, type ResolvedRoutingConfig, type TemplateConfig, type WithHydrationStrategy, blockMetaSchema, defineMdxComponents, definePageSchema, extractSlugFromPathname, findHydratableComponents, hasHydratableComponents, isHydratable, isPublished, localesFromAstroI18n, localesFromStarlight, pageMetaSchema, pathnameFromSlug, readStringAttribute, serializeProps, toDate, withHydration, writeStringAttribute };
139
108
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/hydration-scanner.ts","../src/lib/hydration-utils.ts","../src/lib/route-utils.ts","../src/lib/serialize-props.ts"],"mappings":";;;;;;;;;;UAOiB,kBAAA;;EAEf,aAAA;;EAEA,QAAA;EAJiC;EAMjC,QAAA;AAAA;;;;ACLF;;;;;;;;;;AAUA;;;;;;iBD6EsB,2BAAA,CACpB,cAAA,YACA,WAAA,WACC,OAAA,CAAQ,kBAAA;;;;;;;UC1FM,yBAAA;EDDA;ECGf,SAAA,GAAY,iBAAA;EACZ,MAAA,IAAU,KAAA;AAAA;;;;;UAOK,mBAAA;ED6EK;EC3EpB,IAAA;;EAEA,KAAA,EAAO,MAAA;ED0EP;ECxEA,QAAA,EAAU,OAAA,CAAQ,iBAAA;ED0EjB;ECxED,EAAA;AAAA;;;;;AAlBF;;;;;;iBA+BgB,YAAA,CAAa,aAAA,UAAuB,MAAA,EAAQ,MAAA,GAAS,iBAAA;;;;AArBrE;;;;;iBA2CgB,wBAAA,CAAyB,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQ,MAAA,GAAS,mBAAA;;;;;iBA0CtD,uBAAA,CAAwB,IAAA,EAAM,IAAA,EAAM,MAAA,EAAQ,MAAA;;;iBCvG5C,MAAA,CAAO,KAAA,WAAgB,IAAA,sBAAuB,IAAA;AAAA,UAcpD,eAAA;EACR,SAAA,YAAqB,IAAA;EACrB,WAAA,YAAuB,IAAA;AAAA;AAAA,iBAGT,WAAA,CAAY,IAAA,EAAM,eAAA;;AFZlC;;;;;;;;;AAwFA;;;;;;iBE5CgB,uBAAA,CAAwB,QAAA,UAAkB,OAAA;;;;;;;AD3C1D;;;;;;;;;iBC6EgB,gBAAA,CAAiB,IAAA,sBAA0B,OAAA;;;;;;;iBCjF3C,cAAA,CAAe,KAAA,EAAO,MAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/hydration-utils.ts","../src/lib/route-utils.ts","../src/lib/serialize-props.ts"],"mappings":";;;;;;;;;;;;;UAQiB;;EAEf,YAAY;EACZ,UAAU;;;;;;UAOK;;EAEf;;EAEA,OAAO;;EAEP,UAAU,QAAQ;;EAElB;;;;;;;;;;;;iBAac,aAAa,uBAAuB,QAAQ,SAAS;;;;;;;;;iBAsBrD,yBAAyB,MAAM,MAAM,QAAQ,SAAS;;;;;iBA0CtD,wBAAwB,MAAM,MAAM,QAAQ;;;iBCvG5C,OAAO,gBAAgB,0BAAuB;UAcpD;EACR,qBAAqB;EACrB,uBAAuB;;iBAGT,YAAY,MAAM;;;;;;;;;;;;;;;;;iBAgClB,wBAAwB,kBAAkB;;;;;;;;;;;;;;;;iBAkC1C,iBAAiB,0BAA0B;;;;;;;iBCjF3C,eAAe,OAAO"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,9 @@
1
- import { n as scanForHydratableComponents } from "./hydration-scanner-B0NjYkZ_.mjs";
2
- import { i as isHydratable, n as findHydratableComponents, r as hasHydratableComponents, t as serializeProps } from "./serialize-props-Dhv_MnkY.mjs";
3
- import { t as withHydration } from "./withHydration-EzyzBQ-Y.mjs";
1
+ import { i as isHydratable, n as findHydratableComponents, r as hasHydratableComponents, t as serializeProps } from "./serialize-props-BHoNpzH6.mjs";
2
+ import { t as withHydration } from "./withHydration-C256ox_6.mjs";
3
+ import { n as localesFromStarlight, t as localesFromAstroI18n } from "./locales-helpers-qiwh7nxS.mjs";
4
+ import { defineMdxComponents, readStringAttribute, writeStringAttribute } from "@conloca/cms-spa/mdx-components";
5
+ import { definePageSchema } from "@conloca/cms-spa/page-schemas";
4
6
  import { blockMetaSchema, pageMetaSchema } from "@conloca/content-api/schemas";
5
-
6
7
  //#region src/lib/route-utils.ts
7
8
  function toDate(value) {
8
9
  if (!value) return;
@@ -60,7 +61,7 @@ function pathnameFromSlug(slug, pattern) {
60
61
  if (!slug) return prefix || "/";
61
62
  return `${prefix}/${slug}`;
62
63
  }
63
-
64
64
  //#endregion
65
- export { blockMetaSchema, extractSlugFromPathname, findHydratableComponents, hasHydratableComponents, isHydratable, isPublished, pageMetaSchema, pathnameFromSlug, scanForHydratableComponents, serializeProps, toDate, withHydration };
65
+ export { blockMetaSchema, defineMdxComponents, definePageSchema, extractSlugFromPathname, findHydratableComponents, hasHydratableComponents, isHydratable, isPublished, localesFromAstroI18n, localesFromStarlight, pageMetaSchema, pathnameFromSlug, readStringAttribute, serializeProps, toDate, withHydration, writeStringAttribute };
66
+
66
67
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/lib/route-utils.ts"],"sourcesContent":["export function toDate(value: string | Date | null | undefined) {\n if (!value) {\n return undefined;\n }\n\n if (value instanceof Date) {\n return value;\n }\n\n const parsed = new Date(value);\n\n return Number.isNaN(parsed.getTime()) ? undefined : parsed;\n}\n\ninterface PublishSchedule {\n publishAt?: string | Date | null;\n unpublishAt?: string | Date | null;\n}\n\nexport function isPublished(data: PublishSchedule) {\n const now = new Date();\n const publishAt = toDate(data.publishAt);\n const unpublishAt = toDate(data.unpublishAt);\n\n if (publishAt && publishAt > now) {\n return false;\n }\n\n if (unpublishAt && unpublishAt <= now) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Extract slug from pathname given a route pattern.\n *\n * The slug is the portion of the pathname that comes after the\n * static prefix of the pattern.\n *\n * @param pathname - URL pathname (e.g., '/about', '/blog/post-1')\n * @param pattern - Route pattern (e.g., '/[...slug]', '/blog/[...slug]')\n * @returns The extracted slug, or undefined for root paths\n *\n * @example\n * extractSlugFromPathname('/about', '/[...slug]') // 'about'\n * extractSlugFromPathname('/blog/post-1', '/blog/[...slug]') // 'post-1'\n * extractSlugFromPathname('/', '/[...slug]') // undefined\n * extractSlugFromPathname('/blog', '/blog/[...slug]') // undefined\n */\nexport function extractSlugFromPathname(pathname: string, pattern: string): string | undefined {\n // Pattern: /[...slug] -> prefix: ''\n // Pattern: /blog/[...slug] -> prefix: '/blog'\n // Pattern: /docs/[...path] -> prefix: '/docs'\n\n const prefixMatch = pattern.match(/^(.*?)\\[/);\n const prefix = prefixMatch ? prefixMatch[1].replace(/\\/$/, '') : '';\n\n // Remove prefix from pathname\n const slugPart = pathname.slice(prefix.length);\n\n // Remove leading slash\n const slug = slugPart.replace(/^\\//, '');\n\n // Empty string means root page (e.g., /blog for /blog/[...slug])\n // Return undefined for root to match [...slug] behavior\n return slug || undefined;\n}\n\n/**\n * Convert a slug back to a pathname given a route pattern.\n *\n * The inverse of extractSlugFromPathname.\n *\n * @param slug - The page slug (e.g., 'about', 'post-1'), or undefined for root\n * @param pattern - Route pattern (e.g., '/[...slug]', '/blog/[...slug]')\n * @returns Full URL pathname\n *\n * @example\n * pathnameFromSlug('about', '/[...slug]') // '/about'\n * pathnameFromSlug('post-1', '/blog/[...slug]') // '/blog/post-1'\n * pathnameFromSlug(undefined, '/[...slug]') // '/'\n * pathnameFromSlug(undefined, '/blog/[...slug]') // '/blog'\n */\nexport function pathnameFromSlug(slug: string | undefined, pattern: string): string {\n // Extract the static prefix before the dynamic segment\n const prefixMatch = pattern.match(/^(.*?)\\[/);\n const prefix = prefixMatch ? prefixMatch[1].replace(/\\/$/, '') : '';\n\n if (!slug) {\n // No slug means root of this pattern\n return prefix || '/';\n }\n\n // Combine prefix and slug\n return `${prefix}/${slug}`;\n}\n"],"mappings":";;;;;;AAAA,SAAgB,OAAO,OAAyC;AAC9D,KAAI,CAAC,MACH;AAGF,KAAI,iBAAiB,KACnB,QAAO;CAGT,MAAM,SAAS,IAAI,KAAK,MAAM;AAE9B,QAAO,OAAO,MAAM,OAAO,SAAS,CAAC,GAAG,SAAY;;AAQtD,SAAgB,YAAY,MAAuB;CACjD,MAAM,sBAAM,IAAI,MAAM;CACtB,MAAM,YAAY,OAAO,KAAK,UAAU;CACxC,MAAM,cAAc,OAAO,KAAK,YAAY;AAE5C,KAAI,aAAa,YAAY,IAC3B,QAAO;AAGT,KAAI,eAAe,eAAe,IAChC,QAAO;AAGT,QAAO;;;;;;;;;;;;;;;;;;AAmBT,SAAgB,wBAAwB,UAAkB,SAAqC;CAK7F,MAAM,cAAc,QAAQ,MAAM,WAAW;CAC7C,MAAM,SAAS,cAAc,YAAY,GAAG,QAAQ,OAAO,GAAG,GAAG;AAUjE,QAPiB,SAAS,MAAM,OAAO,OAAO,CAGxB,QAAQ,OAAO,GAAG,IAIzB;;;;;;;;;;;;;;;;;AAkBjB,SAAgB,iBAAiB,MAA0B,SAAyB;CAElF,MAAM,cAAc,QAAQ,MAAM,WAAW;CAC7C,MAAM,SAAS,cAAc,YAAY,GAAG,QAAQ,OAAO,GAAG,GAAG;AAEjE,KAAI,CAAC,KAEH,QAAO,UAAU;AAInB,QAAO,GAAG,OAAO,GAAG"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/lib/route-utils.ts"],"sourcesContent":["export function toDate(value: string | Date | null | undefined) {\n if (!value) {\n return undefined;\n }\n\n if (value instanceof Date) {\n return value;\n }\n\n const parsed = new Date(value);\n\n return Number.isNaN(parsed.getTime()) ? undefined : parsed;\n}\n\ninterface PublishSchedule {\n publishAt?: string | Date | null;\n unpublishAt?: string | Date | null;\n}\n\nexport function isPublished(data: PublishSchedule) {\n const now = new Date();\n const publishAt = toDate(data.publishAt);\n const unpublishAt = toDate(data.unpublishAt);\n\n if (publishAt && publishAt > now) {\n return false;\n }\n\n if (unpublishAt && unpublishAt <= now) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Extract slug from pathname given a route pattern.\n *\n * The slug is the portion of the pathname that comes after the\n * static prefix of the pattern.\n *\n * @param pathname - URL pathname (e.g., '/about', '/blog/post-1')\n * @param pattern - Route pattern (e.g., '/[...slug]', '/blog/[...slug]')\n * @returns The extracted slug, or undefined for root paths\n *\n * @example\n * extractSlugFromPathname('/about', '/[...slug]') // 'about'\n * extractSlugFromPathname('/blog/post-1', '/blog/[...slug]') // 'post-1'\n * extractSlugFromPathname('/', '/[...slug]') // undefined\n * extractSlugFromPathname('/blog', '/blog/[...slug]') // undefined\n */\nexport function extractSlugFromPathname(pathname: string, pattern: string): string | undefined {\n // Pattern: /[...slug] -> prefix: ''\n // Pattern: /blog/[...slug] -> prefix: '/blog'\n // Pattern: /docs/[...path] -> prefix: '/docs'\n\n const prefixMatch = pattern.match(/^(.*?)\\[/);\n const prefix = prefixMatch ? prefixMatch[1].replace(/\\/$/, '') : '';\n\n // Remove prefix from pathname\n const slugPart = pathname.slice(prefix.length);\n\n // Remove leading slash\n const slug = slugPart.replace(/^\\//, '');\n\n // Empty string means root page (e.g., /blog for /blog/[...slug])\n // Return undefined for root to match [...slug] behavior\n return slug || undefined;\n}\n\n/**\n * Convert a slug back to a pathname given a route pattern.\n *\n * The inverse of extractSlugFromPathname.\n *\n * @param slug - The page slug (e.g., 'about', 'post-1'), or undefined for root\n * @param pattern - Route pattern (e.g., '/[...slug]', '/blog/[...slug]')\n * @returns Full URL pathname\n *\n * @example\n * pathnameFromSlug('about', '/[...slug]') // '/about'\n * pathnameFromSlug('post-1', '/blog/[...slug]') // '/blog/post-1'\n * pathnameFromSlug(undefined, '/[...slug]') // '/'\n * pathnameFromSlug(undefined, '/blog/[...slug]') // '/blog'\n */\nexport function pathnameFromSlug(slug: string | undefined, pattern: string): string {\n // Extract the static prefix before the dynamic segment\n const prefixMatch = pattern.match(/^(.*?)\\[/);\n const prefix = prefixMatch ? prefixMatch[1].replace(/\\/$/, '') : '';\n\n if (!slug) {\n // No slug means root of this pattern\n return prefix || '/';\n }\n\n // Combine prefix and slug\n return `${prefix}/${slug}`;\n}\n"],"mappings":";;;;;;;AAAA,SAAgB,OAAO,OAAyC;CAC9D,IAAI,CAAC,OACH;CAGF,IAAI,iBAAiB,MACnB,OAAO;CAGT,MAAM,SAAS,IAAI,KAAK,KAAK;CAE7B,OAAO,OAAO,MAAM,OAAO,QAAQ,CAAC,IAAI,KAAA,IAAY;AACtD;AAOA,SAAgB,YAAY,MAAuB;CACjD,MAAM,sBAAM,IAAI,KAAK;CACrB,MAAM,YAAY,OAAO,KAAK,SAAS;CACvC,MAAM,cAAc,OAAO,KAAK,WAAW;CAE3C,IAAI,aAAa,YAAY,KAC3B,OAAO;CAGT,IAAI,eAAe,eAAe,KAChC,OAAO;CAGT,OAAO;AACT;;;;;;;;;;;;;;;;;AAkBA,SAAgB,wBAAwB,UAAkB,SAAqC;CAK7F,MAAM,cAAc,QAAQ,MAAM,UAAU;CAC5C,MAAM,SAAS,cAAc,YAAY,EAAE,CAAC,QAAQ,OAAO,EAAE,IAAI;CAUjE,OAPiB,SAAS,MAAM,OAAO,MAGnB,CAAC,CAAC,QAAQ,OAAO,EAI3B,KAAK,KAAA;AACjB;;;;;;;;;;;;;;;;AAiBA,SAAgB,iBAAiB,MAA0B,SAAyB;CAElF,MAAM,cAAc,QAAQ,MAAM,UAAU;CAC5C,MAAM,SAAS,cAAc,YAAY,EAAE,CAAC,QAAQ,OAAO,EAAE,IAAI;CAEjE,IAAI,CAAC,MAEH,OAAO,UAAU;CAInB,OAAO,GAAG,OAAO,GAAG;AACtB"}
@@ -1,5 +1,4 @@
1
1
  import { APIRoute } from "astro";
2
-
3
2
  //#region src/mime-types.d.ts
4
3
  /** MIME types for SPA static asset serving. Covers all file types produced by the cms-spa build. */
5
4
  declare const SPA_MIME_TYPES: Record<string, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"cms-handler.d.mts","names":[],"sources":["../../src/mime-types.ts","../../src/cms-handler.ts"],"mappings":";;;;cACa,cAAA,EAAgB,MAAA;;;;AAA7B;;;;;;;;ACuCA;;;;;;cAAa,GAAA,EAAK,QAAA"}
1
+ {"version":3,"file":"cms-handler.d.mts","names":[],"sources":["../../src/mime-types.ts","../../src/cms-handler.ts"],"mappings":";;;cACa,gBAAgB;;;;;;;;;;;;;;;;;;cC8DhB,KAAK"}