@xleddyl/nuxt-cms 0.9.4 → 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 (431) 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 +27 -9
  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 +143 -28
  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/site.d.ts +23 -0
  351. package/dist/runtime/server/utils/site.js +79 -0
  352. package/dist/runtime/server/utils/sitemap.d.ts +12 -0
  353. package/dist/runtime/server/utils/sitemap.js +109 -0
  354. package/dist/runtime/server/utils/user-management.d.ts +4 -0
  355. package/dist/runtime/server/utils/user-management.js +20 -0
  356. package/dist/runtime/server/utils/users.d.ts +1 -1
  357. package/dist/runtime/server/utils/users.js +1 -1
  358. package/dist/runtime/server/utils/visibility.d.ts +1 -0
  359. package/dist/runtime/server/utils/visibility.js +6 -1
  360. package/dist/runtime/server/utils/webhooks.d.ts +24 -0
  361. package/dist/runtime/server/utils/webhooks.js +90 -0
  362. package/dist/runtime/shared/block-paths.d.ts +66 -0
  363. package/dist/runtime/shared/block-paths.js +310 -0
  364. package/dist/runtime/shared/block-picker.d.ts +18 -0
  365. package/dist/runtime/shared/block-picker.js +31 -0
  366. package/dist/runtime/shared/block-signature.d.ts +4 -0
  367. package/dist/runtime/shared/block-signature.js +46 -0
  368. package/dist/runtime/shared/clipboard.d.ts +31 -0
  369. package/dist/runtime/shared/clipboard.js +206 -0
  370. package/dist/runtime/shared/conditions.d.ts +36 -0
  371. package/dist/runtime/shared/conditions.js +100 -0
  372. package/dist/runtime/shared/content-routes.d.ts +42 -0
  373. package/dist/runtime/shared/content-routes.js +237 -0
  374. package/dist/runtime/shared/duplicate.js +2 -1
  375. package/dist/runtime/shared/editor-layout.d.ts +18 -0
  376. package/dist/runtime/shared/editor-layout.js +9 -0
  377. package/dist/runtime/shared/field-options.d.ts +21 -0
  378. package/dist/runtime/shared/field-options.js +90 -0
  379. package/dist/runtime/shared/graphql-sdl.d.ts +1 -0
  380. package/dist/runtime/shared/graphql-sdl.js +50 -26
  381. package/dist/runtime/shared/history.d.ts +27 -0
  382. package/dist/runtime/shared/history.js +123 -0
  383. package/dist/runtime/shared/hooks.d.ts +45 -0
  384. package/dist/runtime/shared/hooks.js +28 -0
  385. package/dist/runtime/shared/index.d.ts +90 -21
  386. package/dist/runtime/shared/index.js +121 -37
  387. package/dist/runtime/shared/inline-text.d.ts +38 -0
  388. package/dist/runtime/shared/inline-text.js +85 -0
  389. package/dist/runtime/shared/layout.d.ts +2 -1
  390. package/dist/runtime/shared/layout.js +3 -0
  391. package/dist/runtime/shared/links.d.ts +48 -0
  392. package/dist/runtime/shared/links.js +155 -0
  393. package/dist/runtime/shared/list-filters.d.ts +2 -0
  394. package/dist/runtime/shared/list-filters.js +2 -0
  395. package/dist/runtime/shared/media-focal.d.ts +30 -0
  396. package/dist/runtime/shared/media-focal.js +52 -0
  397. package/dist/runtime/shared/migrations-dir.d.ts +14 -0
  398. package/dist/runtime/shared/migrations-dir.js +48 -2
  399. package/dist/runtime/shared/presets.d.ts +67 -0
  400. package/dist/runtime/shared/presets.js +127 -0
  401. package/dist/runtime/shared/preview-links.d.ts +64 -0
  402. package/dist/runtime/shared/preview-links.js +54 -0
  403. package/dist/runtime/shared/preview.d.ts +124 -21
  404. package/dist/runtime/shared/preview.js +419 -81
  405. package/dist/runtime/shared/redirects.d.ts +75 -0
  406. package/dist/runtime/shared/redirects.js +230 -0
  407. package/dist/runtime/shared/roles.d.ts +57 -0
  408. package/dist/runtime/shared/roles.js +293 -0
  409. package/dist/runtime/shared/save-state.d.ts +8 -0
  410. package/dist/runtime/shared/save-state.js +15 -0
  411. package/dist/runtime/shared/search.d.ts +16 -1
  412. package/dist/runtime/shared/search.js +41 -7
  413. package/dist/runtime/shared/seo.d.ts +167 -0
  414. package/dist/runtime/shared/seo.js +335 -0
  415. package/dist/runtime/shared/transfer.js +2 -1
  416. package/dist/runtime/shared/translations.d.ts +29 -0
  417. package/dist/runtime/shared/translations.js +123 -0
  418. package/dist/runtime/shared/users.d.ts +1 -1
  419. package/dist/runtime/shared/validation.d.ts +23 -1
  420. package/dist/runtime/shared/validation.js +214 -64
  421. package/dist/runtime/webhooks.d.ts +33 -0
  422. package/dist/runtime/webhooks.js +57 -0
  423. package/dist/types.d.mts +5 -1
  424. package/package.json +6 -2
  425. package/dist/runtime/app/components/cms/BlockOutline.vue +0 -88
  426. package/dist/runtime/app/components/cms/BlockPalette.vue +0 -31
  427. package/dist/runtime/app/components/cms/SettingsModal.d.vue.ts +0 -12
  428. package/dist/runtime/app/components/cms/SettingsModal.vue +0 -126
  429. package/dist/runtime/app/components/cms/SettingsModal.vue.d.ts +0 -12
  430. package/dist/runtime/app/composables/cms-field-focus.d.ts +0 -4
  431. package/dist/runtime/app/composables/cms-field-focus.js +0 -20
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <KRoot class="cms-scope cms-canvas" :theme="theme" preset="default">
2
+ <KRoot class="is-canvas" document :theme="theme" preset="default">
3
3
  <KAuthLogin
