@alpaca-editor/core 1.0.3939 → 1.0.3942

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 (325) hide show
  1. package/dist/components/ActionButton.d.ts +1 -0
  2. package/dist/components/ActionButton.js +2 -2
  3. package/dist/components/ActionButton.js.map +1 -1
  4. package/dist/editor/FieldActionsOverlay.d.ts +1 -0
  5. package/dist/editor/FieldActionsOverlay.js +2 -11
  6. package/dist/editor/FieldActionsOverlay.js.map +1 -1
  7. package/dist/editor/PictureCropper.js +65 -23
  8. package/dist/editor/PictureCropper.js.map +1 -1
  9. package/dist/editor/PictureEditor.js +16 -2
  10. package/dist/editor/PictureEditor.js.map +1 -1
  11. package/dist/editor/Titlebar.js +1 -1
  12. package/dist/editor/Titlebar.js.map +1 -1
  13. package/dist/editor/ai/GhostWriter.js +21 -2
  14. package/dist/editor/ai/GhostWriter.js.map +1 -1
  15. package/dist/editor/commands/componentCommands.js +7 -3
  16. package/dist/editor/commands/componentCommands.js.map +1 -1
  17. package/dist/editor/media-selector/MediaFolderBrowser.d.ts +5 -0
  18. package/dist/editor/media-selector/MediaFolderBrowser.js +77 -0
  19. package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -0
  20. package/dist/editor/media-selector/MediaSelector.js +1 -1
  21. package/dist/editor/media-selector/MediaSelector.js.map +1 -1
  22. package/dist/editor/media-selector/Thumbnails.js +2 -2
  23. package/dist/editor/media-selector/index.d.ts +8 -0
  24. package/dist/editor/media-selector/index.js +9 -0
  25. package/dist/editor/media-selector/index.js.map +1 -0
  26. package/dist/editor/menubar/BrowseHistory.js +1 -1
  27. package/dist/editor/menubar/PageSelector.js +39 -15
  28. package/dist/editor/menubar/PageSelector.js.map +1 -1
  29. package/dist/editor/page-editor-chrome/useInlineAICompletion.js +37 -11
  30. package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
  31. package/dist/editor/reviews/Comment.js +1 -1
  32. package/dist/editor/reviews/Comment.js.map +1 -1
  33. package/dist/editor/services/aiService.js +0 -1
  34. package/dist/editor/services/aiService.js.map +1 -1
  35. package/dist/editor/sidebar/ComponentTree.js +3 -4
  36. package/dist/editor/sidebar/ComponentTree.js.map +1 -1
  37. package/dist/editor/ui/SimpleTabs.d.ts +1 -0
  38. package/dist/editor/ui/SimpleTabs.js +3 -3
  39. package/dist/editor/ui/SimpleTabs.js.map +1 -1
  40. package/dist/editor/ui/Splitter.js +61 -6
  41. package/dist/editor/ui/Splitter.js.map +1 -1
  42. package/dist/editor/views/MediaFolderEditView.d.ts +4 -0
  43. package/dist/editor/views/MediaFolderEditView.js +40 -0
  44. package/dist/editor/views/MediaFolderEditView.js.map +1 -0
  45. package/dist/editor/views/SingleEditView.js +9 -1
  46. package/dist/editor/views/SingleEditView.js.map +1 -1
  47. package/dist/revision.d.ts +2 -2
  48. package/dist/revision.js +2 -2
  49. package/dist/styles.css +61 -5
  50. package/package.json +8 -2
  51. package/.prettierrc +0 -3
  52. package/build.css +0 -3
  53. package/components.json +0 -21
  54. package/eslint.config.mjs +0 -4
  55. package/images/bg-shape-black.webp +0 -0
  56. package/images/wizard-bg.png +0 -0
  57. package/images/wizard-tour.png +0 -0
  58. package/images/wizard.png +0 -0
  59. package/src/client-components/api.ts +0 -6
  60. package/src/client-components/index.ts +0 -19
  61. package/src/components/ActionButton.tsx +0 -41
  62. package/src/components/Error.tsx +0 -57
  63. package/src/components/ui/CardConnector.tsx +0 -56
  64. package/src/components/ui/button.tsx +0 -62
  65. package/src/components/ui/card.tsx +0 -372
  66. package/src/components/ui/context-menu.tsx +0 -250
  67. package/src/config/config.tsx +0 -917
  68. package/src/config/types.ts +0 -286
  69. package/src/editor/ComponentInfo.tsx +0 -90
  70. package/src/editor/ConfirmationDialog.tsx +0 -103
  71. package/src/editor/ContentTree.tsx +0 -730
  72. package/src/editor/ContextMenu.tsx +0 -230
  73. package/src/editor/Editor.tsx +0 -90
  74. package/src/editor/EditorWarning.tsx +0 -34
  75. package/src/editor/EditorWarnings.tsx +0 -33
  76. package/src/editor/FieldActionsOverlay.tsx +0 -307
  77. package/src/editor/FieldEditorPopup.tsx +0 -65
  78. package/src/editor/FieldHistory.tsx +0 -75
  79. package/src/editor/FieldList.tsx +0 -190
  80. package/src/editor/FieldListField.tsx +0 -391
  81. package/src/editor/FieldListFieldWithFallbacks.tsx +0 -217
  82. package/src/editor/FloatingToolbar.tsx +0 -163
  83. package/src/editor/ImageEditor.tsx +0 -128
  84. package/src/editor/ItemInfo.tsx +0 -90
  85. package/src/editor/LinkEditorDialog.tsx +0 -196
  86. package/src/editor/MainLayout.tsx +0 -95
  87. package/src/editor/MobileLayout.tsx +0 -68
  88. package/src/editor/NewEditorClient.tsx +0 -11
  89. package/src/editor/PictureCropper.tsx +0 -503
  90. package/src/editor/PictureEditor.tsx +0 -277
  91. package/src/editor/PictureEditorDialog.tsx +0 -381
  92. package/src/editor/PublishDialog.ignore +0 -74
  93. package/src/editor/ScrollingContentTree.tsx +0 -67
  94. package/src/editor/Terminal.tsx +0 -227
  95. package/src/editor/Titlebar.tsx +0 -104
  96. package/src/editor/ai/AiPopup.tsx +0 -59
  97. package/src/editor/ai/AiResponseMessage.tsx +0 -106
  98. package/src/editor/ai/AiTerminal.tsx +0 -503
  99. package/src/editor/ai/AiToolCall.tsx +0 -61
  100. package/src/editor/ai/EditorAiTerminal.tsx +0 -20
  101. package/src/editor/ai/GhostWriter.tsx +0 -432
  102. package/src/editor/ai/aiPageModel.ts +0 -108
  103. package/src/editor/ai/editorAiContext.ts +0 -18
  104. package/src/editor/client/AboutDialog.tsx +0 -44
  105. package/src/editor/client/EditorClient.tsx +0 -2241
  106. package/src/editor/client/GenericDialog.tsx +0 -50
  107. package/src/editor/client/editContext.ts +0 -416
  108. package/src/editor/client/helpers.ts +0 -44
  109. package/src/editor/client/itemsRepository.ts +0 -574
  110. package/src/editor/client/operations.ts +0 -768
  111. package/src/editor/client/pageModelBuilder.ts +0 -219
  112. package/src/editor/commands/commands.ts +0 -22
  113. package/src/editor/commands/componentCommands.tsx +0 -424
  114. package/src/editor/commands/createVersionCommand.ts +0 -33
  115. package/src/editor/commands/deleteVersionCommand.ts +0 -71
  116. package/src/editor/commands/itemCommands.tsx +0 -351
  117. package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +0 -201
  118. package/src/editor/commands/localizeItem/LocalizeItemUtils.ts +0 -27
  119. package/src/editor/commands/undo.ts +0 -39
  120. package/src/editor/component-designer/ComponentDesigner.tsx +0 -70
  121. package/src/editor/component-designer/ComponentDesignerAiTerminal.tsx +0 -11
  122. package/src/editor/component-designer/ComponentDesignerMenu.tsx +0 -91
  123. package/src/editor/component-designer/ComponentEditor.tsx +0 -97
  124. package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +0 -31
  125. package/src/editor/component-designer/ComponentRenderingEditor.tsx +0 -104
  126. package/src/editor/component-designer/ComponentsDropdown.tsx +0 -39
  127. package/src/editor/component-designer/PlaceholdersEditor.tsx +0 -179
  128. package/src/editor/component-designer/RenderingsDropdown.tsx +0 -36
  129. package/src/editor/component-designer/TemplateEditor.tsx +0 -236
  130. package/src/editor/component-designer/aiContext.ts +0 -23
  131. package/src/editor/componentTreeHelper.tsx +0 -116
  132. package/src/editor/context-menu/CopyMoveMenu.tsx +0 -103
  133. package/src/editor/context-menu/InsertMenu.tsx +0 -347
  134. package/src/editor/control-center/About.tsx +0 -342
  135. package/src/editor/control-center/ControlCenterMenu.tsx +0 -76
  136. package/src/editor/control-center/IndexOverview.tsx +0 -50
  137. package/src/editor/control-center/IndexSettings.tsx +0 -266
  138. package/src/editor/control-center/Info.tsx +0 -104
  139. package/src/editor/control-center/QuotaInfo.tsx +0 -301
  140. package/src/editor/control-center/Status.tsx +0 -113
  141. package/src/editor/control-center/WebSocketMessages.tsx +0 -155
  142. package/src/editor/editor-warnings/ItemLocked.tsx +0 -63
  143. package/src/editor/editor-warnings/NoLanguageWriteAccess.tsx +0 -22
  144. package/src/editor/editor-warnings/NoWorkflowWriteAccess.tsx +0 -23
  145. package/src/editor/editor-warnings/NoWriteAccess.tsx +0 -16
  146. package/src/editor/editor-warnings/ValidationErrors.tsx +0 -54
  147. package/src/editor/field-types/AttachmentEditor.tsx +0 -9
  148. package/src/editor/field-types/CheckboxEditor.tsx +0 -47
  149. package/src/editor/field-types/DropLinkEditor.tsx +0 -80
  150. package/src/editor/field-types/DropListEditor.tsx +0 -84
  151. package/src/editor/field-types/ImageFieldEditor.tsx +0 -65
  152. package/src/editor/field-types/InternalLinkFieldEditor.tsx +0 -117
  153. package/src/editor/field-types/LinkFieldEditor.tsx +0 -85
  154. package/src/editor/field-types/MultiLineText.tsx +0 -82
  155. package/src/editor/field-types/PictureFieldEditor.tsx +0 -121
  156. package/src/editor/field-types/RawEditor.tsx +0 -53
  157. package/src/editor/field-types/ReactQuill.tsx +0 -580
  158. package/src/editor/field-types/RichTextEditor.tsx +0 -22
  159. package/src/editor/field-types/RichTextEditorComponent.tsx +0 -127
  160. package/src/editor/field-types/SingleLineText.tsx +0 -174
  161. package/src/editor/field-types/TreeListEditor.tsx +0 -261
  162. package/src/editor/fieldTypes.ts +0 -140
  163. package/src/editor/media-selector/AiImageSearch.tsx +0 -185
  164. package/src/editor/media-selector/AiImageSearchPrompt.tsx +0 -94
  165. package/src/editor/media-selector/MediaSelector.tsx +0 -42
  166. package/src/editor/media-selector/Preview.tsx +0 -14
  167. package/src/editor/media-selector/Thumbnails.tsx +0 -48
  168. package/src/editor/media-selector/TreeSelector.tsx +0 -292
  169. package/src/editor/media-selector/UploadZone.tsx +0 -137
  170. package/src/editor/menubar/ActionsMenu.tsx +0 -94
  171. package/src/editor/menubar/ActiveUsers.tsx +0 -17
  172. package/src/editor/menubar/ApproveAndPublish.tsx +0 -18
  173. package/src/editor/menubar/BrowseHistory.tsx +0 -28
  174. package/src/editor/menubar/ItemLanguageVersion.tsx +0 -76
  175. package/src/editor/menubar/LanguageSelector.tsx +0 -226
  176. package/src/editor/menubar/Menu.tsx +0 -83
  177. package/src/editor/menubar/NavButtons.tsx +0 -74
  178. package/src/editor/menubar/PageSelector.tsx +0 -166
  179. package/src/editor/menubar/PageViewerControls.tsx +0 -120
  180. package/src/editor/menubar/PreviewSecondaryControls.tsx +0 -18
  181. package/src/editor/menubar/SecondaryControls.tsx +0 -45
  182. package/src/editor/menubar/Separator.tsx +0 -12
  183. package/src/editor/menubar/SiteInfo.tsx +0 -53
  184. package/src/editor/menubar/User.tsx +0 -27
  185. package/src/editor/menubar/VersionSelector.tsx +0 -142
  186. package/src/editor/page-editor-chrome/CommentHighlighting.tsx +0 -307
  187. package/src/editor/page-editor-chrome/CommentHighlightings.tsx +0 -35
  188. package/src/editor/page-editor-chrome/FieldActionIndicator.tsx +0 -59
  189. package/src/editor/page-editor-chrome/FieldActionIndicators.tsx +0 -23
  190. package/src/editor/page-editor-chrome/FieldEditedIndicator.tsx +0 -64
  191. package/src/editor/page-editor-chrome/FieldEditedIndicators.tsx +0 -35
  192. package/src/editor/page-editor-chrome/FrameMenu.tsx +0 -338
  193. package/src/editor/page-editor-chrome/FrameMenus.tsx +0 -48
  194. package/src/editor/page-editor-chrome/InlineEditor.tsx +0 -765
  195. package/src/editor/page-editor-chrome/LockedFieldIndicator.tsx +0 -61
  196. package/src/editor/page-editor-chrome/NoLayout.tsx +0 -36
  197. package/src/editor/page-editor-chrome/PageEditorChrome.tsx +0 -122
  198. package/src/editor/page-editor-chrome/PictureEditorOverlay.tsx +0 -161
  199. package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +0 -169
  200. package/src/editor/page-editor-chrome/PlaceholderDropZones.tsx +0 -315
  201. package/src/editor/page-editor-chrome/SuggestionHighlighting.tsx +0 -300
  202. package/src/editor/page-editor-chrome/SuggestionHighlightings.tsx +0 -40
  203. package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +0 -791
  204. package/src/editor/page-viewer/DeviceToolbar.tsx +0 -70
  205. package/src/editor/page-viewer/EditorForm.tsx +0 -258
  206. package/src/editor/page-viewer/MiniMap.tsx +0 -362
  207. package/src/editor/page-viewer/PageViewer.tsx +0 -169
  208. package/src/editor/page-viewer/PageViewerFrame.tsx +0 -1022
  209. package/src/editor/page-viewer/pageModelSkeletonBuilder.ts +0 -412
  210. package/src/editor/page-viewer/pageViewContext.ts +0 -186
  211. package/src/editor/pageModel.ts +0 -220
  212. package/src/editor/picture-shared.tsx +0 -53
  213. package/src/editor/reviews/Comment.tsx +0 -307
  214. package/src/editor/reviews/Comments.tsx +0 -125
  215. package/src/editor/reviews/DiffView.tsx +0 -109
  216. package/src/editor/reviews/PreviewInfo.tsx +0 -35
  217. package/src/editor/reviews/Reviews.tsx +0 -280
  218. package/src/editor/reviews/SuggestedEdit.tsx +0 -316
  219. package/src/editor/reviews/reviewCommands.tsx +0 -47
  220. package/src/editor/reviews/useReviews.tsx +0 -70
  221. package/src/editor/services/aiService.ts +0 -174
  222. package/src/editor/services/componentDesignerService.ts +0 -151
  223. package/src/editor/services/contentService.ts +0 -180
  224. package/src/editor/services/editService.ts +0 -488
  225. package/src/editor/services/indexService.ts +0 -24
  226. package/src/editor/services/reviewsService.ts +0 -53
  227. package/src/editor/services/serviceHelper.ts +0 -95
  228. package/src/editor/services/suggestedEditsService.ts +0 -39
  229. package/src/editor/services/systemService.ts +0 -5
  230. package/src/editor/services/translationService.ts +0 -21
  231. package/src/editor/services-server/api.ts +0 -150
  232. package/src/editor/services-server/graphQL.ts +0 -106
  233. package/src/editor/sidebar/ComponentPalette.tsx +0 -161
  234. package/src/editor/sidebar/ComponentTree.tsx +0 -548
  235. package/src/editor/sidebar/ComponentTree2.tsxx +0 -490
  236. package/src/editor/sidebar/Debug.tsx +0 -111
  237. package/src/editor/sidebar/DictionaryEditor.tsx +0 -261
  238. package/src/editor/sidebar/EditHistory.tsx +0 -134
  239. package/src/editor/sidebar/GraphQL.tsx +0 -164
  240. package/src/editor/sidebar/Insert.tsx +0 -35
  241. package/src/editor/sidebar/MainContentTree.tsx +0 -102
  242. package/src/editor/sidebar/Performance.tsx +0 -53
  243. package/src/editor/sidebar/Sessions.tsx +0 -35
  244. package/src/editor/sidebar/Sidebar.tsx +0 -20
  245. package/src/editor/sidebar/SidebarView.tsx +0 -152
  246. package/src/editor/sidebar/Translations.tsx +0 -295
  247. package/src/editor/sidebar/Validation.tsx +0 -102
  248. package/src/editor/sidebar/ViewSelector.tsx +0 -60
  249. package/src/editor/sidebar/Workbox.tsx +0 -209
  250. package/src/editor/ui/CenteredMessage.tsx +0 -7
  251. package/src/editor/ui/CopyMoveTargetSelectorDialog.tsx +0 -81
  252. package/src/editor/ui/CopyToClipboardButton.tsx +0 -24
  253. package/src/editor/ui/DialogButtons.tsx +0 -11
  254. package/src/editor/ui/Icons.tsx +0 -709
  255. package/src/editor/ui/ItemList.tsx +0 -76
  256. package/src/editor/ui/ItemNameDialogNew.tsx +0 -118
  257. package/src/editor/ui/ItemSearch.tsx +0 -153
  258. package/src/editor/ui/PerfectTree.tsx +0 -571
  259. package/src/editor/ui/Section.tsx +0 -35
  260. package/src/editor/ui/SimpleIconButton.tsx +0 -54
  261. package/src/editor/ui/SimpleMenu.tsx +0 -40
  262. package/src/editor/ui/SimpleTable.tsx +0 -60
  263. package/src/editor/ui/SimpleTabs.tsx +0 -55
  264. package/src/editor/ui/SimpleToolbar.tsx +0 -7
  265. package/src/editor/ui/Spinner.tsx +0 -9
  266. package/src/editor/ui/Splitter.tsx +0 -314
  267. package/src/editor/ui/StackedPanels.tsx +0 -134
  268. package/src/editor/ui/Toolbar.tsx +0 -7
  269. package/src/editor/utils/id-helper.ts +0 -3
  270. package/src/editor/utils/insertOptions.ts +0 -69
  271. package/src/editor/utils/itemutils.ts +0 -29
  272. package/src/editor/utils/useMemoDebug.ts +0 -28
  273. package/src/editor/utils.ts +0 -486
  274. package/src/editor/views/CompareView.tsx +0 -245
  275. package/src/editor/views/EditView.tsx +0 -27
  276. package/src/editor/views/ItemEditor.tsx +0 -58
  277. package/src/editor/views/SingleEditView.tsx +0 -46
  278. package/src/fonts/Geist-Black.woff2 +0 -0
  279. package/src/fonts/Geist-Bold.woff2 +0 -0
  280. package/src/fonts/Geist-ExtraBold.woff2 +0 -0
  281. package/src/fonts/Geist-ExtraLight.woff2 +0 -0
  282. package/src/fonts/Geist-Light.woff2 +0 -0
  283. package/src/fonts/Geist-Medium.woff2 +0 -0
  284. package/src/fonts/Geist-Regular.woff2 +0 -0
  285. package/src/fonts/Geist-SemiBold.woff2 +0 -0
  286. package/src/fonts/Geist-Thin.woff2 +0 -0
  287. package/src/fonts/Geist[wght].woff2 +0 -0
  288. package/src/fonts/index.ts +0 -10
  289. package/src/index.ts +0 -23
  290. package/src/lib/safelist.tsx +0 -16
  291. package/src/lib/utils.ts +0 -6
  292. package/src/page-wizard/PageWizard.tsx +0 -139
  293. package/src/page-wizard/WizardBox.tsx +0 -4
  294. package/src/page-wizard/WizardBoxConnector.tsx +0 -56
  295. package/src/page-wizard/WizardSteps.tsx +0 -458
  296. package/src/page-wizard/service.ts +0 -35
  297. package/src/page-wizard/startPageWizardCommand.ts +0 -26
  298. package/src/page-wizard/steps/BuildPageStep.tsx +0 -259
  299. package/src/page-wizard/steps/CollectStep.tsx +0 -296
  300. package/src/page-wizard/steps/ComponentTypesSelector.tsx +0 -454
  301. package/src/page-wizard/steps/Components.tsx +0 -193
  302. package/src/page-wizard/steps/ContentStep.tsx +0 -890
  303. package/src/page-wizard/steps/EditButton.tsx +0 -34
  304. package/src/page-wizard/steps/FieldEditor.tsx +0 -102
  305. package/src/page-wizard/steps/Generate.tsx +0 -60
  306. package/src/page-wizard/steps/ImagesStep.tsx +0 -382
  307. package/src/page-wizard/steps/LayoutStep.tsx +0 -227
  308. package/src/page-wizard/steps/MetaDataStep.tsx +0 -173
  309. package/src/page-wizard/steps/SelectStep.tsx +0 -281
  310. package/src/page-wizard/steps/schema.ts +0 -180
  311. package/src/page-wizard/steps/usePageCreator.ts +0 -325
  312. package/src/page-wizard/usePageWizard.ts +0 -79
  313. package/src/revision.ts +0 -2
  314. package/src/splash-screen/NewPage.tsx +0 -294
  315. package/src/splash-screen/OpenPage.tsx +0 -113
  316. package/src/splash-screen/RecentPages.tsx +0 -123
  317. package/src/splash-screen/SectionHeadline.tsx +0 -21
  318. package/src/splash-screen/SplashScreen.tsx +0 -195
  319. package/src/tour/Tour.tsx +0 -566
  320. package/src/tour/default-tour.tsx +0 -301
  321. package/src/tour/preview-tour.tsx +0 -128
  322. package/src/types.ts +0 -335
  323. package/styles.css +0 -765
  324. package/tsconfig.build.json +0 -31
  325. package/tsconfig.json +0 -14
