@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,367 @@
1
+ /** SEO tracking options */
2
+ export interface SeoOptions {
3
+ /** Whether to track SEO elements (default: true) */
4
+ trackSeo?: boolean;
5
+ /** Whether to mark the page title with a CMS ID (default: true) */
6
+ markTitle?: boolean;
7
+ /** Whether to parse JSON-LD structured data (default: true) */
8
+ parseJsonLd?: boolean;
9
+ }
10
+ export interface CmsMarkerOptions {
11
+ attributeName?: string;
12
+ includeTags?: string[] | null;
13
+ excludeTags?: string[];
14
+ includeEmptyText?: boolean;
15
+ generateManifest?: boolean;
16
+ manifestFile?: string;
17
+ markComponents?: boolean;
18
+ componentDirs?: string[];
19
+ /** Directory containing content collections (default: 'src/content') */
20
+ contentDir?: string;
21
+ /** SEO tracking options */
22
+ seo?: SeoOptions;
23
+ }
24
+ export interface ComponentProp {
25
+ name: string;
26
+ type: string;
27
+ required: boolean;
28
+ defaultValue?: string;
29
+ description?: string;
30
+ }
31
+ export interface ComponentDefinition {
32
+ name: string;
33
+ file: string;
34
+ props: ComponentProp[];
35
+ description?: string;
36
+ slots?: string[];
37
+ previewUrl?: string;
38
+ /** Viewport width (in px) used to render the preview iframe (default: 1280) */
39
+ previewWidth?: number;
40
+ }
41
+ /** Image metadata for better tracking and integrity */
42
+ export interface ImageMetadata {
43
+ /** Image source URL */
44
+ src: string;
45
+ /** Alt text */
46
+ alt: string;
47
+ /** SHA256 hash of image content (for integrity checking) */
48
+ hash?: string;
49
+ /** Image dimensions */
50
+ dimensions?: {
51
+ width: number;
52
+ height: number;
53
+ };
54
+ /** Responsive image srcset */
55
+ srcSet?: string;
56
+ /** Image sizes attribute */
57
+ sizes?: string;
58
+ }
59
+ /** Content constraints for validation */
60
+ export interface ContentConstraints {
61
+ /** Maximum content length */
62
+ maxLength?: number;
63
+ /** Minimum content length */
64
+ minLength?: number;
65
+ /** Regex pattern for validation */
66
+ pattern?: string;
67
+ /** Allowed HTML tags for rich text content */
68
+ allowedTags?: string[];
69
+ }
70
+ /** Represents a single Tailwind color with its shades and values */
71
+ export interface TailwindColor {
72
+ /** Color name (e.g., 'red', 'blue', 'primary') */
73
+ name: string;
74
+ /** Map of shade to CSS color value (e.g., { '500': '#ef4444', '600': '#dc2626' }) */
75
+ values: Record<string, string>;
76
+ /** Whether this is a custom/theme color vs default Tailwind */
77
+ isCustom?: boolean;
78
+ }
79
+ /** Attribute with source information for git diff tracking */
80
+ export interface Attribute {
81
+ /** The resolved attribute value (from rendered HTML) */
82
+ value: string;
83
+ /** The expression text if dynamic (e.g., "component.githubUrl") */
84
+ sourceExpression?: string;
85
+ /** Path to the source file where the value is defined */
86
+ sourcePath?: string;
87
+ /** Line number where the value is defined in source (1-indexed) */
88
+ sourceLine?: number;
89
+ /** The exact source snippet that can be replaced for git diff */
90
+ sourceSnippet?: string;
91
+ }
92
+ /** Available colors palette from Tailwind config */
93
+ export interface AvailableColors {
94
+ /** All available colors with their shades */
95
+ colors: TailwindColor[];
96
+ /** Default Tailwind color names */
97
+ defaultColors: string[];
98
+ /** Custom/theme color names */
99
+ customColors: string[];
100
+ }
101
+ /** Text style value with class name and CSS properties */
102
+ export interface TextStyleValue {
103
+ /** Tailwind class name (e.g., 'font-bold', 'text-xl') */
104
+ class: string;
105
+ /** Display label for UI */
106
+ label: string;
107
+ /** CSS properties to apply (e.g., { fontWeight: '700' }) */
108
+ css: Record<string, string>;
109
+ }
110
+ /** Available text styles from Tailwind config */
111
+ export interface AvailableTextStyles {
112
+ /** Font weight options (font-normal, font-bold, etc.) */
113
+ fontWeight: TextStyleValue[];
114
+ /** Font size options (text-xs, text-sm, text-base, etc.) */
115
+ fontSize: TextStyleValue[];
116
+ /** Text decoration options (underline, line-through, etc.) */
117
+ textDecoration: TextStyleValue[];
118
+ /** Font style options (italic, not-italic) */
119
+ fontStyle: TextStyleValue[];
120
+ }
121
+ export interface ManifestEntry {
122
+ id: string;
123
+ tag: string;
124
+ /** Plain text content (for display/search) */
125
+ text: string;
126
+ /** HTML content when element contains inline styling (strong, em, etc.) */
127
+ html?: string;
128
+ sourcePath?: string;
129
+ sourceLine?: number;
130
+ /** Full element snippet from opening to closing tag (for text content updates) */
131
+ sourceSnippet?: string;
132
+ variableName?: string;
133
+ childCmsIds?: string[];
134
+ parentComponentId?: string;
135
+ /** Collection name for collection entries (e.g., 'services', 'blog') */
136
+ collectionName?: string;
137
+ /** Entry slug for collection entries (e.g., '3d-tisk') */
138
+ collectionSlug?: string;
139
+ /** Path to the markdown content file (e.g., 'src/content/blog/my-post.md') */
140
+ contentPath?: string;
141
+ /** Stable ID derived from content + context hash, survives rebuilds */
142
+ stableId?: string;
143
+ /** SHA256 hash of sourceSnippet at generation time for conflict detection */
144
+ sourceHash?: string;
145
+ /** Image metadata for img elements (replaces imageSrc/imageAlt) */
146
+ imageMetadata?: ImageMetadata;
147
+ /** Content validation constraints */
148
+ constraints?: ContentConstraints;
149
+ /** Color classes applied to this element (for buttons, etc.) */
150
+ colorClasses?: Record<string, Attribute>;
151
+ /** All HTML attributes with source information */
152
+ attributes?: Record<string, Attribute>;
153
+ }
154
+ export interface ComponentInstance {
155
+ id: string;
156
+ componentName: string;
157
+ file: string;
158
+ sourcePath: string;
159
+ sourceLine: number;
160
+ props: Record<string, any>;
161
+ slots?: Record<string, string>;
162
+ parentId?: string;
163
+ /** File where this component is invoked (parent page/layout) */
164
+ invocationSourcePath?: string;
165
+ /** 0-based index among same-name component invocations in the parent file */
166
+ invocationIndex?: number;
167
+ }
168
+ /** Represents a content collection entry (markdown file) */
169
+ export interface CollectionEntry {
170
+ /** Collection name (e.g., 'services', 'blog') */
171
+ collectionName: string;
172
+ /** Entry slug (e.g., '3d-tisk') */
173
+ collectionSlug: string;
174
+ /** Path to the markdown file relative to project root */
175
+ sourcePath: string;
176
+ /** Frontmatter fields with their values and line numbers */
177
+ frontmatter: Record<string, {
178
+ value: string;
179
+ line: number;
180
+ }>;
181
+ /** Full markdown body content */
182
+ body: string;
183
+ /** Line number where body starts (1-indexed) */
184
+ bodyStartLine: number;
185
+ /** ID of the wrapper element containing the rendered markdown */
186
+ wrapperId?: string;
187
+ }
188
+ /** Field types for collection schema inference */
189
+ export type FieldType = 'text' | 'textarea' | 'date' | 'boolean' | 'number' | 'image' | 'url' | 'select' | 'array' | 'object' | 'reference';
190
+ /** Definition of a single field in a collection's schema */
191
+ export interface FieldDefinition {
192
+ /** Field name as it appears in frontmatter */
193
+ name: string;
194
+ /** Inferred or specified field type */
195
+ type: FieldType;
196
+ /** Whether the field is required (present in all entries) */
197
+ required: boolean;
198
+ /** Default value for the field */
199
+ defaultValue?: unknown;
200
+ /** Options for 'select' type fields */
201
+ options?: string[];
202
+ /** Item type for 'array' fields */
203
+ itemType?: FieldType;
204
+ /** Nested fields for 'object' type */
205
+ fields?: FieldDefinition[];
206
+ /** Sample values seen across entries */
207
+ examples?: unknown[];
208
+ }
209
+ /** Per-entry metadata for collection browsing */
210
+ export interface CollectionEntryInfo {
211
+ slug: string;
212
+ title?: string;
213
+ sourcePath: string;
214
+ draft?: boolean;
215
+ /** URL pathname of the rendered page for this entry */
216
+ pathname?: string;
217
+ }
218
+ /** Definition of a content collection with inferred schema */
219
+ export interface CollectionDefinition {
220
+ /** Collection identifier (directory name) */
221
+ name: string;
222
+ /** Human-readable label for the collection */
223
+ label: string;
224
+ /** Path to the collection directory */
225
+ path: string;
226
+ /** Number of entries in the collection */
227
+ entryCount: number;
228
+ /** Inferred field definitions */
229
+ fields: FieldDefinition[];
230
+ /** Whether the collection has draft support */
231
+ supportsDraft?: boolean;
232
+ /** File extension used by entries */
233
+ fileExtension: 'md' | 'mdx';
234
+ /** Per-entry metadata for browsing */
235
+ entries?: CollectionEntryInfo[];
236
+ }
237
+ /** Manifest metadata for versioning and conflict detection */
238
+ export interface ManifestMetadata {
239
+ /** Manifest schema version */
240
+ version: string;
241
+ /** ISO timestamp when manifest was generated */
242
+ generatedAt: string;
243
+ /** Build system that generated the manifest (e.g., 'astro', 'vite') */
244
+ generatedBy?: string;
245
+ /** Build ID for correlation */
246
+ buildId?: string;
247
+ /** SHA256 hash of all entry content for quick drift detection */
248
+ contentHash?: string;
249
+ /** Per-source-file hashes for granular conflict detection */
250
+ sourceFileHashes?: Record<string, string>;
251
+ }
252
+ /** Page entry for the global manifest */
253
+ export interface PageEntry {
254
+ /** Page URL pathname (e.g., '/', '/about') */
255
+ pathname: string;
256
+ /** Page title from SEO data */
257
+ title?: string;
258
+ }
259
+ export interface CmsManifest {
260
+ /** Manifest metadata for versioning and conflict detection */
261
+ metadata?: ManifestMetadata;
262
+ entries: Record<string, ManifestEntry>;
263
+ components: Record<string, ComponentInstance>;
264
+ componentDefinitions: Record<string, ComponentDefinition>;
265
+ /** Content collection entries indexed by "collectionName/slug" */
266
+ collections?: Record<string, CollectionEntry>;
267
+ /** Collection definitions with inferred schemas */
268
+ collectionDefinitions?: Record<string, CollectionDefinition>;
269
+ /** Available Tailwind colors from the project's config */
270
+ availableColors?: AvailableColors;
271
+ /** Available text styles from the project's Tailwind config */
272
+ availableTextStyles?: AvailableTextStyles;
273
+ /** All pages in the site with pathname and title */
274
+ pages?: PageEntry[];
275
+ }
276
+ /** Source tracking information for SEO elements */
277
+ export interface SeoSourceInfo {
278
+ /** CMS ID if element was marked for editing */
279
+ id?: string;
280
+ /** Path to source file */
281
+ sourcePath: string;
282
+ /** Line number in source file (1-indexed) */
283
+ sourceLine: number;
284
+ /** Exact source code snippet for matching/replacement */
285
+ sourceSnippet: string;
286
+ }
287
+ /** SEO meta tag with source tracking */
288
+ export interface SeoMetaTag extends SeoSourceInfo {
289
+ /** Meta tag name attribute (for name-based meta tags) */
290
+ name?: string;
291
+ /** Meta tag property attribute (for Open Graph/Twitter tags) */
292
+ property?: string;
293
+ /** Meta tag content value */
294
+ content: string;
295
+ }
296
+ /** Open Graph metadata */
297
+ export interface OpenGraphData {
298
+ title?: SeoMetaTag;
299
+ description?: SeoMetaTag;
300
+ image?: SeoMetaTag;
301
+ url?: SeoMetaTag;
302
+ type?: SeoMetaTag;
303
+ siteName?: SeoMetaTag;
304
+ }
305
+ /** Twitter Card metadata */
306
+ export interface TwitterCardData {
307
+ card?: SeoMetaTag;
308
+ title?: SeoMetaTag;
309
+ description?: SeoMetaTag;
310
+ image?: SeoMetaTag;
311
+ site?: SeoMetaTag;
312
+ }
313
+ /** JSON-LD structured data entry */
314
+ export interface JsonLdEntry extends SeoSourceInfo {
315
+ /** Schema.org @type value */
316
+ type: string;
317
+ /** Parsed JSON-LD data */
318
+ data: Record<string, unknown>;
319
+ }
320
+ /** Canonical URL link element */
321
+ export interface CanonicalUrl extends SeoSourceInfo {
322
+ /** The canonical URL href value */
323
+ href: string;
324
+ }
325
+ /** Favicon link element */
326
+ export interface SeoFavicon extends SeoSourceInfo {
327
+ /** The favicon href value */
328
+ href: string;
329
+ /** The type attribute (e.g. "image/png", "image/svg+xml") */
330
+ type?: string;
331
+ /** The sizes attribute (e.g. "32x32", "16x16") */
332
+ sizes?: string;
333
+ /** The rel value (e.g. "icon", "apple-touch-icon") */
334
+ rel: string;
335
+ }
336
+ /** Page title element with optional CMS ID */
337
+ export interface SeoTitle extends SeoSourceInfo {
338
+ /** Title text content */
339
+ content: string;
340
+ }
341
+ /** Meta keywords with parsed array */
342
+ export interface SeoKeywords extends SeoSourceInfo {
343
+ /** Raw keywords string */
344
+ content: string;
345
+ /** Parsed array of individual keywords */
346
+ keywords: string[];
347
+ }
348
+ /** Complete SEO data for a page */
349
+ export interface PageSeoData {
350
+ /** Page title */
351
+ title?: SeoTitle;
352
+ /** Meta description */
353
+ description?: SeoMetaTag;
354
+ /** Meta keywords */
355
+ keywords?: SeoKeywords;
356
+ /** Canonical URL */
357
+ canonical?: CanonicalUrl;
358
+ /** Favicons */
359
+ favicons?: SeoFavicon[];
360
+ /** Open Graph metadata */
361
+ openGraph?: OpenGraphData;
362
+ /** Twitter Card metadata */
363
+ twitterCard?: TwitterCardData;
364
+ /** JSON-LD structured data blocks */
365
+ jsonLd?: JsonLdEntry[];
366
+ }
367
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,WAAW,UAAU;IAC1B,oDAAoD;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mEAAmE;IACnE,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC7B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,2BAA2B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U,EAAE,CAAA;IACvB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,aAAa,CAAA;IACzB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,eAAe,CAAA;IAC7B,qCAAqC;IACrC,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;CACtB"}
@@ -0,0 +1,61 @@
1
+ import type { ManifestEntry } from './types';
2
+ /**
3
+ * Normalize a page path by removing query strings, hashes, and trailing slashes.
4
+ * Handles both full URLs and plain pathnames.
5
+ * Examples: '/about/' -> '/about', 'http://localhost/about?x=1' -> '/about'
6
+ */
7
+ export declare function normalizePagePath(url: string): string;
8
+ /**
9
+ * Generate a SHA256 hash of the given content
10
+ */
11
+ export declare function sha256(content: string): string;
12
+ /**
13
+ * Generate a short hash (first 12 characters of SHA256)
14
+ * Used for stableId to keep it reasonably short but still unique
15
+ */
16
+ export declare function shortHash(content: string): string;
17
+ /**
18
+ * Generate a stable ID for an element based on its content and context.
19
+ * This ID survives rebuilds as long as the content and structure remain similar.
20
+ *
21
+ * Components:
22
+ * - tag name
23
+ * - first 50 chars of text content
24
+ * - source path (if available)
25
+ */
26
+ export declare function generateStableId(tag: string, text: string, sourcePath?: string): string;
27
+ /**
28
+ * Generate a hash of the source snippet for conflict detection.
29
+ * If the source file changes, this hash will differ from what's stored in manifest.
30
+ */
31
+ export declare function generateSourceHash(sourceSnippet: string): string;
32
+ /**
33
+ * Generate a content hash for the entire manifest (all entries).
34
+ * Used for quick drift detection without comparing individual entries.
35
+ */
36
+ export declare function generateManifestContentHash(entries: Record<string, ManifestEntry>): string;
37
+ /**
38
+ * Generate per-source-file hashes for granular conflict detection.
39
+ * Maps source file path -> hash of all entries from that file.
40
+ */
41
+ export declare function generateSourceFileHashes(entries: Record<string, ManifestEntry>): Record<string, string>;
42
+ /**
43
+ * Escape special regex characters in a string for use in `new RegExp()`.
44
+ */
45
+ export declare function escapeRegex(str: string): string;
46
+ /**
47
+ * Escape a string for safe use as a replacement in `String.prototype.replace()`.
48
+ * Prevents `$1`, `$$`, `$&` etc. from being interpreted as backreferences.
49
+ */
50
+ export declare function escapeReplacement(str: string): string;
51
+ /**
52
+ * Resolve a user-provided file path and ensure it stays within the project root.
53
+ * Throws if the resolved path escapes the project boundary.
54
+ */
55
+ export declare function resolveAndValidatePath(filePath: string): string;
56
+ /**
57
+ * Acquire a per-file lock for safe read-modify-write operations.
58
+ * Returns a release function to call when done.
59
+ */
60
+ export declare function acquireFileLock(filePath: string): Promise<() => void>;
61
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAYrD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC/B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,GACjB,MAAM,CAQR;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAU1F;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBvG;AAMD;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAErD;AAMD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY/D;AAQD;;;GAGG;AACH,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,CAAC,CAkB3E"}
@@ -0,0 +1,14 @@
1
+ import type { Plugin } from 'vite';
2
+ import type { ManifestWriter } from './manifest-writer';
3
+ import type { CmsMarkerOptions, ComponentDefinition } from './types';
4
+ export interface VitePluginContext {
5
+ manifestWriter: ManifestWriter;
6
+ componentDefinitions: Record<string, ComponentDefinition>;
7
+ config: Required<CmsMarkerOptions>;
8
+ idCounter: {
9
+ value: number;
10
+ };
11
+ command: 'dev' | 'build' | 'preview' | 'sync';
12
+ }
13
+ export declare function createVitePlugin(context: VitePluginContext): Plugin[];
14
+ //# sourceMappingURL=vite-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEpE,MAAM,WAAW,iBAAiB;IACjC,cAAc,EAAE,cAAc,CAAA;IAC9B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IACzD,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IAClC,SAAS,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5B,OAAO,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;CAC7C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,EAAE,CA6BrE"}