@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,21 @@
1
+ import type { CollectionDefinition } from '../types';
2
+ export interface ToolbarCallbacks {
3
+ onEdit: () => void;
4
+ onCompare: () => void;
5
+ onSave: () => void;
6
+ onDiscard: () => void;
7
+ onAIChat?: () => void;
8
+ onMediaLibrary?: () => void;
9
+ onDismissDeployment?: () => void;
10
+ onNavigateChange?: () => void;
11
+ onEditContent?: () => void;
12
+ onToggleHighlights?: () => void;
13
+ onSeoEditor?: () => void;
14
+ onOpenCollection?: (name: string) => void;
15
+ }
16
+ export interface ToolbarProps {
17
+ callbacks: ToolbarCallbacks;
18
+ collectionDefinitions?: Record<string, CollectionDefinition>;
19
+ }
20
+ export declare const Toolbar: ({ callbacks, collectionDefinitions }: ToolbarProps) => import("preact").JSX.Element | null;
21
+ //# sourceMappingURL=toolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbar.d.ts","sourceRoot":"","sources":["../../../../src/editor/components/toolbar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEpD,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IAC3B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAA;IAChC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CACzC;AAED,MAAM,WAAW,YAAY;IAC5B,SAAS,EAAE,gBAAgB,CAAA;IAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAA;CAC5D;AAsED,eAAO,MAAM,OAAO,GAAI,sCAAsC,YAAY,wCAuPzE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { CmsConfig } from './types';
2
+ export declare const DEFAULT_CONFIG: CmsConfig;
3
+ export declare function getConfig(): CmsConfig;
4
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/editor/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,eAAO,MAAM,cAAc,EAAE,SAI5B,CAAA;AAED,wBAAgB,SAAS,IAAI,SAAS,CAGrC"}
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Constants for the CMS editor
3
+ * Centralizes magic numbers and configuration values
4
+ */
5
+ /**
6
+ * Z-index layers for CMS UI elements.
7
+ * Uses high values to ensure CMS UI appears above all page content.
8
+ * Each layer is ordered from back to front.
9
+ */
10
+ export declare const Z_INDEX: {
11
+ /** Highlight overlay for hovered elements */
12
+ readonly HIGHLIGHT: 2147483645;
13
+ /** Overlay backdrop for modals */
14
+ readonly OVERLAY: 2147483646;
15
+ /** Modal panels (block editor, AI chat) */
16
+ readonly MODAL: 2147483647;
17
+ /** Toast notifications - always on top */
18
+ readonly TOAST: 2147483648;
19
+ };
20
+ /**
21
+ * Timing constants for UI interactions
22
+ */
23
+ export declare const TIMING: {
24
+ /** Throttle interval for element detection during mouse move (ms) */
25
+ readonly ELEMENT_DETECTION_THROTTLE_MS: 16;
26
+ /** Delay before clearing focus state on blur (ms) */
27
+ readonly BLUR_DELAY_MS: 10;
28
+ /** Duration before toast starts fading out (ms) */
29
+ readonly TOAST_VISIBLE_DURATION_MS: 2200;
30
+ /** Duration of toast fade out animation (ms) */
31
+ readonly TOAST_FADE_DURATION_MS: 200;
32
+ /** Duration to show component insertion preview before removal (ms) */
33
+ readonly PREVIEW_SUCCESS_DURATION_MS: 3000;
34
+ /** Duration to show error preview before removal (ms) */
35
+ readonly PREVIEW_ERROR_DURATION_MS: 5000;
36
+ /** Delay before focusing input after expansion (ms) */
37
+ readonly FOCUS_DELAY_MS: 50;
38
+ };
39
+ /**
40
+ * Layout constants for UI positioning
41
+ */
42
+ export declare const LAYOUT: {
43
+ /** Edge threshold for component selection (pixels from border) */
44
+ readonly COMPONENT_EDGE_THRESHOLD: 32;
45
+ /** Minimum space needed to show label outside the element */
46
+ readonly LABEL_OUTSIDE_THRESHOLD: 28;
47
+ /** Padding from viewport edges for sticky label */
48
+ readonly STICKY_PADDING: 8;
49
+ /** Default padding from viewport edges */
50
+ readonly VIEWPORT_PADDING: 16;
51
+ /** Default tooltip width */
52
+ readonly TOOLTIP_WIDTH: 200;
53
+ /** Expanded tooltip minimum width */
54
+ readonly TOOLTIP_EXPANDED_MIN_WIDTH: 280;
55
+ /** Expanded tooltip maximum width */
56
+ readonly TOOLTIP_EXPANDED_MAX_WIDTH: 320;
57
+ /** Block editor panel width */
58
+ readonly BLOCK_EDITOR_WIDTH: 400;
59
+ /** Block editor approximate height for positioning */
60
+ readonly BLOCK_EDITOR_HEIGHT: 500;
61
+ /** AI chat panel width */
62
+ readonly AI_CHAT_WIDTH: 400;
63
+ };
64
+ /**
65
+ * API request configuration
66
+ */
67
+ export declare const API: {
68
+ /** Default request timeout in milliseconds */
69
+ readonly REQUEST_TIMEOUT_MS: 30000;
70
+ /** AI streaming request timeout in milliseconds */
71
+ readonly AI_STREAM_TIMEOUT_MS: 120000;
72
+ /** Maximum retry attempts for failed requests */
73
+ readonly MAX_RETRIES: 3;
74
+ /** Base delay for exponential backoff (ms) */
75
+ readonly RETRY_BASE_DELAY_MS: 1000;
76
+ };
77
+ /**
78
+ * Storage keys for persistence
79
+ */
80
+ export declare const STORAGE_KEYS: {
81
+ readonly PENDING_EDITS: "cms-pending-edits";
82
+ readonly PENDING_IMAGE_EDITS: "cms-pending-image-edits";
83
+ readonly PENDING_COLOR_EDITS: "cms-pending-color-edits";
84
+ readonly PENDING_ATTRIBUTE_EDITS: "cms-pending-attribute-edits";
85
+ readonly SETTINGS: "cms-settings";
86
+ readonly PENDING_ENTRY_NAVIGATION: "cms-pending-entry-navigation";
87
+ };
88
+ /**
89
+ * CSS class prefixes and identifiers
90
+ */
91
+ export declare const CSS: {
92
+ /** Data attribute for CMS UI elements (to prevent event propagation) */
93
+ readonly UI_ATTRIBUTE: "data-cms-ui";
94
+ /** Data attribute for CMS element IDs */
95
+ readonly ID_ATTRIBUTE: "data-cms-id";
96
+ /** Data attribute for component IDs */
97
+ readonly COMPONENT_ID_ATTRIBUTE: "data-cms-component-id";
98
+ /** Custom element tag for highlight overlay */
99
+ readonly HIGHLIGHT_ELEMENT: "cms-highlight-overlay";
100
+ };
101
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/editor/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,eAAO,MAAM,OAAO;IACnB,6CAA6C;;IAE7C,kCAAkC;;IAElC,2CAA2C;;IAE3C,0CAA0C;;CAEjC,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,MAAM;IAClB,qEAAqE;;IAErE,qDAAqD;;IAErD,mDAAmD;;IAEnD,gDAAgD;;IAEhD,uEAAuE;;IAEvE,yDAAyD;;IAEzD,uDAAuD;;CAE9C,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,MAAM;IAClB,kEAAkE;;IAElE,6DAA6D;;IAE7D,mDAAmD;;IAEnD,0CAA0C;;IAE1C,4BAA4B;;IAE5B,qCAAqC;;IAErC,qCAAqC;;IAErC,+BAA+B;;IAE/B,sDAAsD;;IAEtD,0BAA0B;;CAEjB,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,GAAG;IACf,8CAA8C;;IAE9C,mDAAmD;;IAEnD,iDAAiD;;IAEjD,8CAA8C;;CAErC,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;CAOf,CAAA;AAEV;;GAEG;AACH,eAAO,MAAM,GAAG;IACf,wEAAwE;;IAExE,yCAAyC;;IAEzC,uCAAuC;;IAEvC,+CAA+C;;CAEtC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import type { CmsConfig, EditorState } from './types';
2
+ export interface CmsProviderProps {
3
+ children: any;
4
+ initialConfig?: CmsConfig;
5
+ initialState?: EditorState;
6
+ }
7
+ /**
8
+ * CMS Provider component.
9
+ *
10
+ * With signals, this provider is mainly for initialization and legacy compatibility.
11
+ * New code should import signals directly rather than using context.
12
+ */
13
+ export declare function CmsProvider({ children, initialConfig, initialState }: CmsProviderProps): import("preact").JSX.Element;
14
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/editor/context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErD,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,GAAG,CAAA;IACb,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,YAAY,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,gBAAgB,gCAqBtF"}
@@ -0,0 +1,77 @@
1
+ import type { ChildCmsElement } from './types';
2
+ /**
3
+ * Get the best CMS element at a specific position using elementsFromPoint.
4
+ * This is more reliable than using event.target for nested elements.
5
+ *
6
+ * @param x - clientX position
7
+ * @param y - clientY position
8
+ * @param manifestEntries - Optional manifest entries to filter by
9
+ */
10
+ export declare function getCmsElementAtPosition(x: number, y: number, manifestEntries?: Record<string, any>): HTMLElement | null;
11
+ /**
12
+ * Get a component element at a specific position.
13
+ * Only returns component roots (elements with data-cms-component-id).
14
+ */
15
+ export declare function getComponentAtPosition(x: number, y: number): HTMLElement | null;
16
+ /**
17
+ * Check if a point is near the edge of an element's bounding rect.
18
+ * Used to only trigger component selection when hovering near borders.
19
+ */
20
+ export declare function isNearElementEdge(x: number, y: number, rect: DOMRect, threshold?: number): boolean;
21
+ export declare function getCmsElementFromEvent(ev: MouseEvent): HTMLElement | null;
22
+ /**
23
+ * Check if an element is a CMS-styled span (inline text styling)
24
+ */
25
+ export declare function isStyledSpan(element: HTMLElement): boolean;
26
+ /**
27
+ * Extract plain text content from a CMS element.
28
+ * Styled spans are reduced to their text content (not HTML).
29
+ * Nested CMS elements are replaced with {{cms:id}} placeholders.
30
+ */
31
+ export declare function getEditableTextFromElement(el: HTMLElement): string;
32
+ /**
33
+ * Get the HTML content of a CMS element suitable for saving.
34
+ * Preserves styled spans but cleans up editing artifacts.
35
+ */
36
+ export declare function getEditableHtmlFromElement(el: HTMLElement): string;
37
+ export declare function getChildCmsElements(el: HTMLElement): ChildCmsElement[];
38
+ export declare function findInnermostCmsElement(target: EventTarget | null): HTMLElement | null;
39
+ export declare function getAllCmsElements(): NodeListOf<HTMLElement>;
40
+ export declare function makeElementEditable(el: HTMLElement): void;
41
+ export declare function makeElementNonEditable(el: HTMLElement): void;
42
+ /**
43
+ * Set highlight outline on an element using Shadow DOM overlay.
44
+ * This doesn't modify the element's styles directly.
45
+ */
46
+ export declare function setElementOutline(el: HTMLElement, color: string, style?: 'solid' | 'dashed'): void;
47
+ /**
48
+ * Clear highlight from an element
49
+ */
50
+ export declare function clearElementOutline(el: HTMLElement): void;
51
+ /**
52
+ * Initialize the highlight system (call when starting edit mode)
53
+ */
54
+ export declare function initHighlightSystem(): void;
55
+ /**
56
+ * Clean up all highlights (call when stopping edit mode)
57
+ */
58
+ export declare function cleanupHighlightSystem(): void;
59
+ export declare function logDebug(debug: boolean, ...args: any[]): void;
60
+ /**
61
+ * Disable all interactive elements (links, buttons, forms) to prevent
62
+ * accidental navigation or form submission while in edit mode.
63
+ */
64
+ export declare function disableAllInteractiveElements(): void;
65
+ /**
66
+ * Re-enable all interactive elements that were disabled.
67
+ */
68
+ export declare function enableAllInteractiveElements(): void;
69
+ /**
70
+ * @deprecated Use disableAllInteractiveElements instead
71
+ */
72
+ export declare function disableAllLinks(): void;
73
+ /**
74
+ * @deprecated Use enableAllInteractiveElements instead
75
+ */
76
+ export declare function enableAllLinks(): void;
77
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/editor/dom.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACtC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GACnC,WAAW,GAAG,IAAI,CAyCpB;AAED;;;GAGG;AACH,w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wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAG7D;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,IAAI,CAqBpD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAqBnD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
@@ -0,0 +1,64 @@
1
+ import type { CmsConfig } from './types';
2
+ /**
3
+ * Start edit mode - enables inline editing on all CMS elements.
4
+ * Uses signals for state management.
5
+ */
6
+ export declare function startEditMode(config: CmsConfig, onStateChange?: () => void): Promise<void>;
7
+ /**
8
+ * Stop edit mode - disables inline editing.
9
+ */
10
+ export declare function stopEditMode(onStateChange?: () => void): void;
11
+ /**
12
+ * Handle element content change - tracks dirty state.
13
+ */
14
+ export declare function handleElementChange(config: CmsConfig, cmsId: string, el: HTMLElement, onStateChange?: () => void): void;
15
+ /**
16
+ * Toggle showing original content vs edited content.
17
+ */
18
+ export declare function toggleShowOriginal(config: CmsConfig, onStateChange?: () => void): void;
19
+ /**
20
+ * Discard all pending changes and restore original content.
21
+ * Note: Confirmation is handled by the caller (e.g., toolbar).
22
+ */
23
+ export declare function discardAllChanges(onStateChange?: () => void): void;
24
+ /**
25
+ * Save all dirty changes to the server.
26
+ */
27
+ export declare function saveAllChanges(config: CmsConfig, onStateChange?: () => void): Promise<{
28
+ success: boolean;
29
+ updated: number;
30
+ errors?: Array<{
31
+ cmsId: string;
32
+ error: string;
33
+ }>;
34
+ }>;
35
+ /**
36
+ * Handle color change from the color toolbar.
37
+ * Called when user selects a new color.
38
+ */
39
+ export declare function handleColorChange(config: CmsConfig, cmsId: string, colorType: 'bg' | 'text' | 'border' | 'hoverBg' | 'hoverText', oldClass: string, newClass: string, onStateChange?: () => void, previousClassName?: string, previousStyleCssText?: string): void;
40
+ export interface DeploymentPollingOptions {
41
+ /** Called when deployment completes, fails, or times out */
42
+ onComplete?: (status: 'completed' | 'failed' | 'timeout') => void;
43
+ }
44
+ /**
45
+ * Start polling for deployment status after a save operation.
46
+ * Polls the API every 3 seconds until deployment completes or fails.
47
+ * Waits for deployment to appear for up to 30 seconds before giving up.
48
+ */
49
+ export declare function startDeploymentPolling(config: CmsConfig, options?: DeploymentPollingOptions): void;
50
+ /**
51
+ * Stop polling for deployment status.
52
+ */
53
+ export declare function stopDeploymentPolling(): void;
54
+ /**
55
+ * Dismiss the deployment status indicator.
56
+ * Used when user clicks on a failed deployment status.
57
+ */
58
+ export declare function dismissDeploymentStatus(): void;
59
+ /**
60
+ * Handle attribute change from the attribute editor.
61
+ * Called when user modifies an attribute value.
62
+ */
63
+ export declare function handleAttributeChange(config: CmsConfig, cmsId: string, attributeName: string, newValue: string | boolean | number | undefined, onStateChange?: () => void): void;
64
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../src/editor/editor.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAyC,SAAS,EAA+D,MAAM,SAAS,CAAA;AAqD5I;;;GAGG;AACH,wBAAsB,aAAa,CAClC,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,MAAM,IAAI,GACxB,OAAO,CAAC,IAAI,CAAC,CAqNf;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAkB7D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,WAAW,EACf,aAAa,CAAC,EAAE,MAAM,IAAI,GACxB,IAAI,CAkEN;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CACjC,MAAM,EAAE,SAAS,EACjB,aAAa,CAAC,EAAE,MAAM,IAAI,GACxB,IAAI,CAkCN;A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AAO,GAAG,MAAM,GAAG,SAAS,EAC/C,aAAa,CAAC,EAAE,MAAM,IAAI,GACxB,IAAI,CAuDN"}
@@ -0,0 +1,20 @@
1
+ import type { UndoAction, UndoTextAction } from './types';
2
+ export declare const undoStack: import("@preact/signals-core").Signal<UndoAction[]>;
3
+ export declare const redoStack: import("@preact/signals-core").Signal<UndoAction[]>;
4
+ export declare const canUndo: import("@preact/signals-core").ReadonlySignal<boolean>;
5
+ export declare const canRedo: import("@preact/signals-core").ReadonlySignal<boolean>;
6
+ /** Guard flag to prevent re-recording during undo/redo application */
7
+ export declare let isApplyingUndoRedo: boolean;
8
+ /**
9
+ * Record a text change with debouncing.
10
+ * Rapid keystrokes to the same element are grouped into a single undo unit.
11
+ */
12
+ export declare function recordTextChange(snapshot: UndoTextAction): void;
13
+ /**
14
+ * Record a non-text change immediately (color, image, attribute, seo).
15
+ */
16
+ export declare function recordChange(action: UndoAction): void;
17
+ export declare function performUndo(): void;
18
+ export declare function performRedo(): void;
19
+ export declare function clearHistory(): void;
20
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../src/editor/history.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAa,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AASpE,eAAO,MAAM,SAAS,qDAA2B,CAAA;AACjD,eAAO,MAAM,SAAS,qDAA2B,CAAA;AAEjD,eAAO,MAAM,OAAO,wDAA2E,CAAA;AAC/F,eAAO,MAAM,OAAO,wDAA6C,CAAA;AAEjE,sEAAsE;AACtE,eAAO,IAAI,kBAAkB,SAAQ,CAAA;AAoBrC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAwB/D;AAMD;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAUrD;AA0BD,wBAAgB,WAAW,IAAI,IAAI,CAiBlC;AAED,wBAAgB,WAAW,IAAI,IAAI,CAclC;AAwLD,wBAAgB,YAAY,IAAI,IAAI,CAQnC"}
@@ -0,0 +1,14 @@
1
+ export { isEventOnCmsUI, useComponentClickHandler, useElementDetection } from './useElementDetection';
2
+ export type { ComponentClickHandlerOptions, OutlineState } from './useElementDetection';
3
+ export { isElementInCmsUI, usePositionTracking } from './utils';
4
+ export { useTooltipState } from './useTooltipState';
5
+ export type { TooltipState, UseTooltipStateOptions } from './useTooltipState';
6
+ export { useAIHandlers } from './useAIHandlers';
7
+ export type { AIHandlersOptions } from './useAIHandlers';
8
+ export { useBlockEditorHandlers } from './useBlockEditorHandlers';
9
+ export type { BlockEditorHandlersOptions } from './useBlockEditorHandlers';
10
+ export { clearTextSelection, restoreSelection, saveSelection, useTextSelection } from './useTextSelection';
11
+ export type { TextSelectionState } from './useTextSelection';
12
+ export { useImageHoverDetection } from './useImageHoverDetection';
13
+ export type { ImageHoverState } from './useImageHoverDetection';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AACrG,YAAY,EAAE,4BAA4B,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEvF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,YAAY,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAE1E,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1G,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,22 @@
1
+ import { AIService } from '../ai';
2
+ import type { CmsConfig } from '../types';
3
+ export interface AIHandlersOptions {
4
+ config: CmsConfig;
5
+ showToast: (message: string, type?: 'info' | 'success' | 'error') => void;
6
+ onTooltipHide: () => void;
7
+ onUIUpdate?: () => void;
8
+ }
9
+ /**
10
+ * Hook providing AI-related handlers for the CMS editor.
11
+ * Uses signals directly for state management.
12
+ */
13
+ export declare function useAIHandlers({ config, showToast, onTooltipHide, onUIUpdate, }: AIHandlersOptions): {
14
+ aiService: AIService;
15
+ handleAIChatToggle: () => Promise<void>;
16
+ handleChatClose: () => void;
17
+ handleChatCancel: () => void;
18
+ handleTooltipPromptSubmit: (prompt: string, elementId: string) => Promise<void>;
19
+ handleChatSend: (message: string, elementId?: string) => Promise<void>;
20
+ handleApplyToElement: (content: string, elementId: string) => void;
21
+ };
22
+ //# sourceMappingURL=useAIHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAIHandlers.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/useAIHandlers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAoB,MAAM,OAAO,CAAA;AAMnD,OAAO,KAAK,EAA6B,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpE,MAAM,WAAW,iBAAiB;IACjC,MAAM,EAAE,SAAS,CAAA;IACjB,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,KAAK,IAAI,CAAA;IACzE,aAAa,EAAE,MAAM,IAAI,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACvB;AAQD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC7B,MAAM,EACN,SAAS,EACT,aAAa,EACb,UAAU,GACV,EAAE,iBAAiB;;;;;wCA6EH,MAAM,aAAa,MAAM;8BAiExB,MAAM,cAAc,MAAM;oCAoJhC,MAAM,aAAa,MAAM;EAuBpC"}
@@ -0,0 +1,18 @@
1
+ import type { CmsConfig, InsertPosition } from '../types';
2
+ export interface BlockEditorHandlersOptions {
3
+ config: CmsConfig;
4
+ showToast: (message: string, type?: 'info' | 'success' | 'error') => void;
5
+ }
6
+ /**
7
+ * Hook providing block editor handlers for the CMS editor.
8
+ * Uses signals directly for state management.
9
+ */
10
+ export declare function useBlockEditorHandlers({ config, showToast, }: BlockEditorHandlersOptions): {
11
+ blockEditorRect: DOMRect | null;
12
+ handleComponentSelect: (componentId: string, rect: DOMRect) => void;
13
+ handleBlockEditorClose: () => void;
14
+ handleUpdateProps: (componentId: string, props: Record<string, any>) => void;
15
+ handleInsertComponent: (position: InsertPosition, referenceComponentId: string, componentName: string, props: Record<string, any>) => Promise<void>;
16
+ handleRemoveBlock: (componentId: string) => Promise<void>;
17
+ };
18
+ //# sourceMappingURL=useBlockEditorHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBlockEditorHandlers.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/useBlockEditorHandlers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAczD,MAAM,WAAW,0BAA0B;IAC1C,MAAM,EAAE,SAAS,CAAA;IACjB,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,KAAK,IAAI,CAAA;CACzE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACtC,MAAM,EACN,SAAS,GACT,EAAE,0BAA0B;;yCAOb,MAAM,QAAQ,OAAO;;qCAqBrB,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;sCAarC,cAAc,wBACF,MAAM,iBACb,MAAM,SACd,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;qCAmEP,MAAM;EAgE3B"}
@@ -0,0 +1,26 @@
1
+ import { isEventOnCmsUI } from './utils';
2
+ export interface OutlineState {
3
+ visible: boolean;
4
+ rect: DOMRect | null;
5
+ isComponent: boolean;
6
+ componentName: string | undefined;
7
+ tagName: string | undefined;
8
+ element: HTMLElement | null;
9
+ /** CMS ID of the detected element */
10
+ cmsId: string | null;
11
+ }
12
+ /**
13
+ * Hook for detecting and tracking hovered CMS elements.
14
+ * Uses signals directly for state management.
15
+ */
16
+ export declare function useElementDetection(): OutlineState;
17
+ export interface ComponentClickHandlerOptions {
18
+ onComponentSelect: (componentId: string, rect: DOMRect) => void;
19
+ }
20
+ /**
21
+ * Hook for handling component click selection.
22
+ * Uses signals directly for state management.
23
+ */
24
+ export declare function useComponentClickHandler({ onComponentSelect, }: ComponentClickHandlerOptions): void;
25
+ export { isEventOnCmsUI };
26
+ //# sourceMappingURL=useElementDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useElementDetection.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/useElementDetection.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAuB,MAAM,SAAS,CAAA;AAE7D,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACpB,WAAW,EAAE,OAAO,CAAA;IACpB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;IAC3B,qCAAqC;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AAYD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAgLlD;AAED,MAAM,WAAW,4BAA4B;IAC5C,iBAAiB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;CAC/D;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACxC,iBAAiB,GACjB,EAAE,4BAA4B,GAAG,IAAI,CA4DrC;AAGD,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,12 @@
1
+ export interface ImageHoverState {
2
+ visible: boolean;
3
+ rect: DOMRect | null;
4
+ element: HTMLImageElement | null;
5
+ cmsId: string | null;
6
+ }
7
+ /**
8
+ * Hook for detecting and tracking hovered CMS image elements.
9
+ * Shows a visual overlay when hovering over images marked with data-cms-img.
10
+ */
11
+ export declare function useImageHoverDetection(): ImageHoverState;
12
+ //# sourceMappingURL=useImageHoverDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useImageHoverDetection.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/useImageHoverDetection.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAChC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB;AASD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,eAAe,CA8ExD"}
@@ -0,0 +1,23 @@
1
+ import { type TextSelection } from '../text-styling';
2
+ export interface TextSelectionState {
3
+ hasSelection: boolean;
4
+ selection: TextSelection | null;
5
+ rect: DOMRect | null;
6
+ element: HTMLElement | null;
7
+ }
8
+ /**
9
+ * Hook for managing text selection state within CMS elements.
10
+ * Tracks when the user has selected text and provides the selection details
11
+ * for the text styling toolbar.
12
+ */
13
+ export declare function useTextSelection(): TextSelectionState;
14
+ /**
15
+ * Clear the current text selection
16
+ */
17
+ export declare function clearTextSelection(): void;
18
+ /**
19
+ * Save and restore selection - useful when applying styles
20
+ */
21
+ export declare function saveSelection(): Range | null;
22
+ export declare function restoreSelection(range: Range | null): void;
23
+ //# sourceMappingURL=useTextSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTextSelection.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/useTextSelection.ts"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGtE,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,aAAa,GAAG,IAAI,CAAA;IAC/B,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;CAC3B;AASD;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,kBAAkB,CAkIrD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAKzC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,KAAK,GAAG,IAAI,CAM5C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,CAQ1D"}
@@ -0,0 +1,19 @@
1
+ export interface TooltipState {
2
+ elementId: string | null;
3
+ rect: DOMRect | null;
4
+ element: HTMLElement | null;
5
+ }
6
+ export interface UseTooltipStateOptions {
7
+ /** @deprecated No longer needed - signals are used directly */
8
+ isEditing?: boolean;
9
+ }
10
+ /**
11
+ * Hook for managing tooltip visibility and positioning.
12
+ * Uses signals directly for state management.
13
+ */
14
+ export declare function useTooltipState(_options?: UseTooltipStateOptions): {
15
+ tooltipState: TooltipState;
16
+ showTooltipForElement: () => void;
17
+ hideTooltip: () => void;
18
+ };
19
+ //# sourceMappingURL=useTooltipState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTooltipState.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/useTooltipState.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACpB,OAAO,EAAE,WAAW,GAAG,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACtC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,CAAC,EAAE,sBAAsB;;;;EA0GhE"}
@@ -0,0 +1,32 @@
1
+ import type { RefObject } from 'preact';
2
+ /**
3
+ * Check if a mouse event originates from CMS UI elements.
4
+ * This includes the toolbar, AI chat, color picker, and other CMS overlays.
5
+ */
6
+ export declare function isEventOnCmsUI(ev: MouseEvent): boolean;
7
+ /**
8
+ * Check if a target element is part of CMS UI.
9
+ * Non-event based variant for direct element checks.
10
+ */
11
+ export declare function isElementInCmsUI(target: HTMLElement | null): boolean;
12
+ /**
13
+ * Hook for tracking an element's position on scroll and resize.
14
+ * Returns a callback to get the latest rect, and automatically updates
15
+ * when the element scrolls or the window resizes.
16
+ *
17
+ * @param element - The element to track
18
+ * @param onPositionChange - Callback when position changes
19
+ * @param enabled - Whether tracking is enabled
20
+ */
21
+ export declare function usePositionTracking(element: HTMLElement | null, onPositionChange: (rect: DOMRect | null) => void, enabled?: boolean): void;
22
+ /**
23
+ * Hook for throttling a callback function.
24
+ * Returns a throttled version that will only execute once per interval.
25
+ */
26
+ export declare function useThrottle<T extends (...args: unknown[]) => void>(callback: T, intervalMs: number): T;
27
+ /**
28
+ * Creates a ref that always contains the latest value.
29
+ * Useful for accessing current values in event handlers without stale closures.
30
+ */
31
+ export declare function useLatestRef<T>(value: T): RefObject<T>;
32
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/editor/hooks/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAIvC;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CActD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,OAAO,CAGpE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,gBAAgB,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,EAChD,OAAO,GAAE,OAAc,GACrB,IAAI,CAuBN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,EACjE,QAAQ,EAAE,CAAC,EACX,UAAU,EAAE,MAAM,GAChB,CAAC,CAYH;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAItD"}
@@ -0,0 +1,12 @@
1
+ declare class CmsEditor {
2
+ private appRoot;
3
+ private shadowRoot;
4
+ private config;
5
+ init(): Promise<void>;
6
+ private setupUI;
7
+ private injectThemeStyles;
8
+ private setupKeyboardShortcuts;
9
+ private toggleVisibility;
10
+ }
11
+ export { CmsEditor };
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/editor/index.tsx"],"names":[],"mappings":"AAkXA,cAAM,SAAS;IACd,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,MAAM,CAAc;IAEtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAS3B,OAAO,CAAC,OAAO;IA2Bf,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,sBAAsB;IAgC9B,OAAO,CAAC,gBAAgB;CASxB;AAgBD,OAAO,EAAE,SAAS,EAAE,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare const cn: (...inputs: ClassValue[]) => string;
3
+ //# sourceMappingURL=cn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../../../../src/editor/lib/cn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAA;AAG5C,eAAO,MAAM,EAAE,GAAI,GAAG,QAAQ,UAAU,EAAE,WAA6B,CAAA"}
@@ -0,0 +1,19 @@
1
+ import type { CmsManifest, ComponentDefinition, ComponentInstance, ManifestEntry } from './types';
2
+ type GetManifestEntry = (manifest: CmsManifest, id: string) => ManifestEntry | undefined;
3
+ export declare const getManifestEntry: GetManifestEntry;
4
+ type HasManifestEntry = (manifest: CmsManifest, id: string) => boolean;
5
+ export declare const hasManifestEntry: HasManifestEntry;
6
+ type GetComponentInstances = (manifest: CmsManifest) => Record<string, ComponentInstance>;
7
+ export declare const getComponentInstances: GetComponentInstances;
8
+ type GetComponentInstance = (manifest: CmsManifest, id: string) => ComponentInstance | undefined;
9
+ export declare const getComponentInstance: GetComponentInstance;
10
+ type GetComponentDefinitions = (manifest: CmsManifest) => Record<string, ComponentDefinition>;
11
+ export declare const getComponentDefinitions: GetComponentDefinitions;
12
+ type GetComponentDefinition = (manifest: CmsManifest, name: string) => ComponentDefinition | undefined;
13
+ export declare const getComponentDefinition: GetComponentDefinition;
14
+ type GetManifestEntryCount = (manifest: CmsManifest) => number;
15
+ export declare const getManifestEntryCount: GetManifestEntryCount;
16
+ type GetAvailableComponentNames = (manifest: CmsManifest) => string[];
17
+ export declare const getAvailableComponentNames: GetAvailableComponentNames;
18
+ export {};
19
+ //# sourceMappingURL=manifest.d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