@nuasite/cms 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +237 -0
  2. package/dist/src/build-processor.d.ts +20 -0
  3. package/dist/src/build-processor.d.ts.map +1 -0
  4. package/dist/src/collection-scanner.d.ts +6 -0
  5. package/dist/src/collection-scanner.d.ts.map +1 -0
  6. package/dist/src/component-registry.d.ts +63 -0
  7. package/dist/src/component-registry.d.ts.map +1 -0
  8. package/dist/src/config.d.ts +24 -0
  9. package/dist/src/config.d.ts.map +1 -0
  10. package/dist/src/dev-middleware.d.ts +20 -0
  11. package/dist/src/dev-middleware.d.ts.map +1 -0
  12. package/dist/src/editor/ai.d.ts +60 -0
  13. package/dist/src/editor/ai.d.ts.map +1 -0
  14. package/dist/src/editor/api.d.ts +140 -0
  15. package/dist/src/editor/api.d.ts.map +1 -0
  16. package/dist/src/editor/color-utils.d.ts +106 -0
  17. package/dist/src/editor/color-utils.d.ts.map +1 -0
  18. package/dist/src/editor/components/ai-chat.d.ts +11 -0
  19. package/dist/src/editor/components/ai-chat.d.ts.map +1 -0
  20. package/dist/src/editor/components/ai-tooltip.d.ts +12 -0
  21. package/dist/src/editor/components/ai-tooltip.d.ts.map +1 -0
  22. package/dist/src/editor/components/attribute-editor.d.ts +5 -0
  23. package/dist/src/editor/components/attribute-editor.d.ts.map +1 -0
  24. package/dist/src/editor/components/block-editor.d.ts +12 -0
  25. package/dist/src/editor/components/block-editor.d.ts.map +1 -0
  26. package/dist/src/editor/components/collections-browser.d.ts +2 -0
  27. package/dist/src/editor/components/collections-browser.d.ts.map +1 -0
  28. package/dist/src/editor/components/color-toolbar.d.ts +12 -0
  29. package/dist/src/editor/components/color-toolbar.d.ts.map +1 -0
  30. package/dist/src/editor/components/confirm-dialog.d.ts +2 -0
  31. package/dist/src/editor/components/confirm-dialog.d.ts.map +1 -0
  32. package/dist/src/editor/components/create-page-modal.d.ts +2 -0
  33. package/dist/src/editor/components/create-page-modal.d.ts.map +1 -0
  34. package/dist/src/editor/components/editable-highlights.d.ts +9 -0
  35. package/dist/src/editor/components/editable-highlights.d.ts.map +1 -0
  36. package/dist/src/editor/components/error-boundary.d.ts +32 -0
  37. package/dist/src/editor/components/error-boundary.d.ts.map +1 -0
  38. package/dist/src/editor/components/fields.d.ts +75 -0
  39. package/dist/src/editor/components/fields.d.ts.map +1 -0
  40. package/dist/src/editor/components/frontmatter-fields.d.ts +29 -0
  41. package/dist/src/editor/components/frontmatter-fields.d.ts.map +1 -0
  42. package/dist/src/editor/components/highlight-overlay.d.ts +64 -0
  43. package/dist/src/editor/components/highlight-overlay.d.ts.map +1 -0
  44. package/dist/src/editor/components/image-overlay.d.ts +12 -0
  45. package/dist/src/editor/components/image-overlay.d.ts.map +1 -0
  46. package/dist/src/editor/components/markdown-editor-overlay.d.ts +6 -0
  47. package/dist/src/editor/components/markdown-editor-overlay.d.ts.map +1 -0
  48. package/dist/src/editor/components/markdown-inline-editor.d.ts +10 -0
  49. package/dist/src/editor/components/markdown-inline-editor.d.ts.map +1 -0
  50. package/dist/src/editor/components/media-library.d.ts +2 -0
  51. package/dist/src/editor/components/media-library.d.ts.map +1 -0
  52. package/dist/src/editor/components/outline.d.ts +21 -0
  53. package/dist/src/editor/components/outline.d.ts.map +1 -0
  54. package/dist/src/editor/components/redirect-countdown.d.ts +2 -0
  55. package/dist/src/editor/components/redirect-countdown.d.ts.map +1 -0
  56. package/dist/src/editor/components/seo-editor.d.ts +2 -0
  57. package/dist/src/editor/components/seo-editor.d.ts.map +1 -0
  58. package/dist/src/editor/components/text-style-toolbar.d.ts +8 -0
  59. package/dist/src/editor/components/text-style-toolbar.d.ts.map +1 -0
  60. package/dist/src/editor/components/toast/toast-container.d.ts +7 -0
  61. package/dist/src/editor/components/toast/toast-container.d.ts.map +1 -0
  62. package/dist/src/editor/components/toast/toast.d.ts +7 -0
  63. package/dist/src/editor/components/toast/toast.d.ts.map +1 -0
  64. package/dist/src/editor/components/toast/types.d.ts +7 -0
  65. package/dist/src/editor/components/toast/types.d.ts.map +1 -0
  66. package/dist/src/editor/components/toolbar.d.ts +21 -0
  67. package/dist/src/editor/components/toolbar.d.ts.map +1 -0
  68. package/dist/src/editor/config.d.ts +4 -0
  69. package/dist/src/editor/config.d.ts.map +1 -0
  70. package/dist/src/editor/constants.d.ts +101 -0
  71. package/dist/src/editor/constants.d.ts.map +1 -0
  72. package/dist/src/editor/context.d.ts +14 -0
  73. package/dist/src/editor/context.d.ts.map +1 -0
  74. package/dist/src/editor/dom.d.ts +77 -0
  75. package/dist/src/editor/dom.d.ts.map +1 -0
  76. package/dist/src/editor/editor.d.ts +64 -0
  77. package/dist/src/editor/editor.d.ts.map +1 -0
  78. package/dist/src/editor/history.d.ts +20 -0
  79. package/dist/src/editor/history.d.ts.map +1 -0
  80. package/dist/src/editor/hooks/index.d.ts +14 -0
  81. package/dist/src/editor/hooks/index.d.ts.map +1 -0
  82. package/dist/src/editor/hooks/useAIHandlers.d.ts +22 -0
  83. package/dist/src/editor/hooks/useAIHandlers.d.ts.map +1 -0
  84. package/dist/src/editor/hooks/useBlockEditorHandlers.d.ts +18 -0
  85. package/dist/src/editor/hooks/useBlockEditorHandlers.d.ts.map +1 -0
  86. package/dist/src/editor/hooks/useElementDetection.d.ts +26 -0
  87. package/dist/src/editor/hooks/useElementDetection.d.ts.map +1 -0
  88. package/dist/src/editor/hooks/useImageHoverDetection.d.ts +12 -0
  89. package/dist/src/editor/hooks/useImageHoverDetection.d.ts.map +1 -0
  90. package/dist/src/editor/hooks/useTextSelection.d.ts +23 -0
  91. package/dist/src/editor/hooks/useTextSelection.d.ts.map +1 -0
  92. package/dist/src/editor/hooks/useTooltipState.d.ts +19 -0
  93. package/dist/src/editor/hooks/useTooltipState.d.ts.map +1 -0
  94. package/dist/src/editor/hooks/utils.d.ts +32 -0
  95. package/dist/src/editor/hooks/utils.d.ts.map +1 -0
  96. package/dist/src/editor/index.d.ts +12 -0
  97. package/dist/src/editor/index.d.ts.map +1 -0
  98. package/dist/src/editor/lib/cn.d.ts +3 -0
  99. package/dist/src/editor/lib/cn.d.ts.map +1 -0
  100. package/dist/src/editor/manifest.d.ts +19 -0
  101. package/dist/src/editor/manifest.d.ts.map +1 -0
  102. package/dist/src/editor/markdown-api.d.ts +36 -0
  103. package/dist/src/editor/markdown-api.d.ts.map +1 -0
  104. package/dist/src/editor/signals.d.ts +242 -0
  105. package/dist/src/editor/signals.d.ts.map +1 -0
  106. package/dist/src/editor/storage.d.ts +27 -0
  107. package/dist/src/editor/storage.d.ts.map +1 -0
  108. package/dist/src/editor/text-styling.d.ts +350 -0
  109. package/dist/src/editor/text-styling.d.ts.map +1 -0
  110. package/dist/src/editor/themes.d.ts +38 -0
  111. package/dist/src/editor/themes.d.ts.map +1 -0
  112. package/dist/src/editor/types.d.ts +454 -0
  113. package/dist/src/editor/types.d.ts.map +1 -0
  114. package/dist/src/error-collector.d.ts +56 -0
  115. package/dist/src/error-collector.d.ts.map +1 -0
  116. package/dist/src/handlers/component-ops.d.ts +34 -0
  117. package/dist/src/handlers/component-ops.d.ts.map +1 -0
  118. package/dist/src/handlers/markdown-ops.d.ts +41 -0
  119. package/dist/src/handlers/markdown-ops.d.ts.map +1 -0
  120. package/dist/src/handlers/request-utils.d.ts +20 -0
  121. package/dist/src/handlers/request-utils.d.ts.map +1 -0
  122. package/dist/src/handlers/source-writer.d.ts +51 -0
  123. package/dist/src/handlers/source-writer.d.ts.map +1 -0
  124. package/dist/src/html-processor.d.ts +63 -0
  125. package/dist/src/html-processor.d.ts.map +1 -0
  126. package/dist/src/index.d.ts +41 -0
  127. package/dist/src/index.d.ts.map +1 -0
  128. package/dist/src/manifest-writer.d.ts +111 -0
  129. package/dist/src/manifest-writer.d.ts.map +1 -0
  130. package/dist/src/media/contember.d.ts +15 -0
  131. package/dist/src/media/contember.d.ts.map +1 -0
  132. package/dist/src/media/local.d.ts +9 -0
  133. package/dist/src/media/local.d.ts.map +1 -0
  134. package/dist/src/media/s3.d.ts +12 -0
  135. package/dist/src/media/s3.d.ts.map +1 -0
  136. package/dist/src/media/types.d.ts +40 -0
  137. package/dist/src/media/types.d.ts.map +1 -0
  138. package/dist/src/preview-generator.d.ts +19 -0
  139. package/dist/src/preview-generator.d.ts.map +1 -0
  140. package/dist/src/seo-processor.d.ts +23 -0
  141. package/dist/src/seo-processor.d.ts.map +1 -0
  142. package/dist/src/source-finder/ast-extractors.d.ts +35 -0
  143. package/dist/src/source-finder/ast-extractors.d.ts.map +1 -0
  144. package/dist/src/source-finder/ast-parser.d.ts +16 -0
  145. package/dist/src/source-finder/ast-parser.d.ts.map +1 -0
  146. package/dist/src/source-finder/cache.d.ts +18 -0
  147. package/dist/src/source-finder/cache.d.ts.map +1 -0
  148. package/dist/src/source-finder/collection-finder.d.ts +29 -0
  149. package/dist/src/source-finder/collection-finder.d.ts.map +1 -0
  150. package/dist/src/source-finder/cross-file-tracker.d.ts +39 -0
  151. package/dist/src/source-finder/cross-file-tracker.d.ts.map +1 -0
  152. package/dist/src/source-finder/element-finder.d.ts +42 -0
  153. package/dist/src/source-finder/element-finder.d.ts.map +1 -0
  154. package/dist/src/source-finder/image-finder.d.ts +24 -0
  155. package/dist/src/source-finder/image-finder.d.ts.map +1 -0
  156. package/dist/src/source-finder/index.d.ts +9 -0
  157. package/dist/src/source-finder/index.d.ts.map +1 -0
  158. package/dist/src/source-finder/search-index.d.ts +27 -0
  159. package/dist/src/source-finder/search-index.d.ts.map +1 -0
  160. package/dist/src/source-finder/snippet-utils.d.ts +90 -0
  161. package/dist/src/source-finder/snippet-utils.d.ts.map +1 -0
  162. package/dist/src/source-finder/source-lookup.d.ts +16 -0
  163. package/dist/src/source-finder/source-lookup.d.ts.map +1 -0
  164. package/dist/src/source-finder/types.d.ts +167 -0
  165. package/dist/src/source-finder/types.d.ts.map +1 -0
  166. package/dist/src/source-finder/variable-extraction.d.ts +37 -0
  167. package/dist/src/source-finder/variable-extraction.d.ts.map +1 -0
  168. package/dist/src/tailwind-colors.d.ts +54 -0
  169. package/dist/src/tailwind-colors.d.ts.map +1 -0
  170. package/dist/src/tsconfig.tsbuildinfo +1 -0
  171. package/dist/src/types.d.ts +367 -0
  172. package/dist/src/types.d.ts.map +1 -0
  173. package/dist/src/utils.d.ts +61 -0
  174. package/dist/src/utils.d.ts.map +1 -0
  175. package/dist/src/vite-plugin.d.ts +14 -0
  176. package/dist/src/vite-plugin.d.ts.map +1 -0
  177. package/dist/types/tsconfig.tsbuildinfo +1 -0
  178. package/package.json +80 -0
  179. package/src/build-processor.ts +784 -0
  180. package/src/collection-scanner.ts +304 -0
  181. package/src/component-registry.ts +393 -0
  182. package/src/config.ts +74 -0
  183. package/src/dev-middleware.ts +525 -0
  184. package/src/dist/src/tsconfig.tsbuildinfo +1 -0
  185. package/src/editor/ai.ts +185 -0
  186. package/src/editor/api.ts +513 -0
  187. package/src/editor/color-utils.ts +556 -0
  188. package/src/editor/components/ai-chat.tsx +632 -0
  189. package/src/editor/components/ai-tooltip.tsx +179 -0
  190. package/src/editor/components/attribute-editor.tsx +596 -0
  191. package/src/editor/components/block-editor.tsx +546 -0
  192. package/src/editor/components/collections-browser.tsx +248 -0
  193. package/src/editor/components/color-toolbar.tsx +314 -0
  194. package/src/editor/components/confirm-dialog.tsx +69 -0
  195. package/src/editor/components/create-page-modal.tsx +163 -0
  196. package/src/editor/components/editable-highlights.tsx +260 -0
  197. package/src/editor/components/error-boundary.tsx +87 -0
  198. package/src/editor/components/fields.tsx +387 -0
  199. package/src/editor/components/frontmatter-fields.tsx +469 -0
  200. package/src/editor/components/highlight-overlay.ts +229 -0
  201. package/src/editor/components/image-overlay.tsx +230 -0
  202. package/src/editor/components/markdown-editor-overlay.tsx +505 -0
  203. package/src/editor/components/markdown-inline-editor.tsx +780 -0
  204. package/src/editor/components/media-library.tsx +297 -0
  205. package/src/editor/components/outline.tsx +402 -0
  206. package/src/editor/components/redirect-countdown.tsx +45 -0
  207. package/src/editor/components/seo-editor.tsx +498 -0
  208. package/src/editor/components/text-style-toolbar.tsx +362 -0
  209. package/src/editor/components/toast/toast-container.tsx +15 -0
  210. package/src/editor/components/toast/toast.tsx +49 -0
  211. package/src/editor/components/toast/types.ts +7 -0
  212. package/src/editor/components/toolbar.tsx +366 -0
  213. package/src/editor/config.ts +12 -0
  214. package/src/editor/constants.ts +106 -0
  215. package/src/editor/context.tsx +38 -0
  216. package/src/editor/dom.ts +357 -0
  217. package/src/editor/editor.ts +1510 -0
  218. package/src/editor/env.d.ts +4 -0
  219. package/src/editor/history.ts +355 -0
  220. package/src/editor/hooks/index.ts +19 -0
  221. package/src/editor/hooks/useAIHandlers.ts +345 -0
  222. package/src/editor/hooks/useBlockEditorHandlers.ts +206 -0
  223. package/src/editor/hooks/useElementDetection.ts +284 -0
  224. package/src/editor/hooks/useImageHoverDetection.ts +102 -0
  225. package/src/editor/hooks/useTextSelection.ts +187 -0
  226. package/src/editor/hooks/useTooltipState.ts +126 -0
  227. package/src/editor/hooks/utils.ts +101 -0
  228. package/src/editor/index.tsx +481 -0
  229. package/src/editor/lib/cn.ts +4 -0
  230. package/src/editor/manifest.ts +25 -0
  231. package/src/editor/markdown-api.ts +209 -0
  232. package/src/editor/signals.ts +1351 -0
  233. package/src/editor/storage.ts +266 -0
  234. package/src/editor/styles.css +465 -0
  235. package/src/editor/text-styling.ts +773 -0
  236. package/src/editor/themes.ts +210 -0
  237. package/src/editor/types.ts +591 -0
  238. package/src/error-collector.ts +106 -0
  239. package/src/handlers/component-ops.ts +463 -0
  240. package/src/handlers/markdown-ops.ts +202 -0
  241. package/src/handlers/request-utils.ts +151 -0
  242. package/src/handlers/source-writer.ts +649 -0
  243. package/src/html-processor.ts +1108 -0
  244. package/src/index.ts +284 -0
  245. package/src/manifest-writer.ts +371 -0
  246. package/src/media/contember.ts +84 -0
  247. package/src/media/local.ts +114 -0
  248. package/src/media/s3.ts +133 -0
  249. package/src/media/types.ts +33 -0
  250. package/src/preview-generator.ts +293 -0
  251. package/src/seo-processor.ts +567 -0
  252. package/src/source-finder/ast-extractors.ts +185 -0
  253. package/src/source-finder/ast-parser.ts +150 -0
  254. package/src/source-finder/cache.ts +76 -0
  255. package/src/source-finder/collection-finder.ts +335 -0
  256. package/src/source-finder/cross-file-tracker.ts +741 -0
  257. package/src/source-finder/element-finder.ts +387 -0
  258. package/src/source-finder/image-finder.ts +283 -0
  259. package/src/source-finder/index.ts +37 -0
  260. package/src/source-finder/search-index.ts +525 -0
  261. package/src/source-finder/snippet-utils.ts +668 -0
  262. package/src/source-finder/source-lookup.ts +200 -0
  263. package/src/source-finder/types.ts +210 -0
  264. package/src/source-finder/variable-extraction.ts +406 -0
  265. package/src/tailwind-colors.ts +874 -0
  266. package/src/tsconfig.json +25 -0
  267. package/src/types.ts +406 -0
  268. package/src/utils.ts +186 -0
  269. package/src/vite-plugin.ts +42 -0
