@oktis-works/admin 0.4.20 → 0.4.23

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 (144) hide show
  1. package/dist/client/_astro/{ActivityWidget.BbEtaaM-.js → ActivityWidget.DaftIB1V.js} +2 -2
  2. package/dist/client/_astro/AdminBar.B-diRxPt.js +253 -0
  3. package/dist/client/_astro/{AtGlanceWidget.C1hpeDlx.js → AtGlanceWidget.q_xwhOJa.js} +3 -3
  4. package/dist/client/_astro/BaseLayout.sayhdG_g.css +1 -0
  5. package/dist/client/_astro/ContentEditor.B1b1Ixz0.js +3 -0
  6. package/dist/client/_astro/ContentEditor.DGTZ51kU.js +1 -0
  7. package/dist/client/_astro/ContentTypeWorkspace.CFzwh3Rc.js +1 -0
  8. package/dist/client/_astro/CustomFieldsManager.DqCE6rSX.js +5 -0
  9. package/dist/client/_astro/DashboardHome.HrqKA0mK.js +1 -0
  10. package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.sBNUxHjt.js +1 -0
  11. package/dist/client/_astro/{DashboardLayout.CGou4voc.css → DashboardLayout.cOPI1C7I.css} +1 -1
  12. package/dist/client/_astro/{Footer.rUGgtlfI.js → Footer.nQEKIcjo.js} +2 -2
  13. package/dist/client/_astro/GeneralSettings.C5lXnnvB.js +1 -0
  14. package/dist/client/_astro/LogsManager.BSXD0gFG.js +1 -0
  15. package/dist/client/_astro/MediaLibrary.9tlXDGsx.js +1 -0
  16. package/dist/client/_astro/MenuManager.CfLmtMhF.js +1 -0
  17. package/dist/client/_astro/PluginManager.Ba2R7ZVx.js +98 -0
  18. package/dist/client/_astro/PostTypesManager.DqbyhhLF.js +1 -0
  19. package/dist/client/_astro/QuickDraftWidget.J5LOLOY3.js +17 -0
  20. package/dist/client/_astro/ResourceHubs.sI10AY3z.js +1 -0
  21. package/dist/client/_astro/TaxonomiesManager.BFd3zjNe.js +1 -0
  22. package/dist/client/_astro/TaxonomyTermsManager.C7ClYXtt.js +1 -0
  23. package/dist/client/_astro/ThemeManager.C4t-yZay.js +129 -0
  24. package/dist/client/_astro/UserCreateForm.B-7pKOO6.js +1 -0
  25. package/dist/client/_astro/UsersManager.aI6-3vtM.js +1 -0
  26. package/dist/client/_astro/WebhooksManager.C3E91U9V.js +1 -0
  27. package/dist/client/_astro/api.DSIz0zxF.js +1 -0
  28. package/dist/client/_astro/ar.9BcNkJMI.js +1 -0
  29. package/dist/client/_astro/client.BDaUmf7m.js +1 -0
  30. package/dist/client/_astro/custom-fields.pl-GPt9A.css +1 -0
  31. package/dist/client/_astro/dist.BqeNZlzo.js +1 -0
  32. package/dist/client/_astro/es-ES.DgqDFCmG.js +1 -0
  33. package/dist/client/_astro/extensions.BD4YTWQq.js +1 -0
  34. package/dist/client/_astro/he.11dIJHQw.js +1 -0
  35. package/dist/client/_astro/i18n.Tk18hqHh.js +1 -0
  36. package/dist/client/_astro/it.yCdgk3Xj.js +1 -0
  37. package/dist/client/_astro/ja.BIm7Hwe_.js +1 -0
  38. package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.O-AlzgHd.js → login.astro_astro_type_script_index_0_lang.CJiWhdn-.js} +1 -1
  39. package/dist/client/_astro/lucide.DlU56wZ1.js +4 -0
  40. package/dist/client/_astro/pl.dUwrcITB.js +1 -0
  41. package/dist/client/_astro/pt-BR.BvjbjXKW.js +1 -0
  42. package/dist/client/_astro/rolldown-runtime.BpQH8Ho1.js +1 -0
  43. package/dist/client/_astro/ru.lmDiQaSu.js +1 -0
  44. package/dist/client/_astro/solid.TEtyrbLc.js +1 -0
  45. package/dist/client/_astro/sw._qHdoFbp.js +1 -0
  46. package/dist/client/_astro/tr.Do-lr98T.js +1 -0
  47. package/dist/client/_astro/uk.DTUX-N1c.js +1 -0
  48. package/dist/client/_astro/{version.BQq07lEn.js → version.Cvcb-3YL.js} +1 -1
  49. package/dist/client/_astro/web.C8wWxyYF.js +1 -0
  50. package/dist/client/_astro/yo.BIYG0J7I.js +1 -0
  51. package/dist/client/_astro/zh-CN.C7Iod1E1.js +1 -0
  52. package/dist/server/chunks/{ContentEditor_DS7flRjR.mjs → ContentEditor_Bz6HNlOl.mjs} +11 -31
  53. package/dist/server/chunks/{DashboardLayout_09DepSVn.mjs → DashboardLayout_DnvPikNH.mjs} +42 -17
  54. package/dist/server/chunks/MediaLibrary_CfwJY7WG.mjs +466 -0
  55. package/dist/server/chunks/{_slug__l8CTaLpP.mjs → _slug__Bf1zTrrT.mjs} +1 -1
  56. package/dist/server/chunks/access_Iqz1YRc2.mjs +138 -0
  57. package/dist/server/chunks/{ar_B0LfQbpu.mjs → ar_DlCzOUGe.mjs} +22 -2
  58. package/dist/server/chunks/custom-fields_HXTX5-i-.mjs +1297 -0
  59. package/dist/server/chunks/{edit_hSCrM2Gq.mjs → edit_ibDxQgfc.mjs} +2 -2
  60. package/dist/server/chunks/{es-ES_dBEm2FNw.mjs → es-ES_DD40B9Zr.mjs} +22 -2
  61. package/dist/server/chunks/{general_Ct9MU7b-.mjs → general_VinYjg7Y.mjs} +2 -2
  62. package/dist/server/chunks/{he_DRWoI1A5.mjs → he_8WSAyM_S.mjs} +22 -2
  63. package/dist/server/chunks/{i18n_BqFK0MIW.mjs → i18n_BgHPm3Sm.mjs} +337 -57
  64. package/dist/server/chunks/{index_CBfRX_VO.mjs → index_BIz2E9Ay.mjs} +3 -3
  65. package/dist/server/chunks/{index_uv0IHg8r.mjs → index_DmY8Cm8s.mjs} +2 -2
  66. package/dist/server/chunks/{index_DQ5pFuPN.mjs → index_DvyRjH_d.mjs} +2 -2
  67. package/dist/server/chunks/{index_Cv2j9xC_.mjs → index_WfuyDGIh.mjs} +2 -2
  68. package/dist/server/chunks/{index_B77wdzK2.mjs → index_kl5K78eg.mjs} +1 -1
  69. package/dist/server/chunks/{it_BDY3lerP.mjs → it_DEDC6yxf.mjs} +22 -2
  70. package/dist/server/chunks/{ja_C-EybQiV.mjs → ja_BRQi6rW3.mjs} +22 -2
  71. package/dist/server/chunks/{login_D-Z6bo6E.mjs → login_s3hMBW1K.mjs} +1 -1
  72. package/dist/server/chunks/logs_DUQUxzzy.mjs +160 -0
  73. package/dist/server/chunks/menus_CgKz8KBb.mjs +532 -0
  74. package/dist/server/chunks/{new_DpJfTahF.mjs → new_CU0A50ce.mjs} +2 -2
  75. package/dist/server/chunks/{new_XOnqlHm3.mjs → new_CZuza7Tx.mjs} +2 -2
  76. package/dist/server/chunks/{pl_DH5LKmVG.mjs → pl_CKanAk0F.mjs} +22 -2
  77. package/dist/server/chunks/plugins_fppkr9jv.mjs +133 -0
  78. package/dist/server/chunks/{post-types_DziideHh.mjs → post-types_BAWPD3pX.mjs} +2 -2
  79. package/dist/server/chunks/{pt-BR_CBnqy3xP.mjs → pt-BR_CoM1872j.mjs} +263 -13
  80. package/dist/server/chunks/{ru_CFa1xYFr.mjs → ru_CuNXt2MB.mjs} +22 -2
  81. package/dist/server/chunks/{sw_QZf7NSsI.mjs → sw_RLMWPkos.mjs} +22 -2
  82. package/dist/server/chunks/{taxonomies_Bc6xPaKp.mjs → taxonomies_BACV08DC.mjs} +2 -2
  83. package/dist/server/chunks/{taxonomy_Cv4_KTTL.mjs → taxonomy_CZLTclnV.mjs} +30 -15
  84. package/dist/server/chunks/themes_DHNmoF_s.mjs +132 -0
  85. package/dist/server/chunks/{tr_Fjry5R-K.mjs → tr_Dz8pqyTZ.mjs} +22 -2
  86. package/dist/server/chunks/{uk_Bxc3qY45.mjs → uk_BjwqlweA.mjs} +22 -2
  87. package/dist/server/chunks/{upload_CB_L9tkU.mjs → upload_BZgCqIbH.mjs} +2 -2
  88. package/dist/server/chunks/webhooks_D0qA5-De.mjs +300 -0
  89. package/dist/server/chunks/{yo_BARL-Qrh.mjs → yo_Dv14KWVR.mjs} +22 -2
  90. package/dist/server/chunks/{zh-CN_CkjPJL88.mjs → zh-CN_DjIZCWzG.mjs} +22 -2
  91. package/dist/server/entry.mjs +77 -50
  92. package/dist/server/virtual_astro_middleware.mjs +1 -1
  93. package/package.json +1 -1
  94. package/dist/client/_astro/AdminBar.CU2eba2D.js +0 -253
  95. package/dist/client/_astro/BaseLayout.Y8xW22CP.css +0 -1
  96. package/dist/client/_astro/ContentEditor.Bc5Jq8Dv.js +0 -1
  97. package/dist/client/_astro/ContentEditor.DvpaqJBD.js +0 -3
  98. package/dist/client/_astro/ContentTypeWorkspace.DakVi21h.js +0 -1
  99. package/dist/client/_astro/CustomFieldsManager.B7WOTvb7.js +0 -3
  100. package/dist/client/_astro/DashboardHome.CUfuLLDH.js +0 -1
  101. package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.Dpnx6U2l.js +0 -4
  102. package/dist/client/_astro/FieldTypePicker.Cyfzqug-.js +0 -1
  103. package/dist/client/_astro/GeneralSettings.C4mnJ7P2.js +0 -1
  104. package/dist/client/_astro/MediaLibrary.2geQYfXB.js +0 -1
  105. package/dist/client/_astro/PluginManager.D3pm88iu.js +0 -93
  106. package/dist/client/_astro/PostTypesManager.Cyhr3VEJ.js +0 -1
  107. package/dist/client/_astro/QuickDraftWidget.CPljoS31.js +0 -17
  108. package/dist/client/_astro/ResourceHubs.DpCJERsJ.js +0 -1
  109. package/dist/client/_astro/TaxonomiesManager.P3bc-fnu.js +0 -1
  110. package/dist/client/_astro/TaxonomyTermsManager.BxP9gwm7.js +0 -1
  111. package/dist/client/_astro/ThemeManager.3MUOwqex.js +0 -129
  112. package/dist/client/_astro/UserCreateForm.C3RiEJEa.js +0 -1
  113. package/dist/client/_astro/UsersManager.DR9XR3FX.js +0 -1
  114. package/dist/client/_astro/api.25OAsWO0.js +0 -1
  115. package/dist/client/_astro/ar.CwC9hXB9.js +0 -1
  116. package/dist/client/_astro/client.W0NY0lEa.js +0 -1
  117. package/dist/client/_astro/custom-fields.IjuRIdAC.css +0 -1
  118. package/dist/client/_astro/es-ES.qNcd-cVX.js +0 -1
  119. package/dist/client/_astro/extensions.Bj86CHnv.js +0 -1
  120. package/dist/client/_astro/he.DfZ0ZzM-.js +0 -1
  121. package/dist/client/_astro/i18n.C24_pkIi.js +0 -1
  122. package/dist/client/_astro/it.PFmLQj2s.js +0 -1
  123. package/dist/client/_astro/ja.CMi5cD8g.js +0 -1
  124. package/dist/client/_astro/pl.CRExzLlj.js +0 -1
  125. package/dist/client/_astro/pt-BR.BPvwNpKR.js +0 -1
  126. package/dist/client/_astro/ru.CWV-tkZ3.js +0 -1
  127. package/dist/client/_astro/solid.DN8T1HsY.js +0 -1
  128. package/dist/client/_astro/src.Cq47pnsg.js +0 -1
  129. package/dist/client/_astro/sw.B5x6GU4s.js +0 -1
  130. package/dist/client/_astro/tr.BzxCGQu8.js +0 -1
  131. package/dist/client/_astro/uk.DJHMwNRU.js +0 -1
  132. package/dist/client/_astro/web.Bze9SKEA.js +0 -1
  133. package/dist/client/_astro/yo.DNw_hOnW.js +0 -1
  134. package/dist/client/_astro/zh-CN.Bs7H6Unx.js +0 -1
  135. package/dist/server/chunks/FieldTypePicker_CXwpmcQ3.mjs +0 -79
  136. package/dist/server/chunks/MediaLibrary_Xs09kLza.mjs +0 -335
  137. package/dist/server/chunks/ResourceHubs_Dwb0xyPZ.mjs +0 -453
  138. package/dist/server/chunks/access_D93W5BWD.mjs +0 -34
  139. package/dist/server/chunks/custom-fields_Dp7DHJ0M.mjs +0 -488
  140. package/dist/server/chunks/operations_0sYvzzNC.mjs +0 -34
  141. package/dist/server/chunks/plugins_Clk92l6Q.mjs +0 -156
  142. package/dist/server/chunks/resources_dPTDnpAf.mjs +0 -34
  143. package/dist/server/chunks/themes_BRtDtEK7.mjs +0 -155
  144. /package/dist/server/chunks/{BaseLayout_m8b8Eemd.mjs → BaseLayout_CXafpVV9.mjs} +0 -0
