@alpaca-editor/core 1.0.3767 → 1.0.3768

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 (443) hide show
  1. package/dist/client-components/api.d.ts +1 -0
  2. package/dist/client-components/api.js +1 -4
  3. package/dist/client-components/index.d.ts +16 -0
  4. package/dist/client-components/index.js +16 -36
  5. package/dist/components/ActionButton.d.ts +12 -0
  6. package/dist/components/ActionButton.js +4 -8
  7. package/dist/components/Error.d.ts +9 -0
  8. package/dist/components/Error.js +8 -13
  9. package/dist/config/config.d.ts +6 -0
  10. package/dist/config/config.js +145 -153
  11. package/dist/config/types.d.ts +223 -0
  12. package/dist/config/types.js +1 -2
  13. package/dist/editor/ComponentInfo.d.ts +4 -0
  14. package/dist/editor/ComponentInfo.js +12 -15
  15. package/dist/editor/ConfirmationDialog.d.ts +19 -0
  16. package/dist/editor/ConfirmationDialog.js +11 -13
  17. package/dist/editor/ContentTree.d.ts +35 -0
  18. package/dist/editor/ContentTree.js +56 -59
  19. package/dist/editor/ContextMenu.d.ts +13 -0
  20. package/dist/editor/ContextMenu.js +9 -13
  21. package/dist/editor/Editor.d.ts +11 -0
  22. package/dist/editor/Editor.js +21 -27
  23. package/dist/editor/EditorWarning.d.ts +5 -0
  24. package/dist/editor/EditorWarning.js +4 -7
  25. package/dist/editor/EditorWarnings.d.ts +9 -0
  26. package/dist/editor/EditorWarnings.js +6 -12
  27. package/dist/editor/FieldEditorPopup.d.ts +10 -0
  28. package/dist/editor/FieldEditorPopup.js +10 -13
  29. package/dist/editor/FieldHistory.d.ts +6 -0
  30. package/dist/editor/FieldHistory.js +17 -20
  31. package/dist/editor/FieldList.d.ts +16 -0
  32. package/dist/editor/FieldList.js +17 -23
  33. package/dist/editor/FieldListField.d.ts +14 -0
  34. package/dist/editor/FieldListField.js +44 -48
  35. package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
  36. package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
  37. package/dist/editor/FloatingToolbar.d.ts +7 -0
  38. package/dist/editor/FloatingToolbar.js +20 -23
  39. package/dist/editor/ImageEditor.d.ts +5 -0
  40. package/dist/editor/ImageEditor.js +11 -14
  41. package/dist/editor/InsertMenu.d.ts +8 -0
  42. package/dist/editor/InsertMenu.js +37 -44
  43. package/dist/editor/ItemInfo.d.ts +4 -0
  44. package/dist/editor/ItemInfo.js +11 -14
  45. package/dist/editor/LinkEditorDialog.d.ts +15 -0
  46. package/dist/editor/LinkEditorDialog.js +27 -33
  47. package/dist/editor/MainLayout.d.ts +9 -0
  48. package/dist/editor/MainLayout.js +16 -22
  49. package/dist/editor/NewEditorClient.d.ts +5 -0
  50. package/dist/editor/NewEditorClient.js +3 -6
  51. package/dist/editor/PictureCropper.d.ts +6 -0
  52. package/dist/editor/PictureCropper.js +31 -37
  53. package/dist/editor/PictureEditor.d.ts +8 -0
  54. package/dist/editor/PictureEditor.js +15 -18
  55. package/dist/editor/PictureEditorDialog.d.ts +8 -0
  56. package/dist/editor/PictureEditorDialog.js +28 -34
  57. package/dist/editor/ScrollingContentTree.d.ts +6 -0
  58. package/dist/editor/ScrollingContentTree.js +10 -16
  59. package/dist/editor/Terminal.d.ts +14 -0
  60. package/dist/editor/Terminal.js +20 -23
  61. package/dist/editor/Titlebar.d.ts +1 -0
  62. package/dist/editor/Titlebar.js +5 -8
  63. package/dist/editor/ai/AiPopup.d.ts +10 -0
  64. package/dist/editor/ai/AiPopup.js +10 -13
  65. package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
  66. package/dist/editor/ai/AiResponseMessage.js +12 -15
  67. package/dist/editor/ai/AiTerminal.d.ts +34 -0
  68. package/dist/editor/ai/AiTerminal.js +41 -47
  69. package/dist/editor/ai/AiToolCall.d.ts +9 -0
  70. package/dist/editor/ai/AiToolCall.js +8 -11
  71. package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
  72. package/dist/editor/ai/EditorAiTerminal.js +5 -8
  73. package/dist/editor/ai/editorAiContext.d.ts +11 -0
  74. package/dist/editor/ai/editorAiContext.js +1 -4
  75. package/dist/editor/client/DialogContext.d.ts +12 -0
  76. package/dist/editor/client/DialogContext.js +9 -14
  77. package/dist/editor/client/EditorClient.d.ts +26 -0
  78. package/dist/editor/client/EditorClient.js +177 -216
  79. package/dist/editor/client/GenericDialog.d.ts +10 -0
  80. package/dist/editor/client/GenericDialog.js +11 -14
  81. package/dist/editor/client/editContext.d.ts +199 -0
  82. package/dist/editor/client/editContext.js +14 -54
  83. package/dist/editor/client/helpers.d.ts +12 -0
  84. package/dist/editor/client/helpers.js +1 -4
  85. package/dist/editor/client/itemsRepository.d.ts +24 -0
  86. package/dist/editor/client/itemsRepository.js +22 -25
  87. package/dist/editor/client/operations.d.ts +57 -0
  88. package/dist/editor/client/operations.js +47 -53
  89. package/dist/editor/client/pageModelBuilder.d.ts +6 -0
  90. package/dist/editor/client/pageModelBuilder.js +10 -13
  91. package/dist/editor/commands/commands.d.ts +19 -0
  92. package/dist/editor/commands/commands.js +1 -2
  93. package/dist/editor/commands/componentCommands.d.ts +13 -0
  94. package/dist/editor/commands/componentCommands.js +7 -14
  95. package/dist/editor/commands/createVersionCommand.d.ts +4 -0
  96. package/dist/editor/commands/createVersionCommand.js +5 -8
  97. package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
  98. package/dist/editor/commands/deleteVersionCommand.js +5 -8
  99. package/dist/editor/commands/itemCommands.d.ts +17 -0
  100. package/dist/editor/commands/itemCommands.js +9 -12
  101. package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
  102. package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
  103. package/dist/editor/commands/undo.d.ts +15 -0
  104. package/dist/editor/commands/undo.js +2 -6
  105. package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
  106. package/dist/editor/component-designer/ComponentDesigner.js +21 -24
  107. package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
  108. package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
  109. package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
  110. package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
  111. package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
  112. package/dist/editor/component-designer/ComponentEditor.js +19 -22
  113. package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
  114. package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
  115. package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
  116. package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
  117. package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
  118. package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
  119. package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
  120. package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
  121. package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
  122. package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
  123. package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
  124. package/dist/editor/component-designer/TemplateEditor.js +21 -24
  125. package/dist/editor/component-designer/aiContext.d.ts +5 -0
  126. package/dist/editor/component-designer/aiContext.js +3 -6
  127. package/dist/editor/componentTreeHelper.d.ts +16 -0
  128. package/dist/editor/componentTreeHelper.js +8 -19
  129. package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
  130. package/dist/editor/control-center/ControlCenterMenu.js +15 -18
  131. package/dist/editor/control-center/IndexOverview.d.ts +1 -0
  132. package/dist/editor/control-center/IndexOverview.js +12 -15
  133. package/dist/editor/control-center/IndexSettings.d.ts +5 -0
  134. package/dist/editor/control-center/IndexSettings.js +29 -32
  135. package/dist/editor/control-center/Status.d.ts +1 -0
  136. package/dist/editor/control-center/Status.js +3 -6
  137. package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
  138. package/dist/editor/editor-warnings/ItemLocked.js +7 -10
  139. package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
  140. package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
  141. package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
  142. package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
  143. package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
  144. package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
  145. package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
  146. package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
  147. package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
  148. package/dist/editor/field-types/AttachmentEditor.js +3 -6
  149. package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
  150. package/dist/editor/field-types/CheckboxEditor.js +11 -14
  151. package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
  152. package/dist/editor/field-types/DropLinkEditor.js +14 -17
  153. package/dist/editor/field-types/DropListEditor.d.ts +5 -0
  154. package/dist/editor/field-types/DropListEditor.js +12 -15
  155. package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
  156. package/dist/editor/field-types/ImageFieldEditor.js +10 -13
  157. package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
  158. package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
  159. package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
  160. package/dist/editor/field-types/LinkFieldEditor.js +12 -15
  161. package/dist/editor/field-types/MultiLineText.d.ts +6 -0
  162. package/dist/editor/field-types/MultiLineText.js +11 -14
  163. package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
  164. package/dist/editor/field-types/PictureFieldEditor.js +13 -16
  165. package/dist/editor/field-types/RawEditor.d.ts +5 -0
  166. package/dist/editor/field-types/RawEditor.js +12 -15
  167. package/dist/editor/field-types/ReactQuill.d.ts +125 -0
  168. package/dist/editor/field-types/ReactQuill.js +100 -82
  169. package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
  170. package/dist/editor/field-types/RichTextEditor.js +5 -44
  171. package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
  172. package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
  173. package/dist/editor/field-types/SingleLineText.d.ts +6 -0
  174. package/dist/editor/field-types/SingleLineText.js +13 -16
  175. package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
  176. package/dist/editor/field-types/TreeListEditor.js +33 -39
  177. package/dist/editor/fieldTypes.d.ts +117 -0
  178. package/dist/editor/fieldTypes.js +1 -2
  179. package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
  180. package/dist/editor/media-selector/AiImageSearch.js +30 -36
  181. package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
  182. package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
  183. package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
  184. package/dist/editor/media-selector/MediaSelector.js +5 -9
  185. package/dist/editor/media-selector/Preview.d.ts +4 -0
  186. package/dist/editor/media-selector/Preview.js +3 -6
  187. package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
  188. package/dist/editor/media-selector/Thumbnails.js +5 -8
  189. package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
  190. package/dist/editor/media-selector/TreeSelector.js +39 -46
  191. package/dist/editor/media-selector/UploadZone.d.ts +4 -0
  192. package/dist/editor/media-selector/UploadZone.js +17 -20
  193. package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
  194. package/dist/editor/menubar/ActionsMenu.js +10 -13
  195. package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
  196. package/dist/editor/menubar/ActiveUsers.js +7 -10
  197. package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
  198. package/dist/editor/menubar/ApproveAndPublish.js +5 -8
  199. package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
  200. package/dist/editor/menubar/BrowseHistory.js +6 -9
  201. package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
  202. package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
  203. package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
  204. package/dist/editor/menubar/LanguageSelector.js +12 -15
  205. package/dist/editor/menubar/Menu.d.ts +1 -0
  206. package/dist/editor/menubar/Menu.js +12 -15
  207. package/dist/editor/menubar/NavButtons.d.ts +1 -0
  208. package/dist/editor/menubar/NavButtons.js +8 -11
  209. package/dist/editor/menubar/PageSelector.d.ts +4 -0
  210. package/dist/editor/menubar/PageSelector.js +16 -19
  211. package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
  212. package/dist/editor/menubar/PageViewerControls.js +13 -16
  213. package/dist/editor/menubar/Separator.d.ts +3 -0
  214. package/dist/editor/menubar/Separator.js +4 -7
  215. package/dist/editor/menubar/SiteInfo.d.ts +1 -0
  216. package/dist/editor/menubar/SiteInfo.js +13 -16
  217. package/dist/editor/menubar/User.d.ts +4 -0
  218. package/dist/editor/menubar/User.js +5 -8
  219. package/dist/editor/menubar/VersionSelector.d.ts +9 -0
  220. package/dist/editor/menubar/VersionSelector.js +18 -21
  221. package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
  222. package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
  223. package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
  224. package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
  225. package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
  226. package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
  227. package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
  228. package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
  229. package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
  230. package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
  231. package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
  232. package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
  233. package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
  234. package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
  235. package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
  236. package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
  237. package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
  238. package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
  239. package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
  240. package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
  241. package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
  242. package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
  243. package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
  244. package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
  245. package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
  246. package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
  247. package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
  248. package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
  249. package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
  250. package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
  251. package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
  252. package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
  253. package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
  254. package/dist/editor/page-viewer/EditorForm.js +22 -25
  255. package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
  256. package/dist/editor/page-viewer/MiniMap.js +27 -63
  257. package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
  258. package/dist/editor/page-viewer/PageViewer.js +21 -24
  259. package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
  260. package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
  261. package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
  262. package/dist/editor/page-viewer/pageViewContext.js +26 -29
  263. package/dist/editor/pageModel.d.ts +171 -0
  264. package/dist/editor/pageModel.js +1 -2
  265. package/dist/editor/picture-shared.d.ts +16 -0
  266. package/dist/editor/picture-shared.js +2 -6
  267. package/dist/editor/reviews/Comment.d.ts +4 -0
  268. package/dist/editor/reviews/Comment.js +32 -35
  269. package/dist/editor/reviews/Comments.d.ts +1 -0
  270. package/dist/editor/reviews/Comments.js +14 -17
  271. package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
  272. package/dist/editor/reviews/PreviewInfo.js +6 -9
  273. package/dist/editor/reviews/Reviews.d.ts +1 -0
  274. package/dist/editor/reviews/Reviews.js +36 -42
  275. package/dist/editor/reviews/reviewCommands.d.ts +3 -0
  276. package/dist/editor/reviews/reviewCommands.js +8 -11
  277. package/dist/editor/reviews/useReviews.d.ts +12 -0
  278. package/dist/editor/reviews/useReviews.js +11 -17
  279. package/dist/editor/services/aiService.d.ts +34 -0
  280. package/dist/editor/services/aiService.js +5 -10
  281. package/dist/editor/services/componentDesignerService.d.ts +46 -0
  282. package/dist/editor/services/componentDesignerService.js +14 -22
  283. package/dist/editor/services/contentService.d.ts +34 -0
  284. package/dist/editor/services/contentService.js +18 -31
  285. package/dist/editor/services/editService.d.ts +34 -0
  286. package/dist/editor/services/editService.js +48 -77
  287. package/dist/editor/services/indexService.d.ts +6 -0
  288. package/dist/editor/services/indexService.js +11 -18
  289. package/dist/editor/services/reviewsService.d.ts +12 -0
  290. package/dist/editor/services/reviewsService.js +30 -42
  291. package/dist/editor/services/serviceHelper.d.ts +9 -0
  292. package/dist/editor/services/serviceHelper.js +2 -6
  293. package/dist/editor/services/systemService.d.ts +2 -0
  294. package/dist/editor/services/systemService.js +3 -6
  295. package/dist/editor/services/translationService.d.ts +11 -0
  296. package/dist/editor/services/translationService.js +7 -12
  297. package/dist/editor/services-server/api.d.ts +19 -0
  298. package/dist/editor/services-server/api.js +10 -19
  299. package/dist/editor/services-server/graphQL.d.ts +29 -0
  300. package/dist/editor/services-server/graphQL.js +5 -9
  301. package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
  302. package/dist/editor/sidebar/ComponentPalette.js +19 -22
  303. package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
  304. package/dist/editor/sidebar/ComponentTree.js +26 -29
  305. package/dist/editor/sidebar/Debug.d.ts +1 -0
  306. package/dist/editor/sidebar/Debug.js +20 -23
  307. package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
  308. package/dist/editor/sidebar/DictionaryEditor.js +45 -48
  309. package/dist/editor/sidebar/EditHistory.d.ts +1 -0
  310. package/dist/editor/sidebar/EditHistory.js +22 -25
  311. package/dist/editor/sidebar/GraphQL.d.ts +1 -0
  312. package/dist/editor/sidebar/GraphQL.js +17 -20
  313. package/dist/editor/sidebar/Insert.d.ts +1 -0
  314. package/dist/editor/sidebar/Insert.js +10 -13
  315. package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
  316. package/dist/editor/sidebar/MainContentTree.js +16 -22
  317. package/dist/editor/sidebar/Performance.d.ts +1 -0
  318. package/dist/editor/sidebar/Performance.js +7 -10
  319. package/dist/editor/sidebar/Sessions.d.ts +1 -0
  320. package/dist/editor/sidebar/Sessions.js +7 -10
  321. package/dist/editor/sidebar/Sidebar.d.ts +1 -0
  322. package/dist/editor/sidebar/Sidebar.js +6 -9
  323. package/dist/editor/sidebar/SidebarView.d.ts +8 -0
  324. package/dist/editor/sidebar/SidebarView.js +18 -21
  325. package/dist/editor/sidebar/Translations.d.ts +1 -0
  326. package/dist/editor/sidebar/Translations.js +31 -34
  327. package/dist/editor/sidebar/Validation.d.ts +1 -0
  328. package/dist/editor/sidebar/Validation.js +11 -14
  329. package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
  330. package/dist/editor/sidebar/ViewSelector.js +8 -11
  331. package/dist/editor/sidebar/Workbox.d.ts +1 -0
  332. package/dist/editor/sidebar/Workbox.js +20 -23
  333. package/dist/editor/ui/CenteredMessage.d.ts +3 -0
  334. package/dist/editor/ui/CenteredMessage.js +3 -6
  335. package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
  336. package/dist/editor/ui/CopyToClipboardButton.js +5 -8
  337. package/dist/editor/ui/DialogButtons.d.ts +3 -0
  338. package/dist/editor/ui/DialogButtons.js +3 -6
  339. package/dist/editor/ui/Icons.d.ts +38 -0
  340. package/dist/editor/ui/Icons.js +54 -74
  341. package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
  342. package/dist/editor/ui/ItemNameDialog.js +16 -22
  343. package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
  344. package/dist/editor/ui/ItemNameDialogNew.js +22 -28
  345. package/dist/editor/ui/ItemSearch.d.ts +23 -0
  346. package/dist/editor/ui/ItemSearch.js +24 -28
  347. package/dist/editor/ui/PerfectTree.d.ts +60 -0
  348. package/dist/editor/ui/PerfectTree.js +39 -76
  349. package/dist/editor/ui/Section.d.ts +4 -0
  350. package/dist/editor/ui/Section.js +7 -10
  351. package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
  352. package/dist/editor/ui/SimpleIconButton.js +4 -7
  353. package/dist/editor/ui/SimpleMenu.d.ts +13 -0
  354. package/dist/editor/ui/SimpleMenu.js +4 -7
  355. package/dist/editor/ui/SimpleTable.d.ts +14 -0
  356. package/dist/editor/ui/SimpleTable.js +5 -8
  357. package/dist/editor/ui/SimpleTabs.d.ts +12 -0
  358. package/dist/editor/ui/SimpleTabs.js +4 -7
  359. package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
  360. package/dist/editor/ui/SimpleToolbar.js +3 -6
  361. package/dist/editor/ui/Spinner.d.ts +3 -0
  362. package/dist/editor/ui/Spinner.js +3 -6
  363. package/dist/editor/ui/Splitter.d.ts +15 -0
  364. package/dist/editor/ui/Splitter.js +16 -53
  365. package/dist/editor/ui/StackedPanels.d.ts +5 -0
  366. package/dist/editor/ui/StackedPanels.js +18 -21
  367. package/dist/editor/ui/Toolbar.d.ts +3 -0
  368. package/dist/editor/ui/Toolbar.js +3 -6
  369. package/dist/editor/utils/id-helper.d.ts +1 -0
  370. package/dist/editor/utils/id-helper.js +1 -4
  371. package/dist/editor/utils/insertOptions.d.ts +3 -0
  372. package/dist/editor/utils/insertOptions.js +3 -6
  373. package/dist/editor/utils/itemutils.d.ts +3 -0
  374. package/dist/editor/utils/itemutils.js +3 -7
  375. package/dist/editor/utils/useMemoDebug.d.ts +1 -0
  376. package/dist/editor/utils/useMemoDebug.js +4 -7
  377. package/dist/editor/utils.d.ts +44 -0
  378. package/dist/editor/utils.js +27 -48
  379. package/dist/editor/views/CompareView.d.ts +1 -0
  380. package/dist/editor/views/CompareView.js +31 -34
  381. package/dist/editor/views/EditView.d.ts +1 -0
  382. package/dist/editor/views/EditView.js +9 -12
  383. package/dist/editor/views/ItemEditor.d.ts +7 -0
  384. package/dist/editor/views/ItemEditor.js +9 -12
  385. package/dist/editor/views/SingleEditView.d.ts +8 -0
  386. package/dist/editor/views/SingleEditView.js +12 -15
  387. package/dist/index.d.ts +4 -0
  388. package/dist/index.js +3 -22
  389. package/dist/page-wizard/PageWizard.d.ts +70 -0
  390. package/dist/page-wizard/PageWizard.js +16 -19
  391. package/dist/page-wizard/SelectWizard.d.ts +7 -0
  392. package/dist/page-wizard/SelectWizard.js +16 -19
  393. package/dist/page-wizard/WizardSteps.d.ts +8 -0
  394. package/dist/page-wizard/WizardSteps.js +20 -23
  395. package/dist/page-wizard/service.d.ts +15 -0
  396. package/dist/page-wizard/service.js +6 -11
  397. package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
  398. package/dist/page-wizard/startPageWizardCommand.js +1 -4
  399. package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
  400. package/dist/page-wizard/steps/BuildPageStep.js +27 -33
  401. package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
  402. package/dist/page-wizard/steps/CollectStep.js +21 -27
  403. package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
  404. package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
  405. package/dist/page-wizard/steps/Components.d.ts +9 -0
  406. package/dist/page-wizard/steps/Components.js +16 -22
  407. package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
  408. package/dist/page-wizard/steps/CreatePage.js +25 -28
  409. package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
  410. package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
  411. package/dist/page-wizard/steps/EditButton.d.ts +8 -0
  412. package/dist/page-wizard/steps/EditButton.js +3 -6
  413. package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
  414. package/dist/page-wizard/steps/FieldEditor.js +9 -12
  415. package/dist/page-wizard/steps/Generate.d.ts +5 -0
  416. package/dist/page-wizard/steps/Generate.js +6 -8
  417. package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
  418. package/dist/page-wizard/steps/ImagesStep.js +32 -36
  419. package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
  420. package/dist/page-wizard/steps/LayoutStep.js +27 -30
  421. package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
  422. package/dist/page-wizard/steps/SelectStep.js +29 -35
  423. package/dist/page-wizard/steps/schema.d.ts +13 -0
  424. package/dist/page-wizard/steps/schema.js +2 -6
  425. package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
  426. package/dist/page-wizard/steps/usePageCreator.js +13 -16
  427. package/dist/splash-screen/NewPage.d.ts +3 -0
  428. package/dist/splash-screen/NewPage.js +39 -42
  429. package/dist/splash-screen/SectionHeadline.d.ts +4 -0
  430. package/dist/splash-screen/SectionHeadline.js +5 -8
  431. package/dist/splash-screen/SplashScreen.d.ts +1 -0
  432. package/dist/splash-screen/SplashScreen.js +23 -26
  433. package/dist/tour/Tour.d.ts +3 -0
  434. package/dist/tour/Tour.js +17 -20
  435. package/dist/tour/default-tour.d.ts +9 -0
  436. package/dist/tour/default-tour.js +10 -13
  437. package/dist/tour/preview-tour.d.ts +2 -0
  438. package/dist/tour/preview-tour.js +12 -15
  439. package/dist/types.d.ts +259 -0
  440. package/dist/types.js +1 -2
  441. package/package.json +1 -1
  442. package/tsconfig.build.json +16 -12
  443. package/dist/tsconfig.build.tsbuildinfo +0 -1
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EditButton = EditButton;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- function EditButton({ field, onEdit, className = "" }) {
6
- return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onEdit, className: `inline-flex items-center justify-center p-1 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${className}`, "aria-label": `Edit ${field.name || "field"}`, title: `Edit ${field.name || "field"}`, children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" }) }) }));
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function EditButton({ field, onEdit, className = "" }) {
3
+ return (_jsx("button", { type: "button", onClick: onEdit, className: `inline-flex items-center justify-center p-1 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${className}`, "aria-label": `Edit ${field.name || "field"}`, title: `Edit ${field.name || "field"}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" }) }) }));
7
4
  }
@@ -0,0 +1,5 @@
1
+ import { WizardField } from "../PageWizard";
2
+ export declare function FieldEditor({ field, onFieldEdited, }: {
3
+ field: WizardField;
4
+ onFieldEdited: () => void;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,20 +1,17 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FieldEditor = FieldEditor;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const editor_1 = require("primereact/editor");
7
- function FieldEditor({ field, onFieldEdited, }) {
8
- const [fieldValue, setFieldValue] = (0, react_1.useState)("");
9
- const [isEditing, setIsEditing] = (0, react_1.useState)(false);
10
- (0, react_1.useEffect)(() => {
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { Editor } from "primereact/editor";
4
+ export function FieldEditor({ field, onFieldEdited, }) {
5
+ const [fieldValue, setFieldValue] = useState("");
6
+ const [isEditing, setIsEditing] = useState(false);
7
+ useEffect(() => {
11
8
  if (isEditing) {
12
9
  const value = field.value;
13
10
  setFieldValue(typeof value === "string" ? value : "");
14
11
  }
15
12
  }, [isEditing]);
16
13
  if (!isEditing) {
17
- return ((0, jsx_runtime_1.jsxs)("div", { onClick: () => setIsEditing(true), className: "cursor-pointer mb-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "font-bold text-gray-900", children: [field.name, ":"] }), (0, jsx_runtime_1.jsx)("div", { className: "text-gray-700 [&_ul]:list-disc [&_ul]:pl-5 [&_li]:my-1 [&_p]:my-1", dangerouslySetInnerHTML: { __html: field.value } })] }));
14
+ return (_jsxs("div", { onClick: () => setIsEditing(true), className: "cursor-pointer mb-2", children: [_jsxs("div", { className: "font-bold text-gray-900", children: [field.name, ":"] }), _jsx("div", { className: "text-gray-700 [&_ul]:list-disc [&_ul]:pl-5 [&_li]:my-1 [&_p]:my-1", dangerouslySetInnerHTML: { __html: field.value } })] }));
18
15
  }
19
16
  const isRichText = field.type === "Rich Text";
20
17
  const handleSave = () => {
@@ -26,5 +23,5 @@ function FieldEditor({ field, onFieldEdited, }) {
26
23
  const handleCancel = () => {
27
24
  setIsEditing(false);
28
25
  };
29
- return ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-1000", children: (0, jsx_runtime_1.jsxs)("div", { className: "bg-white rounded-lg shadow-xl p-6 w-full max-w-lg", children: [(0, jsx_runtime_1.jsxs)("h3", { className: "text-lg font-medium text-gray-900 mb-4", children: ["Edit ", field.name || "Field"] }), isRichText ? ((0, jsx_runtime_1.jsx)("div", { className: "mb-4", children: (0, jsx_runtime_1.jsx)(editor_1.Editor, { className: "w-full h-64 p-2 border border-gray-300 rounded-md", value: fieldValue, onTextChange: (e) => setFieldValue(e.htmlValue || "") }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "mb-4", children: (0, jsx_runtime_1.jsx)("textarea", { className: "w-full p-2 border border-gray-300 rounded-md", value: fieldValue, onChange: (e) => setFieldValue(e.target.value) }) })), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-end space-x-3", children: [(0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleCancel, className: "inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", children: "Cancel" }), (0, jsx_runtime_1.jsx)("button", { type: "button", onClick: handleSave, className: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", children: "Save" })] })] }) }));
26
+ return (_jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-1000", children: _jsxs("div", { className: "bg-white rounded-lg shadow-xl p-6 w-full max-w-lg", children: [_jsxs("h3", { className: "text-lg font-medium text-gray-900 mb-4", children: ["Edit ", field.name || "Field"] }), isRichText ? (_jsx("div", { className: "mb-4", children: _jsx(Editor, { className: "w-full h-64 p-2 border border-gray-300 rounded-md", value: fieldValue, onTextChange: (e) => setFieldValue(e.htmlValue || "") }) })) : (_jsx("div", { className: "mb-4", children: _jsx("textarea", { className: "w-full p-2 border border-gray-300 rounded-md", value: fieldValue, onChange: (e) => setFieldValue(e.target.value) }) })), _jsxs("div", { className: "flex justify-end space-x-3", children: [_jsx("button", { type: "button", onClick: handleCancel, className: "inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", children: "Cancel" }), _jsx("button", { type: "button", onClick: handleSave, className: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", children: "Save" })] })] }) }));
30
27
  }
@@ -0,0 +1,5 @@
1
+ interface GenerateProps {
2
+ title: string;
3
+ }
4
+ declare function Generate({ title }: GenerateProps): import("react/jsx-runtime").JSX.Element;
5
+ export default Generate;
@@ -1,11 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const utils_1 = require("primereact/utils");
5
- const Icons_1 = require("../../editor/ui/Icons");
6
- const Icons_2 = require("../../editor/ui/Icons");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classNames } from "primereact/utils";
3
+ import { SparkleIconBig } from "../../editor/ui/Icons";
4
+ import { SparkleIconSmall } from "../../editor/ui/Icons";
7
5
  function Generate({ title }) {
8
6
  console.log("Generate", title);
9
- return ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.classNames)("flex flex-col justify-center items-center h-full transition-all duration-300 animate-fadeIn text-canvas-pink"), children: (0, jsx_runtime_1.jsxs)("div", { className: "mb-20", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex justify-center ml-20 animate-sparkle w-auto min-h-10 delay-700", children: (0, jsx_runtime_1.jsx)(Icons_2.SparkleIconSmall, {}) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center ml-5 animate-sparkle w-auto min-h-20", children: (0, jsx_runtime_1.jsx)(Icons_1.SparkleIconBig, {}) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-center mr-20 animate-sparkle w-auto min-h-10 delay-500", children: (0, jsx_runtime_1.jsx)(Icons_2.SparkleIconSmall, {}) })] }) }));
7
+ return (_jsx("div", { className: classNames("flex flex-col justify-center items-center h-full transition-all duration-300 animate-fadeIn text-canvas-pink"), children: _jsxs("div", { className: "mb-20", children: [_jsx("div", { className: "flex justify-center ml-20 animate-sparkle w-auto min-h-10 delay-700", children: _jsx(SparkleIconSmall, {}) }), _jsx("div", { className: "flex justify-center ml-5 animate-sparkle w-auto min-h-20", children: _jsx(SparkleIconBig, {}) }), _jsx("div", { className: "flex justify-center mr-20 animate-sparkle w-auto min-h-10 delay-500", children: _jsx(SparkleIconSmall, {}) })] }) }));
10
8
  }
11
- exports.default = Generate;
9
+ export default Generate;
@@ -0,0 +1,2 @@
1
+ import { StepComponentProps } from "../../config/types";
2
+ export declare const ImagesStep: (props: StepComponentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,27 +1,24 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImagesStep = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const ScrollingContentTree_1 = require("../../editor/ScrollingContentTree");
7
- const Splitter_1 = require("../../editor/ui/Splitter");
8
- const editContext_1 = require("../../editor/client/editContext");
9
- const aiService_1 = require("../../editor/services/aiService");
10
- const service_1 = require("../service");
11
- const ActionButton_1 = require("../../components/ActionButton");
12
- const utils_1 = require("primereact/utils");
13
- const button_1 = require("primereact/button");
14
- const dialog_1 = require("primereact/dialog");
15
- const ImagesStep = (props) => {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { ScrollingContentTree } from "../../editor/ScrollingContentTree";
4
+ import { Splitter } from "../../editor/ui/Splitter";
5
+ import { useEditContext } from "../../editor/client/editContext";
6
+ import { executePrompt, executeSearch } from "../../editor/services/aiService";
7
+ import { createWizardAiContext } from "../service";
8
+ import { ActionButton } from "../../components/ActionButton";
9
+ import { classNames } from "primereact/utils";
10
+ import { Button } from "primereact/button";
11
+ import { Dialog } from "primereact/dialog";
12
+ export const ImagesStep = (props) => {
16
13
  const mediaRootId = "3D6658D8-A0BF-4E75-B3E2-D050FABCF4E1";
17
- const [selectedFolderId, setSelectedFolderId] = (0, react_1.useState)(mediaRootId);
18
- const [isLoading, setIsLoading] = (0, react_1.useState)(false);
19
- const [error, setError] = (0, react_1.useState)(null);
20
- const editContext = (0, editContext_1.useEditContext)();
14
+ const [selectedFolderId, setSelectedFolderId] = useState(mediaRootId);
15
+ const [isLoading, setIsLoading] = useState(false);
16
+ const [error, setError] = useState(null);
17
+ const editContext = useEditContext();
21
18
  const propName = props.step.propertyName || "images";
22
- const [showFolderDialog, setShowFolderDialog] = (0, react_1.useState)(false);
23
- const [selectedFolder, setSelectedFolder] = (0, react_1.useState)();
24
- (0, react_1.useEffect)(() => {
19
+ const [showFolderDialog, setShowFolderDialog] = useState(false);
20
+ const [selectedFolder, setSelectedFolder] = useState();
21
+ useEffect(() => {
25
22
  if (props.data[propName]?.length > 0) {
26
23
  props.setStepCompleted(true);
27
24
  }
@@ -35,7 +32,7 @@ const ImagesStep = (props) => {
35
32
  }));
36
33
  try {
37
34
  // First, ask AI for keywords based on the content
38
- const aiPromptResult = await (0, aiService_1.executePrompt)([
35
+ const aiPromptResult = await executePrompt([
39
36
  {
40
37
  content: `You are an AI assistant for building a web page. You will later have to create images for the page.
41
38
  Please anaylze the provided data and suggest a number of images and specific keywords per image. The keywords will be used to find matching images in the image library.
@@ -45,11 +42,11 @@ const ImagesStep = (props) => {
45
42
  name: "system",
46
43
  role: "system",
47
44
  },
48
- ], editContext, service_1.createWizardAiContext, [""], true, undefined, "o3-mini-low");
45
+ ], editContext, createWizardAiContext, [""], true, undefined, "o3-mini-low");
49
46
  const images = JSON.parse(aiPromptResult.content).images;
50
47
  // Create an array of promises for all search operations
51
48
  const searchPromises = images.map(async (image) => {
52
- const searchResult = await (0, aiService_1.executeSearch)({
49
+ const searchResult = await executeSearch({
53
50
  query: image.keywords.join(" "),
54
51
  rootItemIds: selectedFolderId ? [selectedFolderId] : undefined,
55
52
  editContext: editContext,
@@ -97,7 +94,7 @@ const ImagesStep = (props) => {
97
94
  setIsLoading(false);
98
95
  }
99
96
  };
100
- (0, react_1.useEffect)(() => {
97
+ useEffect(() => {
101
98
  const loadFolder = async () => {
102
99
  if (selectedFolderId) {
103
100
  const item = await editContext?.itemsRepository.getItem({
@@ -116,25 +113,25 @@ const ImagesStep = (props) => {
116
113
  {
117
114
  name: "Settings",
118
115
  defaultSize: 400,
119
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col gap-2 pr-6 pb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "relative mb-2 rounded-md border border-gray-400 bg-white p-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-2 text-sm font-bold text-gray-800", children: "Image library folder" }), selectedFolder && ((0, jsx_runtime_1.jsx)("div", { className: "mb-2 text-sm text-gray-500", children: selectedFolder.path })), (0, jsx_runtime_1.jsx)(button_1.Button, { label: "Change Folder", onClick: () => {
116
+ content: (_jsxs("div", { className: "flex h-full flex-col gap-2 pr-6 pb-4", children: [_jsxs("div", { className: "relative mb-2 rounded-md border border-gray-400 bg-white p-4", children: [_jsx("div", { className: "mb-2 text-sm font-bold text-gray-800", children: "Image library folder" }), selectedFolder && (_jsx("div", { className: "mb-2 text-sm text-gray-500", children: selectedFolder.path })), _jsx(Button, { label: "Change Folder", onClick: () => {
120
117
  setShowFolderDialog(true);
121
- } }), (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { header: "Select Folder", visible: showFolderDialog, onHide: () => {
118
+ } }), _jsx(Dialog, { header: "Select Folder", visible: showFolderDialog, onHide: () => {
122
119
  setShowFolderDialog(false);
123
- }, style: { width: "50vw", height: "50vh" }, children: (0, jsx_runtime_1.jsx)("div", { className: "relative flex h-full flex-col", children: (0, jsx_runtime_1.jsx)(ScrollingContentTree_1.ScrollingContentTree, { rootItemId: mediaRootId, onSelectionChange: (selection) => {
120
+ }, style: { width: "50vw", height: "50vh" }, children: _jsx("div", { className: "relative flex h-full flex-col", children: _jsx(ScrollingContentTree, { rootItemId: mediaRootId, onSelectionChange: (selection) => {
124
121
  const selectedNode = selection[0];
125
122
  if (selectedNode)
126
123
  setSelectedFolderId(selectedNode.id);
127
124
  else
128
125
  setSelectedFolderId(mediaRootId);
129
126
  setShowFolderDialog(false);
130
- } }) }) })] }), (0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { onClick: findMatchingImages, isLoading: isLoading, disabled: isLoading, loadingText: "Searching...", children: "Find Matching Images" })] })),
127
+ } }) }) })] }), _jsx(ActionButton, { onClick: findMatchingImages, isLoading: isLoading, disabled: isLoading, loadingText: "Searching...", children: "Find Matching Images" })] })),
131
128
  },
132
129
  {
133
130
  name: "Images",
134
131
  defaultSize: "auto",
135
- content: ((0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 overflow-auto", children: (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-4 p-4 pt-0", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [error && (0, jsx_runtime_1.jsx)("div", { className: "text-red-500", children: error }), props.data[propName]?.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col gap-4", children: props.data[propName]?.map((image, index) => ((0, jsx_runtime_1.jsxs)("span", { className: (0, utils_1.classNames)("rounded border border-gray-400 bg-white p-4 text-sm", index % 2 === 0
132
+ content: (_jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx("div", { className: "flex flex-col gap-4 p-4 pt-0", children: _jsxs("div", { className: "flex items-center gap-4", children: [error && _jsx("div", { className: "text-red-500", children: error }), props.data[propName]?.length > 0 && (_jsx("div", { className: "flex flex-col gap-4", children: props.data[propName]?.map((image, index) => (_jsxs("span", { className: classNames("rounded border border-gray-400 bg-white p-4 text-sm", index % 2 === 0
136
133
  ? "animate-fadeRight"
137
- : "animate-fadeLeft"), children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-3 text-lg", children: image.title }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-wrap gap-5", children: image.options?.map((option, thumbnailIndex) => ((0, jsx_runtime_1.jsxs)("div", { className: "relative flex h-28 w-28 cursor-pointer items-center justify-center border border-gray-400", onClick: () => {
134
+ : "animate-fadeLeft"), children: [_jsx("div", { className: "mb-3 text-lg", children: image.title }), _jsx("div", { className: "flex flex-wrap gap-5", children: image.options?.map((option, thumbnailIndex) => (_jsxs("div", { className: "relative flex h-28 w-28 cursor-pointer items-center justify-center border border-gray-400", onClick: () => {
138
135
  props.setData((prevData) => ({
139
136
  ...prevData,
140
137
  [propName]: prevData[propName].map((img, imgIndex) => ({
@@ -149,11 +146,10 @@ const ImagesStep = (props) => {
149
146
  : option),
150
147
  })),
151
148
  }));
152
- }, children: [(0, jsx_runtime_1.jsx)("img", { src: option.thumbUrl, alt: option.name }, thumbnailIndex), (0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.classNames)("peer ring-offset-background focus-visible:ring-ring pointer-events-none absolute right-1 bottom-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", option.selected
149
+ }, children: [_jsx("img", { src: option.thumbUrl, alt: option.name }, thumbnailIndex), _jsx("div", { className: classNames("peer ring-offset-background focus-visible:ring-ring pointer-events-none absolute right-1 bottom-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", option.selected
153
150
  ? "text-canvas-pink border-canvas-pink bg-white"
154
- : ""), children: option.selected && ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: (0, jsx_runtime_1.jsx)("path", { d: "M20 6 9 17l-5-5" }) })) })] }, thumbnailIndex))) })] }, index))) }))] }) }) })),
151
+ : ""), children: option.selected && (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M20 6 9 17l-5-5" }) })) })] }, thumbnailIndex))) })] }, index))) }))] }) }) })),
155
152
  },
156
153
  ];
157
- return (0, jsx_runtime_1.jsx)(Splitter_1.Splitter, { panels: panels });
154
+ return _jsx(Splitter, { panels: panels });
158
155
  };
159
- exports.ImagesStep = ImagesStep;
@@ -0,0 +1,2 @@
1
+ import { StepComponentProps } from "../../config/types";
2
+ export declare function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalState, setInternalState, }: StepComponentProps): import("react/jsx-runtime").JSX.Element | null;
@@ -1,33 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LayoutStep = LayoutStep;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const editContext_1 = require("../../editor/client/editContext");
7
- const aiService_1 = require("../../editor/services/aiService");
8
- const service_1 = require("../service");
9
- const Components_1 = require("./Components");
10
- const Splitter_1 = require("../../editor/ui/Splitter");
11
- const schema_1 = require("./schema");
12
- const ActionButton_1 = require("../../components/ActionButton");
13
- const ComponentTypesSelector_1 = require("./ComponentTypesSelector");
14
- function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalState, setInternalState, }) {
15
- const editContext = (0, editContext_1.useEditContext)();
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from "react";
3
+ import { useEditContext } from "../../editor/client/editContext";
4
+ import { executePrompt } from "../../editor/services/aiService";
5
+ import { createWizardAiContext } from "../service";
6
+ import { Components } from "./Components";
7
+ import { Splitter } from "../../editor/ui/Splitter";
8
+ import { convertPageSchemaToWizardComponents } from "./schema";
9
+ import { ActionButton } from "../../components/ActionButton";
10
+ import { ComponentTypeSelector } from "./ComponentTypesSelector";
11
+ export function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalState, setInternalState, }) {
12
+ const editContext = useEditContext();
16
13
  const abortController = new AbortController();
17
14
  const localAbortController = abortController || new AbortController();
18
- const [isLoading, setIsLoading] = (0, react_1.useState)(false);
19
- const [message, setMessage] = (0, react_1.useState)();
20
- const [selectedComponentTypes, setSelectedComponentTypes] = (0, react_1.useState)([]);
21
- const [customInstructions, setCustomInstructions] = (0, react_1.useState)();
15
+ const [isLoading, setIsLoading] = useState(false);
16
+ const [message, setMessage] = useState();
17
+ const [selectedComponentTypes, setSelectedComponentTypes] = useState([]);
18
+ const [customInstructions, setCustomInstructions] = useState();
22
19
  if (!editContext) {
23
20
  return null;
24
21
  }
25
- (0, react_1.useEffect)(() => {
22
+ useEffect(() => {
26
23
  if (data.pageModel?.components?.length) {
27
24
  setStepCompleted(!isLoading);
28
25
  }
29
26
  }, [data.pageModel, isLoading]);
30
- (0, react_1.useEffect)(() => {
27
+ useEffect(() => {
31
28
  setCustomInstructions(step.instructions);
32
29
  }, []);
33
30
  const createLayout = async () => {
@@ -38,8 +35,8 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
38
35
  ? JSON.parse(wizard.schema)
39
36
  : wizard.schema;
40
37
  // Filter the schema based on selected component types and placeholders
41
- const filteredSchema = (0, schema_1.convertPageSchemaToWizardComponents)(schema, selectedComponentTypes);
42
- const result = await (0, aiService_1.executePrompt)([
38
+ const filteredSchema = convertPageSchemaToWizardComponents(schema, selectedComponentTypes);
39
+ const result = await executePrompt([
43
40
  {
44
41
  content: `${customInstructions?.trim()} Reply with a json object of type PageModel = { name: string; metaDescription: string; components: Component[]; message: string; };
45
42
  Component = { name: string, type: string; fields: Field[]; placeholder?: string; children?: Component[]; };
@@ -56,7 +53,7 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
56
53
  name: "system",
57
54
  role: "system",
58
55
  },
59
- ], editContext, service_1.createWizardAiContext, [""], true, { signal: localAbortController.signal }, "o3-mini-low", (response) => {
56
+ ], editContext, createWizardAiContext, [""], true, { signal: localAbortController.signal }, "o3-mini-low", (response) => {
60
57
  try {
61
58
  const newLayout = JSON.parse(response.content);
62
59
  if (newLayout) {
@@ -89,7 +86,7 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
89
86
  const regenerateLayout = () => {
90
87
  createLayout();
91
88
  };
92
- (0, react_1.useEffect)(() => {
89
+ useEffect(() => {
93
90
  if (!selectedComponentTypes.length)
94
91
  return;
95
92
  // Only set custom instructions if they're not already set or if step.instructions has changed
@@ -99,22 +96,22 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
99
96
  }, [step.instructions, selectedComponentTypes]);
100
97
  // Custom instructions panel
101
98
  const customInstructionsPanel = () => {
102
- return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-4", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-sm font-bold", children: "Instructions" }), (0, jsx_runtime_1.jsx)("div", { className: "mb-3 text-xs text-gray-500", children: "Provide guidance for the AI when generating your layout" }), (0, jsx_runtime_1.jsx)("textarea", { value: customInstructions, onChange: (e) => setCustomInstructions(e.target.value), placeholder: "Example: Make it modern and minimalist. Focus on images. Include a hero section at the top.", className: "w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 h-48", disabled: isLoading })] }));
99
+ return (_jsxs("div", { className: "mb-4", children: [_jsx("h3", { className: "text-sm font-bold", children: "Instructions" }), _jsx("div", { className: "mb-3 text-xs text-gray-500", children: "Provide guidance for the AI when generating your layout" }), _jsx("textarea", { value: customInstructions, onChange: (e) => setCustomInstructions(e.target.value), placeholder: "Example: Make it modern and minimalist. Focus on images. Include a hero section at the top.", className: "w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 h-48", disabled: isLoading })] }));
103
100
  };
104
101
  const settingsPanel = {
105
102
  name: "Settings",
106
103
  collapsible: false,
107
104
  defaultSize: 450,
108
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "absolute inset-0 overflow-auto flex flex-col h-full pr-4", children: [customInstructionsPanel(), (0, jsx_runtime_1.jsx)(ComponentTypesSelector_1.ComponentTypeSelector, { selectedComponentTypes: selectedComponentTypes, setSelectedComponentTypes: setSelectedComponentTypes, schema: wizard.schema, data: data, setData: setData, step: step }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-2", children: [(0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { onClick: regenerateLayout, disabled: isLoading || selectedComponentTypes.length === 0, isLoading: isLoading, loadingText: "Working", className: "flex-1", children: data.pageModel ? "Regenerate Layout" : "Generate Layout" }), isLoading && ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
105
+ content: (_jsxs("div", { className: "absolute inset-0 overflow-auto flex flex-col h-full pr-4", children: [customInstructionsPanel(), _jsx(ComponentTypeSelector, { selectedComponentTypes: selectedComponentTypes, setSelectedComponentTypes: setSelectedComponentTypes, schema: wizard.schema, data: data, setData: setData, step: step }), _jsxs("div", { className: "flex gap-2", children: [_jsx(ActionButton, { onClick: regenerateLayout, disabled: isLoading || selectedComponentTypes.length === 0, isLoading: isLoading, loadingText: "Working", className: "flex-1", children: data.pageModel ? "Regenerate Layout" : "Generate Layout" }), isLoading && (_jsxs("button", { onClick: () => {
109
106
  localAbortController.abort();
110
107
  setIsLoading(false);
111
- }, className: "bg-red-500 text-white px-2 py-1 rounded text-xs hover:bg-red-600 flex items-center gap-1", children: [(0, jsx_runtime_1.jsx)("span", { className: "pi pi-times" }), "Abort"] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-gray-500 p-2", children: message })] })),
108
+ }, className: "bg-red-500 text-white px-2 py-1 rounded text-xs hover:bg-red-600 flex items-center gap-1", children: [_jsx("span", { className: "pi pi-times" }), "Abort"] }))] }), _jsx("div", { className: "text-xs text-gray-500 p-2", children: message })] })),
112
109
  };
113
110
  const layoutPanel = {
114
111
  name: "Layout",
115
112
  defaultSize: "auto",
116
113
  collapsible: false,
117
- content: ((0, jsx_runtime_1.jsx)("div", { className: "absolute inset-2 flex flex-col justify-center items-center text-gray-600", children: (0, jsx_runtime_1.jsx)(Components_1.Components, { pageModel: data.pageModel, onComponentRemoved: () => setData({ ...data }), onFieldEdited: () => setData({ ...data }), thumbnails: internalState.thumbnails, setInternalState: setInternalState }) })),
114
+ content: (_jsx("div", { className: "absolute inset-2 flex flex-col justify-center items-center text-gray-600", children: _jsx(Components, { pageModel: data.pageModel, onComponentRemoved: () => setData({ ...data }), onFieldEdited: () => setData({ ...data }), thumbnails: internalState.thumbnails, setInternalState: setInternalState }) })),
118
115
  };
119
- return ((0, jsx_runtime_1.jsx)(Splitter_1.Splitter, { panels: [settingsPanel, layoutPanel], localStorageKey: "editor.page-wizard.layout" }));
116
+ return (_jsx(Splitter, { panels: [settingsPanel, layoutPanel], localStorageKey: "editor.page-wizard.layout" }));
120
117
  }
@@ -0,0 +1,2 @@
1
+ import { StepComponentProps } from "../../config/types";
2
+ export declare function SelectStep({ step, data, setData, setStepCompleted, internalState, setInternalState, }: StepComponentProps): import("react/jsx-runtime").JSX.Element;
@@ -1,35 +1,29 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SelectStep = SelectStep;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const editContext_1 = require("../../editor/client/editContext");
10
- const aiService_1 = require("../../editor/services/aiService");
11
- const service_1 = require("../service");
12
- const utils_1 = require("primereact/utils");
13
- const Splitter_1 = require("../../editor/ui/Splitter");
14
- const inputtextarea_1 = require("primereact/inputtextarea");
15
- const ActionButton_1 = require("../../components/ActionButton");
16
- const Generate_1 = __importDefault(require("./Generate"));
17
- function SelectStep({ step, data, setData, setStepCompleted, internalState, setInternalState, }) {
18
- const editContext = (0, editContext_1.useEditContext)();
19
- const [options, setOptions] = (0, react_1.useState)([]);
20
- const [loading, setLoading] = (0, react_1.useState)(false);
21
- const [error, setError] = (0, react_1.useState)(null);
22
- const [selectedOptions, setSelectedOptions] = (0, react_1.useState)([]);
23
- const [instructions, setInstructions] = (0, react_1.useState)(step.instructions);
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { useEditContext } from "../../editor/client/editContext";
4
+ import { executePrompt } from "../../editor/services/aiService";
5
+ import { createWizardAiContext } from "../service";
6
+ import { classNames } from "primereact/utils";
7
+ import { Splitter } from "../../editor/ui/Splitter";
8
+ import { InputTextarea } from "primereact/inputtextarea";
9
+ import { ActionButton } from "../../components/ActionButton";
10
+ import Generate from "./Generate";
11
+ export function SelectStep({ step, data, setData, setStepCompleted, internalState, setInternalState, }) {
12
+ const editContext = useEditContext();
13
+ const [options, setOptions] = useState([]);
14
+ const [loading, setLoading] = useState(false);
15
+ const [error, setError] = useState(null);
16
+ const [selectedOptions, setSelectedOptions] = useState([]);
17
+ const [instructions, setInstructions] = useState(step.instructions);
24
18
  // Get the property name from the step or use "choice" as default
25
19
  const propertyName = step.propertyName || "selectedOptions";
26
- (0, react_1.useEffect)(() => {
20
+ useEffect(() => {
27
21
  if (data[propertyName]?.length) {
28
22
  setStepCompleted(true);
29
23
  }
30
24
  }, [data]);
31
25
  // Initialize the property in data
32
- (0, react_1.useEffect)(() => {
26
+ useEffect(() => {
33
27
  if (!data[propertyName]) {
34
28
  setData((prevData) => ({
35
29
  ...prevData,
@@ -46,7 +40,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
46
40
  // Create a prompt based on step instructions and data
47
41
  const prompt = `${instructions}\n\nCurrent data: ${JSON.stringify(data, null, 2)}`;
48
42
  // Call the executePrompt function with the prompt
49
- const result = await (0, aiService_1.executePrompt)([
43
+ const result = await executePrompt([
50
44
  {
51
45
  content: `You are a helpful assistant that generates options for a wizard select step.
52
46
  Generate a JSON array of options based on the instructions and current data.
@@ -60,7 +54,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
60
54
  name: "user",
61
55
  role: "user",
62
56
  },
63
- ], editContext, service_1.createWizardAiContext, [""], true, undefined, step.aiModel || "o3-mini-low");
57
+ ], editContext, createWizardAiContext, [""], true, undefined, step.aiModel || "o3-mini-low");
64
58
  // Parse the result and set options
65
59
  if (result && result.content) {
66
60
  try {
@@ -92,7 +86,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
92
86
  }
93
87
  };
94
88
  // Generate options on component mount
95
- (0, react_1.useEffect)(() => {
89
+ useEffect(() => {
96
90
  if (internalState[step.id + "options"]?.length > 0) {
97
91
  setOptions(internalState[step.id + "options"]);
98
92
  return;
@@ -100,7 +94,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
100
94
  generateOptions();
101
95
  }, [editContext, step.instructions, internalState]);
102
96
  // Sync data[propertyName] with selectedOptions state
103
- (0, react_1.useEffect)(() => {
97
+ useEffect(() => {
104
98
  const currentSelections = data[propertyName] || [];
105
99
  setSelectedOptions(currentSelections.map((option) => option.id));
106
100
  }, [data, propertyName]);
@@ -127,24 +121,24 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
127
121
  });
128
122
  };
129
123
  if (error) {
130
- return ((0, jsx_runtime_1.jsxs)("div", { className: "text-red-500 p-4", children: [error, (0, jsx_runtime_1.jsx)("button", { className: "ml-4 px-2 py-1 bg-blue-500 text-white rounded", onClick: () => window.location.reload(), children: "Retry" })] }));
124
+ return (_jsxs("div", { className: "text-red-500 p-4", children: [error, _jsx("button", { className: "ml-4 px-2 py-1 bg-blue-500 text-white rounded", onClick: () => window.location.reload(), children: "Retry" })] }));
131
125
  }
132
126
  const optionsPanel = {
133
127
  name: "options",
134
128
  defaultSize: "auto",
135
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 h-full", children: [loading && ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center h-full", children: (0, jsx_runtime_1.jsx)(Generate_1.default, { title: "Generating options..." }) })), !loading && ((0, jsx_runtime_1.jsx)("div", { children: options.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-gray-500 p-4", children: "No options available. Try refreshing the page." })) : (options.map((option, index) => {
129
+ content: (_jsxs("div", { className: "p-4 h-full", children: [loading && (_jsx("div", { className: "flex items-center justify-center h-full", children: _jsx(Generate, { title: "Generating options..." }) })), !loading && (_jsx("div", { children: options.length === 0 ? (_jsx("div", { className: "text-gray-500 p-4", children: "No options available. Try refreshing the page." })) : (options.map((option, index) => {
136
130
  const isSelected = selectedOptions.includes(option.id);
137
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.classNames)("mb-3 flex items-center p-3 rounded bg-white border-2", index % 2 === 0
131
+ return (_jsxs("div", { className: classNames("mb-3 flex items-center p-3 rounded bg-white border-2", index % 2 === 0
138
132
  ? "animate-fadeRight"
139
133
  : "animate-fadeLeft", isSelected
140
134
  ? "text-canvas-pink border-canvas-pink"
141
- : "text-gray-600 border-gray-300"), onClick: () => handleOptionSelect(option), children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col flex-1 cursor-pointer", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium", children: option.title }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-gray-600", children: option.description })] }), isSelected && ((0, jsx_runtime_1.jsx)("div", { className: "text-canvas-pink ml-2", children: "\u2713" }))] }, option.id));
135
+ : "text-gray-600 border-gray-300"), onClick: () => handleOptionSelect(option), children: [_jsxs("div", { className: "flex flex-col flex-1 cursor-pointer", children: [_jsx("div", { className: "font-medium", children: option.title }), _jsx("div", { className: "text-xs text-gray-600", children: option.description })] }), isSelected && (_jsx("div", { className: "text-canvas-pink ml-2", children: "\u2713" }))] }, option.id));
142
136
  })) }))] })),
143
137
  };
144
138
  const settingsPanel = {
145
139
  name: "settings",
146
140
  defaultSize: 400,
147
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2 pr-6", children: [(0, jsx_runtime_1.jsx)("h3", { className: "text-sm font-bold", children: "Instructions" }), (0, jsx_runtime_1.jsx)(inputtextarea_1.InputTextarea, { className: "h-48 text-sm", value: instructions, onChange: (e) => setInstructions(e.target.value), placeholder: "Enter instructions for the options" }), (0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { onClick: generateOptions, isLoading: loading, disabled: loading, loadingText: "Thinking...", children: "Regenerate Options" })] })),
141
+ content: (_jsxs("div", { className: "flex flex-col gap-2 pr-6", children: [_jsx("h3", { className: "text-sm font-bold", children: "Instructions" }), _jsx(InputTextarea, { className: "h-48 text-sm", value: instructions, onChange: (e) => setInstructions(e.target.value), placeholder: "Enter instructions for the options" }), _jsx(ActionButton, { onClick: generateOptions, isLoading: loading, disabled: loading, loadingText: "Thinking...", children: "Regenerate Options" })] })),
148
142
  };
149
- return (0, jsx_runtime_1.jsx)(Splitter_1.Splitter, { panels: [settingsPanel, optionsPanel] });
143
+ return _jsx(Splitter, { panels: [settingsPanel, optionsPanel] });
150
144
  }
@@ -0,0 +1,13 @@
1
+ import { WizardSchemaComponent, PageSchema } from "../PageWizard";
2
+ export declare function convertPageSchemaToWizardComponents(pageSchema: PageSchema, whitelist: string[]): WizardSchemaComponent[];
3
+ /**
4
+ * Finds a placeholder (by its name) where a child component of type `childComponentType`
5
+ * can be placed inside a parent of type `parentComponentType`. For a parentComponentType
6
+ * equal to "root" (case‑insensitive), the function searches among top‑level placeholders.
7
+ *
8
+ * @param schema - The PageSchema (an array of SchemaPlaceholders).
9
+ * @param parentComponentType - The type of the parent component, or "root" to indicate top‑level.
10
+ * @param childComponentType - The type of the child component to place.
11
+ * @returns The name of a valid placeholder or undefined if none is found.
12
+ */
13
+ export declare function getPlaceholder(schema: PageSchema, parentComponentType: string, childComponentType: string): string | undefined;
@@ -1,8 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertPageSchemaToWizardComponents = convertPageSchemaToWizardComponents;
4
- exports.getPlaceholder = getPlaceholder;
5
- function convertPageSchemaToWizardComponents(pageSchema, whitelist) {
1
+ export function convertPageSchemaToWizardComponents(pageSchema, whitelist) {
6
2
  const componentMap = new Map();
7
3
  /**
8
4
  * Recursively processes a SchemaComponent.
@@ -83,7 +79,7 @@ function convertPageSchemaToWizardComponents(pageSchema, whitelist) {
83
79
  * @param childComponentType - The type of the child component to place.
84
80
  * @returns The name of a valid placeholder or undefined if none is found.
85
81
  */
86
- function getPlaceholder(schema, parentComponentType, childComponentType) {
82
+ export function getPlaceholder(schema, parentComponentType, childComponentType) {
87
83
  // Check for the special case where we want to place at the root level.
88
84
  if (parentComponentType.toLowerCase() === "root") {
89
85
  // First, look for a top-level placeholder that already contains a component
@@ -0,0 +1,6 @@
1
+ import { Dispatch, SetStateAction } from "react";
2
+ import { Wizard, WizardPageComponent, WizardPageModel } from "../PageWizard";
3
+ import { ItemDescriptor } from "../../editor/pageModel";
4
+ export declare function usePageCreator(pageItem: ItemDescriptor | undefined, wizard: Wizard, setPageModel: Dispatch<SetStateAction<WizardPageModel>>): {
5
+ createComponentsRecursively: (components: WizardPageComponent[], parentComponentType: string, parentComponentId?: string, parentPath?: number[]) => Promise<void>;
6
+ };
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.usePageCreator = usePageCreator;
4
- const react_1 = require("react");
5
- const editContext_1 = require("../../editor/client/editContext");
6
- const editContext_2 = require("../../editor/client/editContext");
7
- const componentTreeHelper_1 = require("../../editor/componentTreeHelper");
8
- const schema_1 = require("./schema");
9
- const utils_1 = require("../../editor/utils");
10
- function usePageCreator(pageItem, wizard, setPageModel) {
11
- const editContext = (0, editContext_2.useEditContext)();
12
- const editContextRef = (0, editContext_1.useEditContextRef)();
1
+ import { useMemo } from "react";
2
+ import { useEditContextRef } from "../../editor/client/editContext";
3
+ import { useEditContext } from "../../editor/client/editContext";
4
+ import { getComponentById } from "../../editor/componentTreeHelper";
5
+ import { getPlaceholder } from "./schema";
6
+ import { normalizeGuid } from "../../editor/utils";
7
+ export function usePageCreator(pageItem, wizard, setPageModel) {
8
+ const editContext = useEditContext();
9
+ const editContextRef = useEditContextRef();
13
10
  // Function to build a map of all components from wizard schema
14
11
  const buildComponentTypeMap = () => {
15
12
  const componentMap = new Map();
@@ -46,7 +43,7 @@ function usePageCreator(pageItem, wizard, setPageModel) {
46
43
  return { componentMap, fieldIdsMap };
47
44
  };
48
45
  // Build the component type to typeId map
49
- const mappings = (0, react_1.useMemo)(() => buildComponentTypeMap(), [wizard.schema]);
46
+ const mappings = useMemo(() => buildComponentTypeMap(), [wizard.schema]);
50
47
  const createNewComponent = async (component, parentComponentType, index, parentComponentId) => {
51
48
  if (!editContext)
52
49
  return undefined;
@@ -56,9 +53,9 @@ function usePageCreator(pageItem, wizard, setPageModel) {
56
53
  // 1. Add the component to the placeholder
57
54
  console.log(`Adding component ${component.type} (typeId: ${typeId}) to placeholder ${parentComponentId} at index ${index}`);
58
55
  const placeholderKey = component.placeholder ||
59
- (0, schema_1.getPlaceholder)(wizard.schema, parentComponentType, component.type);
56
+ getPlaceholder(wizard.schema, parentComponentType, component.type);
60
57
  const placeholderId = parentComponentId
61
- ? placeholderKey + "_" + (0, utils_1.normalizeGuid)(parentComponentId)
58
+ ? placeholderKey + "_" + normalizeGuid(parentComponentId)
62
59
  : placeholderKey;
63
60
  if (!placeholderId) {
64
61
  console.error("Placeholder ID not found", component);
@@ -78,7 +75,7 @@ function usePageCreator(pageItem, wizard, setPageModel) {
78
75
  const maxAttempts = 40;
79
76
  while (!createdComponent && attempts < maxAttempts) {
80
77
  if (editContextRef.current?.page) {
81
- createdComponent = (0, componentTreeHelper_1.getComponentById)(componentId, editContextRef.current?.page);
78
+ createdComponent = getComponentById(componentId, editContextRef.current?.page);
82
79
  if (createdComponent) {
83
80
  break;
84
81
  }
@@ -0,0 +1,3 @@
1
+ export declare function NewPage({ selectedItemId }: {
2
+ selectedItemId?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;