4
4
  :submit="login"
5
5
  :submit-error="loginError"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <KRoot class="cms-scope cms-canvas" :theme="theme" preset="default">
2
+ <KRoot class="is-canvas" document :theme="theme" preset="default">
3
3
  <KAuthLogout :logout="clear" :account="account" login-to="/cms/login">
4
4
  <template #brand>
5
5
  <CmsBrandMark size="lg" hide-text />
@@ -1,16 +1,16 @@
1
1
  <template>
2
- <div class="cms-page">
2
+ <div class="k-page">
3
3
  <KPageHeader
4
4
  title="Media"
5
5
  :icon="cmsIcon('photo')"
6
6
  description="Images, videos and files used across your content."
7
7
  >
8
8
  <template #badge>
9
- <KBadge :label="runtime.mediaStorage" size="sm" class="cms-code-badge" />
9
+ <KBadge :label="runtime.mediaStorage" size="sm" class="cms-code" />
10
10
  </template>
11
11
  </KPageHeader>
12
12
 
13
- <CmsMediaGallery v-model:folder="folder" />
13
+ <CmsMediaGallery v-model:folder="folder" fill />
14
14
  </div>
15
15
  </template>
16
16
 
@@ -1,14 +1,23 @@
1
1
  <template>
2
2
  <div class="cms-preview" :data-cms-preview="state ? 'ready' : 'waiting'">
3
3
  <template v-if="state && field">
4
- <component :is="wrapper" v-if="wrapper && item" :item="item" :locale="state.locale">
5
- <CmsBlocks :blocks="blocks" :entry="blockEntry" :field="state.field" annotate />
6
- <div v-if="!visibleCount && canAdd" class="cms-preview-empty">
4
+ <component
5
+ :is="wrapper"
6
+ v-if="wrapper && rendered.item"
7
+ :item="rendered.item"
8
+ :locale="state.locale"
9
+ >
10
+ <CmsBlocks
11
+ :blocks="rendered.blocks"
12
+ :entry="blockEntry"
13
+ :field="state.field"
14
+ annotate
15
+ />
16
+ <div v-if="!visibleCount && canAdd" class="cms-preview-empty" v-bind="tokenRoot">
7
17
  <button
8
18
  type="button"
9
19
  class="cms-preview-empty-button"
10
- data-cms-preview-keep
11
- @click="post({ type: 'insert', index: state.blocks.length })"
20
+ :data-cms-insert="`${state.field}.${state.blocks.length}`"
12
21
  >
13
22
  <KIcon name="plus" />
14
23
  <span>Add a block</span>
@@ -16,13 +25,17 @@
16
25
  </div>
17
26
  </component>
18
27
  <template v-else>
