@alpaca-headless/alpaca-headless-nextjs 1.0.129 → 1.0.246

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 (364) hide show
  1. package/dist/editor.css +439 -49
  2. package/dist/esm/alpacaContext.js +16 -0
  3. package/dist/esm/client-components/ClientLink.js +34 -0
  4. package/dist/{cjs/components → esm/client-components}/LinkEditor.js +22 -19
  5. package/dist/esm/client-components/MultiComponentEditor.js +22 -0
  6. package/dist/esm/client-components/index.js +4 -0
  7. package/dist/esm/components/Error.js +10 -0
  8. package/dist/{cjs → esm}/components/Image.js +4 -7
  9. package/dist/esm/components/Link.js +32 -0
  10. package/dist/esm/components/LinkPreview.js +30 -0
  11. package/dist/esm/components/LockedFieldIndicator.js +21 -0
  12. package/dist/esm/components/Picture.js +133 -0
  13. package/dist/esm/components/PictureEditor.js +77 -0
  14. package/dist/esm/components/PictureEditorWrapper.js +6 -0
  15. package/dist/esm/components/Placeholder.js +117 -0
  16. package/dist/esm/components/RichText.js +30 -0
  17. package/dist/esm/components/RichTextEditor.js +92 -0
  18. package/dist/esm/components/RichTextEditorWrapper.js +7 -0
  19. package/dist/esm/components/Slot.js +6 -0
  20. package/dist/esm/components/Text.js +29 -0
  21. package/dist/esm/components/TextEditor.js +78 -0
  22. package/dist/esm/components/TextEditorWrapper.js +19 -0
  23. package/dist/esm/components/Translate.js +12 -0
  24. package/dist/esm/components/TranslateEditor.js +24 -0
  25. package/dist/esm/components/index.js +7 -0
  26. package/dist/esm/components/picture-shared.js +26 -0
  27. package/dist/esm/editor/ComponentInfo.js +12 -0
  28. package/dist/esm/editor/ConfirmationDialog.js +29 -0
  29. package/dist/{cjs → esm}/editor/ContentTree.js +55 -46
  30. package/dist/esm/editor/ContextMenu.js +90 -0
  31. package/dist/esm/editor/DialogButtons.js +4 -0
  32. package/dist/esm/editor/DictionaryEditor.js +37 -0
  33. package/dist/esm/editor/EditFrame.js +115 -0
  34. package/dist/esm/editor/EditFrameWrapper.js +7 -0
  35. package/dist/esm/editor/Editor.js +15 -0
  36. package/dist/esm/editor/EditorClient.js +877 -0
  37. package/dist/esm/editor/EditorClientHost.js +15 -0
  38. package/dist/esm/editor/EditorWarning.js +10 -0
  39. package/dist/esm/editor/EditorWarnings.js +13 -0
  40. package/dist/esm/editor/FieldEditorPopup.js +23 -0
  41. package/dist/esm/editor/FieldList.js +48 -0
  42. package/dist/esm/editor/FieldListField.js +137 -0
  43. package/dist/{cjs → esm}/editor/FloatingToolbar.js +20 -23
  44. package/dist/esm/editor/ItemInfo.js +14 -0
  45. package/dist/esm/editor/ItemNameDialog.js +32 -0
  46. package/dist/esm/editor/LinkEditorDialog.js +61 -0
  47. package/dist/esm/editor/MainLayout.js +18 -0
  48. package/dist/esm/editor/MediaSelector.js +85 -0
  49. package/dist/esm/editor/Outline.js +82 -0
  50. package/dist/esm/editor/PageViewer.js +41 -0
  51. package/dist/esm/editor/PictureEditorDialog.js +201 -0
  52. package/dist/esm/editor/PlaceholderDropZone.js +130 -0
  53. package/dist/esm/editor/PlaceholderDropZoneHost.js +7 -0
  54. package/dist/esm/editor/PreviewClient.js +5 -0
  55. package/dist/esm/editor/PreviewClientHost.js +7 -0
  56. package/dist/esm/editor/PreviewPanel.js +7 -0
  57. package/dist/esm/editor/PublishDialog.js +15 -0
  58. package/dist/esm/editor/Terminal.js +55 -0
  59. package/dist/esm/editor/ai/AiPopup.js +28 -0
  60. package/dist/esm/editor/ai/AiResponseMessage.js +20 -0
  61. package/dist/{cjs/editor → esm/editor/ai}/AiTerminal.js +67 -48
  62. package/dist/esm/editor/ai/AiToolCall.js +15 -0
  63. package/dist/esm/editor/commands/commands.js +1 -0
  64. package/dist/esm/editor/commands/componentCommands.js +287 -0
  65. package/dist/esm/editor/commands/createVersionCommand.js +26 -0
  66. package/dist/esm/editor/commands/undo.js +22 -0
  67. package/dist/esm/editor/componentTreeHelper.js +20 -0
  68. package/dist/esm/editor/config/config.js +261 -0
  69. package/dist/esm/editor/editContext.js +11 -0
  70. package/dist/esm/editor/editor-warnings/ItemLocked.js +40 -0
  71. package/dist/esm/editor/editor-warnings/ValidationErrors.js +22 -0
  72. package/dist/esm/editor/fieldTypes/CheckboxEditor.js +21 -0
  73. package/dist/esm/editor/fieldTypes/DropLinkEditor.js +50 -0
  74. package/dist/esm/editor/fieldTypes/InternalLinkFieldEditor.js +41 -0
  75. package/dist/{cjs → esm}/editor/fieldTypes/LinkFieldEditor.js +14 -16
  76. package/dist/esm/editor/fieldTypes/MultiLineText.js +25 -0
  77. package/dist/esm/editor/fieldTypes/PictureFieldEditor.js +33 -0
  78. package/dist/esm/editor/fieldTypes/RawEditor.js +26 -0
  79. package/dist/esm/editor/fieldTypes/RichTextEditor.js +7 -0
  80. package/dist/esm/editor/fieldTypes/RichTextEditorComponent.js +46 -0
  81. package/dist/esm/editor/fieldTypes/SingleLineText.js +25 -0
  82. package/dist/esm/editor/fieldTypes/TreeListEditor.js +57 -0
  83. package/dist/esm/editor/index.js +4 -0
  84. package/dist/esm/editor/itemCommands.js +27 -0
  85. package/dist/esm/editor/menubar/BrowseHistory.js +39 -0
  86. package/dist/esm/editor/menubar/ItemLanguageVersion.js +20 -0
  87. package/dist/esm/editor/menubar/LanguageSelector.js +18 -0
  88. package/dist/esm/editor/menubar/Menu.js +105 -0
  89. package/dist/esm/editor/menubar/PageViewerControls.js +66 -0
  90. package/dist/esm/editor/menubar/VersionSelector.js +18 -0
  91. package/dist/esm/editor/previewContext.js +5 -0
  92. package/dist/esm/editor/services/contentService.js +58 -0
  93. package/dist/esm/editor/services/editService.js +428 -0
  94. package/dist/esm/editor/sidebar/ComponentPalette.js +42 -0
  95. package/dist/esm/editor/sidebar/ComponentTree.js +237 -0
  96. package/dist/esm/editor/sidebar/Debug.js +46 -0
  97. package/dist/esm/editor/sidebar/EditHistory.js +66 -0
  98. package/dist/esm/editor/sidebar/EditorForm.js +24 -0
  99. package/dist/esm/editor/sidebar/GraphQL.js +85 -0
  100. package/dist/esm/editor/sidebar/Insert.js +7 -0
  101. package/dist/esm/editor/sidebar/MainContentTree.js +38 -0
  102. package/dist/esm/editor/sidebar/Sessions.js +11 -0
  103. package/dist/esm/editor/sidebar/Sidebar.js +13 -0
  104. package/dist/esm/editor/sidebar/SidebarView.js +69 -0
  105. package/dist/esm/editor/sidebar/Workbox.js +77 -0
  106. package/dist/esm/editor/ui/CopyToClipboardButton.js +14 -0
  107. package/dist/esm/editor/ui/Icons.js +19 -0
  108. package/dist/esm/editor/ui/Section.js +8 -0
  109. package/dist/esm/editor/utils/insertOptions.js +39 -0
  110. package/dist/esm/editor/utils.js +71 -0
  111. package/dist/esm/editor/views/ItemEditor.js +18 -0
  112. package/dist/esm/fieldTypes.js +1 -0
  113. package/dist/esm/graphQL.js +50 -0
  114. package/dist/esm/graphQLTypes.js +1 -0
  115. package/dist/esm/index.js +8 -0
  116. package/dist/{cjs → esm}/loadRouteData.js +23 -20
  117. package/dist/{cjs → esm}/mediaProtection.js +4 -11
  118. package/dist/esm/middleware/handleRequest.js +45 -0
  119. package/dist/esm/middleware/index.js +1 -0
  120. package/dist/esm/servertypes.js +1 -0
  121. package/dist/primereact/resources/themes/arya-blue/theme.css +854 -790
  122. package/dist/primereact/resources/themes/arya-green/theme.css +854 -790
  123. package/dist/primereact/resources/themes/arya-orange/theme.css +854 -790
  124. package/dist/primereact/resources/themes/arya-purple/theme.css +854 -790
  125. package/dist/primereact/resources/themes/bootstrap4-dark-blue/theme.css +678 -615
  126. package/dist/primereact/resources/themes/bootstrap4-dark-purple/theme.css +678 -615
  127. package/dist/primereact/resources/themes/bootstrap4-light-blue/theme.css +679 -616
  128. package/dist/primereact/resources/themes/bootstrap4-light-purple/theme.css +679 -616
  129. package/dist/primereact/resources/themes/fluent-light/theme.css +686 -638
  130. package/dist/primereact/resources/themes/lara-dark-amber/theme.css +679 -630
  131. package/dist/primereact/resources/themes/lara-dark-blue/theme.css +679 -630
  132. package/dist/primereact/resources/themes/lara-dark-cyan/theme.css +679 -630
  133. package/dist/primereact/resources/themes/lara-dark-green/theme.css +679 -630
  134. package/dist/primereact/resources/themes/lara-dark-indigo/theme.css +679 -630
  135. package/dist/primereact/resources/themes/lara-dark-pink/theme.css +679 -630
  136. package/dist/primereact/resources/themes/lara-dark-purple/theme.css +679 -630
  137. package/dist/primereact/resources/themes/lara-dark-teal/theme.css +679 -630
  138. package/dist/primereact/resources/themes/lara-light-amber/theme.css +776 -725
  139. package/dist/primereact/resources/themes/lara-light-blue/theme.css +1011 -960
  140. package/dist/primereact/resources/themes/lara-light-cyan/theme.css +776 -725
  141. package/dist/primereact/resources/themes/lara-light-green/theme.css +820 -769
  142. package/dist/primereact/resources/themes/lara-light-indigo/theme.css +1016 -965
  143. package/dist/primereact/resources/themes/lara-light-pink/theme.css +776 -725
  144. package/dist/primereact/resources/themes/lara-light-purple/theme.css +1016 -965
  145. package/dist/primereact/resources/themes/lara-light-teal/theme.css +776 -725
  146. package/dist/primereact/resources/themes/luna-amber/theme.css +950 -887
  147. package/dist/primereact/resources/themes/luna-blue/theme.css +950 -887
  148. package/dist/primereact/resources/themes/luna-green/theme.css +950 -887
  149. package/dist/primereact/resources/themes/luna-pink/theme.css +950 -887
  150. package/dist/primereact/resources/themes/md-dark-deeppurple/theme.css +918 -950
  151. package/dist/primereact/resources/themes/md-dark-indigo/theme.css +918 -950
  152. package/dist/primereact/resources/themes/md-light-deeppurple/theme.css +878 -910
  153. package/dist/primereact/resources/themes/md-light-indigo/theme.css +878 -910
  154. package/dist/primereact/resources/themes/mdc-dark-deeppurple/theme.css +918 -950
  155. package/dist/primereact/resources/themes/mdc-dark-indigo/theme.css +918 -950
  156. package/dist/primereact/resources/themes/mdc-light-deeppurple/theme.css +878 -910
  157. package/dist/primereact/resources/themes/mdc-light-indigo/theme.css +878 -910
  158. package/dist/primereact/resources/themes/mira/theme.css +1562 -1532
  159. package/dist/primereact/resources/themes/nano/theme.css +707 -641
  160. package/dist/primereact/resources/themes/nova/theme.css +705 -643
  161. package/dist/primereact/resources/themes/nova-accent/theme.css +701 -636
  162. package/dist/primereact/resources/themes/nova-alt/theme.css +705 -643
  163. package/dist/primereact/resources/themes/rhea/theme.css +876 -811
  164. package/dist/primereact/resources/themes/saga-blue/theme.css +896 -832
  165. package/dist/primereact/resources/themes/saga-green/theme.css +896 -832
  166. package/dist/primereact/resources/themes/saga-orange/theme.css +896 -832
  167. package/dist/primereact/resources/themes/saga-purple/theme.css +896 -832
  168. package/dist/primereact/resources/themes/soho-dark/theme.css +701 -643
  169. package/dist/primereact/resources/themes/soho-light/theme.css +690 -634
  170. package/dist/primereact/resources/themes/tailwind-light/theme.css +1370 -1306
  171. package/dist/primereact/resources/themes/vela-blue/theme.css +862 -798
  172. package/dist/primereact/resources/themes/vela-green/theme.css +862 -798
  173. package/dist/primereact/resources/themes/vela-orange/theme.css +862 -798
  174. package/dist/primereact/resources/themes/vela-purple/theme.css +862 -798
  175. package/dist/primereact/resources/themes/viva-dark/theme.css +655 -612
  176. package/dist/primereact/resources/themes/viva-light/theme.css +737 -694
  177. package/package.json +25 -22
  178. package/types/alpacaContext.d.ts +14 -8
  179. package/types/{components → client-components}/LinkEditor.d.ts +1 -1
  180. package/types/client-components/MultiComponentEditor.d.ts +4 -2
  181. package/types/client-components/index.d.ts +3 -2
  182. package/types/components/Image.d.ts +1 -0
  183. package/types/components/Link.d.ts +1 -0
  184. package/types/components/LinkPreview.d.ts +6 -0
  185. package/types/components/LockedFieldIndicator.d.ts +6 -0
  186. package/types/components/Picture.d.ts +4 -6
  187. package/types/components/PictureEditorWrapper.d.ts +3 -0
  188. package/types/components/Placeholder.d.ts +12 -11
  189. package/types/components/RichText.d.ts +2 -1
  190. package/types/components/RichTextEditor.d.ts +3 -290
  191. package/types/components/RichTextEditorWrapper.d.ts +2 -0
  192. package/types/components/Slot.d.ts +2 -1
  193. package/types/components/Text.d.ts +2 -1
  194. package/types/components/TextEditor.d.ts +3 -290
  195. package/types/components/TextEditorWrapper.d.ts +4 -0
  196. package/types/components/Translate.d.ts +1 -0
  197. package/types/components/picture-shared.d.ts +16 -0
  198. package/types/editor/ComponentInfo.d.ts +1 -1
  199. package/types/editor/ContentTree.d.ts +2 -2
  200. package/types/editor/ContextMenu.d.ts +14 -0
  201. package/types/editor/DictionaryEditor.d.ts +1 -4
  202. package/types/editor/EditFrameWrapper.d.ts +6 -0
  203. package/types/editor/Editor.d.ts +68 -5
  204. package/types/editor/EditorClient.d.ts +17 -5
  205. package/types/editor/EditorClientHost.d.ts +4 -2
  206. package/types/editor/EditorWarning.d.ts +6 -0
  207. package/types/editor/EditorWarnings.d.ts +9 -0
  208. package/types/editor/FieldEditorPopup.d.ts +10 -0
  209. package/types/editor/FieldList.d.ts +6 -2
  210. package/types/editor/FieldListField.d.ts +6 -2
  211. package/types/editor/ItemInfo.d.ts +1 -1
  212. package/types/editor/Outline.d.ts +11 -0
  213. package/types/editor/PageViewer.d.ts +1 -0
  214. package/types/editor/PictureEditorDialog.d.ts +4 -2
  215. package/types/editor/PlaceholderDropZone.d.ts +3 -2
  216. package/types/editor/PlaceholderDropZoneHost.d.ts +3 -2
  217. package/types/editor/PreviewClient.d.ts +4 -0
  218. package/types/editor/PreviewClientHost.d.ts +4 -0
  219. package/types/editor/PreviewPanel.d.ts +1 -0
  220. package/types/editor/PublishDialog.d.ts +7 -0
  221. package/types/editor/Terminal.d.ts +6 -2
  222. package/types/editor/{AiPopup.d.ts → ai/AiPopup.d.ts} +2 -3
  223. package/types/editor/ai/AiResponseMessage.d.ts +7 -0
  224. package/types/editor/ai/AiTerminal.d.ts +4 -0
  225. package/types/editor/ai/AiToolCall.d.ts +9 -0
  226. package/types/editor/commands/commands.d.ts +21 -0
  227. package/types/editor/commands/componentCommands.d.ts +5 -0
  228. package/types/editor/commands/createVersionCommand.d.ts +2 -0
  229. package/types/editor/commands/undo.d.ts +15 -0
  230. package/types/editor/componentTreeHelper.d.ts +2 -1
  231. package/types/editor/config/config.d.ts +2 -0
  232. package/types/editor/editContext.d.ts +70 -93
  233. package/types/editor/editor-warnings/ItemLocked.d.ts +2 -0
  234. package/types/editor/editor-warnings/ValidationErrors.d.ts +2 -0
  235. package/types/editor/fieldTypes/CheckboxEditor.d.ts +3 -2
  236. package/types/editor/fieldTypes/DropLinkEditor.d.ts +5 -0
  237. package/types/editor/fieldTypes/InternalLinkFieldEditor.d.ts +3 -2
  238. package/types/editor/fieldTypes/LinkFieldEditor.d.ts +3 -2
  239. package/types/editor/fieldTypes/MultiLineText.d.ts +3 -2
  240. package/types/editor/fieldTypes/PictureFieldEditor.d.ts +2 -1
  241. package/types/editor/fieldTypes/RawEditor.d.ts +5 -0
  242. package/types/editor/fieldTypes/RichTextEditor.d.ts +4 -3
  243. package/types/editor/fieldTypes/RichTextEditorComponent.d.ts +5 -0
  244. package/types/editor/fieldTypes/SingleLineText.d.ts +3 -2
  245. package/types/editor/fieldTypes/TreeListEditor.d.ts +2 -1
  246. package/types/editor/index.d.ts +2 -0
  247. package/types/editor/itemCommands.d.ts +3 -0
  248. package/types/editor/menubar/BrowseHistory.d.ts +4 -0
  249. package/types/editor/menubar/ItemLanguageVersion.d.ts +1 -0
  250. package/types/editor/menubar/LanguageSelector.d.ts +5 -0
  251. package/types/editor/menubar/Menu.d.ts +1 -0
  252. package/types/editor/menubar/PageViewerControls.d.ts +1 -0
  253. package/types/editor/menubar/VersionSelector.d.ts +5 -0
  254. package/types/editor/previewContext.d.ts +4 -0
  255. package/types/editor/{contentService.d.ts → services/contentService.d.ts} +2 -3
  256. package/types/editor/services/editService.d.ts +27 -0
  257. package/types/editor/sidebar/ComponentPalette.d.ts +1 -0
  258. package/types/editor/sidebar/ComponentTree.d.ts +1 -0
  259. package/types/editor/sidebar/Debug.d.ts +1 -0
  260. package/types/editor/sidebar/EditHistory.d.ts +1 -0
  261. package/types/editor/sidebar/EditorForm.d.ts +1 -0
  262. package/types/editor/sidebar/GraphQL.d.ts +1 -0
  263. package/types/editor/sidebar/Insert.d.ts +1 -0
  264. package/types/editor/sidebar/MainContentTree.d.ts +3 -0
  265. package/types/editor/sidebar/Sessions.d.ts +1 -0
  266. package/types/editor/sidebar/Sidebar.d.ts +4 -0
  267. package/types/editor/sidebar/SidebarView.d.ts +8 -0
  268. package/types/editor/sidebar/Workbox.d.ts +1 -0
  269. package/types/editor/ui/CopyToClipboardButton.d.ts +3 -0
  270. package/types/editor/ui/Icons.d.ts +16 -0
  271. package/types/editor/utils/insertOptions.d.ts +3 -0
  272. package/types/editor/utils.d.ts +8 -0
  273. package/types/editor/views/ItemEditor.d.ts +1 -0
  274. package/types/fieldTypes.d.ts +39 -11
  275. package/types/graphQL.d.ts +12 -0
  276. package/types/index.d.ts +4 -3
  277. package/types/loadRouteData.d.ts +7 -85
  278. package/types/middleware/handleRequest.d.ts +5 -0
  279. package/types/middleware/index.d.ts +1 -1
  280. package/types/servertypes.d.ts +306 -0
  281. package/dist/cjs/alpacaContext.js +0 -12
  282. package/dist/cjs/client-components/ClientLink.js +0 -36
  283. package/dist/cjs/client-components/MultiComponentEditor.js +0 -26
  284. package/dist/cjs/client-components/index.js +0 -19
  285. package/dist/cjs/components/Error.js +0 -15
  286. package/dist/cjs/components/Link.js +0 -36
  287. package/dist/cjs/components/Picture.js +0 -124
  288. package/dist/cjs/components/PictureEditor.js +0 -49
  289. package/dist/cjs/components/Placeholder.js +0 -118
  290. package/dist/cjs/components/RichText.js +0 -47
  291. package/dist/cjs/components/RichTextEditor.js +0 -94
  292. package/dist/cjs/components/Slot.js +0 -8
  293. package/dist/cjs/components/Text.js +0 -46
  294. package/dist/cjs/components/TextEditor.js +0 -77
  295. package/dist/cjs/components/Translate.js +0 -14
  296. package/dist/cjs/components/TranslateEditor.js +0 -28
  297. package/dist/cjs/components/index.js +0 -23
  298. package/dist/cjs/editor/AiPopup.js +0 -33
  299. package/dist/cjs/editor/ComponentInfo.js +0 -15
  300. package/dist/cjs/editor/ComponentPalette.js +0 -23
  301. package/dist/cjs/editor/ComponentTree.js +0 -217
  302. package/dist/cjs/editor/ConfirmationDialog.js +0 -31
  303. package/dist/cjs/editor/Debug.js +0 -26
  304. package/dist/cjs/editor/DialogButtons.js +0 -7
  305. package/dist/cjs/editor/DictionaryEditor.js +0 -41
  306. package/dist/cjs/editor/EditFrame.js +0 -129
  307. package/dist/cjs/editor/EditHistory.js +0 -43
  308. package/dist/cjs/editor/Editor.js +0 -27
  309. package/dist/cjs/editor/EditorClient.js +0 -753
  310. package/dist/cjs/editor/EditorClientHost.js +0 -37
  311. package/dist/cjs/editor/FieldList.js +0 -51
  312. package/dist/cjs/editor/FieldListField.js +0 -75
  313. package/dist/cjs/editor/GraphQL.js +0 -87
  314. package/dist/cjs/editor/ItemEditor.js +0 -9
  315. package/dist/cjs/editor/ItemInfo.js +0 -17
  316. package/dist/cjs/editor/ItemNameDialog.js +0 -37
  317. package/dist/cjs/editor/LanguageSelector.js +0 -21
  318. package/dist/cjs/editor/LinkEditorDialog.js +0 -67
  319. package/dist/cjs/editor/MainLayout.js +0 -24
  320. package/dist/cjs/editor/MediaSelector.js +0 -92
  321. package/dist/cjs/editor/PictureEditorDialog.js +0 -93
  322. package/dist/cjs/editor/PlaceholderDropZone.js +0 -93
  323. package/dist/cjs/editor/PlaceholderDropZoneHost.js +0 -37
  324. package/dist/cjs/editor/SidebarTabs.js +0 -47
  325. package/dist/cjs/editor/Terminal.js +0 -61
  326. package/dist/cjs/editor/Utils.js +0 -43
  327. package/dist/cjs/editor/VersionSelector.js +0 -21
  328. package/dist/cjs/editor/Workbox.js +0 -41
  329. package/dist/cjs/editor/componentCommands.js +0 -141
  330. package/dist/cjs/editor/componentTreeHelper.js +0 -18
  331. package/dist/cjs/editor/contentService.js +0 -80
  332. package/dist/cjs/editor/editContext.js +0 -40
  333. package/dist/cjs/editor/editService.js +0 -334
  334. package/dist/cjs/editor/fieldTypes/CheckboxEditor.js +0 -21
  335. package/dist/cjs/editor/fieldTypes/InternalLinkFieldEditor.js +0 -46
  336. package/dist/cjs/editor/fieldTypes/MultiLineText.js +0 -25
  337. package/dist/cjs/editor/fieldTypes/PictureFieldEditor.js +0 -19
  338. package/dist/cjs/editor/fieldTypes/RichTextEditor.js +0 -24
  339. package/dist/cjs/editor/fieldTypes/SingleLineText.js +0 -25
  340. package/dist/cjs/editor/fieldTypes/TreeListEditor.js +0 -59
  341. package/dist/cjs/editor/index.js +0 -18
  342. package/dist/cjs/editor/ui/Section.js +0 -8
  343. package/dist/cjs/fieldTypes.js +0 -2
  344. package/dist/cjs/graphQLTypes.js +0 -2
  345. package/dist/cjs/index.js +0 -36
  346. package/dist/cjs/layoutData.js +0 -2
  347. package/dist/cjs/middleware/authorization.js +0 -52
  348. package/dist/cjs/middleware/index.js +0 -17
  349. package/types/editor/AiTerminal.d.ts +0 -5
  350. package/types/editor/ComponentPalette.d.ts +0 -6
  351. package/types/editor/ComponentTree.d.ts +0 -5
  352. package/types/editor/Debug.d.ts +0 -6
  353. package/types/editor/EditHistory.d.ts +0 -4
  354. package/types/editor/GraphQL.d.ts +0 -5
  355. package/types/editor/ItemEditor.d.ts +0 -4
  356. package/types/editor/LanguageSelector.d.ts +0 -5
  357. package/types/editor/SidebarTabs.d.ts +0 -8
  358. package/types/editor/Utils.d.ts +0 -3
  359. package/types/editor/VersionSelector.d.ts +0 -5
  360. package/types/editor/Workbox.d.ts +0 -6
  361. package/types/editor/componentCommands.d.ts +0 -4
  362. package/types/editor/editService.d.ts +0 -20
  363. package/types/layoutData.d.ts +0 -92
  364. package/types/middleware/authorization.d.ts +0 -2