@@ -1,301 +0,0 @@
1
- import { GetEditorTourStepsParams, TourStep } from "../config/types";
2
-
3
- export function getDefaultTourSteps(
4
- {
5
- editContext,
6
- nextStep,
7
- stopTour,
8
- waitForElement,
9
- waitForElementToDisappear,
10
- setFocusRect,
11
- delay,
12
- waitForInput,
13
- simulateTyping,
14
- }: GetEditorTourStepsParams,
15
- config: {
16
- firstComponentTemplateId: string;
17
- firstComponentTemplateName: string;
18
- firstComponentTextFieldName: string;
19
- firstComponentTextFieldId: string;
20
- firstComponentRichTextFieldName: string;
21
- firstComponentRichTextFieldId: string;
22
- },
23
- ) {
24
- const tourSteps: Record<string, TourStep> = {
25
- "start-tour": {
26
- title: "Welcome to the AI Editor Tour!",
27
- description:
28
- "I will show you around the editor and how to use the most important features.",
29
- prepareAction: async () => {
30
- editContext?.openSplashScreen();
31
- },
32
- buttons: [
33
- {
34
- label: (
35
- <div className="flex items-center gap-2">
36
- <i className="pi pi-play" /> Start Tour
37
- </div>
38
- ),
39
- onClick: () => {
40
- nextStep("new-page");
41
- },
42
- className: "button button-primary mt-2",
43
- },
44
- {
45
- label: (
46
- <div className="flex items-center gap-2">
47
- <i className="pi pi-times" /> No thanks
48
- </div>
49
- ),
50
- onClick: () => {
51
- stopTour();
52
- },
53
- className: "button button-secondary mt-2",
54
- },
55
- ],
56
- },
57
- "new-page": {
58
- description: (
59
- <>
60
- Click on the <b>New Page</b> tab to create a new page
61
- </>
62
- ),
63
- focusElement: "#new-page-tab",
64
- waitForUserInput: async () => {
65
- await waitForElement("#new-page-tab.active-tab");
66
- },
67
- nextStep: "pick-location",
68
- },
69
- "pick-location": {
70
- description: (
71
- <>
72
- Select the <b>Playground</b> folder as the parent for your new page
73
- </>
74
- ),
75
- focusElement: ".tour-pick-location",
76
- waitForUserInput: async () => {
77
- await new Promise<void>((resolve) => {
78
- const checkForElement = () => {
79
- const elements = document.querySelectorAll(".p-highlight");
80
- for (const element of elements) {
81
- if (element.textContent?.trim() === "Playground") {
82
- setFocusRect(element.getBoundingClientRect());
83
- resolve();
84
- return;
85
- }
86
- }
87
- requestAnimationFrame(checkForElement);
88
- };
89
- checkForElement();
90
- });
91
- },
92
- getPointTo: () => {
93
- const elements = document.querySelectorAll(".p-treenode-label");
94
- for (const element of elements) {
95
- if (element.textContent?.trim() === "Playground") {
96
- return element.getBoundingClientRect();
97
- }
98
- }
99
- return undefined;
100
- },
101
- nextStep: "choose-template",
102
- },
103
- "choose-template": {
104
- description: "Select a template for your page",
105
- focusElement: ".tour-choose-template",
106
- waitForUserInput: async () => {
107
- await waitForElement(".tour-selected-template");
108
- },
109
- bubblePosition: "left",
110
- nextStep: "enter-name",
111
- },
112
- "enter-name": {
113
- description: "Enter a name for your page",
114
- focusElement: "#new-page-name",
115
- bubblePosition: "left",
116
- waitForUserInput: async () => {
117
- await waitForElement("#create-new-page-button:not(.p-disabled)");
118
- },
119
- nextStep: "create-page",
120
- },
121
- "create-page": {
122
- description: "Click the Create button",
123
- focusElement: "#create-new-page-button",
124
- waitForUserInput: async () => {
125
- await waitForElement("#insert-component-button");
126
- },
127
- nextStep: "ready-to-add-component",
128
- },
129
- "ready-to-add-component": {
130
- description: "Wanna add a component to your beautiful empty page?",
131
- buttons: [
132
- {
133
- label: (
134
- <>
135
- <i className="pi pi-arrow-right" /> I'm ready, lets go!
136
- </>
137
- ),
138
- onClick: () => nextStep("insert-component"),
139
- },
140
- ],
141
- },
142
- "insert-component": {
143
- description: "Excellent, click on the plus button to insert a component.",
144
- focusElement: "#insert-component-button",
145
- waitForUserInput: async () => {
146
- await waitForElement(".tour-component-palette");
147
- },
148
- nextStep: "drag-component",
149
- },
150
- "drag-component": {
151
- description: `Drag and drop a ${config.firstComponentTemplateName} component to your page.`,
152
- focusElement: `#insert-component-${config.firstComponentTemplateId}`,
153
- waitForUserInput: async () => {
154
- await waitForElement(".tour-placeholder-dropzone");
155
- },
156
- nextStep: "drop-component-on-placeholder",
157
- },
158
- "drop-component-on-placeholder": {
159
- description: "Drop the component onto this placeholder!",
160
- focusElement: ".tour-placeholder-dropzone",
161
- bubblePosition: "left",
162
- extendFocus: 70,
163
- waitForUserInput: async () => {
164
- await waitForElementToDisappear(".tour-placeholder-dropzone");
165
- await delay(400);
166
- if (!document.querySelector(".tour-component-palette")) {
167
- return "enter-title";
168
- }
169
- return "drag-component";
170
- },
171
- nextStep: "enter-title",
172
- },
173
- "enter-title": {
174
- description: `Excellent! Now lets fill in the fields. First enter a ${config.firstComponentTextFieldName}`,
175
- focusElement: `[data-field-id='${config.firstComponentTextFieldId}']`,
176
- waitForUserInput: async () => {
177
- await delay(5000);
178
- await waitForInput(
179
- `[data-field-id='${config.firstComponentTextFieldId}'] input`,
180
- 5,
181
- );
182
- },
183
- nextStep: "see-content-update",
184
- },
185
- "see-content-update": {
186
- description:
187
- "See how the content is automatically updating on your page?",
188
- focusElement: `[data-field-id='${config.firstComponentTextFieldId}']`,
189
- pointToElement: `iframe:[data-fieldid='${config.firstComponentTextFieldId}']`,
190
- bubblePosition: "bottom",
191
- flipArrow: true,
192
- waitForUserInput: async () => {
193
- await delay(5000);
194
- await waitForInput(
195
- `[data-field-id='${config.firstComponentTextFieldId}'] input`,
196
- 5,
197
- );
198
- },
199
- nextStep: "edit-content-inline",
200
- },
201
- "edit-content-inline": {
202
- description:
203
- "You can also directly edit the content on the page. Click on the [Introduction] placeholder here and start typing!",
204
- focusElement: `iframe:[data-fieldid='${config.firstComponentRichTextFieldId}']`,
205
- bubblePosition: "bottom",
206
- flipArrow: true,
207
- waitForUserInput: async () => {
208
- await delay(5000);
209
- await waitForInput(
210
- `[data-field-id='${config.firstComponentRichTextFieldId}'] [contenteditable]`,
211
- 5,
212
- );
213
- },
214
- nextStep: "ai-intro",
215
- },
216
- "ai-intro": {
217
- description:
218
- "But hey, this is an AI editor, so why not let the AI do some of the work for you?",
219
- buttons: [
220
- {
221
- label: (
222
- <>
223
- <i className="pi pi-arrow-right" /> Great, show me!
224
- </>
225
- ),
226
- onClick: () => nextStep("ai-sidebar"),
227
- },
228
- ],
229
- },
230
- "ai-sidebar": {
231
- description: "Click on the AI sidebar to open the AI chat.",
232
- focusElement: `[data-sidebarview-name='ai']`,
233
- nextStep: "ai-terminal",
234
- waitForElement: "[data-sidebarview-name='ai'].a-active",
235
- },
236
- "ai-terminal": {
237
- description:
238
- "Let me take control and add tell the AI to add some more components.",
239
- focusElement: `.tour-ai-terminal textarea`,
240
- waitForUserInput: async () => {
241
- await delay(1000);
242
- const aiTerminal = document.querySelector(".tour-ai-terminal textarea");
243
- if (aiTerminal) {
244
- (aiTerminal as HTMLTextAreaElement).focus();
245
- await simulateTyping(
246
- aiTerminal as HTMLTextAreaElement,
247
- `Plase add three components of type ${config.firstComponentTemplateName} with some funny dummy content to the page.`,
248
- );
249
- }
250
- },
251
- bubblePosition: "top-right",
252
- nextStep: "ai-submit",
253
- },
254
- "ai-submit": {
255
- description: "Click on the Send button to submit the prompt to the AI.",
256
- focusElement: ".tour-ai-terminal .tour-send-button",
257
- bubblePosition: "top-right",
258
- nextStep: "ai-watch-components-added",
259
- waitForElement: ".tour-ai-terminal .a-prompt",
260
- },
261
- "ai-watch-components-added": {
262
- description:
263
- "Watch how the AI adds the components to the page. This can take a few seconds.",
264
- focusElement: ".tour-ai-terminal",
265
- pointToElement: ".tour-ai-terminal .a-prompt",
266
- waitForElement: ".tour-ai-response-message-changes",
267
- nextStep: "congratulations",
268
- },
269
- congratulations: {
270
- title: "Congratulations!",
271
- description: "You have completed the tour and are now an AI Editor Pro!",
272
- buttons: [
273
- {
274
- label: (
275
- <>
276
- <i className="pi pi-check" /> Finish Tour
277
- </>
278
- ),
279
- onClick: () => stopTour(),
280
- className: "button button-primary mt-2",
281
- },
282
- ],
283
- },
284
- error: {
285
- title: "Oh no...",
286
- description: "Something went wrong.",
287
- buttons: [
288
- {
289
- label: (
290
- <>
291
- <i className="pi pi-check" /> Close
292
- </>
293
- ),
294
- onClick: () => stopTour(),
295
- },
296
- ],
297
- },
298
- };
299
-
300
- return tourSteps;
301
- }
@@ -1,128 +0,0 @@
1
- import { GetEditorTourStepsParams, TourStep } from "../config/types";
2
-
3
- export function getPreviewTourSteps({
4
- editContext,
5
- nextStep,
6
- stopTour,
7
- waitForElement,
8
- delay,
9
- }: GetEditorTourStepsParams) {
10
- const tourSteps: Record<string, TourStep> = {
11
- "start-tour": {
12
- title: "Welcome to the Preview Tour!",
13
- description:
14
- "I'll guide you through the preview and explain how to use its essential features.",
15
- prepareAction: async () => {
16
- editContext?.openSplashScreen();
17
- },
18
- buttons: [
19
- {
20
- label: (
21
- <div className="flex items-center gap-2">
22
- <i className="pi pi-play" /> Start Tour
23
- </div>
24
- ),
25
- onClick: () => {
26
- nextStep("comment");
27
- },
28
- className: "button button-primary mt-2",
29
- },
30
- {
31
- label: (
32
- <div className="flex items-center gap-2">
33
- <i className="pi pi-times" /> No thanks
34
- </div>
35
- ),
36
- onClick: () => {
37
- stopTour();
38
- },
39
- className: "button button-secondary mt-2",
40
- },
41
- ],
42
- },
43
- comment: {
44
- description: <>Click here to add a comment to the page</>,
45
- focusElement: "#add-comment",
46
- nextStep: "commentContextMenu",
47
- buttons: [
48
- {
49
- label: (
50
- <>
51
- <i className="pi pi-arrow-right" /> Next
52
- </>
53
- ),
54
- onClick: () => nextStep("commentContextMenu"),
55
- },
56
- ],
57
- },
58
- commentContextMenu: {
59
- description: (
60
- <>You can also select text and add a comment from the context menu </>
61
- ),
62
- focusElement: "[data-testid='pageEditoriframe']",
63
- waitForUserInput: async () => {
64
- await waitForElement(".p-contextmenu-enter-done");
65
- await delay(1000);
66
- },
67
- nextStep: "approveMenu",
68
- bubblePosition: "left",
69
- },
70
- approveMenu: {
71
- description: <>Approve or reject the page here </>,
72
- focusElement: "#actions-menu",
73
- waitForUserInput: async () => {
74
- await waitForElement("#approveReview");
75
- await delay(2000);
76
- },
77
- nextStep: "closeTour",
78
- bubblePosition: "left",
79
- },
80
- closeTour: {
81
- description: <>Congratulations! You have completed the tour.</>,
82
- buttons: [
83
- {
84
- label: (
85
- <>
86
- <i className="pi pi-check" /> Finish Tour
87
- </>
88
- ),
89
- onClick: () => stopTour(),
90
- className: "button button-primary mt-2",
91
- },
92
- ],
93
- },
94
- congratulations: {
95
- title: "Congratulations!",
96
- description:
97
- "You have completed the tour and are ready to start editing!",
98
- buttons: [
99
- {
100
- label: (
101
- <>
102
- <i className="pi pi-check" /> Finish Tour
103
- </>
104
- ),
105
- onClick: () => stopTour(),
106
- className: "button button-primary mt-2",
107
- },
108
- ],
109
- },
110
-
111
- error: {
112
- title: "Oh no...",
113
- description: "Something went wrong.",
114
- buttons: [
115
- {
116
- label: (
117
- <>
118
- <i className="pi pi-check" /> Close
119
- </>
120
- ),
121
- onClick: () => stopTour(),
122
- },
123
- ],
124
- },
125
- };
126
-
127
- return tourSteps;
128
- }