@nuxt-atelier/admin 0.0.0-stage → 0.1.1

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 (356) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -2
  3. package/dist/module.d.mts +52 -0
  4. package/dist/module.json +12 -0
  5. package/dist/module.mjs +188 -0
  6. package/dist/runtime/admin.css +1 -0
  7. package/dist/runtime/ai-off.d.ts +1 -0
  8. package/dist/runtime/ai-off.js +1 -0
  9. package/dist/runtime/appearance.d.ts +59 -0
  10. package/dist/runtime/appearance.js +111 -0
  11. package/dist/runtime/branding.d.ts +11 -0
  12. package/dist/runtime/branding.js +14 -0
  13. package/dist/runtime/components/App.d.vue.ts +6 -0
  14. package/dist/runtime/components/App.vue +170 -0
  15. package/dist/runtime/components/App.vue.d.ts +6 -0
  16. package/dist/runtime/components/AppearanceModal.d.vue.ts +3 -0
  17. package/dist/runtime/components/AppearanceModal.vue +267 -0
  18. package/dist/runtime/components/AppearanceModal.vue.d.ts +3 -0
  19. package/dist/runtime/components/AuthFrame.d.vue.ts +15 -0
  20. package/dist/runtime/components/AuthFrame.vue +56 -0
  21. package/dist/runtime/components/AuthFrame.vue.d.ts +15 -0
  22. package/dist/runtime/components/BlocksField.d.vue.ts +14 -0
  23. package/dist/runtime/components/BlocksField.vue +167 -0
  24. package/dist/runtime/components/BlocksField.vue.d.ts +14 -0
  25. package/dist/runtime/components/Brand.d.vue.ts +6 -0
  26. package/dist/runtime/components/Brand.vue +22 -0
  27. package/dist/runtime/components/Brand.vue.d.ts +6 -0
  28. package/dist/runtime/components/CollectionList.d.vue.ts +6 -0
  29. package/dist/runtime/components/CollectionList.vue +312 -0
  30. package/dist/runtime/components/CollectionList.vue.d.ts +6 -0
  31. package/dist/runtime/components/CommentsPanel.d.vue.ts +9 -0
  32. package/dist/runtime/components/CommentsPanel.vue +228 -0
  33. package/dist/runtime/components/CommentsPanel.vue.d.ts +9 -0
  34. package/dist/runtime/components/EntryEdit.d.vue.ts +9 -0
  35. package/dist/runtime/components/EntryEdit.vue +457 -0
  36. package/dist/runtime/components/EntryEdit.vue.d.ts +9 -0
  37. package/dist/runtime/components/FieldInput.d.vue.ts +13 -0
  38. package/dist/runtime/components/FieldInput.vue +356 -0
  39. package/dist/runtime/components/FieldInput.vue.d.ts +13 -0
  40. package/dist/runtime/components/FormSubmissions.d.vue.ts +6 -0
  41. package/dist/runtime/components/FormSubmissions.vue +197 -0
  42. package/dist/runtime/components/FormSubmissions.vue.d.ts +6 -0
  43. package/dist/runtime/components/GlobalSearch.d.vue.ts +10 -0
  44. package/dist/runtime/components/GlobalSearch.vue +145 -0
  45. package/dist/runtime/components/GlobalSearch.vue.d.ts +10 -0
  46. package/dist/runtime/components/Home.d.vue.ts +3 -0
  47. package/dist/runtime/components/Home.vue +247 -0
  48. package/dist/runtime/components/Home.vue.d.ts +3 -0
  49. package/dist/runtime/components/Icon.d.ts +14 -0
  50. package/dist/runtime/components/Icon.js +12 -0
  51. package/dist/runtime/components/MediaDetails.d.vue.ts +11 -0
  52. package/dist/runtime/components/MediaDetails.vue +222 -0
  53. package/dist/runtime/components/MediaDetails.vue.d.ts +11 -0
  54. package/dist/runtime/components/MediaField.d.vue.ts +14 -0
  55. package/dist/runtime/components/MediaField.vue +86 -0
  56. package/dist/runtime/components/MediaField.vue.d.ts +14 -0
  57. package/dist/runtime/components/MediaGrid.d.vue.ts +13 -0
  58. package/dist/runtime/components/MediaGrid.vue +49 -0
  59. package/dist/runtime/components/MediaGrid.vue.d.ts +13 -0
  60. package/dist/runtime/components/MediaLibrary.d.vue.ts +12 -0
  61. package/dist/runtime/components/MediaLibrary.vue +151 -0
  62. package/dist/runtime/components/MediaLibrary.vue.d.ts +12 -0
  63. package/dist/runtime/components/NotFound.d.vue.ts +6 -0
  64. package/dist/runtime/components/NotFound.vue +29 -0
  65. package/dist/runtime/components/NotFound.vue.d.ts +6 -0
  66. package/dist/runtime/components/NotificationBell.d.vue.ts +3 -0
  67. package/dist/runtime/components/NotificationBell.vue +53 -0
  68. package/dist/runtime/components/NotificationBell.vue.d.ts +3 -0
  69. package/dist/runtime/components/Page.d.vue.ts +28 -0
  70. package/dist/runtime/components/Page.vue +84 -0
  71. package/dist/runtime/components/Page.vue.d.ts +28 -0
  72. package/dist/runtime/components/RelatedCreate.d.vue.ts +16 -0
  73. package/dist/runtime/components/RelatedCreate.vue +86 -0
  74. package/dist/runtime/components/RelatedCreate.vue.d.ts +16 -0
  75. package/dist/runtime/components/RevisionHistory.d.vue.ts +16 -0
  76. package/dist/runtime/components/RevisionHistory.vue +145 -0
  77. package/dist/runtime/components/RevisionHistory.vue.d.ts +16 -0
  78. package/dist/runtime/components/RichTextEditor.d.vue.ts +15 -0
  79. package/dist/runtime/components/RichTextEditor.vue +190 -0
  80. package/dist/runtime/components/RichTextEditor.vue.d.ts +15 -0
  81. package/dist/runtime/components/RobotsSettings.d.vue.ts +3 -0
  82. package/dist/runtime/components/RobotsSettings.vue +173 -0
  83. package/dist/runtime/components/RobotsSettings.vue.d.ts +3 -0
  84. package/dist/runtime/components/RoleEdit.d.vue.ts +6 -0
  85. package/dist/runtime/components/RoleEdit.vue +234 -0
  86. package/dist/runtime/components/RoleEdit.vue.d.ts +6 -0
  87. package/dist/runtime/components/Roles.d.vue.ts +3 -0
  88. package/dist/runtime/components/Roles.vue +129 -0
  89. package/dist/runtime/components/Roles.vue.d.ts +3 -0
  90. package/dist/runtime/components/ScheduleSection.d.vue.ts +12 -0
  91. package/dist/runtime/components/ScheduleSection.vue +120 -0
  92. package/dist/runtime/components/ScheduleSection.vue.d.ts +12 -0
  93. package/dist/runtime/components/SeoPanel.d.vue.ts +7 -0
  94. package/dist/runtime/components/SeoPanel.vue +81 -0
  95. package/dist/runtime/components/SeoPanel.vue.d.ts +7 -0
  96. package/dist/runtime/components/Setup.d.vue.ts +3 -0
  97. package/dist/runtime/components/Setup.vue +79 -0
  98. package/dist/runtime/components/Setup.vue.d.ts +3 -0
  99. package/dist/runtime/components/SharedBlockUsage.d.vue.ts +7 -0
  100. package/dist/runtime/components/SharedBlockUsage.vue +91 -0
  101. package/dist/runtime/components/SharedBlockUsage.vue.d.ts +7 -0
  102. package/dist/runtime/components/Shell.d.vue.ts +15 -0
  103. package/dist/runtime/components/Shell.vue +281 -0
  104. package/dist/runtime/components/Shell.vue.d.ts +15 -0
  105. package/dist/runtime/components/SignIn.d.vue.ts +3 -0
  106. package/dist/runtime/components/SignIn.vue +106 -0
  107. package/dist/runtime/components/SignIn.vue.d.ts +3 -0
  108. package/dist/runtime/components/Toaster.d.vue.ts +3 -0
  109. package/dist/runtime/components/Toaster.vue +24 -0
  110. package/dist/runtime/components/Toaster.vue.d.ts +3 -0
  111. package/dist/runtime/components/Users.d.vue.ts +3 -0
  112. package/dist/runtime/components/Users.vue +226 -0
  113. package/dist/runtime/components/Users.vue.d.ts +3 -0
  114. package/dist/runtime/composables/debounced.d.ts +3 -0
  115. package/dist/runtime/composables/debounced.js +11 -0
  116. package/dist/runtime/composables/useAtelierAdmin.d.ts +17 -0
  117. package/dist/runtime/composables/useAtelierAdmin.js +53 -0
  118. package/dist/runtime/composables/useAtelierAdminPortal.d.ts +3 -0
  119. package/dist/runtime/composables/useAtelierAdminPortal.js +5 -0
  120. package/dist/runtime/composables/useAtelierAdminSchema.d.ts +182 -0
  121. package/dist/runtime/composables/useAtelierAdminSchema.js +26 -0
  122. package/dist/runtime/composables/useAtelierCollection.d.ts +49 -0
  123. package/dist/runtime/composables/useAtelierCollection.js +77 -0
  124. package/dist/runtime/composables/useAtelierComments.d.ts +50 -0
  125. package/dist/runtime/composables/useAtelierComments.js +46 -0
  126. package/dist/runtime/composables/useAtelierDashboard.d.ts +42 -0
  127. package/dist/runtime/composables/useAtelierDashboard.js +16 -0
  128. package/dist/runtime/composables/useAtelierEntryForm.d.ts +77 -0
  129. package/dist/runtime/composables/useAtelierEntryForm.js +184 -0
  130. package/dist/runtime/composables/useAtelierGlobalSearch.d.ts +12 -0
  131. package/dist/runtime/composables/useAtelierGlobalSearch.js +17 -0
  132. package/dist/runtime/composables/useAtelierMediaLibrary.d.ts +75 -0
  133. package/dist/runtime/composables/useAtelierMediaLibrary.js +85 -0
  134. package/dist/runtime/composables/useAtelierNavigation.d.ts +20 -0
  135. package/dist/runtime/composables/useAtelierNavigation.js +37 -0
  136. package/dist/runtime/composables/useAtelierNotifications.d.ts +21 -0
  137. package/dist/runtime/composables/useAtelierNotifications.js +34 -0
  138. package/dist/runtime/composables/useAtelierPermissions.d.ts +11 -0
  139. package/dist/runtime/composables/useAtelierPermissions.js +15 -0
  140. package/dist/runtime/composables/useAtelierPresence.d.ts +32 -0
  141. package/dist/runtime/composables/useAtelierPresence.js +95 -0
  142. package/dist/runtime/composables/useAtelierRealtime.d.ts +10 -0
  143. package/dist/runtime/composables/useAtelierRealtime.js +74 -0
  144. package/dist/runtime/composables/useAtelierRoles.d.ts +13 -0
  145. package/dist/runtime/composables/useAtelierRoles.js +15 -0
  146. package/dist/runtime/composables/useAtelierSeo.d.ts +34 -0
  147. package/dist/runtime/composables/useAtelierSeo.js +57 -0
  148. package/dist/runtime/composables/useAtelierSession.d.ts +35 -0
  149. package/dist/runtime/composables/useAtelierSession.js +36 -0
  150. package/dist/runtime/composables/useAtelierSetting.d.ts +11 -0
  151. package/dist/runtime/composables/useAtelierSetting.js +16 -0
  152. package/dist/runtime/composables/useAtelierUsers.d.ts +18 -0
  153. package/dist/runtime/composables/useAtelierUsers.js +16 -0
  154. package/dist/runtime/crystal-neuo/VERSION +3 -0
  155. package/dist/runtime/crystal-neuo/components/Alert.d.vue.ts +25 -0
  156. package/dist/runtime/crystal-neuo/components/Alert.vue +25 -0
  157. package/dist/runtime/crystal-neuo/components/Alert.vue.d.ts +25 -0
  158. package/dist/runtime/crystal-neuo/components/Avatar.d.vue.ts +15 -0
  159. package/dist/runtime/crystal-neuo/components/Avatar.vue +25 -0
  160. package/dist/runtime/crystal-neuo/components/Avatar.vue.d.ts +15 -0
  161. package/dist/runtime/crystal-neuo/components/Badge.d.vue.ts +25 -0
  162. package/dist/runtime/crystal-neuo/components/Badge.vue +17 -0
  163. package/dist/runtime/crystal-neuo/components/Badge.vue.d.ts +25 -0
  164. package/dist/runtime/crystal-neuo/components/Breadcrumb.d.vue.ts +16 -0
  165. package/dist/runtime/crystal-neuo/components/Breadcrumb.vue +26 -0
  166. package/dist/runtime/crystal-neuo/components/Breadcrumb.vue.d.ts +16 -0
  167. package/dist/runtime/crystal-neuo/components/Button.d.vue.ts +35 -0
  168. package/dist/runtime/crystal-neuo/components/Button.vue +31 -0
  169. package/dist/runtime/crystal-neuo/components/Button.vue.d.ts +35 -0
  170. package/dist/runtime/crystal-neuo/components/Card.d.vue.ts +25 -0
  171. package/dist/runtime/crystal-neuo/components/Card.vue +17 -0
  172. package/dist/runtime/crystal-neuo/components/Card.vue.d.ts +25 -0
  173. package/dist/runtime/crystal-neuo/components/Checkbox.d.vue.ts +23 -0
  174. package/dist/runtime/crystal-neuo/components/Checkbox.vue +45 -0
  175. package/dist/runtime/crystal-neuo/components/Checkbox.vue.d.ts +23 -0
  176. package/dist/runtime/crystal-neuo/components/DatePicker.d.vue.ts +24 -0
  177. package/dist/runtime/crystal-neuo/components/DatePicker.vue +43 -0
  178. package/dist/runtime/crystal-neuo/components/DatePicker.vue.d.ts +24 -0
  179. package/dist/runtime/crystal-neuo/components/Dialog.d.vue.ts +41 -0
  180. package/dist/runtime/crystal-neuo/components/Dialog.vue +63 -0
  181. package/dist/runtime/crystal-neuo/components/Dialog.vue.d.ts +41 -0
  182. package/dist/runtime/crystal-neuo/components/Drawer.d.vue.ts +34 -0
  183. package/dist/runtime/crystal-neuo/components/Drawer.vue +45 -0
  184. package/dist/runtime/crystal-neuo/components/Drawer.vue.d.ts +34 -0
  185. package/dist/runtime/crystal-neuo/components/FileUpload.d.vue.ts +32 -0
  186. package/dist/runtime/crystal-neuo/components/FileUpload.vue +94 -0
  187. package/dist/runtime/crystal-neuo/components/FileUpload.vue.d.ts +32 -0
  188. package/dist/runtime/crystal-neuo/components/Input.d.vue.ts +26 -0
  189. package/dist/runtime/crystal-neuo/components/Input.vue +48 -0
  190. package/dist/runtime/crystal-neuo/components/Input.vue.d.ts +26 -0
  191. package/dist/runtime/crystal-neuo/components/List.d.vue.ts +25 -0
  192. package/dist/runtime/crystal-neuo/components/List.vue +19 -0
  193. package/dist/runtime/crystal-neuo/components/List.vue.d.ts +25 -0
  194. package/dist/runtime/crystal-neuo/components/ListItem.d.vue.ts +20 -0
  195. package/dist/runtime/crystal-neuo/components/ListItem.vue +13 -0
  196. package/dist/runtime/crystal-neuo/components/ListItem.vue.d.ts +20 -0
  197. package/dist/runtime/crystal-neuo/components/Menu.d.vue.ts +26 -0
  198. package/dist/runtime/crystal-neuo/components/Menu.vue +120 -0
  199. package/dist/runtime/crystal-neuo/components/Menu.vue.d.ts +26 -0
  200. package/dist/runtime/crystal-neuo/components/Modal.d.vue.ts +32 -0
  201. package/dist/runtime/crystal-neuo/components/Modal.vue +37 -0
  202. package/dist/runtime/crystal-neuo/components/Modal.vue.d.ts +32 -0
  203. package/dist/runtime/crystal-neuo/components/Nav.d.vue.ts +24 -0
  204. package/dist/runtime/crystal-neuo/components/Nav.vue +15 -0
  205. package/dist/runtime/crystal-neuo/components/Nav.vue.d.ts +24 -0
  206. package/dist/runtime/crystal-neuo/components/NavLink.d.vue.ts +22 -0
  207. package/dist/runtime/crystal-neuo/components/NavLink.vue +23 -0
  208. package/dist/runtime/crystal-neuo/components/NavLink.vue.d.ts +22 -0
  209. package/dist/runtime/crystal-neuo/components/Pagination.d.vue.ts +23 -0
  210. package/dist/runtime/crystal-neuo/components/Pagination.vue +58 -0
  211. package/dist/runtime/crystal-neuo/components/Pagination.vue.d.ts +23 -0
  212. package/dist/runtime/crystal-neuo/components/Progress.d.vue.ts +18 -0
  213. package/dist/runtime/crystal-neuo/components/Progress.vue +35 -0
  214. package/dist/runtime/crystal-neuo/components/Progress.vue.d.ts +18 -0
  215. package/dist/runtime/crystal-neuo/components/Radio.d.vue.ts +28 -0
  216. package/dist/runtime/crystal-neuo/components/Radio.vue +40 -0
  217. package/dist/runtime/crystal-neuo/components/Radio.vue.d.ts +28 -0
  218. package/dist/runtime/crystal-neuo/components/SegmentedControl.d.vue.ts +31 -0
  219. package/dist/runtime/crystal-neuo/components/SegmentedControl.vue +39 -0
  220. package/dist/runtime/crystal-neuo/components/SegmentedControl.vue.d.ts +31 -0
  221. package/dist/runtime/crystal-neuo/components/Select.d.vue.ts +28 -0
  222. package/dist/runtime/crystal-neuo/components/Select.vue +48 -0
  223. package/dist/runtime/crystal-neuo/components/Select.vue.d.ts +28 -0
  224. package/dist/runtime/crystal-neuo/components/Sheet.d.vue.ts +29 -0
  225. package/dist/runtime/crystal-neuo/components/Sheet.vue +37 -0
  226. package/dist/runtime/crystal-neuo/components/Sheet.vue.d.ts +29 -0
  227. package/dist/runtime/crystal-neuo/components/Skeleton.d.vue.ts +13 -0
  228. package/dist/runtime/crystal-neuo/components/Skeleton.vue +17 -0
  229. package/dist/runtime/crystal-neuo/components/Skeleton.vue.d.ts +13 -0
  230. package/dist/runtime/crystal-neuo/components/Slider.d.vue.ts +28 -0
  231. package/dist/runtime/crystal-neuo/components/Slider.vue +41 -0
  232. package/dist/runtime/crystal-neuo/components/Slider.vue.d.ts +28 -0
  233. package/dist/runtime/crystal-neuo/components/TabBar.d.vue.ts +28 -0
  234. package/dist/runtime/crystal-neuo/components/TabBar.vue +29 -0
  235. package/dist/runtime/crystal-neuo/components/TabBar.vue.d.ts +28 -0
  236. package/dist/runtime/crystal-neuo/components/Table.d.vue.ts +31 -0
  237. package/dist/runtime/crystal-neuo/components/Table.vue +36 -0
  238. package/dist/runtime/crystal-neuo/components/Table.vue.d.ts +31 -0
  239. package/dist/runtime/crystal-neuo/components/Tabs.d.vue.ts +40 -0
  240. package/dist/runtime/crystal-neuo/components/Tabs.vue +79 -0
  241. package/dist/runtime/crystal-neuo/components/Tabs.vue.d.ts +40 -0
  242. package/dist/runtime/crystal-neuo/components/Textarea.d.vue.ts +25 -0
  243. package/dist/runtime/crystal-neuo/components/Textarea.vue +48 -0
  244. package/dist/runtime/crystal-neuo/components/Textarea.vue.d.ts +25 -0
  245. package/dist/runtime/crystal-neuo/components/Toast.d.vue.ts +32 -0
  246. package/dist/runtime/crystal-neuo/components/Toast.vue +67 -0
  247. package/dist/runtime/crystal-neuo/components/Toast.vue.d.ts +32 -0
  248. package/dist/runtime/crystal-neuo/components/Toggle.d.vue.ts +21 -0
  249. package/dist/runtime/crystal-neuo/components/Toggle.vue +43 -0
  250. package/dist/runtime/crystal-neuo/components/Toggle.vue.d.ts +21 -0
  251. package/dist/runtime/crystal-neuo/components/Tooltip.d.vue.ts +23 -0
  252. package/dist/runtime/crystal-neuo/components/Tooltip.vue +38 -0
  253. package/dist/runtime/crystal-neuo/components/Tooltip.vue.d.ts +23 -0
  254. package/dist/runtime/crystal-neuo/components/cn.d.ts +1 -0
  255. package/dist/runtime/crystal-neuo/components/cn.js +3 -0
  256. package/dist/runtime/crystal-neuo/components/useControlAttrs.d.ts +15 -0
  257. package/dist/runtime/crystal-neuo/components/useControlAttrs.js +11 -0
  258. package/dist/runtime/crystal-neuo/components/useFocusTrap.d.ts +9 -0
  259. package/dist/runtime/crystal-neuo/components/useFocusTrap.js +55 -0
  260. package/dist/runtime/crystal-neuo/components/useModalDialog.d.ts +11 -0
  261. package/dist/runtime/crystal-neuo/components/useModalDialog.js +42 -0
  262. package/dist/runtime/crystal-neuo/contract/alert.contract.d.ts +3 -0
  263. package/dist/runtime/crystal-neuo/contract/alert.contract.js +18 -0
  264. package/dist/runtime/crystal-neuo/contract/avatar.contract.d.ts +3 -0
  265. package/dist/runtime/crystal-neuo/contract/avatar.contract.js +18 -0
  266. package/dist/runtime/crystal-neuo/contract/badge.contract.d.ts +3 -0
  267. package/dist/runtime/crystal-neuo/contract/badge.contract.js +18 -0
  268. package/dist/runtime/crystal-neuo/contract/breadcrumb.contract.d.ts +3 -0
  269. package/dist/runtime/crystal-neuo/contract/breadcrumb.contract.js +19 -0
  270. package/dist/runtime/crystal-neuo/contract/button.contract.d.ts +3 -0
  271. package/dist/runtime/crystal-neuo/contract/button.contract.js +22 -0
  272. package/dist/runtime/crystal-neuo/contract/card.contract.d.ts +3 -0
  273. package/dist/runtime/crystal-neuo/contract/card.contract.js +18 -0
  274. package/dist/runtime/crystal-neuo/contract/checkbox.contract.d.ts +3 -0
  275. package/dist/runtime/crystal-neuo/contract/checkbox.contract.js +19 -0
  276. package/dist/runtime/crystal-neuo/contract/date-picker.contract.d.ts +3 -0
  277. package/dist/runtime/crystal-neuo/contract/date-picker.contract.js +22 -0
  278. package/dist/runtime/crystal-neuo/contract/dialog.contract.d.ts +3 -0
  279. package/dist/runtime/crystal-neuo/contract/dialog.contract.js +23 -0
  280. package/dist/runtime/crystal-neuo/contract/drawer.contract.d.ts +3 -0
  281. package/dist/runtime/crystal-neuo/contract/drawer.contract.js +23 -0
  282. package/dist/runtime/crystal-neuo/contract/file-upload.contract.d.ts +17 -0
  283. package/dist/runtime/crystal-neuo/contract/file-upload.contract.js +36 -0
  284. package/dist/runtime/crystal-neuo/contract/index.d.ts +67 -0
  285. package/dist/runtime/crystal-neuo/contract/index.js +96 -0
  286. package/dist/runtime/crystal-neuo/contract/input.contract.d.ts +3 -0
  287. package/dist/runtime/crystal-neuo/contract/input.contract.js +19 -0
  288. package/dist/runtime/crystal-neuo/contract/list.contract.d.ts +3 -0
  289. package/dist/runtime/crystal-neuo/contract/list.contract.js +21 -0
  290. package/dist/runtime/crystal-neuo/contract/menu.contract.d.ts +21 -0
  291. package/dist/runtime/crystal-neuo/contract/menu.contract.js +51 -0
  292. package/dist/runtime/crystal-neuo/contract/modal.contract.d.ts +3 -0
  293. package/dist/runtime/crystal-neuo/contract/modal.contract.js +24 -0
  294. package/dist/runtime/crystal-neuo/contract/nav.contract.d.ts +3 -0
  295. package/dist/runtime/crystal-neuo/contract/nav.contract.js +18 -0
  296. package/dist/runtime/crystal-neuo/contract/pagination.contract.d.ts +11 -0
  297. package/dist/runtime/crystal-neuo/contract/pagination.contract.js +32 -0
  298. package/dist/runtime/crystal-neuo/contract/progress.contract.d.ts +3 -0
  299. package/dist/runtime/crystal-neuo/contract/progress.contract.js +19 -0
  300. package/dist/runtime/crystal-neuo/contract/radio.contract.d.ts +3 -0
  301. package/dist/runtime/crystal-neuo/contract/radio.contract.js +24 -0
  302. package/dist/runtime/crystal-neuo/contract/segmented-control.contract.d.ts +3 -0
  303. package/dist/runtime/crystal-neuo/contract/segmented-control.contract.js +23 -0
  304. package/dist/runtime/crystal-neuo/contract/select.contract.d.ts +3 -0
  305. package/dist/runtime/crystal-neuo/contract/select.contract.js +24 -0
  306. package/dist/runtime/crystal-neuo/contract/sheet.contract.d.ts +3 -0
  307. package/dist/runtime/crystal-neuo/contract/sheet.contract.js +23 -0
  308. package/dist/runtime/crystal-neuo/contract/skeleton.contract.d.ts +3 -0
  309. package/dist/runtime/crystal-neuo/contract/skeleton.contract.js +18 -0
  310. package/dist/runtime/crystal-neuo/contract/slider.contract.d.ts +3 -0
  311. package/dist/runtime/crystal-neuo/contract/slider.contract.js +24 -0
  312. package/dist/runtime/crystal-neuo/contract/tab-bar.contract.d.ts +3 -0
  313. package/dist/runtime/crystal-neuo/contract/tab-bar.contract.js +19 -0
  314. package/dist/runtime/crystal-neuo/contract/table.contract.d.ts +3 -0
  315. package/dist/runtime/crystal-neuo/contract/table.contract.js +18 -0
  316. package/dist/runtime/crystal-neuo/contract/tabs.contract.d.ts +3 -0
  317. package/dist/runtime/crystal-neuo/contract/tabs.contract.js +26 -0
  318. package/dist/runtime/crystal-neuo/contract/textarea.contract.d.ts +3 -0
  319. package/dist/runtime/crystal-neuo/contract/textarea.contract.js +19 -0
  320. package/dist/runtime/crystal-neuo/contract/toast.contract.d.ts +3 -0
  321. package/dist/runtime/crystal-neuo/contract/toast.contract.js +18 -0
  322. package/dist/runtime/crystal-neuo/contract/toggle.contract.d.ts +3 -0
  323. package/dist/runtime/crystal-neuo/contract/toggle.contract.js +22 -0
  324. package/dist/runtime/crystal-neuo/contract/tooltip.contract.d.ts +3 -0
  325. package/dist/runtime/crystal-neuo/contract/tooltip.contract.js +18 -0
  326. package/dist/runtime/crystal-neuo/contract/types.d.ts +76 -0
  327. package/dist/runtime/crystal-neuo/contract/types.js +12 -0
  328. package/dist/runtime/crystal-neuo/css/crystal-neuo.css +1 -0
  329. package/dist/runtime/crystal-neuo/runtime/axes.d.ts +16 -0
  330. package/dist/runtime/crystal-neuo/runtime/axes.js +9 -0
  331. package/dist/runtime/crystal-neuo/runtime/index.d.ts +62 -0
  332. package/dist/runtime/crystal-neuo/runtime/index.js +115 -0
  333. package/dist/runtime/crystal-neuo/runtime/platform.d.ts +11 -0
  334. package/dist/runtime/crystal-neuo/runtime/platform.js +18 -0
  335. package/dist/runtime/crystal-neuo/runtime/refraction.d.ts +42 -0
  336. package/dist/runtime/crystal-neuo/runtime/refraction.js +183 -0
  337. package/dist/runtime/css/shell.css +1 -0
  338. package/dist/runtime/i18n/en.d.ts +2 -0
  339. package/dist/runtime/i18n/en.js +543 -0
  340. package/dist/runtime/i18n/index.d.ts +15 -0
  341. package/dist/runtime/i18n/index.js +52 -0
  342. package/dist/runtime/overrides.d.ts +5 -0
  343. package/dist/runtime/overrides.js +6 -0
  344. package/dist/runtime/pages/AdminPage.d.vue.ts +3 -0
  345. package/dist/runtime/pages/AdminPage.vue +49 -0
  346. package/dist/runtime/pages/AdminPage.vue.d.ts +3 -0
  347. package/dist/runtime/passkeys-off.d.ts +1 -0
  348. package/dist/runtime/passkeys-off.js +3 -0
  349. package/dist/runtime/passkeys.d.ts +1 -0
  350. package/dist/runtime/passkeys.js +6 -0
  351. package/dist/runtime/toast.d.ts +15 -0
  352. package/dist/runtime/toast.js +19 -0
  353. package/dist/runtime/types.d.ts +133 -0
  354. package/dist/runtime/types.js +0 -0
  355. package/dist/types.d.mts +3 -0
  356. package/package.json +59 -4