@@ -1,14 +1,14 @@
1
1
  import "./rolldown-runtime_BMI-E3GI.mjs";
2
2
  import { S as createAstro, d as maybeRenderHead, i as renderComponent, p as addAttribute, s as renderSlot, u as renderTemplate } from "./server_B5N27szj.mjs";
3
3
  import { t as createComponent$1 } from "./compiler_O7J1rlsi.mjs";
4
- import { n as renderScript, t as $$BaseLayout } from "./BaseLayout_m8b8Eemd.mjs";
5
- import { a as LOCALE_LABELS, i as LOCALE_FLAGS, n as useTranslation, o as SUPPORTED_LOCALES, r as apiClient } from "./i18n_BqFK0MIW.mjs";
4
+ import { n as renderScript, t as $$BaseLayout } from "./BaseLayout_CXafpVV9.mjs";
5
+ import { a as LOCALE_LABELS, i as LOCALE_FLAGS, n as useTranslation, o as SUPPORTED_LOCALES, r as apiClient } from "./i18n_BgHPm3Sm.mjs";
6
6
  import { t as require_semver } from "./semver_WbqCUY_o.mjs";
7
7
  import { createComponent, escape, ssr, ssrAttribute, ssrHydrationKey, ssrStyle } from "solid-js/web";