19
- <CmsBlocks :blocks="blocks" :entry="blockEntry" :field="state.field" annotate />
20
- <div v-if="!visibleCount && canAdd" class="cms-preview-empty">
28
+ <CmsBlocks
29
+ :blocks="rendered.blocks"
30
+ :entry="blockEntry"
31
+ :field="state.field"
32
+ annotate
33
+ />
34
+ <div v-if="!visibleCount && canAdd" class="cms-preview-empty" v-bind="tokenRoot">
21
35
  <button
22
36
  type="button"
23
37
  class="cms-preview-empty-button"
24
- data-cms-preview-keep
25
- @click="post({ type: 'insert', index: state.blocks.length })"
38
+ :data-cms-insert="`${state.field}.${state.blocks.length}`"
26
39
  >
27
40
  <KIcon name="plus" />
28
41
  <span>Add a block</span>
@@ -30,21 +43,38 @@
30
43
  </div>
31
44
  </template>
32
45
  <PreviewOverlay
46
+ ref="overlay"
33
47
  :field="field"
34
- :total="state.blocks.length"
48
+ :field-key="state.field"
49
+ :fields="item ? fields : null"
50
+ :blocks="blocks"
51
+ :item="item"
52
+ :locale="state.locale"
53
+ :editable="state.editable"
54
+ :locked-fields="state.lockedFields"
35
55
  :selected="state.selected"
56
+ :highlighted="highlighted"
36
57
  :version="version"
37
58
  @message="post"
59
+ @inline="inline = $event"
38
60
  />
39
61
  </template>
40
- <p v-else-if="standalone" class="cms-preview-notice">
62
+ <p v-else-if="standalone" class="cms-preview-notice" v-bind="tokenRoot">
41
63
  This page shows the live preview of the visual editor. Open an item in the admin to use it.
42
64
  </p>
43
65
  </div>
44
66
  </template>
45
67
 
46
68
  <script setup>