@@ -0,0 +1,145 @@
1
+ <script setup>
2
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
3
+ import { ai } from "#atelier-admin-ai";
4
+ import { navigateTo } from "#imports";
5
+ import { useAtelierAdmin } from "../composables/useAtelierAdmin";
6
+ import { useAtelierAdminSchema } from "../composables/useAtelierAdminSchema";
7
+ import { useAtelierGlobalSearch } from "../composables/useAtelierGlobalSearch";
8
+ import { humanize, useAtelierNavigation } from "../composables/useAtelierNavigation";
9
+ import CnModal from "../crystal-neuo/components/Modal.vue";
10
+ import { useAdminI18n } from "../i18n";
11
+ const open = defineModel("open", { type: Boolean, ...{ default: false } });
12
+ const { t } = useAdminI18n();
13
+ const { to } = useAtelierAdmin();
14
+ const { schema } = useAtelierAdminSchema();
15
+ const { items } = useAtelierNavigation();
16
+ const text = ref("");
17
+ const { results } = useAtelierGlobalSearch(text);
18
+ const active = ref(0);
19
+ const input = ref(null);
20
+ const aiOn = ai ? ai.enabled() : ref(false);
21
+ const asking = ref(null);
22
+ const typeLabel = (name) => schema.value?.collections.find((c) => c.name === name)?.labels?.plural ?? humanize(name);
23
+ const options = computed(() => {
24
+ const needle = text.value.trim().toLowerCase();
25
+ const pages = needle ? items.value.filter((i) => i.label.toLowerCase().includes(needle)).map((i) => ({ key: `page:${i.to}`, kind: "page", title: i.label, to: i.to })) : [];
26
+ const found = results.value.flatMap((r) => {
27
+ if (r.kind === "entry")
28
+ return [{ key: `entry:${r.type}:${r.id}`, kind: r.kind, title: r.title || t("common.untitled"), detail: [typeLabel(r.type), r.detail?.toUpperCase()].filter(Boolean).join(" \xB7 "), to: to("collections", r.type, r.id) }];
29
+ if (r.kind === "singleton")
30
+ return [{ key: `singleton:${r.id}`, kind: r.kind, title: r.title, to: to("singletons", r.id) }];
31
+ if (r.kind === "user")
32
+ return [{ key: `user:${r.id}`, kind: r.kind, title: r.title, detail: r.detail, to: to("users") }];
33
+ if (r.kind === "media")
34
+ return [{ key: `media:${r.id}`, kind: r.kind, title: r.title, detail: r.detail, to: `${to("media")}?search=${encodeURIComponent(r.detail ?? r.title)}` }];
35
+ return [];
36
+ });
37
+ const assistant = aiOn.value && text.value.trim().length > 2 ? [{ key: "assistant", kind: "assistant", title: t("ai.ask", { request: text.value.trim() }), to: "" }] : [];
38
+ return [...pages, ...found, ...assistant];
39
+ });
40
+ watch(options, () => active.value = 0);
41
+ watch(open, async (isOpen) => {
42
+ if (isOpen) {
43
+ text.value = "";
44
+ asking.value = null;
45
+ await nextTick();
46
+ input.value?.focus();
47
+ }
48
+ });
49
+ async function choose(option) {
50
+ if (!option)
51
+ return;
52
+ if (option.kind === "assistant") {
53
+ asking.value = text.value.trim();
54
+ return;
55
+ }
56
+ open.value = false;
57
+ await navigateTo(option.to);
58
+ }
59
+ function onKey(e) {
60
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
61
+ e.preventDefault();
62
+ const n = options.value.length;
63
+ if (n)
64
+ active.value = (active.value + (e.key === "ArrowDown" ? 1 : n - 1)) % n;
65
+ } else if (e.key === "Enter") {
66
+ e.preventDefault();
67
+ void choose(options.value[active.value]);
68
+ }
69
+ }
70
+ function onShortcut(e) {
71
+ if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "k") {
72
+ e.preventDefault();
73
+ open.value = !open.value;
74
+ }
75
+ }
76
+ onMounted(() => window.addEventListener("keydown", onShortcut));
77
+ onBeforeUnmount(() => window.removeEventListener("keydown", onShortcut));
78
+ </script>
79
+
80
+ <template>
81
+ <CnModal
82
+ v-model:open="open"
83
+ :title="t('globalSearch.title')"
84
+ size="lg"
85
+ >
86
+ <component
87
+ :is="ai.Assistant"
88
+ v-if="ai && asking"
89
+ :request="asking"
90
+ @close="open = false"
91
+ />
92
+ <div
93
+ v-else
94
+ class="app-stack app-global-search"
95
+ >
96
+ <input
97
+ ref="input"
98
+ v-model="text"
99
+ class="cn-input"
100
+ type="search"
101
+ role="combobox"
102
+ aria-autocomplete="list"
103
+ aria-controls="atelier-global-search-results"
104
+ :aria-expanded="options.length > 0"
105
+ :aria-activedescendant="options[active] ? `atelier-gs-${active}` : void 0"
106
+ :aria-label="t('globalSearch.label')"
107
+ :placeholder="t('globalSearch.label')"
108
+ @keydown="onKey"
109
+ >
110
+ <ul
111
+ id="atelier-global-search-results"
112
+ role="listbox"
113
+ class="app-list app-global-search__results"
114
+ :aria-label="t('globalSearch.title')"
115
+ >
116
+ <li
117
+ v-for="(option, i) in options"
118
+ :id="`atelier-gs-${i}`"
119
+ :key="option.key"
120
+ role="option"
121
+ :aria-selected="i === active"
122
+ class="app-global-search__option"
123
+ @mousemove="active = i"
124
+ @click="choose(option)"
125
+ >
126
+ <span class="app-global-search__title">{{ option.title }}</span>
127
+ <span class="app-muted">{{ t(`globalSearch.kind.${option.kind}`) }}{{ option.detail ? ` \xB7 ${option.detail}` : "" }}</span>
128
+ </li>
129
+ </ul>
130
+ <p
131
+ v-if="text.trim() && !options.length"
132
+ class="app-muted"
133
+ role="status"
134
+ >
135
+ {{ t("globalSearch.empty") }}
136
+ </p>
137
+ <p
138
+ v-else-if="!text.trim()"
139
+ class="app-muted"
140
+ >
141
+ {{ t("globalSearch.hint") }}
142
+ </p>
143
+ </div>
144
+ </CnModal>
145
+ </template>
@@ -0,0 +1,10 @@
1
+ type __VLS_ModelProps = {
2
+ 'open'?: boolean;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
+ "update:open": (value: boolean) => any;
6
+ }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ 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,247 @@
1
+ <script setup>
2
+ import { useQuery } from "@tanstack/vue-query";
3
+ import { computed } from "vue";
4
+ import { NuxtLink } from "#components";
5
+ import { atelierFetch, useAtelierAdmin } from "../composables/useAtelierAdmin";
6
+ import { useAtelierAdminSchema } from "../composables/useAtelierAdminSchema";
7
+ import { titleField } from "../composables/useAtelierCollection";
8
+ import { useAtelierDashboard } from "../composables/useAtelierDashboard";
9
+ import { humanize, singularLabel, useAtelierNavigation } from "../composables/useAtelierNavigation";
10
+ import { useAtelierSession } from "../composables/useAtelierSession";
11
+ import CnAlert from "../crystal-neuo/components/Alert.vue";
12
+ import CnBadge from "../crystal-neuo/components/Badge.vue";
13
+ import CnButton from "../crystal-neuo/components/Button.vue";
14
+ import { useAdminToast } from "../toast";
15
+ import Icon from "./Icon";
16
+ import Page from "./Page.vue";
17
+ import { useAdminI18n } from "../i18n";
18
+ const { t } = useAdminI18n();
19
+ const { to } = useAtelierAdmin();
20
+ const { items } = useAtelierNavigation();
21
+ const { user } = useAtelierSession();
22
+ const { schema } = useAtelierAdminSchema();
23
+ const { dashboard, retry } = useAtelierDashboard();
24
+ const toast = useAdminToast();
25
+ const typeLabel = (name) => schema.value?.collections.find((c) => c.name === name)?.labels?.plural ?? schema.value?.singletons.find((s) => s.name === name)?.label ?? humanize(name);
26
+ const entryTitle = (type, data) => {
27
+ const key = titleField(schema.value?.collections.find((c) => c.name === type));
28
+ return String(key && data[key] || t("common.untitled"));
29
+ };
30
+ const when = (iso) => new Date(iso).toLocaleString();
31
+ const link = (type, id, singleton = false) => singleton ? to("singletons", type) : to("collections", type, id);
32
+ const failed = computed(() => dashboard.value?.failedJobs ?? []);
33
+ const people = useQuery({
34
+ queryKey: ["atelier", "users"],
35
+ queryFn: () => atelierFetch("/users"),
36
+ enabled: computed(() => !!dashboard.value?.activity?.length && !!schema.value?.capabilities.includes("users"))
37
+ });
38
+ const actor = (id) => {
39
+ const person = id ? people.data.value?.find((u) => u.id === id) : void 0;
40
+ return person ? person.name || person.email : void 0;
41
+ };
42
+ function happened(a) {
43
+ const collection = a.target && schema.value?.collections.find((c) => c.name === a.target.type);
44
+ const singleton = a.target && schema.value?.singletons.find((s) => s.name === a.target.type);
45
+ const type = collection ? singularLabel(collection) : singleton ? singleton.label ?? humanize(singleton.name) : t("home.entry");
46
+ const key = `home.action.${a.action}`;
47
+ const text = t(key, { type });
48
+ return text === key ? a.action : text;
49
+ }
50
+ async function retryJob(id) {
51
+ try {
52
+ await retry.mutateAsync(id);
53
+ toast.add({ color: "success", title: t("home.queuedAgain") });
54
+ } catch (e) {
55
+ toast.add({ color: "error", title: t("home.notRetried"), description: e.message });
56
+ }
57
+ }
58
+ </script>
59
+
60
+ <template>
61
+ <Page
62
+ :title="t('nav.dashboard')"
63
+ :description="t('home.signedInAs', { name: user?.name || user?.email })"
64
+ >
65
+ <CnAlert
66
+ v-if="dashboard?.pendingMigrations"
67
+ variant="warning"
68
+ :title="t('home.migrationsTitle')"
69
+ data-widget="migrations"
70
+ >
71
+ {{ t("home.migrations", { count: dashboard.pendingMigrations }) }}
72
+ </CnAlert>
73
+
74
+ <section
75
+ v-if="failed.length"
76
+ class="app-section"
77
+ data-widget="failed-jobs"
78
+ >
79
+ <h2 class="app-section__title">
80
+ <Icon name="triangle-alert" /> {{ t("home.failedJobs") }}
81
+ </h2>
82
+ <div class="app-table-wrap">
83
+ <table class="cn-table">
84
+ <caption class="sr-only">
85
+ {{ t("home.failedJobs") }}
86
+ </caption>
87
+ <thead>
88
+ <tr>
89
+ <th scope="col">
90
+ {{ t("home.job") }}
91
+ </th>
92
+ <th scope="col">
93
+ {{ t("home.error") }}
94
+ </th>
95
+ <th scope="col">
96
+ {{ t("home.lastTried") }}
97
+ </th>
98
+ <th scope="col">
99
+ <span class="sr-only">{{ t("common.actions") }}</span>
100
+ </th>
101
+ </tr>
102
+ </thead>
103
+ <tbody>
104
+ <tr
105
+ v-for="job in failed"
106
+ :key="job.id"
107
+ >
108
+ <td><code>{{ job.name }}</code></td>
109
+ <td>{{ job.lastError ?? "\u2014" }}</td>
110
+ <td>{{ when(job.runAt) }} ({{ t("home.tries", { count: job.attempts }) }})</td>
111
+ <td class="app-actions-cell">
112
+ <CnButton
113
+ size="sm"
114
+ variant="secondary"
115
+ :aria-label="t('home.retryJob', { name: job.name })"
116
+ @click="retryJob(job.id)"
117
+ >
118
+ {{ t("home.retry") }}
119
+ </CnButton>
120
+ </td>
121
+ </tr>
122
+ </tbody>
123
+ </table>
124
+ </div>
125
+ </section>
126
+
127
+ <div class="app-widgets">
128
+ <section
129
+ class="app-section cn-card cn-card--raised cn-card--size-md"
130
+ data-widget="drafts"
131
+ >
132
+ <h2 class="app-section__title">
133
+ {{ t("home.drafts") }}
134
+ </h2>
135
+ <ul
136
+ v-if="dashboard?.drafts.length"
137
+ class="app-list"
138
+ >
139
+ <li
140
+ v-for="d in dashboard.drafts"
141
+ :key="`${d.type}/${d.id}`"
142
+ >
143
+ <NuxtLink :to="link(d.type, d.id)">
144
+ {{ entryTitle(d.type, d.data) }}
145
+ </NuxtLink>
146
+ <span class="app-muted"> · {{ typeLabel(d.type) }} · {{ when(d.updatedAt) }}</span>
147
+ <CnBadge
148
+ v-if="d.publishedVersion !== null"
149
+ variant="warning"
150
+ size="sm"
151
+ >
152
+ {{ t("status.changed") }}
153
+ </CnBadge>
154
+ </li>
155
+ </ul>
156
+ <p
157
+ v-else
158
+ class="app-muted"
159
+ >
160
+ {{ t("home.noDrafts") }}
161
+ </p>
162
+ </section>
163
+
164
+ <section
165
+ class="app-section cn-card cn-card--raised cn-card--size-md"
166
+ data-widget="scheduled"
167
+ >
168
+ <h2 class="app-section__title">
169
+ {{ t("home.scheduled") }}
170
+ </h2>
171
+ <ul
172
+ v-if="dashboard?.scheduled.length"
173
+ class="app-list"
174
+ >
175
+ <li
176
+ v-for="s in dashboard.scheduled"
177
+ :key="`${s.type}/${s.id}/${s.action}`"
178
+ >
179
+ <CnBadge
180
+ :variant="s.action === 'publish' ? 'success' : 'neutral'"
181
+ size="sm"
182
+ >
183
+ {{ s.action === "publish" ? t("list.publish") : t("list.unpublish") }}
184
+ </CnBadge>
185
+ <NuxtLink :to="link(s.type, s.id, s.singleton)">
186
+ {{ typeLabel(s.type) }}{{ s.singleton ? "" : ` \xB7 ${s.id}` }}
187
+ </NuxtLink>
188
+ <span class="app-muted"> · {{ when(s.runAt) }}</span>
189
+ </li>
190
+ </ul>
191
+ <p
192
+ v-else
193
+ class="app-muted"
194
+ >
195
+ {{ t("home.nothingScheduled") }}
196
+ </p>
197
+ </section>
198
+
199
+ <section
200
+ v-if="dashboard?.activity"
201
+ class="app-section cn-card cn-card--raised cn-card--size-md"
202
+ data-widget="activity"
203
+ >
204
+ <h2 class="app-section__title">
205
+ {{ t("home.activity") }}
206
+ </h2>
207
+ <ul
208
+ v-if="dashboard.activity.length"
209
+ class="app-list"
210
+ >
211
+ <li
212
+ v-for="a in dashboard.activity"
213
+ :key="a.id"
214
+ >
215
+ {{ happened(a) }}
216
+ <span
217
+ v-if="actor(a.actorId)"
218
+ class="app-muted"
219
+ > · {{ t("home.by", { name: actor(a.actorId) }) }}</span>
220
+ <span class="app-muted"> · {{ when(a.at) }}</span>
221
+ </li>
222
+ </ul>
223
+ <p
224
+ v-else
225
+ class="app-muted"
226
+ >
227
+ {{ t("home.noActivity") }}
228
+ </p>
229
+ </section>
230
+ </div>
231
+
232
+ <ul class="app-cards">
233
+ <li
234
+ v-for="item in items.filter((i) => i.group)"
235
+ :key="item.to"
236
+ >
237
+ <NuxtLink
238
+ :to="item.to"
239
+ class="cn-card cn-card--glass cn-card--size-sm app-card-link"
240
+ >
241
+ <Icon :name="item.icon" />
242
+ {{ item.label }}
243
+ </NuxtLink>
244
+ </li>
245
+ </ul>
246
+ </Page>
247
+ </template>
@@ -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,14 @@
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ name: {
3
+ type: StringConstructor;
4
+ required: true;
5
+ };
6
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
7
+ [key: string]: any;
8
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
9
+ name: {
10
+ type: StringConstructor;
11
+ required: true;
12
+ };
13
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { defineComponent, h } from "vue";
2
+ import icons from "#atelier-admin-icons";
3
+ export default defineComponent({
4
+ name: "AtelierAdminIcon",
5
+ props: { name: { type: String, required: true } },
6
+ setup(props) {
7
+ return () => {
8
+ const icon = icons[props.name.replace(/^i-lucide-/, "")];
9
+ return icon ? h("svg", { "class": "app-icon", "xmlns": "http://www.w3.org/2000/svg", "viewBox": `0 0 ${icon.width} ${icon.height}`, "aria-hidden": "true", "focusable": "false", "innerHTML": icon.body }) : null;
10
+ };
11
+ }
12
+ });
@@ -0,0 +1,11 @@
1
+ import type { MediaItem } from '../composables/useAtelierMediaLibrary.js';
2
+ type __VLS_Props = {
3
+ item: MediaItem | null;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
+ close: () => any;
7
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onClose?: (() => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,222 @@
1
+ <script setup>
2
+ import { computed, reactive, ref, watch } from "vue";
3
+ import { ai } from "#atelier-admin-ai";
4
+ import { useAtelierAdminSchema } from "../composables/useAtelierAdminSchema";
5
+ import { useAtelierMediaLibrary } from "../composables/useAtelierMediaLibrary";
6
+ import { useAtelierPermissions } from "../composables/useAtelierPermissions";
7
+ import CnAlert from "../crystal-neuo/components/Alert.vue";
8
+ import CnButton from "../crystal-neuo/components/Button.vue";
9
+ import CnDialog from "../crystal-neuo/components/Dialog.vue";
10
+ import CnDrawer from "../crystal-neuo/components/Drawer.vue";
11
+ import CnInput from "../crystal-neuo/components/Input.vue";
12
+ import CnTextarea from "../crystal-neuo/components/Textarea.vue";
13
+ import CnToggle from "../crystal-neuo/components/Toggle.vue";
14
+ import { useAdminI18n } from "../i18n";
15
+ import { useAdminToast } from "../toast";
16
+ const props = defineProps({
17
+ item: { type: [Object, null], required: true }
18
+ });
19
+ const aiOn = ai ? ai.enabled() : ref(false);
20
+ const emit = defineEmits(["close"]);
21
+ const { t } = useAdminI18n();
22
+ const { manages } = useAtelierPermissions();
23
+ const { schema } = useAtelierAdminSchema();
24
+ const { update, remove, usage } = useAtelierMediaLibrary();
25
+ const toast = useAdminToast();
26
+ const canEdit = computed(() => manages("media"));
27
+ const open = computed({ get: () => !!props.item, set: (on) => !on && emit("close") });
28
+ const locales = computed(() => (schema.value?.locales.codes.length ?? 0) > 1 ? schema.value.locales.codes : [""]);
29
+ const form = reactive({ title: "", caption: "", credits: "", folder: "", tags: "", private: false, alt: {}, focal: null });
30
+ const usages = ref([]);
31
+ const error = ref("");
32
+ watch(() => props.item, async (item) => {
33
+ if (!item)
34
+ return;
35
+ Object.assign(form, { title: item.title ?? "", caption: item.caption ?? "", credits: item.credits ?? "", folder: item.folder, tags: item.tags.join(", "), private: item.private, alt: { ...item.alt }, focal: item.focal });
36
+ error.value = "";
37
+ usages.value = await usage(item.id).catch(() => []);
38
+ }, { immediate: true });
39
+ const isImage = computed(() => props.item?.mime.startsWith("image/"));
40
+ function setFocal(e) {
41
+ if (!canEdit.value)
42
+ return;
43
+ const box = e.currentTarget.getBoundingClientRect();
44
+ const round = (n) => Math.round(Math.min(1, Math.max(0, n)) * 1e3) / 1e3;
45
+ form.focal = { x: round((e.clientX - box.left) / box.width), y: round((e.clientY - box.top) / box.height) };
46
+ }
47
+ const size = (bytes) => bytes > 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : `${Math.ceil(bytes / 1024)} KB`;
48
+ async function save() {
49
+ error.value = "";
50
+ const alt = Object.fromEntries(Object.entries(form.alt).filter(([, v]) => v.trim()));
51
+ const changes = {
52
+ title: form.title || null,
53
+ caption: form.caption || null,
54
+ credits: form.credits || null,
55
+ folder: form.folder.trim(),
56
+ tags: form.tags.split(",").map((tag) => tag.trim()).filter(Boolean),
57
+ private: form.private,
58
+ alt: Object.keys(alt).length ? alt : null,
59
+ focal: form.focal
60
+ };
61
+ try {
62
+ await update.mutateAsync({ id: props.item.id, changes });
63
+ toast.add({ color: "success", title: t("media.saved") });
64
+ } catch (e) {
65
+ error.value = e.errors?.map((x) => `${x.path}: ${x.message}`).join(". ") || e.message;
66
+ }
67
+ }
68
+ const deleting = ref(false);
69
+ async function confirmDelete() {
70
+ try {
71
+ await remove.mutateAsync({ id: props.item.id, force: usages.value.length > 0 });
72
+ toast.add({ color: "success", title: t("media.deleted") });
73
+ emit("close");
74
+ } catch (e) {
75
+ toast.add({ color: "error", title: t("common.notDeleted"), description: e.message });
76
+ }
77
+ }
78
+ </script>
79
+
80
+ <template>
81
+ <CnDrawer
82
+ v-model:open="open"
83
+ :title="t('media.details')"
84
+ placement="end"
85
+ size="lg"
86
+ >
87
+ <div
88
+ v-if="item"
89
+ class="app-stack"
90
+ data-media-details
91
+ >
92
+ <button
93
+ v-if="isImage"
94
+ type="button"
95
+ class="app-media-focal"
96
+ :disabled="!canEdit"
97
+ :aria-label="t('media.focalHint')"
98
+ @click="setFocal"
99
+ >
100
+ <img
101
+ :src="`${item.url}?w=640`"
102
+ :alt="item.alt?.[''] ?? ''"
103
+ class="app-media-focal__image"
104
+ >
105
+ <span
106
+ v-if="form.focal"
107
+ class="app-media-focal__point"
108
+ :style="{ left: `${form.focal.x * 100}%`, top: `${form.focal.y * 100}%` }"
109
+ aria-hidden="true"
110
+ />
111
+ </button>
112
+ <p class="app-muted">
113
+ {{ item.filename }} · {{ t("media.size", { size: size(item.size), width: item.width ?? "\u2013", height: item.height ?? "\u2013" }) }}
114
+ · <a
115
+ :href="item.url"
116
+ target="_blank"
117
+ rel="noopener"
118
+ >{{ t("media.open") }}</a>
119
+ </p>
120
+ <p
121
+ v-if="isImage && canEdit"
122
+ class="app-muted"
123
+ >
124
+ {{ t("media.focalHint") }}
125
+ </p>
126
+ <form
127
+ class="app-form"
128
+ @submit.prevent="save"
129
+ >
130
+ <template v-if="isImage">
131
+ <template
132
+ v-for="locale in locales"
133
+ :key="locale"
134
+ >
135
+ <CnTextarea
136
+ :model-value="form.alt[locale] ?? ''"
137
+ :label="locale ? t('media.altIn', { locale: locale.toUpperCase() }) : t('media.alt')"
138
+ :hint="t('media.altHint')"
139
+ :rows="2"
140
+ :disabled="!canEdit"
141
+ @update:model-value="(v) => form.alt[locale] = v"
142
+ />
143
+ <component
144
+ :is="ai.AltText"
145
+ v-if="ai && aiOn && canEdit && item"
146
+ :media="item.id"
147
+ :locale="locale || void 0"
148
+ @apply="(v) => form.alt[locale] = v"
149
+ />
150
+ </template>
151
+ </template>
152
+ <CnInput
153
+ v-model="form.title"
154
+ :label="t('media.titleField')"
155
+ :disabled="!canEdit"
156
+ />
157
+ <CnTextarea
158
+ v-model="form.caption"
159
+ :label="t('media.caption')"
160
+ :rows="2"
161
+ :disabled="!canEdit"
162
+ />
163
+ <CnInput
164
+ v-model="form.credits"
165
+ :label="t('media.credits')"
166
+ :disabled="!canEdit"
167
+ />
168
+ <CnInput
169
+ v-model="form.folder"
170
+ :label="t('media.folder')"
171
+ :disabled="!canEdit"
172
+ />
173
+ <CnInput
174
+ v-model="form.tags"
175
+ :label="t('media.tags')"
176
+ :hint="t('media.tagsHint')"
177
+ :disabled="!canEdit"
178
+ />
179
+ <CnToggle
180
+ v-model:checked="form.private"
181
+ :label="t('media.privateLabel')"
182
+ :disabled="!canEdit"
183
+ />
184
+ <p class="app-muted">
185
+ {{ usages.length === 1 ? t("media.usedInOne") : usages.length ? t("media.usedIn", { count: usages.length }) : t("media.unused") }}
186
+ </p>
187
+ <CnAlert
188
+ v-if="error"
189
+ variant="danger"
190
+ live
191
+ >
192
+ {{ error }}
193
+ </CnAlert>
194
+ <div
195
+ v-if="canEdit"
196
+ class="app-form__actions"
197
+ >
198
+ <CnButton
199
+ variant="danger"
200
+ @click="deleting = true"
201
+ >
202
+ {{ t("common.delete") }}
203
+ </CnButton>
204
+ <CnButton
205
+ type="submit"
206
+ :loading="update.isPending.value"
207
+ >
208
+ {{ t("common.save") }}
209
+ </CnButton>
210
+ </div>
211
+ </form>
212
+ <CnDialog
213
+ v-model:open="deleting"
214
+ :title="t('media.deleteTitle')"
215
+ :description="usages.length === 1 ? t('media.deleteUsedOne') : usages.length ? t('media.deleteUsed', { count: usages.length }) : t('media.deleteBody')"
216
+ :confirm-label="t('common.delete')"
217
+ variant="destructive"
218
+ @confirm="confirmDelete"
219
+ />
220
+ </div>
221
+ </CnDrawer>
222
+ </template>