@@ -0,0 +1,261 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { RichTextEditor } from "../fieldTypes/RichTextEditor";
3
+ import { LinkFieldEditor } from "../fieldTypes/LinkFieldEditor";
4
+ import { PictureFieldEditor } from "../fieldTypes/PictureFieldEditor";
5
+ import { InternalLinkFieldEditor } from "../fieldTypes/InternalLinkFieldEditor";
6
+ import TreeListEditor from "../fieldTypes/TreeListEditor";
7
+ import { SingleLineText } from "../fieldTypes/SingleLineText";
8
+ import { MultiLineText } from "../fieldTypes/MultiLineText";
9
+ import { DropLinkEditor } from "../fieldTypes/DropLinkEditor";
10
+ import { RawEditor } from "../fieldTypes/RawEditor";
11
+ import { CheckboxEditor } from "../fieldTypes/CheckboxEditor";
12
+ import { ItemLocked } from "../editor-warnings/ItemLocked";
13
+ import { ValidationErrors } from "../editor-warnings/ValidationErrors";
14
+ import { MainContentTree } from "../sidebar/MainContentTree";
15
+ import { ComponentTree } from "../sidebar/ComponentTree";
16
+ import { EditHistory } from "../sidebar/EditHistory";
17
+ import { Sessions } from "../sidebar/Sessions";
18
+ import { Workbox } from "../sidebar/Workbox";
19
+ import { DictionaryEditor } from "../DictionaryEditor";
20
+ import { BugIcon, EditIcon, GraphQLIcon, JsonIcon, WizardIcon, } from "../ui/Icons";
21
+ import { Debug } from "../sidebar/Debug";
22
+ import { GraphQL } from "../sidebar/GraphQL";
23
+ import { PageViewer } from "../PageViewer";
24
+ import { ItemEditor } from "../views/ItemEditor";
25
+ import { EditorForm } from "../sidebar/EditorForm";
26
+ import { AiTerminal } from "../ai/AiTerminal";
27
+ import { Insert } from "../sidebar/Insert";
28
+ import { getCreateAndSwitchToNewVersionCommand } from "../commands/createVersionCommand";
29
+ import { getSelectedComponentCommands } from "../commands/componentCommands";
30
+ import { getRedoCommand, getUndoCommand } from "../commands/undo";
31
+ const defaultRichTextEditorProfile = {
32
+ toolbar: {
33
+ groups: [
34
+ {
35
+ items: ["bold", "italic", "underline", "strikethrough"],
36
+ },
37
+ ],
38
+ },
39
+ };
40
+ export const configuration = {
41
+ alwaysVisiblePageFields: [],
42
+ fieldTypes: {
43
+ raw: {
44
+ editor: RawEditor,
45
+ },
46
+ "single-line text": {
47
+ editor: SingleLineText,
48
+ },
49
+ "multi-line text": {
50
+ editor: MultiLineText,
51
+ },
52
+ "rich text": {
53
+ editor: RichTextEditor,
54
+ custom: {
55
+ profiles: { default: defaultRichTextEditorProfile },
56
+ },
57
+ },
58
+ "general link": {
59
+ editor: LinkFieldEditor,
60
+ },
61
+ picture: {
62
+ editor: PictureFieldEditor,
63
+ },
64
+ droplink: {
65
+ editor: DropLinkEditor,
66
+ },
67
+ "enhanced internal link": {
68
+ editor: InternalLinkFieldEditor,
69
+ },
70
+ treelist: {
71
+ editor: TreeListEditor,
72
+ },
73
+ "enhanced treelist": {
74
+ editor: TreeListEditor,
75
+ },
76
+ checkbox: {
77
+ editor: CheckboxEditor,
78
+ },
79
+ },
80
+ editorWarnings: [ItemLocked, ValidationErrors],
81
+ outline: {
82
+ width: 100,
83
+ },
84
+ chrome: {
85
+ editor: {
86
+ views: [
87
+ {
88
+ name: "edit",
89
+ title: "Edit",
90
+ centerPanelView: "page",
91
+ icon: _jsx(EditIcon, {}),
92
+ leftSidebar: [
93
+ {
94
+ name: "form",
95
+ icon: "pi pi-plus",
96
+ title: "Form",
97
+ header: () => null,
98
+ content: _jsx(EditorForm, {}),
99
+ initialSize: 65,
100
+ },
101
+ {
102
+ name: "component-tree",
103
+ icon: "pi pi-list",
104
+ title: "Outline",
105
+ content: _jsx(ComponentTree, {}),
106
+ initialSize: 20,
107
+ },
108
+ {
109
+ name: "history",
110
+ icon: "pi pi-clock",
111
+ title: "History",
112
+ content: _jsx(EditHistory, {}),
113
+ initialSize: 15,
114
+ },
115
+ ],
116
+ },
117
+ {
118
+ name: "insert",
119
+ title: "Insert",
120
+ icon: "pi pi-plus",
121
+ centerPanelView: "page",
122
+ leftSidebar: [
123
+ {
124
+ name: "component-palette",
125
+ icon: "pi pi-plus",
126
+ header: () => null,
127
+ title: "Insert",
128
+ content: _jsx(Insert, {}),
129
+ initialSize: 15,
130
+ },
131
+ ],
132
+ },
133
+ {
134
+ name: "content-editor",
135
+ title: "Navigate",
136
+ icon: "pi pi-sitemap",
137
+ centerPanelView: "form",
138
+ leftSidebar: [
139
+ {
140
+ name: "debug",
141
+ icon: "pi pi-sitemap",
142
+ title: "Content",
143
+ content: _jsx(MainContentTree, {}),
144
+ initialSize: 100,
145
+ },
146
+ {
147
+ name: "history",
148
+ icon: "pi pi-clock",
149
+ title: "History",
150
+ content: _jsx(EditHistory, {}),
151
+ initialSize: 0,
152
+ },
153
+ ],
154
+ },
155
+ {
156
+ name: "workbox",
157
+ title: "Workbox",
158
+ icon: "pi pi-inbox",
159
+ leftSidebar: [
160
+ {
161
+ name: "Workbox",
162
+ title: "Workbox",
163
+ icon: "pi-inbox",
164
+ content: _jsx(Workbox, {}),
165
+ initialSize: 100,
166
+ },
167
+ ],
168
+ },
169
+ {
170
+ name: "ai",
171
+ title: "AI",
172
+ icon: _jsx(WizardIcon, {}),
173
+ leftSidebar: [
174
+ {
175
+ name: "ai-terminal",
176
+ icon: "pi pi-comments",
177
+ title: "AI",
178
+ content: _jsx(AiTerminal, {}),
179
+ initialSize: 20,
180
+ },
181
+ {
182
+ name: "history",
183
+ icon: "pi pi-clock",
184
+ title: "History",
185
+ content: _jsx(EditHistory, {}),
186
+ initialSize: 0,
187
+ },
188
+ ],
189
+ },
190
+ {
191
+ name: "dictionary",
192
+ title: "Dictionary",
193
+ icon: "pi pi-book",
194
+ leftSidebar: [
195
+ {
196
+ name: "dictionary",
197
+ icon: "pi pi-book",
198
+ title: "Dictionary",
199
+ content: _jsx(DictionaryEditor, {}),
200
+ initialSize: 100,
201
+ },
202
+ ],
203
+ },
204
+ {
205
+ name: "sessions",
206
+ title: "Sessions",
207
+ icon: "pi pi-users",
208
+ leftSidebar: [
209
+ {
210
+ name: "sessions",
211
+ icon: "pi pi-users",
212
+ title: "Sessions",
213
+ content: _jsx(Sessions, {}),
214
+ initialSize: 100,
215
+ },
216
+ ],
217
+ },
218
+ {
219
+ name: "debug",
220
+ title: "Debug",
221
+ icon: _jsx(BugIcon, {}),
222
+ centerPanelView: "page",
223
+ leftSidebar: [
224
+ {
225
+ name: "debug",
226
+ icon: _jsx(JsonIcon, {}),
227
+ title: "JSON",
228
+ content: _jsx(Debug, {}),
229
+ initialSize: 60,
230
+ },
231
+ {
232
+ name: "graphql",
233
+ icon: _jsx(GraphQLIcon, {}),
234
+ title: "GraphQL",
235
+ content: _jsx(GraphQL, {}),
236
+ initialSize: 40,
237
+ },
238
+ ],
239
+ },
240
+ ],
241
+ centerPanelViews: [
242
+ { name: "page", content: _jsx(PageViewer, {}) },
243
+ { name: "form", content: _jsx(ItemEditor, {}) },
244
+ ],
245
+ mainNavigation: [
246
+ getUndoCommand(),
247
+ getRedoCommand(),
248
+ {
249
+ label: "Version",
250
+ icon: "pi pi-fw",
251
+ items: [getCreateAndSwitchToNewVersionCommand()],
252
+ },
253
+ {
254
+ label: "Selection",
255
+ icon: "pi pi-fw",
256
+ items: (editContext) => getSelectedComponentCommands(editContext),
257
+ },
258
+ ],
259
+ },
260
+ },
261
+ };
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import React, { useContext } from "react";
3
+ const EditContext = React.createContext(undefined);
4
+ export const EditContextProvider = EditContext.Provider;
5
+ export const useEditContext = () => useContext(EditContext);
6
+ const EditFrameContext = React.createContext(undefined);
7
+ export const useEditFrameContext = () => useContext(EditFrameContext);
8
+ export const EditFrameContextProvider = EditFrameContext.Provider;
9
+ const EditFilterChildrenContext = React.createContext(undefined);
10
+ export const useEditFilterChildrenContext = () => useContext(EditFilterChildrenContext);
11
+ export const EditFilterChildrenContextProvider = EditFilterChildrenContext.Provider;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { EditorWarning } from "../EditorWarning";
3
+ import { useEditContext } from "../editContext";
4
+ export function ItemLocked({ item }) {
5
+ var _a;
6
+ if (!((_a = item._editor) === null || _a === void 0 ? void 0 : _a.canLock))
7
+ return;
8
+ var editContext = useEditContext();
9
+ if (!editContext)
10
+ return;
11
+ if (item._editor.hasLock) {
12
+ return (_jsx(EditorWarning, { title: "Item locked", severity: "warning", children: _jsx("button", { onClick: () => {
13
+ const items = [item];
14
+ if (item._editor.linkedComponentItem)
15
+ items.push(item._editor.linkedComponentItem);
16
+ editContext.unlockItems(items);
17
+ }, children: "Release lock" }) }));
18
+ }
19
+ if (item._editor.lockedBy == null) {
20
+ return (_jsx(EditorWarning, { title: "Item is locked", severity: "warning", children: _jsxs("div", { children: ["Locked by ", item._editor.lockedBy] }) }));
21
+ }
22
+ // else {
23
+ // return (
24
+ // <EditorWarning title="Item not locked" severity="warning">
25
+ // {item.canLock && (
26
+ // <button
27
+ // onClick={() => {
28
+ // const items: ItemDescriptor[] = [item];
29
+ // if ((item as ComponentData).linkedComponentItem)
30
+ // items.push((item as ComponentData).linkedComponentItem);
31
+ // editContext!.lockItems(items);
32
+ // }}
33
+ // >
34
+ // Lock item
35
+ // </button>
36
+ // )}
37
+ // </EditorWarning>
38
+ // );
39
+ // }
40
+ }
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { EditorWarning } from "../EditorWarning";
3
+ export function ValidationErrors({ item, editContext }) {
4
+ var _a, _b, _c;
5
+ let validationResult = (_b = (_a = editContext.pageValidationResult) === null || _a === void 0 ? void 0 : _a.find((x) => x.item.id === item.id &&
6
+ x.item.language === item.language &&
7
+ x.item.version === item.version)) === null || _b === void 0 ? void 0 : _b.results.filter((x) => x.itemId === item.id);
8
+ if (!validationResult) {
9
+ const pageResult = (_c = editContext.pageValidationResult) === null || _c === void 0 ? void 0 : _c.find((x) => { var _a; return x.item.id === ((_a = editContext === null || editContext === void 0 ? void 0 : editContext.page) === null || _a === void 0 ? void 0 : _a.id); });
10
+ if (pageResult)
11
+ validationResult = pageResult.results.filter((x) => x.itemId === item.id);
12
+ }
13
+ if (!(validationResult === null || validationResult === void 0 ? void 0 : validationResult.length))
14
+ return null;
15
+ const fields = validationResult === null || validationResult === void 0 ? void 0 : validationResult.filter((x) => x.fieldId);
16
+ return (_jsxs(EditorWarning, { title: "Validation", severity: "warning", children: [validationResult === null || validationResult === void 0 ? void 0 : validationResult.filter((x) => !x.fieldId).map((x) => _jsx("div", { children: x.message }, x.validator)), (fields === null || fields === void 0 ? void 0 : fields.length) > 0 && (_jsxs("div", { children: ["The following fields have validation messages:", " ", fields.map((x) => (_jsx("span", { className: "a-cursor-pointer a-font-bold", onClick: () => {
17
+ var _a;
18
+ const field = Object.values(item.fields).find((f) => f.id === x.fieldId);
19
+ if (field)
20
+ editContext.setFocusedField((_a = field._editor) === null || _a === void 0 ? void 0 : _a.descriptor, false);
21
+ }, children: x.fieldName }, x.validator + x.fieldId)))] }))] }));
22
+ }
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useEditContext } from "..";
4
+ import { Checkbox } from "primereact/checkbox";
5
+ export function CheckboxEditor({ field, readOnly, }) {
6
+ var _a;
7
+ const editContext = useEditContext();
8
+ if (!editContext)
9
+ return;
10
+ const fieldItem = (_a = field._editor) === null || _a === void 0 ? void 0 : _a.descriptor.item;
11
+ if (!fieldItem)
12
+ return;
13
+ return (_jsx(Checkbox, { checked: field.value, disabled: readOnly, onChange: (e) => {
14
+ editContext.editField({
15
+ field,
16
+ rawValue: e.checked ? "1" : "0",
17
+ refresh: "immediate",
18
+ });
19
+ // field.value = e.target.value;
20
+ } }, fieldItem.id + field.id + fieldItem.language + fieldItem.version));
21
+ }
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { Dropdown } from "primereact/dropdown";
13
+ import { useEditContext } from "..";
14
+ import { useEffect, useState } from "react";
15
+ import { loadDropLinkOptions } from "../services/editService";
16
+ import { Skeleton } from "primereact/skeleton";
17
+ export function DropLinkEditor({ field, readOnly, }) {
18
+ const editContext = useEditContext();
19
+ const [lazyItems, setLazyItems] = useState([]);
20
+ const [lazyLoading, setLazyLoading] = useState(true);
21
+ if (!field)
22
+ return;
23
+ if (!editContext)
24
+ return;
25
+ useEffect(() => {
26
+ onLazyLoad();
27
+ }, []);
28
+ const onLazyLoad = () => __awaiter(this, void 0, void 0, function* () {
29
+ setLazyLoading(true);
30
+ const options = yield loadDropLinkOptions(field, editContext.sessionId);
31
+ setLazyItems(options);
32
+ setLazyLoading(false);
33
+ });
34
+ return (_jsx(Dropdown, { value: field.value.targetItemId, disabled: readOnly, onChange: (e) => {
35
+ editContext === null || editContext === void 0 ? void 0 : editContext.editField({
36
+ field,
37
+ rawValue: e.value,
38
+ });
39
+ }, options: lazyItems, optionLabel: "name", optionValue: "id", placeholder: "Select", className: "w-full md:w-14rem", virtualScrollerOptions: {
40
+ lazy: true,
41
+ onLazyLoad: onLazyLoad,
42
+ itemSize: 38,
43
+ showLoader: true,
44
+ loading: lazyLoading,
45
+ delay: 250,
46
+ loadingTemplate: (options) => {
47
+ return (_jsx("div", { className: "flex align-items-center p-2", style: { height: "38px" }, children: _jsx(Skeleton, { width: options.even ? "60%" : "50%", height: "1rem" }) }));
48
+ },
49
+ } }));
50
+ }
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { useEditContext } from "../editContext";
5
+ import ContentTree from "../ContentTree";
6
+ export function InternalLinkFieldEditor({ field, readOnly, }) {
7
+ const editContext = useEditContext();
8
+ const [link, setLink] = useState();
9
+ const [showTree, setShowTree] = useState(false);
10
+ useEffect(() => {
11
+ var _a;
12
+ setLink({
13
+ url: field.value.url,
14
+ target: field.value.target,
15
+ targetItemName: field.value.targetItemName,
16
+ targetItemLongId: field.value.targetItemLongId,
17
+ type: field.value.type,
18
+ itemId: (_a = field.value.targetItemLongId) === null || _a === void 0 ? void 0 : _a.split("/").pop(),
19
+ queryString: field.value.queryString,
20
+ });
21
+ }, [field]);
22
+ if (!field)
23
+ return;
24
+ if (!editContext)
25
+ return;
26
+ const selection = [];
27
+ if (link === null || link === void 0 ? void 0 : link.itemId)
28
+ selection.push(link.itemId);
29
+ return (_jsxs("div", { children: [_jsxs("div", { className: "a-p-2 a-border a-bg-gray-50 a-flex a-justify-between a-text-sm a-cursor-pointer a-justiy-between a-focus-shadow", onClick: (e) => {
30
+ if (readOnly)
31
+ return;
32
+ setShowTree(!showTree);
33
+ e.preventDefault();
34
+ }, children: [_jsx("span", { children: link === null || link === void 0 ? void 0 : link.targetItemName }), !readOnly && (_jsx("i", { className: `pi ${showTree ? "pi-angle-up" : "pi-angle-down"} ` }))] }), showTree && (_jsx("div", { className: "a-h-64 a-overflow-scroll a-resize", children: _jsx(ContentTree, { expandIdPath: link === null || link === void 0 ? void 0 : link.targetItemLongId, rootItemId: "{11111111-1111-1111-1111-111111111111}", selectionMode: "single", selectedItemIds: selection, onSelectionChange: (selection) => {
35
+ setShowTree(false);
36
+ editContext === null || editContext === void 0 ? void 0 : editContext.editField({
37
+ field,
38
+ rawValue: selection.id,
39
+ });
40
+ } }) }))] }));
41
+ }
@@ -1,16 +1,13 @@
1
- "use strict";
2
1
  "use client";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.LinkFieldEditor = void 0;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const react_1 = require("react");
