@xleddyl/nuxt-cms 0.9.3 → 0.10.0

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 (433) hide show
  1. package/README.md +1 -1
  2. package/dist/module.d.mts +20 -1
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +1037 -148
  5. package/dist/runtime/app/blocks/CmsBlocks.d.vue.ts +1 -1
  6. package/dist/runtime/app/blocks/CmsBlocks.vue +57 -9
  7. package/dist/runtime/app/blocks/CmsBlocks.vue.d.ts +1 -1
  8. package/dist/runtime/app/blocks/CmsField.d.ts +24 -0
  9. package/dist/runtime/app/blocks/CmsField.js +16 -0
  10. package/dist/runtime/app/blocks/node.d.ts +37 -0
  11. package/dist/runtime/app/blocks/node.js +17 -0
  12. package/dist/runtime/app/blocks/resolve.d.ts +18 -0
  13. package/dist/runtime/app/blocks/resolve.js +34 -0
  14. package/dist/runtime/app/components/cms/BlockPicker.d.vue.ts +22 -0
  15. package/dist/runtime/app/components/cms/BlockPicker.vue +87 -0
  16. package/dist/runtime/app/components/cms/BlockPicker.vue.d.ts +22 -0
  17. package/dist/runtime/app/components/cms/BlockPickerPopover.d.vue.ts +38 -0
  18. package/dist/runtime/app/components/cms/BlockPickerPopover.vue +44 -0
  19. package/dist/runtime/app/components/cms/BlockPickerPopover.vue.d.ts +38 -0
  20. package/dist/runtime/app/components/cms/BlockTree.d.vue.ts +29 -0
  21. package/dist/runtime/app/components/cms/BlockTree.vue +322 -0
  22. package/dist/runtime/app/components/cms/BlockTree.vue.d.ts +29 -0
  23. package/dist/runtime/app/components/cms/BlocksField.vue +569 -218
  24. package/dist/runtime/app/components/cms/BrandMark.vue +7 -13
  25. package/dist/runtime/app/components/cms/ConfirmGroups.vue +15 -13
  26. package/dist/runtime/app/components/cms/{BlockPalette.vue.d.ts → EditorHistory.d.vue.ts} +6 -5
  27. package/dist/runtime/app/components/cms/EditorHistory.vue +34 -0
  28. package/dist/runtime/app/components/cms/{BlockPalette.d.vue.ts → EditorHistory.vue.d.ts} +6 -5
  29. package/dist/runtime/app/components/cms/EntryDrawer.d.vue.ts +11 -5
  30. package/dist/runtime/app/components/cms/EntryDrawer.vue +183 -152
  31. package/dist/runtime/app/components/cms/EntryDrawer.vue.d.ts +11 -5
  32. package/dist/runtime/app/components/cms/EntryForm.d.vue.ts +16 -4
  33. package/dist/runtime/app/components/cms/EntryForm.vue +106 -146
  34. package/dist/runtime/app/components/cms/EntryForm.vue.d.ts +16 -4
  35. package/dist/runtime/app/components/cms/FieldInput.vue +10 -2
  36. package/dist/runtime/app/components/cms/FormSections.d.vue.ts +22 -0
  37. package/dist/runtime/app/components/cms/FormSections.vue +71 -0
  38. package/dist/runtime/app/components/cms/FormSections.vue.d.ts +22 -0
  39. package/dist/runtime/app/components/cms/ImportModal.vue +46 -58
  40. package/dist/runtime/app/components/cms/LinkField.d.vue.ts +16 -0
  41. package/dist/runtime/app/components/cms/LinkField.vue +250 -0
  42. package/dist/runtime/app/components/cms/LinkField.vue.d.ts +16 -0
  43. package/dist/runtime/app/components/cms/ListFilters.vue +10 -12
  44. package/dist/runtime/app/components/cms/LocaleSwitch.d.vue.ts +2 -1
  45. package/dist/runtime/app/components/cms/LocaleSwitch.vue +29 -5
  46. package/dist/runtime/app/components/cms/LocaleSwitch.vue.d.ts +2 -1
  47. package/dist/runtime/app/components/cms/MediaDetail.d.vue.ts +2 -0
  48. package/dist/runtime/app/components/cms/MediaDetail.vue +112 -83
  49. package/dist/runtime/app/components/cms/MediaDetail.vue.d.ts +2 -0
  50. package/dist/runtime/app/components/cms/MediaField.vue +35 -25
  51. package/dist/runtime/app/components/cms/MediaFolderPicker.vue +26 -71
  52. package/dist/runtime/app/components/cms/MediaGallery.d.vue.ts +1 -0
  53. package/dist/runtime/app/components/cms/MediaGallery.vue +442 -419
  54. package/dist/runtime/app/components/cms/MediaGallery.vue.d.ts +1 -0
  55. package/dist/runtime/app/components/cms/MediaThumb.vue +9 -25
  56. package/dist/runtime/app/components/cms/MediaUpload.vue +1 -1
  57. package/dist/runtime/app/components/cms/{BlockOutline.d.vue.ts → NestedBlockList.d.vue.ts} +5 -5
  58. package/dist/runtime/app/components/cms/NestedBlockList.vue +87 -0
  59. package/dist/runtime/app/components/cms/{BlockOutline.vue.d.ts → NestedBlockList.vue.d.ts} +5 -5
  60. package/dist/runtime/app/components/cms/PoweredBy.vue +12 -5
  61. package/dist/runtime/app/components/cms/PresetModal.d.vue.ts +18 -0
  62. package/dist/runtime/app/components/cms/PresetModal.vue +70 -0
  63. package/dist/runtime/app/components/cms/PresetModal.vue.d.ts +18 -0
  64. package/dist/runtime/app/components/cms/RelationField.vue +2 -8
  65. package/dist/runtime/app/components/cms/SettingsAccount.vue +60 -71
  66. package/dist/runtime/app/components/cms/SettingsColumns.vue +47 -69
  67. package/dist/runtime/app/components/cms/SettingsEmptyAdd.d.vue.ts +13 -0
  68. package/dist/runtime/app/components/cms/SettingsEmptyAdd.vue +21 -0
  69. package/dist/runtime/app/components/cms/SettingsEmptyAdd.vue.d.ts +13 -0
  70. package/dist/runtime/app/components/cms/SettingsEntries.d.vue.ts +13 -0
  71. package/dist/runtime/app/components/cms/SettingsEntries.vue +50 -0
  72. package/dist/runtime/app/components/cms/SettingsEntries.vue.d.ts +13 -0
  73. package/dist/runtime/app/components/cms/SettingsEntry.d.vue.ts +1 -10
  74. package/dist/runtime/app/components/cms/SettingsEntry.vue +11 -95
  75. package/dist/runtime/app/components/cms/SettingsEntry.vue.d.ts +1 -10
  76. package/dist/runtime/app/components/cms/SettingsEntryActions.d.vue.ts +7 -0
  77. package/dist/runtime/app/components/cms/SettingsEntryActions.vue +42 -0
  78. package/dist/runtime/app/components/cms/SettingsEntryActions.vue.d.ts +7 -0
  79. package/dist/runtime/app/components/cms/SettingsEntryTabs.d.vue.ts +7 -0
  80. package/dist/runtime/app/components/cms/SettingsEntryTabs.vue +21 -0
  81. package/dist/runtime/app/components/cms/SettingsEntryTabs.vue.d.ts +7 -0
  82. package/dist/runtime/app/components/cms/SettingsFormAction.d.vue.ts +3 -0
  83. package/dist/runtime/app/components/cms/SettingsFormAction.vue +17 -0
  84. package/dist/runtime/app/components/cms/SettingsFormAction.vue.d.ts +3 -0
  85. package/dist/runtime/app/components/cms/SettingsLayout.vue +18 -14
  86. package/dist/runtime/app/components/cms/SettingsPresetForm.d.vue.ts +11 -0
  87. package/dist/runtime/app/components/cms/SettingsPresetForm.vue +60 -0
  88. package/dist/runtime/app/components/cms/SettingsPresetForm.vue.d.ts +11 -0
  89. package/dist/runtime/app/components/cms/SettingsPresets.d.vue.ts +13 -0
  90. package/dist/runtime/app/components/cms/SettingsPresets.vue +65 -0
  91. package/dist/runtime/app/components/cms/SettingsPresets.vue.d.ts +13 -0
  92. package/dist/runtime/app/components/cms/SettingsRecordActions.d.vue.ts +32 -0
  93. package/dist/runtime/app/components/cms/SettingsRecordActions.vue +45 -0
  94. package/dist/runtime/app/components/cms/SettingsRecordActions.vue.d.ts +32 -0
  95. package/dist/runtime/app/components/cms/SettingsRedirectActions.d.vue.ts +3 -0
  96. package/dist/runtime/app/components/cms/SettingsRedirectActions.vue +59 -0
  97. package/dist/runtime/app/components/cms/SettingsRedirectActions.vue.d.ts +3 -0
  98. package/dist/runtime/app/components/cms/SettingsRedirectForm.d.vue.ts +11 -0
  99. package/dist/runtime/app/components/cms/SettingsRedirectForm.vue +77 -0
  100. package/dist/runtime/app/components/cms/SettingsRedirectForm.vue.d.ts +11 -0
  101. package/dist/runtime/app/components/cms/SettingsRedirects.d.vue.ts +13 -0
  102. package/dist/runtime/app/components/cms/SettingsRedirects.vue +117 -0
  103. package/dist/runtime/app/components/cms/SettingsRedirects.vue.d.ts +13 -0
  104. package/dist/runtime/app/components/cms/SettingsSecretCard.d.vue.ts +17 -0
  105. package/dist/runtime/app/components/cms/SettingsSecretCard.vue +43 -0
  106. package/dist/runtime/app/components/cms/SettingsSecretCard.vue.d.ts +17 -0
  107. package/dist/runtime/app/components/cms/SettingsSite.d.vue.ts +3 -0
  108. package/dist/runtime/app/components/cms/SettingsSite.vue +140 -0
  109. package/dist/runtime/app/components/cms/SettingsSite.vue.d.ts +3 -0
  110. package/dist/runtime/app/components/cms/SettingsUserCreate.d.vue.ts +8 -0
  111. package/dist/runtime/app/components/cms/SettingsUserCreate.vue +82 -0
  112. package/dist/runtime/app/components/cms/SettingsUserCreate.vue.d.ts +8 -0
  113. package/dist/runtime/app/components/cms/SettingsUserDetail.d.vue.ts +11 -0
  114. package/dist/runtime/app/components/cms/SettingsUserDetail.vue +179 -0
  115. package/dist/runtime/app/components/cms/SettingsUserDetail.vue.d.ts +11 -0
  116. package/dist/runtime/app/components/cms/SettingsUsers.d.vue.ts +9 -6
  117. package/dist/runtime/app/components/cms/SettingsUsers.vue +88 -234
  118. package/dist/runtime/app/components/cms/SettingsUsers.vue.d.ts +9 -6
  119. package/dist/runtime/app/components/cms/SharePreview.d.vue.ts +18 -0
  120. package/dist/runtime/app/components/cms/SharePreview.vue +219 -0
  121. package/dist/runtime/app/components/cms/SharePreview.vue.d.ts +18 -0
  122. package/dist/runtime/app/components/cms/SlugField.vue +5 -3
  123. package/dist/runtime/app/components/cms/StatusBadge.vue +9 -8
  124. package/dist/runtime/app/components/cms/TranslationBadges.d.vue.ts +7 -0
  125. package/dist/runtime/app/components/cms/TranslationBadges.vue +45 -0
  126. package/dist/runtime/app/components/cms/TranslationBadges.vue.d.ts +7 -0
  127. package/dist/runtime/app/components/cms/TranslationMenu.d.vue.ts +17 -0
  128. package/dist/runtime/app/components/cms/TranslationMenu.vue +28 -0
  129. package/dist/runtime/app/components/cms/TranslationMenu.vue.d.ts +17 -0
  130. package/dist/runtime/app/components/cms/VisualEditor.d.vue.ts +22 -4
  131. package/dist/runtime/app/components/cms/VisualEditor.vue +1152 -335
  132. package/dist/runtime/app/components/cms/VisualEditor.vue.d.ts +22 -4
  133. package/dist/runtime/app/components/cms/WelcomeModal.vue +32 -50
  134. package/dist/runtime/app/composables/cms-clipboard.d.ts +8 -0
  135. package/dist/runtime/app/composables/cms-clipboard.js +38 -0
  136. package/dist/runtime/app/composables/cms-confirm.d.ts +6 -8
  137. package/dist/runtime/app/composables/cms-confirm.js +5 -7
  138. package/dist/runtime/app/composables/cms-entry-disabled.d.ts +5 -1
  139. package/dist/runtime/app/composables/cms-entry-disabled.js +7 -0
  140. package/dist/runtime/app/composables/cms-entry-form.d.ts +15 -0
  141. package/dist/runtime/app/composables/cms-entry-form.js +40 -0
  142. package/dist/runtime/app/composables/cms-entry-settings.d.ts +30 -0
  143. package/dist/runtime/app/composables/cms-entry-settings.js +122 -0
  144. package/dist/runtime/app/composables/cms-entry.d.ts +5 -1
  145. package/dist/runtime/app/composables/cms-entry.js +36 -11
  146. package/dist/runtime/app/composables/cms-history.d.ts +10 -0
  147. package/dist/runtime/app/composables/cms-history.js +24 -0
  148. package/dist/runtime/app/composables/cms-link-targets.d.ts +10 -0
  149. package/dist/runtime/app/composables/cms-link-targets.js +40 -0
  150. package/dist/runtime/app/composables/cms-link-usage.d.ts +1 -0
  151. package/dist/runtime/app/composables/cms-link-usage.js +45 -0
  152. package/dist/runtime/app/composables/cms-media-library.d.ts +19 -9
  153. package/dist/runtime/app/composables/cms-media-library.js +31 -13
  154. package/dist/runtime/app/composables/cms-media-uploader.js +6 -20
  155. package/dist/runtime/app/composables/cms-permissions.d.ts +18 -0
  156. package/dist/runtime/app/composables/cms-permissions.js +54 -0
  157. package/dist/runtime/app/composables/cms-presets.d.ts +11 -0
  158. package/dist/runtime/app/composables/cms-presets.js +40 -0
  159. package/dist/runtime/app/composables/cms-preview-mode.d.ts +4 -0
  160. package/dist/runtime/app/composables/cms-preview-mode.js +8 -0
  161. package/dist/runtime/app/composables/cms-query.d.ts +3 -0
  162. package/dist/runtime/app/composables/cms-query.js +45 -20
  163. package/dist/runtime/app/composables/cms-record-list.d.ts +31 -0
  164. package/dist/runtime/app/composables/cms-record-list.js +75 -0
  165. package/dist/runtime/app/composables/cms-route.d.ts +6 -0
  166. package/dist/runtime/app/composables/cms-route.js +36 -0
  167. package/dist/runtime/app/composables/cms-runtime.d.ts +1 -0
  168. package/dist/runtime/app/composables/cms-save-handoff.d.ts +4 -0
  169. package/dist/runtime/app/composables/cms-save-handoff.js +19 -0
  170. package/dist/runtime/app/composables/cms-seo.d.ts +12 -0
  171. package/dist/runtime/app/composables/cms-seo.js +69 -0
  172. package/dist/runtime/app/composables/cms-settings-form.d.ts +13 -0
  173. package/dist/runtime/app/composables/cms-settings-form.js +29 -0
  174. package/dist/runtime/app/composables/cms-settings-sections.d.ts +26 -0
  175. package/dist/runtime/app/composables/cms-settings-sections.js +181 -0
  176. package/dist/runtime/app/composables/cms-settings-stores.d.ts +52 -0
  177. package/dist/runtime/app/composables/cms-settings-stores.js +156 -0
  178. package/dist/runtime/app/composables/cms-settings.d.ts +3 -3
  179. package/dist/runtime/app/composables/cms-settings.js +14 -8
  180. package/dist/runtime/app/composables/cms-site-disabled.d.ts +7 -0
  181. package/dist/runtime/app/composables/cms-site-disabled.js +8 -0
  182. package/dist/runtime/app/composables/cms-site.d.ts +7 -0
  183. package/dist/runtime/app/composables/cms-site.js +22 -0
  184. package/dist/runtime/app/composables/cms-toast.d.ts +2 -8
  185. package/dist/runtime/app/composables/cms-toast.js +3 -9
  186. package/dist/runtime/app/composables/cms-translation-actions.d.ts +15 -0
  187. package/dist/runtime/app/composables/cms-translation-actions.js +108 -0
  188. package/dist/runtime/app/css-url.d.ts +4 -0
  189. package/dist/runtime/app/image/CmsImage.d.vue.ts +89 -0
  190. package/dist/runtime/app/image/CmsImage.vue +91 -0
  191. package/dist/runtime/app/image/CmsImage.vue.d.ts +89 -0
  192. package/dist/runtime/app/layouts/cms-admin.d.vue.ts +2 -2
  193. package/dist/runtime/app/layouts/cms-admin.vue +98 -76
  194. package/dist/runtime/app/layouts/cms-admin.vue.d.ts +2 -2
  195. package/dist/runtime/app/layouts/cms-editor.vue +7 -2
  196. package/dist/runtime/app/links/CmsLink.d.vue.ts +18 -0
  197. package/dist/runtime/app/links/CmsLink.vue +18 -0
  198. package/dist/runtime/app/links/CmsLink.vue.d.ts +18 -0
  199. package/dist/runtime/app/middleware/cms-auth.js +13 -1
  200. package/dist/runtime/app/pages/admin-collection.vue +473 -297
  201. package/dist/runtime/app/pages/admin-content.vue +190 -53
  202. package/dist/runtime/app/pages/admin-entry.vue +79 -75
  203. package/dist/runtime/app/pages/admin-index.vue +18 -5
  204. package/dist/runtime/app/pages/admin-login.vue +1 -1
  205. package/dist/runtime/app/pages/admin-logout.vue +1 -1
  206. package/dist/runtime/app/pages/admin-media.vue +3 -3
  207. package/dist/runtime/app/pages/admin-preview.vue +112 -24
  208. package/dist/runtime/app/plugins/cms-field.d.ts +2 -0
  209. package/dist/runtime/app/plugins/cms-field.js +8 -0
  210. package/dist/runtime/app/plugins/cms-preview-banner.client.d.ts +2 -0
  211. package/dist/runtime/app/plugins/cms-preview-banner.client.js +19 -0
  212. package/dist/runtime/app/plugins/cms-preview.d.ts +2 -0
  213. package/dist/runtime/app/plugins/cms-preview.js +27 -0
  214. package/dist/runtime/app/preview/CmsPreviewBanner.d.vue.ts +7 -0
  215. package/dist/runtime/app/preview/CmsPreviewBanner.vue +63 -0
  216. package/dist/runtime/app/preview/CmsPreviewBanner.vue.d.ts +7 -0
  217. package/dist/runtime/app/preview/PreviewOverlay.d.vue.ts +17 -3
  218. package/dist/runtime/app/preview/PreviewOverlay.vue +629 -166
  219. package/dist/runtime/app/preview/PreviewOverlay.vue.d.ts +17 -3
  220. package/dist/runtime/app/preview/field-marker.d.ts +12 -0
  221. package/dist/runtime/app/preview/field-marker.js +20 -0
  222. package/dist/runtime/app/preview/inline-text.d.ts +15 -0
  223. package/dist/runtime/app/preview/inline-text.js +158 -0
  224. package/dist/runtime/app/utils/block-editor.d.ts +22 -0
  225. package/dist/runtime/app/utils/block-editor.js +12 -0
  226. package/dist/runtime/app/utils/keyboard.d.ts +6 -0
  227. package/dist/runtime/app/utils/keyboard.js +52 -0
  228. package/dist/runtime/app/utils/redirects.d.ts +6 -0
  229. package/dist/runtime/app/utils/redirects.js +7 -0
  230. package/dist/runtime/app/utils/ui.d.ts +8 -0
  231. package/dist/runtime/app/utils/ui.js +15 -1
  232. package/dist/runtime/app/utils/users.d.ts +15 -0
  233. package/dist/runtime/app/utils/users.js +14 -0
  234. package/dist/runtime/assets/cms.css +1 -1
  235. package/dist/runtime/generate.js +16 -2
  236. package/dist/runtime/server/api/collection-export.get.js +3 -2
  237. package/dist/runtime/server/api/collection-import.post.js +39 -11
  238. package/dist/runtime/server/api/collection.get.js +29 -10
  239. package/dist/runtime/server/api/collection.post.js +28 -11
  240. package/dist/runtime/server/api/collection.put.js +35 -13
  241. package/dist/runtime/server/api/item.delete.js +19 -7
  242. package/dist/runtime/server/api/item.get.js +3 -2
  243. package/dist/runtime/server/api/item.put.js +52 -18
  244. package/dist/runtime/server/api/link-usage.post.d.ts +5 -0
  245. package/dist/runtime/server/api/link-usage.post.js +21 -0
  246. package/dist/runtime/server/api/media-delete.post.js +4 -2
  247. package/dist/runtime/server/api/media-download.get.js +2 -2
  248. package/dist/runtime/server/api/media-folder.delete.js +8 -2
  249. package/dist/runtime/server/api/media-folder.patch.js +10 -2
  250. package/dist/runtime/server/api/media-folder.post.js +4 -2
  251. package/dist/runtime/server/api/media-move.post.js +7 -4
  252. package/dist/runtime/server/api/media-presign.post.js +2 -2
  253. package/dist/runtime/server/api/media-upload.put.js +2 -2
  254. package/dist/runtime/server/api/media-usage.post.d.ts +2 -4
  255. package/dist/runtime/server/api/media-usage.post.js +13 -9
  256. package/dist/runtime/server/api/media.delete.js +4 -2
  257. package/dist/runtime/server/api/media.get.js +22 -7
  258. package/dist/runtime/server/api/media.post.js +4 -2
  259. package/dist/runtime/server/api/media.put.js +33 -16
  260. package/dist/runtime/server/api/preset.delete.d.ts +4 -0
  261. package/dist/runtime/server/api/preset.delete.js +9 -0
  262. package/dist/runtime/server/api/preset.put.d.ts +3 -0
  263. package/dist/runtime/server/api/preset.put.js +23 -0
  264. package/dist/runtime/server/api/presets-field.get.d.ts +3 -0
  265. package/dist/runtime/server/api/presets-field.get.js +13 -0
  266. package/dist/runtime/server/api/presets-field.post.d.ts +3 -0
  267. package/dist/runtime/server/api/presets-field.post.js +36 -0
  268. package/dist/runtime/server/api/presets.get.d.ts +3 -0
  269. package/dist/runtime/server/api/presets.get.js +7 -0
  270. package/dist/runtime/server/api/preview-link.delete.d.ts +4 -0
  271. package/dist/runtime/server/api/preview-link.delete.js +15 -0
  272. package/dist/runtime/server/api/preview-links.get.d.ts +3 -0
  273. package/dist/runtime/server/api/preview-links.get.js +10 -0
  274. package/dist/runtime/server/api/preview-links.post.d.ts +3 -0
  275. package/dist/runtime/server/api/preview-links.post.js +17 -0
  276. package/dist/runtime/server/api/preview.get.d.ts +3 -0
  277. package/dist/runtime/server/api/preview.get.js +7 -0
  278. package/dist/runtime/server/api/redirect.delete.d.ts +4 -0
  279. package/dist/runtime/server/api/redirect.delete.js +10 -0
  280. package/dist/runtime/server/api/redirect.put.d.ts +3 -0
  281. package/dist/runtime/server/api/redirect.put.js +8 -0
  282. package/dist/runtime/server/api/redirects-import.post.d.ts +3 -0
  283. package/dist/runtime/server/api/redirects-import.post.js +13 -0
  284. package/dist/runtime/server/api/redirects.get.d.ts +3 -0
  285. package/dist/runtime/server/api/redirects.get.js +7 -0
  286. package/dist/runtime/server/api/redirects.post.d.ts +3 -0
  287. package/dist/runtime/server/api/redirects.post.js +7 -0
  288. package/dist/runtime/server/api/search.get.js +8 -3
  289. package/dist/runtime/server/api/settings.delete.js +2 -2
  290. package/dist/runtime/server/api/settings.get.js +4 -2
  291. package/dist/runtime/server/api/settings.put.js +2 -2
  292. package/dist/runtime/server/api/site.get.d.ts +3 -0
  293. package/dist/runtime/server/api/site.get.js +7 -0
  294. package/dist/runtime/server/api/site.put.d.ts +3 -0
  295. package/dist/runtime/server/api/site.put.js +16 -0
  296. package/dist/runtime/server/api/tags.get.js +3 -2
  297. package/dist/runtime/server/api/user.delete.js +8 -2
  298. package/dist/runtime/server/api/user.put.js +14 -4
  299. package/dist/runtime/server/api/users.get.js +2 -2
  300. package/dist/runtime/server/api/users.post.js +8 -4
  301. package/dist/runtime/server/middleware/hidden-site.d.ts +2 -0
  302. package/dist/runtime/server/middleware/hidden-site.js +8 -0
  303. package/dist/runtime/server/middleware/preview-links.d.ts +2 -0
  304. package/dist/runtime/server/middleware/preview-links.js +6 -0
  305. package/dist/runtime/server/middleware/redirects.d.ts +2 -0
  306. package/dist/runtime/server/middleware/redirects.js +18 -0
  307. package/dist/runtime/server/plugins/session-validate.js +4 -1
  308. package/dist/runtime/server/plugins/webhooks.d.ts +3 -0
  309. package/dist/runtime/server/plugins/webhooks.js +27 -0
  310. package/dist/runtime/server/routes/graphql.js +5 -3
  311. package/dist/runtime/server/routes/robots.d.ts +2 -0
  312. package/dist/runtime/server/routes/robots.js +16 -0
  313. package/dist/runtime/server/routes/sitemap.d.ts +2 -0
  314. package/dist/runtime/server/routes/sitemap.js +67 -0
  315. package/dist/runtime/server/utils/cached-value.d.ts +5 -0
  316. package/dist/runtime/server/utils/cached-value.js +24 -0
  317. package/dist/runtime/server/utils/content-routes.d.ts +5 -0
  318. package/dist/runtime/server/utils/content-routes.js +29 -0
  319. package/dist/runtime/server/utils/field-rules.d.ts +19 -0
  320. package/dist/runtime/server/utils/field-rules.js +72 -0
  321. package/dist/runtime/server/utils/graphql.d.ts +3 -1
  322. package/dist/runtime/server/utils/graphql.js +145 -29
  323. package/dist/runtime/server/utils/hooks.d.ts +14 -0
  324. package/dist/runtime/server/utils/hooks.js +71 -0
  325. package/dist/runtime/server/utils/import.d.ts +7 -2
  326. package/dist/runtime/server/utils/import.js +108 -14
  327. package/dist/runtime/server/utils/link-usage.d.ts +4 -0
  328. package/dist/runtime/server/utils/link-usage.js +28 -0
  329. package/dist/runtime/server/utils/media-references.d.ts +6 -1
  330. package/dist/runtime/server/utils/media-references.js +49 -20
  331. package/dist/runtime/server/utils/media-usage.d.ts +2 -0
  332. package/dist/runtime/server/utils/media-usage.js +5 -3
  333. package/dist/runtime/server/utils/page-rows.d.ts +2 -0
  334. package/dist/runtime/server/utils/page-rows.js +42 -29
  335. package/dist/runtime/server/utils/permissions.d.ts +14 -0
  336. package/dist/runtime/server/utils/permissions.js +43 -0
  337. package/dist/runtime/server/utils/presets.d.ts +18 -0
  338. package/dist/runtime/server/utils/presets.js +68 -0
  339. package/dist/runtime/server/utils/preview-links.d.ts +207 -0
  340. package/dist/runtime/server/utils/preview-links.js +161 -0
  341. package/dist/runtime/server/utils/redirects.d.ts +31 -0
  342. package/dist/runtime/server/utils/redirects.js +240 -0
  343. package/dist/runtime/server/utils/registry.js +4 -1
  344. package/dist/runtime/server/utils/relations.d.ts +8 -0
  345. package/dist/runtime/server/utils/relations.js +25 -6
  346. package/dist/runtime/server/utils/require-admin.d.ts +0 -1
  347. package/dist/runtime/server/utils/require-admin.js +4 -8
  348. package/dist/runtime/server/utils/search.d.ts +1 -0
  349. package/dist/runtime/server/utils/search.js +44 -19
  350. package/dist/runtime/server/utils/single-row.d.ts +3 -0
  351. package/dist/runtime/server/utils/single-row.js +4 -0
  352. package/dist/runtime/server/utils/site.d.ts +23 -0
  353. package/dist/runtime/server/utils/site.js +79 -0
  354. package/dist/runtime/server/utils/sitemap.d.ts +12 -0
  355. package/dist/runtime/server/utils/sitemap.js +109 -0
  356. package/dist/runtime/server/utils/user-management.d.ts +4 -0
  357. package/dist/runtime/server/utils/user-management.js +20 -0
  358. package/dist/runtime/server/utils/users.d.ts +1 -1
  359. package/dist/runtime/server/utils/users.js +1 -1
  360. package/dist/runtime/server/utils/visibility.d.ts +1 -0
  361. package/dist/runtime/server/utils/visibility.js +6 -1
  362. package/dist/runtime/server/utils/webhooks.d.ts +24 -0
  363. package/dist/runtime/server/utils/webhooks.js +90 -0
  364. package/dist/runtime/shared/block-paths.d.ts +66 -0
  365. package/dist/runtime/shared/block-paths.js +310 -0
  366. package/dist/runtime/shared/block-picker.d.ts +18 -0
  367. package/dist/runtime/shared/block-picker.js +31 -0
  368. package/dist/runtime/shared/block-signature.d.ts +4 -0
  369. package/dist/runtime/shared/block-signature.js +46 -0
  370. package/dist/runtime/shared/clipboard.d.ts +31 -0
  371. package/dist/runtime/shared/clipboard.js +206 -0
  372. package/dist/runtime/shared/conditions.d.ts +36 -0
  373. package/dist/runtime/shared/conditions.js +100 -0
  374. package/dist/runtime/shared/content-routes.d.ts +42 -0
  375. package/dist/runtime/shared/content-routes.js +237 -0
  376. package/dist/runtime/shared/duplicate.js +2 -1
  377. package/dist/runtime/shared/editor-layout.d.ts +18 -0
  378. package/dist/runtime/shared/editor-layout.js +9 -0
  379. package/dist/runtime/shared/field-options.d.ts +21 -0
  380. package/dist/runtime/shared/field-options.js +90 -0
  381. package/dist/runtime/shared/graphql-sdl.d.ts +1 -0
  382. package/dist/runtime/shared/graphql-sdl.js +50 -26
  383. package/dist/runtime/shared/history.d.ts +27 -0
  384. package/dist/runtime/shared/history.js +123 -0
  385. package/dist/runtime/shared/hooks.d.ts +45 -0
  386. package/dist/runtime/shared/hooks.js +28 -0
  387. package/dist/runtime/shared/index.d.ts +90 -21
  388. package/dist/runtime/shared/index.js +121 -37
  389. package/dist/runtime/shared/inline-text.d.ts +38 -0
  390. package/dist/runtime/shared/inline-text.js +85 -0
  391. package/dist/runtime/shared/layout.d.ts +2 -1
  392. package/dist/runtime/shared/layout.js +3 -0
  393. package/dist/runtime/shared/links.d.ts +48 -0
  394. package/dist/runtime/shared/links.js +155 -0
  395. package/dist/runtime/shared/list-filters.d.ts +2 -0
  396. package/dist/runtime/shared/list-filters.js +2 -0
  397. package/dist/runtime/shared/media-focal.d.ts +30 -0
  398. package/dist/runtime/shared/media-focal.js +52 -0
  399. package/dist/runtime/shared/migrations-dir.d.ts +14 -0
  400. package/dist/runtime/shared/migrations-dir.js +48 -2
  401. package/dist/runtime/shared/presets.d.ts +67 -0
  402. package/dist/runtime/shared/presets.js +127 -0
  403. package/dist/runtime/shared/preview-links.d.ts +64 -0
  404. package/dist/runtime/shared/preview-links.js +54 -0
  405. package/dist/runtime/shared/preview.d.ts +124 -21
  406. package/dist/runtime/shared/preview.js +419 -81
  407. package/dist/runtime/shared/redirects.d.ts +75 -0
  408. package/dist/runtime/shared/redirects.js +230 -0
  409. package/dist/runtime/shared/roles.d.ts +57 -0
  410. package/dist/runtime/shared/roles.js +293 -0
  411. package/dist/runtime/shared/save-state.d.ts +8 -0
  412. package/dist/runtime/shared/save-state.js +15 -0
  413. package/dist/runtime/shared/search.d.ts +16 -1
  414. package/dist/runtime/shared/search.js +41 -7
  415. package/dist/runtime/shared/seo.d.ts +167 -0
  416. package/dist/runtime/shared/seo.js +335 -0
  417. package/dist/runtime/shared/transfer.js +2 -1
  418. package/dist/runtime/shared/translations.d.ts +29 -0
  419. package/dist/runtime/shared/translations.js +123 -0
  420. package/dist/runtime/shared/users.d.ts +1 -1
  421. package/dist/runtime/shared/validation.d.ts +23 -1
  422. package/dist/runtime/shared/validation.js +214 -64
  423. package/dist/runtime/webhooks.d.ts +33 -0
  424. package/dist/runtime/webhooks.js +57 -0
  425. package/dist/types.d.mts +5 -1
  426. package/package.json +6 -2
  427. package/dist/runtime/app/components/cms/BlockOutline.vue +0 -88
  428. package/dist/runtime/app/components/cms/BlockPalette.vue +0 -31
  429. package/dist/runtime/app/components/cms/SettingsModal.d.vue.ts +0 -12
  430. package/dist/runtime/app/components/cms/SettingsModal.vue +0 -126
  431. package/dist/runtime/app/components/cms/SettingsModal.vue.d.ts +0 -12
  432. package/dist/runtime/app/composables/cms-field-focus.d.ts +0 -4
  433. package/dist/runtime/app/composables/cms-field-focus.js +0 -20
