@alpaca-editor/core 1.0.3938 → 1.0.3941

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 (357) 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/ContentTree.js +12 -8
  5. package/dist/editor/ContentTree.js.map +1 -1
  6. package/dist/editor/ContextMenu.d.ts +1 -1
  7. package/dist/editor/ContextMenu.js +17 -3
  8. package/dist/editor/ContextMenu.js.map +1 -1
  9. package/dist/editor/FieldActionsOverlay.d.ts +18 -0
  10. package/dist/editor/FieldActionsOverlay.js +139 -0
  11. package/dist/editor/FieldActionsOverlay.js.map +1 -0
  12. package/dist/editor/FieldHistory.d.ts +2 -1
  13. package/dist/editor/FieldHistory.js +11 -8
  14. package/dist/editor/FieldHistory.js.map +1 -1
  15. package/dist/editor/FieldListField.js +14 -17
  16. package/dist/editor/FieldListField.js.map +1 -1
  17. package/dist/editor/PictureCropper.js +65 -23
  18. package/dist/editor/PictureCropper.js.map +1 -1
  19. package/dist/editor/PictureEditor.js +43 -3
  20. package/dist/editor/PictureEditor.js.map +1 -1
  21. package/dist/editor/Titlebar.js +19 -10
  22. package/dist/editor/Titlebar.js.map +1 -1
  23. package/dist/editor/ai/AiTerminal.js +27 -41
  24. package/dist/editor/ai/AiTerminal.js.map +1 -1
  25. package/dist/editor/ai/GhostWriter.js +21 -2
  26. package/dist/editor/ai/GhostWriter.js.map +1 -1
  27. package/dist/editor/client/EditorClient.js +48 -18
  28. package/dist/editor/client/EditorClient.js.map +1 -1
  29. package/dist/editor/client/editContext.d.ts +1 -1
  30. package/dist/editor/client/editContext.js.map +1 -1
  31. package/dist/editor/client/itemsRepository.js +126 -90
  32. package/dist/editor/client/itemsRepository.js.map +1 -1
  33. package/dist/editor/commands/componentCommands.js +7 -3
  34. package/dist/editor/commands/componentCommands.js.map +1 -1
  35. package/dist/editor/media-selector/MediaFolderBrowser.d.ts +5 -0
  36. package/dist/editor/media-selector/MediaFolderBrowser.js +77 -0
  37. package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -0
  38. package/dist/editor/media-selector/MediaSelector.js +1 -1
  39. package/dist/editor/media-selector/MediaSelector.js.map +1 -1
  40. package/dist/editor/media-selector/Thumbnails.js +2 -2
  41. package/dist/editor/media-selector/index.d.ts +8 -0
  42. package/dist/editor/media-selector/index.js +9 -0
  43. package/dist/editor/media-selector/index.js.map +1 -0
  44. package/dist/editor/menubar/BrowseHistory.js +3 -4
  45. package/dist/editor/menubar/BrowseHistory.js.map +1 -1
  46. package/dist/editor/menubar/PageSelector.js +62 -10
  47. package/dist/editor/menubar/PageSelector.js.map +1 -1
  48. package/dist/editor/page-editor-chrome/FieldActionIndicator.js +1 -1
  49. package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
  50. package/dist/editor/page-editor-chrome/useInlineAICompletion.js +37 -11
  51. package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
  52. package/dist/editor/page-viewer/PageViewerFrame.js +98 -2
  53. package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
  54. package/dist/editor/pageModel.d.ts +14 -0
  55. package/dist/editor/reviews/Comment.js +3 -2
  56. package/dist/editor/reviews/Comment.js.map +1 -1
  57. package/dist/editor/services/aiService.js +0 -1
  58. package/dist/editor/services/aiService.js.map +1 -1
  59. package/dist/editor/services/editService.d.ts +1 -1
  60. package/dist/editor/services/editService.js +2 -1
  61. package/dist/editor/services/editService.js.map +1 -1
  62. package/dist/editor/sidebar/ComponentTree.js +3 -4
  63. package/dist/editor/sidebar/ComponentTree.js.map +1 -1
  64. package/dist/editor/ui/Icons.js +1 -1
  65. package/dist/editor/ui/Icons.js.map +1 -1
  66. package/dist/editor/ui/ItemList.d.ts +16 -0
  67. package/dist/editor/ui/ItemList.js +19 -0
  68. package/dist/editor/ui/ItemList.js.map +1 -0
  69. package/dist/editor/ui/ItemSearch.js +2 -12
  70. package/dist/editor/ui/ItemSearch.js.map +1 -1
  71. package/dist/editor/ui/SimpleTabs.d.ts +1 -0
  72. package/dist/editor/ui/SimpleTabs.js +3 -3
  73. package/dist/editor/ui/SimpleTabs.js.map +1 -1
  74. package/dist/editor/ui/Splitter.js +61 -6
  75. package/dist/editor/ui/Splitter.js.map +1 -1
  76. package/dist/editor/views/MediaFolderEditView.d.ts +4 -0
  77. package/dist/editor/views/MediaFolderEditView.js +40 -0
  78. package/dist/editor/views/MediaFolderEditView.js.map +1 -0
  79. package/dist/editor/views/SingleEditView.js +9 -1
  80. package/dist/editor/views/SingleEditView.js.map +1 -1
  81. package/dist/revision.d.ts +2 -2
  82. package/dist/revision.js +2 -2
  83. package/dist/styles.css +64 -13
  84. package/package.json +8 -2
  85. package/.prettierrc +0 -3
  86. package/build.css +0 -3
  87. package/components.json +0 -21
  88. package/eslint.config.mjs +0 -4
  89. package/images/bg-shape-black.webp +0 -0
  90. package/images/wizard-bg.png +0 -0
  91. package/images/wizard-tour.png +0 -0
  92. package/images/wizard.png +0 -0
  93. package/src/client-components/api.ts +0 -6
  94. package/src/client-components/index.ts +0 -19
  95. package/src/components/ActionButton.tsx +0 -41
  96. package/src/components/Error.tsx +0 -57
  97. package/src/components/ui/CardConnector.tsx +0 -56
  98. package/src/components/ui/button.tsx +0 -62
  99. package/src/components/ui/card.tsx +0 -372
  100. package/src/components/ui/context-menu.tsx +0 -250
  101. package/src/config/config.tsx +0 -917
  102. package/src/config/types.ts +0 -286
  103. package/src/editor/ComponentInfo.tsx +0 -90
  104. package/src/editor/ConfirmationDialog.tsx +0 -103
  105. package/src/editor/ContentTree.tsx +0 -727
  106. package/src/editor/ContextMenu.tsx +0 -212
  107. package/src/editor/Editor.tsx +0 -90
  108. package/src/editor/EditorWarning.tsx +0 -34
  109. package/src/editor/EditorWarnings.tsx +0 -33
  110. package/src/editor/FieldEditorPopup.tsx +0 -65
  111. package/src/editor/FieldHistory.tsx +0 -74
  112. package/src/editor/FieldList.tsx +0 -190
  113. package/src/editor/FieldListField.tsx +0 -391
  114. package/src/editor/FieldListFieldWithFallbacks.tsx +0 -217
  115. package/src/editor/FloatingToolbar.tsx +0 -163
  116. package/src/editor/ImageEditor.tsx +0 -128
  117. package/src/editor/ItemInfo.tsx +0 -90
  118. package/src/editor/LinkEditorDialog.tsx +0 -196
  119. package/src/editor/MainLayout.tsx +0 -95
  120. package/src/editor/MobileLayout.tsx +0 -68
  121. package/src/editor/NewEditorClient.tsx +0 -11
  122. package/src/editor/PictureCropper.tsx +0 -503
  123. package/src/editor/PictureEditor.tsx +0 -212
  124. package/src/editor/PictureEditorDialog.tsx +0 -381
  125. package/src/editor/PublishDialog.ignore +0 -74
  126. package/src/editor/ScrollingContentTree.tsx +0 -67
  127. package/src/editor/Terminal.tsx +0 -227
  128. package/src/editor/Titlebar.tsx +0 -93
  129. package/src/editor/ai/AiPopup.tsx +0 -59
  130. package/src/editor/ai/AiResponseMessage.tsx +0 -106
  131. package/src/editor/ai/AiTerminal.tsx +0 -514
  132. package/src/editor/ai/AiToolCall.tsx +0 -61
  133. package/src/editor/ai/EditorAiTerminal.tsx +0 -20
  134. package/src/editor/ai/GhostWriter.tsx +0 -432
  135. package/src/editor/ai/aiPageModel.ts +0 -108
  136. package/src/editor/ai/editorAiContext.ts +0 -18
  137. package/src/editor/client/AboutDialog.tsx +0 -44
  138. package/src/editor/client/EditorClient.tsx +0 -2197
  139. package/src/editor/client/GenericDialog.tsx +0 -50
  140. package/src/editor/client/editContext.ts +0 -412
  141. package/src/editor/client/helpers.ts +0 -44
  142. package/src/editor/client/itemsRepository.ts +0 -538
  143. package/src/editor/client/operations.ts +0 -768
  144. package/src/editor/client/pageModelBuilder.ts +0 -219
  145. package/src/editor/commands/commands.ts +0 -22
  146. package/src/editor/commands/componentCommands.tsx +0 -424
  147. package/src/editor/commands/createVersionCommand.ts +0 -33
  148. package/src/editor/commands/deleteVersionCommand.ts +0 -71
  149. package/src/editor/commands/itemCommands.tsx +0 -351
  150. package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +0 -201
  151. package/src/editor/commands/localizeItem/LocalizeItemUtils.ts +0 -27
  152. package/src/editor/commands/undo.ts +0 -39
  153. package/src/editor/component-designer/ComponentDesigner.tsx +0 -70
  154. package/src/editor/component-designer/ComponentDesignerAiTerminal.tsx +0 -11
  155. package/src/editor/component-designer/ComponentDesignerMenu.tsx +0 -91
  156. package/src/editor/component-designer/ComponentEditor.tsx +0 -97
  157. package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +0 -31
  158. package/src/editor/component-designer/ComponentRenderingEditor.tsx +0 -104
  159. package/src/editor/component-designer/ComponentsDropdown.tsx +0 -39
  160. package/src/editor/component-designer/PlaceholdersEditor.tsx +0 -179
  161. package/src/editor/component-designer/RenderingsDropdown.tsx +0 -36
  162. package/src/editor/component-designer/TemplateEditor.tsx +0 -236
  163. package/src/editor/component-designer/aiContext.ts +0 -23
  164. package/src/editor/componentTreeHelper.tsx +0 -116
  165. package/src/editor/context-menu/CopyMoveMenu.tsx +0 -103
  166. package/src/editor/context-menu/InsertMenu.tsx +0 -347
  167. package/src/editor/control-center/About.tsx +0 -342
  168. package/src/editor/control-center/ControlCenterMenu.tsx +0 -76
  169. package/src/editor/control-center/IndexOverview.tsx +0 -50
  170. package/src/editor/control-center/IndexSettings.tsx +0 -266
  171. package/src/editor/control-center/Info.tsx +0 -104
  172. package/src/editor/control-center/QuotaInfo.tsx +0 -301
  173. package/src/editor/control-center/Status.tsx +0 -113
  174. package/src/editor/control-center/WebSocketMessages.tsx +0 -155
  175. package/src/editor/editor-warnings/ItemLocked.tsx +0 -63
  176. package/src/editor/editor-warnings/NoLanguageWriteAccess.tsx +0 -22
  177. package/src/editor/editor-warnings/NoWorkflowWriteAccess.tsx +0 -23
  178. package/src/editor/editor-warnings/NoWriteAccess.tsx +0 -16
  179. package/src/editor/editor-warnings/ValidationErrors.tsx +0 -54
  180. package/src/editor/field-types/AttachmentEditor.tsx +0 -9
  181. package/src/editor/field-types/CheckboxEditor.tsx +0 -47
  182. package/src/editor/field-types/DropLinkEditor.tsx +0 -80
  183. package/src/editor/field-types/DropListEditor.tsx +0 -84
  184. package/src/editor/field-types/ImageFieldEditor.tsx +0 -65
  185. package/src/editor/field-types/InternalLinkFieldEditor.tsx +0 -117
  186. package/src/editor/field-types/LinkFieldEditor.tsx +0 -85
  187. package/src/editor/field-types/MultiLineText.tsx +0 -82
  188. package/src/editor/field-types/PictureFieldEditor.tsx +0 -121
  189. package/src/editor/field-types/RawEditor.tsx +0 -53
  190. package/src/editor/field-types/ReactQuill.tsx +0 -580
  191. package/src/editor/field-types/RichTextEditor.tsx +0 -22
  192. package/src/editor/field-types/RichTextEditorComponent.tsx +0 -127
  193. package/src/editor/field-types/SingleLineText.tsx +0 -174
  194. package/src/editor/field-types/TreeListEditor.tsx +0 -261
  195. package/src/editor/fieldTypes.ts +0 -140
  196. package/src/editor/media-selector/AiImageSearch.tsx +0 -185
  197. package/src/editor/media-selector/AiImageSearchPrompt.tsx +0 -94
  198. package/src/editor/media-selector/MediaSelector.tsx +0 -42
  199. package/src/editor/media-selector/Preview.tsx +0 -14
  200. package/src/editor/media-selector/Thumbnails.tsx +0 -48
  201. package/src/editor/media-selector/TreeSelector.tsx +0 -292
  202. package/src/editor/media-selector/UploadZone.tsx +0 -137
  203. package/src/editor/menubar/ActionsMenu.tsx +0 -94
  204. package/src/editor/menubar/ActiveUsers.tsx +0 -17
  205. package/src/editor/menubar/ApproveAndPublish.tsx +0 -18
  206. package/src/editor/menubar/BrowseHistory.tsx +0 -37
  207. package/src/editor/menubar/ItemLanguageVersion.tsx +0 -76
  208. package/src/editor/menubar/LanguageSelector.tsx +0 -226
  209. package/src/editor/menubar/Menu.tsx +0 -83
  210. package/src/editor/menubar/NavButtons.tsx +0 -74
  211. package/src/editor/menubar/PageSelector.tsx +0 -141
  212. package/src/editor/menubar/PageViewerControls.tsx +0 -120
  213. package/src/editor/menubar/PreviewSecondaryControls.tsx +0 -18
  214. package/src/editor/menubar/SecondaryControls.tsx +0 -45
  215. package/src/editor/menubar/Separator.tsx +0 -12
  216. package/src/editor/menubar/SiteInfo.tsx +0 -53
  217. package/src/editor/menubar/User.tsx +0 -27
  218. package/src/editor/menubar/VersionSelector.tsx +0 -142
  219. package/src/editor/page-editor-chrome/CommentHighlighting.tsx +0 -307
  220. package/src/editor/page-editor-chrome/CommentHighlightings.tsx +0 -35
  221. package/src/editor/page-editor-chrome/FieldActionIndicator.tsx +0 -59
  222. package/src/editor/page-editor-chrome/FieldActionIndicators.tsx +0 -23
  223. package/src/editor/page-editor-chrome/FieldEditedIndicator.tsx +0 -64
  224. package/src/editor/page-editor-chrome/FieldEditedIndicators.tsx +0 -35
  225. package/src/editor/page-editor-chrome/FrameMenu.tsx +0 -338
  226. package/src/editor/page-editor-chrome/FrameMenus.tsx +0 -48
  227. package/src/editor/page-editor-chrome/InlineEditor.tsx +0 -765
  228. package/src/editor/page-editor-chrome/LockedFieldIndicator.tsx +0 -61
  229. package/src/editor/page-editor-chrome/NoLayout.tsx +0 -36
  230. package/src/editor/page-editor-chrome/PageEditorChrome.tsx +0 -122
  231. package/src/editor/page-editor-chrome/PictureEditorOverlay.tsx +0 -161
  232. package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +0 -169
  233. package/src/editor/page-editor-chrome/PlaceholderDropZones.tsx +0 -315
  234. package/src/editor/page-editor-chrome/SuggestionHighlighting.tsx +0 -300
  235. package/src/editor/page-editor-chrome/SuggestionHighlightings.tsx +0 -40
  236. package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +0 -791
  237. package/src/editor/page-viewer/DeviceToolbar.tsx +0 -70
  238. package/src/editor/page-viewer/EditorForm.tsx +0 -258
  239. package/src/editor/page-viewer/MiniMap.tsx +0 -362
  240. package/src/editor/page-viewer/PageViewer.tsx +0 -169
  241. package/src/editor/page-viewer/PageViewerFrame.tsx +0 -879
  242. package/src/editor/page-viewer/pageModelSkeletonBuilder.ts +0 -412
  243. package/src/editor/page-viewer/pageViewContext.ts +0 -186
  244. package/src/editor/pageModel.ts +0 -208
  245. package/src/editor/picture-shared.tsx +0 -53
  246. package/src/editor/reviews/Comment.tsx +0 -308
  247. package/src/editor/reviews/Comments.tsx +0 -125
  248. package/src/editor/reviews/DiffView.tsx +0 -109
  249. package/src/editor/reviews/PreviewInfo.tsx +0 -35
  250. package/src/editor/reviews/Reviews.tsx +0 -280
  251. package/src/editor/reviews/SuggestedEdit.tsx +0 -316
  252. package/src/editor/reviews/reviewCommands.tsx +0 -47
  253. package/src/editor/reviews/useReviews.tsx +0 -70
  254. package/src/editor/services/aiService.ts +0 -174
  255. package/src/editor/services/componentDesignerService.ts +0 -151
  256. package/src/editor/services/contentService.ts +0 -180
  257. package/src/editor/services/editService.ts +0 -486
  258. package/src/editor/services/indexService.ts +0 -24
  259. package/src/editor/services/reviewsService.ts +0 -53
  260. package/src/editor/services/serviceHelper.ts +0 -95
  261. package/src/editor/services/suggestedEditsService.ts +0 -39
  262. package/src/editor/services/systemService.ts +0 -5
  263. package/src/editor/services/translationService.ts +0 -21
  264. package/src/editor/services-server/api.ts +0 -150
  265. package/src/editor/services-server/graphQL.ts +0 -106
  266. package/src/editor/sidebar/ComponentPalette.tsx +0 -161
  267. package/src/editor/sidebar/ComponentTree.tsx +0 -548
  268. package/src/editor/sidebar/ComponentTree2.tsxx +0 -490
  269. package/src/editor/sidebar/Debug.tsx +0 -111
  270. package/src/editor/sidebar/DictionaryEditor.tsx +0 -261
  271. package/src/editor/sidebar/EditHistory.tsx +0 -134
  272. package/src/editor/sidebar/GraphQL.tsx +0 -164
  273. package/src/editor/sidebar/Insert.tsx +0 -35
  274. package/src/editor/sidebar/MainContentTree.tsx +0 -102
  275. package/src/editor/sidebar/Performance.tsx +0 -53
  276. package/src/editor/sidebar/Sessions.tsx +0 -35
  277. package/src/editor/sidebar/Sidebar.tsx +0 -20
  278. package/src/editor/sidebar/SidebarView.tsx +0 -152
  279. package/src/editor/sidebar/Translations.tsx +0 -295
  280. package/src/editor/sidebar/Validation.tsx +0 -102
  281. package/src/editor/sidebar/ViewSelector.tsx +0 -60
  282. package/src/editor/sidebar/Workbox.tsx +0 -209
  283. package/src/editor/ui/CenteredMessage.tsx +0 -7
  284. package/src/editor/ui/CopyMoveTargetSelectorDialog.tsx +0 -81
  285. package/src/editor/ui/CopyToClipboardButton.tsx +0 -24
  286. package/src/editor/ui/DialogButtons.tsx +0 -11
  287. package/src/editor/ui/Icons.tsx +0 -708
  288. package/src/editor/ui/ItemNameDialogNew.tsx +0 -118
  289. package/src/editor/ui/ItemSearch.tsx +0 -190
  290. package/src/editor/ui/PerfectTree.tsx +0 -571
  291. package/src/editor/ui/Section.tsx +0 -35
  292. package/src/editor/ui/SimpleIconButton.tsx +0 -54
  293. package/src/editor/ui/SimpleMenu.tsx +0 -40
  294. package/src/editor/ui/SimpleTable.tsx +0 -60
  295. package/src/editor/ui/SimpleTabs.tsx +0 -55
  296. package/src/editor/ui/SimpleToolbar.tsx +0 -7
  297. package/src/editor/ui/Spinner.tsx +0 -9
  298. package/src/editor/ui/Splitter.tsx +0 -314
  299. package/src/editor/ui/StackedPanels.tsx +0 -134
  300. package/src/editor/ui/Toolbar.tsx +0 -7
  301. package/src/editor/utils/id-helper.ts +0 -3
  302. package/src/editor/utils/insertOptions.ts +0 -69
  303. package/src/editor/utils/itemutils.ts +0 -29
  304. package/src/editor/utils/useMemoDebug.ts +0 -28
  305. package/src/editor/utils.ts +0 -486
  306. package/src/editor/views/CompareView.tsx +0 -245
  307. package/src/editor/views/EditView.tsx +0 -27
  308. package/src/editor/views/ItemEditor.tsx +0 -58
  309. package/src/editor/views/SingleEditView.tsx +0 -46
  310. package/src/fonts/Geist-Black.woff2 +0 -0
  311. package/src/fonts/Geist-Bold.woff2 +0 -0
  312. package/src/fonts/Geist-ExtraBold.woff2 +0 -0
  313. package/src/fonts/Geist-ExtraLight.woff2 +0 -0
  314. package/src/fonts/Geist-Light.woff2 +0 -0
  315. package/src/fonts/Geist-Medium.woff2 +0 -0
  316. package/src/fonts/Geist-Regular.woff2 +0 -0
  317. package/src/fonts/Geist-SemiBold.woff2 +0 -0
  318. package/src/fonts/Geist-Thin.woff2 +0 -0
  319. package/src/fonts/Geist[wght].woff2 +0 -0
  320. package/src/fonts/index.ts +0 -10
  321. package/src/index.ts +0 -23
  322. package/src/lib/safelist.tsx +0 -16
  323. package/src/lib/utils.ts +0 -6
  324. package/src/page-wizard/PageWizard.tsx +0 -139
  325. package/src/page-wizard/WizardBox.tsx +0 -4
  326. package/src/page-wizard/WizardBoxConnector.tsx +0 -56
  327. package/src/page-wizard/WizardSteps.tsx +0 -458
  328. package/src/page-wizard/service.ts +0 -35
  329. package/src/page-wizard/startPageWizardCommand.ts +0 -26
  330. package/src/page-wizard/steps/BuildPageStep.tsx +0 -259
  331. package/src/page-wizard/steps/CollectStep.tsx +0 -296
  332. package/src/page-wizard/steps/ComponentTypesSelector.tsx +0 -454
  333. package/src/page-wizard/steps/Components.tsx +0 -193
  334. package/src/page-wizard/steps/ContentStep.tsx +0 -890
  335. package/src/page-wizard/steps/EditButton.tsx +0 -34
  336. package/src/page-wizard/steps/FieldEditor.tsx +0 -102
  337. package/src/page-wizard/steps/Generate.tsx +0 -60
  338. package/src/page-wizard/steps/ImagesStep.tsx +0 -382
  339. package/src/page-wizard/steps/LayoutStep.tsx +0 -227
  340. package/src/page-wizard/steps/MetaDataStep.tsx +0 -173
  341. package/src/page-wizard/steps/SelectStep.tsx +0 -281
  342. package/src/page-wizard/steps/schema.ts +0 -180
  343. package/src/page-wizard/steps/usePageCreator.ts +0 -325
  344. package/src/page-wizard/usePageWizard.ts +0 -79
  345. package/src/revision.ts +0 -2
  346. package/src/splash-screen/NewPage.tsx +0 -294
  347. package/src/splash-screen/OpenPage.tsx +0 -113
  348. package/src/splash-screen/RecentPages.tsx +0 -123
  349. package/src/splash-screen/SectionHeadline.tsx +0 -21
  350. package/src/splash-screen/SplashScreen.tsx +0 -195
  351. package/src/tour/Tour.tsx +0 -566
  352. package/src/tour/default-tour.tsx +0 -301
  353. package/src/tour/preview-tour.tsx +0 -128
  354. package/src/types.ts +0 -335
  355. package/styles.css +0 -765
  356. package/tsconfig.build.json +0 -31
  357. package/tsconfig.json +0 -14