7
- const __1 = require("../..");
8
- const LinkEditorDialog_1 = require("../LinkEditorDialog");
9
- function LinkFieldEditor({ field }) {
10
- const editContext = (0, __1.useEditContext)();
11
- const [showDialog, setShowDialog] = (0, react_1.useState)(false);
12
- const [link, setLink] = (0, react_1.useState)();
13
- (0, react_1.useEffect)(() => {
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useEffect, useState } from "react";
4
+ import { LinkEditorDialog } from "../LinkEditorDialog";
5
+ import { useEditContext } from "../editContext";
6
+ export function LinkFieldEditor({ field, readOnly, }) {
7
+ const editContext = useEditContext();
8
+ const [showDialog, setShowDialog] = useState(false);
9
+ const [link, setLink] = useState();
10
+ useEffect(() => {
14
11
  var _a;
15
12
  setLink({
16
13
  url: field.value.url,
@@ -25,10 +22,12 @@ function LinkFieldEditor({ field }) {
25
22
  return;
26
23
  if (!editContext)
27
24
  return;
28
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "a-p-3 a-bg-gray-50 a-flex a-justify-between a-focus-shadow", onClick: (e) => {
25
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "a-p-3 a-bg-gray-50 a-flex a-justify-between a-focus-shadow", onClick: (e) => {
26
+ if (readOnly)
27
+ return;
29
28
  setShowDialog(true);
30
29
  e.preventDefault();
31
- }, children: [(0, jsx_runtime_1.jsx)("div", { children: field.value.url }), (0, jsx_runtime_1.jsx)("i", { className: "pi pi-link a-cursor-pointer" })] }), showDialog && ((0, jsx_runtime_1.jsx)(LinkEditorDialog_1.LinkEditorDialog, { linkValue: link || { type: "internal" }, onOk: (link) => {
30
+ }, children: [_jsx("div", { children: field.value.url }), !readOnly && _jsx("i", { className: "pi pi-link a-cursor-pointer" })] }), showDialog && (_jsx(LinkEditorDialog, { linkValue: link || { type: "internal" }, onOk: (link) => {
32
31
  var _a, _b;
33
32
  const xml = link.type == "internal"
34
33
  ? '<link linktype="internal" querystring="' +
@@ -40,7 +39,7 @@ function LinkFieldEditor({ field }) {
40
39
  '" />'
41
40
  : '<link linktype="external" querystring="' +
42
41
  ((_b = link.queryString) !== null && _b !== void 0 ? _b : "") +
43
- ' url="' +
42
+ '" url="' +
44
43
  link.url +
45
44
  '" target="' +
46
45
  link.target +
@@ -52,4 +51,3 @@ function LinkFieldEditor({ field }) {
52
51
  setShowDialog(false);
53
52
  } }))] }));
54
53
  }
55
- exports.LinkFieldEditor = LinkFieldEditor;
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { InputTextarea } from "primereact/inputtextarea";
4
+ import { useEditContext } from "..";
5
+ export function MultiLineText({ field, readOnly, }) {
6
+ var _a;
7
+ const editContext = useEditContext();
8
+ if (!editContext)
9
+ return;
10
+ const liveField = editContext.getLiveField(field);
11
+ if (!editContext)
12
+ return;
13
+ const value = (liveField === null || liveField === void 0 ? void 0 : liveField.value) || field.value;
14
+ const fieldItem = (_a = field._editor) === null || _a === void 0 ? void 0 : _a.descriptor.item;
15
+ if (!fieldItem)
16
+ return;
17
+ return (_jsx(InputTextarea, { value: value, disabled: readOnly, className: "a-p-2 a-focus-shadow a-text-sm", style: { width: "100%" }, rows: 12, onChange: (e) => {
18
+ editContext.editField({
19
+ field,
20
+ value: e.target.value,
21
+ refresh: "none",
22
+ });
23
+ // field.value = e.target.value;
24
+ } }, fieldItem.id + field.id + fieldItem.language + fieldItem.version));
25
+ }
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEditContext } from "../editContext";
4
+ import { PictureEditorDialog } from "../PictureEditorDialog";
5
+ import { useState } from "react";
6
+ import { InputText } from "primereact/inputtext";
7
+ export function PictureFieldEditor({ field, readOnly, }) {
8
+ var _a, _b, _c, _d;
9
+ const editContext = useEditContext();
10
+ const [editorVisible, setEditorVisible] = useState(false);
11
+ if (!field)
12
+ return;
13
+ if (!editContext)
14
+ return;
15
+ var item = (_a = field._editor) === null || _a === void 0 ? void 0 : _a.descriptor.item;
16
+ return (_jsxs("div", { children: [_jsx("div", { className: "a-flex a-gap-2 a-h-full a-border-r a-focus-shadow a-overflow-auto", children: (_c = (_b = field === null || field === void 0 ? void 0 : field.value) === null || _b === void 0 ? void 0 : _b.variants) === null || _c === void 0 ? void 0 : _c.map((variant) => (_jsxs("div", { children: [_jsx("div", { className: "a-h-40 a-w-40 a-border a-relative a-cursor-pointer a-flex a-justify-center a-items-center", onClick: () => {
17
+ if (!readOnly)
18
+ setEditorVisible(true);
19
+ }, children: variant.src && _jsx("img", { src: variant.thumbSrc }) }), _jsx("div", { className: "a-text-xs", children: variant.name }), _jsx("div", { className: "a-text-xs", children: variant.aspectRatioLockText })] }, variant.name))) }), _jsxs("div", { className: "a-mt-2", children: [_jsx("div", { className: "a-mb-1", children: "Alt Text" }), _jsx(InputText, { value: ((_d = field.value) === null || _d === void 0 ? void 0 : _d.alt) || "", disabled: readOnly, className: "a-p-2 a-focus-shadow a-text-sm", style: { width: "100%" }, onChange: (e) => {
20
+ const raw = (field === null || field === void 0 ? void 0 : field._editor.rawValue)
21
+ ? JSON.parse(field === null || field === void 0 ? void 0 : field._editor.rawValue)
22
+ : { Variants: [] };
23
+ raw.AltText = e.target.value;
24
+ if (field.value)
25
+ field.value.alt = e.target.value;
26
+ editContext.editField({
27
+ field,
28
+ rawValue: JSON.stringify(raw),
29
+ refresh: "none",
30
+ });
31
+ // field.value = e.target.value;
32
+ } }, item.id + field.id + item.language + item.version)] }), editorVisible && (_jsx(PictureEditorDialog, { field: field, onCancel: () => setEditorVisible(false), onOk: () => setEditorVisible(false) }))] }));
33
+ }
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { InputTextarea } from "primereact/inputtextarea";
4
+ import { useEditContext } from "..";
5
+ export function RawEditor({ field, readOnly, }) {
6
+ var _a, _b;
7
+ const editContext = useEditContext();
8
+ if (!editContext)
9
+ return;
10
+ const liveField = editContext.getLiveField(field);
11
+ if (!editContext)
12
+ return;
13
+ const value = ((_a = liveField === null || liveField === void 0 ? void 0 : liveField._editor) === null || _a === void 0 ? void 0 : _a.rawValue) || ((_b = field._editor) === null || _b === void 0 ? void 0 : _b.rawValue);
14
+ const fieldItem = field._editor.descriptor.item;
15
+ return (_jsx(InputTextarea, { value: value || "", disabled: readOnly, className: "a-p-2 a-focus-shadow a-text-sm", style: { width: "100%" }, rows: 12, onChange: (e) => {
16
+ field._editor.rawValue = e.target.value;
17
+ if (liveField)
18
+ liveField._editor.rawValue = e.target.value;
19
+ editContext.editField({
20
+ field,
21
+ rawValue: e.target.value,
22
+ refresh: "waitForQuietPeriod",
23
+ });
24
+ // field.value = e.target.value;
25
+ } }, fieldItem.id + field.id + fieldItem.language + fieldItem.version));
26
+ }
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import dynamic from "next/dynamic";
4
+ const RichTextEditorComponent = dynamic(() => import("./RichTextEditorComponent").then((dnd) => dnd.RichTextEditorComponent), { ssr: false });
5
+ export function RichTextEditor({ field, readOnly, }) {
6
+ return _jsx(RichTextEditorComponent, { field: field, readOnly: readOnly });
7
+ }
@@ -0,0 +1,46 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { Editor } from "primereact/editor";
4
+ import { useEditContext } from "..";
5
+ import Quill from "quill";
6
+ let Inline = Quill.import("blots/inline");
7
+ class BoldBlot extends Inline {
8
+ }
9
+ BoldBlot.blotName = "bold";
10
+ BoldBlot.tagName = "strong";
11
+ Quill.register("formats/bold", BoldBlot);
12
+ export function RichTextEditorComponent({ field, readOnly, }) {
13
+ var _a;
14
+ const editContext = useEditContext();
15
+ if (!editContext)
16
+ return;
17
+ const liveField = editContext.getLiveField(field);
18
+ // const profile =
19
+ // editContext.configuration.fieldTypes["rich text"].custom.profiles.default;
20
+ // const toolbar = getToolbar(profile);
21
+ // const editorModules = {
22
+ // toolbar: {
23
+ // container: [
24
+ // // ... other toolbar options
25
+ // ["customButton"], // Add your custom button here
26
+ // ],
27
+ // },
28
+ // customButton: {}, // Initialize your custom module
29
+ // };
30
+ const fieldItem = (_a = field._editor) === null || _a === void 0 ? void 0 : _a.descriptor.item;
31
+ if (!fieldItem)
32
+ return;
33
+ return (_jsx(_Fragment, { children: _jsx(Editor, { className: "a-focus-shadow", disabled: readOnly, value: liveField.value, style: { width: "100%" },
34
+ // headerTemplate={toolbar}
35
+ //modules={editorModules}
36
+ onTextChange: (e) => {
37
+ var _a;
38
+ // console.log("Text change: " + field.itemId);
39
+ editContext.editField({
40
+ field,
41
+ value: (_a = e.htmlValue) !== null && _a !== void 0 ? _a : "",
42
+ refresh: "none",
43
+ });
44
+ // field.value = e.htmlValue;
45
+ } }, fieldItem.id + field.id + fieldItem.language + fieldItem.version) }));
46
+ }