@@ -1,62 +1,46 @@
1
1
  <template>
2
- <div class="cms-settings-columns">
3
- <p class="cms-settings-hint">
4
- Choose the columns of the table. Drag the visible columns to change their order.
5
- </p>
6
- <ul class="cms-settings-list">
7
- <li
8
- v-for="(key, index) in model"
9
- :key="key"
10
- class="cms-settings-item is-draggable"
11
- :class="{
12
- 'is-dragging': dragging === key,
13
- 'is-drop-before': dropIndex === index && dragging !== key
14
- }"
15
- draggable="true"
16
- @dragstart="onDragStart($event, key)"
17
- @dragover.prevent="dropIndex = index"
18
- @drop.prevent="onDrop(index)"
19
- @dragend="onDragEnd"
20
- >
21
- <KIcon :name="cmsIcon('bars-2')" class="cms-settings-grip" />
22
- <KIcon :name="cmsIcon(iconOf(key))" class="cms-settings-item-icon" />
23
- <span class="cms-settings-item-label">{{ labelOf(key) }}</span>
2
+ <KStack gap="sm">
3
+ <KFieldMessage
4
+ tone="neutral"
5
+ :icon="false"
6
+ message="Choose the columns of the table. Drag the visible columns to change their order."
7
+ />
8
+ <KSortableList v-model="visible" label="Visible columns" size="sm">
9
+ <template #trailing="{ item }">
24
10
  <KSwitch
