@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,35 +1,29 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.InsertMenuTemplate = void 0;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const client_components_1 = require("../client-components");
9
- const react_1 = require("react");
10
- const inputtext_1 = require("primereact/inputtext");
11
- const ScrollingContentTree_1 = require("./ScrollingContentTree");
12
- const SimpleTabs_1 = require("./ui/SimpleTabs");
13
- const ItemSearch_1 = __importDefault(require("./ui/ItemSearch"));
14
- const config_1 = require("../config/config");
15
- const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
16
- const editContext = (0, client_components_1.useEditContext)();
17
- const opRef = (0, react_1.useRef)(null);
18
- const [filter, setFilter] = (0, react_1.useState)("");
19
- const filterRef = (0, react_1.useRef)(null);
20
- const [activeTab, setActiveTab] = (0, react_1.useState)(() => {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEditContext } from "../client-components";
3
+ import { useRef, useState, useEffect } from "react";
4
+ import { InputText } from "primereact/inputtext";
5
+ import { ScrollingContentTree } from "./ScrollingContentTree";
6
+ import { SimpleTabs } from "./ui/SimpleTabs";
7
+ import ItemSearch from "./ui/ItemSearch";
8
+ import { templatesRootItemId } from "../config/config";
9
+ export const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
10
+ const editContext = useEditContext();
11
+ const opRef = useRef(null);
12
+ const [filter, setFilter] = useState("");
13
+ const filterRef = useRef(null);
14
+ const [activeTab, setActiveTab] = useState(() => {
21
15
  const stored = localStorage.getItem("editor.defaultInsertTab");
22
16
  return stored ? parseInt(stored) : 0;
23
17
  });
24
- (0, react_1.useEffect)(() => {
18
+ useEffect(() => {
25
19
  localStorage.setItem("editor.defaultInsertTab", activeTab.toString());
26
20
  }, [activeTab]);
27
- const [recentTemplates, setRecentTemplates] = (0, react_1.useState)([]);
28
- const [recentItems, setRecentItems] = (0, react_1.useState)([]);
29
- const [hoveredItem, setHoveredItem] = (0, react_1.useState)();
30
- const [wizards, setWizards] = (0, react_1.useState)([]);
31
- const hideTimeoutRef = (0, react_1.useRef)(undefined);
32
- (0, react_1.useEffect)(() => {
21
+ const [recentTemplates, setRecentTemplates] = useState([]);
22
+ const [recentItems, setRecentItems] = useState([]);
23
+ const [hoveredItem, setHoveredItem] = useState();
24
+ const [wizards, setWizards] = useState([]);
25
+ const hideTimeoutRef = useRef(undefined);
26
+ useEffect(() => {
33
27
  const loadRecentItems = async () => {
34
28
  const items = await editContext?.itemsRepository.getItems(recentTemplates.map((id) => ({
35
29
  id,
@@ -41,14 +35,14 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
41
35
  };
42
36
  loadRecentItems();
43
37
  }, [recentTemplates]);
44
- (0, react_1.useEffect)(() => {
38
+ useEffect(() => {
45
39
  const stored = localStorage.getItem("editor.recentTemplates");
46
40
  if (stored) {
47
41
  const parsed = JSON.parse(stored);
48
42
  setRecentTemplates(parsed);
49
43
  }
50
44
  }, [insertOptions]);
51
- (0, react_1.useEffect)(() => {
45
+ useEffect(() => {
52
46
  const loadWizards = async () => {
53
47
  const wizards = await editContext?.configuration.pageWizard.getWizards(item.descriptor);
54
48
  setWizards(wizards ?? []);
@@ -79,37 +73,37 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
79
73
  : insertOptions.map((x) => ({
80
74
  label: x.name,
81
75
  id: x.id,
82
- icon: ((0, jsx_runtime_1.jsx)("img", { className: "p-menuitem-icon", src: x.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() })),
76
+ icon: (_jsx("img", { className: "p-menuitem-icon", src: x.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() })),
83
77
  command: getCommand(x),
84
78
  }));
85
79
  const tabs = [
86
80
  {
87
81
  label: "Options",
88
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-2 h-full", children: [(0, jsx_runtime_1.jsx)(inputtext_1.InputText, { ref: filterRef, className: "w-full", placeholder: "Filter", onChange: (e) => setFilter(e.target.value) }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 relative", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 overflow-auto", children: options
82
+ content: (_jsxs("div", { className: "flex flex-col gap-2 h-full", children: [_jsx(InputText, { ref: filterRef, className: "w-full", placeholder: "Filter", onChange: (e) => setFilter(e.target.value) }), _jsx("div", { className: "flex-1 relative", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: options
89
83
  ?.filter((x) => x.label.toLowerCase().indexOf(filter.toLowerCase()) > -1)
90
- .map((option) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
84
+ .map((option) => (_jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
91
85
  ev.stopPropagation();
92
86
  ev.preventDefault();
93
87
  option.command(ev);
94
- }, children: [option.icon, (0, jsx_runtime_1.jsx)("span", { className: "flex-1", children: option.label
88
+ }, children: [option.icon, _jsx("span", { className: "flex-1", children: option.label
95
89
  .split(new RegExp(`(${filter})`, "i"))
96
- .map((part, i) => part.toLowerCase() === filter.toLowerCase() ? ((0, jsx_runtime_1.jsx)("u", { className: "font-bold", children: part }, i)) : (part)) })] }, option.id))) }) })] })),
90
+ .map((part, i) => part.toLowerCase() === filter.toLowerCase() ? (_jsx("u", { className: "font-bold", children: part }, i)) : (part)) })] }, option.id))) }) })] })),
97
91
  id: "options",
98
92
  },
