@opengis/cms 0.0.16 → 0.0.18

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 (201) hide show
  1. package/README.md +96 -3
  2. package/dist/assets/AddUser-CX-McfRW.js +1 -0
  3. package/dist/assets/ApiKeys-DSv1exYv.js +16 -0
  4. package/dist/assets/Appearance-DDtOUvCV.js +6 -0
  5. package/dist/assets/ArticlesPage-D6B3cZsl.js +6 -0
  6. package/dist/assets/BuilderPage-CCeSMVWe.js +1 -0
  7. package/dist/assets/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-DVYVfYF4.js +1 -0
  8. package/dist/assets/CollectionsPage-CHk8Cn5k.js +1 -0
  9. package/dist/assets/Dashboard-Bs7sXO6h.js +11 -0
  10. package/dist/assets/EditCollectionPage-gPuLJrN8.js +41 -0
  11. package/dist/assets/EmailPage-DhlWsPxk.js +1 -0
  12. package/dist/assets/EmptyData-Ct-xQv_N.js +1 -0
  13. package/dist/assets/FeedbackPage-DtaOncVv.js +1 -0
  14. package/dist/assets/Logs-CZ5klHNK.js +1 -0
  15. package/dist/assets/MediaBreadcrumb-BpOxt5PK.js +11 -0
  16. package/dist/assets/MediaPage-DqRcZFlO.js +16 -0
  17. package/dist/assets/MenuAddPage-BLcoVgrS.js +1 -0
  18. package/dist/assets/MenuItemPage-B2otXqkz.js +20 -0
  19. package/dist/assets/MenuPage-C00m4Fc_.js +1 -0
  20. package/dist/assets/MonacoEditor.vue_vue_type_script_setup_true_lang-CjoEsC67.js +3 -0
  21. package/dist/assets/PermissionsPage-LtqcCJ14.js +1 -0
  22. package/dist/assets/Settings-BHH6RoBP.js +1 -0
  23. package/dist/assets/SettingsTable-CY5pZx1z.js +1 -0
  24. package/dist/assets/SettingsTitle-t4WJBFxZ.js +1 -0
  25. package/dist/assets/SingletonsPage-Bn2Ypjhs.js +6 -0
  26. package/dist/assets/TagsPage-DAiakEth.js +1 -0
  27. package/dist/assets/UniversalTable.vue_vue_type_script_setup_true_lang-BQ5m4aZd.js +11 -0
  28. package/dist/assets/UniversalTablePagination.vue_vue_type_script_setup_true_lang-DppVBws0.js +1 -0
  29. package/dist/assets/Users-CMH5j0db.js +1 -0
  30. package/dist/assets/UsersPage-CDGreEib.js +1 -0
  31. package/dist/assets/arrow-up-DCe0WsrM.js +16 -0
  32. package/dist/assets/{calendar-hsWc4yH-.js → calendar-o9t4MkD2.js} +1 -1
  33. package/dist/assets/chevron-left-WFftVS9c.js +6 -0
  34. package/dist/assets/chevron-right-BiiSb3Be.js +6 -0
  35. package/dist/assets/contentForm-unZQhjCu.js +6 -0
  36. package/dist/assets/en-BDx3Svx8.js +1 -0
  37. package/dist/assets/eye-Dijywc6g.js +6 -0
  38. package/dist/assets/file-B_duymIT.js +6 -0
  39. package/dist/assets/general-CkN_0qIV.js +1 -0
  40. package/dist/assets/index-BIp7eSXk.js +1 -0
  41. package/dist/assets/index-DCW2e4Az.js +9 -0
  42. package/dist/assets/index-DGweaj24.js +1 -0
  43. package/dist/assets/index-W-qQIppj-BDlsxaGB.js +1 -0
  44. package/dist/assets/index-W-qQIppj-BsopI3Hz-BIZR-dhy.js +1 -0
  45. package/dist/assets/index-oQz9FOqL.css +1 -0
  46. package/dist/assets/index-yMJAVBXk.js +290 -0
  47. package/dist/assets/list-CXRbSNky.js +6 -0
  48. package/dist/assets/pencil-CwnPP4IJ.js +6 -0
  49. package/dist/assets/{plus-D9etvrM2.js → plus-DLR44m6p.js} +1 -1
  50. package/dist/assets/save-FeDrOUOd.js +6 -0
  51. package/dist/assets/{search-BI-hqhq6.js → search-C4-fHihx.js} +1 -1
  52. package/dist/assets/{square-pen-61CkyXzK.js → square-pen-xVs4e8Yb.js} +1 -1
  53. package/dist/assets/{trash-2-CJSl_r88.js → trash-2-BGXMNU3d.js} +1 -1
  54. package/dist/assets/uk-BA7DIKEL.js +1 -0
  55. package/dist/assets/useDebounce-DFq3rxAW.js +1 -0
  56. package/dist/assets/vs-form-reletion-link-C-xrdHDl.js +20 -0
  57. package/dist/assets/vs-form-reletion-link-bk-9ZkDH.css +1 -0
  58. package/dist/assets/vue.-sixQ7xP-CUPNuJcq.js +1 -0
  59. package/dist/assets/vuedraggable.umd-W_2WTF6i.js +14 -0
  60. package/dist/assets/{x-BNquQe5y.js → x-D2t-wfBe.js} +1 -1
  61. package/dist/index.html +14 -9
  62. package/module/cms/card/cms.content.table/index.yml +17 -0
  63. package/module/cms/card/cms.content.table/main_info.hbs +26 -0
  64. package/module/cms/card/cms.menu.table/content_info.hbs +16 -0
  65. package/module/cms/card/cms.menu.table/index.yml +18 -0
  66. package/module/cms/card/cms.menu.table/main_info.hbs +22 -0
  67. package/module/cms/card/cms.settings.table/index.yml +13 -0
  68. package/module/cms/card/cms.settings.table/main_info.hbs +20 -0
  69. package/module/cms/cls/content.status.json +18 -0
  70. package/module/cms/cls/user_type.json +10 -0
  71. package/module/cms/form/admin.users.form.json +78 -0
  72. package/module/cms/form/cms.content.form.json +79 -0
  73. package/module/cms/form/cms.menu.form.json +69 -0
  74. package/module/cms/form/cms.settings.form.json +32 -0
  75. package/module/cms/menu.json +24 -0
  76. package/module/cms/router.js +154 -0
  77. package/module/cms/select/cms.page_type.sql +2 -0
  78. package/module/cms/select/collection.sql +1 -0
  79. package/module/cms/select/locale.sql +17 -0
  80. package/module/cms/select/news_tag_id.sql +12 -0
  81. package/module/cms/select/tag_id.sql +1 -0
  82. package/module/cms/table/admin.users.table.json +54 -0
  83. package/module/cms/table/cms.content.table.json +106 -0
  84. package/module/cms/table/cms.menu.table.json +73 -0
  85. package/module/cms/table/cms.settings.table.json +57 -0
  86. package/module/cms/table/collection.default.table.json +102 -0
  87. package/module/cms/table/single.default.table.json +115 -0
  88. package/package.json +36 -31
  89. package/plugin.js +63 -23
  90. package/server/app.js +20 -3
  91. package/server/functions/getDraftKey.js +22 -0
  92. package/server/index.js +2 -3
  93. package/server/migrations/fixes.sql +124 -0
  94. package/server/migrations/site.sql +338 -249
  95. package/server/plugins/adminHook.js +2 -2
  96. package/server/plugins/hook.js +53 -61
  97. package/server/plugins/vite.js +5 -5
  98. package/server/routes/cms/controllers/cmsStat.js +56 -0
  99. package/server/routes/cms/controllers/cmsSuggest.js +58 -0
  100. package/server/routes/cms/controllers/deleteContent.js +114 -59
  101. package/server/routes/cms/controllers/deleteMedia.js +75 -46
  102. package/server/routes/cms/controllers/downloadMedia.js +48 -48
  103. package/server/routes/cms/controllers/getContent.js +110 -95
  104. package/server/routes/cms/controllers/getContentBySlug.js +95 -0
  105. package/server/routes/cms/controllers/getPermissions.js +15 -15
  106. package/server/routes/cms/controllers/insertContent.js +218 -68
  107. package/server/routes/cms/controllers/listMedia.js +93 -72
  108. package/server/routes/cms/controllers/metadataMedia.js +38 -37
  109. package/server/routes/cms/controllers/properties.get.js +53 -0
  110. package/server/routes/cms/controllers/properties.post.js +99 -0
  111. package/server/routes/cms/controllers/searchContent.js +205 -0
  112. package/server/routes/cms/controllers/setPermissions.js +49 -49
  113. package/server/routes/cms/controllers/translate.js +90 -0
  114. package/server/routes/cms/controllers/updateContent.js +238 -111
  115. package/server/routes/cms/controllers/uploadMedia.js +78 -65
  116. package/server/routes/cms/index.mjs +81 -12
  117. package/server/routes/cms/utils/additionalData.js +36 -0
  118. package/server/routes/cms/utils/getCollection.js +82 -0
  119. package/server/routes/cms/utils/getSingle.js +188 -0
  120. package/server/routes/cms/utils/insertContentLocalization.js +87 -0
  121. package/server/routes/cms/utils/requestTranslation.js +85 -0
  122. package/server/routes/cms/utils/updateLocalization.js +48 -0
  123. package/server/routes/cmsSpace/controllers/deleteSpace.js +26 -0
  124. package/server/routes/cmsSpace/controllers/getSpaces.js +28 -0
  125. package/server/routes/cmsSpace/controllers/insertSpace.js +22 -0
  126. package/server/routes/cmsSpace/controllers/updateSpace.js +24 -0
  127. package/server/routes/cmsSpace/index.mjs +20 -0
  128. package/server/routes/contentType/controllers/addContentType.js +162 -0
  129. package/server/routes/contentType/controllers/contentTypeList.js +54 -0
  130. package/server/routes/contentType/controllers/delContentType.js +75 -0
  131. package/server/routes/contentType/controllers/editContentType.js +61 -0
  132. package/server/routes/contentType/controllers/getContentType.js +37 -0
  133. package/server/routes/contentType/index.mjs +29 -19
  134. package/server/routes/contentType/utils/updateContents.js +29 -0
  135. package/server/routes/contentType/utils/updateCustomContentTable.js +56 -0
  136. package/server/routes/feedback/controllers/email.list.js +25 -0
  137. package/server/routes/feedback/controllers/feedback.js +49 -0
  138. package/server/routes/feedback/controllers/feedback.list.js +38 -0
  139. package/server/routes/feedback/controllers/news.subscriptions.js +44 -0
  140. package/server/routes/feedback/index.mjs +72 -0
  141. package/server/routes/logs/controllers/export.user.logs.js +78 -0
  142. package/server/routes/logs/controllers/user.logs.js +45 -0
  143. package/server/routes/logs/index.mjs +9 -0
  144. package/server/routes/menu/controllers/addMenu.js +38 -0
  145. package/server/routes/menu/controllers/delMenu.js +32 -0
  146. package/server/routes/menu/controllers/editMenu.js +42 -0
  147. package/server/routes/menu/controllers/getMenu.js +43 -0
  148. package/server/routes/menu/index.mjs +13 -0
  149. package/server/routes/migration/controllers/collectionToCustom.js +137 -0
  150. package/server/routes/migration/index.mjs +8 -0
  151. package/server/routes/tags/controllers/add.tags.js +25 -0
  152. package/server/routes/tags/controllers/del.tags.js +20 -0
  153. package/server/routes/tags/controllers/edit.tags.js +26 -0
  154. package/server/routes/tags/controllers/get.tags.js +16 -0
  155. package/server/routes/tags/index.mjs +14 -0
  156. package/server/templates/page/login.html +73 -5
  157. package/server/templates/select/core.user_mentioned.sql +2 -0
  158. package/src/index.ts +122 -0
  159. package/dist/assets/ArticlesPage-BveM4q3g.js +0 -11
  160. package/dist/assets/CollectionsPage-D5td-UBm.js +0 -1
  161. package/dist/assets/ContentBlock.vue_vue_type_script_setup_true_lang-BwF6D-yB.js +0 -30
  162. package/dist/assets/CreateCollectionPage-Cu0RW5ui.js +0 -76
  163. package/dist/assets/Dashboard-faSjwmB8.js +0 -11
  164. package/dist/assets/EditCollectionPage-K5oPPzCd.js +0 -1
  165. package/dist/assets/MediaPage-BoW3aWgN.js +0 -1
  166. package/dist/assets/PermissionsPage-DGy5fha2.js +0 -1
  167. package/dist/assets/SingletonsPage-C1X2xkQE.js +0 -1
  168. package/dist/assets/UniversalTable.vue_vue_type_script_setup_true_lang-DUqfWJcy.js +0 -6
  169. package/dist/assets/contentForm-DMVC4vho.js +0 -1
  170. package/dist/assets/database-BTxZQzYy.js +0 -6
  171. package/dist/assets/index-9GY17iSP.css +0 -1
  172. package/dist/assets/index-DYyZmLWO.js +0 -2138
  173. package/dist/assets/index-xsH4HHeE.js +0 -6
  174. package/dist/assets/save-C2B6th9J.js +0 -11
  175. package/dist/assets/settings-DbyDiH2g.js +0 -6
  176. package/dist/assets/vue.-sixQ7xP-DwXf3zRn.js +0 -1
  177. package/dist/assets/x-circle-C3q70RMH.js +0 -16
  178. package/server/routes/contentType/controllers/cms.type.delete.js +0 -22
  179. package/server/routes/contentType/controllers/cms.type.get.js +0 -22
  180. package/server/routes/contentType/controllers/cms.type.list.js +0 -25
  181. package/server/routes/contentType/controllers/cms.type.post.js +0 -22
  182. package/server/routes/contentType/controllers/cms.type.put.js +0 -24
  183. package/server/routes/contentType/utils/builderCache.js +0 -58
  184. package/server/routes/fileContent/data/deleteContent.js +0 -34
  185. package/server/routes/fileContent/data/deleteMedia.js +0 -28
  186. package/server/routes/fileContent/data/downloadMedia.js +0 -41
  187. package/server/routes/fileContent/data/getContent.js +0 -32
  188. package/server/routes/fileContent/data/insertContent.js +0 -37
  189. package/server/routes/fileContent/data/listMedia.js +0 -47
  190. package/server/routes/fileContent/data/metadataMedia.js +0 -38
  191. package/server/routes/fileContent/data/updateContent.js +0 -40
  192. package/server/routes/fileContent/data/uploadMedia.js +0 -49
  193. package/server/routes/fileContent/index.mjs +0 -54
  194. package/server/routes/fileContent/type/contentTypeList.js +0 -7
  195. package/server/routes/fileContent/type/createContentType.js +0 -31
  196. package/server/routes/fileContent/type/deleteContentType.js +0 -29
  197. package/server/routes/fileContent/type/getContentType.js +0 -15
  198. package/server/routes/fileContent/type/updateContentType.js +0 -40
  199. package/server/routes/fileContent/utils/astroBuilderCache.js +0 -47
  200. package/server/routes/fileContent/utils/contentDir.js +0 -12
  201. package/server/routes/fileContent/utils/contentTypeExists.js +0 -15