47
- import { canAddBlock, entryFieldsFor, isHiddenBlock } from "#nuxt-cms";
69
+ import {
70
+ canAddBlock,
71
+ contentItemPath,
72
+ entryFieldsFor,
73
+ isHiddenBlock,
74
+ isRoutedContent,
75
+ readLinkValue,
76
+ resolveCmsLink
77
+ } from "#nuxt-cms";
48
78
  import {
49
79
  computed,
50
80
  definePageMeta,
@@ -52,9 +82,11 @@ import {
52
82
  onMounted,
53
83
  ref,
54
84
  shallowRef,
55
- useHead
85
+ useHead,
86
+ watch
56
87
  } from "#imports";
57
88
  import { Icon as KIcon } from "@xleddyl/443-components-vue";
89
+ import tokensHref from "@xleddyl/443-components-vue/tokens.css?url";
58
90
  import cmsConfig from "#cms-config";
59
91
  import { cmsPreviewComponents } from "#cms-blocks";
60
92
  import {
@@ -64,73 +96,129 @@ import {
64
96
  previewEnvelope,
65
97
  previewItem
66
98
  } from "../../shared/preview";
99
+ import { applyInlineOverride } from "../../shared/inline-text";
100
+ import { useCmsLinkTargets } from "../composables/cms-link-targets";
67
101
  import { useCmsRuntime } from "../composables/cms-runtime";
68
102
  import PreviewOverlay from "../preview/PreviewOverlay.vue";
103
+ import {
104
+ cmsFieldMarking,
105
+ cmsPreviewEditable,
106
+ cmsPreviewTheme,
107
+ cmsTokenRoot
108
+ } from "../preview/field-marker";
69
109
  definePageMeta({ middleware: "cms-auth" });
70
110
  const { i18n } = useCmsRuntime();
71
111
  const state = shallowRef(null);
72
112
  const version = ref(0);
113
+ const highlighted = shallowRef(null);
114
+ const overlay = ref(null);
73
115
  const standalone = ref(false);
116
+ const inline = shallowRef(null);
74
117
  useHead({
75
118
  title: "Preview",
76
119
  meta: [{ name: "robots", content: "noindex, nofollow" }],
120
+ link: [{ rel: "stylesheet", href: tokensHref }],
77
121
  htmlAttrs: { lang: computed(() => state.value?.locale) }
78
122
  });
79
123
  const entry = computed(
80
124
  () => state.value ? cmsConfig[state.value.entry] : void 0
81
125
  );
126
+ const tokenRoot = computed(() => cmsTokenRoot(cmsPreviewTheme.value));
82
127
  const blockEntry = computed(() => state.value?.entry);
83
128
  const fields = computed(() => entry.value ? entryFieldsFor(entry.value) : {});
84
129
  const field = computed(() => {
85
130
  const candidate = state.value ? fields.value[state.value.field] : void 0;
86
131
  return candidate?.type === "blocks" ? candidate : void 0;
87
132
  });
133
+ const linkTargets = useCmsLinkTargets(cmsConfig);
134
+ function resolveLink(value) {
135
+ const locale = state.value?.locale ?? i18n.defaultLocale;
136
+ const link = readLinkValue(value);
137
+ const target = link?.entry && link.id && !link.url ? link : null;
138
+ if (target) linkTargets.load(target.entry, target.id);
139
+ const live = target && linkTargets.state(target) === "live";
140
+ const row = live ? linkTargets.target(target.entry, target.id) : null;
141
+ return resolveCmsLink(cmsConfig, value, locale, i18n.defaultLocale, row);
142
+ }
88
143
  const blocks = computed(
89
144
  () => state.value && field.value ? previewBlocks(
90
145
  field.value,
91
146
  state.value.blocks,
92
147
  state.value.locale,
93
148
  i18n.defaultLocale,
94
- state.value.media
149
+ state.value.media,
150
+ resolveLink
95
151
  ) : []
96
152
  );
97
- const visibleCount = computed(() => blocks.value.filter((block) => !isHiddenBlock(block)).length);
153
+ const visibleCount = computed(
154
+ () => rendered.value.blocks.filter((block) => !isHiddenBlock(block)).length
155
+ );
98
156
  const canAdd = computed(
99
157
  () => !!state.value && !!field.value && canAddBlock(field.value, state.value.blocks.length)
100
158
  );
101
- const item = computed(
102
- () => state.value?.item && entry.value?.kind === "content" ? previewItem(
159
+ const item = computed(() => {
160
+ if (!state.value?.item || entry.value?.kind !== "content") return null;
161
+ const preview = previewItem(
103
162
  fields.value,
104
163
  state.value.item,
105
164
  state.value.locale,
106
165
  i18n.defaultLocale,
107
- state.value.media
108
- ) : null
109
- );
166
+ state.value.media,
167
+ resolveLink
168
+ );
169
+ if (!isRoutedContent(entry.value)) return preview;
170
+ return { ...preview, path: contentItemPath(entry.value, state.value.item, state.value.locale) };
171
+ });
172
+ const rendered = computed(() => {
173
+ const view = applyInlineOverride(blocks.value, item.value, inline.value);
174
+ return { blocks: view.blocks, item: view.item };
175
+ });
110
176
  const wrapper = computed(
111
177
  () => state.value && entry.value?.kind === "content" ? cmsPreviewComponents[state.value.entry] : void 0
112
178
  );
113
179
  function post(message) {
114
180
  if (window.parent === window) return;
115
- window.parent.postMessage(previewEnvelope(message), window.location.origin);
181
+ const plain = JSON.parse(JSON.stringify(message));
182
+ window.parent.postMessage(previewEnvelope(plain), window.location.origin);
116
183
  }
117
184
  function onMessage(event) {
118
185
  if (!isTrustedPreviewEvent(event, window.location.origin, window.parent)) return;
119
186
  const message = parseHostMessage(event.data);
120
187
  if (!message) return;
121
- state.value = message.state;
122
- version.value++;
188
+ switch (message.type) {
189
+ case "render":
190
+ if (inline.value?.settled) inline.value = null;
191
+ state.value = message.state;
192
+ cmsPreviewTheme.value = message.state.theme;
193
+ version.value++;
194
+ break;
195
+ case "highlight":
196
+ highlighted.value = message.path;
197
+ break;
198
+ case "reveal":
199
+ void overlay.value?.reveal(message.path);
200
+ break;
201
+ }
123
202
  }
124
203
  onMounted(() => {
204
+ cmsFieldMarking.value = true;
125
205
  standalone.value = window.parent === window;
126
206
  window.addEventListener("message", onMessage);
127
207
  post({ type: "ready" });
128
208
  });
209
+ watch(
210
+ () => !!state.value?.editable && !!field.value,
211
+ (editable) => {
212
+ cmsPreviewEditable.value = editable;
213
+ }
214
+ );
129
215
  onBeforeUnmount(() => {
216
+ cmsFieldMarking.value = false;
217
+ cmsPreviewEditable.value = false;
130
218
  window.removeEventListener("message", onMessage);
131
219
  });
132
220
  </script>
133
221
 
134
222
  <style>
135
- .cms-preview-overlay{--cms-preview-accent:#5b5bd6;--cms-preview-ink:#111114;--cms-preview-surface:#fff;--cms-preview-line:rgba(17,17,20,.12);--cms-preview-danger:#d9383a;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-size:12px;inset:0;line-height:1;pointer-events:none;position:fixed;z-index:2147483000}.cms-preview-outline{border:1px dashed color-mix(in oklab,var(--cms-preview-accent) 70%,transparent);border-radius:2px;box-sizing:border-box;position:absolute}.cms-preview-outline.is-selected{border:2px solid var(--cms-preview-accent);box-shadow:0 0 0 4px color-mix(in oklab,var(--cms-preview-accent) 14%,transparent)}.cms-preview-label{background:var(--cms-preview-accent);border-radius:2px 0 6px 0;color:#fff;font-weight:600;left:-1px;letter-spacing:.01em;padding:4px 7px;position:absolute;top:-1px;white-space:nowrap}.cms-preview-toolbar{align-items:center;background:var(--cms-preview-surface);border-radius:8px;box-shadow:0 0 0 1px var(--cms-preview-line),0 8px 24px -8px rgba(17,17,20,.28);display:flex;gap:2px;padding:3px;pointer-events:auto;position:absolute;transform:translateX(-100%)}.cms-preview-toolbar:not(.is-selected){opacity:.92}.cms-preview-empty-button,.cms-preview-insert,.cms-preview-tool{all:unset;align-items:center;box-sizing:border-box;cursor:pointer;display:inline-flex;justify-content:center}.cms-preview-tool{border-radius:6px;color:var(--cms-preview-ink);height:28px;width:28px}.cms-preview-tool:hover:not(:disabled){background:rgba(17,17,20,.06)}.cms-preview-tool:disabled{cursor:default;opacity:.35}.cms-preview-tool.is-danger{color:var(--cms-preview-danger)}.cms-preview-handle{cursor:grab;touch-action:none}.cms-preview .cms-preview-empty .cms-preview-empty-button:focus-visible,.cms-preview-overlay .cms-preview-insert:focus-visible,.cms-preview-overlay .cms-preview-tool:focus-visible{outline:2px solid var(--cms-preview-accent);outline-offset:2px}.cms-preview-separator{background:var(--cms-preview-line);height:18px;margin:0 2px;width:1px}.cms-preview-overlay svg{flex-shrink:0;height:16px;width:16px}.cms-preview-insert{background:var(--cms-preview-accent);border-radius:999px;box-shadow:0 2px 8px -2px rgba(17,17,20,.4);color:#fff;height:26px;margin:-13px 0 0 -13px;opacity:0;pointer-events:auto;position:absolute;transform:scale(.85);transition:opacity .14s ease,transform .14s ease;width:26px}.cms-preview-insert.is-near,.cms-preview-insert:focus-visible,.cms-preview-insert:hover{opacity:1;transform:scale(1)}.cms-preview-overlay.is-dragging .cms-preview-insert,.cms-preview-overlay.is-dragging .cms-preview-toolbar:not(.is-selected){visibility:hidden}.cms-preview-dropline{background:var(--cms-preview-accent);border-radius:3px;box-shadow:0 0 0 3px color-mix(in oklab,var(--cms-preview-accent) 20%,transparent);height:3px;margin-top:-1.5px;position:absolute}.cms-preview-grabbing,.cms-preview-grabbing *{cursor:grabbing!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.cms-preview-empty{display:flex;justify-content:center;padding:48px 16px}.cms-preview-empty-button{border:1px dashed #5b5bd6;border-radius:10px;color:#5b5bd6;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-size:14px;font-weight:600;gap:8px;padding:12px 18px}.cms-preview-empty-button svg{height:18px;width:18px}.cms-preview-notice{color:#6b6b75;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;margin:64px auto;max-width:32rem;padding:0 16px;text-align:center}
223
+ .cms-preview-overlay{font-family:var(--k-font-sans);font-size:12px;inset:0;line-height:1;pointer-events:none;position:fixed;z-index:2147483000}.cms-preview-outline{border:1px dashed color-mix(in oklab,var(--k-accent) 70%,transparent);border-radius:var(--k-radius-xs);box-sizing:border-box;position:absolute}.cms-preview-outline.is-highlighted{background:color-mix(in oklab,var(--k-accent) 8%,transparent);border-style:solid}.cms-preview-outline.is-selected{border:2px solid var(--k-accent);box-shadow:0 0 0 4px var(--k-ring-soft)}.cms-preview-outline.is-drop-target{background:color-mix(in oklab,var(--k-accent) 6%,transparent);border:2px dashed var(--k-accent)}.cms-preview-label{background:var(--k-accent);border-radius:var(--k-radius-xs) 0 var(--k-radius-sm) 0;color:var(--k-accent-contrast);font-weight:600;left:-1px;letter-spacing:.01em;padding:4px 7px;position:absolute;top:-1px;white-space:nowrap}.cms-preview-field{background:color-mix(in oklab,var(--k-accent) 5%,transparent);border-radius:var(--k-radius-xs);box-sizing:border-box;outline:1px solid color-mix(in oklab,var(--k-accent) 55%,transparent);outline-offset:2px;position:absolute}.cms-preview-field.is-editing{background:none;outline:2px solid var(--k-accent)}.cms-preview-field-label{background:var(--k-elevated);border-radius:var(--k-radius-xs);box-shadow:0 0 0 1px var(--k-accent-line);color:var(--k-accent-text);font-size:11px;font-weight:600;left:-3px;margin-top:6px;padding:3px 6px;position:absolute;top:100%;white-space:nowrap}.cms-preview-field-label.is-above{bottom:100%;margin:0 0 6px;top:auto}.cms-preview-toolbar{align-items:center;background:var(--k-elevated);border-radius:var(--k-radius-md);box-shadow:var(--k-shadow-overlay);display:flex;gap:2px;padding:3px;pointer-events:auto;position:absolute;transform:translateX(-100%)}.cms-preview-toolbar:not(.is-selected){opacity:.92}.cms-preview-empty-button,.cms-preview-insert,.cms-preview-tool{all:unset;align-items:center;box-sizing:border-box;cursor:pointer;display:inline-flex;justify-content:center}.cms-preview-tool{border-radius:var(--k-radius-sm);color:var(--k-text);height:28px;transition:background-color var(--k-duration) var(--k-ease);width:28px}.cms-preview-tool:hover:not(:disabled){background:var(--k-hover)}.cms-preview-tool:disabled{cursor:default;opacity:.35}.cms-preview-tool.is-danger{color:var(--k-danger-text)}.cms-preview-handle{cursor:grab;touch-action:none}.cms-preview .cms-preview-empty-button:focus-visible,.cms-preview-overlay .cms-preview-insert:focus-visible,.cms-preview-overlay .cms-preview-tool:focus-visible{outline:2px solid var(--k-ring);outline-offset:2px}.cms-preview-separator{background:var(--k-line);height:18px;margin:0 2px;width:1px}.cms-preview-overlay svg{flex-shrink:0;height:16px;width:16px}.cms-preview-insert{background:var(--k-accent);border-radius:var(--k-radius-full);box-shadow:var(--k-shadow-sm);color:var(--k-accent-contrast);height:26px;margin:-13px 0 0 -13px;opacity:0;pointer-events:auto;position:absolute;transform:scale(.85);transition:opacity var(--k-duration) var(--k-ease),transform var(--k-duration) var(--k-ease);width:26px}.cms-preview-insert.is-near,.cms-preview-insert:focus-visible,.cms-preview-insert:hover{opacity:1;transform:scale(1)}.cms-preview-overlay.is-dragging .cms-preview-insert,.cms-preview-overlay.is-dragging .cms-preview-toolbar:not(.is-selected){visibility:hidden}.cms-preview-dropline{background:var(--k-accent);border-radius:var(--k-radius-full);box-shadow:0 0 0 3px var(--k-ring-soft);height:3px;margin-top:-1.5px;position:absolute}.cms-preview-dropline.is-vertical{margin:0 0 0 -1.5px;width:3px}.cms-preview-grabbing,.cms-preview-grabbing *{cursor:grabbing!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.cms-preview [data-cms-editing]{cursor:text;outline:none}.cms-preview-empty{display:flex;justify-content:center;padding:48px 16px}.cms-preview-empty-button{border:1px dashed var(--k-accent-line);border-radius:var(--k-radius-lg);color:var(--k-accent-text);font-family:var(--k-font-sans);font-size:14px;font-weight:600;gap:8px;padding:12px 18px;transition:background-color var(--k-duration) var(--k-ease)}.cms-preview-empty-button:hover{background:color-mix(in oklab,var(--k-accent) 6%,transparent)}.cms-preview-empty-button svg{height:18px;width:18px}.cms-preview-empty-button.is-nested{font-size:13px;justify-content:center;min-height:56px;opacity:.8;padding:10px 14px;width:100%}.cms-preview-empty-button.is-nested:hover{opacity:1}.cms-preview-empty-button.is-nested svg{height:16px;width:16px}.cms-preview-notice{color:var(--k-text-muted);font-family:var(--k-font-sans);margin:64px auto;max-width:32rem;padding:0 16px;text-align:center}
136
224
  </style>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { defineNuxtPlugin } from "#imports";
2
+ import { vCmsField } from "../preview/field-marker.js";
3
+ export default defineNuxtPlugin({
4
+ name: "nuxt-cms:field",
5
+ setup(nuxtApp) {
6
+ nuxtApp.vueApp.directive("cms-field", vCmsField);
7
+ }
8
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { createApp, defineAsyncComponent, h } from "vue";
2
+ import { defineNuxtPlugin } from "#imports";
3
+ import { useCmsPreviewState } from "../composables/cms-preview-mode.js";
4
+ export default defineNuxtPlugin({
5
+ name: "nuxt-cms:preview-banner",
6
+ dependsOn: ["nuxt-cms:preview"],
7
+ setup(nuxtApp) {
8
+ const state = useCmsPreviewState();
9
+ const CmsPreviewBanner = defineAsyncComponent(() => import("../preview/CmsPreviewBanner.vue"));
10
+ nuxtApp.hook("app:mounted", () => {
11
+ const host = document.createElement("div");
12
+ host.setAttribute("data-cms-preview-banner", "");
13
+ document.body.appendChild(host);
14
+ createApp({
15
+ render: () => state.value ? h(CmsPreviewBanner, { mode: state.value }) : null
16
+ }).mount(host);
17
+ });
18
+ }
19
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
2
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { defineNuxtPlugin, useRequestURL, useRouter } from "#imports";
2
+ import { PREVIEW_HEADER, PREVIEW_QUERY_PARAM, previewTokenFrom } from "../../shared/index.js";
3
+ import { useCmsPreviewState } from "../composables/cms-preview-mode.js";
4
+ export default defineNuxtPlugin({
5
+ name: "nuxt-cms:preview",
6
+ async setup(nuxtApp) {
7
+ const state = useCmsPreviewState();
8
+ const initial = previewTokenFrom(useRequestURL().searchParams.get(PREVIEW_QUERY_PARAM));
9
+ let current = null;
10
+ async function load(token) {
11
+ if (token === current) return;
12
+ current = token;
13
+ if (!token) {
14
+ state.value = null;
15
+ return;
16
+ }
17
+ const mode = await $fetch("/api/cms/preview", {
18
+ headers: { [PREVIEW_HEADER]: token }
19
+ }).catch(() => null);
20
+ if (current === token) state.value = mode;
21
+ }
22
+ if (import.meta.server || !nuxtApp.payload.serverRendered) await load(initial);
23
+ else current = initial;
24
+ if (import.meta.client)
25
+ useRouter().afterEach((to) => load(previewTokenFrom(to.query[PREVIEW_QUERY_PARAM])));
26
+ }
27
+ });
@@ -0,0 +1,7 @@
1
+ import type { CmsPreviewMode } from '../../shared/index.js';
2
+ type __VLS_Props = {
3
+ mode: CmsPreviewMode;
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,63 @@
1
+ <template>
2
+ <div
3
+ v-if="!dismissed"
4
+ class="cms-preview-banner k-root"
5
+ data-preset="default"
6
+ data-theme="dark"
7
+ role="status"
8
+ >
9
+ <span class="cms-preview-banner-badge">Preview</span>
10
+ <span class="cms-preview-banner-text">
11
+ Unpublished version, not visible to visitors.
12
+ <span v-if="expires">Link expires {{ expires }}.</span>
13
+ </span>
14
+ <button
15
+ type="button"
16
+ class="cms-preview-banner-close"
17
+ aria-label="Hide the preview notice"
18
+ title="Hide"
19
+ @click="dismissed = true"
20
+ >
21
+ <svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true">
22
+ <path
23
+ d="M4 4l8 8M12 4l-8 8"
24
+ stroke="currentColor"
25
+ stroke-width="1.6"
26
+ stroke-linecap="round"
27
+ />
28
+ </svg>
29
+ </button>
30
+ </div>
31
+ </template>
32
+
33
+ <script setup>
34
+ import tokensHref from "@xleddyl/443-components-vue/tokens.css?url";
35
+ import { computed, onMounted, ref, watch } from "vue";
36
+ const props = defineProps({
37
+ mode: { type: Object, required: true }
38
+ });
39
+ const dismissed = ref(false);
40
+ onMounted(() => {
41
+ if (document.querySelector("link[data-cms-tokens]")) return;
42
+ const link = document.createElement("link");
43
+ link.rel = "stylesheet";
44
+ link.href = tokensHref;
45
+ link.dataset.cmsTokens = "";
46
+ document.head.appendChild(link);
47
+ });
48
+ watch(
49
+ () => props.mode.id,
50
+ () => {
51
+ dismissed.value = false;
52
+ }
53
+ );
54
+ const expires = computed(() => {
55
+ const date = new Date(props.mode.expiresAt);
56
+ if (Number.isNaN(date.getTime())) return "";
57
+ return `on ${date.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" })}`;
58
+ });
59
+ </script>
60
+
61
+ <style scoped>
62
+ .cms-preview-banner{align-items:center;background:var(--k-elevated);border-radius:var(--k-radius-xl);bottom:16px;box-shadow:var(--k-shadow-overlay);color:var(--k-text);display:flex;font:500 13px/1.4 var(--k-font-sans);gap:10px;left:16px;margin-inline:auto;max-width:calc(100vw - 32px);padding:8px 8px 8px 10px;position:fixed;right:16px;width:-moz-max-content;width:max-content;z-index:2147483000}.cms-preview-banner-badge{background:var(--k-warning);border-radius:var(--k-radius-full);color:var(--k-text-inverted);flex:none;font-size:11px;font-weight:700;letter-spacing:.04em;padding:2px 8px;text-transform:uppercase}.cms-preview-banner-text{min-width:0}.cms-preview-banner-close{background:transparent;border:0;border-radius:var(--k-radius-full);color:var(--k-text-muted);cursor:pointer;display:grid;flex:none;height:24px;padding:0;place-items:center;transition:background-color var(--k-duration) var(--k-ease),color var(--k-duration) var(--k-ease);width:24px}.cms-preview-banner-close:focus-visible,.cms-preview-banner-close:hover{background:var(--k-hover);color:var(--k-text)}.cms-preview-banner-close:focus-visible{outline:2px solid var(--k-ring);outline-offset:2px}
63
+ </style>
@@ -0,0 +1,7 @@
1
+ import type { CmsPreviewMode } from '../../shared/index.js';
2
+ type __VLS_Props = {
3
+ mode: CmsPreviewMode;
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;
@@ -1,15 +1,29 @@
1
+ import type { CmsBlockPath } from '../../shared/block-paths.js';
1
2
  import type { FieldConfig } from '../../shared/index.js';
3
+ import type { CmsInlineOverride } from '../../shared/inline-text.js';
2
4
  import type { CmsPreviewFrameMessage } from '../../shared/preview.js';
3
5
  type __VLS_Props = {
4
6
  field: FieldConfig;
5
- total: number;
6
- selected: number | null;
7
+ fieldKey: string;
8
+ fields: Record<string, FieldConfig> | null;
9
+ blocks: readonly Record<string, unknown>[];
10
+ item: Record<string, unknown> | null;
11
+ locale: string;
12
+ editable: boolean;
13
+ lockedFields: readonly string[];
14
+ selected: CmsBlockPath | null;
15
+ highlighted: CmsBlockPath | null;
7
16
  version: number;
8
17
  };
9
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
18
+ declare function reveal(path: CmsBlockPath): Promise<void>;
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
20
+ reveal: typeof reveal;
21
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
22
  message: (message: CmsPreviewFrameMessage) => any;
23
+ inline: (override: CmsInlineOverride | null) => any;
11
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
25
  onMessage?: ((message: CmsPreviewFrameMessage) => any) | undefined;
26
+ onInline?: ((override: CmsInlineOverride | null) => any) | undefined;
13
27
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
28
  declare const _default: typeof __VLS_export;
15
29
  export default _default;