99
93
  {
100
94
  label: "Recent",
101
- content: ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col h-full", children: recentItems.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-sm text-gray-500 p-2", children: "No recent templates" })) : (recentItems.map((template) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
95
+ content: (_jsx("div", { className: "flex flex-col h-full", children: recentItems.length === 0 ? (_jsx("div", { className: "text-sm text-gray-500 p-2", children: "No recent templates" })) : (recentItems.map((template) => (_jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
102
96
  ev.stopPropagation();
103
97
  ev.preventDefault();
104
98
  getCommand(template)(ev);
105
- }, children: [(0, jsx_runtime_1.jsx)("img", { className: "p-menuitem-icon", src: template.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() }), (0, jsx_runtime_1.jsx)("span", { className: "flex-1", children: template.name })] }, template.id)))) })),
99
+ }, children: [_jsx("img", { className: "p-menuitem-icon", src: template.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() }), _jsx("span", { className: "flex-1", children: template.name })] }, template.id)))) })),
106
100
  id: "recent",
107
101
  },
108
102
  {
109
103
  label: "From Template",
110
- content: ((0, jsx_runtime_1.jsxs)("div", { className: " h-full w-full flex flex-col gap-2", children: [(0, jsx_runtime_1.jsx)(ItemSearch_1.default, { setHoveredItem: setHoveredItem, rootItemIds: [config_1.templatesRootItemId], itemSelected: (item) => {
104
+ content: (_jsxs("div", { className: " h-full w-full flex flex-col gap-2", children: [_jsx(ItemSearch, { setHoveredItem: setHoveredItem, rootItemIds: [templatesRootItemId], itemSelected: (item) => {
111
105
  getCommand(item)(null);
112
- } }), (0, jsx_runtime_1.jsx)("div", { className: "flex-2 relative", children: (0, jsx_runtime_1.jsx)("div", { className: "overflow-auto absolute inset-0", children: (0, jsx_runtime_1.jsx)(ScrollingContentTree_1.ScrollingContentTree, { selectedItemId: hoveredItem?.id ?? item?.id, rootItemId: config_1.templatesRootItemId, onSelectionChange: (node) => {
106
+ } }), _jsx("div", { className: "flex-2 relative", children: _jsx("div", { className: "overflow-auto absolute inset-0", children: _jsx(ScrollingContentTree, { selectedItemId: hoveredItem?.id ?? item?.id, rootItemId: templatesRootItemId, onSelectionChange: (node) => {
113
107
  if (Array.isArray(node) && node[0]) {
114
108
  node = node[0];
115
109
  }
@@ -123,7 +117,7 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
123
117
  if (wizards.length > 0) {
124
118
  tabs.push({
125
119
  label: "Wizards",
126
- content: ((0, jsx_runtime_1.jsx)("div", { children: wizards.map((wizard) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
120
+ content: (_jsx("div", { children: wizards.map((wizard) => (_jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
127
121
  ev.stopPropagation();
128
122
  ev.preventDefault();
129
123
  editContext?.executeCommand({
@@ -131,11 +125,11 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
131
125
  data: { wizard, item: item.descriptor },
132
126
  event: ev,
133
127
  });
134
- }, children: [(0, jsx_runtime_1.jsx)("img", { className: "p-menuitem-icon", src: wizard.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() }), (0, jsx_runtime_1.jsx)("span", { className: "flex-1", children: wizard.name })] }, wizard.id))) })),
128
+ }, children: [_jsx("img", { className: "p-menuitem-icon", src: wizard.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() }), _jsx("span", { className: "flex-1", children: wizard.name })] }, wizard.id))) })),
135
129
  id: "wizards",
136
130
  });
137
131
  }
138
- return ((0, jsx_runtime_1.jsxs)("div", { className: "p-2", style: { display: "flex", alignItems: "center", cursor: "pointer" }, onMouseEnter: () => {
132
+ return (_jsxs("div", { className: "p-2", style: { display: "flex", alignItems: "center", cursor: "pointer" }, onMouseEnter: () => {
139
133
  if (hideTimeoutRef.current) {
140
134
  clearTimeout(hideTimeoutRef.current);
141
135
  }
@@ -148,7 +142,7 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
148
142
  }, onClick: (ev) => {
149
143
  ev.stopPropagation();
150
144
  ev.preventDefault();
151
- }, children: [(0, jsx_runtime_1.jsx)("i", { className: "mr-2 pi pi-plus" }), (0, jsx_runtime_1.jsx)("span", { className: "p-menuitem-text", children: "Insert" }), (0, jsx_runtime_1.jsx)("div", { ref: opRef, className: "absolute bg-white shadow-lg rounded-md z-50 p-2", onKeyDownCapture: (ev) => {
145
+ }, children: [_jsx("i", { className: "mr-2 pi pi-plus" }), _jsx("span", { className: "p-menuitem-text", children: "Insert" }), _jsx("div", { ref: opRef, className: "absolute bg-white shadow-lg rounded-md z-50 p-2", onKeyDownCapture: (ev) => {
152
146
  ev.stopPropagation();
153
147
  }, onKeyUpCapture: (ev) => {
154
148
  ev.stopPropagation();
@@ -159,6 +153,5 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
159
153
  minWidth: "450px",
160
154
  minHeight: "380px",
161
155
  border: "1px solid #ddd",
162
- }, children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-4 flex flex-col", children: (0, jsx_runtime_1.jsx)(SimpleTabs_1.SimpleTabs, { tabs: tabs, setActiveTab: setActiveTab, activeTab: activeTab }) }) })] }));
156
+ }, children: _jsx("div", { className: "absolute inset-4 flex flex-col", children: _jsx(SimpleTabs, { tabs: tabs, setActiveTab: setActiveTab, activeTab: activeTab }) }) })] }));
163
157
  };
164
- exports.InsertMenuTemplate = InsertMenuTemplate;
@@ -0,0 +1,4 @@
1
+ import { FullItem } from "./pageModel";
2
+ export declare function ItemInfo({ item }: {
3
+ item: FullItem | null;
4
+ }): import("react/jsx-runtime").JSX.Element | undefined;
@@ -1,30 +1,27 @@
1
1
  "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.ItemInfo = ItemInfo;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const editContext_1 = require("./client/editContext");
7
- const CopyToClipboardButton_1 = require("./ui/CopyToClipboardButton");
8
- const Section_1 = require("./ui/Section");
9
- function ItemInfo({ item }) {
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEditContext } from "./client/editContext";
4
+ import { CopyToClipboardButton } from "./ui/CopyToClipboardButton";
5
+ import { Section } from "./ui/Section";
6
+ export function ItemInfo({ item }) {
10
7
  if (!item?.fields)
11
8
  return;
12
- const editContext = (0, editContext_1.useEditContext)();
9
+ const editContext = useEditContext();
13
10
  function formatRow(label, value) {
14
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: label }), (0, jsx_runtime_1.jsx)("div", { children: value })] }));
11
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "font-bold", children: label }), _jsx("div", { children: value })] }));
15
12
  }
16
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center py-2 px-3 my-2", children: [(0, jsx_runtime_1.jsx)("img", { src: item.largeIcon, alt: "Icon", className: "mr-2", style: { height: "32px", width: "32px" } }), (0, jsx_runtime_1.jsxs)("h2", { className: "text-l font-bold", children: [item.name, (0, jsx_runtime_1.jsx)("button", { className: "ml-2", onClick: () => {
13
+ return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center py-2 px-3 my-2", children: [_jsx("img", { src: item.largeIcon, alt: "Icon", className: "mr-2", style: { height: "32px", width: "32px" } }), _jsxs("h2", { className: "text-l font-bold", children: [item.name, _jsx("button", { className: "ml-2", onClick: () => {
17
14
  editContext?.executeCommand({
18
15
  command: editContext.configuration.commands.renameItem,
19
16
  data: { items: [item] },
20
17
  });
21
- }, children: (0, jsx_runtime_1.jsx)("i", { className: "pi pi-pencil" }) })] })] }), (0, jsx_runtime_1.jsx)(Section_1.Section, { title: "Info", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-[min-content_1fr] gap-3 text-xs", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: "ID:" }), (0, jsx_runtime_1.jsxs)("div", { children: [item.id, " ", (0, jsx_runtime_1.jsx)(CopyToClipboardButton_1.CopyToClipboardButton, { text: item.id })] }), (0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: "Path:" }), (0, jsx_runtime_1.jsxs)("div", { children: [item.path, " ", (0, jsx_runtime_1.jsx)(CopyToClipboardButton_1.CopyToClipboardButton, { text: item.path })] }), (0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: "Language:" }), (0, jsx_runtime_1.jsx)("div", { children: item.language }), (0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: "Version:" }), (0, jsx_runtime_1.jsx)("div", { children: item.versions > 0 ? item.version : "No versions" }), (0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: "Template:" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("span", { className: "cursor-pointer hover:underline", onClick: () => {
18
+ }, children: _jsx("i", { className: "pi pi-pencil" }) })] })] }), _jsx(Section, { title: "Info", children: _jsxs("div", { className: "grid grid-cols-[min-content_1fr] gap-3 text-xs", children: [_jsx("div", { className: "font-bold", children: "ID:" }), _jsxs("div", { children: [item.id, " ", _jsx(CopyToClipboardButton, { text: item.id })] }), _jsx("div", { className: "font-bold", children: "Path:" }), _jsxs("div", { children: [item.path, " ", _jsx(CopyToClipboardButton, { text: item.path })] }), _jsx("div", { className: "font-bold", children: "Language:" }), _jsx("div", { children: item.language }), _jsx("div", { className: "font-bold", children: "Version:" }), _jsx("div", { children: item.versions > 0 ? item.version : "No versions" }), _jsx("div", { className: "font-bold", children: "Template:" }), _jsxs("div", { children: [_jsxs("span", { className: "cursor-pointer hover:underline", onClick: () => {
22
19
  editContext?.loadItem({
23
20
  id: item.templateId,
24
21
  language: "en",
25
22
  version: 0,
26
23
  });
27
24
  editContext?.switchView("content-editor");
28
- }, children: [" ", item.templateName, " (", item.templateId, " "] }), (0, jsx_runtime_1.jsx)(CopyToClipboardButton_1.CopyToClipboardButton, { text: item.templateId }), ")"] }), item.masterLanguages &&
29
- formatRow("Master languages", item.masterLanguages.join(", ")), item.translations && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: "Languages" }), (0, jsx_runtime_1.jsx)("div", { children: item.translations?.join(", ") })] }))] }) })] }));
25
+ }, children: [" ", item.templateName, " (", item.templateId, " "] }), _jsx(CopyToClipboardButton, { text: item.templateId }), ")"] }), item.masterLanguages &&
26
+ formatRow("Master languages", item.masterLanguages.join(", ")), item.translations && (_jsxs(_Fragment, { children: [_jsx("div", { className: "font-bold", children: "Languages" }), _jsx("div", { children: item.translations?.join(", ") })] }))] }) })] }));
30
27
  }