8
- import { For, For as For2, Show, Show as Show2, createMemo as createMemo$1, createSignal, createSignal as createSignal$1, onMount, onMount as onMount$1 } from "solid-js";
8
+ import { For, For as For2, Show, Show as Show2, createEffect, createMemo as createMemo$1, createSignal, createSignal as createSignal$1, onCleanup, onMount, onMount as onMount$1 } from "solid-js";
9
9
  require_semver();
10
10
  //#endregion
11
- //#region ../../packages/ui/dist/server.js
11
+ //#region ../../node_modules/.bun/@oktis-works+ui@0.3.3/node_modules/@oktis-works/ui/dist/server.js
12
12
  var _tmpl$$7 = ["<span", " class=\"spinner\" aria-label=\"Carregando\"></span>"];
13
13
  var _tmpl$2$6 = [
14
14
  "<button",
@@ -89,6 +89,13 @@ var _tmpl$12 = [
89
89
  "\">",
90
90
  "</span>"
91
91
  ];
92
+ var _tmpl$13 = [
93
+ "<div",
94
+ " class=\"modal-overlay\"><div class=\"modal\" role=\"dialog\" aria-modal=\"true\"",
95
+ "><div class=\"modal-header\"><h3>",
96
+ "</h3><button type=\"button\" class=\"btn btn-ghost btn-sm\" aria-label=\"Fechar\">×</button></div><div class=\"modal-body\">",
97
+ "</div></div></div>"
98
+ ];
92
99
  var _tmpl$15 = [
93
100
  "<table",
94
101
  " class=\"table\"><thead><tr>",
@@ -227,6 +234,24 @@ function Badge(props) {
227
234
  const variant = props.variant ?? "secondary";
228
235
  return ssr(_tmpl$12, ssrHydrationKey(), `badge badge-${escape(variant, true)}`, escape(props.children));
229
236
  }
237
+ function Modal(props) {
238
+ const handleKeyDown = (event) => {
239
+ if (event.key === "Escape") props.onClose();
240
+ };
241
+ createEffect(() => {
242
+ if (props.open) document.addEventListener("keydown", handleKeyDown);
243
+ else document.removeEventListener("keydown", handleKeyDown);
244
+ });
245
+ onCleanup(() => document.removeEventListener("keydown", handleKeyDown));
246
+ return createComponent(Show, {
247
+ get when() {
248
+ return props.open;
249
+ },
250
+ get children() {
251
+ return ssr(_tmpl$13, ssrHydrationKey(), ssrAttribute("aria-label", escape(props.title, true), false), escape(props.title), escape(props.children));
252
+ }
253
+ });
254
+ }
230
255
  function Table(props) {
231
256
  const columns = props.columns;
232
257
  return createComponent(Show, {
@@ -585,7 +610,7 @@ function AdminBar(props) {
585
610
  /** Versão do release atual (ex.: "0.4.0"). */
586
611
  var APP_VERSION = {
587
612
  name: "okcms",
588
- version: "0.4.20",
613
+ version: "0.4.23",
589
614
  "private": true,
590
615
  description: "Hybrid, modular, API-first CMS",
591
616
  engines: {
@@ -612,7 +637,7 @@ var APP_VERSION = {
612
637
  "publish:all": "node scripts/prepare-publish.mjs && for pkg in packages/* apps/api apps/admin apps/web apps/worker; do [ -f \"$pkg/package.json\" ] || continue; echo \"→ publishing $pkg\"; (cd \"$pkg\" && npm publish --access public) || exit 1; done"
613
638
  },
614
639
  devDependencies: {
615
- "@oktis-works/cms": "^0.4.20",
640
+ "@oktis-works/cms": "^0.4.23",
616
641
  "@changesets/changelog-github": "^1.0.1",
617
642
  "@changesets/cli": "^3.0.3",
618
643
  "@types/node": "22.0.0",
@@ -976,9 +1001,9 @@ var $$DashboardLayout = createComponent$1(($$result, $$props, $$slots) => {
976
1001
  const isActive = (href) => href === "/" ? pathname === "/" : pathname === href || pathname.startsWith(`${href}/`);
977
1002
  const navActive = {
978
1003
  dashboard: isActive("/"),
979
- content: isActive("/content"),
980
1004
  media: isActive("/media"),
981
1005
  users: isActive("/users"),
1006
+ menus: isActive("/menus"),
982
1007
  settings: isActive("/settings"),
983
1008
  plugins: isActive("/plugins"),
984
1009
  themes: isActive("/themes")
@@ -1004,20 +1029,20 @@ var $$DashboardLayout = createComponent$1(($$result, $$props, $$slots) => {
1004
1029
  key: "settings.taxonomies.title",
1005
1030
  active: isActive("/settings/taxonomies")
1006
1031
  },
1007
- {
1008
- href: "/settings/resources",
1009
- key: "resources.title",
1010
- active: isActive("/settings/resources")
1011
- },
1012
1032
  {
1013
1033
  href: "/settings/access",
1014
1034
  key: "access.title",
1015
1035
  active: isActive("/settings/access")
1016
1036
  },
1017
1037
  {
1018
- href: "/settings/operations",
1019
- key: "operations.title",
1020
- active: isActive("/settings/operations")
1038
+ href: "/settings/logs",
1039
+ key: "logs.title",
1040
+ active: isActive("/settings/logs")
1041
+ },
1042
+ {
1043
+ href: "/settings/webhooks",
1044
+ key: "webhooks.title",
1045
+ active: isActive("/settings/webhooks")
1021
1046
  }
1022
1047
  ];
1023
1048
  return renderTemplate`${renderComponent($$result, "BaseLayout", $$BaseLayout, {
@@ -1030,7 +1055,7 @@ var $$DashboardLayout = createComponent$1(($$result, $$props, $$slots) => {
1030
1055
  "client:component-hydration": "load",
1031
1056
  "client:component-path": "/home/runner/work/cms/cms/apps/admin/src/components/admin-bar/AdminBar.tsx",
1032
1057
  "client:component-export": "AdminBar"
1033
- })}${maybeRenderHead($$result)}<div class="layout" data-astro-cid-ynf3rr4n><!-- Sidebar colapsavel — o estado (body.sidebar-collapsed) e aplicado pelo script abaixo --><aside class="sidebar" data-astro-cid-ynf3rr4n><div class="sidebar-header" data-astro-cid-ynf3rr4n><span class="sidebar-collapsed-brand"${addAttribute(t("layout.appName"), "title")} data-astro-cid-ynf3rr4n><svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="28" height="28" data-astro-cid-ynf3rr4n><rect width="32" height="32" rx="8" fill="url(#grad)" data-astro-cid-ynf3rr4n></rect><path d="M8 10h16M8 16h12M8 22h8" stroke="#0A0A0A" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" data-astro-cid-ynf3rr4n></path><defs data-astro-cid-ynf3rr4n><linearGradient id="grad" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse" data-astro-cid-ynf3rr4n><stop offset="0%" stop-color="#D8B45E" data-astro-cid-ynf3rr4n></stop><stop offset="100%" stop-color="#B99542" data-astro-cid-ynf3rr4n></stop></linearGradient></defs></svg></span></div><nav class="sidebar-nav" data-astro-cid-ynf3rr4n><a href="/"${addAttribute(["nav-item", { active: navActive.dashboard }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><rect x="3" y="3" width="7" height="7" data-astro-cid-ynf3rr4n></rect><rect x="14" y="3" width="7" height="7" data-astro-cid-ynf3rr4n></rect><rect x="14" y="14" width="7" height="7" data-astro-cid-ynf3rr4n></rect><rect x="3" y="14" width="7" height="7" data-astro-cid-ynf3rr4n></rect></svg><span class="nav-label" data-sidebar-i18n="layout.nav.dashboard" data-astro-cid-ynf3rr4n>${t("layout.nav.dashboard")}</span></a><div${addAttribute(["nav-group", { open: navActive.content }], "class:list")} data-nav-group="content" data-astro-cid-ynf3rr4n><div class="nav-group-header" data-astro-cid-ynf3rr4n><div${addAttribute(["nav-item", { active: navActive.content }], "class:list")} data-astro-cid-ynf3rr4n><i data-lucide="file-text" aria-hidden="true" data-astro-cid-ynf3rr4n></i><span class="nav-label" data-sidebar-i18n="layout.nav.content" data-astro-cid-ynf3rr4n>${t("layout.nav.content")}</span></div><button class="nav-group-toggle" type="button"${addAttribute(navActive.content ? "true" : "false", "aria-expanded")} aria-label="Toggle content menu" data-astro-cid-ynf3rr4n>⌄</button></div><div class="nav-submenu" data-astro-cid-ynf3rr4n><div data-post-types-menu data-astro-cid-ynf3rr4n></div></div></div><a href="/media"${addAttribute(["nav-item", { active: navActive.media }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><rect x="3" y="3" width="18" height="18" rx="2" ry="2" data-astro-cid-ynf3rr4n></rect><circle cx="8.5" cy="8.5" r="1.5" data-astro-cid-ynf3rr4n></circle><polyline points="21 15 16 10 5 21" data-astro-cid-ynf3rr4n></polyline></svg><span class="nav-label" data-sidebar-i18n="layout.nav.media" data-astro-cid-ynf3rr4n>${t("layout.nav.media")}</span></a><a href="/users"${addAttribute(["nav-item", { active: navActive.users }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" data-astro-cid-ynf3rr4n></path><circle cx="9" cy="7" r="4" data-astro-cid-ynf3rr4n></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87" data-astro-cid-ynf3rr4n></path><path d="M16 3.13a4 4 0 0 1 0 7.75" data-astro-cid-ynf3rr4n></path></svg><span class="nav-label" data-sidebar-i18n="layout.nav.users" data-astro-cid-ynf3rr4n>${t("layout.nav.users")}</span></a><div${addAttribute(["nav-group", { open: navActive.settings }], "class:list")} data-nav-group="settings" data-astro-cid-ynf3rr4n><div class="nav-group-header" data-astro-cid-ynf3rr4n><a href="/settings"${addAttribute(["nav-item", { active: navActive.settings }], "class:list")} data-astro-cid-ynf3rr4n><svg class="settings-nav-icon" 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" data-astro-cid-ynf3rr4n><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 0-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" data-astro-cid-ynf3rr4n></path><circle cx="12" cy="12" r="3" data-astro-cid-ynf3rr4n></circle></svg><svg 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" data-astro-cid-ynf3rr4n><circle cx="12" cy="12" r="3" data-astro-cid-ynf3rr4n></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06-.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1.82-.33l-.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0-2.83l-.06-.06a1.65 1.65 0 0 0-.33-1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" data-astro-cid-ynf3rr4n></path></svg><span class="nav-label" data-sidebar-i18n="layout.nav.settings" data-astro-cid-ynf3rr4n>${t("layout.nav.settings")}</span></a><button class="nav-group-toggle" type="button"${addAttribute(navActive.settings ? "true" : "false", "aria-expanded")} aria-label="Toggle settings menu" data-astro-cid-ynf3rr4n>⌄</button></div><!-- Submenu de configurações fica agrupado diretamente sob Settings. --><div class="nav-submenu" data-astro-cid-ynf3rr4n>${settingsChildren.map((child) => renderTemplate`<a${addAttribute(child.href, "href")}${addAttribute(["nav-subitem", { active: child.active }], "class:list")}${addAttribute(child.key, "data-sidebar-i18n")} data-astro-cid-ynf3rr4n>${t(child.key)}</a>`)}</div></div><a href="/plugins"${addAttribute(["nav-item", { active: navActive.plugins }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><rect x="2" y="2" width="20" height="20" rx="2" ry="2" data-astro-cid-ynf3rr4n></rect><path d="M15 7h4a2 2 0 0 1 2 2v4" data-astro-cid-ynf3rr4n></path><path d="M9 17H5a2 2 0 0 1-2-2V9" data-astro-cid-ynf3rr4n></path><line x1="8" y1="12" x2="16" y2="12" data-astro-cid-ynf3rr4n></line></svg><span class="nav-label" data-sidebar-i18n="layout.nav.plugins" data-astro-cid-ynf3rr4n>${t("layout.nav.plugins")}</span></a><a href="/themes"${addAttribute(["nav-item", { active: navActive.themes }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><circle cx="12" cy="12" r="10" data-astro-cid-ynf3rr4n></circle><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" data-astro-cid-ynf3rr4n></path><path d="M2 12h20" data-astro-cid-ynf3rr4n></path></svg><span class="nav-label" data-sidebar-i18n="layout.nav.themes" data-astro-cid-ynf3rr4n>${t("layout.nav.themes")}</span></a><!-- D1: slots de extensao — paginas de menu declaradas por plugins ativos -->${renderComponent($$result, "PluginExtensionsSlot", PluginExtensionsSlot, {
1058
+ })}${maybeRenderHead($$result)}<div class="layout" data-astro-cid-ynf3rr4n><!-- Sidebar colapsavel — o estado (body.sidebar-collapsed) e aplicado pelo script abaixo --><aside class="sidebar" data-astro-cid-ynf3rr4n><div class="sidebar-header" data-astro-cid-ynf3rr4n><span class="sidebar-collapsed-brand"${addAttribute(t("layout.appName"), "title")} data-astro-cid-ynf3rr4n><svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="28" height="28" data-astro-cid-ynf3rr4n><rect width="32" height="32" rx="8" fill="url(#grad)" data-astro-cid-ynf3rr4n></rect><path d="M8 10h16M8 16h12M8 22h8" stroke="#0A0A0A" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" data-astro-cid-ynf3rr4n></path><defs data-astro-cid-ynf3rr4n><linearGradient id="grad" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse" data-astro-cid-ynf3rr4n><stop offset="0%" stop-color="#D8B45E" data-astro-cid-ynf3rr4n></stop><stop offset="100%" stop-color="#B99542" data-astro-cid-ynf3rr4n></stop></linearGradient></defs></svg></span></div><nav class="sidebar-nav" data-astro-cid-ynf3rr4n><a href="/"${addAttribute(["nav-item", { active: navActive.dashboard }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><rect x="3" y="3" width="7" height="7" data-astro-cid-ynf3rr4n></rect><rect x="14" y="3" width="7" height="7" data-astro-cid-ynf3rr4n></rect><rect x="14" y="14" width="7" height="7" data-astro-cid-ynf3rr4n></rect><rect x="3" y="14" width="7" height="7" data-astro-cid-ynf3rr4n></rect></svg><span class="nav-label" data-sidebar-i18n="layout.nav.dashboard" data-astro-cid-ynf3rr4n>${t("layout.nav.dashboard")}</span></a><div data-post-types-menu data-astro-cid-ynf3rr4n></div><a href="/media"${addAttribute(["nav-item", { active: navActive.media }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><rect x="3" y="3" width="18" height="18" rx="2" ry="2" data-astro-cid-ynf3rr4n></rect><circle cx="8.5" cy="8.5" r="1.5" data-astro-cid-ynf3rr4n></circle><polyline points="21 15 16 10 5 21" data-astro-cid-ynf3rr4n></polyline></svg><span class="nav-label" data-sidebar-i18n="layout.nav.media" data-astro-cid-ynf3rr4n>${t("layout.nav.media")}</span></a><a href="/users"${addAttribute(["nav-item", { active: navActive.users }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" data-astro-cid-ynf3rr4n></path><circle cx="9" cy="7" r="4" data-astro-cid-ynf3rr4n></circle><path d="M23 21v-2a4 4 0 0 0-3-3.87" data-astro-cid-ynf3rr4n></path><path d="M16 3.13a4 4 0 0 1 0 7.75" data-astro-cid-ynf3rr4n></path></svg><span class="nav-label" data-sidebar-i18n="layout.nav.users" data-astro-cid-ynf3rr4n>${t("layout.nav.users")}</span></a><a href="/menus"${addAttribute(["nav-item", { active: navActive.menus }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" aria-hidden="true" data-astro-cid-ynf3rr4n><line x1="8" y1="6" x2="21" y2="6" data-astro-cid-ynf3rr4n></line><line x1="8" y1="12" x2="21" y2="12" data-astro-cid-ynf3rr4n></line><line x1="8" y1="18" x2="21" y2="18" data-astro-cid-ynf3rr4n></line><line x1="3" y1="6" x2="3.01" y2="6" data-astro-cid-ynf3rr4n></line><line x1="3" y1="12" x2="3.01" y2="12" data-astro-cid-ynf3rr4n></line><line x1="3" y1="18" x2="3.01" y2="18" data-astro-cid-ynf3rr4n></line></svg><span class="nav-label" data-sidebar-i18n="layout.nav.menus" data-astro-cid-ynf3rr4n>${t("layout.nav.menus")}</span></a><div${addAttribute(["nav-group", { open: navActive.settings }], "class:list")} data-nav-group="settings" data-astro-cid-ynf3rr4n><div class="nav-group-header" data-astro-cid-ynf3rr4n><a href="/settings/general"${addAttribute(["nav-item", { active: navActive.settings }], "class:list")} data-astro-cid-ynf3rr4n><svg class="settings-nav-icon" 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" data-astro-cid-ynf3rr4n><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 0-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" data-astro-cid-ynf3rr4n></path><circle cx="12" cy="12" r="3" data-astro-cid-ynf3rr4n></circle></svg><svg 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" data-astro-cid-ynf3rr4n><circle cx="12" cy="12" r="3" data-astro-cid-ynf3rr4n></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06-.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1.82-.33l-.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0-2.83l-.06-.06a1.65 1.65 0 0 0-.33-1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" data-astro-cid-ynf3rr4n></path></svg><span class="nav-label" data-sidebar-i18n="layout.nav.settings" data-astro-cid-ynf3rr4n>${t("layout.nav.settings")}</span></a></div><!-- Submenu de configurações fica agrupado diretamente sob Settings. --><div class="nav-submenu" data-astro-cid-ynf3rr4n>${settingsChildren.map((child) => renderTemplate`<a${addAttribute(child.href, "href")}${addAttribute(["nav-subitem", { active: child.active }], "class:list")}${addAttribute(child.key, "data-sidebar-i18n")} data-astro-cid-ynf3rr4n>${t(child.key)}</a>`)}</div></div><a href="/plugins"${addAttribute(["nav-item", { active: navActive.plugins }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><rect x="2" y="2" width="20" height="20" rx="2" ry="2" data-astro-cid-ynf3rr4n></rect><path d="M15 7h4a2 2 0 0 1 2 2v4" data-astro-cid-ynf3rr4n></path><path d="M9 17H5a2 2 0 0 1-2-2V9" data-astro-cid-ynf3rr4n></path><line x1="8" y1="12" x2="16" y2="12" data-astro-cid-ynf3rr4n></line></svg><span class="nav-label" data-sidebar-i18n="layout.nav.plugins" data-astro-cid-ynf3rr4n>${t("layout.nav.plugins")}</span></a><a href="/themes"${addAttribute(["nav-item", { active: navActive.themes }], "class:list")} data-astro-cid-ynf3rr4n><svg 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" data-astro-cid-ynf3rr4n><circle cx="12" cy="12" r="10" data-astro-cid-ynf3rr4n></circle><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" data-astro-cid-ynf3rr4n></path><path d="M2 12h20" data-astro-cid-ynf3rr4n></path></svg><span class="nav-label" data-sidebar-i18n="layout.nav.themes" data-astro-cid-ynf3rr4n>${t("layout.nav.themes")}</span></a><!-- D1: slots de extensao — paginas de menu declaradas por plugins ativos -->${renderComponent($$result, "PluginExtensionsSlot", PluginExtensionsSlot, {
1034
1059
  "client:load": true,
1035
1060
  "data-astro-cid-ynf3rr4n": true,
1036
1061
  "client:component-hydration": "load",
@@ -1063,4 +1088,4 @@ var $$DashboardLayout = createComponent$1(($$result, $$props, $$slots) => {
1063
1088
  })}</div></main></div>` })}${renderScript($$result, "/home/runner/work/cms/cms/apps/admin/src/layouts/DashboardLayout.astro?astro&type=script&index=0&lang.ts")}`;
1064
1089
  }, "/home/runner/work/cms/cms/apps/admin/src/layouts/DashboardLayout.astro", void 0);
1065
1090
  //#endregion
1066
- export { For2 as a, Select as c, createMemo$1 as d, createSignal$1 as f, Card as i, Show2 as l, Badge as n, Input as o, onMount$1 as p, Button as r, Pagination as s, $$DashboardLayout as t, Table as u };
1091
+ export { For2 as a, Pagination as c, Table as d, createMemo$1 as f, Card as i, Select as l, onMount$1 as m, Badge as n, Input as o, createSignal$1 as p, Button as r, Modal as s, $$DashboardLayout as t, Show2 as u };
@@ -0,0 +1,466 @@
1
+ import { n as useTranslation, r as apiClient } from "./i18n_BgHPm3Sm.mjs";
2
+ import { a as For2, c as Pagination, l as Select, m as onMount, o as Input, p as createSignal, r as Button, s as Modal, u as Show2 } from "./DashboardLayout_DnvPikNH.mjs";
3
+ import { createComponent, escape, memo, ssr, ssrAttribute, ssrHydrationKey, ssrStyleProperty } from "solid-js/web";
4
+ //#region src/components/media/MediaLibrary.tsx
5
+ var _tmpl$ = [
6
+ "<div",
7
+ " class=\"notice notice--error\">",
8
+ "</div>"
9
+ ];
10
+ var _tmpl$2 = [
11
+ "<div",
12
+ " class=\"notice\">",
13
+ "</div>"
14
+ ];
15
+ var _tmpl$3 = [
16
+ "<div",
17
+ " class=\"media-grid\">",
18
+ "</div>"
19
+ ];
20
+ var _tmpl$4 = [
21
+ "<div",
22
+ " class=\"media-library\"><!--$-->",
23
+ "<!--/--><!--$-->",
24
+ "<!--/--><div class=\"",
25
+ "\"><p><strong>",
26
+ "</strong> ou</p><label class=\"btn btn-primary\" style=\"",
27
+ "\"><!--$-->",
28
+ "<!--/--><input type=\"file\" multiple style=\"",
29
+ "\"",
30
+ "></label><p class=\"muted\">",
31
+ "</p></div><div class=\"toolbar\"><!--$-->",
32
+ "<!--/--><!--$-->",
33
+ "<!--/--><!--$-->",
34
+ "<!--/--></div><!--$-->",
35
+ "<!--/--><!--$-->",
36
+ "<!--/--><!--$-->",
37
+ "<!--/--></div>"
38
+ ];
39
+ var _tmpl$5 = [
40
+ "<p",
41
+ " class=\"muted\">",
42
+ "</p>"
43
+ ];
44
+ var _tmpl$6 = ["<img", " loading=\"lazy\">"];
45
+ var _tmpl$7 = [
46
+ "<button",
47
+ " type=\"button\" class=\"",
48
+ "\"><div class=\"media-card__preview\">",
49
+ "</div><div class=\"media-card__meta\"><span class=\"media-card__name\"",
50
+ ">",
51
+ "</span><span class=\"muted\"><!--$-->",
52
+ "<!--/--> · <!--$-->",
53
+ "<!--/--></span></div></button>"
54
+ ];
55
+ var _tmpl$8 = [
56
+ "<span",
57
+ " class=\"media-card__ext\">",
58
+ "</span>"
59
+ ];
60
+ var _tmpl$9 = ["<img", ">"];
61
+ var _tmpl$0 = [
62
+ "<video",
63
+ " controls",
64
+ "></video>"
65
+ ];
66
+ var _tmpl$1 = [
67
+ "<audio",
68
+ " controls",
69
+ "></audio>"
70
+ ];
71
+ var _tmpl$10 = ["<iframe", "></iframe>"];
72
+ var _tmpl$11 = [
73
+ "<div",
74
+ " class=\"media-card__ext media-modal__file-icon\">",
75
+ "</div>"
76
+ ];
77
+ var _tmpl$12 = [
78
+ "<dt",
79
+ ">",
80
+ "</dt>"
81
+ ];
82
+ var _tmpl$13 = [
83
+ "<dd",
84
+ ">",
85
+ "</dd>"
86
+ ];
87
+ var _tmpl$14 = [
88
+ "<div",
89
+ " class=\"media-modal\"><div class=\"media-modal__preview\"><!--$-->",
90
+ "<!--/--><!--$-->",
91
+ "<!--/--><!--$-->",
92
+ "<!--/--><!--$-->",
93
+ "<!--/--><!--$-->",
94
+ "<!--/--></div><div class=\"media-modal__layout\"><div class=\"media-modal__fields\"><!--$-->",
95
+ "<!--/--><!--$-->",
96
+ "<!--/--><!--$-->",
97
+ "<!--/--><label class=\"field__label\"><!--$-->",
98
+ "<!--/--><textarea class=\"input media-modal__textarea\" name=\"media-description\"",
99
+ "></textarea></label></div><dl class=\"media-details__list media-modal__facts\"><dt>",
100
+ "</dt><dd>",
101
+ "</dd><dt>",
102
+ "</dt><dd>",
103
+ "</dd><dt>",
104
+ "</dt><dd>",
105
+ "</dd><!--$-->",
106
+ "<!--/--><dt>",
107
+ "</dt><dd>",
108
+ "</dd><dt>",
109
+ "</dt><dd class=\"media-details__url\"><code>",
110
+ "</code><button class=\"btn btn-secondary btn-sm\" type=\"button\">",
111
+ "</button></dd></dl></div><div class=\"media-modal__replace\"><label class=\"btn btn-secondary\" style=\"",
112
+ "\"><!--$-->",
113
+ "<!--/--><input type=\"file\" style=\"",
114
+ "\"",
115
+ "></label><span class=\"muted\">",
116
+ "</span></div><div class=\"media-details__actions\"><!--$-->",
117
+ "<!--/--><!--$-->",
118
+ "<!--/--><!--$-->",
119
+ "<!--/--></div></div>"
120
+ ];
121
+ function formatSize(bytes) {
122
+ if (!Number.isFinite(bytes)) return "—";
123
+ if (bytes < 1024) return `${bytes} B`;
124
+ if (bytes < 1048576) return `${(bytes / 1024).toFixed(1)} KB`;
125
+ return `${(bytes / 1048576).toFixed(1)} MB`;
126
+ }
127
+ function isImage(media) {
128
+ return media.mime_type.startsWith("image/");
129
+ }
130
+ function isVideo(media) {
131
+ return media.mime_type.startsWith("video/");
132
+ }
133
+ function isAudio(media) {
134
+ return media.mime_type.startsWith("audio/");
135
+ }
136
+ function isPdf(media) {
137
+ return media.mime_type === "application/pdf";
138
+ }
139
+ function displayTitle(media) {
140
+ return media.title?.trim() || media.filename;
141
+ }
142
+ function dimensions(media) {
143
+ const metadata = media.metadata;
144
+ const width = Number(metadata?.["width"]);
145
+ const height = Number(metadata?.["height"]);
146
+ return width > 0 && height > 0 ? `${width} × ${height} px` : null;
147
+ }
148
+ function draftFrom(media) {
149
+ return {
150
+ title: media.title ?? media.filename,
151
+ alt: media.alt ?? "",
152
+ caption: media.caption ?? "",
153
+ description: media.description ?? ""
154
+ };
155
+ }
156
+ function MediaLibrary(props) {
157
+ const { t } = useTranslation();
158
+ const [items, setItems] = createSignal([]);
159
+ const [total, setTotal] = createSignal(0);
160
+ const [page, setPage] = createSignal(1);
161
+ const [search, setSearch] = createSignal("");
162
+ const [mimeType, setMimeType] = createSignal("");
163
+ const [error, setError] = createSignal("");
164
+ const [info, setInfo] = createSignal("");
165
+ const [uploading, setUploading] = createSignal(false);
166
+ const [selected, setSelected] = createSignal(null);
167
+ const [draft, setDraft] = createSignal({
168
+ title: "",
169
+ alt: "",
170
+ caption: "",
171
+ description: ""
172
+ });
173
+ const [dragOver, setDragOver] = createSignal(false);
174
+ const [savingDetails, setSavingDetails] = createSignal(false);
175
+ const [replacing, setReplacing] = createSignal(false);
176
+ const limit = 24;
177
+ const mediaUrl = (media) => apiClient.mediaUrl(media.url);
178
+ const load = async () => {
179
+ try {
180
+ const result = await apiClient.listMedia({
181
+ page: page(),
182
+ limit,
183
+ search: search() || void 0,
184
+ mimeType: mimeType() || void 0
185
+ });
186
+ setItems(result.data ?? []);
187
+ setTotal(result.total ?? 0);
188
+ } catch (err) {
189
+ setError(err instanceof Error ? err.message : String(err));
190
+ }
191
+ };
192
+ onMount(load);
193
+ const searchNow = async () => {
194
+ setPage(1);
195
+ await load();
196
+ };
197
+ const remove = async (media) => {
198
+ if (!confirm(t("media.details.confirmDelete", { filename: media.filename }))) return;
199
+ try {
200
+ await apiClient.deleteMedia(media.id);
201
+ if (selected()?.id === media.id) setSelected(null);
202
+ await load();
203
+ } catch (err) {
204
+ setError(err instanceof Error ? err.message : String(err));
205
+ }
206
+ };
207
+ const saveDetails = async () => {
208
+ const media = selected();
209
+ if (!media) return;
210
+ setSavingDetails(true);
211
+ setError("");
212
+ try {
213
+ const updated = await apiClient.updateMedia(media.id, draft());
214
+ const merged = {
215
+ ...media,
216
+ ...updated
217
+ };
218
+ setSelected(merged);
219
+ setDraft(draftFrom(merged));
220
+ setInfo(t("media.details.saved"));
221
+ await load();
222
+ } catch (err) {
223
+ setError(err instanceof Error ? err.message : String(err));
224
+ } finally {
225
+ setSavingDetails(false);
226
+ }
227
+ };
228
+ return ssr(_tmpl$4, ssrHydrationKey(), escape(createComponent(Show2, {
229
+ get when() {
230
+ return error();
231
+ },
232
+ get children() {
233
+ return ssr(_tmpl$, ssrHydrationKey(), escape(error()));
234
+ }
235
+ })), escape(createComponent(Show2, {
236
+ get when() {
237
+ return info();
238
+ },
239
+ get children() {
240
+ return ssr(_tmpl$2, ssrHydrationKey(), escape(info()));
241
+ }
242
+ })), `upload-zone ${dragOver() || props.focusUpload ? "upload-zone--active" : ""}`, escape(t("media.upload.dropzone")), ssrStyleProperty("cursor:", "pointer"), uploading() ? escape(t("media.upload.uploading")) : escape(t("media.upload.select")), ssrStyleProperty("display:", "none"), ssrAttribute("disabled", uploading(), true), escape(t("media.upload.hint")), escape(createComponent(Input, {
243
+ name: "media-search",
244
+ get placeholder() {
245
+ return t("media.toolbar.search");
246
+ },
247
+ get value() {
248
+ return search();
249
+ },
250
+ onInput: (value) => {
251
+ setSearch(value);
252
+ searchNow();
253
+ }
254
+ })), escape(createComponent(Select, {
255
+ name: "media-mime",
256
+ get placeholder() {
257
+ return t("media.toolbar.allTypes");
258
+ },
259
+ get value() {
260
+ return mimeType();
261
+ },
262
+ get options() {
263
+ return [
264
+ {
265
+ value: "image/png",
266
+ label: t("media.mimeTypes.png")
267
+ },
268
+ {
269
+ value: "image/jpeg",
270
+ label: t("media.mimeTypes.jpeg")
271
+ },
272
+ {
273
+ value: "image/gif",
274
+ label: t("media.mimeTypes.gif")
275
+ },
276
+ {
277
+ value: "image/webp",
278
+ label: t("media.mimeTypes.webp")
279
+ },
280
+ {
281
+ value: "image/svg+xml",
282
+ label: t("media.mimeTypes.svg")
283
+ },
284
+ {
285
+ value: "application/pdf",
286
+ label: t("media.mimeTypes.pdf")
287
+ },
288
+ {
289
+ value: "video/mp4",
290
+ label: t("media.mimeTypes.mp4")
291
+ },
292
+ {
293
+ value: "audio/mpeg",
294
+ label: t("media.mimeTypes.mp3")
295
+ }
296
+ ];
297
+ },
298
+ onChange: (value) => {
299
+ setMimeType(value);
300
+ searchNow();
301
+ }
302
+ })), escape(createComponent(Button, {
303
+ variant: "secondary",
304
+ onClick: () => void searchNow(),
305
+ get children() {
306
+ return t("media.toolbar.searchBtn");
307
+ }
308
+ })), escape(createComponent(Show2, {
309
+ get when() {
310
+ return items().length > 0;
311
+ },
312
+ get fallback() {
313
+ return ssr(_tmpl$5, ssrHydrationKey(), escape(t("media.empty")));
314
+ },
315
+ get children() {
316
+ return ssr(_tmpl$3, ssrHydrationKey(), escape(createComponent(For2, {
317
+ get each() {
318
+ return items();
319
+ },
320
+ children: (media) => ssr(_tmpl$7, ssrHydrationKey(), `media-card ${selected()?.id === media.id ? "media-card--selected" : ""}`, escape(createComponent(Show2, {
321
+ get when() {
322
+ return isImage(media);
323
+ },
324
+ get fallback() {
325
+ return ssr(_tmpl$8, ssrHydrationKey(), escape(media.mime_type.split("/")[1]?.toUpperCase() ?? "FILE"));
326
+ },
327
+ get children() {
328
+ return ssr(_tmpl$6, ssrHydrationKey() + ssrAttribute("src", escape(mediaUrl(media), true), false) + ssrAttribute("alt", escape(media.alt ?? displayTitle(media), true), false));
329
+ }
330
+ })), ssrAttribute("title", escape(displayTitle(media), true), false), escape(displayTitle(media)), escape(media.filename), escape(formatSize(media.size)))
331
+ })));
332
+ }
333
+ })), escape(createComponent(Pagination, {
334
+ get page() {
335
+ return page();
336
+ },
337
+ limit,
338
+ get total() {
339
+ return total();
340
+ },
341
+ onPageChange: (next) => {
342
+ setPage(next);
343
+ load();
344
+ }
345
+ })), escape(createComponent(Modal, {
346
+ get open() {
347
+ return Boolean(selected());
348
+ },
349
+ get title() {
350
+ return memo(() => !!selected())() ? displayTitle(selected()) : t("media.details.title");
351
+ },
352
+ onClose: () => setSelected(null),
353
+ get children() {
354
+ return createComponent(Show2, {
355
+ get when() {
356
+ return selected();
357
+ },
358
+ children: (media) => ssr(_tmpl$14, ssrHydrationKey(), escape(createComponent(Show2, {
359
+ get when() {
360
+ return isImage(media());
361
+ },
362
+ get children() {
363
+ return ssr(_tmpl$9, ssrHydrationKey() + ssrAttribute("src", escape(mediaUrl(media()), true), false) + ssrAttribute("alt", escape(draft().alt || displayTitle(media()), true), false));
364
+ }
365
+ })), escape(createComponent(Show2, {
366
+ get when() {
367
+ return isVideo(media());
368
+ },
369
+ get children() {
370
+ return ssr(_tmpl$0, ssrHydrationKey(), ssrAttribute("src", escape(mediaUrl(media()), true), false));
371
+ }
372
+ })), escape(createComponent(Show2, {
373
+ get when() {
374
+ return isAudio(media());
375
+ },
376
+ get children() {
377
+ return ssr(_tmpl$1, ssrHydrationKey(), ssrAttribute("src", escape(mediaUrl(media()), true), false));
378
+ }
379
+ })), escape(createComponent(Show2, {
380
+ get when() {
381
+ return isPdf(media());
382
+ },
383
+ get children() {
384
+ return ssr(_tmpl$10, ssrHydrationKey() + ssrAttribute("title", escape(displayTitle(media()), true), false) + ssrAttribute("src", escape(mediaUrl(media()), true), false));
385
+ }
386
+ })), escape(createComponent(Show2, {
387
+ get when() {
388
+ return memo(() => !!(!isImage(media()) && !isVideo(media()) && !isAudio(media())))() && !isPdf(media());
389
+ },
390
+ get children() {
391
+ return ssr(_tmpl$11, ssrHydrationKey(), escape(media().mime_type.split("/")[1]?.toUpperCase() ?? "FILE"));
392
+ }
393
+ })), escape(createComponent(Input, {
394
+ name: "media-title",
395
+ get label() {
396
+ return t("media.details.titleField");
397
+ },
398
+ get value() {
399
+ return draft().title;
400
+ },
401
+ onInput: (value) => setDraft({
402
+ ...draft(),
403
+ title: value
404
+ })
405
+ })), escape(createComponent(Input, {
406
+ name: "media-alt",
407
+ get label() {
408
+ return t("media.details.alt");
409
+ },
410
+ get value() {
411
+ return draft().alt;
412
+ },
413
+ onInput: (value) => setDraft({
414
+ ...draft(),
415
+ alt: value
416
+ })
417
+ })), escape(createComponent(Input, {
418
+ name: "media-caption",
419
+ get label() {
420
+ return t("media.details.caption");
421
+ },
422
+ get value() {
423
+ return draft().caption;
424
+ },
425
+ onInput: (value) => setDraft({
426
+ ...draft(),
427
+ caption: value
428
+ })
429
+ })), escape(t("media.details.description")), ssrAttribute("value", escape(draft().description, true), false), escape(t("media.details.file")), escape(media().filename), escape(t("media.details.type")), escape(media().mime_type), escape(t("media.details.size")), escape(formatSize(media().size)), escape(createComponent(Show2, {
430
+ get when() {
431
+ return dimensions(media());
432
+ },
433
+ get children() {
434
+ return [ssr(_tmpl$12, ssrHydrationKey(), escape(t("media.details.dimensions"))), ssr(_tmpl$13, ssrHydrationKey(), escape(dimensions(media())))];
435
+ }
436
+ })), escape(t("media.details.uploaded")), media().created_at ? escape(new Date(media().created_at).toLocaleString()) : "—", escape(t("media.details.url")), escape(mediaUrl(media())), escape(t("media.details.copy")), ssrStyleProperty("cursor:", "pointer"), replacing() ? escape(t("media.details.replacing")) : escape(t("media.details.replace")), ssrStyleProperty("display:", "none"), ssrAttribute("disabled", replacing(), true), escape(t("media.details.replaceHint")), escape(createComponent(Button, {
437
+ variant: "primary",
438
+ get disabled() {
439
+ return savingDetails();
440
+ },
441
+ get loading() {
442
+ return savingDetails();
443
+ },
444
+ onClick: () => void saveDetails(),
445
+ get children() {
446
+ return t("media.details.save");
447
+ }
448
+ })), escape(createComponent(Button, {
449
+ variant: "danger",
450
+ onClick: () => void remove(media()),
451
+ get children() {
452
+ return t("media.details.delete");
453
+ }
454
+ })), escape(createComponent(Button, {
455
+ variant: "secondary",
456
+ onClick: () => setSelected(null),
457
+ get children() {
458
+ return t("media.details.close");
459
+ }
460
+ })))
461
+ });
462
+ }
463
+ })));
464
+ }
465
+ //#endregion
466
+ export { MediaLibrary as t };
@@ -1,7 +1,7 @@
1
1
  import { r as __exportAll } from "./rolldown-runtime_BMI-E3GI.mjs";
2
2
  import { S as createAstro, d as maybeRenderHead, i as renderComponent, p as addAttribute, u as renderTemplate } from "./server_B5N27szj.mjs";
3
3
  import { t as createComponent } from "./compiler_O7J1rlsi.mjs";
4
- import { t as $$DashboardLayout } from "./DashboardLayout_09DepSVn.mjs";
4
+ import { t as $$DashboardLayout } from "./DashboardLayout_DnvPikNH.mjs";
5
5
  //#region src/pages/plugins/[slug].astro
6
6
  var _slug__exports = /* @__PURE__ */ __exportAll({
7
7
  default: () => $$Slug,