@@ -0,0 +1,51 @@
1
+ import type { ManifestWriter } from '../manifest-writer';
2
+ export interface ColorChangePayload {
3
+ oldClass: string;
4
+ newClass: string;
5
+ type: 'bg' | 'text' | 'border' | 'hoverBg' | 'hoverText';
6
+ sourcePath?: string;
7
+ sourceLine?: number;
8
+ sourceSnippet?: string;
9
+ }
10
+ export interface ImageChangePayload {
11
+ newSrc: string;
12
+ newAlt: string;
13
+ }
14
+ export interface AttributeChangePayload {
15
+ attributeName: string;
16
+ oldValue: string | undefined;
17
+ newValue: string | undefined;
18
+ sourcePath?: string;
19
+ sourceLine?: number;
20
+ sourceSnippet?: string;
21
+ }
22
+ export interface ChangePayload {
23
+ cmsId: string;
24
+ newValue: string;
25
+ originalValue: string;
26
+ sourcePath: string;
27
+ sourceLine: number;
28
+ sourceSnippet: string;
29
+ htmlValue?: string;
30
+ childCmsIds?: string[];
31
+ hasStyledContent?: boolean;
32
+ colorChange?: ColorChangePayload;
33
+ imageChange?: ImageChangePayload;
34
+ attributeChanges?: AttributeChangePayload[];
35
+ }
36
+ export interface SaveBatchRequest {
37
+ changes: ChangePayload[];
38
+ meta: {
39
+ source: string;
40
+ url: string;
41
+ };
42
+ }
43
+ export interface SaveBatchResponse {
44
+ updated: number;
45
+ errors?: Array<{
46
+ cmsId: string;
47
+ error: string;
48
+ }>;
49
+ }
50
+ export declare function handleUpdate(request: SaveBatchRequest, manifestWriter: ManifestWriter): Promise<SaveBatchResponse>;
51
+ //# sourceMappingURL=source-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-writer.d.ts","sourceRoot":"","sources":["../../../src/handlers/source-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAIxD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAA;IACxD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACtC,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,gBAAgB,CAAC,EAAE,sBAAsB,EAAE,CAAA;CAC3C;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CACrC;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD;AAED,wBAAsB,YAAY,CACjC,OAAO,EAAE,gBAAgB,EACzB,cAAc,EAAE,cAAc,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAoE5B"}
@@ -0,0 +1,63 @@
1
+ import type { ComponentInstance, ManifestEntry, PageSeoData, SeoOptions } from './types';
2
+ /**
3
+ * Inline text styling elements that should NOT be marked with CMS IDs.
4
+ * These elements are text formatting and should be part of their parent's content.
5
+ * They will be preserved as HTML when editing the parent element.
6
+ */
7
+ export declare const INLINE_STYLE_TAGS: readonly ["strong", "b", "em", "i", "u", "s", "strike", "del", "ins", "mark", "small", "sub", "sup", "abbr", "cite", "code", "kbd", "samp", "var", "time", "dfn", "q"];
8
+ export interface ProcessHtmlOptions {
9
+ attributeName: string;
10
+ includeTags: string[] | null;
11
+ excludeTags: string[];
12
+ includeEmptyText: boolean;
13
+ generateManifest: boolean;
14
+ markComponents?: boolean;
15
+ componentDirs?: string[];
16
+ excludeComponentDirs?: string[];
17
+ markStyledSpans?: boolean;
18
+ /** When true, only mark elements that have source file attributes (from Astro templates) */
19
+ skipMarkdownContent?: boolean;
20
+ /**
21
+ * When true, skip marking inline text styling elements (strong, b, em, i, etc.).
22
+ * These elements will be preserved as part of their parent's HTML content.
23
+ * Defaults to true.
24
+ */
25
+ skipInlineStyleTags?: boolean;
26
+ /** Collection info for marking the wrapper element containing markdown content */
27
+ collectionInfo?: {
28
+ name: string;
29
+ slug: string;
30
+ /** First line of the markdown body (used to find wrapper element in build mode) */
31
+ bodyFirstLine?: string;
32
+ /** Full markdown body text (used for robust wrapper detection in build mode) */
33
+ bodyText?: string;
34
+ /** Path to the markdown file (e.g., 'src/content/blog/my-post.md') */
35
+ contentPath?: string;
36
+ };
37
+ /** SEO tracking options */
38
+ seo?: SeoOptions;
39
+ }
40
+ export interface ProcessHtmlResult {
41
+ html: string;
42
+ entries: Record<string, ManifestEntry>;
43
+ components: Record<string, ComponentInstance>;
44
+ /** ID of the element wrapping collection markdown content */
45
+ collectionWrapperId?: string;
46
+ /** Extracted SEO data from the page */
47
+ seo?: PageSeoData;
48
+ }
49
+ /**
50
+ * Process HTML to inject CMS markers and extract manifest entries
51
+ */
52
+ export declare function processHtml(html: string, fileId: string, options: ProcessHtmlOptions, getNextId: () => string, sourcePath?: string): Promise<ProcessHtmlResult>;
53
+ /**
54
+ * Extract component name from source file path
55
+ * e.g., "src/components/Welcome.astro" -> "Welcome"
56
+ * e.g., "src/components/ui/Button.astro" -> "Button"
57
+ */
58
+ export declare function extractComponentName(sourceFile: string): string;
59
+ /**
60
+ * Clean text for comparison (normalize whitespace)
61
+ */
62
+ export declare function cleanText(text: string): string;
63
+ //# sourceMappingURL=html-processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-processor.d.ts","sourceRoot":"","sources":["../../src/html-processor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAa,iBAAiB,EAAiB,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMlH;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,wKAuBpB,CAAA;AAEV,MAAM,WAAW,kBAAkB;IAClC,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC5B,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,gBAAgB,EAAE,OAAO,CAAA;IACzB,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,4FAA4F;IAC5F,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,kFAAkF;IAClF,cAAc,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,mFAAmF;QACnF,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,gFAAgF;QAChF,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,sEAAsE;QACtE,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,2BAA2B;IAC3B,GAAG,CAAC,EAAE,UAAU,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC7C,6DAA6D;IAC7D,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,uCAAuC;IACvC,GAAG,CAAC,EAAE,WAAW,CAAA;CACjB;AAwHD;;GAEG;AACH,wBAAsB,WAAW,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,EAC3B,SAAS,EAAE,MAAM,MAAM,EACvB,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAksB5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAK/D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE9C"}
@@ -0,0 +1,41 @@
1
+ import type { AstroIntegration } from 'astro';
2
+ import type { MediaStorageAdapter } from './media/types';
3
+ import type { CmsMarkerOptions } from './types';
4
+ export interface NuaCmsOptions extends CmsMarkerOptions {
5
+ /**
6
+ * URL to the CMS editor script.
7
+ * If not set, the built-in editor bundle is served from the dev server.
8
+ */
9
+ src?: string;
10
+ /**
11
+ * CMS configuration passed as window.NuaCmsConfig.
12
+ */
13
+ cmsConfig?: {
14
+ apiBase?: string;
15
+ highlightColor?: string;
16
+ debug?: boolean;
17
+ theme?: Record<string, string>;
18
+ themePreset?: string;
19
+ };
20
+ /**
21
+ * Proxy /_nua/cms requests to this target URL during dev.
22
+ * Example: 'http://localhost:8787'
23
+ */
24
+ proxy?: string;
25
+ /**
26
+ * Media storage adapter for file uploads.
27
+ * Defaults to local filesystem (public/uploads) when no proxy is configured.
28
+ */
29
+ media?: MediaStorageAdapter;
30
+ }
31
+ export default function nuaCms(options?: NuaCmsOptions): AstroIntegration;
32
+ export { createContemberStorageAdapter as contemberMedia } from './media/contember';
33
+ export { createLocalStorageAdapter as localMedia } from './media/local';
34
+ export { createS3StorageAdapter as s3Media } from './media/s3';
35
+ export type { MediaItem, MediaStorageAdapter } from './media/types';
36
+ export { scanCollections } from './collection-scanner';
37
+ export { getProjectRoot, resetProjectRoot, setProjectRoot } from './config';
38
+ export type { CollectionInfo, MarkdownContent, SourceLocation, VariableReference } from './source-finder';
39
+ export { findCollectionSource, parseMarkdownContent } from './source-finder';
40
+ export type { Attribute, AvailableColors, AvailableTextStyles, CanonicalUrl, CmsManifest, CmsMarkerOptions, CollectionDefinition, CollectionEntry, ComponentDefinition, ComponentInstance, ComponentProp, ContentConstraints, FieldDefinition, FieldType, ImageMetadata, JsonLdEntry, ManifestEntry, ManifestMetadata, OpenGraphData, PageEntry, PageSeoData, SeoKeywords, SeoMetaTag, SeoOptions, SeoSourceInfo, SeoTitle, TailwindColor, TextStyleValue, TwitterCardData, } from './types';
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAa7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAuB,MAAM,SAAS,CAAA;AAGpE,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACtD;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;IACD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,mBAAmB,CAAA;CAC3B;AAID,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,gBAAgB,CAmM5E;AAED,OAAO,EAAE,6BAA6B,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACnF,OAAO,EAAE,yBAAyB,IAAI,UAAU,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,EAAE,sBAAsB,IAAI,OAAO,EAAE,MAAM,YAAY,CAAA;AAC9D,YAAY,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAEnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAC3E,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACzG,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAC5E,YAAY,EACX,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,SAAS,EACT,aAAa,EACb,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,WAAW,EACX,WAAW,EACX,UAAU,EACV,UAAU,EACV,aAAa,EACb,QAAQ,EACR,aAAa,EACb,cAAc,EACd,eAAe,GACf,MAAM,SAAS,CAAA"}
@@ -0,0 +1,111 @@
1
+ import type { AvailableColors, AvailableTextStyles, CmsManifest, CollectionDefinition, CollectionEntry, ComponentDefinition, ComponentInstance, ManifestEntry, PageSeoData } from './types';
2
+ /**
3
+ * Manages streaming manifest writes during build.
4
+ * Accumulates entries and writes per-page manifests as pages are processed.
5
+ */
6
+ export declare class ManifestWriter {
7
+ private globalManifest;
8
+ private pageManifests;
9
+ private outDir;
10
+ private manifestFile;
11
+ private componentDefinitions;
12
+ private collectionDefinitions;
13
+ private availableColors;
14
+ private availableTextStyles;
15
+ private writeQueue;
16
+ constructor(manifestFile: string, componentDefinitions?: Record<string, ComponentDefinition>);
17
+ /**
18
+ * Set the output directory for manifest files
19
+ */
20
+ setOutDir(dir: string): void;
21
+ /**
22
+ * Update component definitions (called after initial scan)
23
+ */
24
+ setComponentDefinitions(definitions: Record<string, ComponentDefinition>): void;
25
+ /**
26
+ * Load available Tailwind colors and text styles from the project's CSS config
27
+ */
28
+ loadAvailableColors(projectRoot?: string): Promise<void>;
29
+ /**
30
+ * Set available colors directly (for testing or custom colors)
31
+ */
32
+ setAvailableColors(colors: AvailableColors): void;
33
+ /**
34
+ * Set available text styles directly (for testing or custom styles)
35
+ */
36
+ setAvailableTextStyles(textStyles: AvailableTextStyles): void;
37
+ /**
38
+ * Set collection definitions (inferred schemas for content collections)
39
+ */
40
+ setCollectionDefinitions(definitions: Record<string, CollectionDefinition>): void;
41
+ /**
42
+ * Get collection definitions
43
+ */
44
+ getCollectionDefinitions(): Record<string, CollectionDefinition>;
45
+ /**
46
+ * Get the manifest path for a given page
47
+ * Places manifest next to the page: /about -> /about.json, / -> /index.json
48
+ */
49
+ private getPageManifestPath;
50
+ /**
51
+ * Add a page's entries to the manifest (called after each page is processed)
52
+ * This is non-blocking - writes are queued
53
+ */
54
+ addPage(pagePath: string, entries: Record<string, ManifestEntry>, components: Record<string, ComponentInstance>, collection?: CollectionEntry, seo?: PageSeoData): void;
55
+ /**
56
+ * Write a single page manifest to disk
57
+ */
58
+ private writePageManifest;
59
+ /**
60
+ * Finalize manifest writes
61
+ * Call this in astro:build:done to ensure all writes complete
62
+ */
63
+ finalize(): Promise<{
64
+ totalEntries: number;
65
+ totalPages: number;
66
+ totalComponents: number;
67
+ }>;
68
+ /**
69
+ * Get the global manifest (for virtual module support)
70
+ */
71
+ getGlobalManifest(): CmsManifest;
72
+ /**
73
+ * Get a page's manifest data (for dev mode)
74
+ */
75
+ getPageManifest(pagePath: string): {
76
+ entries: Record<string, ManifestEntry>;
77
+ components: Record<string, ComponentInstance>;
78
+ collection?: CollectionEntry;
79
+ seo?: PageSeoData;
80
+ } | undefined;
81
+ /**
82
+ * Reset state (for dev mode reloads)
83
+ */
84
+ reset(): void;
85
+ /**
86
+ * Get page data for preview generation (pages and their components)
87
+ */
88
+ getPageDataForPreviews(): Map<string, {
89
+ entries: Record<string, ManifestEntry>;
90
+ components: Record<string, ComponentInstance>;
91
+ collection?: CollectionEntry;
92
+ seo?: PageSeoData;
93
+ }>;
94
+ /**
95
+ * Get component definitions
96
+ */
97
+ getComponentDefinitions(): Record<string, ComponentDefinition>;
98
+ /**
99
+ * Get the output directory
100
+ */
101
+ getOutDir(): string;
102
+ /**
103
+ * Get available colors (for use in dev middleware)
104
+ */
105
+ getAvailableColors(): AvailableColors | undefined;
106
+ /**
107
+ * Get available text styles (for use in dev middleware)
108
+ */
109
+ getAvailableTextStyles(): AvailableTextStyles | undefined;
110
+ }
111
+ //# sourceMappingURL=manifest-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest-writer.d.ts","sourceRoot":"","sources":["../../src/manifest-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EAGb,WAAW,EACX,MAAM,SAAS,CAAA;AAMhB;;;GAGG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,cAAc,CAAa;IACnC,OAAO,CAAC,aAAa,CAKP;IACd,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,oBAAoB,CAAqC;IACjE,OAAO,CAAC,qBAAqB,CAA2C;IACxE,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,mBAAmB,CAAiC;IAC5D,OAAO,CAAC,UAAU,CAAmC;gBAEzC,YAAY,EAAE,MAAM,EAAE,oBAAoB,GAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAM;IAYhG;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI5B;;OAEG;IACH,uBAAuB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,IAAI;IAK/E;;OAEG;IACG,mBAAmB,CAAC,WAAW,GAAE,MAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOhF;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAKjD;;OAEG;IACH,sBAAsB,CAAC,UAAU,EAAE,mBAAmB,GAAG,IAAI;IAK7D;;OAEG;IACH,wBAAwB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,IAAI;IAKjF;;OAEG;IACH,wBAAwB,IAAI,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAIhE;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAQ3B;;;OAGG;IACH,OAAO,CACN,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAC7C,UAAU,CAAC,EAAE,eAAe,EAC5B,GAAG,CAAC,EAAE,WAAW,GACf,IAAI;IAoCP;;OAEG;YACW,iBAAiB;IAgD/B;;;OAGG;IACG,QAAQ,IAAI,OAAO,CAAC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IAwEhG;;OAEG;IACH,iBAAiB,IAAI,WAAW;IAIhC;;OAEG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG;QAClC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;QAC7C,UAAU,CAAC,EAAE,eAAe,CAAA;QAC5B,GAAG,CAAC,EAAE,WAAW,CAAA;KACjB,GAAG,SAAS;IAIb;;OAEG;IACH,KAAK,IAAI,IAAI;IAcb;;OAEG;IACH,sBAAsB,IAAI,GAAG,CAAC,MAAM,EAAE;QACrC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;QACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;QAC7C,UAAU,CAAC,EAAE,eAAe,CAAA;QAC5B,GAAG,CAAC,EAAE,WAAW,CAAA;KACjB,CAAC;IAIF;;OAEG;IACH,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC;IAI9D;;OAEG;IACH,SAAS,IAAI,MAAM;IAInB;;OAEG;IACH,kBAAkB,IAAI,eAAe,GAAG,SAAS;IAIjD;;OAEG;IACH,sBAAsB,IAAI,mBAAmB,GAAG,SAAS;CAGzD"}
@@ -0,0 +1,15 @@
1
+ import type { MediaStorageAdapter } from './types';
2
+ export interface ContemberStorageOptions {
3
+ /** Base URL of the worker API, e.g. 'https://api.example.com' */
4
+ apiBaseUrl: string;
5
+ /** Project slug used in the API path */
6
+ projectSlug: string;
7
+ /** Session token for authentication (NUA_SITE_SESSION_TOKEN cookie value) */
8
+ sessionToken?: string;
9
+ }
10
+ /**
11
+ * Media storage adapter that proxies to the Contember worker's CMS media endpoints.
12
+ * Uses the existing /cms/:projectSlug/media/* API backed by R2 storage + Contember database.
13
+ */
14
+ export declare function createContemberStorageAdapter(options: ContemberStorageOptions): MediaStorageAdapter;
15
+ //# sourceMappingURL=contember.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contember.d.ts","sourceRoot":"","sources":["../../../src/media/contember.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,uBAAuB;IACvC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAA;IACnB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,uBAAuB,GAAG,mBAAmB,CAoEnG"}
@@ -0,0 +1,9 @@
1
+ import type { MediaStorageAdapter } from './types';
2
+ export interface LocalStorageOptions {
3
+ /** Directory to store media files (relative to project root or absolute). Default: 'public/uploads' */
4
+ dir?: string;
5
+ /** URL prefix for serving files. Default: '/uploads' */
6
+ urlPrefix?: string;
7
+ }
8
+ export declare function createLocalStorageAdapter(options?: LocalStorageOptions): MediaStorageAdapter;
9
+ //# sourceMappingURL=local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/media/local.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAmB,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,mBAAmB;IACnC,uGAAuG;IACvG,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,mBAAwB,GAAG,mBAAmB,CA6EhG"}
@@ -0,0 +1,12 @@
1
+ import type { MediaStorageAdapter } from './types';
2
+ export interface S3StorageOptions {
3
+ bucket: string;
4
+ region: string;
5
+ accessKeyId?: string;
6
+ secretAccessKey?: string;
7
+ endpoint?: string;
8
+ cdnPrefix?: string;
9
+ prefix?: string;
10
+ }
11
+ export declare function createS3StorageAdapter(options: S3StorageOptions): MediaStorageAdapter;
12
+ //# sourceMappingURL=s3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/media/s3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,mBAAmB,EAAqB,MAAM,SAAS,CAAA;AAEtF,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAQD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,CA2GrF"}
@@ -0,0 +1,40 @@
1
+ export interface MediaItem {
2
+ id: string;
3
+ url: string;
4
+ filename: string;
5
+ annotation?: string;
6
+ contentType: string;
7
+ width?: number;
8
+ height?: number;
9
+ uploadedAt?: string;
10
+ }
11
+ export interface MediaListResult {
12
+ items: MediaItem[];
13
+ hasMore: boolean;
14
+ cursor?: string;
15
+ }
16
+ export interface MediaUploadResult {
17
+ success: boolean;
18
+ url?: string;
19
+ filename?: string;
20
+ annotation?: string;
21
+ id?: string;
22
+ error?: string;
23
+ }
24
+ export interface MediaStorageAdapter {
25
+ list(options?: {
26
+ limit?: number;
27
+ cursor?: string;
28
+ }): Promise<MediaListResult>;
29
+ upload(file: Buffer, filename: string, contentType: string): Promise<MediaUploadResult>;
30
+ delete(id: string): Promise<{
31
+ success: boolean;
32
+ error?: string;
33
+ }>;
34
+ /** Local filesystem info for direct file serving in dev (bypasses Vite's public dir cache) */
35
+ staticFiles?: {
36
+ urlPrefix: string;
37
+ dir: string;
38
+ };
39
+ }
40
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/media/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,eAAe;IAC/B,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAC7E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IACvF,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACjE,8FAA8F;IAC9F,WAAW,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAChD"}
@@ -0,0 +1,19 @@
1
+ import type { ComponentDefinition, ComponentInstance, ManifestEntry } from './types';
2
+ import type { CollectionEntry, PageSeoData } from './types';
3
+ type PageData = {
4
+ entries: Record<string, ManifestEntry>;
5
+ components: Record<string, ComponentInstance>;
6
+ collection?: CollectionEntry;
7
+ seo?: PageSeoData;
8
+ };
9
+ /**
10
+ * Generate standalone preview HTML files for each component that has
11
+ * at least one instance on a built page.
12
+ *
13
+ * Reads the built HTML, extracts the component DOM fragment, annotates
14
+ * text props for live preview updates, and writes a self-contained HTML
15
+ * page to `outDir/_cms-preview/<ComponentName>/index.html`.
16
+ */
17
+ export declare function generateComponentPreviews(outDir: string, pageManifests: Map<string, PageData>, componentDefinitions: Record<string, ComponentDefinition>): Promise<void>;
18
+ export {};
19
+ //# sourceMappingURL=preview-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview-generator.d.ts","sourceRoot":"","sources":["../../src/preview-generator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACpF,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,KAAK,QAAQ,GAAG;IACf,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC7C,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,GAAG,CAAC,EAAE,WAAW,CAAA;CACjB,CAAA;AA4LD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACpC,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,GACvD,OAAO,CAAC,IAAI,CAAC,CAiFf"}
@@ -0,0 +1,23 @@
1
+ import type { PageSeoData } from './types';
2
+ export interface ProcessSeoOptions {
3
+ /** Whether to mark the page title with a CMS ID (default: true) */
4
+ markTitle?: boolean;
5
+ /** Whether to parse JSON-LD structured data (default: true) */
6
+ parseJsonLd?: boolean;
7
+ /** Path to source file for source tracking (fallback) */
8
+ sourcePath?: string;
9
+ }
10
+ export interface ProcessSeoResult {
11
+ /** Extracted SEO data */
12
+ seo: PageSeoData;
13
+ /** The modified HTML with title CMS ID if markTitle is enabled */
14
+ html: string;
15
+ /** The CMS ID assigned to the title element */
16
+ titleId?: string;
17
+ }
18
+ /**
19
+ * Process HTML to extract SEO metadata from the <head> section.
20
+ * Returns structured SEO data with source tracking information.
21
+ */
22
+ export declare function processSeoFromHtml(html: string, options?: ProcessSeoOptions, getNextId?: () => string): Promise<ProcessSeoResult>;
23
+ //# sourceMappingURL=seo-processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seo-processor.d.ts","sourceRoot":"","sources":["../../src/seo-processor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA4C,WAAW,EAAkE,MAAM,SAAS,CAAA;AAKpJ,MAAM,WAAW,iBAAiB;IACjC,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAChC,yBAAyB;IACzB,GAAG,EAAE,WAAW,CAAA;IAChB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAA;IACZ,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,iBAAsB,EAC/B,SAAS,CAAC,EAAE,MAAM,MAAM,GACtB,OAAO,CAAC,gBAAgB,CAAC,CAwD3B"}
@@ -0,0 +1,35 @@
1
+ import type { BabelNode, LineTransformer, VariableDefinition } from './types';
2
+ /**
3
+ * Extract string value from a Babel node (StringLiteral or simple TemplateLiteral)
4
+ */
5
+ export declare function getStringValue(node: BabelNode): string | null;
6
+ /**
7
+ * Recursively extract properties from an object expression
8
+ * @param objNode - The ObjectExpression node
9
+ * @param parentPath - The full path to this object (e.g., 'config' or 'config.nav')
10
+ * @param definitions - Array to collect definitions into
11
+ * @param lineTransformer - Transforms Babel line numbers to file line numbers
12
+ */
13
+ export declare function extractObjectProperties(objNode: BabelNode, parentPath: string, definitions: VariableDefinition[], lineTransformer: LineTransformer): void;
14
+ /**
15
+ * Extract elements from an array expression
16
+ * @param arrNode - The ArrayExpression node
17
+ * @param parentPath - The full path to this array (e.g., 'items' or 'config.items')
18
+ * @param definitions - Array to collect definitions into
19
+ * @param lineTransformer - Transforms Babel line numbers to file line numbers
20
+ * @param defaultLine - Fallback line if element has no location
21
+ */
22
+ export declare function extractArrayElements(arrNode: BabelNode, parentPath: string, definitions: VariableDefinition[], lineTransformer: LineTransformer, defaultLine: number): void;
23
+ /**
24
+ * Build the full path for a variable definition.
25
+ * For array indices (numeric names), uses bracket notation: items[0]
26
+ * For object properties, uses dot notation: config.nav.title
27
+ */
28
+ export declare function buildDefinitionPath(def: VariableDefinition): string;
29
+ /**
30
+ * Parse an expression path and extract the full path for variable lookup.
31
+ * Handles patterns like: varName, obj.prop, items[0], config.nav.title, links[0].text
32
+ * @returns The full expression path or null if not a simple variable reference
33
+ */
34
+ export declare function parseExpressionPath(exprText: string): string | null;
35
+ //# sourceMappingURL=ast-extractors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-extractors.d.ts","sourceRoot":"","sources":["../../../src/source-finder/ast-extractors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAM7E;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAY7D;AAgBD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,kBAAkB,EAAE,EACjC,eAAe,EAAE,eAAe,GAC9B,IAAI,CAiCN;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,SAAS,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,kBAAkB,EAAE,EACjC,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,MAAM,GACjB,IAAI,CAmDN;AAMD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,kBAAkB,GAAG,MAAM,CASnE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQnE"}
@@ -0,0 +1,16 @@
1
+ import type { BabelFile, CachedParsedFile, ParsedAstroFile } from './types';
2
+ /**
3
+ * Parse an Astro file and return both template AST and frontmatter content
4
+ */
5
+ export declare function parseAstroFile(content: string): Promise<ParsedAstroFile>;
6
+ /**
7
+ * Parse frontmatter JavaScript/TypeScript with Babel
8
+ * @param content - The frontmatter content to parse
9
+ * @param filePath - Optional file path for error reporting
10
+ */
11
+ export declare function parseFrontmatter(content: string, filePath?: string): BabelFile | null;
12
+ /**
13
+ * Get a cached parsed file, parsing it if not cached
14
+ */
15
+ export declare function getCachedParsedFile(filePath: string): Promise<CachedParsedFile | null>;
16
+ //# sourceMappingURL=ast-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast-parser.d.ts","sourceRoot":"","sources":["../../../src/source-finder/ast-parser.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAO3E;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAoB9E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAiBrF;AAMD;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAwD5F"}
@@ -0,0 +1,18 @@
1
+ import type { CachedParsedFile, ImageIndexEntry, SearchIndexEntry } from './types';
2
+ export declare function getParsedFileCache(): Map<string, CachedParsedFile>;
3
+ export declare function getDirectoryCache(): Map<string, string[]>;
4
+ export declare function getMarkdownFileCache(): Map<string, {
5
+ content: string;
6
+ lines: string[];
7
+ }>;
8
+ export declare function getTextSearchIndex(): SearchIndexEntry[];
9
+ export declare function getImageSearchIndex(): ImageIndexEntry[];
10
+ export declare function isSearchIndexInitialized(): boolean;
11
+ export declare function setSearchIndexInitialized(value: boolean): void;
12
+ export declare function addToTextSearchIndex(entry: SearchIndexEntry): void;
13
+ export declare function addToImageSearchIndex(entry: ImageIndexEntry): void;
14
+ /**
15
+ * Clear all caches - call at start of each build
16
+ */
17
+ export declare function clearSourceFinderCache(): void;
18
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/source-finder/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAwBlF,wBAAgB,kBAAkB,IAAI,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAElE;AAED,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAEzD;AAED,wBAAgB,oBAAoB,IAAI,GAAG,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAExF;AAED,wBAAgB,kBAAkB,IAAI,gBAAgB,EAAE,CAEvD;AAED,wBAAgB,mBAAmB,IAAI,eAAe,EAAE,CAEvD;AAED,wBAAgB,wBAAwB,IAAI,OAAO,CAElD;AAED,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAE9D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAElE;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAElE;AAMD;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAQ7C"}
@@ -0,0 +1,29 @@
1
+ import type { CollectionInfo, MarkdownContent, SourceLocation } from './types';
2
+ /**
3
+ * Find markdown collection file for a given page path.
4
+ *
5
+ * Uses slug-based reverse lookup: scans all collection directories for a
6
+ * matching entry regardless of the URL prefix. This supports localized or
7
+ * renamed routes (e.g. `/aktuality/my-article` with content in `src/content/news/`).
8
+ *
9
+ * @param pagePath - The URL path of the page (e.g., '/services/3d-tisk')
10
+ * @param contentDir - The content directory (default: 'src/content')
11
+ * @returns Collection info if found, undefined otherwise
12
+ */
13
+ export declare function findCollectionSource(pagePath: string, contentDir?: string): Promise<CollectionInfo | undefined>;
14
+ /**
15
+ * Find text content in a markdown file and return source location
16
+ * Only matches frontmatter fields, not body content (body is handled separately as a whole)
17
+ * @param textContent - The text content to search for
18
+ * @param collectionInfo - Collection information (name, slug, file path)
19
+ * @returns Source location if found in frontmatter
20
+ */
21
+ export declare function findMarkdownSourceLocation(textContent: string, collectionInfo: CollectionInfo): Promise<SourceLocation | undefined>;
22
+ /**
23
+ * Parse markdown file and extract frontmatter fields and full body content.
24
+ * Uses caching for better performance.
25
+ * @param collectionInfo - Collection information (name, slug, file path)
26
+ * @returns Parsed markdown content with frontmatter and body
27
+ */
28
+ export declare function parseMarkdownContent(collectionInfo: CollectionInfo): Promise<MarkdownContent | undefined>;
29
+ //# sourceMappingURL=collection-finder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection-finder.d.ts","sourceRoot":"","sources":["../../../src/source-finder/collection-finder.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AA6B9E;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACzC,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAsB,GAChC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAiErC;AA8DD;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC/C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,GAC5B,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAmErC;AAMD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACzC,cAAc,EAAE,cAAc,GAC5B,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAkEtC"}
@@ -0,0 +1,39 @@
1
+ import type { ImportInfo, SourceLocation } from './types';
2
+ /**
3
+ * Search for a component usage with an expression prop across all files.
4
+ * When we find an expression like {items[0]} in a component where items comes from props,
5
+ * we search for where that component is used and track the expression prop back.
6
+ * Supports multi-level prop drilling with a depth limit.
7
+ *
8
+ * @param componentFileName - The file name of the component (e.g., 'Nav.astro')
9
+ * @param propName - The prop name we're looking for (e.g., 'items')
10
+ * @param expressionPath - The full expression path (e.g., 'items[0]')
11
+ * @param searchText - The text content we're searching for
12
+ * @param depth - Current recursion depth (default 0, max 5)
13
+ * @returns Source location if found
14
+ */
15
+ export declare function searchForExpressionProp(componentFileName: string, propName: string, expressionPath: string, searchText: string, depth?: number): Promise<SourceLocation | undefined>;
16
+ /**
17
+ * Search for a value in an imported file.
18
+ * @param fromFile - The file that contains the import
19
+ * @param importInfo - Information about the import
20
+ * @param expressionPath - The full expression path (e.g., 'config.title' or 'navItems[0]')
21
+ * @param searchText - The text content we're searching for
22
+ */
23
+ export declare function searchForImportedValue(fromFile: string, importInfo: ImportInfo, expressionPath: string, searchText: string): Promise<SourceLocation | undefined>;
24
+ /**
25
+ * Search for prop values passed to components using AST parsing.
26
+ * Uses caching for better performance.
27
+ */
28
+ export declare function searchForPropInParents(dir: string, textContent: string): Promise<SourceLocation | undefined>;
29
+ /**
30
+ * Find the actual source location for a dynamic attribute value.
31
+ * Uses the resolved VALUE to search for where it's defined (handles loop variables, etc.)
32
+ *
33
+ * @param expression - The source expression (e.g., "component.githubUrl")
34
+ * @param resolvedValue - The actual resolved value from the rendered HTML
35
+ * @param sourceFilePath - The source file path where the attribute is used (relative to project root)
36
+ * @returns Source location with file, line, and snippet for the actual value definition
37
+ */
38
+ export declare function findAttributeSourceLocation(expression: string, resolvedValue: string, sourceFilePath: string): Promise<SourceLocation | undefined>;
39
+ //# sourceMappingURL=cross-file-tracker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-file-tracker.d.ts","sourceRoot":"","sources":["../../../src/source-finder/cross-file-tracker.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAsB,MAAM,SAAS,CAAA;AAQ7E;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC5C,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,MAAU,GACf,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAiCrC;AAwID;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAC3C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAkDrC;AAMD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CA6DlH;AAMD;;;;;;;;GAQG;AACH,wBAAsB,2BAA2B,CAChD,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,GACpB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAuFrC"}