@@ -1,76 +0,0 @@
1
- import{c as o,d as S,r as x,u as q,a as A,F as u,I as j,P as y,b as n,e,m,x as P,h as g,t as l,n as v,l as D,f,g as w,y as F,s as h,v as b,z as H,w as Z,j as U,k as E,o as i}from"./index-DYyZmLWO.js";import{T as G,L as N,a as _,d as Q,_ as R}from"./ContentBlock.vue_vue_type_script_setup_true_lang-BwF6D-yB.js";import{u as J}from"./vue.-sixQ7xP-DwXf3zRn.js";import{C as K}from"./calendar-hsWc4yH-.js";import{A as O,S as W}from"./save-C2B6th9J.js";import"./settings-DbyDiH2g.js";import"./x-BNquQe5y.js";/**
2
- * @license lucide-vue-next v0.344.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const X=o("BarChartIcon",[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]]);/**
7
- * @license lucide-vue-next v0.344.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Y=o("BoxIcon",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
12
- * @license lucide-vue-next v0.344.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const ee=o("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
17
- * @license lucide-vue-next v0.344.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const C=o("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
22
- * @license lucide-vue-next v0.344.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const te=o("Grid3x3Icon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
27
- * @license lucide-vue-next v0.344.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const ae=o("LayersIcon",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
32
- * @license lucide-vue-next v0.344.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const oe=o("MapIcon",[["polygon",{points:"3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21",key:"ok2ie8"}],["line",{x1:"9",x2:"9",y1:"3",y2:"18",key:"w34qz5"}],["line",{x1:"15",x2:"15",y1:"6",y2:"21",key:"volv9a"}]]);/**
37
- * @license lucide-vue-next v0.344.0 - ISC
38
- *
39
- * This source code is licensed under the ISC license.
40
- * See the LICENSE file in the root directory of this source tree.
41
- */const re=o("MusicIcon",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);/**
42
- * @license lucide-vue-next v0.344.0 - ISC
43
- *
44
- * This source code is licensed under the ISC license.
45
- * See the LICENSE file in the root directory of this source tree.
46
- */const se=o("PaletteIcon",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
47
- * @license lucide-vue-next v0.344.0 - ISC
48
- *
49
- * This source code is licensed under the ISC license.
50
- * See the LICENSE file in the root directory of this source tree.
51
- */const le=o("PuzzleIcon",[["path",{d:"M19.439 7.85c-.049.322.059.648.289.878l1.568 1.568c.47.47.706 1.087.706 1.704s-.235 1.233-.706 1.704l-1.611 1.611a.98.98 0 0 1-.837.276c-.47-.07-.802-.48-.968-.925a2.501 2.501 0 1 0-3.214 3.214c.446.166.855.497.925.968a.979.979 0 0 1-.276.837l-1.61 1.61a2.404 2.404 0 0 1-1.705.707 2.402 2.402 0 0 1-1.704-.706l-1.568-1.568a1.026 1.026 0 0 0-.877-.29c-.493.074-.84.504-1.02.968a2.5 2.5 0 1 1-3.237-3.237c.464-.18.894-.527.967-1.02a1.026 1.026 0 0 0-.289-.877l-1.568-1.568A2.402 2.402 0 0 1 1.998 12c0-.617.236-1.234.706-1.704L4.23 8.77c.24-.24.581-.353.917-.303.515.077.877.528 1.073 1.01a2.5 2.5 0 1 0 3.259-3.259c-.482-.196-.933-.558-1.01-1.073-.05-.336.062-.676.303-.917l1.525-1.525A2.402 2.402 0 0 1 12 1.998c.617 0 1.234.236 1.704.706l1.568 1.568c.23.23.556.338.877.29.493-.074.84-.504 1.02-.968a2.5 2.5 0 1 1 3.237 3.237c-.464.18-.894.527-.967 1.02Z",key:"i0oyt7"}]]);/**
52
- * @license lucide-vue-next v0.344.0 - ISC
53
- *
54
- * This source code is licensed under the ISC license.
55
- * See the LICENSE file in the root directory of this source tree.
56
- */const ie=o("QuoteIcon",[["path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z",key:"4rm80e"}],["path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",key:"10za9r"}]]);/**
57
- * @license lucide-vue-next v0.344.0 - ISC
58
- *
59
- * This source code is licensed under the ISC license.
60
- * See the LICENSE file in the root directory of this source tree.
61
- */const ne=o("ShapesIcon",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/**
62
- * @license lucide-vue-next v0.344.0 - ISC
63
- *
64
- * This source code is licensed under the ISC license.
65
- * See the LICENSE file in the root directory of this source tree.
66
- */const ce=o("SparklesIcon",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
67
- * @license lucide-vue-next v0.344.0 - ISC
68
- *
69
- * This source code is licensed under the ISC license.
70
- * See the LICENSE file in the root directory of this source tree.
71
- */const de=o("TableIcon",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
72
- * @license lucide-vue-next v0.344.0 - ISC
73
- *
74
- * This source code is licensed under the ISC license.
75
- * See the LICENSE file in the root directory of this source tree.
76
- */const ue=o("VideoIcon",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]]),ye={class:"min-h-full bg-gray-50 dark:bg-gray-900"},me={class:"bg-white dark:bg-gray-800 shadow-sm border-b border-gray-200 dark:border-gray-700"},ge={class:"px-4 sm:px-6 lg:px-8 py-4"},pe={class:"flex items-center justify-between"},he={class:"flex items-center"},be={class:"text-2xl font-semibold text-gray-900 dark:text-white"},ke={class:"flex items-center space-x-3"},xe={class:"border border-gray-300 dark:border-gray-600 rounded-md overflow-hidden"},ve={type:"submit",form:"collection-form",class:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-sky-600 hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 transition-colors"},fe={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},we={class:"grid grid-cols-12 gap-6"},_e={class:"col-span-12 md:col-span-3"},Ce={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4 border border-gray-200 dark:border-gray-700"},Me={class:"text-lg font-medium text-gray-900 dark:text-white mb-4"},Be={class:"text-sm font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-3"},ze={class:"grid grid-cols-2 gap-3"},Le=["onClick"],Ve={class:"mb-2"},Ie={class:"text-sm text-gray-700 dark:text-gray-300"},Te={class:"col-span-12 md:col-span-9"},$e={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700"},Se={class:"p-6 space-y-6"},qe={for:"name",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},Ae={for:"slug",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},je={for:"description",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},Pe={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700"},De={class:"p-6"},Fe={class:"text-lg font-medium text-gray-900 dark:text-white mb-4"},He={key:0,class:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-6"},Ze={class:"text-center text-gray-500 dark:text-gray-400"},We=S({__name:"CreateCollectionPage",setup(Ue){const k=P(),c=x("edit"),{t:M}=q();J({title:()=>M("collections.createCollection")+" | CMS"});const s=x({name:"",slug:"",description:"",contentBlocks:[]}),B=[{id:"heading",label:"Heading",icon:G,category:"text"},{id:"paragraph",label:"Text",icon:u,category:"text"},{id:"quote",label:"Quote",icon:ie,category:"text"},{id:"code",label:"Code",icon:C,category:"text"},{id:"list",label:"List",icon:N,category:"text"},{id:"image",label:"Image",icon:j,category:"media"},{id:"gallery",label:"Gallery",icon:te,category:"media"},{id:"video",label:"Video",icon:ue,category:"media"},{id:"audio",label:"Audio",icon:re,category:"media"},{id:"file",label:"File",icon:u,category:"media"},{id:"container",label:"Container",icon:Y,category:"layout"},{id:"columns",label:"Columns",icon:y,category:"layout"},{id:"divider",label:"Divider",icon:ae,category:"layout"},{id:"spacer",label:"Spacer",icon:ne,category:"layout"},{id:"button",label:"Button",icon:_,category:"interactive"},{id:"form",label:"Form",icon:u,category:"interactive"},{id:"tabs",label:"Tabs",icon:y,category:"interactive"},{id:"accordion",label:"Accordion",icon:y,category:"interactive"},{id:"carousel",label:"Carousel",icon:y,category:"interactive"},{id:"table",label:"Table",icon:de,category:"data"},{id:"chart",label:"Chart",icon:X,category:"data"},{id:"timeline",label:"Timeline",icon:ee,category:"data"},{id:"calendar",label:"Calendar",icon:K,category:"data"},{id:"map",label:"Map",icon:oe,category:"embeds"},{id:"social",label:"Social",icon:_,category:"embeds"},{id:"customHtml",label:"Custom HTML",icon:C,category:"special"},{id:"markdown",label:"Markdown",icon:u,category:"special"},{id:"svg",label:"SVG",icon:se,category:"special"},{id:"animation",label:"Animation",icon:ce,category:"special"},{id:"snippet",label:"Snippet",icon:le,category:"special"}],z=A(()=>B.reduce((t,a)=>(t[a.category]||(t[a.category]=[]),t[a.category].push(a),t),{})),L=t=>{switch(t){case"heading":return{text:"",level:1};case"paragraph":return{text:""};case"quote":return{text:"",author:"",citation:""};case"code":return{code:"",language:"javascript",showLineNumbers:!0};case"list":return{items:[""],type:"bullet",showCheckboxes:!1};case"image":return{url:"",alt:"",caption:"",size:"medium"};case"gallery":return{images:[],columns:3,gap:"medium"};case"video":return{url:"",type:"upload",autoplay:!1,controls:!0};case"audio":return{url:"",autoplay:!1,controls:!0};case"file":return{url:"",name:"",size:"",type:""};case"container":return{width:"full",padding:"medium",background:"none"};case"columns":return{columns:[],count:2,gap:"medium"};case"divider":return{style:"solid",width:"full",color:"gray"};case"spacer":return{height:"medium"};case"button":return{text:"",url:"",style:"primary",size:"medium"};case"form":return{fields:[],submitText:"Submit",action:""};case"tabs":return{tabs:[{title:"Tab 1",content:""}]};case"accordion":return{items:[{title:"Item 1",content:""}]};case"carousel":return{items:[],autoplay:!1,indicators:!0};case"table":return{headers:[],rows:[],striped:!0};case"chart":return{type:"bar",data:{},options:{}};case"timeline":return{items:[],style:"vertical"};case"calendar":return{events:[],view:"month"};case"map":return{latitude:0,longitude:0,zoom:13};case"social":return{platform:"",url:"",showCount:!0};case"customHtml":return{code:"",scripts:[]};case"markdown":return{content:"",sanitize:!0};case"svg":return{code:"",width:"auto",height:"auto"};case"animation":return{type:"fade",duration:300,delay:0};case"snippet":return{code:"",language:"javascript"};default:return{}}},V=t=>{const a={id:`block-${Date.now()}`,type:t,content:L(t)};s.value.contentBlocks.push(a)},I=t=>{s.value.contentBlocks=s.value.contentBlocks.filter(a=>a.id!==t)},T=t=>{console.log("Editing block:",t)},$=()=>{console.log("Form submitted:",s.value),k.push("/collections")};return(t,a)=>(i(),n("div",ye,[e("div",me,[e("div",ge,[e("div",pe,[e("div",he,[e("button",{onClick:a[0]||(a[0]=r=>m(k).push("/collections")),class:"mr-4 p-2 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"},[g(m(O),{class:"h-5 w-5"})]),e("h1",be,l(t.$t("collections.createCollection")),1)]),e("div",ke,[e("div",xe,[e("button",{class:v(["px-4 py-2 text-sm font-medium",[c.value==="edit"?"bg-sky-100 text-sky-700 dark:bg-sky-900 dark:text-sky-300":"bg-white text-gray-700 dark:bg-gray-700 dark:text-gray-200"]]),onClick:a[1]||(a[1]=r=>c.value="edit")}," Edit ",2),e("button",{class:v(["px-4 py-2 text-sm font-medium",[c.value==="preview"?"bg-sky-100 text-sky-700 dark:bg-sky-900 dark:text-sky-300":"bg-white text-gray-700 dark:bg-gray-700 dark:text-gray-200"]]),onClick:a[2]||(a[2]=r=>c.value="preview")}," Preview ",2)]),e("button",ve,[g(m(W),{class:"h-4 w-4 mr-2"}),D(" "+l(t.$t("common.actions.save"))+" "+l(t.$t("collections.title")),1)])])])])]),e("div",fe,[e("div",we,[e("div",_e,[e("div",Ce,[e("h2",Me,l(t.$t("common.content"))+" "+l(t.$t("collections.title")),1),(i(!0),n(f,null,w(z.value,(r,p)=>(i(),n("div",{key:p,class:"mb-6"},[e("h3",Be,l(p.charAt(0).toUpperCase()+p.slice(1)),1),e("div",ze,[(i(!0),n(f,null,w(r,d=>(i(),n("div",{key:d.id,onClick:Ee=>V(d.id),class:"flex flex-col items-center justify-center p-4 border border-gray-200 dark:border-gray-700 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors"},[e("div",Ve,[(i(),U(E(d.icon),{class:"h-5 w-5"}))]),e("span",Ie,l(d.label),1)],8,Le))),128))])]))),128))])]),e("div",Te,[e("form",{id:"collection-form",onSubmit:F($,["prevent"]),class:"space-y-6"},[e("div",$e,[e("div",Se,[e("div",null,[e("label",qe,l(t.$t("collections.form.name")),1),h(e("input",{type:"text",name:"name",id:"name","onUpdate:modelValue":a[3]||(a[3]=r=>s.value.name=r),class:"mt-1 block w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-sky-500 focus:border-sky-500 sm:text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white transition-colors",required:""},null,512),[[b,s.value.name]])]),e("div",null,[e("label",Ae,l(t.$t("collections.form.slug")),1),h(e("input",{type:"text",name:"slug",id:"slug","onUpdate:modelValue":a[4]||(a[4]=r=>s.value.slug=r),class:"mt-1 block w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-sky-500 focus:border-sky-500 sm:text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white transition-colors",required:""},null,512),[[b,s.value.slug]])]),e("div",null,[e("label",je,l(t.$t("collections.form.description")),1),h(e("textarea",{name:"description",id:"description",rows:"3","onUpdate:modelValue":a[5]||(a[5]=r=>s.value.description=r),class:"mt-1 block w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-sky-500 focus:border-sky-500 sm:text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white transition-colors"},null,512),[[b,s.value.description]])])])]),e("div",Pe,[e("div",De,[e("h3",Fe,l(t.$t("common.content"))+" "+l(t.$t("collections.title")),1),g(m(Q),{modelValue:s.value.contentBlocks,"onUpdate:modelValue":a[6]||(a[6]=r=>s.value.contentBlocks=r),"item-key":"id",handle:".handle",class:"space-y-4"},{item:Z(({element:r})=>[g(R,{block:r,onRemove:I,onEdit:T},null,8,["block"])]),_:1},8,["modelValue"]),s.value.contentBlocks.length===0?(i(),n("div",He,[e("div",Ze,l(t.$t("collections.dragToBuild")),1)])):H("",!0)])])],32)])])])]))}});export{We as default};
@@ -1,11 +0,0 @@
1
- import{c as M,d as B,u as I,a as k,F as T,I as P,r as p,b as n,e,f as m,g as y,h as o,t as s,w as h,i as q,o as i,j as g,n as u,k as x,l as a,m as c,U as w}from"./index-DYyZmLWO.js";import{u as E}from"./vue.-sixQ7xP-DwXf3zRn.js";import{D as F}from"./database-BTxZQzYy.js";import{P as L}from"./plus-D9etvrM2.js";import{C}from"./calendar-hsWc4yH-.js";import{E as D,X as N,C as H}from"./x-circle-C3q70RMH.js";import{S as R}from"./square-pen-61CkyXzK.js";/**
2
- * @license lucide-vue-next v0.344.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const A=M("TagIcon",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
7
- * @license lucide-vue-next v0.344.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const V=M("UsersIcon",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),z={class:"space-y-6"},J={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},X={class:"flex justify-between items-start"},G={class:"text-sm font-medium text-gray-500 dark:text-gray-400"},K={class:"text-2xl font-semibold text-gray-900 dark:text-white mt-1"},W={class:"p-3 rounded-full bg-gray-100 dark:bg-gray-700"},O={class:"mt-4 flex items-center"},Q={class:"text-sm text-gray-500 dark:text-gray-400 ml-1"},Y={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm p-6 border border-gray-200 dark:border-gray-700"},Z={class:"flex items-center justify-between mb-6"},ee={class:"text-lg font-medium text-gray-900 dark:text-white"},te={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"},se={class:"flex items-center justify-between mb-2"},ae={class:"text-lg font-medium text-gray-900 dark:text-white"},re={class:"text-sm font-medium text-gray-500 dark:text-gray-400"},oe={class:"text-sm text-gray-500 dark:text-gray-400"},de={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},ie={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},ce={class:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},ne={class:"text-lg font-medium text-gray-900 dark:text-white"},le={class:"divide-y divide-gray-200 dark:divide-gray-700"},he={class:"flex items-center justify-between mb-2"},ge={class:"flex items-center space-x-4 text-sm text-gray-500 dark:text-gray-400"},ue={class:"flex items-center"},me={class:"flex items-center"},ye={class:"flex items-center"},xe={class:"flex items-center"},be={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700"},ve={class:"p-4 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between"},_e={class:"text-lg font-medium text-gray-900 dark:text-white"},fe={class:"divide-y divide-gray-200 dark:divide-gray-700"},ke={class:"flex items-center justify-between mb-2"},pe={class:"flex items-center space-x-4 text-sm text-gray-500 dark:text-gray-400"},we={class:"flex items-center"},Ce={class:"flex items-center"},De={class:"flex items-center"},Ae={class:"flex items-center"},qe=B({__name:"Dashboard",setup(Me){const{t:d,locale:Se}=I();E({title:()=>d("dashboard.title")+" | CMS"});const S=k(()=>[{title:d("dashboard.stats.totalArticles"),value:"128",change:"+12%",trend:"up",icon:T,iconColor:"text-blue-500"},{title:d("dashboard.stats.totalMedia"),value:"843",change:"+5%",trend:"up",icon:P,iconColor:"text-purple-500"},{title:d("dashboard.stats.activeUsers"),value:"24",change:"+2",trend:"up",icon:V,iconColor:"text-green-500"},{title:d("dashboard.stats.apiRequests"),value:"15.2k",change:"-3%",trend:"down",icon:F,iconColor:"text-orange-500"}]),$=k(()=>[{name:d("dashboard.collections.articles"),description:d("dashboard.collections.articlesDesc"),count:128,path:"/collections/articles"},{name:d("dashboard.collections.posts"),description:d("dashboard.collections.postsDesc"),count:256,path:"/collections/posts"},{name:d("dashboard.collections.products"),description:d("dashboard.collections.productsDesc"),count:64,path:"/collections/products"},{name:d("dashboard.collections.categories"),description:d("dashboard.collections.categoriesDesc"),count:12,path:"/collections/categories"}]),U=p([{id:"1",title:"Getting Started with Keystatic CMS",author:"Alex Morgan",category:"Tutorials",status:"published",date:"2024-03-15",views:1245},{id:"2",title:"Content Modeling Best Practices",author:"Jamie Chen",category:"Best Practices",status:"published",date:"2024-03-14",views:932},{id:"3",title:"Advanced Content Builder Techniques",author:"Sam Wilson",category:"Advanced",status:"draft",date:"2024-03-13",views:0}]),j=p([{id:"1",title:"New Feature Release",author:"Riley Thompson",category:"Updates",status:"published",date:"2024-03-15",views:456},{id:"2",title:"Community Spotlight",author:"Jordan Lee",category:"Community",status:"published",date:"2024-03-14",views:789},{id:"3",title:"Upcoming Events",author:"Alex Morgan",category:"Events",status:"draft",date:"2024-03-13",views:0}]),b=r=>{const f=new Date(r);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(f)},v=r=>{switch(r){case"published":return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case"draft":return"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200";default:return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"}},_=r=>{switch(r){case"published":return H;case"draft":return R;default:return N}};return(r,f)=>{const l=q("router-link");return i(),n("div",z,[e("div",J,[(i(!0),n(m,null,y(S.value,t=>(i(),n("div",{key:t.title,class:"bg-white dark:bg-gray-800 p-6 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 transform transition-transform duration-300 hover:scale-105"},[e("div",X,[e("div",null,[e("p",G,s(t.title),1),e("h3",K,s(t.value),1)]),e("div",W,[(i(),g(x(t.icon),{class:u(["h-6 w-6",t.iconColor])},null,8,["class"]))])]),e("div",O,[(i(),g(x(t.trend==="up"?"ArrowUp":"ArrowDown"),{class:u(["w-4 h-4 mr-1",t.trend==="up"?"text-green-500":"text-red-500"])},null,8,["class"])),e("span",{class:u(["text-sm font-medium",t.trend==="up"?"text-green-500":"text-red-500"])},s(t.change),3),e("span",Q,s(r.$t("dashboard.stats.fromLastMonth")),1)])]))),128))]),e("div",Y,[e("div",Z,[e("h2",ee,s(r.$t("dashboard.collections.title")),1),o(l,{to:"/collections",class:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-sky-600 hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 transition-colors"},{default:h(()=>[o(c(L),{class:"h-4 w-4 mr-2"}),a(" "+s(r.$t("dashboard.collections.new")),1)]),_:1})]),e("div",te,[(i(!0),n(m,null,y($.value,t=>(i(),g(l,{key:t.name,to:t.path,class:"block p-6 bg-gray-50 dark:bg-gray-700 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-600 transition-colors"},{default:h(()=>[e("div",se,[e("h3",ae,s(t.name),1),e("span",re,s(t.count)+" "+s(r.$t("dashboard.collections.items")),1)]),e("p",oe,s(t.description),1)]),_:2},1032,["to"]))),128))])]),e("div",de,[e("div",ie,[e("div",ce,[e("h2",ne,s(r.$t("dashboard.recentArticles")),1),o(l,{to:"/collections/articles",class:"text-sm text-sky-600 dark:text-sky-400 hover:text-sky-700 dark:hover:text-sky-300"},{default:h(()=>[a(s(r.$t("common.actions.viewAll")),1)]),_:1})]),e("div",le,[(i(!0),n(m,null,y(U.value,t=>(i(),n("div",{key:t.id,class:"p-4 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"},[e("div",he,[o(l,{to:`/collections/articles/${t.id}`,class:"text-base font-medium text-gray-900 dark:text-white hover:text-sky-600 dark:hover:text-sky-400"},{default:h(()=>[a(s(t.title),1)]),_:2},1032,["to"]),e("span",{class:u([v(t.status),"px-2.5 py-0.5 rounded-full text-xs font-medium inline-flex items-center"])},[(i(),g(x(_(t.status)),{class:"h-3 w-3 mr-1"})),a(" "+s(t.status),1)],2)]),e("div",ge,[e("div",ue,[o(c(w),{class:"h-4 w-4 mr-1"}),a(" "+s(t.author),1)]),e("div",me,[o(c(A),{class:"h-4 w-4 mr-1"}),a(" "+s(t.category),1)]),e("div",ye,[o(c(C),{class:"h-4 w-4 mr-1"}),a(" "+s(b(t.date)),1)]),e("div",xe,[o(c(D),{class:"h-4 w-4 mr-1"}),a(" "+s(t.views),1)])])]))),128))])]),e("div",be,[e("div",ve,[e("h2",_e,s(r.$t("dashboard.recentPosts")),1),o(l,{to:"/collections/posts",class:"text-sm text-sky-600 dark:text-sky-400 hover:text-sky-700 dark:hover:text-sky-300"},{default:h(()=>[a(s(r.$t("common.actions.viewAll")),1)]),_:1})]),e("div",fe,[(i(!0),n(m,null,y(j.value,t=>(i(),n("div",{key:t.id,class:"p-4 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"},[e("div",ke,[o(l,{to:`/collections/posts/${t.id}`,class:"text-base font-medium text-gray-900 dark:text-white hover:text-sky-600 dark:hover:text-sky-400"},{default:h(()=>[a(s(t.title),1)]),_:2},1032,["to"]),e("span",{class:u([v(t.status),"px-2.5 py-0.5 rounded-full text-xs font-medium inline-flex items-center"])},[(i(),g(x(_(t.status)),{class:"h-3 w-3 mr-1"})),a(" "+s(t.status),1)],2)]),e("div",pe,[e("div",we,[o(c(w),{class:"h-4 w-4 mr-1"}),a(" "+s(t.author),1)]),e("div",Ce,[o(c(A),{class:"h-4 w-4 mr-1"}),a(" "+s(t.category),1)]),e("div",De,[o(c(C),{class:"h-4 w-4 mr-1"}),a(" "+s(b(t.date)),1)]),e("div",Ae,[o(c(D),{class:"h-4 w-4 mr-1"}),a(" "+s(t.views),1)])])]))),128))])])])])}}});export{qe as default};
@@ -1 +0,0 @@
1
- import{d as B,r as b,u as C,b as c,e,m as d,x as $,h as l,t as a,n as y,l as T,f as V,g as D,y as L,s as g,v as m,z as A,w as S,j as E,k as I,I as N,P,A as U,o as i}from"./index-DYyZmLWO.js";import{d as j,T as k,L as F,a as M,_ as R}from"./ContentBlock.vue_vue_type_script_setup_true_lang-BwF6D-yB.js";import{u as q}from"./vue.-sixQ7xP-DwXf3zRn.js";import{A as z,S as H}from"./save-C2B6th9J.js";import"./settings-DbyDiH2g.js";import"./x-BNquQe5y.js";const G={class:"min-h-full bg-gray-50 dark:bg-gray-900"},J={class:"bg-white dark:bg-gray-800 shadow-sm border-b border-gray-200 dark:border-gray-700"},K={class:"px-4 sm:px-6 lg:px-8 py-4"},O={class:"flex items-center justify-between"},Q={class:"flex items-center"},W={class:"text-2xl font-semibold text-gray-900 dark:text-white"},X={class:"flex items-center space-x-3"},Y={class:"border border-gray-300 dark:border-gray-600 rounded-md overflow-hidden"},Z={type:"submit",form:"collection-form",class:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-sky-600 hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 transition-colors"},ee={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},te={class:"grid grid-cols-12 gap-6"},oe={class:"col-span-12 md:col-span-3"},se={class:"bg-white dark:bg-gray-800 rounded-lg shadow-sm p-4 border border-gray-200 dark:border-gray-700"},re={class:"text-lg font-medium text-gray-900 dark:text-white mb-4"},ae={class:"grid grid-cols-2 gap-3"},ne=["onClick"],de={class:"mb-2"},le={class:"text-sm text-gray-700 dark:text-gray-300"},ie={class:"col-span-12 md:col-span-9"},ce={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700"},ge={class:"p-6 space-y-6"},me={for:"name",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},ue={for:"slug",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},be={for:"description",class:"block text-sm font-medium text-gray-700 dark:text-gray-300"},ye={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700"},ke={class:"p-6"},pe={class:"text-lg font-medium text-gray-900 dark:text-white mb-4"},he={key:0,class:"border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg p-6"},xe={class:"text-center text-gray-500 dark:text-gray-400"},Ve=B({__name:"EditCollectionPage",setup(ve){const u=$();U();const n=b("edit"),{t:p}=C();q({title:()=>p("collections.editCollection")+" | CMS"});const r=b({name:"Articles",slug:"articles",description:"Blog articles and news posts",contentBlocks:[{id:"block-1",type:"heading",content:{text:"Article Title",level:1}},{id:"block-2",type:"paragraph",content:{text:"Article content goes here..."}},{id:"block-3",type:"image",content:{url:"",alt:"Featured Image"}}]}),h=[{id:"heading",label:"Heading",icon:k},{id:"paragraph",label:"Text",icon:k},{id:"image",label:"Image",icon:N},{id:"list",label:"List",icon:F},{id:"button",label:"Button",icon:M},{id:"divider",label:"Divider",icon:P}],x=t=>{switch(t){case"heading":return{text:"",level:1};case"paragraph":return{text:""};case"image":return{url:"",alt:""};case"list":return{items:[""]};case"button":return{text:"",url:""};case"divider":return{style:"solid"};default:return{}}},v=t=>{const o={id:`block-${Date.now()}`,type:t,content:x(t)};r.value.contentBlocks.push(o)},f=t=>{r.value.contentBlocks=r.value.contentBlocks.filter(o=>o.id!==t)},w=t=>{console.log("Editing block:",t)},_=()=>{console.log("Form submitted:",r.value),u.push("/collections")};return(t,o)=>(i(),c("div",G,[e("div",J,[e("div",K,[e("div",O,[e("div",Q,[e("button",{onClick:o[0]||(o[0]=s=>d(u).push("/collections")),class:"mr-4 p-2 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"},[l(d(z),{class:"h-5 w-5"})]),e("h1",W,a(t.$t("collections.editCollection")),1)]),e("div",X,[e("div",Y,[e("button",{class:y(["px-4 py-2 text-sm font-medium",[n.value==="edit"?"bg-sky-100 text-sky-700 dark:bg-sky-900 dark:text-sky-300":"bg-white text-gray-700 dark:bg-gray-700 dark:text-gray-200"]]),onClick:o[1]||(o[1]=s=>n.value="edit")}," Edit ",2),e("button",{class:y(["px-4 py-2 text-sm font-medium",[n.value==="preview"?"bg-sky-100 text-sky-700 dark:bg-sky-900 dark:text-sky-300":"bg-white text-gray-700 dark:bg-gray-700 dark:text-gray-200"]]),onClick:o[2]||(o[2]=s=>n.value="preview")}," Preview ",2)]),e("button",Z,[l(d(H),{class:"h-4 w-4 mr-2"}),T(" "+a(t.$t("common.actions.save"))+" "+a(t.$t("common.actions.edit")),1)])])])])]),e("div",ee,[e("div",te,[e("div",oe,[e("div",se,[e("h2",re,a(t.$t("common.content"))+" "+a(t.$t("collections.title")),1),e("div",ae,[(i(),c(V,null,D(h,s=>e("div",{key:s.id,onClick:fe=>v(s.id),class:"flex flex-col items-center justify-center p-4 border border-gray-200 dark:border-gray-700 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer transition-colors"},[e("div",de,[(i(),E(I(s.icon),{class:"h-5 w-5"}))]),e("span",le,a(s.label),1)],8,ne)),64))])])]),e("div",ie,[e("form",{id:"collection-form",onSubmit:L(_,["prevent"]),class:"space-y-6"},[e("div",ce,[e("div",ge,[e("div",null,[e("label",me,a(t.$t("collections.form.name")),1),g(e("input",{type:"text",name:"name",id:"name","onUpdate:modelValue":o[3]||(o[3]=s=>r.value.name=s),class:"mt-1 block w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-sky-500 focus:border-sky-500 sm:text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white transition-colors",required:""},null,512),[[m,r.value.name]])]),e("div",null,[e("label",ue,a(t.$t("collections.form.slug")),1),g(e("input",{type:"text",name:"slug",id:"slug","onUpdate:modelValue":o[4]||(o[4]=s=>r.value.slug=s),class:"mt-1 block w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-sky-500 focus:border-sky-500 sm:text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white transition-colors",required:""},null,512),[[m,r.value.slug]])]),e("div",null,[e("label",be,a(t.$t("collections.form.description")),1),g(e("textarea",{name:"description",id:"description",rows:"3","onUpdate:modelValue":o[5]||(o[5]=s=>r.value.description=s),class:"mt-1 block w-full border border-gray-300 dark:border-gray-600 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-sky-500 focus:border-sky-500 sm:text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-white transition-colors"},null,512),[[m,r.value.description]])])])]),e("div",ye,[e("div",ke,[e("h3",pe,a(t.$t("common.content"))+" "+a(t.$t("collections.title")),1),l(d(j),{modelValue:r.value.contentBlocks,"onUpdate:modelValue":o[6]||(o[6]=s=>r.value.contentBlocks=s),"item-key":"id",handle:".handle",class:"space-y-4"},{item:S(({element:s})=>[l(R,{block:s,onRemove:f,onEdit:w},null,8,["block"])]),_:1},8,["modelValue"]),r.value.contentBlocks.length===0?(i(),c("div",he,[e("div",xe,a(t.$t("collections.dragToBuild")),1)])):A("",!0)])])],32)])])])]))}});export{Ve as default};
@@ -1 +0,0 @@
1
- import{b as i,o as l,e as t,j as p,z as k,h as c,f as j,g as I,t as h,n as M,L as K,l as G,i as $,m as V,M as J,N as Q,r as _,w as Z,q as W}from"./index-DYyZmLWO.js";import{a as A}from"./index-xsH4HHeE.js";const w=(s,o)=>{const n=s.__vccOpts||s;for(const[r,e]of o)n[r]=e;return n},Y={},ee={xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function te(s,o){return l(),i("svg",ee,o[0]||(o[0]=[t("path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"},null,-1),t("polyline",{points:"9 22 9 12 15 12 15 22"},null,-1)]))}const se=w(Y,[["render",te]]),ne={},oe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-chevron-right"};function le(s,o){return l(),i("svg",oe,o[0]||(o[0]=[t("path",{d:"m9 18 6-6-6-6"},null,-1)]))}const R=w(ne,[["render",le]]),ie={class:"flex items-center space-x-1 text-sm"},re=["onClick"],ae={__name:"MediaBreadcrumb",props:{currentPath:{type:Array,required:!0}},emits:["navigate"],setup(s){return(o,n)=>(l(),i("nav",ie,[t("button",{class:"inline-flex items-center justify-center h-8 px-2 text-sm font-medium transition-colors rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground",onClick:n[0]||(n[0]=r=>o.$emit("navigate",[]))},[c(se,{class:"w-4 h-4"})]),s.currentPath.length>0?(l(),p(R,{key:0,class:"w-4 h-4 text-muted-foreground"})):k("",!0),(l(!0),i(j,null,I(s.currentPath,(r,e)=>(l(),i("div",{key:e,class:"flex items-center"},[t("button",{class:M(["inline-flex items-center justify-center h-8 px-2 text-sm font-medium transition-colors rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground",{"font-semibold":e===s.currentPath.length-1}]),onClick:m=>o.$emit("navigate",s.currentPath.slice(0,e+1))},h(r),11,re),e<s.currentPath.length-1?(l(),p(R,{key:0,class:"w-4 h-4 text-muted-foreground"})):k("",!0)]))),128))]))}},de={},ce={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"w-4 h-4 lucide lucide-layout-grid"};function ue(s,o){return l(),i("svg",ce,o[0]||(o[0]=[t("rect",{width:"7",height:"7",x:"3",y:"3",rx:"1"},null,-1),t("rect",{width:"7",height:"7",x:"14",y:"3",rx:"1"},null,-1),t("rect",{width:"7",height:"7",x:"14",y:"14",rx:"1"},null,-1),t("rect",{width:"7",height:"7",x:"3",y:"14",rx:"1"},null,-1)]))}const me=w(de,[["render",ue]]),ge={},he={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-list"};function fe(s,o){return l(),i("svg",he,o[0]||(o[0]=[K('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>',6)]))}const pe=w(ge,[["render",fe]]),ve={},xe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-plus"};function ye(s,o){return l(),i("svg",xe,o[0]||(o[0]=[t("path",{d:"M5 12h14"},null,-1),t("path",{d:"M12 5v14"},null,-1)]))}const E=w(ve,[["render",ye]]),be={class:"flex items-center gap-2"},we={class:"inline-flex border rounded-md"},_e={__name:"MediaViewControls",props:{modelValue:{type:String,required:!0}},emits:["update:modelValue","create-folder","file-change"],setup(s){return(o,n)=>(l(),i("div",be,[t("div",we,[t("button",{class:M(["inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground h-10 px-3",{"bg-gray-100":s.modelValue==="grid"}]),onClick:n[0]||(n[0]=r=>o.$emit("update:modelValue","grid")),"aria-label":"Grid view"},[c(me,{class:"w-4 h-4"})],2),t("button",{class:M(["inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground h-10 px-3",{"bg-gray-100":s.modelValue==="list"}]),onClick:n[1]||(n[1]=r=>o.$emit("update:modelValue","list")),"aria-label":"List view"},[c(pe,{class:"w-4 h-4"})],2)]),t("button",{class:"inline-flex items-center justify-center px-3 text-sm font-medium transition-colors border rounded-md whitespace-nowrap ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input bg-background hover:bg-accent hover:text-accent-foreground h-9",onClick:n[2]||(n[2]=r=>o.$emit("create-folder"))},[c(E,{class:"w-4 h-4 mr-2"}),n[5]||(n[5]=G(" Нова папка "))]),t("div",null,[t("input",{type:"file",onChange:n[3]||(n[3]=r=>o.$emit("file-change",r)),ref:"fileInputRef",class:"hidden",multiple:""},null,544),t("button",{class:"flex bg-sky-600 hover:bg-sky-700 text-white px-3 py-1.5 rounded-md items-center gap-x-2",onClick:n[4]||(n[4]=r=>o.$refs.fileInputRef.click())},[c(E,{class:"w-4 h-4 mr-2"}),n[6]||(n[6]=G(" Завантажити медіа "))])])]))}},ke={},$e={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function Ce(s,o){return l(),i("svg",$e,o[0]||(o[0]=[t("path",{d:"M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z"},null,-1),t("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"},null,-1)]))}const B=w(ke,[["render",Ce]]);function z(s){if(s===0)return"0 Bytes";const o=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(s)/Math.log(o));return Number.parseFloat((s/Math.pow(o,r)).toFixed(2))+" "+n[r]}function H(s){return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}const Fe={class:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5"},Ve={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground col-span-full"},je=["onClick"],Me={class:"flex flex-col items-center text-center"},Be={class:"flex items-center justify-center w-16 h-16 mb-2"},Ae={key:0,class:"relative w-16 h-16"},He=["src","alt"],Ie={class:"w-full text-sm font-medium truncate"},ze={key:0,class:"text-xs text-muted-foreground"},De=["onClick"],Le={class:"text-sm"},Ne={__name:"MediaGrid",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null}},emits:["file-click"],setup(s){return(o,n)=>{const r=$("File");return l(),i("div",Fe,[s.files.length===0?(l(),i("div",Ve,[c(r,{class:"w-12 h-12 mb-2"}),n[0]||(n[0]=t("p",null,"Немає файлів у цій папці",-1))])):k("",!0),(l(!0),i(j,null,I(s.files,e=>{var m;return l(),i(j,{key:e.id},[e.type==="file"?(l(),i("div",{key:0,class:M(["border rounded-lg p-3 h-[140px] cursor-pointer hover:bg-gray-100",{"bg-accent text-accent-foreground ring-2 ring-primary":((m=s.selectedFile)==null?void 0:m.id)===e.id}]),onClick:u=>o.$emit("file-click",e)},[t("div",Me,[t("div",Be,[(e==null?void 0:e.filetype)==="image"&&(e!=null&&e.filepath)?(l(),i("div",Ae,[t("img",{src:e==null?void 0:e.filepath,alt:(e==null?void 0:e.alt)||(e==null?void 0:e.filename),class:"object-cover w-full h-full rounded"},null,8,He)])):(l(),p(r,{key:1,class:"w-12 h-12 text-gray-500"}))]),t("div",Ie,h(e==null?void 0:e.filename),1),e.filesize?(l(),i("div",ze,h(V(z)(e.filesize)),1)):k("",!0)])],10,je)):e.type==="dir"?(l(),i("div",{key:1,class:"border rounded-lg p-3 hover:bg-gray-100 h-[140px] cursor-pointer flex flex-col items-center justify-center",onClick:u=>o.$emit("file-click",e)},[c(B,{class:"w-12 h-12 text-blue-500"}),t("span",Le,h(e==null?void 0:e.name),1)],8,De)):k("",!0)],64)}),128))])}}},Pe={},Se={"aria-hidden":"true",focusable:"false",role:"img",viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor"};function Ue(s,o){return l(),i("svg",Se,o[0]||(o[0]=[t("path",{d:"M.513 1.513A1.75 1.75 0 0 1 1.75 1h3.5c.55 0 1.07.26 1.4.7l.9 1.2a.25.25 0 0 0 .2.1H 13a1 1 0 0 1 1 1v.5H2.75a.75.75 0 0 0 0 1.5h11.978a1 1 0 0 1 .994 1.117L15 13.25A1.75 1.75 0 0 1 13.25 15H1.75A1.75 1.75 0 0 1 0 13.25V2.75c0-.464.184-.91.513-1.237Z"},null,-1),t("path",{d:"M1.75 1A1.75 1.75 0 0 0 0 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0 0 16 13.25v-8.5A1.75 1.75 0 0 0 14.25 3H7.5a.25.25 0 0 1-.2-.1l-.9-1.2C6.07 1.26 5.55 1 5 1H1.75Z"},null,-1)]))}const X=w(Pe,[["render",Ue]]),Te={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground"},qe={key:1,class:"w-full text-sm caption-bottom"},Oe={class:"[&_tr:last-child]:border-0"},Ge=["onClick"],Ze={class:"p-4 font-medium align-middle"},Re={class:"flex items-center gap-2"},Ee={key:1,class:"relative w-8 h-8"},Ke=["src","alt"],Xe={class:"truncate max-w-[200px]"},Je={class:"p-4 align-middle"},Qe={class:"p-4 align-middle"},We={class:"hidden p-4 align-middle md:table-cell"},Ye={__name:"MediaList",props:{files:{type:Array,required:!0},selectedFile:{type:Object,default:null}},emits:["file-click"],setup(s){return(o,n)=>{const r=$("File");return l(),i("div",null,[s.files.length===0?(l(),i("div",Te,[c(r,{class:"w-12 h-12 mb-2"}),n[0]||(n[0]=t("p",null,"Немає файлів у цій папці",-1))])):(l(),i("table",qe,[n[1]||(n[1]=t("thead",{class:"[&_tr]:border-b"},[t("tr",{class:"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"},[t("th",{class:"h-12 px-4 text-left align-middle font-medium text-muted-foreground w-[300px]"}," Назва "),t("th",{class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"}," Тип "),t("th",{class:"h-12 px-4 font-medium text-left align-middle text-muted-foreground"}," Розмір "),t("th",{class:"hidden h-12 px-4 font-medium text-left align-middle text-muted-foreground md:table-cell"}," Змінено ")])],-1)),t("tbody",Oe,[(l(!0),i(j,null,I(s.files,e=>{var m,u,v,f;return l(),i("tr",{key:e.id,class:M(["border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted cursor-pointer",{"bg-accent":((m=s.selectedFile)==null?void 0:m.id)===e.id}]),onClick:y=>o.$emit("file-click",e)},[t("td",Ze,[t("div",Re,[e.type==="dir"?(l(),p(B,{key:0,class:"w-5 h-5 text-blue-500"})):(e==null?void 0:e.filetype)==="image"&&(e!=null&&e.filepath)?(l(),i("div",Ee,[t("img",{src:e==null?void 0:e.filepath,alt:(e==null?void 0:e.alt)||(e==null?void 0:e.filename),class:"object-cover w-full h-full rounded"},null,8,Ke)])):(e==null?void 0:e.filetype)==="image"?(l(),p(X,{key:2,class:"w-5 h-5 text-green-500"})):(l(),p(r,{key:3,class:"w-5 h-5 text-gray-500"})),t("span",Xe,h((e==null?void 0:e.filename)||(e==null?void 0:e.name)),1)])]),t("td",Je,h((e==null?void 0:e.type)==="dir"?"Папка":((v=(u=e==null?void 0:e.filetype)==null?void 0:u.charAt(0))==null?void 0:v.toUpperCase())+((f=e==null?void 0:e.filetype)==null?void 0:f.slice(1))),1),t("td",Qe,h((e==null?void 0:e.type)==="dir"?"--":V(z)(e==null?void 0:e.filesize)),1),t("td",We,h(e!=null&&e.updated_at?V(H)(e==null?void 0:e.updated_at):"--"),1)],10,Ge)}),128))])]))])}}},et={},tt={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function st(s,o){return l(),i("svg",tt,o[0]||(o[0]=[K('<path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><line x1="10" y1="9" x2="8" y2="9"></line>',5)]))}const nt=w(et,[["render",st]]),ot={class:"border rounded-lg shadow-sm bg-card text-card-foreground"},lt={class:"p-6 space-y-4"},it={key:0,class:"flex flex-col items-center justify-center h-64 text-muted-foreground"},rt={class:"flex justify-center mb-4"},at={key:1,class:"flex items-center justify-center w-full h-48"},dt=["src","alt"],ct={class:"text-lg font-semibold truncate"},ut={class:"text-sm text-muted-foreground"},mt={class:"space-y-2"},gt={class:"flex items-center gap-2"},ht={class:"ml-auto text-sm"},ft={class:"flex items-center gap-2"},pt={class:"ml-auto text-sm"},vt={class:"flex items-center gap-2"},xt={class:"ml-auto text-sm"},yt={key:0,class:"flex items-start gap-2"},bt={class:"ml-auto text-sm text-right"},wt={key:1,class:"flex items-start gap-2"},_t={class:"ml-auto text-sm text-right"},kt={__name:"MediaFileInfo",props:{file:{type:Object,default:null}},setup(s){return(o,n)=>{var u,v,f,y,C,x,b,d,a,g,F,D,L,N,P,S,U,T,q,O;const r=$("File"),e=$("HardDrive"),m=$("Calendar");return l(),i("div",ot,[n[7]||(n[7]=t("div",{class:"flex flex-col space-y-1.5 p-6"},[t("h3",{class:"text-2xl font-semibold leading-none tracking-tight"}," Інформація про файл ")],-1)),t("div",lt,[s.file?(l(),i(j,{key:1},[t("div",rt,[s.file.filetype==="folder"?(l(),p(B,{key:0,class:"w-24 h-24 text-blue-500"})):((u=s.file)==null?void 0:u.filetype)==="image"&&((v=s.file)!=null&&v.filepath)?(l(),i("div",at,[t("img",{src:(f=s.file)==null?void 0:f.filepath,alt:((y=s.file)==null?void 0:y.alt)||((C=s.file)==null?void 0:C.filename),class:"object-contain max-w-full max-h-full rounded"},null,8,dt)])):((x=s.file)==null?void 0:x.filetype)==="image"?(l(),p(X,{key:2,class:"w-24 h-24 text-green-500"})):(l(),p(r,{key:3,class:"w-24 h-24 text-gray-500"}))]),t("div",null,[t("h3",ct,h((b=s.file)==null?void 0:b.filename),1),t("p",ut,h(((d=s.file)==null?void 0:d.filetype)==="folder"?"Папка":((a=s.file)==null?void 0:a.filetype.charAt(0).toUpperCase())+((g=s.file)==null?void 0:g.filetype.slice(1))),1)]),n[6]||(n[6]=t("div",{class:"w-full h-px bg-border"},null,-1)),t("div",mt,[t("div",gt,[c(e,{class:"w-4 h-4 text-muted-foreground"}),n[1]||(n[1]=t("span",{class:"text-sm"},"Розмір: ",-1)),t("span",ht,h(((F=s.file)==null?void 0:F.filetype)==="folder"?"--":V(z)((D=s.file)==null?void 0:D.filesize)),1)]),t("div",ft,[c(m,{class:"w-4 h-4 text-muted-foreground"}),n[2]||(n[2]=t("span",{class:"text-sm"},"Створено: ",-1)),t("span",pt,h((L=s.file)!=null&&L.created_at?V(H)((N=s.file)==null?void 0:N.created_at):"--"),1)]),t("div",vt,[c(m,{class:"w-4 h-4 text-muted-foreground"}),n[3]||(n[3]=t("span",{class:"text-sm"},"Змінено: ",-1)),t("span",xt,h((P=s.file)!=null&&P.updated_at?V(H)((S=s.file)==null?void 0:S.updated_at):"--"),1)]),(U=s.file)!=null&&U.filepath?(l(),i("div",yt,[c(B,{class:"h-4 w-4 text-muted-foreground mt-0.5"}),n[4]||(n[4]=t("span",{class:"text-sm"},"Шлях: ",-1)),t("span",bt,h((T=s.file)==null?void 0:T.filepath),1)])):k("",!0),(q=s.file)!=null&&q.description?(l(),i("div",wt,[c(nt,{class:"h-4 w-4 text-muted-foreground mt-0.5"}),n[5]||(n[5]=t("span",{class:"text-sm"},"Опис: ",-1)),t("span",_t,h((O=s.file)==null?void 0:O.description),1)])):k("",!0)])],64)):(l(),i("div",it,n[0]||(n[0]=[t("p",null,"Виберіть файл для перегляду деталей",-1)])))])])}}},$t={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Ct={__name:"MediaCreateFolder",props:{modelValue:{},modelModifiers:{}},emits:J(["update:modelValue","create"],["update:modelValue"]),setup(s,{emit:o}){const n=Q(s,"modelValue"),r=o,e=_({}),m={name:{name:"name",label:"Назва",type:"Text"}},u=()=>{r("create",{...e.value}),e.value={}};return(v,f)=>{const y=$("VsForm"),C=$("VsDialog");return l(),p(C,{visible:n.value,"onUpdate:visible":f[2]||(f[2]=x=>n.value=x),title:"Створити папку"},{footer:Z(()=>[t("div",$t,[t("button",{onClick:f[1]||(f[1]=x=>v.$emit("update:modelValue",!1)),class:"inline-flex items-center px-3 py-2 text-sm text-black duration-300 border border-gray-200 rounded-lg gap-x-2 whitespace-nowrap hover:bg-gray-100"}," Скасувати "),t("button",{onClick:u,class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Створити ")])]),default:Z(()=>[c(y,{scheme:m,modelValue:e.value,"onUpdate:modelValue":f[0]||(f[0]=x=>e.value=x)},null,8,["modelValue"])]),_:1},8,["visible"])}}},Ft={class:"container min-h-screen p-4 mx-auto"},Vt={class:"grid grid-cols-1 gap-6 lg:grid-cols-4"},jt={class:"space-y-4 lg:col-span-3"},Mt={class:"flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center"},Ht={__name:"MediaPage",setup(s){const o=_("grid"),n=_([]),r=_(null),e=_([]),m=_(!1),u=_([]),v=d=>{n.value=d,u.value=[...u.value,d],r.value=null,b()},f=()=>{u.value.length>1&&(u.value.pop(),n.value=u.value[u.value.length-1],r.value=null,b())},y=d=>{var a;d.type==="dir"?v([...n.value,d.name]):r.value=d.id===((a=r.value)==null?void 0:a.id)?null:d},C=async d=>{const a=d.target.files[0];if(!a)return;const g=new FormData;g.append("file",a);try{const F=n.value.join("/");await A.post(`/api/cms-media/upload?subdir=${F}`,g,{headers:{"Content-Type":"multipart/form-data","X-Skip-Session":"true"}}),await b()}catch(F){error.value="Failed to upload files",console.error("Upload error:",F)}},x=async d=>{try{const a=n.value.join("/");await A.post(`/api/cms-media/upload?subdir=${a}/${d.name}`),m.value=!1,await b()}catch{error.value="Failed to create folder"}},b=async()=>{try{const d=n.value.join("/"),a=await A.get("/api/cms-media",{params:{subdir:d}});a.data&&a.data.data?e.value=a.data.data.map(g=>({...g,id:g.type==="dir"?`dir-${g.name}`:g.name})):e.value=[]}catch(d){error.value="Failed to fetch files",console.error("Fetch error:",d),e.value=[]}};return W(()=>{u.value=[[]],b()}),(d,a)=>(l(),i("div",Ft,[a[4]||(a[4]=t("h1",{class:"mb-6 text-3xl font-bold"},"Медіа бібліотека",-1)),t("div",Vt,[t("div",jt,[t("div",Mt,[c(ae,{"current-path":n.value,onNavigate:v,onNavigateBack:f},null,8,["current-path"]),c(_e,{modelValue:o.value,"onUpdate:modelValue":a[0]||(a[0]=g=>o.value=g),onCreateFolder:a[1]||(a[1]=g=>m.value=!0),onFileChange:C},null,8,["modelValue"])]),a[3]||(a[3]=t("div",{class:"w-full h-px bg-border"},null,-1)),o.value==="grid"?(l(),p(Ne,{key:0,files:e.value,"selected-file":r.value,onFileClick:y},null,8,["files","selected-file"])):(l(),p(Ye,{key:1,files:e.value,"selected-file":r.value,onFileClick:y},null,8,["files","selected-file"]))]),c(kt,{file:r.value},null,8,["file"])]),c(Ct,{modelValue:m.value,"onUpdate:modelValue":a[2]||(a[2]=g=>m.value=g),onCreate:x},null,8,["modelValue"])]))}};export{Ht as default};
@@ -1 +0,0 @@
1
- import{d as v,u as _,r as x,a as C,b as l,e,t as i,h as u,l as A,m as a,s as P,v as j,f as y,g as p,n as L,j as d,O as c,o as r}from"./index-DYyZmLWO.js";import{u as M}from"./vue.-sixQ7xP-DwXf3zRn.js";import{P as U}from"./plus-D9etvrM2.js";import{S as B}from"./search-BI-hqhq6.js";import{X as g}from"./x-BNquQe5y.js";const R={class:"space-y-6"},S={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},V={class:"text-2xl font-semibold text-gray-900 dark:text-white"},E={class:"inline-flex items-center justify-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-sky-600 hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 transition-colors"},$={class:"grid grid-cols-1 md:grid-cols-12 gap-6"},D={class:"md:col-span-8 bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden"},N={class:"p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700"},T={class:"flex items-center"},z={class:"relative flex-1"},J={class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},F=["placeholder"],H={class:"overflow-x-auto"},I={class:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},O={class:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700"},Q={class:"px-6 py-4 whitespace-nowrap"},W={class:"flex items-center"},X={class:"h-10 w-10 rounded-full bg-sky-100 dark:bg-sky-900 flex items-center justify-center text-sky-600 dark:text-sky-300 font-medium text-sm"},Y={class:"ml-4"},q={class:"text-sm font-medium text-gray-900 dark:text-white"},G={class:"text-sm text-gray-500 dark:text-gray-400"},K={class:"px-6 py-4 whitespace-nowrap"},Z={class:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400"},ee={class:"md:col-span-4 bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden"},te={class:"overflow-x-auto"},re={class:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},se={class:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700"},ae={class:"px-6 py-3 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-white"},oe={class:"px-6 py-3 whitespace-nowrap text-center"},ie={class:"px-6 py-3 whitespace-nowrap text-center"},de={class:"px-6 py-3 whitespace-nowrap text-center"},ne={class:"px-6 py-3 whitespace-nowrap text-center"},ye=v({__name:"PermissionsPage",setup(le){const{t:h}=_();M({title:()=>h("permissions.title")+" | CMS"});const n=x(""),m=x([{id:"1",name:"Alex Morgan",email:"alex@example.com",role:"admin",lastActive:"2 hours ago"},{id:"2",name:"Jamie Chen",email:"jamie@example.com",role:"editor",lastActive:"4 hours ago"},{id:"3",name:"Sam Wilson",email:"sam@example.com",role:"author",lastActive:"Yesterday"},{id:"4",name:"Riley Thompson",email:"riley@example.com",role:"viewer",lastActive:"3 days ago"},{id:"5",name:"Jordan Lee",email:"jordan@example.com",role:"editor",lastActive:"1 week ago"}]),k=x([{name:"Create content",admin:!0,editor:!0,author:!0,viewer:!1},{name:"Edit content",admin:!0,editor:!0,author:!0,viewer:!1},{name:"Delete content",admin:!0,editor:!0,author:!1,viewer:!1},{name:"Publish content",admin:!0,editor:!0,author:!1,viewer:!1},{name:"Manage media",admin:!0,editor:!0,author:!0,viewer:!1},{name:"Manage users",admin:!0,editor:!1,author:!1,viewer:!1},{name:"Manage settings",admin:!0,editor:!1,author:!1,viewer:!1}]),f=C(()=>n.value?m.value.filter(o=>o.name.toLowerCase().includes(n.value.toLowerCase())||o.email.toLowerCase().includes(n.value.toLowerCase())):m.value);function w(o){switch(o){case"admin":return"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200";case"editor":return"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200";case"author":return"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200";case"viewer":return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300";default:return"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"}}return(o,s)=>(r(),l("div",R,[e("div",S,[e("h1",V,i(o.$t("permissions.title")),1),e("button",E,[u(a(U),{class:"h-4 w-4 mr-2"}),A(" "+i(o.$t("permissions.inviteUser")),1)])]),e("div",$,[e("div",D,[e("div",N,[e("div",T,[e("div",z,[e("div",J,[u(a(B),{class:"h-5 w-5 text-gray-400"})]),P(e("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>n.value=t),type:"text",class:"block w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md leading-5 bg-white dark:bg-gray-700 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 text-gray-900 dark:text-white sm:text-sm transition-colors",placeholder:o.$t("permissions.searchUsers")},null,8,F),[[j,n.value]])])])]),e("div",H,[e("table",I,[s[2]||(s[2]=e("thead",{class:"bg-gray-50 dark:bg-gray-750"},[e("tr",null,[e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," User "),e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Role "),e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Last Active "),e("th",{scope:"col",class:"px-6 py-3 text-right text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Actions ")])],-1)),e("tbody",O,[(r(!0),l(y,null,p(f.value,t=>(r(),l("tr",{key:t.id,class:"hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"},[e("td",Q,[e("div",W,[e("div",X,i(t.name.charAt(0).toUpperCase()),1),e("div",Y,[e("div",q,i(t.name),1),e("div",G,i(t.email),1)])])]),e("td",K,[e("span",{class:L(["px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full",w(t.role)])},i(o.$t("permissions.roles."+t.role)),3)]),e("td",Z,i(t.lastActive),1),s[1]||(s[1]=e("td",{class:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium"},[e("button",{class:"text-sky-600 hover:text-sky-900 dark:text-sky-400 dark:hover:text-sky-300 mr-3 transition-colors"}," Edit "),e("button",{class:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300 transition-colors"}," Remove ")],-1))]))),128))])])])]),e("div",ee,[s[4]||(s[4]=e("div",{class:"p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700"},[e("h2",{class:"text-lg font-medium text-gray-900 dark:text-white"},"Role Permissions"),e("p",{class:"mt-1 text-sm text-gray-500 dark:text-gray-400"}," Permissions assigned to each role in the system. ")],-1)),e("div",te,[e("table",re,[s[3]||(s[3]=e("thead",{class:"bg-gray-50 dark:bg-gray-750"},[e("tr",null,[e("th",{scope:"col",class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Permission "),e("th",{scope:"col",class:"px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Admin "),e("th",{scope:"col",class:"px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Editor "),e("th",{scope:"col",class:"px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Author "),e("th",{scope:"col",class:"px-6 py-3 text-center text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Viewer ")])],-1)),e("tbody",se,[(r(!0),l(y,null,p(k.value,(t,b)=>(r(),l("tr",{key:b,class:"hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors"},[e("td",ae,i(t.name),1),e("td",oe,[t.admin?(r(),d(a(c),{key:0,class:"mx-auto h-5 w-5 text-green-500"})):(r(),d(a(g),{key:1,class:"mx-auto h-5 w-5 text-red-500"}))]),e("td",ie,[t.editor?(r(),d(a(c),{key:0,class:"mx-auto h-5 w-5 text-green-500"})):(r(),d(a(g),{key:1,class:"mx-auto h-5 w-5 text-red-500"}))]),e("td",de,[t.author?(r(),d(a(c),{key:0,class:"mx-auto h-5 w-5 text-green-500"})):(r(),d(a(g),{key:1,class:"mx-auto h-5 w-5 text-red-500"}))]),e("td",ne,[t.viewer?(r(),d(a(c),{key:0,class:"mx-auto h-5 w-5 text-green-500"})):(r(),d(a(g),{key:1,class:"mx-auto h-5 w-5 text-red-500"}))])]))),128))])])]),s[5]||(s[5]=e("div",{class:"p-4 border-t border-gray-200 dark:border-gray-700"},[e("button",{class:"inline-flex items-center justify-center px-4 py-2 border border-gray-300 dark:border-gray-600 text-sm font-medium rounded-md shadow-sm text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 transition-colors w-full"}," Customize Permissions ")],-1))])])]))}});export{ye as default};
@@ -1 +0,0 @@
1
- import{d as y,r as n,q as x,b,e as t,h as l,s as h,m as g,v,l as w,x as _,o as k}from"./index-DYyZmLWO.js";import{F as S,_ as F}from"./UniversalTable.vue_vue_type_script_setup_true_lang-DUqfWJcy.js";import{S as V}from"./search-BI-hqhq6.js";import"./calendar-hsWc4yH-.js";import"./x-circle-C3q70RMH.js";import"./square-pen-61CkyXzK.js";import"./trash-2-CJSl_r88.js";const q={class:"space-y-6"},B={class:"bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden"},C={class:"p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700"},E={class:"flex flex-col sm:flex-row gap-4"},N={class:"flex-1 relative"},T={class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},j={class:"flex space-x-2"},L={class:"inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 dark:text-gray-200 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500 transition-colors"},A=y({__name:"SingletonsPage",setup(M){const u=_(),o=n(""),i=n([]),d=n([{name:"title",title:"Title"},{name:"slug",title:"Slug"}]),m=s=>{u.push(`/singletons/${s.id}`)},f=async()=>{const r=(await(await fetch("/api/cms")).json()).rows.filter(a=>a.type==="single");i.value=r},p=(s,e)=>{if(!e)return!0;const r=e.toLowerCase();return d.value.some(a=>{const c=s[a.name];return c&&c.toString().toLowerCase().includes(r)})};return x(f),(s,e)=>(k(),b("div",q,[e[2]||(e[2]=t("div",{class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},[t("h1",{class:"text-2xl font-semibold text-gray-900 dark:text-white"},"Singletons")],-1)),t("div",B,[t("div",C,[t("div",E,[t("div",N,[t("div",T,[l(g(V),{class:"h-5 w-5 text-gray-400"})]),h(t("input",{type:"text",class:"block w-full pl-10 pr-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md leading-5 bg-white dark:bg-gray-700 placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 text-gray-900 dark:text-white sm:text-sm transition-colors",placeholder:"Search singletons...","onUpdate:modelValue":e[0]||(e[0]=r=>o.value=r)},null,512),[[v,o.value]])]),t("div",j,[t("button",L,[l(g(S),{class:"h-4 w-4 mr-2 text-gray-500 dark:text-gray-400"}),e[1]||(e[1]=w(" Filter "))])])])]),l(F,{rows:i.value,columns:d.value,query:o.value,filterFn:p,onEdit:m},null,8,["rows","columns","query"])])]))}});export{A as default};
@@ -1,6 +0,0 @@
1
- import{c as $,d as q,a as M,b as i,e as o,f as u,g as x,t as d,n as C,j as w,k as F,z as D,l as g,h as y,m as k,x as N,o as a}from"./index-DYyZmLWO.js";import{C as A}from"./calendar-hsWc4yH-.js";import{E as L,X as z,C as I}from"./x-circle-C3q70RMH.js";import{S as R}from"./square-pen-61CkyXzK.js";import{T as P}from"./trash-2-CJSl_r88.js";/**
2
- * @license lucide-vue-next v0.344.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ie=$("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),U={class:"overflow-x-auto"},X={class:"min-w-full divide-y divide-gray-200 dark:divide-gray-700"},j={class:"bg-gray-50 dark:bg-gray-800"},G={class:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700"},H=["onClick"],J={key:2,class:"flex items-center text-sm text-gray-500 dark:text-gray-400"},K={key:3,class:"flex items-center"},O={key:4,class:"text-sm text-gray-900 dark:text-white truncate max-w-xs"},Q={class:"px-6 py-4 whitespace-nowrap text-sm font-medium"},W={class:"flex space-x-2"},Y=["onClick"],Z=["onClick"],oe=q({__name:"UniversalTable",props:{rows:{},columns:{},query:{},filterFn:{type:Function},onEdit:{type:Function},onView:{type:Function},onDelete:{type:Function},onMore:{type:Function},customRender:{}},emits:["edit","view","delete","more"],setup(V,{emit:E}){const n=V,c=E;N();const B=M(()=>!n.query||!n.filterFn?n.rows:n.rows.filter(t=>n.filterFn(t,n.query))),S=t=>{if(!t)return"";const r=new Date(t);return new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r)},l=t=>{switch(t){case"published":return{icon:I,text:"Published",classes:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200"};case"draft":return{icon:R,text:"Draft",classes:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200"};case"archived":return{icon:z,text:"Archived",classes:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300"};default:return null}},p=(t,r)=>{switch(t){case"edit":c("edit",r),n.onEdit&&n.onEdit(r);break;case"view":c("view",r),n.onView&&n.onView(r);break;case"delete":c("delete",r),n.onDelete&&n.onDelete(r);break;case"more":c("more",r),n.onMore&&n.onMore(r);break}},T=t=>{p("edit",t)};return(t,r)=>(a(),i("div",U,[o("table",X,[o("thead",j,[o("tr",null,[(a(!0),i(u,null,x(t.columns,e=>(a(),i("th",{key:e.name,class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"},d(e.title||e.name),1))),128)),r[0]||(r[0]=o("th",{class:"px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider"}," Actions ",-1))])]),o("tbody",G,[(a(!0),i(u,null,x(B.value,e=>(a(),i("tr",{key:e.id||e._id||e.name},[(a(!0),i(u,null,x(t.columns,(s,f)=>{var h,v,_,m,b;return a(),i("td",{key:s.name,class:C(["px-6 py-4 whitespace-nowrap",{"cursor-pointer font-bold ":f===0}]),onClick:ee=>f===0?T(e):void 0},[t.customRender&&t.customRender[s.name]?(a(),w(F(t.customRender[s.name](e[s.name],e)),{key:0})):s.name==="status"?(a(),i(u,{key:1},[l(e[s.name])?(a(),i("span",{key:0,class:C(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",(h=l(e[s.name]))==null?void 0:h.classes])},[(a(),w(F((v=l(e[s.name]))==null?void 0:v.icon),{class:"h-3 w-3 mr-1"})),g(" "+d((_=l(e[s.name]))==null?void 0:_.text),1)],2)):D("",!0)],64)):["published_at","created_at","updated_at","date","lastModified"].includes(s.name)?(a(),i("div",J,[y(k(A),{class:"h-4 w-4 mr-1"}),g(" "+d(S(e[s.name])),1)])):s.name==="views"?(a(),i("div",K,[y(k(L),{class:"h-4 w-4 mr-1"}),g(" "+d(((b=(m=e[s.name])==null?void 0:m.toLocaleString)==null?void 0:b.call(m))??e[s.name]),1)])):(a(),i("div",O,d(e[s.name]),1))],10,H)}),128)),o("td",Q,[o("div",W,[o("button",{class:"text-sky-600 hover:text-sky-900 dark:text-sky-400 dark:hover:text-sky-300 transition-colors",onClick:s=>p("edit",e)},[y(k(R),{class:"h-4 w-4"})],8,Y),t.onDelete||t.$attrs.onDelete||t.$attrs["on:delete"]?(a(),i("button",{key:0,class:"text-red-600 hover:text-red-900 dark:text-red-400 dark:hover:text-red-300 transition-colors",onClick:s=>p("delete",e)},[y(k(P),{class:"h-4 w-4"})],8,Z)):D("",!0)])])]))),128))])])]))}});export{ie as F,oe as _};
@@ -1 +0,0 @@
1
- import{d as C,r as v,p as k,b as w,e as m,f as T,g as j,y as U,j as A,t as S,k as E,K as b,A as D,x as V,o as h,q as N,h as x,m as g,l as q}from"./index-DYyZmLWO.js";import{a as $}from"./index-xsH4HHeE.js";import{A as B,S as O}from"./save-C2B6th9J.js";const J={class:"max-w-4xl mx-auto"},L={class:"space-y-6"},M={class:"text-sm font-medium text-gray-900 dark:text-white mb-2"},P=C({__name:"formWrapper",props:{columns:{},initialData:{}},emits:["submit","cancel","update"],setup(_,{emit:y}){const d=D(),o=_,c=y;function p(s,n){const e={};return s.forEach(f=>{e[f.name]=n&&n[f.name]!==void 0?n[f.name]:""}),e}const t=v(p(o.columns??[],o.initialData)),a=v({...t.value}),r=v(null),i=()=>{r.value&&clearTimeout(r.value),r.value=window.setTimeout(()=>{Object.keys(t.value).some(n=>t.value[n]!==a.value[n])&&(c("update",{...t.value}),a.value={...t.value})},300)};k(t,()=>{i()},{deep:!0});const u=V();k(()=>[o.columns,o.initialData],([s,n])=>{s&&n&&(t.value=p(s,n))},{immediate:!0});const l=s=>{if(s==="yes_no")return b.formComponents.VsFormSwitcher;if(s==="date")return b.formComponents.VsFormDatepicker;if(!s)return null;const n=s.charAt(0).toUpperCase()+s.slice(1);return b.formComponents["VsForm"+n]},F=async()=>{var s;(s=o.initialData)!=null&&s.id?await $.put(`/api/cms/${d.meta.type}/${o.initialData.id}`,{...t.value}):await $.post(`/api/cms/${d.meta.type}`,{...t.value}),u.back()};return(s,n)=>(h(),w("div",J,[m("div",{onSubmit:U(F,["prevent"]),class:"space-y-6 bg-white dark:bg-gray-800 shadow-sm rounded-lg border border-gray-200 dark:border-gray-700 p-6"},[m("div",L,[(h(!0),w(T,null,j(s.columns,e=>(h(),w("div",{key:e.name},[m("div",M,S(e.title),1),(h(),A(E(l((e==null?void 0:e.type)||"")),{modelValue:t.value[e.name],"onUpdate:modelValue":f=>t.value[e.name]=f,label:e==null?void 0:e.title,id:e==null?void 0:e.name,name:e==null?void 0:e.name,type:e==null?void 0:e.type,required:e==null?void 0:e.required,placeholder:e==null?void 0:e.placeholder,rows:e==null?void 0:e.rows,options:e==null?void 0:e.options},null,8,["modelValue","onUpdate:modelValue","label","id","name","type","required","placeholder","rows","options"]))]))),128))])],32)]))}}),R={class:"space-y-6"},z={class:"flex items-center justify-between"},K={class:"flex items-center gap-4"},W={class:"text-2xl font-semibold text-gray-900 dark:text-white"},G={class:"flex items-center space-x-3"},X=C({__name:"contentForm",setup(_){const y=V(),d=D(),o=v([]),c=v({title:"",content:"",author:"",category:"",status:"draft"});N(async()=>{var r;const t=d.meta.type||"articles",a=(r=d.params)==null?void 0:r.id;if(!a){const u=await(await fetch(`/api/cms/${t}/`)).json();o.value=u.columns}try{if(!a)return;const i=await fetch(`/api/cms/${t}/${a}`);if(!i.ok)throw new Error("Failed to fetch article");const u=await i.json();o.value=u==null?void 0:u.columns;let l=u.rows;Array.isArray(l)||(l=[l]),c.value=l[0]}catch(i){console.error("Error fetching article:",i)}});const p=async t=>{var i;const a=d.meta.type||"articles",r=(i=d.params)==null?void 0:i.id;try{r?await fetch(`/api/cms/${a}/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c.value)}):await fetch(`/api/cms/${a}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c.value)}),y.back()}catch(u){console.error("Error saving article:",u)}};return(t,a)=>(h(),w("div",R,[m("div",z,[m("div",K,[m("button",{onClick:a[0]||(a[0]=r=>g(y).back()),class:"p-2 text-gray-500 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white rounded-full hover:bg-gray-100 dark:hover:bg-gray-700"},[x(g(B),{class:"h-5 w-5"})]),m("h1",W,S(g(d).meta.title),1)]),m("div",G,[m("button",{onClick:p,type:"submit",class:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-sky-600 hover:bg-sky-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-sky-500"},[x(g(O),{class:"h-4 w-4 mr-2"}),a[2]||(a[2]=q(" Зберегти "))])])]),x(P,{columns:o.value,"initial-data":c.value,onSubmit:p,onUpdate:a[1]||(a[1]=r=>c.value=r)},null,8,["columns","initial-data"])]))}});export{X as default};
@@ -1,6 +0,0 @@
1
- import{c as e}from"./index-DYyZmLWO.js";/**
2
- * @license lucide-vue-next v0.344.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const c=e("DatabaseIcon",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);export{c as D};