@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,37 +1,34 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NewPage = NewPage;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const ScrollingContentTree_1 = require("../editor/ScrollingContentTree");
7
- const contentService_1 = require("../editor/services/contentService");
8
- const editService_1 = require("../editor/services/editService");
9
- const inputtext_1 = require("primereact/inputtext");
10
- const button_1 = require("primereact/button");
11
- const utils_1 = require("../editor/utils");
12
- const utils_2 = require("primereact/utils");
13
- const client_components_1 = require("../client-components");
14
- const SectionHeadline_1 = require("./SectionHeadline");
15
- const use_debounce_1 = require("use-debounce");
16
- const service_1 = require("../page-wizard/service");
17
- function NewPage({ selectedItemId }) {
18
- const [selectedItem, setSelectedItem] = (0, react_1.useState)(null);
19
- const [isValid, setIsValid] = (0, react_1.useState)(false);
20
- const [insertOptions, setInsertOptions] = (0, react_1.useState)(null);
21
- const [validationMessage, setValidationMessage] = (0, react_1.useState)(null);
22
- const [selectedTemplate, setSelectedTemplate] = (0, react_1.useState)();
23
- const [name, setName] = (0, react_1.useState)("");
24
- const editContext = (0, client_components_1.useEditContext)();
25
- const [wizards, setWizards] = (0, react_1.useState)([]);
26
- const insertOptionsAndWizards = (0, react_1.useMemo)(() => {
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useState } from "react";
3
+ import { ScrollingContentTree } from "../editor/ScrollingContentTree";
4
+ import { getChildren, } from "../editor/services/contentService";
5
+ import { executeCreateItem, loadInsertOptions, } from "../editor/services/editService";
6
+ import { InputText } from "primereact/inputtext";
7
+ import { Button } from "primereact/button";
8
+ import { getAbsoluteIconUrl, getItemDescriptor } from "../editor/utils";
9
+ import { classNames } from "primereact/utils";
10
+ import { useEditContext } from "../client-components";
11
+ import { SectionHeadline } from "./SectionHeadline";
12
+ import { useDebouncedCallback } from "use-debounce";
13
+ import { getWizards } from "../page-wizard/service";
14
+ export function NewPage({ selectedItemId }) {
15
+ const [selectedItem, setSelectedItem] = useState(null);
16
+ const [isValid, setIsValid] = useState(false);
17
+ const [insertOptions, setInsertOptions] = useState(null);
18
+ const [validationMessage, setValidationMessage] = useState(null);
19
+ const [selectedTemplate, setSelectedTemplate] = useState();
20
+ const [name, setName] = useState("");
21
+ const editContext = useEditContext();
22
+ const [wizards, setWizards] = useState([]);
23
+ const insertOptionsAndWizards = useMemo(() => {
27
24
  return [...(insertOptions || []), ...(wizards || [])];
28
25
  }, [insertOptions, wizards]);
29
- (0, react_1.useEffect)(() => {
26
+ useEffect(() => {
30
27
  const loadOptions = async () => {
31
28
  if (!selectedItem)
32
29
  return;
33
- const item = (0, utils_1.getItemDescriptor)(selectedItem);
34
- const insertOptions = await (0, editService_1.loadInsertOptions)(item);
30
+ const item = getItemDescriptor(selectedItem);
31
+ const insertOptions = await loadInsertOptions(item);
35
32
  const pageInsertOptions = insertOptions?.filter((x) => x.hasLayout);
36
33
  setInsertOptions(pageInsertOptions);
37
34
  setSelectedTemplate(pageInsertOptions?.[0]?.id);
@@ -39,14 +36,14 @@ function NewPage({ selectedItemId }) {
39
36
  const loadWizards = async () => {
40
37
  if (!selectedItem)
41
38
  return;
42
- const item = (0, utils_1.getItemDescriptor)(selectedItem);
43
- const wizards = await (0, service_1.getWizards)(item);
39
+ const item = getItemDescriptor(selectedItem);
40
+ const wizards = await getWizards(item);
44
41
  setWizards(wizards);
45
42
  };
46
43
  loadOptions();
47
44
  loadWizards();
48
45
  }, [selectedItem]);
49
- (0, react_1.useEffect)(() => {
46
+ useEffect(() => {
50
47
  const loadItem = async () => {
51
48
  const itemId = selectedItemId ||
52
49
  editContext?.configuration.editor.dialogs.newPage.expandTreeNode;
@@ -62,12 +59,12 @@ function NewPage({ selectedItemId }) {
62
59
  };
63
60
  loadItem();
64
61
  }, [selectedItemId]);
65
- const isValidDebounced = (0, use_debounce_1.useDebouncedCallback)(async () => {
62
+ const isValidDebounced = useDebouncedCallback(async () => {
66
63
  if (!selectedItem)
67
64
  return;
68
65
  let valid = !!selectedTemplate && name.trim().length >= 3;
69
66
  if (valid) {
70
- const children = await (0, contentService_1.getChildren)(selectedItem.id, editContext?.sessionId ?? "", [], false, editContext?.contentEditorItem?.language || "en");
67
+ const children = await getChildren(selectedItem.id, editContext?.sessionId ?? "", [], false, editContext?.contentEditorItem?.language || "en");
71
68
  if (children.find((x) => x.name.toLocaleLowerCase() === name.trim().toLocaleLowerCase())) {
72
69
  valid = false;
73
70
  setValidationMessage("A page with this name already exists.");
@@ -83,13 +80,13 @@ function NewPage({ selectedItemId }) {
83
80
  setValidationMessage(null);
84
81
  setIsValid(valid);
85
82
  }, 500);
86
- (0, react_1.useEffect)(() => {
83
+ useEffect(() => {
87
84
  isValidDebounced();
88
85
  }, [name]);
89
86
  const handleOk = async () => {
90
87
  if (!selectedItem || !selectedTemplate)
91
88
  return;
92
- const result = await (0, editService_1.executeCreateItem)((0, utils_1.getItemDescriptor)(selectedItem), selectedTemplate, name);
89
+ const result = await executeCreateItem(getItemDescriptor(selectedItem), selectedTemplate, name);
93
90
  if (result.response.ok) {
94
91
  editContext?.switchView("page-editor");
95
92
  if (result.data)
@@ -116,16 +113,16 @@ function NewPage({ selectedItemId }) {
116
113
  event: ev,
117
114
  });
118
115
  };
119
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex h-full gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "tour-pick-location flex w-1/2 flex-col", children: [(0, jsx_runtime_1.jsx)(SectionHeadline_1.SectionHeadline, { children: "1. Pick Location" }), (0, jsx_runtime_1.jsx)("div", { className: "relative flex-1", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 overflow-auto", children: (0, jsx_runtime_1.jsx)(ScrollingContentTree_1.ScrollingContentTree, { selectedItemId: selectedItem?.id || selectedItemId, onSelectionChange: (selection) => {
116
+ return (_jsxs("div", { className: "flex h-full gap-3", children: [_jsxs("div", { className: "tour-pick-location flex w-1/2 flex-col", children: [_jsx(SectionHeadline, { children: "1. Pick Location" }), _jsx("div", { className: "relative flex-1", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(ScrollingContentTree, { selectedItemId: selectedItem?.id || selectedItemId, onSelectionChange: (selection) => {
120
117
  const selected = selection[0];
121
118
  if (selected)
122
119
  setSelectedItem(selected);
123
- } }) }) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "w-1/2 border-l pl-7", children: [(0, jsx_runtime_1.jsx)(SectionHeadline_1.SectionHeadline, { className: "tour-choose-template", children: "2. Choose a Template or Wizard" }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-1 flex min-h-12 flex-wrap gap-3", children: [!insertOptions?.length && ((0, jsx_runtime_1.jsx)("div", { children: "No page templates available here." })), insertOptionsAndWizards?.map((option) => ((0, jsx_runtime_1.jsxs)("div", { onClick: () => setSelectedTemplate(option.id), className: (0, utils_2.classNames)("mb-2 flex cursor-pointer flex-col items-center bg-gray-100 p-2 text-sm", selectedTemplate === option.id
120
+ } }) }) })] }), _jsxs("div", { className: "w-1/2 border-l pl-7", children: [_jsx(SectionHeadline, { className: "tour-choose-template", children: "2. Choose a Template or Wizard" }), _jsxs("div", { className: "mt-1 flex min-h-12 flex-wrap gap-3", children: [!insertOptions?.length && (_jsx("div", { children: "No page templates available here." })), insertOptionsAndWizards?.map((option) => (_jsxs("div", { onClick: () => setSelectedTemplate(option.id), className: classNames("mb-2 flex cursor-pointer flex-col items-center bg-gray-100 p-2 text-sm", selectedTemplate === option.id
124
121
  ? "tour-selected-template bg-gray-200 outline outline-2 outline-offset-2 outline-gray-200"
125
- : "bg-gray-100"), children: [(0, jsx_runtime_1.jsx)("img", { src: (0, utils_1.getAbsoluteIconUrl)(option.icon), width: "32", height: "32" }), option.name] }, option.id)))] }), selectedTemplate &&
126
- wizards?.find((x) => x.id === selectedTemplate) && ((0, jsx_runtime_1.jsx)("div", { className: "mt-4", children: (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: launchWizard, label: "Start Wizard", id: "launch-wizard-button" }) })), selectedTemplate &&
127
- insertOptions?.find((x) => x.id === selectedTemplate) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SectionHeadline_1.SectionHeadline, { children: "3. Name Your Page" }), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { className: "w-full", value: name, id: "new-page-name", onChange: (e) => setName(e.target.value), onKeyDown: (ev) => {
122
+ : "bg-gray-100"), children: [_jsx("img", { src: getAbsoluteIconUrl(option.icon), width: "32", height: "32" }), option.name] }, option.id)))] }), selectedTemplate &&
123
+ wizards?.find((x) => x.id === selectedTemplate) && (_jsx("div", { className: "mt-4", children: _jsx(Button, { onClick: launchWizard, label: "Start Wizard", id: "launch-wizard-button" }) })), selectedTemplate &&
124
+ insertOptions?.find((x) => x.id === selectedTemplate) && (_jsxs(_Fragment, { children: [_jsx(SectionHeadline, { children: "3. Name Your Page" }), _jsx(InputText, { className: "w-full", value: name, id: "new-page-name", onChange: (e) => setName(e.target.value), onKeyDown: (ev) => {
128
125
  if (ev.key === "Enter" && isValid)
129
126
  handleOk();
130
- }, "data-testid": "new-page-name" }), validationMessage && ((0, jsx_runtime_1.jsx)("div", { className: "mt-2 text-red-500", children: validationMessage })), (0, jsx_runtime_1.jsx)("div", { className: "mt-4", children: (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: handleOk, label: "Create", disabled: !isValid, id: "create-new-page-button" }) })] }))] })] }));
127
+ }, "data-testid": "new-page-name" }), validationMessage && (_jsx("div", { className: "mt-2 text-red-500", children: validationMessage })), _jsx("div", { className: "mt-4", children: _jsx(Button, { onClick: handleOk, label: "Create", disabled: !isValid, id: "create-new-page-button" }) })] }))] })] }));
131
128
  }