25
11
  :model-value="true"
26
- :aria-label="`Hide ${labelOf(key)}`"
12
+ :aria-label="`Hide ${item.label}`"
27
13
  :disabled="model.length === 1"
28
- @update:model-value="hide(key)"
14
+ @update:model-value="hide(String(item.value))"
29
15
  />
30
- </li>
31
- <li
32
- v-if="dragging"
33
- class="cms-settings-drop-end"
34
- :class="{ 'is-over': dropIndex === model.length }"
35
- @dragover.prevent="dropIndex = model.length"
36
- @drop.prevent="onDrop(model.length)"
37
- />
38
- </ul>
16
+ </template>
17
+ </KSortableList>
39
18
 
40
19
  <template v-if="hidden.length">
41
- <p class="cms-settings-subtitle">Hidden</p>
42
- <ul class="cms-settings-list">
43
- <li v-for="key in hidden" :key="key" class="cms-settings-item is-muted">
44
- <KIcon :name="cmsIcon(iconOf(key))" class="cms-settings-item-icon" />
45
- <span class="cms-settings-item-label">{{ labelOf(key) }}</span>
20
+ <KSeparator variant="heading" label="Hidden" :level="3" />
21
+ <KSortableList :model-value="hidden" label="Hidden columns" size="sm" disabled>
22
+ <template #trailing="{ item }">
46
23
  <KSwitch