@@ -1,580 +0,0 @@
1
- /*
2
- React-Quill
3
- https://github.com/zenoamaro/react-quill
4
- */
5
-
6
- import React from "react";
7
- import isEqual from "lodash/isEqual";
8
-
9
- import Quill, {
10
- type EmitterSource,
11
- type Range as RangeStatic,
12
- QuillOptions as QuillOptionsStatic,
13
- } from "quill";
14
- import type DeltaStatic from "quill-delta";
15
-
16
- // Merged namespace hack to export types along with default object
17
- // See: https://github.com/Microsoft/TypeScript/issues/2719
18
- namespace ReactQuill {
19
- export type Value = string | DeltaStatic;
20
- export type Range = RangeStatic | null;
21
-
22
- export interface QuillOptions extends QuillOptionsStatic {
23
- scrollingContainer?: HTMLElement | string | undefined;
24
- strict?: boolean | undefined;
25
- tabIndex?: number;
26
- }
27
-
28
- export interface ReactQuillProps {
29
- bounds?: string | HTMLElement;
30
- children?: React.ReactElement<any>;
31
- className?: string;
32
- defaultValue?: Value;
33
- formats?: string[];
34
- id?: string;
35
- modules?: QuillOptions["modules"];
36
- onChange?(
37
- value: string,
38
- delta: DeltaStatic,
39
- source: EmitterSource,
40
- editor: UnprivilegedEditor
41
- ): void;
42
- onChangeSelection?(
43
- selection: Range,
44
- source: EmitterSource,
45
- editor: UnprivilegedEditor
46
- ): void;
47
- onFocus?(
48
- selection: Range,
49
- source: EmitterSource,
50
- editor: UnprivilegedEditor
51
- ): void;
52
- onBlur?(
53
- previousSelection: Range,
54
- source: EmitterSource,
55
- editor: UnprivilegedEditor
56
- ): void;
57
- onKeyDown?: React.EventHandler<any>;
58
- onKeyPress?: React.EventHandler<any>;
59
- onKeyUp?: React.EventHandler<any>;
60
- placeholder?: string;
61
- preserveWhitespace?: boolean;
62
- readOnly?: boolean;
63
- scrollingContainer?: string | HTMLElement;
64
- style?: React.CSSProperties;
65
- tabIndex?: number;
66
- theme?: string;
67
- value?: Value;
68
- }
69
-
70
- export interface UnprivilegedEditor {
71
- getLength: Quill["getLength"];
72
- getText: Quill["getText"];
73
- getHTML: Quill["getSemanticHTML"];
74
- getBounds: Quill["getBounds"];
75
- getSelection: Quill["getSelection"];
76
- getContents: Quill["getContents"];
77
- }
78
- }
79
-
80
- // Re-import everything from namespace into scope for comfort
81
- import Value = ReactQuill.Value;
82
- import Range = ReactQuill.Range;
83
- import QuillOptions = ReactQuill.QuillOptions;
84
- import ReactQuillProps = ReactQuill.ReactQuillProps;
85
- import UnprivilegedEditor = ReactQuill.UnprivilegedEditor;
86
-
87
- interface ReactQuillState {
88
- generation: number;
89
- }
90
-
91
- export class ReactQuill extends React.Component<
92
- ReactQuillProps,
93
- ReactQuillState
94
- > {
95
- static displayName = "React Quill";
96
-
97
- /*
98
- Export Quill to be able to call `register`
99
- */
100
- static Quill = Quill;
101
-
102
- /*
103
- Changing one of these props should cause a full re-render and a
104
- re-instantiation of the Quill editor.
105
- */
106
- dirtyProps: (keyof ReactQuillProps)[] = [
107
- "modules",
108
- "formats",
109
- "bounds",
110
- "theme",
111
- "children",
112
- ];
113
-
114
- /*
115
- Changing one of these props should cause a regular update. These are mostly
116
- props that act on the container, rather than the quillized editing area.
117
- */
118
- cleanProps: (keyof ReactQuillProps)[] = [
119
- "id",
120
- "className",
121
- "style",
122
- "placeholder",
123
- "tabIndex",
124
- "onChange",
125
- "onChangeSelection",
126
- "onFocus",
127
- "onBlur",
128
- "onKeyPress",
129
- "onKeyDown",
130
- "onKeyUp",
131
- ];
132
-
133
- static defaultProps = {
134
- theme: "snow",
135
- modules: {},
136
- readOnly: false,
137
- };
138
-
139
- state: ReactQuillState = {
140
- generation: 0,
141
- };
142
-
143
- /*
144
- The Quill Editor instance.
145
- */
146
- editor?: Quill;
147
-
148
- /*
149
- Reference to the element holding the Quill editing area.
150
- */
151
- editingArea?: React.ReactInstance | null;
152
-
153
- /*
154
- Tracks the internal value of the Quill editor
155
- */
156
- value: Value;
157
-
158
- /*
159
- Tracks the internal selection of the Quill editor
160
- */
161
- selection: Range = null;
162
-
163
- /*
164
- Used to compare whether deltas from `onChange` are being used as `value`.
165
- */
166
- lastDeltaChangeSet?: DeltaStatic;
167
-
168
- /*
169
- Stores the contents of the editor to be restored after regeneration.
170
- */
171
- regenerationSnapshot?: {
172
- delta: DeltaStatic;
173
- selection: Range;
174
- };
175
-
176
- /*
177
- A weaker, unprivileged proxy for the editor that does not allow accidentally
178
- modifying editor state.
179
- */
180
- unprivilegedEditor?: UnprivilegedEditor;
181
-
182
- private editingAreaRef = React.createRef<HTMLDivElement | HTMLPreElement>();
183
-
184
- constructor(props: ReactQuillProps) {
185
- super(props);
186
- const value = this.isControlled() ? props.value : props.defaultValue;
187
- this.value = value ?? "";
188
- }
189
-
190
- validateProps(props: ReactQuillProps): void {
191
- if (React.Children.count(props.children) > 1)
192
- throw new Error(
193
- "The Quill editing area can only be composed of a single React element."
194
- );
195
-
196
- if (React.Children.count(props.children)) {
197
- const child = React.Children.only(props.children);
198
- if (child?.type === "textarea")
199
- throw new Error(
200
- "Quill does not support editing on a <textarea>. Use a <div> instead."
201
- );
202
- }
203
-
204
- if (this.lastDeltaChangeSet && props.value === this.lastDeltaChangeSet)
205
- throw new Error(
206
- "You are passing the `delta` object from the `onChange` event back " +
207
- "as `value`. You most probably want `editor.getContents()` instead. " +
208
- "See: https://github.com/zenoamaro/react-quill#using-deltas"
209
- );
210
- }
211
-
212
- shouldComponentUpdate(
213
- nextProps: ReactQuillProps,
214
- nextState: ReactQuillState
215
- ) {
216
- this.validateProps(nextProps);
217
-
218
- // If the editor hasn't been instantiated yet, or the component has been
219
- // regenerated, we already know we should update.
220
- if (!this.editor || this.state.generation !== nextState.generation) {
221
- return true;
222
- }
223
-
224
- // Handle value changes in-place
225
- if ("value" in nextProps) {
226
- const prevContents = this.getEditorContents();
227
- const nextContents = nextProps.value ?? "";
228
-
229
- // NOTE: Seeing that Quill is missing a way to prevent edits, we have to
230
- // settle for a hybrid between controlled and uncontrolled mode. We
231
- // can't prevent the change, but we'll still override content
232
- // whenever `value` differs from current state.
233
- // NOTE: Comparing an HTML string and a Quill Delta will always trigger a
234
- // change, regardless of whether they represent the same document.
235
- if (!this.isEqualValue(nextContents, prevContents)) {
236
- this.setEditorContents(this.editor, nextContents);
237
- }
238
- }
239
-
240
- // Handle read-only changes in-place
241
- if (nextProps.readOnly !== this.props.readOnly) {
242
- this.setEditorReadOnly(this.editor, nextProps.readOnly!);
243
- }
244
-
245
- // Clean and Dirty props require a render
246
- return [...this.cleanProps, ...this.dirtyProps].some((prop) => {
247
- return !isEqual(nextProps[prop], this.props[prop]);
248
- });
249
- }
250
-
251
- shouldComponentRegenerate(nextProps: ReactQuillProps): boolean {
252
- // Whenever a `dirtyProp` changes, the editor needs reinstantiation.
253
- return this.dirtyProps.some((prop) => {
254
- return !isEqual(nextProps[prop], this.props[prop]);
255
- });
256
- }
257
-
258
- componentDidMount() {
259
- this.instantiateEditor();
260
- this.setEditorContents(this.editor!, this.getEditorContents());
261
- }
262
-
263
- componentWillUnmount() {
264
- this.destroyEditor();
265
- }
266
-
267
- componentDidUpdate(prevProps: ReactQuillProps, prevState: ReactQuillState) {
268
- // If we're changing one of the `dirtyProps`, the entire Quill Editor needs
269
- // to be re-instantiated. Regenerating the editor will cause the whole tree,
270
- // including the container, to be cleaned up and re-rendered from scratch.
271
- // Store the contents so they can be restored later.
272
- if (this.editor && this.shouldComponentRegenerate(prevProps)) {
273
- const delta = this.editor.getContents();
274
- const selection = this.editor.getSelection();
275
- this.regenerationSnapshot = { delta, selection };
276
- this.setState({ generation: this.state.generation + 1 });
277
- this.destroyEditor();
278
- }
279
-
280
- // The component has been regenerated, so it must be re-instantiated, and
281
- // its content must be restored to the previous values from the snapshot.
282
- if (this.state.generation !== prevState.generation) {
283
- const { delta, selection } = this.regenerationSnapshot!;
284
- delete this.regenerationSnapshot;
285
- this.instantiateEditor();
286
- const editor = this.editor!;
287
- editor.setContents(delta);
288
- postpone(() => this.setEditorSelection(editor, selection));
289
- }
290
- }
291
-
292
- instantiateEditor(): void {
293
- if (this.editor) {
294
- this.hookEditor(this.editor);
295
- } else {
296
- this.editor = this.createEditor(
297
- this.getEditingArea(),
298
- this.getEditorConfig()
299
- );
300
- }
301
- }
302
-
303
- destroyEditor(): void {
304
- if (!this.editor) return;
305
- this.unhookEditor(this.editor);
306
- }
307
-
308
- /*
309
- We consider the component to be controlled if `value` is being sent in props.
310
- */
311
- isControlled(): boolean {
312
- return "value" in this.props;
313
- }
314
-
315
- getEditorConfig(): QuillOptions {
316
- return {
317
- bounds: this.props.bounds,
318
- formats: this.props.formats,
319
- modules: this.props.modules,
320
- placeholder: this.props.placeholder,
321
- readOnly: this.props.readOnly,
322
- scrollingContainer: this.props.scrollingContainer,
323
- tabIndex: this.props.tabIndex,
324
- theme: this.props.theme,
325
- };
326
- }
327
-
328
- getEditor(): Quill {
329
- if (!this.editor) throw new Error("Accessing non-instantiated editor");
330
- return this.editor;
331
- }
332
-
333
- /**
334
- Creates an editor on the given element. The editor will be passed the
335
- configuration, have its events bound,
336
- */
337
- createEditor(element: HTMLElement, config: QuillOptions) {
338
- const editor = new Quill(element, config);
339
- if (config.tabIndex != null) {
340
- this.setEditorTabIndex(editor, config.tabIndex);
341
- }
342
- this.hookEditor(editor);
343
- return editor;
344
- }
345
-
346
- hookEditor(editor: Quill) {
347
- // Expose the editor on change events via a weaker, unprivileged proxy
348
- // object that does not allow accidentally modifying editor state.
349
- this.unprivilegedEditor = this.makeUnprivilegedEditor(editor);
350
- // Using `editor-change` allows picking up silent updates, like selection
351
- // changes on typing.
352
- editor.on("editor-change", this.onEditorChange);
353
- }
354
-
355
- unhookEditor(editor: Quill) {
356
- editor.off("editor-change", this.onEditorChange);
357
- }
358
-
359
- getEditorContents(): Value {
360
- return this.value;
361
- }
362
-
363
- getEditorSelection(): Range {
364
- return this.selection;
365
- }
366
-
367
- /*
368
- True if the value is a Delta instance or a Delta look-alike.
369
- */
370
- isDelta(value: any): boolean {
371
- return value && value.ops;
372
- }
373
-
374
- /*
375
- Special comparison function that knows how to compare Deltas.
376
- */
377
- isEqualValue(value: any, nextValue: any): boolean {
378
- if (this.isDelta(value) && this.isDelta(nextValue)) {
379
- return isEqual(value.ops, nextValue.ops);
380
- } else {
381
- return isEqual(value, nextValue);
382
- }
383
- }
384
-
385
- /*
386
- Replace the contents of the editor, but keep the previous selection hanging
387
- around so that the cursor won't move.
388
- */
389
- setEditorContents(editor: Quill, value: Value) {
390
- this.value = value;
391
-
392
- //const sel = this.getEditorSelection();
393
- if (typeof value === "string") {
394
- editor.setContents(editor.clipboard.convert({ html: value }));
395
- } else {
396
- editor.setContents(value);
397
- }
398
- // THIS STEALS FOCUS!
399
- // postpone(() => this.setEditorSelection(editor, sel));
400
- }
401
-
402
- setEditorSelection(editor: Quill, range: Range) {
403
- this.selection = range;
404
- if (range) {
405
- // Validate bounds before applying.
406
- const length = editor.getLength();
407
- range.index = Math.max(0, Math.min(range.index, length - 1));
408
- range.length = Math.max(
409
- 0,
410
- Math.min(range.length, length - 1 - range.index)
411
- );
412
- editor.setSelection(range);
413
- }
414
- }
415
-
416
- setEditorTabIndex(editor: Quill, tabIndex: number) {
417
- if (editor?.scroll?.domNode) {
418
- (editor.scroll.domNode as HTMLElement).tabIndex = tabIndex;
419
- }
420
- }
421
-
422
- setEditorReadOnly(editor: Quill, value: boolean) {
423
- if (value) {
424
- editor.disable();
425
- } else {
426
- editor.enable();
427
- }
428
- }
429
-
430
- /*
431
- Returns a weaker, unprivileged proxy object that only exposes read-only
432
- accessors found on the editor instance, without any state-modifying methods.
433
- */
434
- makeUnprivilegedEditor(editor: Quill) {
435
- const e = editor;
436
- return {
437
- getHTML: () => e.root.innerHTML,
438
- getLength: e.getLength.bind(e),
439
- getText: e.getText.bind(e),
440
- getContents: e.getContents.bind(e),
441
- getSelection: e.getSelection.bind(e),
442
- getBounds: e.getBounds.bind(e),
443
- };
444
- }
445
-
446
- getEditingArea(): HTMLElement {
447
- if (!this.editingAreaRef.current) {
448
- throw new Error("Editing area is not available");
449
- }
450
- return this.editingAreaRef.current;
451
- }
452
-
453
- /*
454
- Renders an editor area, unless it has been provided one to clone.
455
- */
456
- renderEditingArea(): React.ReactNode {
457
- const { children, preserveWhitespace } = this.props;
458
- const { generation } = this.state;
459
-
460
- if (React.Children.count(children)) {
461
- return React.cloneElement(React.Children.only(children)!, {
462
- ref: this.editingAreaRef,
463
- });
464
- }
465
-
466
- return preserveWhitespace ? (
467
- <pre
468
- ref={this.editingAreaRef as React.LegacyRef<HTMLPreElement>}
469
- key={generation}
470
- />
471
- ) : (
472
- <div
473
- ref={this.editingAreaRef as React.LegacyRef<HTMLDivElement>}
474
- key={generation}
475
- />
476
- );
477
- }
478
-
479
- render() {
480
- return (
481
- <div
482
- id={this.props.id}
483
- style={this.props.style}
484
- key={this.state.generation}
485
- className={`quill ${this.props.className ?? ""}`}
486
- onKeyPress={this.props.onKeyPress}
487
- onKeyDownCapture={this.props.onKeyDown}
488
- onKeyUp={this.props.onKeyUp}
489
- >
490
- {this.renderEditingArea()}
491
- </div>
492
- );
493
- }
494
-
495
- onEditorChange = (
496
- eventName: "text-change" | "selection-change",
497
- rangeOrDelta: Range | DeltaStatic,
498
- //oldRangeOrDelta: Range | DeltaStatic,
499
- source: EmitterSource
500
- ) => {
501
- if (eventName === "text-change") {
502
- this.onEditorChangeText?.(
503
- this.editor!.root.innerHTML,
504
- rangeOrDelta as DeltaStatic,
505
- source,
506
- this.unprivilegedEditor!
507
- );
508
- } else if (eventName === "selection-change") {
509
- this.onEditorChangeSelection?.(
510
- rangeOrDelta as RangeStatic,
511
- source,
512
- this.unprivilegedEditor!
513
- );
514
- }
515
- };
516
-
517
- onEditorChangeText(
518
- value: string,
519
- delta: DeltaStatic,
520
- source: EmitterSource,
521
- editor: UnprivilegedEditor
522
- ): void {
523
- if (!this.editor) return;
524
-
525
- // We keep storing the same type of value as what the user gives us,
526
- // so that value comparisons will be more stable and predictable.
527
- const nextContents = this.isDelta(this.value)
528
- ? editor.getContents()
529
- : editor.getHTML();
530
-
531
- if (nextContents !== this.getEditorContents()) {
532
- // Taint this `delta` object, so we can recognize whether the user
533
- // is trying to send it back as `value`, preventing a likely loop.
534
- this.lastDeltaChangeSet = delta;
535
-
536
- this.value = nextContents;
537
- this.props.onChange?.(value, delta, source, editor);
538
- }
539
- }
540
-
541
- onEditorChangeSelection(
542
- nextSelection: RangeStatic,
543
- source: EmitterSource,
544
- editor: UnprivilegedEditor
545
- ): void {
546
- if (!this.editor) return;
547
- const currentSelection = this.getEditorSelection();
548
- const hasGainedFocus = !currentSelection && nextSelection;
549
- const hasLostFocus = currentSelection && !nextSelection;
550
-
551
- if (isEqual(nextSelection, currentSelection)) return;
552
-
553
- this.selection = nextSelection;
554
- this.props.onChangeSelection?.(nextSelection, source, editor);
555
-
556
- if (hasGainedFocus) {
557
- this.props.onFocus?.(nextSelection, source, editor);
558
- } else if (hasLostFocus) {
559
- this.props.onBlur?.(currentSelection, source, editor);
560
- }
561
- }
562
-
563
- focus(): void {
564
- if (!this.editor) return;
565
- this.editor.focus();
566
- }
567
-
568
- blur(): void {
569
- if (!this.editor) return;
570
- this.selection = null;
571
- this.editor.blur();
572
- }
573
- }
574
-
575
- /*
576
- Small helper to execute a function in the next micro-tick.
577
- */
578
- function postpone(fn: (value: void) => void) {
579
- Promise.resolve().then(fn);
580
- }
@@ -1,22 +0,0 @@
1
- "use client";
2
-
3
- import dynamic from "next/dynamic";
4
- import { Field } from "../pageModel";
5
-
6
- const RichTextEditorComponent = dynamic(
7
- () =>
8
- import("./RichTextEditorComponent").then(
9
- (dnd) => dnd.RichTextEditorComponent
10
- ),
11
- { ssr: false }
12
- );
13
-
14
- export function RichTextEditor({
15
- field,
16
- readOnly,
17
- }: {
18
- field: Field;
19
- readOnly?: boolean;
20
- }) {
21
- return <RichTextEditorComponent field={field} readOnly={readOnly} />;
22
- }