@@ -0,0 +1,4 @@
1
+ export declare function SectionHeadline({ children, className, }: {
2
+ children: React.ReactNode;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SectionHeadline = SectionHeadline;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const utils_1 = require("primereact/utils");
6
- const Icons_1 = require("../editor/ui/Icons");
7
- function SectionHeadline({ children, className, }) {
8
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.classNames)("mt-2 mb-2 font-bold flex gap-2 items-center w-fit", className), children: [(0, jsx_runtime_1.jsx)(Icons_1.ArrowRightIcon, {}), " ", children] }));
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classNames } from "primereact/utils";
3
+ import { ArrowRightIcon } from "../editor/ui/Icons";
4
+ export function SectionHeadline({ children, className, }) {
5
+ return (_jsxs("div", { className: classNames("mt-2 mb-2 font-bold flex gap-2 items-center w-fit", className), children: [_jsx(ArrowRightIcon, {}), " ", children] }));
9
6
  }
@@ -0,0 +1 @@
1
+ export declare function SplashScreen(): import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,43 +1,40 @@
1
1
  "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.SplashScreen = SplashScreen;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const editContext_1 = require("../editor/client/editContext");
8
- const SimpleTabs_1 = require("../editor/ui/SimpleTabs");
9
- const ScrollingContentTree_1 = require("../editor/ScrollingContentTree");
10
- const NewPage_1 = require("./NewPage");
11
- const navigation_1 = require("next/navigation");
12
- const SimpleIconButton_1 = require("../editor/ui/SimpleIconButton");
13
- function SplashScreen() {
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { useEditContext } from "../editor/client/editContext";
5
+ import { SimpleTabs } from "../editor/ui/SimpleTabs";
6
+ import { ScrollingContentTree } from "../editor/ScrollingContentTree";
7
+ import { NewPage } from "./NewPage";
8
+ import { usePathname, useRouter } from "next/navigation";
9
+ import { SimpleIconButton } from "../editor/ui/SimpleIconButton";
10
+ export function SplashScreen() {
14
11
  const savedHistory = typeof window !== "undefined"
15
12
  ? localStorage.getItem("editor.browseHistory")
16
13
  : null;
17
- const [selectedPage, setSelectedPage] = (0, react_1.useState)(null);
18
- const [activeTab, setActiveTab] = (0, react_1.useState)(0);
19
- const editContext = (0, editContext_1.useEditContext)();
14
+ const [selectedPage, setSelectedPage] = useState(null);
15
+ const [activeTab, setActiveTab] = useState(0);
16
+ const editContext = useEditContext();
20
17
  const recentPages = savedHistory
21
18
  ? JSON.parse(savedHistory)
22
19
  : [];
23
20
  const searchParams = new URLSearchParams(window.location.search);
24
- const [history, setHistory] = (0, react_1.useState)();
25
- const router = (0, navigation_1.useRouter)();
26
- const pathname = (0, navigation_1.usePathname)();
27
- (0, react_1.useEffect)(() => {
21
+ const [history, setHistory] = useState();
22
+ const router = useRouter();
23
+ const pathname = usePathname();
24
+ useEffect(() => {
28
25
  const fetchItems = async () => {
29
26
  const pages = await editContext?.itemsRepository.getItems(recentPages);
30
27
  setHistory(pages);
31
28
  };
32
29
  fetchItems();
33
30
  }, [editContext?.itemsRepository]);
34
- (0, react_1.useEffect)(() => {
31
+ useEffect(() => {
35
32
  if (recentPages.length > 0 && recentPages[0])
36
33
  setSelectedPage(recentPages[0]);
37
34
  if (searchParams.get("create") === "1")
38
35
  setActiveTab(1);
39
36
  }, []);
40
- (0, react_1.useEffect)(() => {
37
+ useEffect(() => {
41
38
  if (activeTab === 0) {
42
39
  router.replace(pathname);
43
40
  }
@@ -49,7 +46,7 @@ function SplashScreen() {
49
46
  return;
50
47
  const tabs = [
51
48
  {
52
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 gap-4 p-2 text-sm", children: [(0, jsx_runtime_1.jsx)("div", { className: "relative w-2/3", children: (0, jsx_runtime_1.jsx)(ScrollingContentTree_1.ScrollingContentTree, { selectedItemId: selectedPage?.id, onSelectionChange: (selection) => {
49
+ content: (_jsxs("div", { className: "flex flex-1 gap-4 p-2 text-sm", children: [_jsx("div", { className: "relative w-2/3", children: _jsx(ScrollingContentTree, { selectedItemId: selectedPage?.id, onSelectionChange: (selection) => {
53
50
  const selectedItem = selection[0];
54
51
  if (selectedItem)
55
52
  editContext?.loadItem({
@@ -57,25 +54,25 @@ function SplashScreen() {
57
54
  language: selectedItem.language ?? "en",
58
55
  version: selectedItem.version,
59
56
  });
60
- } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex w-1/3 flex-col border-l pl-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "mb-3 font-bold", children: "Recent Pages" }), (0, jsx_runtime_1.jsx)("div", { className: "relative flex-1", children: (0, jsx_runtime_1.jsx)("ul", { className: "absolute inset-0 overflow-auto", children: history?.map((page, index) => ((0, jsx_runtime_1.jsxs)("li", { onMouseOver: () => setSelectedPage(page), onClick: () => {
57
+ } }) }), _jsxs("div", { className: "flex w-1/3 flex-col border-l pl-6", children: [_jsx("div", { className: "mb-3 font-bold", children: "Recent Pages" }), _jsx("div", { className: "relative flex-1", children: _jsx("ul", { className: "absolute inset-0 overflow-auto", children: history?.map((page, index) => (_jsxs("li", { onMouseOver: () => setSelectedPage(page), onClick: () => {
61
58
  editContext?.switchView("page-editor");
62
59
  editContext?.loadItem({
63
60
  id: page.id,
64
61
  language: page.language ?? "en",
65
62
  version: 0,
66
63
  });
67
- }, className: "flex cursor-pointer items-center gap-2 p-2 text-xs hover:bg-gray-100", children: [page.icon && ((0, jsx_runtime_1.jsx)("img", { src: page.icon, width: "16", height: "16" })), " ", page.name, " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-gray-500", children: ["(", page.language, ")"] })] }, index))) }) })] })] })),
64
+ }, className: "flex cursor-pointer items-center gap-2 p-2 text-xs hover:bg-gray-100", children: [page.icon && (_jsx("img", { src: page.icon, width: "16", height: "16" })), " ", page.name, " ", _jsxs("span", { className: "text-gray-500", children: ["(", page.language, ")"] })] }, index))) }) })] })] })),
68
65
  label: "Open Page",
69
66
  id: "open-page-tab",
70
67
  },
71
68
  {
72
- content: ((0, jsx_runtime_1.jsx)("div", { className: "relative flex flex-1 flex-col", children: (0, jsx_runtime_1.jsx)(NewPage_1.NewPage, { selectedItemId: selectedPage?.id }) })),
69
+ content: (_jsx("div", { className: "relative flex flex-1 flex-col", children: _jsx(NewPage, { selectedItemId: selectedPage?.id }) })),
73
70
  label: "New Page",
74
71
  id: "new-page-tab",
75
72
  testId: "new-page-tab",
76
73
  },
77
74
  ];