@@ -0,0 +1,15 @@
1
+ export type Link = {
2
+ url?: string;
3
+ itemId?: string;
4
+ queryString?: string;
5
+ target?: string;
6
+ customTarget?: string;
7
+ type: string;
8
+ targetItemLongId?: string;
9
+ targetItemName?: string;
10
+ };
11
+ export declare function LinkEditorDialog({ linkValue, onCancel, onOk, }: {
12
+ linkValue: Link;
13
+ onOk: (link: Link) => void;
14
+ onCancel: () => void;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,23 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LinkEditorDialog = LinkEditorDialog;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const dialog_1 = require("primereact/dialog");
9
- const inputtext_1 = require("primereact/inputtext");
10
- const react_1 = require("react");
11
- const dropdown_1 = require("primereact/dropdown");
12
- const divider_1 = require("primereact/divider");
13
- const button_1 = require("primereact/button");
14
- const splitter_1 = require("primereact/splitter");
15
- const ItemSearch_1 = __importDefault(require("./ui/ItemSearch"));
16
- const SimpleTabs_1 = require("./ui/SimpleTabs");
17
- const ScrollingContentTree_1 = require("./ScrollingContentTree");
18
- function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
19
- const [url, setUrl] = (0, react_1.useState)();
20
- const [targetWindow, setTargetWindow] = (0, react_1.useState)();
21
- const [customTarget, setCustomTarget] = (0, react_1.useState)();
22
- const [queryString, setQueryString] = (0, react_1.useState)();
23
- const [activeTabIndex, setActiveTabIndex] = (0, react_1.useState)(0);
24
- const [selectedItemId, setSelectedItemId] = (0, react_1.useState)("");
25
- const [hoveredItemId, setHoveredItemId] = (0, react_1.useState)();
26
- (0, react_1.useEffect)(() => {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog } from "primereact/dialog";
3
+ import { InputText } from "primereact/inputtext";
4
+ import { useEffect, useState } from "react";
5
+ import { Dropdown } from "primereact/dropdown";
6
+ import { Divider } from "primereact/divider";
7
+ import { Button } from "primereact/button";
8
+ import { Splitter, SplitterPanel } from "primereact/splitter";
9
+ import ItemSearch from "./ui/ItemSearch";
10
+ import { SimpleTabs } from "./ui/SimpleTabs";
11
+ import { ScrollingContentTree } from "./ScrollingContentTree";
12
+ export function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
13
+ const [url, setUrl] = useState();
14
+ const [targetWindow, setTargetWindow] = useState();
15
+ const [customTarget, setCustomTarget] = useState();
16
+ const [queryString, setQueryString] = useState();
17
+ const [activeTabIndex, setActiveTabIndex] = useState(0);
18
+ const [selectedItemId, setSelectedItemId] = useState("");
19
+ const [hoveredItemId, setHoveredItemId] = useState();
20
+ useEffect(() => {
27
21
  setUrl(linkValue.url);
28
22
  setTargetWindow(linkValue.target);
29
23
  if (linkValue.type == "external")
@@ -53,9 +47,9 @@ function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
53
47
  {
54
48
  id: "internal",
55
49
  label: "Internal",
56
- content: ((0, jsx_runtime_1.jsxs)(splitter_1.Splitter, { className: "mt-4 flex-1", children: [(0, jsx_runtime_1.jsx)(splitter_1.SplitterPanel, { className: "relative h-full", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 overflow-auto", children: (0, jsx_runtime_1.jsx)(ScrollingContentTree_1.ScrollingContentTree, { selectedItemId: hoveredItemId || selectedItemId, onSelectionChange: (selection) => {
50
+ content: (_jsxs(Splitter, { className: "mt-4 flex-1", children: [_jsx(SplitterPanel, { className: "relative h-full", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(ScrollingContentTree, { selectedItemId: hoveredItemId || selectedItemId, onSelectionChange: (selection) => {
57
51
  setSelectedItemId(selection[0]?.id || "");
58
- } }) }) }), (0, jsx_runtime_1.jsx)(splitter_1.SplitterPanel, { children: (0, jsx_runtime_1.jsx)("div", { className: "relative ml-2 h-full w-full", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 overflow-auto", children: (0, jsx_runtime_1.jsx)(ItemSearch_1.default, { itemSelected: (item) => {
52
+ } }) }) }), _jsx(SplitterPanel, { children: _jsx("div", { className: "relative ml-2 h-full w-full", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(ItemSearch, { itemSelected: (item) => {
59
53
  setSelectedItemId(item.id);
60
54
  }, setHoveredItem: (item) => ((item) => {
61
55
  if (!item)
@@ -66,17 +60,17 @@ function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
66
60
  {
67
61
  id: "external",
68
62
  label: "External",
69
- content: ((0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [" ", (0, jsx_runtime_1.jsx)("label", { className: "mt-4 block text-sm", children: "Url:" }), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: url || "", onChange: (e) => {
63
+ content: (_jsxs("div", { className: "flex-1", children: [" ", _jsx("label", { className: "mt-4 block text-sm", children: "Url:" }), _jsx(InputText, { value: url || "", onChange: (e) => {
70
64
  setUrl(e.target.value);
71
65
  }, className: "w-full text-sm" })] })),
72
66
  },
73
67
  ];
74
- return ((0, jsx_runtime_1.jsx)(dialog_1.Dialog, { style: { width: "60%", height: "70%" }, onHide: onCancel, header: "Select link target", visible: true, onShow: () => {
68
+ return (_jsx(Dialog, { style: { width: "60%", height: "70%" }, onHide: onCancel, header: "Select link target", visible: true, onShow: () => {
75
69
  // Trigger a resize event to recalculate TabView layout
76
70
  window.dispatchEvent(new Event("resize"));
77
- }, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex h-full flex-col p-4", children: [linkValue && ((0, jsx_runtime_1.jsx)(SimpleTabs_1.SimpleTabs, { tabs: tabs, activeTab: activeTabIndex, setActiveTab: setActiveTabIndex })), (0, jsx_runtime_1.jsx)(divider_1.Divider, {}), (0, jsx_runtime_1.jsx)("label", { className: "text-xs", children: "QueryString" }), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: queryString, onChange: (e) => setQueryString(e.target.value), className: "text-sm" }), (0, jsx_runtime_1.jsx)("label", { className: "mt-4 text-xs", children: "Window" }), (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { options: targetWindows, optionLabel: "name", optionValue: "code", value: targetWindow, onChange: (e) => setTargetWindow(e.value), className: "text-sm" }), targetWindow === "custom" && ((0, jsx_runtime_1.jsxs)("div", { className: "m-2", children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs", children: "Custom:" }), (0, jsx_runtime_1.jsx)(inputtext_1.InputText, { value: customTarget || "", onChange: (e) => {
71
+ }, children: _jsxs("div", { className: "flex h-full flex-col p-4", children: [linkValue && (_jsx(SimpleTabs, { tabs: tabs, activeTab: activeTabIndex, setActiveTab: setActiveTabIndex })), _jsx(Divider, {}), _jsx("label", { className: "text-xs", children: "QueryString" }), _jsx(InputText, { value: queryString, onChange: (e) => setQueryString(e.target.value), className: "text-sm" }), _jsx("label", { className: "mt-4 text-xs", children: "Window" }), _jsx(Dropdown, { options: targetWindows, optionLabel: "name", optionValue: "code", value: targetWindow, onChange: (e) => setTargetWindow(e.value), className: "text-sm" }), targetWindow === "custom" && (_jsxs("div", { className: "m-2", children: [_jsx("label", { className: "block text-xs", children: "Custom:" }), _jsx(InputText, { value: customTarget || "", onChange: (e) => {
78
72
  setCustomTarget(e.target.value);
79
- }, className: "text-sm" })] })), (0, jsx_runtime_1.jsx)(divider_1.Divider, {}), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-end gap-3", children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => {
73
+ }, className: "text-sm" })] })), _jsx(Divider, {}), _jsxs("div", { className: "flex justify-end gap-3", children: [_jsx(Button, { onClick: () => {
80
74
  onOk({
81
75
  url,
82
76
  target: getTargetWindow(),
@@ -85,5 +79,5 @@ function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
85
79
  queryString: queryString,
86
80
  type: activeTabIndex === 1 ? "external" : "internal",
87
81
  });
88
- }, children: "Select" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: onCancel, children: "Cancel" })] })] }) }));
82
+ }, children: "Select" }), _jsx(Button, { onClick: onCancel, children: "Cancel" })] })] }) }));
89
83
  }
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from "react";
2
+ import { EditorView } from "../config/types";
3
+ export default function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, className, }: {
4
+ rightSidebar?: ReactNode;
5
+ rightSidebarTitle?: string;
6
+ view: EditorView;
7
+ centerPanelView: ReactNode;
8
+ className?: string;
9
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,30 +1,24 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.default = MainLayout;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const react_2 = __importDefault(require("react"));
10
- const utils_1 = require("primereact/utils");
11
- const editContext_1 = require("./client/editContext");
12
- const Icons_1 = require("./ui/Icons");
13
- const SidebarView_1 = require("./sidebar/SidebarView");
14
- const Splitter_1 = require("./ui/Splitter");
15
- const ViewSelector_1 = require("./sidebar/ViewSelector");
16
- function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, className, }) {
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import React from "react";
4
+ import { classNames } from "primereact/utils";
5
+ import { useEditContext } from "./client/editContext";
6
+ import { NavigatorIcon } from "./ui/Icons";
7
+ import { SidebarView } from "./sidebar/SidebarView";
8
+ import { Splitter } from "./ui/Splitter";
9
+ import { ViewSelector } from "./sidebar/ViewSelector";
10
+ export default function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, className, }) {
17
11
  const panels = [];
18
- const editContext = (0, editContext_1.useEditContext)();
19
- const mainLayoutDivRef = (0, react_1.useRef)(null);
20
- const leftSidebarRef = react_2.default.useRef(null);
12
+ const editContext = useEditContext();
13
+ const mainLayoutDivRef = useRef(null);
14
+ const leftSidebarRef = React.useRef(null);
21
15
  if (!editContext)
22
16
  return null;
23
17
  if (view.leftSidebar)
24
18
  panels.push({
25
19
  name: "leftSidebar",
26
20
  defaultSize: 350,
27
- content: ((0, jsx_runtime_1.jsx)("div", { className: "w-full h-full", ref: leftSidebarRef, style: { wordBreak: "normal" }, children: (0, jsx_runtime_1.jsx)(SidebarView_1.SidebarView, { sidebar: view.leftSidebar, editContext: editContext, active: true }) })),
21
+ content: (_jsx("div", { className: "w-full h-full", ref: leftSidebarRef, style: { wordBreak: "normal" }, children: _jsx(SidebarView, { sidebar: view.leftSidebar, editContext: editContext, active: true }) })),
28
22
  });
29
23
  panels.push({
30
24
  name: "center",
@@ -40,7 +34,7 @@ function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, cl
40
34
  });
41
35
  }
42
36
  if (!editContext?.configuration.editor.embedded) {
43
- className = (0, utils_1.classNames)("fixed inset-0", className);
37
+ className = classNames("fixed inset-0", className);
44
38
  }
45
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.classNames)("flex flex-col select-none", className), ref: mainLayoutDivRef, children: [editContext?.configuration.editor.titlebar, (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1", children: [!view.hideViewSelector && (0, jsx_runtime_1.jsx)(ViewSelector_1.ViewSelector, {}), (0, jsx_runtime_1.jsx)("div", { className: "flex-1", children: (0, jsx_runtime_1.jsx)(Splitter_1.Splitter, { localStorageKey: "editor.panelSizes", expandLabel: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center", children: [(0, jsx_runtime_1.jsx)(Icons_1.NavigatorIcon, {}), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3", children: [rightSidebarTitle, " "] })] }), panels: panels }) })] })] }));
39
+ return (_jsxs("div", { className: classNames("flex flex-col select-none", className), ref: mainLayoutDivRef, children: [editContext?.configuration.editor.titlebar, _jsxs("div", { className: "flex flex-1", children: [!view.hideViewSelector && _jsx(ViewSelector, {}), _jsx("div", { className: "flex-1", children: _jsx(Splitter, { localStorageKey: "editor.panelSizes", expandLabel: _jsxs("div", { className: "flex items-center justify-center", children: [_jsx(NavigatorIcon, {}), _jsxs("div", { className: "mt-3", children: [rightSidebarTitle, " "] })] }), panels: panels }) })] })] }));
46
40
  }
@@ -0,0 +1,5 @@
1
+ import { EditorConfiguration } from "../config/types";
2
+ export declare function NewEditorClient(props: {
3
+ className?: string;
4
+ configuration: EditorConfiguration;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,6 @@
1
1
  "use client";
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.NewEditorClient = NewEditorClient;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- function NewEditorClient(props) {
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export function NewEditorClient(props) {
7
4
  console.log(props);
8
- return (0, jsx_runtime_1.jsx)("div", { children: "Hello" });
5
+ return _jsx("div", { children: "Hello" });
9
6
  }
@@ -0,0 +1,6 @@
1
+ import { PictureField } from "./fieldTypes";
2
+ export declare function PictureCropper({ field, onClose, variantName: selectedVariantName, }: {
3
+ field: PictureField;
4
+ variantName: string;
5
+ onClose: () => void;
6
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,33 +1,27 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.PictureCropper = PictureCropper;
7
- const jsx_runtime_1 = require("react/jsx-runtime");
8
- const dialog_1 = require("primereact/dialog");
9
- const editContext_1 = require("./client/editContext");
10
- const react_1 = require("react");
11
- const button_1 = require("primereact/button");
12
- const DialogButtons_1 = __importDefault(require("./ui/DialogButtons"));
13
- const utils_1 = require("primereact/utils");
14
- function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
15
- const [pictureValue, setPictureValue] = (0, react_1.useState)();
16
- const [isValid, setIsValid] = (0, react_1.useState)(true);
17
- const [rawValue, setRawValue] = (0, react_1.useState)();
18
- const imageRef = (0, react_1.useRef)(null);
19
- const [rect, setRect] = (0, react_1.useState)();
20
- const rectRef = (0, react_1.useRef)(rect);
21
- const movingRef = (0, react_1.useRef)(false);
22
- const [startPos, setStartPos] = (0, react_1.useState)({
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog } from "primereact/dialog";
3
+ import { useEditContext } from "./client/editContext";
4
+ import { useEffect, useRef, useState } from "react";
5
+ import { Button } from "primereact/button";
6
+ import DialogButtons from "./ui/DialogButtons";
7
+ import { classNames } from "primereact/utils";
8
+ export function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
9
+ const [pictureValue, setPictureValue] = useState();
10
+ const [isValid, setIsValid] = useState(true);
11
+ const [rawValue, setRawValue] = useState();
12
+ const imageRef = useRef(null);
13
+ const [rect, setRect] = useState();
14
+ const rectRef = useRef(rect);
15
+ const movingRef = useRef(false);
16
+ const [startPos, setStartPos] = useState({
23
17
  x: 0,
24
18
  y: 0,
25
19
  });
26
- const offset = (0, react_1.useRef)({ x: 0, y: 0 });
27
- const editContext = (0, editContext_1.useEditContext)();
20
+ const offset = useRef({ x: 0, y: 0 });
21
+ const editContext = useEditContext();
28
22
  const EDGE_THRESHOLD = 10; // pixels from edge to detect resize
29
- const [resizeEdge, setResizeEdge] = (0, react_1.useState)(null);
30
- const resizeEdgeRef = (0, react_1.useRef)(null);
23
+ const [resizeEdge, setResizeEdge] = useState(null);
24
+ const resizeEdgeRef = useRef(null);
31
25
  const getResizeEdge = (pos, rect, bounds) => {
32
26
  if (!rect || !bounds)
33
27
  return null;
@@ -59,7 +53,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
59
53
  return "s";
60
54
  return null;
61
55
  };
62
- (0, react_1.useEffect)(() => {
56
+ useEffect(() => {
63
57
  const deepCopy = JSON.parse(JSON.stringify(field.value));
64
58
  setPictureValue(deepCopy);
65
59
  const raw = field?.rawValue
@@ -70,7 +64,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
70
64
  const selectedVariant = pictureValue && pictureValue.variants
71
65
  ? pictureValue.variants?.find((x) => x.name == selectedVariantName)
72
66
  : null;
73
- (0, react_1.useEffect)(() => {
67
+ useEffect(() => {
74
68
  if (selectedVariant?.region &&
75
69
  (!selectedVariant.aspectRatioLock ||
76
70
  Math.abs(selectedVariant.aspectRatioLock -
@@ -89,7 +83,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
89
83
  setRect(undefined);
90
84
  }
91
85
  }, [selectedVariant]);
92
- (0, react_1.useEffect)(() => {
86
+ useEffect(() => {
93
87
  if (!rect)
94
88
  return;
95
89
  if ((selectedVariant?.minWidth && selectedVariant.minWidth > widthPx) ||
@@ -100,7 +94,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
100
94
  setIsValid(true);
101
95
  rectRef.current = rect;
102
96
  }, [rect]);
103
- (0, react_1.useEffect)(() => {
97
+ useEffect(() => {
104
98
  if (!rawValue)
105
99
  return;
106
100
  if (!selectedVariantName)
@@ -298,11 +292,11 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
298
292
  const scale = imageBounds ? selectedVariant.width / imageBounds.width : 0;
299
293
  const widthPx = rect ? Math.round(rect.width * selectedVariant.width) : 0;
300
294
  const heightPx = rect ? Math.round(rect.height * selectedVariant.height) : 0;
301
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(dialog_1.Dialog, { header: "Crop " + field.name + " - " + selectedVariantName, pt: { content: { style: { paddingLeft: "0" } } }, visible: true, style: { width: "75vw", height: "75vh" }, onHide: onClose, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 flex-col justify h-full", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex-1 flex gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "w-56 text-sm p-4 bg-gray-100 flex flex-col gap-3", children: [(0, jsx_runtime_1.jsx)(LabelAndValue, { label: "Variant:", value: selectedVariantName }), (0, jsx_runtime_1.jsx)(LabelAndValue, { label: "Image Dimensions:", value: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [selectedVariant.width, " x ", selectedVariant.height] }) }), selectedVariant.aspectRatioLock && ((0, jsx_runtime_1.jsx)(LabelAndValue, { label: "Required Aspect Ratio:", value: selectedVariant.aspectRatioLockText })), selectedVariant.minWidth && ((0, jsx_runtime_1.jsx)(LabelAndValue, { label: "Minimum Width:", value: selectedVariant.minWidth })), selectedVariant.minHeight && ((0, jsx_runtime_1.jsx)(LabelAndValue, { label: "Minimum Height:", value: selectedVariant.minHeight })), rect && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(LabelAndValue, { label: "Selection:", value: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [widthPx, " x ", heightPx] }) }), selectedVariant.minWidth &&
302
- widthPx < selectedVariant.minWidth && ((0, jsx_runtime_1.jsx)("div", { className: "text-red-500", children: "Minimum width not met!" })), selectedVariant.minHeight &&
303
- heightPx < selectedVariant.minHeight && ((0, jsx_runtime_1.jsx)("div", { className: "text-red-500", children: "Minimum height not met!" }))] }))] }), (0, jsx_runtime_1.jsx)("div", { className: "flex-1 relative p-3", children: (0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 top-3 select-none flex items-center justify-center", children: (0, jsx_runtime_1.jsxs)("div", { ref: imageRef, className: "relative cursor-crosshair max-h-full", style: {
295
+ return (_jsx(_Fragment, { children: _jsx(Dialog, { header: "Crop " + field.name + " - " + selectedVariantName, pt: { content: { style: { paddingLeft: "0" } } }, visible: true, style: { width: "75vw", height: "75vh" }, onHide: onClose, children: _jsxs("div", { className: "flex gap-1 flex-col justify h-full", children: [_jsxs("div", { className: "flex-1 flex gap-2", children: [_jsxs("div", { className: "w-56 text-sm p-4 bg-gray-100 flex flex-col gap-3", children: [_jsx(LabelAndValue, { label: "Variant:", value: selectedVariantName }), _jsx(LabelAndValue, { label: "Image Dimensions:", value: _jsxs(_Fragment, { children: [selectedVariant.width, " x ", selectedVariant.height] }) }), selectedVariant.aspectRatioLock && (_jsx(LabelAndValue, { label: "Required Aspect Ratio:", value: selectedVariant.aspectRatioLockText })), selectedVariant.minWidth && (_jsx(LabelAndValue, { label: "Minimum Width:", value: selectedVariant.minWidth })), selectedVariant.minHeight && (_jsx(LabelAndValue, { label: "Minimum Height:", value: selectedVariant.minHeight })), rect && (_jsxs(_Fragment, { children: [_jsx(LabelAndValue, { label: "Selection:", value: _jsxs(_Fragment, { children: [widthPx, " x ", heightPx] }) }), selectedVariant.minWidth &&
296
+ widthPx < selectedVariant.minWidth && (_jsx("div", { className: "text-red-500", children: "Minimum width not met!" })), selectedVariant.minHeight &&
297
+ heightPx < selectedVariant.minHeight && (_jsx("div", { className: "text-red-500", children: "Minimum height not met!" }))] }))] }), _jsx("div", { className: "flex-1 relative p-3", children: _jsx("div", { className: "absolute inset-0 top-3 select-none flex items-center justify-center", children: _jsxs("div", { ref: imageRef, className: "relative cursor-crosshair max-h-full", style: {
304
298
  aspectRatio: `${selectedVariant.width}/${selectedVariant.height}`,
305
- }, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, children: [(0, jsx_runtime_1.jsx)("img", { className: "object-scale-down", src: selectedVariant.originalSrc ?? selectedVariant.src }), rect && ((0, jsx_runtime_1.jsx)("div", { className: (0, utils_1.classNames)("absolute bg-opacity-70 border text-xs cursor-move", isValid
299
+ }, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, children: [_jsx("img", { className: "object-scale-down", src: selectedVariant.originalSrc ?? selectedVariant.src }), rect && (_jsx("div", { className: classNames("absolute bg-opacity-70 border text-xs cursor-move", isValid
306
300
  ? "bg-blue-200 border-blue-400 text-blue-500"
307
301
  : "bg-red-200 border-red-400 text-red-500"), style: {
308
302
  left: rect.x * 100 + "%",
@@ -314,7 +308,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
314
308
  ? `${resizeEdge}-resize`
315
309
  : `${resizeEdge}-resize`
316
310
  : "move",
317
- }, children: widthPx / scale > 50 && ((0, jsx_runtime_1.jsxs)("div", { className: "absolute bottom-1 right-2 text-nowrap", style: { textShadow: "white 1px 1px" }, children: [widthPx, " x ", heightPx] })) }))] }) }) })] }), (0, jsx_runtime_1.jsxs)(DialogButtons_1.default, { children: [(0, jsx_runtime_1.jsx)(button_1.Button, { onClick: () => setRect(undefined), children: "Reset" }), (0, jsx_runtime_1.jsx)(button_1.Button, { size: "small", disabled: !isValid, onClick: () => {
311
+ }, children: widthPx / scale > 50 && (_jsxs("div", { className: "absolute bottom-1 right-2 text-nowrap", style: { textShadow: "white 1px 1px" }, children: [widthPx, " x ", heightPx] })) }))] }) }) })] }), _jsxs(DialogButtons, { children: [_jsx(Button, { onClick: () => setRect(undefined), children: "Reset" }), _jsx(Button, { size: "small", disabled: !isValid, onClick: () => {
318
312
  if (pictureValue) {
319
313
  if (field) {
320
314
  editContext?.operations.editField({
@@ -325,8 +319,8 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
325
319
  }
326
320
  }
327
321
  onClose();
328
- }, children: "Ok" }), (0, jsx_runtime_1.jsx)(button_1.Button, { onClick: onClose, size: "small", children: "Cancel" })] })] }) }) }));
322
+ }, children: "Ok" }), _jsx(Button, { onClick: onClose, size: "small", children: "Cancel" })] })] }) }) }));
329
323
  }
330
324
  function LabelAndValue({ label, value, }) {
331
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "font-bold", children: label }), (0, jsx_runtime_1.jsx)("div", { children: value })] }));
325
+ return (_jsxs("div", { children: [_jsx("div", { className: "font-bold", children: label }), _jsx("div", { children: value })] }));
332
326
  }
@@ -0,0 +1,8 @@
1
+ import { PictureField } from "./fieldTypes";
2
+ export declare function PictureEditor({ field, variantName, style, forwardScrollevents, isPageEditor, }: {
3
+ field: PictureField;
4
+ variantName: string;
5
+ style?: React.CSSProperties;
6
+ forwardScrollevents?: boolean;
7
+ isPageEditor?: boolean;
8
+ }): import("react/jsx-runtime").JSX.Element;