47
24
  :model-value="false"
48
- :aria-label="`Show ${labelOf(key)}`"
49
- @update:model-value="show(key)"
25
+ :aria-label="`Show ${item.label}`"
26
+ @update:model-value="show(String(item.value))"
50
27
  />
51
- </li>
52
- </ul>
28
+ </template>
29
+ </KSortableList>
53
30
  </template>
54
- </div>
31
+ </KStack>
55
32
  </template>
56
33
 
57
34
  <script setup>
58
- import { Icon as KIcon, Switch as KSwitch } from "@xleddyl/443-components-vue";
59
- import { computed, ref } from "#imports";
35
+ import {
36
+ FieldMessage as KFieldMessage,
37
+ Separator as KSeparator,
38
+ SortableList as KSortableList,
39
+ Stack as KStack,
40
+ Switch as KSwitch
41
+ } from "@xleddyl/443-components-vue";
42
+ import { computed } from "#imports";
43
+ import { TRANSLATIONS_COLUMN } from "../../../shared/translations";
60
44
  import { cmsIcon, fieldIcon } from "../../utils/ui";
61
45
  const props = defineProps({
62
46
  fields: { type: Object, required: true },
@@ -64,13 +48,28 @@ const props = defineProps({
64
48
  });
65
49
  const model = defineModel({ type: Array, ...{ required: true } });
66
50
  const available = computed(() => [...Object.keys(props.fields), ...props.extra]);
67
- const hidden = computed(() => available.value.filter((key) => !model.value.includes(key)));
51
+ function columnItem(key) {
52
+ return { value: key, label: labelOf(key), icon: cmsIcon(iconOf(key)) };
53
+ }
54
+ const hidden = computed(
55
+ () => available.value.filter((key) => !model.value.includes(key)).map(columnItem)
56
+ );
57
+ const visible = computed({
58
+ get: () => model.value.map(columnItem),
59
+ set: (items) => {
60
+ model.value = items.map((item) => String(item.value));
61
+ }
62
+ });
63
+ const EXTRA_COLUMNS = {
64
+ status: { label: "Status", icon: "check-circle" },
65
+ [TRANSLATIONS_COLUMN]: { label: "Translations", icon: "language" }
66
+ };
68
67
  function labelOf(key) {
69
- return props.fields[key]?.label ?? (key === "status" ? "Status" : key);
68
+ return props.fields[key]?.label ?? EXTRA_COLUMNS[key]?.label ?? key;
70
69
  }
71
70
  function iconOf(key) {
72
71
  const field = props.fields[key];
73
- return field ? fieldIcon(field) : "check-circle";
72
+ return field ? fieldIcon(field) : EXTRA_COLUMNS[key]?.icon ?? "check-circle";
74
73
  }
75
74
  function hide(key) {
76
75
  if (model.value.length === 1) return;
@@ -79,25 +78,4 @@ function hide(key) {
79
78
  function show(key) {
80
79
  model.value = [...model.value, key];
81
80
  }
82
- const dragging = ref(null);
83
- const dropIndex = ref(null);
84
- function onDragStart(event, key) {
85
- dragging.value = key;
86
- event.dataTransfer?.setData("text/plain", key);
87
- if (event.dataTransfer) event.dataTransfer.effectAllowed = "move";
88
- }
89
- function onDrop(index) {
90
- const key = dragging.value;
91
- if (key) {
92
- const next = model.value.filter((k) => k !== key);
93
- const from = model.value.indexOf(key);
94
- next.splice(from < index ? index - 1 : index, 0, key);
95
- model.value = next;
96
- }
97
- onDragEnd();
98
- }
99
- function onDragEnd() {
100
- dragging.value = null;
101
- dropIndex.value = null;
102
- }
103
81
  </script>
@@ -0,0 +1,13 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ label?: string;
4
+ newLabel: string;
5
+ icon?: string;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ open: (page: SettingsModalPage) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onOpen?: ((page: SettingsModalPage) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <KButton
3
+ :icon="cmsIcon(icon)"
4
+ size="sm"
5
+ @click="emit('open', { id: CMS_NEW_RECORD, label: newLabel })"
6
+ >
7
+ {{ label }}
8
+ </KButton>
9
+ </template>
10
+
11
+ <script setup>
12
+ import { Button as KButton } from "@xleddyl/443-components-vue";
13
+ import { CMS_NEW_RECORD } from "../../composables/cms-route";
14
+ import { cmsIcon } from "../../utils/ui";
15
+ defineProps({
16
+ label: { type: String, required: false, default: "Add" },
17
+ newLabel: { type: String, required: true },
18
+ icon: { type: String, required: false, default: "plus" }
19
+ });
20
+ const emit = defineEmits(["open"]);
21
+ </script>
@@ -0,0 +1,13 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ label?: string;
4
+ newLabel: string;
5
+ icon?: string;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ open: (page: SettingsModalPage) => any;
9
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
10
+ onOpen?: ((page: SettingsModalPage) => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ page?: SettingsModalPage;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ open: (page: SettingsModalPage) => any;
7
+ back: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onOpen?: ((page: SettingsModalPage) => any) | undefined;
10
+ onBack?: (() => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,50 @@
1
+ <template>
2
+ <CmsSettingsEntry v-if="page && entryNames.includes(page.id)" :key="page.id" :name="page.id" />
3
+ <KRecordList
4
+ v-else
5
+ :items="items"
6
+ label="Content types"
7
+ :empty-icon="cmsIcon('view-columns')"
8
+ empty-text="No content types"
9
+ empty-description="Your role cannot read any content type."
10
+ @row-click="(item2) => open(String(item2.id), item2.title)"
11
+ >
12
+ <template #action="{ item }">
13
+ <KButton
14
+ icon="chevron-right"
15
+ variant="ghost"
16
+ tone="neutral"
17
+ size="sm"
18
+ square
19
+ aria-label="Open"
20
+ @click="open(String(item.id), item.title)"
21
+ />
22
+ </template>
23
+ </KRecordList>
24
+ </template>
25
+
26
+ <script setup>
27
+ import { Button as KButton, RecordList as KRecordList } from "@xleddyl/443-components-vue";
28
+ import { computed, watch } from "#imports";
29
+ import { useCmsEntrySettings, useCmsSettingsEntries } from "../../composables/cms-entry-settings";
30
+ import { cmsIcon } from "../../utils/ui";
31
+ const props = defineProps({
32
+ page: { type: Object, required: false }
33
+ });
34
+ const emit = defineEmits(["open", "back"]);
35
+ const entries = useCmsSettingsEntries();
36
+ const { status } = useCmsEntrySettings(() => props.page?.id);
37
+ const entryNames = computed(() => entries.value.map((entry) => entry.name));
38
+ const items = computed(
39
+ () => entries.value.map((entry) => ({ id: entry.name, title: entry.label, description: entry.kind }))
40
+ );
41
+ watch(
42
+ () => props.page?.id,
43
+ () => {
44
+ status.value = "idle";
45
+ }
46
+ );
47
+ function open(id, label) {
48
+ emit("open", { id, label });
49
+ }
50
+ </script>
@@ -0,0 +1,13 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ page?: SettingsModalPage;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ open: (page: SettingsModalPage) => any;
7
+ back: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onOpen?: ((page: SettingsModalPage) => any) | undefined;
10
+ onBack?: (() => any) | undefined;
11
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -1,15 +1,6 @@
1
- type Status = 'idle' | 'saving' | 'saved' | 'error';
2
1
  type __VLS_Props = {
3
2
  name: string;
4
3
  };
5
- type __VLS_ModelProps = {
6
- 'status'?: Status;
7
- };
8
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
- "update:status": (value: Status) => any;
11
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- "onUpdate:status"?: ((value: Status) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
5
  declare const _default: typeof __VLS_export;
15
6
  export default _default;
@@ -1,110 +1,26 @@
1
1
  <template>
2
- <div class="cms-settings-entry">
3
- <KTabs
4
- v-if="parts.length > 1"
5
- v-model="activePart"
6
- :items="parts"
7
- :label="`${entry.label} settings`"
8
- size="sm"
9
- lazy
10
- :panel-focusable="false"
11
- >
12
- <template #panel-columns>
13
- <CmsSettingsColumns
14
- :model-value="columns"
15
- :fields="entry.fields"
16
- :extra="listExtraColumns(name)"
17
- @update:model-value="saveColumns"
18
- />
19
- </template>
20
- <template #panel-layout>
21
- <CmsSettingsLayout
22
- :model-value="layout"
23
- :fields="fields"
24
- :tabs="entry.tabs"
25
- @update:model-value="saveLayout"
26
- />
27
- </template>
28
- </KTabs>
2
+ <div :id="CMS_ENTRY_SETTINGS_PANEL" class="cms-settings-entry">
3
+ <CmsSettingsColumns
4
+ v-if="part === 'columns' && entry"
5
+ :model-value="columns"
6
+ :fields="entry.fields"
7
+ :extra="extraColumns"
8
+ @update:model-value="saveColumns"
9
+ />
29
10
  <CmsSettingsLayout
30
- v-else
11
+ v-else-if="entry"
31
12
  :model-value="layout"
32
13
  :fields="fields"
33
14
  :tabs="entry.tabs"
34
15
  @update:model-value="saveLayout"
35
16
  />
36
-
37
- <div class="cms-settings-footer">
38
- <KButton
39
- label="Reset to default"
40
- :icon="cmsIcon('arrow-uturn-left')"
41
- variant="ghost"
42
- tone="neutral"
43
- size="sm"
44
- :disabled="!isCustom"
45
- @click="resetPart"
46
- />
47
- </div>
48
17
  </div>
49
18
  </template>
50
19
 
51
20
  <script setup>
52
- import { Button as KButton, Tabs as KTabs } from "@xleddyl/443-components-vue";
53
- import { computed, ref } from "#imports";
54
- import cmsConfig from "#cms-config";
55
- import {
56
- entryFields,
57
- entryFormLayout,
58
- entryListColumns,
59
- listExtraColumns,
60
- useCmsSettings
61
- } from "../../composables/cms-settings";
62
- import { useCmsToast } from "../../composables/cms-toast";
63
- import { cmsIcon, errorMessage } from "../../utils/ui";
21
+ import { CMS_ENTRY_SETTINGS_PANEL, useCmsEntrySettings } from "../../composables/cms-entry-settings";
64
22
  const props = defineProps({
65
23
  name: { type: String, required: true }
66
24
  });
67
- const status = defineModel("status", { type: String, ...{ default: "idle" } });
68
- const { settings, save, reset } = useCmsSettings();
69
- const toast = useCmsToast();
70
- const entry = computed(() => cmsConfig[props.name]);
71
- const fields = computed(() => entryFields(props.name));
72
- const parts = computed(() => [
73
- ...entry.value.kind === "collection" || entry.value.kind === "content" ? [{ value: "columns", label: "Table columns" }] : [],
74
- { value: "layout", label: "Form layout" }
75
- ]);
76
- const activePart = ref(parts.value[0].value);
77
- const columns = computed(() => entryListColumns(props.name, settings.value));
78
- const layout = computed(() => entryFormLayout(props.name, settings.value, fields.value));
79
- const isCustom = computed(() => {
80
- const saved = settings.value[props.name];
81
- return activePart.value === "columns" ? !!saved?.columns : !!saved?.layout;
82
- });
83
- async function persist(next) {
84
- status.value = "saving";
85
- try {
86
- if (!next.columns && !next.layout) await reset(props.name);
87
- else await save(props.name, next);
88
- status.value = "saved";
89
- } catch (error) {
90
- status.value = "error";
91
- toast.add({ title: "Settings not saved", description: errorMessage(error), color: "error" });
92
- }
93
- }
94
- function current() {
95
- const saved = settings.value[props.name] ?? {};
96
- return { columns: saved.columns, layout: saved.layout };
97
- }
98
- function saveColumns(value) {
99
- void persist({ ...current(), columns: value });
100
- }
101
- function saveLayout(value) {
102
- void persist({ ...current(), layout: value });
103
- }
104
- function resetPart() {
105
- const next = current();
106
- if (activePart.value === "columns") next.columns = void 0;
107
- else next.layout = void 0;
108
- void persist(next);
109
- }
25
+ const { entry, part, fields, columns, layout, extraColumns, saveColumns, saveLayout } = useCmsEntrySettings(() => props.name);
110
26
  </script>
@@ -1,15 +1,6 @@
1
- type Status = 'idle' | 'saving' | 'saved' | 'error';
2
1
  type __VLS_Props = {
3
2
  name: string;
4
3
  };
5
- type __VLS_ModelProps = {
6
- 'status'?: Status;
7
- };
8
- type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
- "update:status": (value: Status) => any;
11
- }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- "onUpdate:status"?: ((value: Status) => any) | undefined;
13
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
5
  declare const _default: typeof __VLS_export;
15
6
  export default _default;
@@ -0,0 +1,7 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ page?: SettingsModalPage;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <template v-if="page">
3
+ <KBadge
4
+ :label="ENTRY_SETTINGS_STATUS_LABELS[status]"
5
+ :tone="STATUS_TONES[status]"
6
+ :pulse="status === 'saving'"
7
+ variant="outline"
8
+ dot
9
+ aria-live="polite"
10
+ />
11
+ <KButton
12
+ variant="soft"
13
+ tone="neutral"
14
+ size="sm"
15
+ :icon="cmsIcon('arrow-uturn-left')"
16
+ :disabled="!isCustom"
17
+ disabled-reason="This part already uses the default"
18
+ @click="resetPart"
19
+ >
20
+ Reset to default
21
+ </KButton>
22
+ </template>
23
+ </template>
24
+
25
+ <script setup>
26
+ import { Badge as KBadge, Button as KButton } from "@xleddyl/443-components-vue";
27
+ import {
28
+ ENTRY_SETTINGS_STATUS_LABELS,
29
+ useCmsEntrySettings
30
+ } from "../../composables/cms-entry-settings";
31
+ import { cmsIcon } from "../../utils/ui";
32
+ const props = defineProps({
33
+ page: { type: Object, required: false }
34
+ });
35
+ const STATUS_TONES = {
36
+ idle: "neutral",
37
+ saving: "neutral",
38
+ saved: "success",
39
+ error: "danger"
40
+ };
41
+ const { status, isCustom, resetPart } = useCmsEntrySettings(() => props.page?.id);
42
+ </script>
@@ -0,0 +1,7 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ page?: SettingsModalPage;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ page?: SettingsModalPage;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,21 @@
1
+ <template>
2
+ <KTabs
3
+ v-if="page && parts.length > 1"
4
+ :model-value="part"
5
+ :items="parts"
6
+ variant="underline"
7
+ size="sm"
8
+ label="Layout parts"
9
+ :controls="CMS_ENTRY_SETTINGS_PANEL"
10
+ @update:model-value="(value) => part = value"
11
+ />
12
+ </template>
13
+
14
+ <script setup>
15
+ import { Tabs as KTabs } from "@xleddyl/443-components-vue";
16
+ import { CMS_ENTRY_SETTINGS_PANEL, useCmsEntrySettings } from "../../composables/cms-entry-settings";
17
+ const props = defineProps({
18
+ page: { type: Object, required: false }
19
+ });
20
+ const { parts, part } = useCmsEntrySettings(() => props.page?.id);
21
+ </script>
@@ -0,0 +1,7 @@
1
+ import type { SettingsModalPage } from '@xleddyl/443-components-vue';
2
+ type __VLS_Props = {
3
+ page?: SettingsModalPage;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <KButton
3
+ v-if="formAction"
4
+ type="submit"
5
+ size="sm"
6
+ :form="formAction.id"
7
+ :loading="formAction.submitting"
8
+ >
9
+ {{ formAction.label }}
10
+ </KButton>
11
+ </template>
12
+
13
+ <script setup>
14
+ import { Button as KButton } from "@xleddyl/443-components-vue";
15
+ import { useCmsSettingsFormAction } from "../../composables/cms-settings-form";
16
+ const formAction = useCmsSettingsFormAction();
17
+ </script>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -1,20 +1,21 @@
1
1
  <template>
2
2
  <div class="cms-layout-editor" :class="{ 'is-dragging': dragging }">
3
- <p class="cms-settings-hint">
4
- Drag a field up or down to move it. Drop it on the side of another field to put them in the
5
- same row (up to {{ MAX_LAYOUT_ROW_FIELDS }}).
6
- </p>
3
+ <KFieldMessage
4
+ tone="neutral"
5
+ :icon="false"
6
+ :message="`Drag a field up or down to move it. Drop it on the side of another field to put them in the same row (up to ${MAX_LAYOUT_ROW_FIELDS}).`"
7
+ />
7
8
  <div class="cms-layout-areas">
8
9
  <div v-for="area in AREAS" :key="area.id" class="cms-layout-area" :class="`is-${area.id}`">
9
- <div
10
+ <KCard
10
11
  v-if="!model[area.id].some((section2) => section2.rows.length || section2.title)"
11
- class="cms-layout-empty"
12
- :class="{ 'is-over': isOver({ type: 'area', area: area.id }) }"
12
+ variant="dashed"
13
+ :title="area.empty"
14
+ :selected="isOver({ type: 'area', area: area.id })"
15
+ :animated="false"
13
16
  @dragover.prevent="setTarget({ type: 'area', area: area.id })"
14
17
  @drop.prevent="drop"
15
- >
16
- {{ area.empty }}
17
- </div>
18
+ />
18
19
  <div
19
20
  v-for="(section, sectionIndex) in model[area.id]"
20
21
  v-else
@@ -24,9 +25,7 @@
24
25
  >
25
26
  <p v-if="section.title" class="cms-layout-section-title">
26
27
  {{ section.title }}
27
- <KBadge v-if="section.collapsed" size="sm" class="cms-code-badge"
28
- >Collapsed</KBadge
29
- >
28
+ <KBadge v-if="section.collapsed" size="sm" class="cms-code">Collapsed</KBadge>
30
29
  </p>
31
30
  <template v-for="(row, rowIndex) in section.rows" :key="row.join('|')">
32
31
  <div
@@ -82,7 +81,12 @@
82
81
 
83
82
  <script setup>
84
83
  import { MAX_LAYOUT_ROW_FIELDS, fieldTab } from "#nuxt-cms";
85
- import { Badge as KBadge, Icon as KIcon } from "@xleddyl/443-components-vue";
84
+ import {
85
+ Badge as KBadge,
86
+ Card as KCard,
87
+ FieldMessage as KFieldMessage,
88
+ Icon as KIcon
89
+ } from "@xleddyl/443-components-vue";
86
90
  import { ref } from "#imports";
87
91
  import { cmsIcon, fieldIcon } from "../../utils/ui";
88
92
  const AREAS = [{ id: "main", empty: "Drop fields here" }];
@@ -0,0 +1,11 @@
1
+ import type { CmsBlockPreset } from '../../../shared/presets.js';
2
+ type __VLS_Props = {
3
+ preset: CmsBlockPreset;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ saved: (preset: CmsBlockPreset) => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onSaved?: ((preset: CmsBlockPreset) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;