78
- return ((0, jsx_runtime_1.jsx)("div", { className: "flex h-full items-center justify-center bg-gray-100", children: (0, jsx_runtime_1.jsxs)("div", { className: "relative h-3/4 w-2/3 space-y-8 rounded-lg bg-white p-6 p-8 shadow-lg", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex flex-1 flex-col", children: (0, jsx_runtime_1.jsx)(SimpleTabs_1.SimpleTabs, { tabs: tabs, activeTab: activeTab, setActiveTab: setActiveTab }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex justify-end", children: (0, jsx_runtime_1.jsxs)("a", { className: "flex cursor-pointer items-center text-xs text-blue-600", onClick: () => editContext?.startTour(), children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-arrow-right mr-2" }), " Take Tour"] }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 right-0 p-2", children: (0, jsx_runtime_1.jsx)(SimpleIconButton_1.SimpleIconButton, { icon: "pi pi-times", onClick: () => editContext?.switchView(editContext.contentEditorItem?.hasLayout
75
+ return (_jsx("div", { className: "flex h-full items-center justify-center bg-gray-100", children: _jsxs("div", { className: "relative h-3/4 w-2/3 space-y-8 rounded-lg bg-white p-6 p-8 shadow-lg", children: [_jsxs("div", { className: "flex h-full flex-col", children: [_jsx("div", { className: "flex flex-1 flex-col", children: _jsx(SimpleTabs, { tabs: tabs, activeTab: activeTab, setActiveTab: setActiveTab }) }), _jsx("div", { className: "flex justify-end", children: _jsxs("a", { className: "flex cursor-pointer items-center text-xs text-blue-600", onClick: () => editContext?.startTour(), children: [_jsx("i", { className: "pi pi-arrow-right mr-2" }), " Take Tour"] }) })] }), _jsx("div", { className: "absolute top-0 right-0 p-2", children: _jsx(SimpleIconButton, { icon: "pi pi-times", onClick: () => editContext?.switchView(editContext.contentEditorItem?.hasLayout
79
76
  ? "page-editor"
80
77
  : "content-editor"), label: "Close" }) })] }) }));
81
78
  }
@@ -0,0 +1,3 @@
1
+ export declare function Tour({ tourStopCallback }: {
2
+ tourStopCallback: () => void;
3
+ }): import("react/jsx-runtime").JSX.Element | null;
package/dist/tour/Tour.js CHANGED
@@ -1,16 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Tour = Tour;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const client_components_1 = require("../client-components");
7
- const utils_1 = require("primereact/utils");
8
- function Tour({ tourStopCallback }) {
9
- const [currentStep, setCurrentStep] = (0, react_1.useState)("start-tour");
10
- const [show, setShow] = (0, react_1.useState)(true);
11
- const editContext = (0, client_components_1.useEditContext)();
12
- const [focusRect, setFocusRect] = (0, react_1.useState)(null);
13
- const [pointToRect, setPointToRect] = (0, react_1.useState)(null);
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { useEditContext } from "../client-components";
4
+ import { classNames } from "primereact/utils";
5
+ export function Tour({ tourStopCallback }) {
6
+ const [currentStep, setCurrentStep] = useState("start-tour");
7
+ const [show, setShow] = useState(true);
8
+ const editContext = useEditContext();
9
+ const [focusRect, setFocusRect] = useState(null);
10
+ const [pointToRect, setPointToRect] = useState(null);
14
11
  const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
15
12
  const waitForElement = (selector, timeout = 0) => {
16
13
  if (selector.startsWith("iframe:")) {
@@ -153,7 +150,7 @@ function Tour({ tourStopCallback }) {
153
150
  const step = tourSteps[currentStep];
154
151
  if (!step)
155
152
  return null;
156
- (0, react_1.useEffect)(() => {
153
+ useEffect(() => {
157
154
  const runStep = async () => {
158
155
  setShow(false);
159
156
  setFocusRect(null);
@@ -192,7 +189,7 @@ function Tour({ tourStopCallback }) {
192
189
  };
193
190
  runStep();
194
191
  }, [currentStep]);
195
- (0, react_1.useEffect)(() => {
192
+ useEffect(() => {
196
193
  const getPointTo = async () => {
197
194
  let pointToRect = focusRect;
198
195
  if (step.getPointTo) {
@@ -296,9 +293,9 @@ function Tour({ tourStopCallback }) {
296
293
  // : 'none',
297
294
  };
298
295
  if (!show) {
299
- return (0, jsx_runtime_1.jsx)("div", { className: "overlay", style: overlayStyle });
296
+ return _jsx("div", { className: "overlay", style: overlayStyle });
300
297
  }
301
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "overlay", style: overlayStyle }), (0, jsx_runtime_1.jsxs)("div", { style: boxStyle, className: "text-gray-800 flex flex-col items-center fade-in", children: [focusRect && ((0, jsx_runtime_1.jsx)("svg", { width: "100px", height: "100px", viewBox: "0 -7.89 113.08 113.08", xmlns: "http://www.w3.org/2000/svg", className: (0, utils_1.classNames)("pointer-events-none", arrowRotation), style: arrowStyle, children: (0, jsx_runtime_1.jsx)("path", { style: { stroke: "#0000ff", fill: "#0000ff" }, d: "M20.1871 175C15.7485 172.891 13.0008 172.469 12.1553 170.992C8.98489 165.508 5.39173 160.024 3.70083 153.908C-1.37187 137.666 -0.737781 121.214 2.64402 104.762C8.35081 76.7092 21.0325 51.8201 36.8847 28.1966C38.5756 25.6655 40.0552 23.1344 41.7461 20.3924C41.7461 20.1814 41.5347 19.7596 41.112 19.1268C36.462 20.3923 31.6007 21.6579 26.9507 22.7125C24.4144 23.1344 21.4552 23.1344 18.9189 22.2907C17.4394 21.8688 15.3258 19.5486 15.3258 18.0722C15.3258 16.1739 16.8053 13.8537 18.0735 12.1663C19.1303 11.1117 21.0326 10.9008 22.7235 10.4789C35.4052 7.31508 48.087 3.72935 60.9801 0.776411C71.9709 -1.75468 75.564 1.83105 74.9299 12.5882C74.2959 23.7672 74.0845 34.9462 73.6618 45.9142C73.4505 49.289 72.8164 52.8747 72.3936 56.6714C63.5164 52.6638 63.5164 52.6638 60.346 18.494C47.0301 33.2588 38.1529 49.289 29.9098 65.7411C21.6666 82.1932 16.1712 99.489 13.2121 117.839C10.2531 136.823 13.8462 154.751 20.1871 175Z", fill: "#0D1927" }) })), (0, jsx_runtime_1.jsx)("style", { children: `
298
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "overlay", style: overlayStyle }), _jsxs("div", { style: boxStyle, className: "text-gray-800 flex flex-col items-center fade-in", children: [focusRect && (_jsx("svg", { width: "100px", height: "100px", viewBox: "0 -7.89 113.08 113.08", xmlns: "http://www.w3.org/2000/svg", className: classNames("pointer-events-none", arrowRotation), style: arrowStyle, children: _jsx("path", { style: { stroke: "#0000ff", fill: "#0000ff" }, d: "M20.1871 175C15.7485 172.891 13.0008 172.469 12.1553 170.992C8.98489 165.508 5.39173 160.024 3.70083 153.908C-1.37187 137.666 -0.737781 121.214 2.64402 104.762C8.35081 76.7092 21.0325 51.8201 36.8847 28.1966C38.5756 25.6655 40.0552 23.1344 41.7461 20.3924C41.7461 20.1814 41.5347 19.7596 41.112 19.1268C36.462 20.3923 31.6007 21.6579 26.9507 22.7125C24.4144 23.1344 21.4552 23.1344 18.9189 22.2907C17.4394 21.8688 15.3258 19.5486 15.3258 18.0722C15.3258 16.1739 16.8053 13.8537 18.0735 12.1663C19.1303 11.1117 21.0326 10.9008 22.7235 10.4789C35.4052 7.31508 48.087 3.72935 60.9801 0.776411C71.9709 -1.75468 75.564 1.83105 74.9299 12.5882C74.2959 23.7672 74.0845 34.9462 73.6618 45.9142C73.4505 49.289 72.8164 52.8747 72.3936 56.6714C63.5164 52.6638 63.5164 52.6638 60.346 18.494C47.0301 33.2588 38.1529 49.289 29.9098 65.7411C21.6666 82.1932 16.1712 99.489 13.2121 117.839C10.2531 136.823 13.8462 154.751 20.1871 175Z", fill: "#0D1927" }) })), _jsx("style", { children: `
302
299
  @import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&display=swap');
303
300
  .handwritten {
304
301
  font-family: 'Caveat', cursive;
@@ -313,9 +310,9 @@ function Tour({ tourStopCallback }) {
313
310
  from { opacity: 0; }
314
311
  to { opacity: 1; }
315
312
  }
316
- ` }), (0, jsx_runtime_1.jsxs)("div", { className: `relative flex items-stretch justify-center bg-gray-50 rounded-lg border border-gray-800 gap-6 shadow-2xl`, style: bubbleStyle, children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs font-bold cursor-pointer flex items-center gap-2 absolute top-0 right-0 mr-2 mt-2", onClick: stopTour, children: (0, jsx_runtime_1.jsx)("i", { className: "pi pi-times" }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-col items-center justify-center gap-2 bg-gray-200 p-6 rounded-l-lg", children: (0, jsx_runtime_1.jsx)(AlpacaIcon, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-end justify-center gap-3 p-4 ", children: [(0, jsx_runtime_1.jsxs)("div", { className: "opacity-100 text-2xl font-bold handwritten text-center flex flex-col items-center max-w-[450px]", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-4xl mb-4", children: step.title }), (0, jsx_runtime_1.jsx)("div", { children: step.description })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-2", children: step.buttons &&
317
- step.buttons.map((button, index) => ((0, jsx_runtime_1.jsx)("button", { onClick: button.onClick, className: button.className, children: button.label }, index))) })] })] })] })] }));
313
+ ` }), _jsxs("div", { className: `relative flex items-stretch justify-center bg-gray-50 rounded-lg border border-gray-800 gap-6 shadow-2xl`, style: bubbleStyle, children: [_jsx("div", { className: "text-xs font-bold cursor-pointer flex items-center gap-2 absolute top-0 right-0 mr-2 mt-2", onClick: stopTour, children: _jsx("i", { className: "pi pi-times" }) }), _jsx("div", { className: "flex flex-col items-center justify-center gap-2 bg-gray-200 p-6 rounded-l-lg", children: _jsx(AlpacaIcon, {}) }), _jsxs("div", { className: "flex flex-col items-end justify-center gap-3 p-4 ", children: [_jsxs("div", { className: "opacity-100 text-2xl font-bold handwritten text-center flex flex-col items-center max-w-[450px]", children: [_jsx("div", { className: "text-4xl mb-4", children: step.title }), _jsx("div", { children: step.description })] }), _jsx("div", { className: "flex gap-2", children: step.buttons &&
314
+ step.buttons.map((button, index) => (_jsx("button", { onClick: button.onClick, className: button.className, children: button.label }, index))) })] })] })] })] }));
318
315
  }
319
316
  function AlpacaIcon() {
320
- return ((0, jsx_runtime_1.jsxs)("svg", { height: "80px", width: "80px", version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: [(0, jsx_runtime_1.jsx)("path", { style: { fill: "#EBE4DD" }, d: "M102.989,153.011v153.011C119.613,428.825,184.332,506.115,256,506.115\r\n\ts136.387-77.29,153.012-200.092V153.011H102.989z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#D8CCBC" }, d: "M255.999,153.011v353.103H256c71.668,0,136.387-77.29,153.012-200.092V153.011H255.999z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#A58868" }, d: "M273.655,435.494h-35.31c0,41.195-17.007,41.195-29.425,41.195V512\r\n\tc16.246,0,34.206-4.021,47.08-18.162C268.873,507.979,286.834,512,303.08,512v-35.31C290.662,476.69,273.655,476.69,273.655,435.494\r\n\tz" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#947859" }, d: "M273.655,435.494H256v58.343C268.873,507.979,286.834,512,303.08,512v-35.31\r\n\tC290.662,476.69,273.655,476.69,273.655,435.494z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#EBE4DD" }, d: "M126.529,0C81.025,0,44.138,36.888,44.138,82.391s36.888,82.391,82.391,82.391V0z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#D8CCBC" }, d: "M385.471,164.782c45.503,0,82.391-36.888,82.391-82.391S430.975,0,385.471,0V164.782z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#BFA993" }, d: "M490.407,247.172c0.643-3.83,0.996-7.758,0.996-11.77c0-39.003-31.618-70.621-70.621-70.621\r\n\ts-70.621,31.618-70.621,70.621c0,4.012,0.352,7.94,0.995,11.77H490.407z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#EDEDED" }, d: "M420.782,306.023c39.003,0,70.621-31.618,70.621-70.621H350.161\r\n\tC350.161,274.405,381.779,306.023,420.782,306.023z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#454449" }, d: "M397.241,235.401c0,12.981,10.559,23.54,23.538,23.54h0.002c12.981,0.001,23.54-10.559,23.54-23.54\r\n\tH397.241z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#BFA993" }, d: "M160.844,247.172c0.643-3.83,0.995-7.758,0.995-11.77c0-39.003-31.618-70.621-70.621-70.621\r\n\tS20.598,196.4,20.598,235.402c0,4.012,0.352,7.94,0.995,11.77H160.844z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#EDEDED" }, d: "M91.218,306.023c39.003,0,70.621-31.618,70.621-70.621H20.598\r\n\tC20.598,274.405,52.216,306.023,91.218,306.023z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#454449" }, d: "M67.678,235.401c0,12.981,10.559,23.54,23.538,23.54h0.002c12.981,0.001,23.54-10.559,23.54-23.54\r\n\tH67.678z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#D8CCBC" }, d: "M391.356,107.187c0-15.527,4.902-33.778-5.082-46.69c-8.818-11.403-28.519-12.694-43.229-20.793\r\n\tc-12.822-7.059-23.38-23.527-39.415-27.235c-14.505-3.356-31.411,6.442-47.63,6.442c-16.218,0-33.125-9.796-47.631-6.442\r\n\tc-16.036,3.708-26.595,20.178-39.415,27.237c-14.71,8.099-34.41,9.391-43.227,20.792c-9.985,12.912-5.082,31.161-5.082,46.689\r\n\ts-4.902,33.778,5.082,46.69c8.818,11.403,28.519,12.693,43.229,20.793c12.821,7.059,23.379,23.527,39.413,27.235\r\n\tc14.505,3.356,31.412-6.442,47.63-6.442s33.125,9.796,47.632,6.442c16.034-3.708,26.592-20.176,39.413-27.237\r\n\tc14.709-8.099,34.411-9.391,43.228-20.792C396.259,140.965,391.356,122.715,391.356,107.187z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#BFA993" }, d: "M386.274,60.497c-8.818-11.403-28.519-12.694-43.229-20.793\r\n\tc-12.822-7.059-23.38-23.527-39.415-27.235c-14.505-3.356-31.411,6.442-47.63,6.442v176.552c16.218,0,33.125,9.796,47.632,6.442\r\n\tc16.034-3.708,26.592-20.176,39.413-27.237c14.709-8.099,34.411-9.391,43.228-20.792c9.985-12.912,5.082-31.161,5.082-46.689\r\n\tS396.259,73.409,386.274,60.497z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#58575D" }, d: "M293.664,406.069c-6.186,18.772-22.763,39.469-37.664,39.784\r\n\tc-14.901-0.315-31.478-21.012-37.664-39.784c-2.858-9.591,4.529-17.529,16.478-17.655c14.124,0,28.248,0,42.372,0\r\n\tC289.136,388.54,296.522,396.476,293.664,406.069z" }), (0, jsx_runtime_1.jsx)("path", { style: { fill: "#454449" }, d: "M277.186,388.414c-7.062,0-14.124,0-21.186,0v57.439c14.901-0.315,31.478-21.012,37.664-39.784\r\n\tC296.522,396.476,289.136,388.54,277.186,388.414z" })] }));
317
+ return (_jsxs("svg", { height: "80px", width: "80px", version: "1.1", id: "Layer_1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", children: [_jsx("path", { style: { fill: "#EBE4DD" }, d: "M102.989,153.011v153.011C119.613,428.825,184.332,506.115,256,506.115\r\n\ts136.387-77.29,153.012-200.092V153.011H102.989z" }), _jsx("path", { style: { fill: "#D8CCBC" }, d: "M255.999,153.011v353.103H256c71.668,0,136.387-77.29,153.012-200.092V153.011H255.999z" }), _jsx("path", { style: { fill: "#A58868" }, d: "M273.655,435.494h-35.31c0,41.195-17.007,41.195-29.425,41.195V512\r\n\tc16.246,0,34.206-4.021,47.08-18.162C268.873,507.979,286.834,512,303.08,512v-35.31C290.662,476.69,273.655,476.69,273.655,435.494\r\n\tz" }), _jsx("path", { style: { fill: "#947859" }, d: "M273.655,435.494H256v58.343C268.873,507.979,286.834,512,303.08,512v-35.31\r\n\tC290.662,476.69,273.655,476.69,273.655,435.494z" }), _jsx("path", { style: { fill: "#EBE4DD" }, d: "M126.529,0C81.025,0,44.138,36.888,44.138,82.391s36.888,82.391,82.391,82.391V0z" }), _jsx("path", { style: { fill: "#D8CCBC" }, d: "M385.471,164.782c45.503,0,82.391-36.888,82.391-82.391S430.975,0,385.471,0V164.782z" }), _jsx("path", { style: { fill: "#BFA993" }, d: "M490.407,247.172c0.643-3.83,0.996-7.758,0.996-11.77c0-39.003-31.618-70.621-70.621-70.621\r\n\ts-70.621,31.618-70.621,70.621c0,4.012,0.352,7.94,0.995,11.77H490.407z" }), _jsx("path", { style: { fill: "#EDEDED" }, d: "M420.782,306.023c39.003,0,70.621-31.618,70.621-70.621H350.161\r\n\tC350.161,274.405,381.779,306.023,420.782,306.023z" }), _jsx("path", { style: { fill: "#454449" }, d: "M397.241,235.401c0,12.981,10.559,23.54,23.538,23.54h0.002c12.981,0.001,23.54-10.559,23.54-23.54\r\n\tH397.241z" }), _jsx("path", { style: { fill: "#BFA993" }, d: "M160.844,247.172c0.643-3.83,0.995-7.758,0.995-11.77c0-39.003-31.618-70.621-70.621-70.621\r\n\tS20.598,196.4,20.598,235.402c0,4.012,0.352,7.94,0.995,11.77H160.844z" }), _jsx("path", { style: { fill: "#EDEDED" }, d: "M91.218,306.023c39.003,0,70.621-31.618,70.621-70.621H20.598\r\n\tC20.598,274.405,52.216,306.023,91.218,306.023z" }), _jsx("path", { style: { fill: "#454449" }, d: "M67.678,235.401c0,12.981,10.559,23.54,23.538,23.54h0.002c12.981,0.001,23.54-10.559,23.54-23.54\r\n\tH67.678z" }), _jsx("path", { style: { fill: "#D8CCBC" }, d: "M391.356,107.187c0-15.527,4.902-33.778-5.082-46.69c-8.818-11.403-28.519-12.694-43.229-20.793\r\n\tc-12.822-7.059-23.38-23.527-39.415-27.235c-14.505-3.356-31.411,6.442-47.63,6.442c-16.218,0-33.125-9.796-47.631-6.442\r\n\tc-16.036,3.708-26.595,20.178-39.415,27.237c-14.71,8.099-34.41,9.391-43.227,20.792c-9.985,12.912-5.082,31.161-5.082,46.689\r\n\ts-4.902,33.778,5.082,46.69c8.818,11.403,28.519,12.693,43.229,20.793c12.821,7.059,23.379,23.527,39.413,27.235\r\n\tc14.505,3.356,31.412-6.442,47.63-6.442s33.125,9.796,47.632,6.442c16.034-3.708,26.592-20.176,39.413-27.237\r\n\tc14.709-8.099,34.411-9.391,43.228-20.792C396.259,140.965,391.356,122.715,391.356,107.187z" }), _jsx("path", { style: { fill: "#BFA993" }, d: "M386.274,60.497c-8.818-11.403-28.519-12.694-43.229-20.793\r\n\tc-12.822-7.059-23.38-23.527-39.415-27.235c-14.505-3.356-31.411,6.442-47.63,6.442v176.552c16.218,0,33.125,9.796,47.632,6.442\r\n\tc16.034-3.708,26.592-20.176,39.413-27.237c14.709-8.099,34.411-9.391,43.228-20.792c9.985-12.912,5.082-31.161,5.082-46.689\r\n\tS396.259,73.409,386.274,60.497z" }), _jsx("path", { style: { fill: "#58575D" }, d: "M293.664,406.069c-6.186,18.772-22.763,39.469-37.664,39.784\r\n\tc-14.901-0.315-31.478-21.012-37.664-39.784c-2.858-9.591,4.529-17.529,16.478-17.655c14.124,0,28.248,0,42.372,0\r\n\tC289.136,388.54,296.522,396.476,293.664,406.069z" }), _jsx("path", { style: { fill: "#454449" }, d: "M277.186,388.414c-7.062,0-14.124,0-21.186,0v57.439c14.901-0.315,31.478-21.012,37.664-39.784\r\n\tC296.522,396.476,289.136,388.54,277.186,388.414z" })] }));
321
318
  }
@@ -0,0 +1,9 @@
1
+ import { GetEditorTourStepsParams, TourStep } from "../config/types";
2
+ export declare function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement, waitForElementToDisappear, setFocusRect, delay, waitForInput, simulateTyping, }: GetEditorTourStepsParams, config: {
3
+ firstComponentTemplateId: string;
4
+ firstComponentTemplateName: string;
5
+ firstComponentTextFieldName: string;
6
+ firstComponentTextFieldId: string;
7
+ firstComponentRichTextFieldName: string;
8
+ firstComponentRichTextFieldId: string;
9
+ }): Record<string, TourStep>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDefaultTourSteps = getDefaultTourSteps;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement, waitForElementToDisappear, setFocusRect, delay, waitForInput, simulateTyping, }, config) {
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ export function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement, waitForElementToDisappear, setFocusRect, delay, waitForInput, simulateTyping, }, config) {
6
3
  const tourSteps = {
7
4
  "start-tour": {
8
5
  title: "Welcome to the AI Editor Tour!",
@@ -12,14 +9,14 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
12
9
  },
13
10
  buttons: [
14
11
  {
15
- label: ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-play" }), " Start Tour"] })),
12
+ label: (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("i", { className: "pi pi-play" }), " Start Tour"] })),
16
13
  onClick: () => {
17
14
  nextStep("new-page");
18
15
  },
19
16
  className: "button button-primary mt-2",
20
17
  },
21
18
  {
22
- label: ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-times" }), " No thanks"] })),
19
+ label: (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("i", { className: "pi pi-times" }), " No thanks"] })),
23
20
  onClick: () => {
24
21
  stopTour();
25
22
  },
@@ -28,7 +25,7 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
28
25
  ],
29
26
  },
30
27
  "new-page": {
31
- description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Click on the ", (0, jsx_runtime_1.jsx)("b", { children: "New Page" }), " tab to create a new page"] })),
28
+ description: (_jsxs(_Fragment, { children: ["Click on the ", _jsx("b", { children: "New Page" }), " tab to create a new page"] })),
32
29
  focusElement: "#new-page-tab",
33
30
  waitForUserInput: async () => {
34
31
  await waitForElement("#new-page-tab.active-tab");
@@ -36,7 +33,7 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
36
33
  nextStep: "pick-location",
37
34
  },
38
35
  "pick-location": {
39
- description: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["Select the ", (0, jsx_runtime_1.jsx)("b", { children: "Playground" }), " folder as the parent for your new page"] })),
36
+ description: (_jsxs(_Fragment, { children: ["Select the ", _jsx("b", { children: "Playground" }), " folder as the parent for your new page"] })),
40
37
  focusElement: ".tour-pick-location",
41
38
  waitForUserInput: async () => {
42
39
  await new Promise((resolve) => {
@@ -95,7 +92,7 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
95
92
  description: "Wanna add a component to your beautiful empty page?",
96
93
  buttons: [
97
94
  {
98
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-arrow-right" }), " I'm ready, lets go!"] })),
95
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-arrow-right" }), " I'm ready, lets go!"] })),
99
96
  onClick: () => nextStep("insert-component"),
100
97
  },
101
98
  ],
@@ -167,7 +164,7 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
167
164
  description: "But hey, this is an AI editor, so why not let the AI do some of the work for you?",
168
165
  buttons: [
169
166
  {
170
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-arrow-right" }), " Great, show me!"] })),
167
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-arrow-right" }), " Great, show me!"] })),
171
168
  onClick: () => nextStep("ai-sidebar"),
172
169
  },
173
170
  ],
@@ -211,7 +208,7 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
211
208
  description: "You have completed the tour and are now an AI Editor Pro!",
212
209
  buttons: [
213
210
  {
214
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-check" }), " Finish Tour"] })),
211
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-check" }), " Finish Tour"] })),
215
212
  onClick: () => stopTour(),
216
213
  className: "button button-primary mt-2",
217
214
  },
@@ -221,7 +218,7 @@ function getDefaultTourSteps({ editContext, nextStep, stopTour, waitForElement,
221
218
  description: "Oops, something went wrong.",
222
219
  buttons: [
223
220
  {
224
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-check" }), " Close"] })),
221
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-check" }), " Close"] })),
225
222
  onClick: () => stopTour(),
226
223
  },
227
224
  ],
@@ -0,0 +1,2 @@
1
+ import { GetEditorTourStepsParams, TourStep } from "../config/types";
2
+ export declare function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement, delay, }: GetEditorTourStepsParams): Record<string, TourStep>;
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPreviewTourSteps = getPreviewTourSteps;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement, delay, }) {
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ export function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement, delay, }) {
6
3
  const tourSteps = {
7
4
  "start-tour": {
8
5
  title: "Welcome to the Preview Tour!",
@@ -12,14 +9,14 @@ function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement,
12
9
  },
13
10
  buttons: [
14
11
  {
15
- label: ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-play" }), " Start Tour"] })),
12
+ label: (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("i", { className: "pi pi-play" }), " Start Tour"] })),
16
13
  onClick: () => {
17
14
  nextStep("comment");
18
15
  },
19
16
  className: "button button-primary mt-2",
20
17
  },
21
18
  {
22
- label: ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-times" }), " No thanks"] })),
19
+ label: (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("i", { className: "pi pi-times" }), " No thanks"] })),
23
20
  onClick: () => {
24
21
  stopTour();
25
22
  },
@@ -28,18 +25,18 @@ function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement,
28
25
  ],
29
26
  },
30
27
  comment: {
31
- description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Click here to add a comment to the page" }),
28
+ description: _jsx(_Fragment, { children: "Click here to add a comment to the page" }),
32
29
  focusElement: "#add-comment",
33
30
  nextStep: "commentContextMenu",
34
31
  buttons: [
35
32
  {
36
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-arrow-right" }), " Next"] })),
33
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-arrow-right" }), " Next"] })),
37
34
  onClick: () => nextStep("commentContextMenu"),
38
35
  },
39
36
  ],
40
37
  },
41
38
  commentContextMenu: {
42
- description: ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "You can also select text and add a comment from the context menu " })),
39
+ description: (_jsx(_Fragment, { children: "You can also select text and add a comment from the context menu " })),
43
40
  focusElement: "[data-testid='pageEditoriframe']",
44
41
  waitForUserInput: async () => {
45
42
  await waitForElement(".p-contextmenu-enter-done");
@@ -49,7 +46,7 @@ function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement,
49
46
  bubblePosition: "left",
50
47
  },
51
48
  approveMenu: {
52
- description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Approve or reject the page here " }),
49
+ description: _jsx(_Fragment, { children: "Approve or reject the page here " }),
53
50
  focusElement: "#actions-menu",
54
51
  waitForUserInput: async () => {
55
52
  await waitForElement("#approveReview");
@@ -59,10 +56,10 @@ function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement,
59
56
  bubblePosition: "left",
60
57
  },
61
58
  closeTour: {
62
- description: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: "Congratulations! You have completed the tour." }),
59
+ description: _jsx(_Fragment, { children: "Congratulations! You have completed the tour." }),
63
60
  buttons: [
64
61
  {
65
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-check" }), " Finish Tour"] })),
62
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-check" }), " Finish Tour"] })),
66
63
  onClick: () => stopTour(),
67
64
  className: "button button-primary mt-2",
68
65
  },
@@ -73,7 +70,7 @@ function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement,
73
70
  description: "You have completed the tour and are ready to start editing!",
74
71
  buttons: [
75
72
  {
76
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-check" }), " Finish Tour"] })),
73
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-check" }), " Finish Tour"] })),
77
74
  onClick: () => stopTour(),
78
75
  className: "button button-primary mt-2",
79
76
  },
@@ -83,7 +80,7 @@ function getPreviewTourSteps({ editContext, nextStep, stopTour, waitForElement,
83
80
  description: "Oops, something went wrong.",
84
81
  buttons: [
85
82
  {
86
- label: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("i", { className: "pi pi-check" }), " Close"] })),
83
+ label: (_jsxs(_Fragment, { children: [_jsx("i", { className: "pi pi-check" }), " Close"] })),
87
84
  onClick: () => stopTour(),
88
85
  },
89
86
  ],