@oktis-works/admin 0.4.10 → 0.4.14
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.
- package/dist/client/_astro/{ActivityWidget.CSfbsvBc.js → ActivityWidget.C2ETg6u_.js} +2 -2
- package/dist/client/_astro/AdminBar.Dc_oT_my.js +234 -0
- package/dist/client/_astro/{AtGlanceWidget.olHTd5cS.js → AtGlanceWidget.BVCJB3QT.js} +3 -3
- package/dist/client/_astro/BaseLayout.B3A9-IS6.css +1 -0
- package/dist/client/_astro/ContentEditor.CoCaseap.js +1 -0
- package/dist/client/_astro/ContentList.Qp90yZEx.js +1 -0
- package/dist/client/_astro/CustomFieldsManager.B2JEuxBb.js +3 -0
- package/dist/client/_astro/DashboardHome.CgDrZavo.js +1 -0
- package/dist/client/_astro/DashboardLayout.CEvRGr78.css +1 -0
- package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.nXh9K0OY.js +1 -0
- package/dist/client/_astro/FieldTypePicker.BEuYPzV8.js +1 -0
- package/dist/client/_astro/{Footer.A_wTlAMd.js → Footer.BpxMjlJE.js} +3 -5
- package/dist/client/_astro/GeneralSettings.BVFwXCbR.js +1 -0
- package/dist/client/_astro/MediaLibrary.CGzXvUbD.js +1 -0
- package/dist/client/_astro/PluginManager.CQW7_Hl-.js +93 -0
- package/dist/client/_astro/PostTypesManager.CFX0sR5p.js +1 -0
- package/dist/client/_astro/{QuickDraftWidget.BUK9R8iq.js → QuickDraftWidget.DLaU-WiG.js} +2 -2
- package/dist/client/_astro/ResourceHubs.DasaSiMK.js +1 -0
- package/dist/client/_astro/TaxonomiesManager.CralM7Ne.js +1 -0
- package/dist/client/_astro/ThemeManager.C9mBa-po.js +129 -0
- package/dist/client/_astro/UserCreateForm.D6rRUn0J.js +1 -0
- package/dist/client/_astro/UsersManager.DdpgI0mN.js +1 -0
- package/dist/client/_astro/api.CDW61rqX.js +1 -0
- package/dist/client/_astro/ar.DsV0P0EN.js +1 -0
- package/dist/client/_astro/{client.C7p516_9.js → client.BY0Z100j.js} +1 -1
- package/dist/client/_astro/custom-fields.IjuRIdAC.css +1 -0
- package/dist/client/_astro/es-ES.etPSaiLd.js +1 -0
- package/dist/client/_astro/extensions.roNfOg-_.js +1 -0
- package/dist/client/_astro/he.U1Vtp3zT.js +1 -0
- package/dist/client/_astro/i18n.D0KNEGgP.js +1 -0
- package/dist/client/_astro/it.DJuI8oO_.js +1 -0
- package/dist/client/_astro/ja.Cw8I_NUV.js +1 -0
- package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.CLM9X6sQ.js → login.astro_astro_type_script_index_0_lang.CdYoT76J.js} +1 -1
- package/dist/client/_astro/pl.Dsz-4G_z.js +1 -0
- package/dist/client/_astro/pt-BR.CyQAHnXs.js +1 -0
- package/dist/client/_astro/ru.CwIIcTdy.js +1 -0
- package/dist/client/_astro/src.DyLYQxi2.js +1 -0
- package/dist/client/_astro/sw.DwpL3sb6.js +1 -0
- package/dist/client/_astro/tr.CY2JWJ7Y.js +1 -0
- package/dist/client/_astro/uk.BudEWIU8.js +1 -0
- package/dist/client/_astro/{version.DdQxNnVi.js → version.CoiXQYz6.js} +1 -1
- package/dist/client/_astro/{web.D1H9RxZL.js → web.D_vCtCLj.js} +1 -1
- package/dist/client/_astro/yo.BmoZs0fO.js +1 -0
- package/dist/client/_astro/zh-CN.khaXV6fv.js +1 -0
- package/dist/server/chunks/{BaseLayout_GUKuUGNt.mjs → BaseLayout_4yJ0PQCS.mjs} +2 -19
- package/dist/server/chunks/{ContentEditor_D9pMXYZY.mjs → ContentEditor_Dtmf4Zk6.mjs} +31 -101
- package/dist/server/chunks/{DashboardLayout_D5cpVFW2.mjs → DashboardLayout_DnE23ArY.mjs} +54 -564
- package/dist/server/chunks/FieldTypePicker_CXwpmcQ3.mjs +79 -0
- package/dist/server/chunks/{MediaLibrary_BRwD3_Ik.mjs → MediaLibrary_CKvvgCI6.mjs} +2 -2
- package/dist/server/chunks/ResourceHubs_Aoy5L4qj.mjs +453 -0
- package/dist/server/chunks/{_slug__B0_Nwmjh.mjs → _slug__DtzYz9Uz.mjs} +1 -1
- package/dist/server/chunks/access_BNFcmbp2.mjs +34 -0
- package/dist/server/chunks/{ar_DBjdWIJ0.mjs → ar_DMC8HaoP.mjs} +3 -1
- package/dist/server/chunks/custom-fields_90Jyw521.mjs +488 -0
- package/dist/server/chunks/{edit_Cf30wdZ0.mjs → edit_BmWxJDZa.mjs} +2 -2
- package/dist/server/chunks/{es-ES_TJ4oK1yi.mjs → es-ES_DZvHskAD.mjs} +3 -1
- package/dist/server/chunks/{general_CQ4Jb4sC.mjs → general_AGjbJVe-.mjs} +6 -6
- package/dist/server/chunks/{he_TWsuTphz.mjs → he_zy3stNhR.mjs} +3 -1
- package/dist/server/chunks/i18n_Csb4GGX2.mjs +1326 -0
- package/dist/server/chunks/{index_DvroAJAZ.mjs → index_BKm7s1bn.mjs} +2 -2
- package/dist/server/chunks/{index_BoNMua8M.mjs → index_C7yZO-zD.mjs} +2 -2
- package/dist/server/chunks/{index_B541nJoz.mjs → index_CUsSNKEq.mjs} +8 -6
- package/dist/server/chunks/{index_C7yO7uAx.mjs → index_D5IP16pU.mjs} +3 -3
- package/dist/server/chunks/{index_BiJh6n-r.mjs → index_b00ttelz.mjs} +1 -1
- package/dist/server/chunks/{it_CEVFVWh1.mjs → it_BiUDLszZ.mjs} +3 -1
- package/dist/server/chunks/{ja_CqDirMqf.mjs → ja_DjFAG7hL.mjs} +3 -1
- package/dist/server/chunks/{login_B7FSWUaM.mjs → login_lEEcbYs3.mjs} +2 -1
- package/dist/server/chunks/{new_CP8lvbKz.mjs → new_BDjFzd-l.mjs} +2 -2
- package/dist/server/chunks/{new_Circ7nxk.mjs → new_BjtzqhsE.mjs} +2 -2
- package/dist/server/chunks/operations_D7TMl0mB.mjs +34 -0
- package/dist/server/chunks/{pl_ChIKxfZG.mjs → pl_0Xe9Qom2.mjs} +3 -1
- package/dist/server/chunks/plugins_KhRV7kiu.mjs +152 -0
- package/dist/server/chunks/{post-types__UNdVC6h.mjs → post-types_DfXwkNIg.mjs} +6 -6
- package/dist/server/chunks/{pt-BR_4d4jZWL0.mjs → pt-BR_DIZpU2Mk.mjs} +206 -2
- package/dist/server/chunks/resources_BbhlUSXs.mjs +34 -0
- package/dist/server/chunks/{ru_CIc6O5Q7.mjs → ru_DFvIxd0Y.mjs} +3 -1
- package/dist/server/chunks/script_CPGt5jAh.mjs +19 -0
- package/dist/server/chunks/{sw_Bs3iYVDM.mjs → sw_CmaPgGYa.mjs} +3 -1
- package/dist/server/chunks/{taxonomies_CVMK3JxL.mjs → taxonomies_CF7qpKG3.mjs} +2 -2
- package/dist/server/chunks/themes_RAw8tJmy.mjs +151 -0
- package/dist/server/chunks/{tr_C7JbXuoQ.mjs → tr_B_acwl2e.mjs} +3 -1
- package/dist/server/chunks/{uk_Dibs8Wkc.mjs → uk_DXnk4imL.mjs} +3 -1
- package/dist/server/chunks/{upload_BN1-_I0F.mjs → upload_BBZ9ttmU.mjs} +2 -2
- package/dist/server/chunks/{yo_B6MPvz_U.mjs → yo_DDQ8a-0v.mjs} +3 -1
- package/dist/server/chunks/{zh-CN_G1Dc2b28.mjs → zh-CN_763uzTMQ.mjs} +3 -1
- package/dist/server/entry.mjs +200 -22
- package/dist/server/virtual_astro_middleware.mjs +6 -3
- package/package.json +1 -1
- package/dist/client/_astro/AdminBar.DzMuNBYF.js +0 -234
- package/dist/client/_astro/BaseLayout.B2MfKf6B.css +0 -1
- package/dist/client/_astro/ContentEditor.uJ5F6gSs.js +0 -1
- package/dist/client/_astro/ContentList.CVy_dKZZ.js +0 -1
- package/dist/client/_astro/DashboardHome.DZVGJl33.js +0 -1
- package/dist/client/_astro/DashboardLayout.DrKf2Klk.css +0 -1
- package/dist/client/_astro/DashboardLayout.astro_astro_type_script_index_0_lang.BrC4PbPa.js +0 -1
- package/dist/client/_astro/GeneralSettings.BS1F1fbv.js +0 -1
- package/dist/client/_astro/HelpTabs.CHwVYwbx.js +0 -103
- package/dist/client/_astro/LanguageSelector.C-0zi24B.js +0 -14
- package/dist/client/_astro/MediaLibrary.BG_XuGSC.js +0 -1
- package/dist/client/_astro/PostTypesManager.kgLZEJjr.js +0 -1
- package/dist/client/_astro/ScreenOptions.CtkDOZLA.js +0 -70
- package/dist/client/_astro/TaxonomiesManager.BBL0hyRa.js +0 -1
- package/dist/client/_astro/UserCreateForm.PVLoPXwZ.js +0 -1
- package/dist/client/_astro/UsersManager.CG61mqGd.js +0 -1
- package/dist/client/_astro/api.DTNuyqvx.js +0 -1
- package/dist/client/_astro/ar.CzsjUutD.js +0 -1
- package/dist/client/_astro/en.DmN7xy_a.js +0 -1
- package/dist/client/_astro/es-ES.p2TLEMlZ.js +0 -1
- package/dist/client/_astro/extensions.DfxrGzbo.js +0 -1
- package/dist/client/_astro/he.BnYHiYpn.js +0 -1
- package/dist/client/_astro/i18n.DJXYgZ8Z.js +0 -1
- package/dist/client/_astro/it.WrWKBEAD.js +0 -1
- package/dist/client/_astro/ja.DxnfhIdt.js +0 -1
- package/dist/client/_astro/pl.jUj-RfZS.js +0 -1
- package/dist/client/_astro/pt-BR.DtNwEO0i.js +0 -1
- package/dist/client/_astro/ru.KFSfdjWn.js +0 -1
- package/dist/client/_astro/src.Cgonpfb5.js +0 -1
- package/dist/client/_astro/sw.3jlAOLOv.js +0 -1
- package/dist/client/_astro/tr.tnLMnGPg.js +0 -1
- package/dist/client/_astro/uk.VquHY_xc.js +0 -1
- package/dist/client/_astro/yo.Cr8hCb5u.js +0 -1
- package/dist/client/_astro/zh-CN.E32QqP4v.js +0 -1
- package/dist/server/chunks/en_C750mYKk.mjs +0 -408
- package/dist/server/chunks/i18n_DnHqy5K-.mjs +0 -527
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m,u as h}from"./web.D_vCtCLj.js";import{t as g}from"./api.CDW61rqX.js";import{a as _,i as v,n as y,o as b}from"./src.DyLYQxi2.js";var x=f(`<div class="notice notice--error">`),S=f(`<div class=notice>`),C=f(`<div class=media-grid>`),w=f(`<div class=media-library><!$><!/><!$><!/><div class=upload-zone><p><strong></strong> ou</p><label class="btn btn-primary"style=cursor:pointer><!$><!/><input type=file multiple style=display:none></label><p class=muted></p></div><div class=toolbar><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/><!$><!/>`),ee=f(`<p class=muted>`),te=f(`<img loading=lazy>`,!0,!1,!1),T=f(`<button type=button class=media-card><div class=media-card__preview></div><div class=media-card__meta><span class=media-card__name></span><span class=muted>`),E=f(`<span class=media-card__ext>`),ne=f(`<img>`),re=f(`<div class="card media-details"><h3></h3><div class=media-details__preview></div><dl class=media-details__list><dt></dt><dd></dd><dt></dt><dd></dd><dt></dt><dd></dd><dt></dt><dd class=media-details__url><code></code><button class="btn btn-secondary btn-sm"type=button></button></dd></dl><!$><!/><!$><!/><div class=media-details__actions><!$><!/><!$><!/><!$><!/>`);function D(e){return Number.isFinite(e)?e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`:`—`}var O=e=>e.mime_type.startsWith(`image/`);function k(u){let{t:f}=e(),[k,A]=t([]),[ie,j]=t(0),[M,N]=t(1),[P,F]=t(``),[I,L]=t(``),[R,z]=t(``),[B,V]=t(``),[H,U]=t(!1),[W,G]=t(null),[ae,K]=t(!1),[q,J]=t(!1),Y=async()=>{try{let e=await g.listMedia({page:M(),limit:24,search:P()||void 0,mimeType:I()||void 0});A(e.data??[]),j(e.total??0)}catch(e){z(e instanceof Error?e.message:String(e))}};r(Y);let X=async()=>{N(1),await Y()},Z=async e=>{if(e.length===0)return;U(!0),z(``),V(``);let t=0;for(let n of Array.from(e))try{await g.uploadMedia(n,{alt:``}),t+=1}catch(e){z(`${n.name}: ${e instanceof Error?e.message:String(e)}`)}U(!1),t>0&&(V(f(`media.toasts.uploaded`,{count:t})),N(1),await Y())},oe=async e=>{if(confirm(f(`media.details.confirmDelete`,{filename:e.filename})))try{await g.deleteMedia(e.id),W()?.id===e.id&&G(null),await Y()}catch(e){z(e instanceof Error?e.message:String(e))}},se=async()=>{let e=W();if(e){J(!0),z(``);try{let t=await g.updateMedia(e.id,{alt:e.alt??``,caption:e.caption??``});G({...e,...t}),V(f(`media.details.saved`)),await Y()}catch(e){z(e instanceof Error?e.message:String(e))}finally{J(!1)}}},ce=async e=>{try{await navigator.clipboard.writeText(e),V(f(`media.details.copied`))}catch{z(f(`media.details.copyError`))}};return(()=>{var e=p(w),t=e.firstChild,[r,g]=c(t.nextSibling),A=r.nextSibling,[j,z]=c(A.nextSibling),V=j.nextSibling,U=V.firstChild,J=U.firstChild,Q=U.nextSibling,le=Q.firstChild,[ue,de]=c(le.nextSibling),fe=ue.nextSibling,pe=Q.nextSibling,$=V.nextSibling,me=$.firstChild,[he,ge]=c(me.nextSibling),_e=he.nextSibling,[ve,ye]=c(_e.nextSibling),be=ve.nextSibling,[xe,Se]=c(be.nextSibling),Ce=$.nextSibling,[we,Te]=c(Ce.nextSibling),Ee=we.nextSibling,[De,Oe]=c(Ee.nextSibling),ke=De.nextSibling,[Ae,je]=c(ke.nextSibling);return d(e,a(i,{get when(){return R()},get children(){var e=p(x);return d(e,R),e}}),r,g),d(e,a(i,{get when(){return B()},get children(){var e=p(S);return d(e,B),e}}),j,z),V.addEventListener(`drop`,e=>{e.preventDefault(),K(!1),e.dataTransfer&&Z(e.dataTransfer.files)}),V.addEventListener(`dragleave`,()=>K(!1)),V.addEventListener(`dragover`,e=>{e.preventDefault(),K(!0)}),d(J,()=>f(`media.upload.dropzone`)),d(Q,(()=>{var e=m(()=>!!H());return()=>e()?f(`media.upload.uploading`):f(`media.upload.select`)})(),ue,de),fe.addEventListener(`change`,e=>{e.currentTarget.files&&Z(e.currentTarget.files),e.currentTarget.value=``}),d(pe,()=>f(`media.upload.hint`)),d($,a(v,{name:`media-search`,get placeholder(){return f(`media.toolbar.search`)},get value(){return P()},onInput:e=>{F(e),X()}}),he,ge),d($,a(b,{name:`media-mime`,get placeholder(){return f(`media.toolbar.allTypes`)},get value(){return I()},get options(){return[{value:`image/png`,label:f(`media.mimeTypes.png`)},{value:`image/jpeg`,label:f(`media.mimeTypes.jpeg`)},{value:`image/gif`,label:f(`media.mimeTypes.gif`)},{value:`image/webp`,label:f(`media.mimeTypes.webp`)},{value:`image/svg+xml`,label:f(`media.mimeTypes.svg`)},{value:`application/pdf`,label:f(`media.mimeTypes.pdf`)},{value:`video/mp4`,label:f(`media.mimeTypes.mp4`)},{value:`audio/mpeg`,label:f(`media.mimeTypes.mp3`)}]},onChange:e=>{L(e),X()}}),ve,ye),d($,a(y,{variant:`secondary`,onClick:()=>void X(),get children(){return f(`media.toolbar.searchBtn`)}}),xe,Se),d(e,a(i,{get when(){return k().length>0},get fallback(){return(()=>{var e=p(ee);return d(e,()=>f(`media.empty`)),e})()},get children(){var e=p(C);return d(e,a(s,{get each(){return k()},children:e=>(()=>{var t=p(T),r=t.firstChild,o=r.nextSibling.firstChild,s=o.nextSibling;return t.$$click=()=>G(e),d(r,a(i,{get when(){return O(e)},get fallback(){return(()=>{var t=p(E);return d(t,()=>e.mime_type.split(`/`)[1]?.toUpperCase()??`FILE`),t})()},get children(){var t=p(te);return n(n=>{var r=e.url,i=e.alt??e.filename;return r!==n.e&&h(t,`src`,n.e=r),i!==n.t&&h(t,`alt`,n.t=i),n},{e:void 0,t:void 0}),t}})),d(o,()=>e.filename),d(s,()=>D(e.size)),n(n=>{var r=W()?.id===e.id,i=e.filename;return r!==n.e&&t.classList.toggle(`media-card--selected`,n.e=r),i!==n.t&&h(o,`title`,n.t=i),n},{e:void 0,t:void 0}),l(),t})()})),e}}),we,Te),d(e,a(_,{get page(){return M()},limit:24,get total(){return ie()},onPageChange:e=>{N(e),Y()}}),De,Oe),d(e,a(i,{get when(){return W()},children:e=>(()=>{var t=p(re),r=t.firstChild,o=r.nextSibling,s=o.nextSibling,u=s.firstChild,m=u.nextSibling,g=m.nextSibling,_=g.nextSibling,b=_.nextSibling,x=b.nextSibling,S=x.nextSibling,C=S.nextSibling.firstChild,w=C.nextSibling,te=s.nextSibling,[T,E]=c(te.nextSibling),k=T.nextSibling,[A,ie]=c(k.nextSibling),j=A.nextSibling,M=j.firstChild,[N,P]=c(M.nextSibling),F=N.nextSibling,[I,L]=c(F.nextSibling),R=I.nextSibling,[z,B]=c(R.nextSibling);return d(r,()=>f(`media.details.title`)),d(o,a(i,{get when(){return O(e())},get fallback(){return(()=>{var t=p(ee);return d(t,()=>e().mime_type),t})()},get children(){var t=p(ne);return n(n=>{var r=e().url,i=e().alt??``;return r!==n.e&&h(t,`src`,n.e=r),i!==n.t&&h(t,`alt`,n.t=i),n},{e:void 0,t:void 0}),t}})),d(u,()=>f(`media.details.file`)),d(m,()=>e().filename),d(g,()=>f(`media.details.type`)),d(_,()=>e().mime_type),d(b,()=>f(`media.details.size`)),d(x,()=>D(e().size)),d(S,()=>f(`media.details.url`)),d(C,()=>e().url),w.$$click=()=>void ce(e().url),d(w,()=>f(`media.details.copy`)),d(t,a(v,{name:`media-alt`,get label(){return f(`media.details.alt`)},get value(){return e().alt??``},onInput:t=>G({...e(),alt:t})}),T,E),d(t,a(v,{name:`media-caption`,get label(){return f(`media.details.caption`)},get value(){return e().caption??``},onInput:t=>G({...e(),caption:t})}),A,ie),d(j,a(y,{variant:`primary`,get disabled(){return q()},get loading(){return q()},onClick:()=>void se(),get children(){return f(`media.details.save`)}}),N,P),d(j,a(y,{variant:`danger`,onClick:()=>void oe(e()),get children(){return f(`media.details.delete`)}}),I,L),d(j,a(y,{variant:`secondary`,onClick:()=>G(null),get children(){return f(`media.details.close`)}}),z,B),l(),t})()}),Ae,je),n(e=>{var t=!!(ae()||u.focusUpload),n=H();return t!==e.e&&V.classList.toggle(`upload-zone--active`,e.e=t),n!==e.t&&o(fe,`disabled`,e.t=n),e},{e:void 0,t:void 0}),e})()}u([`click`]);export{k as MediaLibrary};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./web.D_vCtCLj.js";import{t as _}from"./api.CDW61rqX.js";var v=f(`<form class="card plugin-install-form"><input class=input required><input class=input required><textarea class=input required rows=5></textarea><button class="btn btn-primary"type=submit>`),y=f(`<div class=plugin-manager><div class=page-header><h2></h2><p class=page-description></p><button class="btn btn-primary"type=button></button></div><!$><!/><!$><!/><!$><!/><!$><!/><style>
|
|
2
|
+
.page-header {
|
|
3
|
+
margin-bottom: 1.5rem;
|
|
4
|
+
}
|
|
5
|
+
.page-header h2 {
|
|
6
|
+
margin: 0 0 0.5rem;
|
|
7
|
+
font-size: 1.5rem;
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
}
|
|
10
|
+
.page-description {
|
|
11
|
+
margin: 0;
|
|
12
|
+
color: var(--color-muted);
|
|
13
|
+
font-size: 0.875rem;
|
|
14
|
+
}
|
|
15
|
+
.plugins-table-container {
|
|
16
|
+
overflow-x: auto;
|
|
17
|
+
}
|
|
18
|
+
.table {
|
|
19
|
+
width: 100%;
|
|
20
|
+
border-collapse: collapse;
|
|
21
|
+
}
|
|
22
|
+
.table th,
|
|
23
|
+
.table td {
|
|
24
|
+
padding: 0.75rem 1rem;
|
|
25
|
+
text-align: left;
|
|
26
|
+
border-bottom: 1px solid var(--color-border);
|
|
27
|
+
}
|
|
28
|
+
.table th {
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
color: var(--color-text);
|
|
31
|
+
background: var(--color-surface);
|
|
32
|
+
}
|
|
33
|
+
.plugin-row:hover {
|
|
34
|
+
background: var(--color-background);
|
|
35
|
+
}
|
|
36
|
+
.plugin-name {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: 0.25rem;
|
|
40
|
+
}
|
|
41
|
+
.plugin-name strong {
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
}
|
|
44
|
+
.plugin-description {
|
|
45
|
+
font-size: 0.75rem;
|
|
46
|
+
color: var(--color-muted);
|
|
47
|
+
}
|
|
48
|
+
.status-badge {
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
padding: 0.25rem 0.5rem;
|
|
52
|
+
border-radius: var(--radius-full);
|
|
53
|
+
font-size: 0.6875rem;
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
text-transform: uppercase;
|
|
56
|
+
}
|
|
57
|
+
.status-active {
|
|
58
|
+
background: var(--color-success-soft);
|
|
59
|
+
color: var(--color-success);
|
|
60
|
+
}
|
|
61
|
+
.status-installed {
|
|
62
|
+
background: var(--color-primary-soft);
|
|
63
|
+
color: var(--color-primary);
|
|
64
|
+
}
|
|
65
|
+
.status-inactive {
|
|
66
|
+
background: var(--color-muted-soft);
|
|
67
|
+
color: var(--color-muted);
|
|
68
|
+
}
|
|
69
|
+
.btn-loading {
|
|
70
|
+
opacity: 0.6;
|
|
71
|
+
cursor: wait;
|
|
72
|
+
}
|
|
73
|
+
.empty-state {
|
|
74
|
+
padding: 2rem;
|
|
75
|
+
text-align: center;
|
|
76
|
+
color: var(--color-muted);
|
|
77
|
+
}
|
|
78
|
+
.alert {
|
|
79
|
+
padding: 0.75rem 1rem;
|
|
80
|
+
border-radius: var(--radius-md);
|
|
81
|
+
margin-bottom: 1rem;
|
|
82
|
+
}
|
|
83
|
+
.alert-error {
|
|
84
|
+
background: var(--color-error-soft);
|
|
85
|
+
color: var(--color-error);
|
|
86
|
+
border: 1px solid var(--color-error);
|
|
87
|
+
}
|
|
88
|
+
.skeleton {
|
|
89
|
+
padding: 2rem;
|
|
90
|
+
text-align: center;
|
|
91
|
+
color: var(--color-muted);
|
|
92
|
+
}
|
|
93
|
+
`),b=f(`<div class="alert alert-error">`),x=f(`<div class=skeleton>Loading...`),S=f(`<div class=plugins-table-container><table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody></tbody></table><!$><!/>`),C=f(`<tr class=plugin-row><td class=plugin-name><strong></strong><!$><!/></td><td></td><td><span></span></td><td><button></button><button class="btn btn-sm btn-danger"type=button>`),w=f(`<span class=plugin-description>`),T=f(`<div class=empty-state>`);function E(){let{t:u}=e(),[f,E]=t([]),[D,O]=t(!0),[k,A]=t(null),[j,M]=t(null),[N,P]=t({name:``,version:``,manifest:`{}`}),[F,I]=t(!1);r(async()=>{await L()});async function L(){try{O(!0);let e=await _.getPlugins();E(e)}catch{A(u(`plugins.loadError`))}finally{O(!1)}}let R=e=>e.status===`ACTIVE`||e.status===`ACTIVATED`;async function z(e){let t=R(e);M(e.id);try{let n=t?await _.deactivatePlugin(e.id):await _.activatePlugin(e.id);E(f().map(t=>t.id===e.id?n:t))}catch{A(u(t?`plugins.deactivateError`:`plugins.activateError`))}finally{M(null)}}async function B(e){e.preventDefault();try{let e=N();await _.installPlugin({name:e.name,version:e.version,manifest:JSON.parse(e.manifest)}),P({name:``,version:``,manifest:`{}`}),I(!1),await L()}catch(e){A(e instanceof Error?e.message:u(`plugins.installError`))}}async function V(e){if(confirm(u(`plugins.confirmUninstall`,{name:e.name})))try{await _.uninstallPlugin(e.id),await L()}catch(e){A(e instanceof Error?e.message:u(`plugins.uninstallError`))}}let H=e=>{switch(e){case`ACTIVE`:case`ACTIVATED`:return u(`plugins.status.active`);case`INSTALLED`:return u(`plugins.status.installed`);case`INACTIVE`:case`DEACTIVATED`:return u(`plugins.status.inactive`);default:return e}},U=e=>{switch(e){case`ACTIVE`:case`ACTIVATED`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:case`DEACTIVATED`:return`status-inactive`;default:return``}};return(()=>{var e=p(y),t=e.firstChild,r=t.firstChild,_=r.nextSibling,E=_.nextSibling,O=t.nextSibling,[A,M]=c(O.nextSibling),L=A.nextSibling,[W,G]=c(L.nextSibling),K=W.nextSibling,[q,J]=c(K.nextSibling),Y=q.nextSibling,[X,Z]=c(Y.nextSibling);return X.nextSibling,d(r,()=>u(`plugins.title`)),d(_,()=>u(`plugins.description`)),E.$$click=()=>I(!F()),d(E,()=>u(`plugins.install`)),d(e,a(i,{get when(){return F()},get children(){var e=p(v),t=e.firstChild,r=t.nextSibling,i=r.nextSibling,a=i.nextSibling;return e.addEventListener(`submit`,B),t.$$input=e=>P({...N(),name:e.currentTarget.value}),r.$$input=e=>P({...N(),version:e.currentTarget.value}),i.$$input=e=>P({...N(),manifest:e.currentTarget.value}),d(a,()=>u(`common.save`)),n(e=>{var n=u(`plugins.name`),a=u(`plugins.version`),o=u(`plugins.manifest`);return n!==e.e&&g(t,`placeholder`,e.e=n),a!==e.t&&g(r,`placeholder`,e.t=a),o!==e.a&&g(i,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n(()=>o(t,`value`,N().name)),n(()=>o(r,`value`,N().version)),n(()=>o(i,`value`,N().manifest)),l(),e}}),A,M),d(e,(()=>{var e=m(()=>!!k());return()=>e()&&(()=>{var e=p(b);return d(e,k),e})()})(),W,G),d(e,(()=>{var e=m(()=>!!D());return()=>e()&&p(x)})(),q,J),d(e,(()=>{var e=m(()=>!(D()||k()));return()=>e()&&(()=>{var e=p(S),t=e.firstChild,r=t.firstChild,i=r.firstChild.firstChild,_=i.nextSibling,v=_.nextSibling,y=v.nextSibling,b=r.nextSibling,x=t.nextSibling,[E,D]=c(x.nextSibling);return d(i,()=>u(`plugins.columns.name`)),d(_,()=>u(`plugins.columns.version`)),d(v,()=>u(`plugins.columns.status`)),d(y,()=>u(`plugins.columns.actions`)),d(b,a(s,{get each(){return f()},children:e=>(()=>{var t=p(C),r=t.firstChild,i=r.firstChild,a=i.nextSibling,[s,f]=c(a.nextSibling),_=r.nextSibling,v=_.nextSibling,y=v.firstChild,b=v.nextSibling.firstChild,x=b.nextSibling;return d(i,()=>e.name),d(r,(()=>{var t=m(()=>!!e.manifest?.description);return()=>t()&&(()=>{var t=p(w);return d(t,()=>e.manifest.description),t})()})(),s,f),d(_,()=>e.version),d(y,()=>H(e.status)),b.$$click=()=>z(e),d(b,(()=>{var t=m(()=>!!R(e));return()=>t()?u(`plugins.deactivate`):u(`plugins.activate`)})()),x.$$click=()=>void V(e),d(x,()=>u(`plugins.uninstall`)),n(t=>{var n=`status-badge ${U(e.status)}`,r=`btn btn-sm ${j()===e.id?`btn-loading`:``}`,i=j()!==null,a=R(e)?u(`plugins.deactivate`):u(`plugins.activate`);return n!==t.e&&h(y,t.e=n),r!==t.t&&h(b,t.t=r),i!==t.a&&o(b,`disabled`,t.a=i),a!==t.o&&g(b,`aria-label`,t.o=a),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l(),t})()})),d(e,(()=>{var e=m(()=>f().length===0);return()=>e()&&(()=>{var e=p(T);return d(e,()=>u(`plugins.empty`)),e})()})(),E,D),e})()})(),X,Z),l(),e})()}u([`click`,`input`]);export{E as PluginManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m,u as h,x as g}from"./web.D_vCtCLj.js";import{t as _}from"./api.CDW61rqX.js";var ee=f(`<div class="notice notice--error">`),te=f(`<div class=post-types-manager><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required pattern=[a-z0-9_]+></label><label><!$><!/><input class=input required></label><label><!$><!/><input class=input required></label></div><fieldset class=supports><legend></legend><!$><!/><label><input type=checkbox> <!$><!/></label></fieldset><button type=submit class="btn btn-primary"></button></form><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),v=f(`<label><input type=checkbox> <!$><!/>`),y=f(`<button type=button class="btn btn-danger">`),b=f(`<tr><td></td><td></td><td></td><td></td><td></td><td></td><td>`);function x(){let{t:u}=e(),[f,x]=t([]),[S,C]=t(``),[w,T]=t(!1),E=g(()=>[{value:`title`,label:u(`settings.postTypes.form.supportsOptions.title`)},{value:`editor`,label:u(`settings.postTypes.form.supportsOptions.editor`)},{value:`thumbnail`,label:u(`settings.postTypes.form.supportsOptions.thumbnail`)},{value:`excerpt`,label:u(`settings.postTypes.form.supportsOptions.excerpt`)},{value:`revisions`,label:u(`settings.postTypes.form.supportsOptions.revisions`)}]),[D,O]=t({name:``,slug:``,singularLabel:``,pluralLabel:``,hasArchive:!1,supports:[`title`,`editor`]}),k=async()=>{try{x(await _.getContentTypes())}catch(e){C(e instanceof Error?e.message:String(e))}};r(k);let ne=async e=>{e.preventDefault(),C(``),T(!0);try{await _.createContentType({name:D().slug,slug:D().slug,singularLabel:D().singularLabel,pluralLabel:D().pluralLabel,hasArchive:D().hasArchive,supports:D().supports}),O({name:``,slug:``,singularLabel:``,pluralLabel:``,hasArchive:!1,supports:[`title`,`editor`]}),await k()}catch(e){C(e instanceof Error?e.message:String(e))}finally{T(!1)}},re=async e=>{try{await _.deleteContentType(e),await k()}catch(e){C(e instanceof Error?e.message:String(e))}};return(()=>{var e=p(te),t=e.firstChild,[r,g]=c(t.nextSibling),_=r.nextSibling,x=_.firstChild,C=x.nextSibling,T=C.firstChild,k=T.firstChild,[A,j]=c(k.nextSibling),M=A.nextSibling,N=T.nextSibling,ie=N.firstChild,[P,ae]=c(ie.nextSibling),F=P.nextSibling,I=N.nextSibling,oe=I.firstChild,[L,R]=c(oe.nextSibling),z=L.nextSibling,B=C.nextSibling,V=B.firstChild,H=V.nextSibling,[U,W]=c(H.nextSibling),G=U.nextSibling,K=G.firstChild,se=K.nextSibling.nextSibling,[ce,le]=c(se.nextSibling),q=B.nextSibling,J=_.nextSibling.firstChild,Y=J.firstChild.firstChild,X=Y.nextSibling,Z=X.nextSibling,Q=Z.nextSibling,$=Q.nextSibling,ue=$.nextSibling,de=J.nextSibling;return d(e,a(i,{get when(){return S()},get children(){var e=p(ee);return d(e,S),e}}),r,g),_.addEventListener(`submit`,ne),d(x,()=>u(`settings.postTypes.form.title`)),d(T,()=>u(`settings.postTypes.form.slug`),A,j),M.$$input=e=>O({...D(),slug:e.currentTarget.value}),d(N,()=>u(`settings.postTypes.form.singular`),P,ae),F.$$input=e=>O({...D(),singularLabel:e.currentTarget.value}),d(I,()=>u(`settings.postTypes.form.plural`),L,R),z.$$input=e=>O({...D(),pluralLabel:e.currentTarget.value}),d(V,()=>u(`settings.postTypes.form.supports`)),d(B,a(s,{get each(){return E()},children:e=>(()=>{var t=p(v),r=t.firstChild,i=r.nextSibling.nextSibling,[a,s]=c(i.nextSibling);return r.addEventListener(`change`,t=>O({...D(),supports:t.currentTarget.checked?[...D().supports,e.value]:D().supports.filter(t=>t!==e.value)})),d(t,()=>e.label,a,s),n(()=>o(r,`checked`,D().supports.includes(e.value))),t})()}),U,W),K.addEventListener(`change`,e=>O({...D(),hasArchive:e.currentTarget.checked})),d(G,()=>u(`settings.postTypes.form.hasArchive`),ce,le),d(q,()=>u(`settings.postTypes.form.create`)),d(Y,()=>u(`settings.postTypes.table.slug`)),d(X,()=>u(`settings.postTypes.table.singular`)),d(Z,()=>u(`settings.postTypes.table.plural`)),d(Q,()=>u(`settings.postTypes.table.source`)),d($,()=>u(`settings.postTypes.table.supports`)),d(ue,()=>u(`settings.postTypes.table.archive`)),d(de,a(s,{get each(){return f()},children:e=>(()=>{var t=p(b),n=t.firstChild,r=n.nextSibling,o=r.nextSibling,s=o.nextSibling,c=s.nextSibling,f=c.nextSibling,h=f.nextSibling;return d(n,()=>e.slug),d(r,()=>e.singularLabel),d(o,()=>e.pluralLabel),d(s,()=>e.source??u(`settings.postTypes.sources.admin`)),d(c,()=>(e.supports??[]).join(`, `)),d(f,(()=>{var t=m(()=>!!e.hasArchive);return()=>t()?u(`common.yes`):u(`common.no`)})()),d(h,a(i,{get when(){return e.source!==`CORE`},get children(){var t=p(y);return t.$$click=()=>re(e.slug),d(t,()=>u(`settings.postTypes.table.actions.remove`)),l(),t}})),t})()})),n(e=>{var t=u(`settings.postTypes.form.slugHint`),n=w();return t!==e.e&&h(M,`title`,e.e=t),n!==e.t&&o(q,`disabled`,e.t=n),e},{e:void 0,t:void 0}),n(()=>o(M,`value`,D().slug)),n(()=>o(F,`value`,D().singularLabel)),n(()=>o(z,`value`,D().pluralLabel)),n(()=>o(K,`checked`,D().hasArchive)),l(),e})()}u([`input`,`click`]);export{x as PostTypesManager};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,b as i,d as a,g as o,i as s,l as c,n as l,o as u,p as d,r as f,s as p,u as m}from"./web.D_vCtCLj.js";import{t as h}from"./api.CDW61rqX.js";import{DashboardWidget as g}from"./AtGlanceWidget.BVCJB3QT.js";var _=d(`<div class=quick-draft-wrapper><div class=quick-draft-content-wrapper>`),v=d(`<style>
|
|
2
2
|
.quick-draft-form { display: flex; flex-direction: column; gap: 1rem; }
|
|
3
3
|
.form-group textarea { min-height: 100px; resize: vertical; font-family: inherit; }
|
|
4
4
|
.drafts-list h4 { margin-bottom: 1rem; }
|
|
@@ -14,4 +14,4 @@ import{C as e,E as t,S as n,b as r,d as i,g as a,i as o,l as s,n as c,o as l,p a
|
|
|
14
14
|
.draft-meta { display: flex; gap: 0.5rem; font-size: 0.8125rem; color: var(--color-muted); }
|
|
15
15
|
.status-draft { color: var(--color-warning); font-weight: 500; }
|
|
16
16
|
.draft-date { font-size: 0.75rem; }
|
|
17
|
-
`),y=
|
|
17
|
+
`),y=d(`<div class=skeleton>Loading...`),b=d(`<div class=quick-draft-content><form class=quick-draft-form><div class=form-group><label for=quick-draft-title></label><input type=text id=quick-draft-title class=input required></div><div class=form-group><label for=quick-draft-content></label><textarea id=quick-draft-content class=input rows=4></textarea></div><div class=form-actions><button type=submit class="btn btn-primary"></button><button type=button class="btn btn-secondary"></button></div></form><div class=drafts-section>`),x=d(`<span class=spinner>`),S=d(`<div class=drafts-list><h4></h4><!$><!/>`),C=d(`<a class=draft-item><div class=draft-info><span class=draft-title></span><span class=draft-meta><span class=status-draft></span><span class=draft-date>`),w=d(`<p class=empty-state>`);function T(){let{t:l}=e(),[d,T]=t([]),[E,D]=t(!0),[O,k]=t(!1),[A,j]=t(``),[M,N]=t(``);r(async()=>{try{let e=await h.getContent({type:`post`,status:`DRAFT`,limit:5});T(e.data??[])}catch(e){console.error(`Failed to load drafts:`,e)}finally{D(!1)}});let P=async e=>{if(e.preventDefault(),A().trim()){k(!0);try{let e=await h.createContent({type:`post`,title:A(),slug:A().toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``),excerpt:M(),status:`DRAFT`,body:{content:M()}});T([e,...d()]),j(``),N(``)}catch(e){console.error(`Failed to save draft:`,e)}finally{k(!1)}}},F=e=>e?new Date(e).toLocaleDateString(`pt-BR`,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}):``;return i(g,{get title(){return l(`dashboard.widgets.quickDraft.title`)},panelId:`quick-draft`,get children(){return[(()=>{var e=f(_),t=e.firstChild;return u(t,(()=>{var e=p(()=>!!E());return()=>e()?f(y):(()=>{var e=f(b),t=e.firstChild,r=t.firstChild,h=r.firstChild,g=h.nextSibling,_=r.nextSibling,v=_.firstChild,y=v.nextSibling,T=_.nextSibling.firstChild,E=T.nextSibling,D=t.nextSibling;return t.addEventListener(`submit`,P),u(h,()=>l(`dashboard.widgets.quickDraft.heading`)),g.$$input=e=>j(e.currentTarget.value),u(v,()=>l(`dashboard.widgets.quickDraft.content`)),y.$$input=e=>N(e.currentTarget.value),u(T,(()=>{var e=p(()=>!!O());return()=>e()?f(x):l(`dashboard.widgets.quickDraft.save`)})()),E.$$click=()=>{j(``),N(``)},u(E,()=>l(`common.cancel`)),u(D,(()=>{var e=p(()=>d().length>0);return()=>e()?(()=>{var e=f(S),t=e.firstChild,r=t.nextSibling,[a,c]=s(r.nextSibling);return u(t,()=>l(`dashboard.widgets.quickDraft.yourDrafts`)),u(e,i(o,{get each(){return d()},children:e=>(()=>{var t=f(C),r=t.firstChild.firstChild,i=r.nextSibling.firstChild,a=i.nextSibling;return u(r,()=>e.title),u(i,()=>l(`content.list.statuses.draft`)),u(a,()=>F(e.updated_at)),n(()=>m(t,`href`,`/content/edit?id=${e.id}`)),t})()}),a,c),e})():(()=>{var e=f(w);return u(e,()=>l(`dashboard.widgets.quickDraft.noDrafts`)),e})()})()),n(e=>{var t=l(`dashboard.widgets.quickDraft.headingPlaceholder`),n=l(`dashboard.widgets.quickDraft.contentPlaceholder`),r=O();return t!==e.e&&m(g,`placeholder`,e.e=t),n!==e.t&&m(y,`placeholder`,e.t=n),r!==e.a&&a(T,`disabled`,e.a=r),e},{e:void 0,t:void 0,a:void 0}),n(()=>a(g,`value`,A())),n(()=>a(y,`value`,M())),c(),e})()})()),e})(),f(v)]}})}l([`input`,`click`]);export{T as QuickDraftWidget};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m,u as h}from"./web.D_vCtCLj.js";import{t as g}from"./api.CDW61rqX.js";var _=f(`<div class="notice notice--error">`),v=f(`<div class=notice>`),y=f(`<table class=table><thead><tr><th></th><th></th><th></th></tr></thead><tbody>`),b=f(`<button class="btn btn-primary"type=button>+ <!$><!/>`),x=f(`<div class=resource-hub><!$><!/><!$><!/><div class=resource-tabs></div><!$><!/><div class=resource-actions><button type=button class="btn btn-primary">+ <!$><!/></button></div><div class=card><!$><!/><!$><!/><!$><!/></div><section class="card terms-panel"><h3></h3><select class=input><option value></option><!$><!/></select><!$><!/>`),S=f(`<button type=button class=btn>`),C=f(`<label><!$><!/><textarea class=input>`),w=f(`<label><!$><!/><textarea class=input rows=8>`),T=f(`<form class="card resource-form"><h3></h3><label><!$><!/><input class=input required></label><label><!$><!/><input class=input></label><!$><!/><!$><!/><div><button class="btn btn-primary"type=submit></button> <button class=btn type=button>`),E=f(`<tr><td></td><td></td><td><button class=btn type=button></button> <button class="btn btn-danger"type=button>`),D=f(`<option>`),O=f(`<form class=term-form><input class=input required><input class=input><button class=btn type=submit>`),k=f(`<tr><td></td><td></td><td><button class=btn type=button></button><button class="btn btn-danger"type=button>`),A=f(`<div class=resource-hub><!$><!/><div class=access-grid><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody></tbody></table></section><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody>`),j=f(`<form class=resource-form><input class=input required><input class=input required><input class=input><button class="btn btn-primary"type=submit>`),M=f(`<button class="btn btn-danger"type=button>`),N=f(`<tr><td></td><td></td><td><button class=btn type=button></button><!$><!/>`),ee=f(`<tr><td></td><td></td><td></td><td><button class=btn type=button></button><button class="btn btn-danger"type=button>`),P=f(`<div class=resource-hub><!$><!/><section class=card><h3></h3><button class="btn btn-primary"type=button>+ <!$><!/></button><!$><!/><table class=table><tbody></tbody></table></section><section class=card><h3></h3><button class="btn btn-primary"type=button></button><table class=table><tbody></tbody></table></section><section class=card><h3></h3><table class=table><tbody></tbody></table></section><section class=card><h3></h3><table class=table><tbody>`),te=f(`<form class=resource-form><input class=input required type=url placeholder=https://example.com/webhook><input class=input><input class=input><button class="btn btn-primary"type=submit>`),F=f(`<button class="btn btn-primary"type=button>`),I=f(`<tr><td></td><td></td><td></td><td>`),L=f(`<tr><td></td><td></td><td>`),R=f(`<tr><td></td><td>`);function z(e){return e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/(^-|-$)/g,``)}function B(){let{t:u}=e(),[f,m]=t(`category`),[A,j]=t([]),[M,N]=t([]),[ee,P]=t([]),[te,F]=t([]),[I,L]=t([]),[R,B]=t(``),[V,H]=t(null),[U,W]=t(null),[G,K]=t(``),[q,J]=t(``),Y=async()=>{try{let[e,t,n,r]=await Promise.all([g.getCategories(),g.getTags(),g.getMenus(),g.getTaxonomies()]);j(e),N(t),P(n),F(r),!R()&&r[0]&&(B(r[0].slug),L(await g.getTaxonomyTerms(r[0].slug)))}catch(e){K(e instanceof Error?e.message:String(e))}};r(Y);let X=async e=>{if(B(e),!e){L([]);return}try{L(await g.getTaxonomyTerms(e))}catch(e){K(e instanceof Error?e.message:String(e))}},Z=(e,t)=>{if(m(e),e===`menu`){let e=t;H({id:e?.id,name:e?.name??``,slug:e?.slug??``,items:JSON.stringify(e?.items??[],null,2)})}else{let e=t;H({id:e?.id,name:e?.name??``,slug:e?.slug??``,description:`description`in(e??{})?String(e.description??``):void 0})}K(``),J(``)},ne=async e=>{e.preventDefault();let t=V();if(t){K(``);try{let e=t.slug||z(t.name);if(f()===`category`){let n={name:t.name,slug:e,description:t.description};t.id?await g.updateCategory(t.id,n):await g.createCategory(n)}else if(f()===`tag`){let n={name:t.name,slug:e};t.id?await g.updateTag(t.id,n):await g.createTag(n)}else{let n=JSON.parse(t.items||`[]`),r={name:t.name,slug:e,items:n};t.id?await g.updateMenu(t.id,r):await g.createMenu(r)}H(null),J(u(`resources.saved`)),await Y()}catch(e){K(e instanceof Error?e.message:String(e))}}},re=async e=>{if(confirm(u(`resources.confirmDelete`)))try{f()===`category`&&e.id&&await g.deleteCategory(e.id),f()===`tag`&&e.id&&await g.deleteTag(e.id),f()===`menu`&&e.id&&await g.deleteMenu(e.id),await Y()}catch(e){K(e instanceof Error?e.message:String(e))}},ie=async e=>{e.preventDefault();let t=U(),n=R();if(t&&n)try{t.id?await g.updateTaxonomyTerm(n,t.id,{name:t.name,slug:t.slug||z(t.name),description:t.description}):await g.createTaxonomyTerm(n,{name:t.name,slug:t.slug||z(t.name),description:t.description}),W(null),await X(n)}catch(e){K(e instanceof Error?e.message:String(e))}};return(()=>{var e=p(x),t=e.firstChild,[r,j]=c(t.nextSibling),N=r.nextSibling,[P,F]=c(N.nextSibling),L=P.nextSibling,z=L.nextSibling,[B,K]=c(z.nextSibling),J=B.nextSibling,Y=J.firstChild,ae=Y.firstChild.nextSibling,[oe,se]=c(ae.nextSibling),Q=J.nextSibling,ce=Q.firstChild,[le,ue]=c(ce.nextSibling),de=le.nextSibling,[fe,pe]=c(de.nextSibling),me=fe.nextSibling,[he,ge]=c(me.nextSibling),_e=Q.nextSibling,ve=_e.firstChild,$=ve.nextSibling,ye=$.firstChild,be=ye.nextSibling,[xe,Se]=c(be.nextSibling),Ce=$.nextSibling,[we,Te]=c(Ce.nextSibling);return d(e,a(i,{get when(){return G()},get children(){var e=p(_);return d(e,G),e}}),r,j),d(e,a(i,{get when(){return q()},get children(){var e=p(v);return d(e,q),e}}),P,F),d(L,a(s,{each:[`category`,`tag`,`menu`],children:e=>(()=>{var t=p(S);return t.$$click=()=>{m(e),H(null)},d(t,()=>u(`resources.tabs.${e}`)),n(()=>t.classList.toggle(`btn-primary`,f()===e)),l(),t})()})),d(e,a(i,{get when(){return V()},children:e=>(()=>{var t=p(T),r=t.firstChild,s=r.nextSibling,m=s.firstChild,[h,g]=c(m.nextSibling),_=h.nextSibling,v=s.nextSibling,y=v.firstChild,[b,x]=c(y.nextSibling),S=b.nextSibling,E=v.nextSibling,[D,O]=c(E.nextSibling),k=D.nextSibling,[A,j]=c(k.nextSibling),M=A.nextSibling.firstChild,N=M.nextSibling.nextSibling;return t.addEventListener(`submit`,ne),d(r,()=>u(`resources.form.${e().id?`edit`:`new`}`)),d(s,()=>u(`resources.name`),h,g),_.$$input=t=>H({...e(),name:t.currentTarget.value}),d(v,()=>u(`resources.slug`),b,x),S.$$input=t=>H({...e(),slug:t.currentTarget.value}),d(t,a(i,{get when(){return f()===`category`},get children(){var t=p(C),r=t.firstChild,[i,a]=c(r.nextSibling),s=i.nextSibling;return d(t,()=>u(`resources.description`),i,a),s.$$input=t=>H({...e(),description:t.currentTarget.value}),n(()=>o(s,`value`,e().description??``)),l(),t}}),D,O),d(t,a(i,{get when(){return f()===`menu`},get children(){var t=p(w),r=t.firstChild,[i,a]=c(r.nextSibling),s=i.nextSibling;return d(t,()=>u(`resources.items`),i,a),s.$$input=t=>H({...e(),items:t.currentTarget.value}),n(()=>o(s,`value`,e().items??`[]`)),l(),t}}),A,j),d(M,()=>u(`common.save`)),N.$$click=()=>H(null),d(N,()=>u(`common.cancel`)),n(()=>o(_,`value`,e().name)),n(()=>o(S,`value`,e().slug)),l(),t})()}),B,K),Y.$$click=()=>Z(f()),d(Y,()=>u(`resources.new`),oe,se),d(Q,a(i,{get when(){return f()===`category`},get children(){var e=p(y),t=e.firstChild,n=t.firstChild.firstChild,r=n.nextSibling,i=t.nextSibling;return d(n,()=>u(`resources.name`)),d(r,()=>u(`resources.slug`)),d(i,a(s,{get each(){return A()},children:e=>(()=>{var t=p(E),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling.nextSibling;return d(n,()=>e.name),d(r,()=>e.slug),i.$$click=()=>Z(`category`,e),d(i,()=>u(`common.edit`)),a.$$click=()=>void re(e),d(a,()=>u(`common.delete`)),l(),t})()})),e}}),le,ue),d(Q,a(i,{get when(){return f()===`tag`},get children(){var e=p(y),t=e.firstChild,n=t.firstChild.firstChild,r=n.nextSibling,i=t.nextSibling;return d(n,()=>u(`resources.name`)),d(r,()=>u(`resources.slug`)),d(i,a(s,{get each(){return M()},children:e=>(()=>{var t=p(E),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling.nextSibling;return d(n,()=>e.name),d(r,()=>e.slug),i.$$click=()=>Z(`tag`,e),d(i,()=>u(`common.edit`)),a.$$click=()=>void re(e),d(a,()=>u(`common.delete`)),l(),t})()})),e}}),fe,pe),d(Q,a(i,{get when(){return f()===`menu`},get children(){var e=p(y),t=e.firstChild,n=t.firstChild.firstChild,r=n.nextSibling,i=t.nextSibling;return d(n,()=>u(`resources.name`)),d(r,()=>u(`resources.slug`)),d(i,a(s,{get each(){return ee()},children:e=>(()=>{var t=p(E),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling.nextSibling;return d(n,()=>e.name),d(r,()=>e.slug),i.$$click=()=>Z(`menu`,e),d(i,()=>u(`common.edit`)),a.$$click=()=>void re(e),d(a,()=>u(`common.delete`)),l(),t})()})),e}}),he,ge),d(ve,()=>u(`resources.terms.title`)),$.addEventListener(`change`,e=>void X(e.currentTarget.value)),d(ye,()=>u(`resources.terms.choose`)),d($,a(s,{get each(){return te()},children:e=>(()=>{var t=p(D);return d(t,()=>e.name),n(()=>o(t,`value`,e.slug)),t})()}),xe,Se),d(_e,a(i,{get when(){return R()},get children(){return[(()=>{var e=p(b),t=e.firstChild.nextSibling,[n,r]=c(t.nextSibling);return e.$$click=()=>W({name:``,slug:``,description:``}),d(e,()=>u(`resources.terms.new`),n,r),l(),e})(),a(i,{get when(){return U()},children:e=>(()=>{var t=p(O),r=t.firstChild,i=r.nextSibling,a=i.nextSibling;return t.addEventListener(`submit`,ie),r.$$input=t=>W({...e(),name:t.currentTarget.value}),i.$$input=t=>W({...e(),slug:t.currentTarget.value}),d(a,()=>u(`common.save`)),n(e=>{var t=u(`resources.name`),n=u(`resources.slug`);return t!==e.e&&h(r,`placeholder`,e.e=t),n!==e.t&&h(i,`placeholder`,e.t=n),e},{e:void 0,t:void 0}),n(()=>o(r,`value`,e().name)),n(()=>o(i,`value`,e().slug)),l(),t})()}),(()=>{var e=p(y),t=e.firstChild,n=t.firstChild.firstChild,r=n.nextSibling,i=t.nextSibling;return d(n,()=>u(`resources.name`)),d(r,()=>u(`resources.slug`)),d(i,a(s,{get each(){return I()},children:e=>(()=>{var t=p(k),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling;return d(n,()=>e.name),d(r,()=>e.slug),i.$$click=()=>W({id:e.id,name:e.name,slug:e.slug,description:e.description??``}),d(i,()=>u(`common.edit`)),a.$$click=()=>e.id&&void g.deleteTaxonomyTerm(R(),e.id).then(()=>X(R())),d(a,()=>u(`common.delete`)),l(),t})()})),e})()]}}),we,Te),n(()=>o($,`value`,R())),l(),e})()}function V(){let{t:u}=e(),[f,m]=t([]),[v,y]=t([]),[b,x]=t(null),[S,C]=t(null),[w,T]=t(``),E=async()=>{try{m(await g.listRoles()),y((await g.listTenants({limit:100})).data??[])}catch(e){T(e instanceof Error?e.message:String(e))}};return r(E),(()=>{var e=p(A),t=e.firstChild,[r,m]=c(t.nextSibling),y=r.nextSibling.firstChild,D=y.firstChild,O=D.nextSibling,k=O.firstChild.nextSibling,[P,te]=c(k.nextSibling),F=O.nextSibling,[I,L]=c(F.nextSibling),R=I.nextSibling.firstChild,z=y.nextSibling,B=z.firstChild,V=B.nextSibling,H=V.firstChild.nextSibling,[U,W]=c(H.nextSibling),G=V.nextSibling,[K,q]=c(G.nextSibling),J=K.nextSibling.firstChild;return d(e,a(i,{get when(){return w()},get children(){var e=p(_);return d(e,w),e}}),r,m),d(D,()=>u(`access.roles`)),O.$$click=()=>x({name:``,slug:``,permissions:[]}),d(O,()=>u(`common.create`),P,te),d(y,a(i,{get when(){return b()},children:e=>(()=>{var t=p(j),r=t.firstChild,i=r.nextSibling,a=i.nextSibling,s=a.nextSibling;return t.addEventListener(`submit`,t=>{t.preventDefault(),(e().id?g.updateRole(e().id,e()):g.createRole(e())).then(()=>(x(null),E())).catch(e=>T(e instanceof Error?e.message:String(e)))}),r.$$input=t=>x({...e(),name:t.currentTarget.value}),i.$$input=t=>x({...e(),slug:t.currentTarget.value}),a.$$input=t=>x({...e(),permissions:t.currentTarget.value.split(`,`).map(e=>e.trim()).filter(Boolean)}),d(s,()=>u(`common.save`)),n(e=>{var t=u(`resources.name`),n=u(`resources.slug`),o=u(`access.permissions`);return t!==e.e&&h(r,`placeholder`,e.e=t),n!==e.t&&h(i,`placeholder`,e.t=n),o!==e.a&&h(a,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n(()=>o(r,`value`,e().name??``)),n(()=>o(i,`value`,e().slug??``)),n(()=>o(a,`value`,(e().permissions??[]).join(`, `))),l(),t})()}),I,L),d(R,a(s,{get each(){return f()},children:e=>(()=>{var t=p(N),n=t.firstChild,r=n.nextSibling,o=r.nextSibling,s=o.firstChild,f=s.nextSibling,[m,h]=c(f.nextSibling);return d(n,()=>e.name),d(r,()=>e.slug),s.$$click=()=>x(e),d(s,()=>u(`common.edit`)),d(o,a(i,{get when(){return!e.is_system},get children(){var t=p(M);return t.$$click=()=>void g.deleteRole(e.id).then(E),d(t,()=>u(`common.delete`)),l(),t}}),m,h),l(),t})()})),d(B,()=>u(`access.tenants`)),V.$$click=()=>C({name:``,slug:``}),d(V,()=>u(`common.create`),U,W),d(z,a(i,{get when(){return S()},children:e=>(()=>{var t=p(j),r=t.firstChild,i=r.nextSibling,a=i.nextSibling,s=a.nextSibling;return t.addEventListener(`submit`,t=>{t.preventDefault(),(e().id?g.updateTenant(e().id,e()):g.createTenant(e())).then(()=>(C(null),E())).catch(e=>T(e instanceof Error?e.message:String(e)))}),r.$$input=t=>C({...e(),name:t.currentTarget.value}),i.$$input=t=>C({...e(),slug:t.currentTarget.value}),a.$$input=t=>C({...e(),domain:t.currentTarget.value}),d(s,()=>u(`common.save`)),n(e=>{var t=u(`resources.name`),n=u(`resources.slug`),o=u(`access.domain`);return t!==e.e&&h(r,`placeholder`,e.e=t),n!==e.t&&h(i,`placeholder`,e.t=n),o!==e.a&&h(a,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n(()=>o(r,`value`,e().name??``)),n(()=>o(i,`value`,e().slug??``)),n(()=>o(a,`value`,e().domain??``)),l(),t})()}),K,q),d(J,a(s,{get each(){return v()},children:e=>(()=>{var t=p(ee),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling.firstChild,o=a.nextSibling;return d(n,()=>e.name),d(r,()=>e.slug),d(i,()=>e.status),a.$$click=()=>C(e),d(a,()=>u(`common.edit`)),o.$$click=()=>e.id&&void g.deleteTenant(e.id).then(E),d(o,()=>u(`common.delete`)),l(),t})()})),l(),e})()}function H(){let{t:u}=e(),[f,v]=t([]),[y,b]=t([]),[x,S]=t([]),[C,w]=t([]),[T,D]=t(``),[O,k]=t(null),A=async()=>{try{let[e,t,n,r]=await Promise.all([g.getWebhooks(),g.getBuilds({limit:20}),g.getDeployments({limit:20}),g.getEvents({limit:20})]);v(e),b(t.data??[]),S(n.data??[]),w(r.data??[])}catch(e){D(e instanceof Error?e.message:String(e))}};r(A);let j=async e=>{if(e.id&&e.checksum)try{let t=e.theme??{name:`default`,version:`0.0.0`};await g.createDeployment({buildId:e.id,core_version:e.coreVersion??e.core_version??`unknown`,theme_version:t.version,plugin_versions:e.plugins??{},checksum:e.checksum}),await A()}catch(e){D(e instanceof Error?e.message:String(e))}};return(()=>{var e=p(P),t=e.firstChild,[r,v]=c(t.nextSibling),b=r.nextSibling,S=b.firstChild,w=S.nextSibling,M=w.firstChild.nextSibling,[N,ee]=c(M.nextSibling),z=w.nextSibling,[B,V]=c(z.nextSibling),H=B.nextSibling.firstChild,U=b.nextSibling,W=U.firstChild,G=W.nextSibling,K=G.nextSibling.firstChild,q=U.nextSibling,J=q.firstChild,Y=J.nextSibling.firstChild,X=q.nextSibling.firstChild,Z=X.nextSibling.firstChild;return d(e,a(i,{get when(){return T()},get children(){var e=p(_);return d(e,T),e}}),r,v),d(S,()=>u(`operations.webhooks`)),w.$$click=()=>k({url:``,events:[],secret:``,active:!0}),d(w,()=>u(`common.create`),N,ee),d(b,a(i,{get when(){return O()},children:e=>(()=>{var t=p(te),r=t.firstChild,i=r.nextSibling,a=i.nextSibling,s=a.nextSibling;return t.addEventListener(`submit`,t=>{t.preventDefault(),(e().id?g.updateWebhook(e().id,e()):g.createWebhook(e())).then(()=>(k(null),A())).catch(e=>D(e instanceof Error?e.message:String(e)))}),r.$$input=t=>k({...e(),url:t.currentTarget.value}),i.$$input=t=>k({...e(),events:t.currentTarget.value.split(`,`).map(e=>e.trim()).filter(Boolean)}),a.$$input=t=>k({...e(),secret:t.currentTarget.value}),d(s,()=>u(`common.save`)),n(e=>{var t=u(`operations.events`),n=u(`operations.secret`);return t!==e.e&&h(i,`placeholder`,e.e=t),n!==e.t&&h(a,`placeholder`,e.t=n),e},{e:void 0,t:void 0}),n(()=>o(r,`value`,e().url??``)),n(()=>o(i,`value`,(e().events??[]).join(`, `))),n(()=>o(a,`value`,e().secret??``)),l(),t})()}),B,V),d(H,a(s,{get each(){return f()},children:e=>(()=>{var t=p(E),n=t.firstChild,r=n.nextSibling,i=r.nextSibling.firstChild,a=i.nextSibling.nextSibling;return d(n,()=>e.url),d(r,()=>(e.events??[]).join(`, `)),i.$$click=()=>k(e),d(i,()=>u(`common.edit`)),a.$$click=()=>e.id&&void g.deleteWebhook(e.id).then(A),d(a,()=>u(`common.delete`)),l(),t})()})),d(W,()=>u(`operations.builds`)),G.$$click=()=>void g.createBuild({plugins:{},theme:{name:`default`,version:`0.0.0`}}).then(A).catch(e=>D(e instanceof Error?e.message:String(e))),d(G,()=>u(`operations.createBuild`)),d(K,a(s,{get each(){return y()},children:e=>(()=>{var t=p(I),n=t.firstChild,r=n.nextSibling,o=r.nextSibling,s=o.nextSibling;return d(n,()=>e.id),d(r,()=>e.status),d(o,()=>e.error),d(s,a(i,{get when(){return m(()=>e.status===`COMPLETED`)()&&e.checksum},get children(){var t=p(F);return t.$$click=()=>void j(e),d(t,()=>u(`operations.deploy`)),l(),t}})),t})()})),d(J,()=>u(`operations.deployments`)),d(Y,a(s,{get each(){return x()},children:e=>(()=>{var t=p(L),n=t.firstChild,r=n.nextSibling,i=r.nextSibling;return d(n,()=>e.id),d(r,()=>e.status),d(i,()=>e.build_id),t})()})),d(X,()=>u(`operations.events`)),d(Z,a(s,{get each(){return C()},children:e=>(()=>{var t=p(R),n=t.firstChild,r=n.nextSibling;return d(n,()=>String(e.type??``)),d(r,()=>String(e.created_at??``)),t})()})),l(),e})()}u([`click`,`input`]);export{V as AccessManager,B as ContentResourcesManager,H as OperationsManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m,u as h}from"./web.D_vCtCLj.js";import{t as g}from"./api.CDW61rqX.js";var _=f(`<div class="notice notice--error">`),v=f(`<div class=taxonomies-manager><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required></label><label><!$><!/><input class=input pattern=[a-z0-9_]*></label><label><input type=checkbox> <!$><!/></label></div><fieldset><legend></legend><!$><!/></fieldset><button type=submit class="btn btn-primary"></button></form><table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),y=f(`<label><input type=checkbox> <!$><!/> (<!$><!/>)`),b=f(`<button type=button class="btn btn-danger">`),x=f(`<tr><td><!$><!/> (<!$><!/>)</td><td></td><td></td><td>`),ee=f(`<label style=margin-right:0.75rem><input type=checkbox> <!$><!/>`);function S(){let{t:u}=e(),[f,S]=t([]),[C,w]=t([]),[T,E]=t(``),[D,O]=t(!1),[k,A]=t({name:``,slug:``,hierarchical:!1,attachTo:[]}),j=async()=>{try{let[e,t]=await Promise.all([g.getTaxonomies(),g.getContentTypes()]);S(e),w(t)}catch(e){E(e instanceof Error?e.message:String(e))}};r(j);let M=async e=>{e.preventDefault(),E(``),O(!0);try{await g.createTaxonomy({name:k().name,slug:k().slug||void 0,hierarchical:k().hierarchical,attachTo:k().attachTo,labels:{singular_name:k().name}}),A({name:``,slug:``,hierarchical:!1,attachTo:[]}),await j()}catch(e){E(e instanceof Error?e.message:String(e))}finally{O(!1)}},N=async(e,t)=>{let n=e.attachTo?.includes(t);try{n?await g.detachTaxonomy(e.slug,t):await g.attachTaxonomy(e.slug,t),await j()}catch(e){E(e instanceof Error?e.message:String(e))}},P=async e=>{try{await g.deleteTaxonomy(e),await j()}catch(e){E(e instanceof Error?e.message:String(e))}};return(()=>{var e=p(v),t=e.firstChild,[r,g]=c(t.nextSibling),S=r.nextSibling,w=S.firstChild,E=w.nextSibling,O=E.firstChild,j=O.firstChild,[F,I]=c(j.nextSibling),L=F.nextSibling,R=O.nextSibling,z=R.firstChild,[B,V]=c(z.nextSibling),H=B.nextSibling,U=R.nextSibling,W=U.firstChild,G=W.nextSibling.nextSibling,[K,q]=c(G.nextSibling),J=E.nextSibling,Y=J.firstChild,te=Y.nextSibling,[ne,re]=c(te.nextSibling),X=J.nextSibling,Z=S.nextSibling.firstChild,Q=Z.firstChild.firstChild,$=Q.nextSibling,ie=$.nextSibling,ae=Z.nextSibling;return d(e,a(i,{get when(){return T()},get children(){var e=p(_);return d(e,T),e}}),r,g),S.addEventListener(`submit`,M),d(w,()=>u(`settings.taxonomies.form.title`)),d(O,()=>u(`settings.taxonomies.form.name`),F,I),L.$$input=e=>A({...k(),name:e.currentTarget.value}),d(R,()=>u(`settings.taxonomies.form.slug`),B,V),H.$$input=e=>A({...k(),slug:e.currentTarget.value}),W.addEventListener(`change`,e=>A({...k(),hierarchical:e.currentTarget.checked})),d(U,()=>u(`settings.taxonomies.form.hierarchical`),K,q),d(Y,()=>u(`settings.taxonomies.form.attachTo`)),d(J,a(s,{get each(){return C()},children:e=>(()=>{var t=p(y),r=t.firstChild,i=r.nextSibling.nextSibling,[a,s]=c(i.nextSibling),l=a.nextSibling.nextSibling,[u,f]=c(l.nextSibling);return u.nextSibling,r.addEventListener(`change`,t=>A({...k(),attachTo:t.currentTarget.checked?[...k().attachTo,e.slug]:k().attachTo.filter(t=>t!==e.slug)})),d(t,()=>e.pluralLabel,a,s),d(t,()=>e.slug,u,f),n(()=>o(r,`checked`,k().attachTo.includes(e.slug))),t})()}),ne,re),d(X,()=>u(`settings.taxonomies.form.create`)),d(Q,()=>u(`settings.taxonomies.table.taxonomy`)),d($,()=>u(`settings.taxonomies.table.hierarchical`)),d(ie,()=>u(`settings.taxonomies.table.attachedTypes`)),d(ae,a(s,{get each(){return f()},children:e=>(()=>{var t=p(x),r=t.firstChild,f=r.firstChild,[h,g]=c(f.nextSibling),_=h.nextSibling.nextSibling,[v,y]=c(_.nextSibling);v.nextSibling;var S=r.nextSibling,w=S.nextSibling,T=w.nextSibling;return d(r,()=>e.name,h,g),d(r,()=>e.slug,v,y),d(S,(()=>{var t=m(()=>!!e.hierarchical);return()=>t()?u(`common.yes`):u(`common.no`)})()),d(w,a(s,{get each(){return C()},children:t=>(()=>{var r=p(ee),i=r.firstChild,a=i.nextSibling.nextSibling,[s,l]=c(a.nextSibling);return i.addEventListener(`change`,()=>N(e,t.slug)),d(r,()=>t.slug,s,l),n(()=>o(i,`checked`,e.attachTo?.includes(t.slug)??!1)),r})()})),d(T,a(i,{get when(){return e.source!==`CORE`},get children(){var t=p(b);return t.$$click=()=>P(e.slug),d(t,()=>u(`settings.taxonomies.table.actions.remove`)),l(),t}})),t})()})),n(e=>{var t=u(`settings.taxonomies.form.slugHint`),n=D();return t!==e.e&&h(H,`title`,e.e=t),n!==e.t&&o(X,`disabled`,e.t=n),e},{e:void 0,t:void 0}),n(()=>o(L,`value`,k().name)),n(()=>o(H,`value`,k().slug)),n(()=>o(W,`checked`,k().hierarchical)),l(),e})()}u([`input`,`click`]);export{S as TaxonomiesManager};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m,t as h,u as g}from"./web.D_vCtCLj.js";import{t as _}from"./api.CDW61rqX.js";var v=f(`<form class="card theme-install-form"><input class=input required><input class=input required><textarea class=input required rows=5></textarea><button class="btn btn-primary"type=submit>`),y=f(`<div class=theme-manager><div class=page-header><h2></h2><p class=page-description></p><button class="btn btn-primary"type=button></button></div><!$><!/><!$><!/><!$><!/><!$><!/><style>
|
|
2
|
+
.page-header {
|
|
3
|
+
margin-bottom: 1.5rem;
|
|
4
|
+
}
|
|
5
|
+
.page-header h2 {
|
|
6
|
+
margin: 0 0 0.5rem;
|
|
7
|
+
font-size: 1.5rem;
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
}
|
|
10
|
+
.page-description {
|
|
11
|
+
margin: 0;
|
|
12
|
+
color: var(--color-muted);
|
|
13
|
+
font-size: 0.875rem;
|
|
14
|
+
}
|
|
15
|
+
.theme-install-form {
|
|
16
|
+
display: grid;
|
|
17
|
+
gap: 0.75rem;
|
|
18
|
+
margin-bottom: 1.5rem;
|
|
19
|
+
}
|
|
20
|
+
.themes-grid {
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
|
23
|
+
gap: 1.5rem;
|
|
24
|
+
}
|
|
25
|
+
.theme-card {
|
|
26
|
+
background: var(--color-surface);
|
|
27
|
+
border: 1px solid var(--color-border);
|
|
28
|
+
border-radius: var(--radius-lg);
|
|
29
|
+
padding: 1.5rem;
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
gap: 1rem;
|
|
33
|
+
transition: all 0.2s;
|
|
34
|
+
}
|
|
35
|
+
.theme-card:hover {
|
|
36
|
+
border-color: var(--color-primary);
|
|
37
|
+
box-shadow: var(--shadow-md);
|
|
38
|
+
}
|
|
39
|
+
.theme-card.active {
|
|
40
|
+
border-color: var(--color-primary);
|
|
41
|
+
box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md);
|
|
42
|
+
}
|
|
43
|
+
.theme-preview {
|
|
44
|
+
position: relative;
|
|
45
|
+
}
|
|
46
|
+
.theme-badge {
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0.5rem;
|
|
49
|
+
right: 0.5rem;
|
|
50
|
+
background: var(--color-primary);
|
|
51
|
+
color: var(--color-primary-contrast);
|
|
52
|
+
padding: 0.25rem 0.5rem;
|
|
53
|
+
border-radius: var(--radius-full);
|
|
54
|
+
font-size: 0.625rem;
|
|
55
|
+
font-weight: 700;
|
|
56
|
+
text-transform: uppercase;
|
|
57
|
+
}
|
|
58
|
+
.theme-info {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
gap: 0.5rem;
|
|
62
|
+
}
|
|
63
|
+
.theme-info h3 {
|
|
64
|
+
margin: 0;
|
|
65
|
+
font-size: 1.125rem;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
}
|
|
68
|
+
.theme-version {
|
|
69
|
+
margin: 0;
|
|
70
|
+
font-size: 0.75rem;
|
|
71
|
+
color: var(--color-muted);
|
|
72
|
+
}
|
|
73
|
+
.theme-desc {
|
|
74
|
+
margin: 0;
|
|
75
|
+
font-size: 0.8125rem;
|
|
76
|
+
color: var(--color-text);
|
|
77
|
+
line-height: 1.5;
|
|
78
|
+
}
|
|
79
|
+
.theme-status {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: 0.5rem;
|
|
83
|
+
}
|
|
84
|
+
.status-badge {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
padding: 0.25rem 0.5rem;
|
|
88
|
+
border-radius: var(--radius-full);
|
|
89
|
+
font-size: 0.625rem;
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
text-transform: uppercase;
|
|
92
|
+
}
|
|
93
|
+
.status-active {
|
|
94
|
+
background: var(--color-success-soft);
|
|
95
|
+
color: var(--color-success);
|
|
96
|
+
}
|
|
97
|
+
.status-installed {
|
|
98
|
+
background: var(--color-primary-soft);
|
|
99
|
+
color: var(--color-primary);
|
|
100
|
+
}
|
|
101
|
+
.status-inactive {
|
|
102
|
+
background: var(--color-muted-soft);
|
|
103
|
+
color: var(--color-muted);
|
|
104
|
+
}
|
|
105
|
+
.theme-actions {
|
|
106
|
+
margin-top: 0.5rem;
|
|
107
|
+
}
|
|
108
|
+
.empty-state {
|
|
109
|
+
grid-column: 1 / -1;
|
|
110
|
+
padding: 3rem;
|
|
111
|
+
text-align: center;
|
|
112
|
+
color: var(--color-muted);
|
|
113
|
+
}
|
|
114
|
+
.alert {
|
|
115
|
+
padding: 0.75rem 1rem;
|
|
116
|
+
border-radius: var(--radius-md);
|
|
117
|
+
margin-bottom: 1rem;
|
|
118
|
+
}
|
|
119
|
+
.alert-error {
|
|
120
|
+
background: var(--color-error-soft);
|
|
121
|
+
color: var(--color-error);
|
|
122
|
+
border: 1px solid var(--color-error);
|
|
123
|
+
}
|
|
124
|
+
.skeleton {
|
|
125
|
+
padding: 2rem;
|
|
126
|
+
text-align: center;
|
|
127
|
+
color: var(--color-muted);
|
|
128
|
+
}
|
|
129
|
+
`),b=f(`<div class="alert alert-error">`),x=f(`<div class=skeleton>Loading...`),S=f(`<div class=themes-grid><!$><!/><!$><!/>`),C=f(`<div><div class=theme-preview></div><div class=theme-info><h3></h3><p class=theme-version><!$><!/>: <!$><!/></p><p class=theme-status><span></span></p><!$><!/></div><div class=theme-actions><button></button><button class="btn btn-danger"type=button>`),w=f(`<div class="theme-badge active-badge">`),T=f(`<p class=theme-desc>`),E=f(`<div class=empty-state>`);function D(){let{t:u}=e(),[f,D]=t([]),[O,k]=t(!0),[A,j]=t(null),[M,N]=t(null),[P,F]=t({name:``,version:``,manifest:`{}`}),[I,L]=t(!1);r(async()=>{await R()});async function R(){try{k(!0);let e=await _.getThemes();D(e)}catch{j(u(`themes.loadError`))}finally{k(!1)}}async function z(e){let t=e.status===`ACTIVE`;N(e.id);try{let n=t?await _.deactivateTheme(e.id):await _.activateTheme(e.id);D(f().map(t=>t.id===e.id?n:t))}catch{j(u(t?`themes.deactivateError`:`themes.activateError`))}finally{N(null)}}async function B(e){e.preventDefault();try{let e=P();await _.installTheme({name:e.name,version:e.version,manifest:JSON.parse(e.manifest)}),F({name:``,version:``,manifest:`{}`}),L(!1),await R()}catch(e){j(e instanceof Error?e.message:u(`themes.installError`))}}async function V(e){if(confirm(u(`themes.confirmUninstall`,{name:e.name})))try{await _.uninstallTheme(e.id),await R()}catch(e){j(e instanceof Error?e.message:u(`themes.uninstallError`))}}let H=e=>{switch(e){case`ACTIVE`:return u(`themes.status.active`);case`INSTALLED`:return u(`themes.status.installed`);case`INACTIVE`:return u(`themes.status.inactive`);default:return e}},U=e=>{switch(e){case`ACTIVE`:return`status-active`;case`INSTALLED`:return`status-installed`;case`INACTIVE`:return`status-inactive`;default:return``}};return(()=>{var e=p(y),t=e.firstChild,r=t.firstChild,_=r.nextSibling,D=_.nextSibling,k=t.nextSibling,[j,N]=c(k.nextSibling),R=j.nextSibling,[W,G]=c(R.nextSibling),K=W.nextSibling,[q,J]=c(K.nextSibling),Y=q.nextSibling,[X,Z]=c(Y.nextSibling);return X.nextSibling,d(r,()=>u(`themes.title`)),d(_,()=>u(`themes.description`)),D.$$click=()=>L(!I()),d(D,()=>u(`themes.install`)),d(e,a(i,{get when(){return I()},get children(){var e=p(v),t=e.firstChild,r=t.nextSibling,i=r.nextSibling,a=i.nextSibling;return e.addEventListener(`submit`,B),t.$$input=e=>F({...P(),name:e.currentTarget.value}),r.$$input=e=>F({...P(),version:e.currentTarget.value}),i.$$input=e=>F({...P(),manifest:e.currentTarget.value}),d(a,()=>u(`common.save`)),n(e=>{var n=u(`themes.name`),a=u(`themes.version`),o=u(`themes.manifest`);return n!==e.e&&g(t,`placeholder`,e.e=n),a!==e.t&&g(r,`placeholder`,e.t=a),o!==e.a&&g(i,`placeholder`,e.a=o),e},{e:void 0,t:void 0,a:void 0}),n(()=>o(t,`value`,P().name)),n(()=>o(r,`value`,P().version)),n(()=>o(i,`value`,P().manifest)),l(),e}}),j,N),d(e,(()=>{var e=m(()=>!!A());return()=>e()&&(()=>{var e=p(b);return d(e,A),e})()})(),W,G),d(e,(()=>{var e=m(()=>!!O());return()=>e()&&p(x)})(),q,J),d(e,(()=>{var e=m(()=>!(O()||A()));return()=>e()&&(()=>{var e=p(S),t=e.firstChild,[r,i]=c(t.nextSibling),g=r.nextSibling,[_,v]=c(g.nextSibling);return d(e,a(s,{get each(){return f()},children:e=>(()=>{var t=p(C),r=t.firstChild,i=r.nextSibling,a=i.firstChild,s=a.nextSibling,f=s.firstChild,[g,_]=c(f.nextSibling),v=g.nextSibling.nextSibling,[y,b]=c(v.nextSibling),x=s.nextSibling,S=x.firstChild,E=x.nextSibling,[D,O]=c(E.nextSibling),k=i.nextSibling.firstChild,A=k.nextSibling;return d(r,(()=>{var t=m(()=>!!e.manifest?.name);return()=>t()&&(()=>{var e=p(w);return d(e,()=>u(`themes.active`)),e})()})()),d(a,()=>e.name),d(s,()=>u(`themes.version`),g,_),d(s,()=>e.version,y,b),d(S,()=>H(e.status)),d(i,(()=>{var t=m(()=>!!e.manifest?.description);return()=>t()&&(()=>{var t=p(T);return d(t,()=>e.manifest.description),t})()})(),D,O),k.$$click=()=>z(e),d(k,(()=>{var t=m(()=>e.status===`ACTIVE`);return()=>t()?u(`themes.deactivate`):u(`themes.activate`)})()),A.$$click=()=>void V(e),d(A,()=>u(`themes.uninstall`)),n(n=>{var r=`theme-card ${e.status===`ACTIVE`?`active`:``}`,i=`status-badge ${U(e.status)}`,a=`btn ${M()===e.id?`btn-loading`:``}`,s=M()!==null;return r!==n.e&&h(t,n.e=r),i!==n.t&&h(S,n.t=i),a!==n.a&&h(k,n.a=a),s!==n.o&&o(k,`disabled`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),l(),t})()}),r,i),d(e,(()=>{var e=m(()=>f().length===0);return()=>e()&&(()=>{var e=p(E);return d(e,()=>u(`themes.empty`)),e})()})(),_,v),e})()})(),X,Z),l(),e})()}u([`click`,`input`]);export{D as ThemeManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p,s as m}from"./web.D_vCtCLj.js";import{t as h}from"./api.CDW61rqX.js";var ee=f(`<div class="notice notice--error">`),g=f(`<div class=user-create><!$><!/><form class=card><h3></h3><div class=form-grid><label><!$><!/><input class=input required></label><label><!$><!/><input class=input type=email required></label><label><!$><!/><span class=muted></span><input class=input type=password required minlength=8></label><label><!$><!/><select class=input><option value></option><!$><!/></select></label></div><p class=muted><!$><!/> <!$><!/> — <!$><!/> <!$><!/>.</p><div class=media-details__actions><button class="btn btn-primary"type=submit></button><a class="btn btn-secondary"href=/users>`),te=f(`<option><!$><!/> (<!$><!/>)`);function _(){let{t:u}=e(),[f,_]=t(``),[v,ne]=t(``),[y,re]=t(``),[b,x]=t(``),[S,C]=t([]),[w,T]=t(``),[E,D]=t(!1);r(async()=>{try{let e=await h.listRoles();C(e),x(e.find(e=>e.slug===`EDITOR`)?.id??e[0]?.id??``)}catch{}});let O=async e=>{if(e.preventDefault(),T(``),y().length<8){T(u(`users.detail.passwordError`));return}D(!0);try{await h.createUser({name:f(),email:v(),password:y(),roleId:b()||void 0}),window.location.href=`/users`}catch(e){T(e instanceof Error?e.message:String(e)),D(!1)}};return(()=>{var e=p(g),t=e.firstChild,[r,h]=c(t.nextSibling),C=r.nextSibling,T=C.firstChild,D=T.nextSibling,k=D.firstChild,ie=k.firstChild,[A,j]=c(ie.nextSibling),M=A.nextSibling,N=k.nextSibling,P=N.firstChild,[F,ae]=c(P.nextSibling),I=F.nextSibling,L=N.nextSibling,oe=L.firstChild,[R,z]=c(oe.nextSibling),B=R.nextSibling,V=B.nextSibling,H=L.nextSibling,U=H.firstChild,[W,G]=c(U.nextSibling),K=W.nextSibling,q=K.firstChild,se=q.nextSibling,[ce,le]=c(se.nextSibling),J=D.nextSibling,ue=J.firstChild,[Y,de]=c(ue.nextSibling),fe=Y.nextSibling.nextSibling,[X,pe]=c(fe.nextSibling),me=X.nextSibling.nextSibling,[Z,he]=c(me.nextSibling),ge=Z.nextSibling.nextSibling,[Q,_e]=c(ge.nextSibling);Q.nextSibling;var $=J.nextSibling.firstChild,ve=$.nextSibling;return d(e,a(i,{get when(){return w()},get children(){var e=p(ee);return d(e,w),e}}),r,h),C.addEventListener(`submit`,O),d(T,()=>u(`users.new`)),d(k,()=>u(`users.detail.fields.name`),A,j),M.$$input=e=>_(e.currentTarget.value),d(N,()=>u(`users.detail.fields.email`),F,ae),I.$$input=e=>ne(e.currentTarget.value),d(L,()=>u(`users.detail.fields.password`),R,z),d(B,()=>u(`users.detail.passwordPrompt`,{email:``})),V.$$input=e=>re(e.currentTarget.value),d(H,()=>u(`users.detail.fields.role`),W,G),K.addEventListener(`change`,e=>x(e.currentTarget.value)),d(q,()=>u(`users.detail.rolePlaceholder`)),d(K,a(s,{get each(){return S()},children:e=>(()=>{var t=p(te),r=t.firstChild,[i,a]=c(r.nextSibling),s=i.nextSibling.nextSibling,[l,u]=c(s.nextSibling);return l.nextSibling,d(t,()=>e.name,i,a),d(t,()=>e.slug,l,u),n(()=>o(t,`value`,e.id)),t})()}),ce,le),d(J,()=>u(`common.save`),Y,de),d(J,()=>u(`users.new`).toLowerCase(),X,pe),d(J,()=>u(`users.detail.fields.role`),Z,he),d(J,()=>u(`users.toolbar.newBtn`).toLowerCase(),Q,_e),d($,(()=>{var e=m(()=>!!E());return()=>e()?u(`common.loading`):u(`common.create`)})()),d(ve,()=>u(`common.back`)),n(()=>o($,`disabled`,E())),n(()=>o(M,`value`,f())),n(()=>o(I,`value`,v())),n(()=>o(V,`value`,y())),n(()=>o(K,`value`,b())),l(),e})()}u([`input`]);export{_ as UserCreateForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./i18n.D0KNEGgP.js";import{C as t,S as n,T as r,_ as i,b as a,d as o,g as s,i as c,l,n as u,o as d,p as f,r as p}from"./web.D_vCtCLj.js";import{t as m}from"./api.CDW61rqX.js";import{a as h,i as g,n as _,o as v,t as y}from"./src.DyLYQxi2.js";var b=f(`<div class="notice notice--error">`),x=f(`<div class=notice>`),S=f(`<table class=users-table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),C=f(`<div class=users-manager><!$><!/><!$><!/><div class=toolbar><!$><!/><!$><!/><a class="btn btn-primary"href=/users/new></a><!$><!/></div><!$><!/><!$><!/><!$><!/>`),w=f(`<p class=muted>`),T=f(`<tr><td></td><td class=muted></td><td></td><td><span class=status-dot></span><!$><!/></td><td class=muted></td><td class=users-table__actions><!$><!/><!$><!/>`),E=f(`<span class=muted>`),D=f(`<div class="card user-details"><h3></h3><div class=form-grid><label><!$><!/><input class=input></label><label><!$><!/><input class=input type=email></label><label><!$><!/><select class=input><option value=ACTIVE></option><option value=INACTIVE></option></select></label><label><!$><!/><select class=input><option value></option><!$><!/></select></label></div><p class=muted></p><div class=media-details__actions><!$><!/><!$><!/><!$><!/>`),O=f(`<option><!$><!/> (<!$><!/>)`);function k(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString(`pt-BR`)}function A(){let{t:u}=e(),[f,A]=t([]),[j,M]=t([]),[N,P]=t(0),[F,I]=t(1),[L,R]=t(``),[z,B]=t(``),[V,H]=t(``),[U,W]=t(``),[G,K]=t(null),[q,J]=t(!1),Y=async()=>{try{let e=await m.listUsers({page:F(),limit:20,search:L()||void 0,status:z()||void 0});A(e.data??[]),P(e.total??0)}catch(e){H(e instanceof Error?e.message:String(e))}};r(async()=>{await Y();try{M(await m.listRoles())}catch{}});let X=async()=>{I(1),await Y()},ee=async(e,t)=>{if(t){J(!0),H(``);try{let n=await m.assignRole(e.id,t);K({...e,roles:n.roles}),W(u(`users.detail.toasts.roleUpdated`,{name:e.name})),await Y()}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}}},te=async e=>{let t=prompt(u(`users.detail.passwordPrompt`,{email:e.email}));if(t){if(t.length<8){H(u(`users.detail.passwordError`));return}J(!0),H(``);try{await m.setUserPassword(e.id,t),W(u(`users.detail.toasts.passwordChanged`,{name:e.name}))}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}}},ne=async e=>{J(!0),H(``);try{await m.updateUser(e.id,{name:e.name,email:e.email,status:e.status}),W(u(`users.detail.toasts.saved`,{name:e.name})),K(null),await Y()}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}},re=async e=>{if(confirm(u(`users.detail.confirmDelete`,{email:e.email}))){J(!0),H(``);try{await m.deleteUser(e.id),G()?.id===e.id&&K(null),W(u(`users.detail.toasts.deleted`,{name:e.name})),await Y()}catch(e){H(e instanceof Error?e.message:String(e))}finally{J(!1)}}},ie=e=>j().find(t=>t.slug===e.roles[0]);return(()=>{var e=p(C),t=e.firstChild,[r,m]=c(t.nextSibling),A=r.nextSibling,[M,P]=c(A.nextSibling),H=M.nextSibling,W=H.firstChild,[J,Z]=c(W.nextSibling),ae=J.nextSibling,[Q,oe]=c(ae.nextSibling),$=Q.nextSibling,se=$.nextSibling,[ce,le]=c(se.nextSibling),ue=H.nextSibling,[de,fe]=c(ue.nextSibling),pe=de.nextSibling,[me,he]=c(pe.nextSibling),ge=me.nextSibling,[_e,ve]=c(ge.nextSibling);return d(e,a(i,{get when(){return V()},get children(){var e=p(b);return d(e,V),e}}),r,m),d(e,a(i,{get when(){return U()},get children(){var e=p(x);return d(e,U),e}}),M,P),d(H,a(g,{name:`user-search`,get placeholder(){return u(`users.toolbar.search`)},get value(){return L()},onInput:e=>{R(e),X()}}),J,Z),d(H,a(v,{name:`user-status`,get placeholder(){return u(`users.toolbar.allStatus`)},get value(){return z()},get options(){return[{value:`ACTIVE`,label:u(`users.toolbar.active`)},{value:`INACTIVE`,label:u(`users.toolbar.inactive`)}]},onChange:e=>{B(e),X()}}),Q,oe),d($,()=>u(`users.toolbar.newBtn`)),d(H,a(_,{variant:`secondary`,onClick:()=>void X(),get children(){return u(`users.toolbar.searchBtn`)}}),ce,le),d(e,a(i,{get when(){return f().length>0},get fallback(){return(()=>{var e=p(w);return d(e,()=>u(`users.empty`)),e})()},get children(){var e=p(S),t=e.firstChild,r=t.firstChild.firstChild,o=r.nextSibling,l=o.nextSibling,m=l.nextSibling,h=m.nextSibling,g=t.nextSibling;return d(r,()=>u(`users.table.name`)),d(o,()=>u(`users.table.email`)),d(l,()=>u(`users.table.role`)),d(m,()=>u(`users.table.status`)),d(h,()=>u(`users.table.lastAccess`)),d(g,a(s,{get each(){return f()},children:e=>(()=>{var t=p(T),r=t.firstChild,o=r.nextSibling,s=o.nextSibling,l=s.nextSibling,f=l.firstChild,m=f.nextSibling,[h,g]=c(m.nextSibling),v=l.nextSibling,b=v.nextSibling,x=b.firstChild,[S,C]=c(x.nextSibling),w=S.nextSibling,[D,O]=c(w.nextSibling);return d(r,()=>e.name),d(o,()=>e.email),d(s,a(i,{get when(){return e.roles.length>0},get fallback(){return(()=>{var e=p(E);return d(e,()=>u(`users.noRole`)),e})()},get children(){return a(y,{get children(){return e.roles.join(`, `)}})}})),d(l,()=>u(`common.status.`+e.status.toLowerCase()),h,g),d(v,()=>k(e.last_login_at)),d(b,a(_,{variant:`secondary`,size:`sm`,onClick:()=>K(e),get children(){return u(`users.table.actions.manage`)}}),S,C),d(b,a(_,{variant:`danger`,size:`sm`,onClick:()=>void re(e),get children(){return u(`users.table.actions.delete`)}}),D,O),n(n=>{var r=G()?.id===e.id,i=e.status===`ACTIVE`;return r!==n.e&&t.classList.toggle(`users-table__row--selected`,n.e=r),i!==n.t&&f.classList.toggle(`status-dot--active`,n.t=i),n},{e:void 0,t:void 0}),t})()})),e}}),de,fe),d(e,a(h,{get page(){return F()},limit:20,get total(){return N()},onPageChange:e=>{I(e),Y()}}),me,he),d(e,a(i,{get when(){return G()},children:e=>(()=>{var t=p(D),r=t.firstChild,i=r.nextSibling,f=i.firstChild,m=f.firstChild,[h,g]=c(m.nextSibling),v=h.nextSibling,y=f.nextSibling,b=y.firstChild,[x,S]=c(b.nextSibling),C=x.nextSibling,w=y.nextSibling,T=w.firstChild,[E,A]=c(T.nextSibling),M=E.nextSibling,N=M.firstChild,P=N.nextSibling,F=w.nextSibling,I=F.firstChild,[L,R]=c(I.nextSibling),z=L.nextSibling,B=z.firstChild,V=B.nextSibling,[H,U]=c(V.nextSibling),W=i.nextSibling,G=W.nextSibling,J=G.firstChild,[Y,X]=c(J.nextSibling),re=Y.nextSibling,[Z,ae]=c(re.nextSibling),Q=Z.nextSibling,[oe,$]=c(Q.nextSibling);return d(r,()=>u(`users.detail.title`)),d(f,()=>u(`users.detail.fields.name`),h,g),v.$$input=t=>K({...e(),name:t.currentTarget.value}),d(y,()=>u(`users.detail.fields.email`),x,S),C.$$input=t=>K({...e(),email:t.currentTarget.value}),d(w,()=>u(`users.detail.fields.status`),E,A),M.addEventListener(`change`,t=>K({...e(),status:t.currentTarget.value})),d(N,()=>u(`users.detail.statusOptions.active`)),d(P,()=>u(`users.detail.statusOptions.inactive`)),d(F,()=>u(`users.detail.fields.role`),L,R),z.addEventListener(`change`,t=>void ee(e(),t.currentTarget.value)),d(B,()=>u(`users.detail.rolePlaceholder`)),d(z,a(s,{get each(){return j()},children:e=>(()=>{var t=p(O),r=t.firstChild,[i,a]=c(r.nextSibling),s=i.nextSibling.nextSibling,[l,u]=c(s.nextSibling);return l.nextSibling,d(t,()=>e.name,i,a),d(t,()=>e.slug,l,u),n(()=>o(t,`value`,e.id)),t})()}),H,U),d(W,()=>u(`users.detail.meta`,{created:k(e().created_at),lastAccess:k(e().last_login_at)})),d(G,a(_,{variant:`primary`,get disabled(){return q()},get loading(){return q()},onClick:()=>void ne(e()),get children(){return u(`users.detail.actions.save`)}}),Y,X),d(G,a(_,{variant:`secondary`,get disabled(){return q()},onClick:()=>void te(e()),get children(){return u(`users.detail.actions.resetPassword`)}}),Z,ae),d(G,a(_,{variant:`secondary`,onClick:()=>K(null),get children(){return u(`users.detail.actions.close`)}}),oe,$),n(()=>o(z,`disabled`,q())),n(()=>o(v,`value`,e().name)),n(()=>o(C,`value`,e().email)),n(()=>o(M,`value`,e().status)),n(()=>o(z,`value`,ie(e())?.id??``)),l(),t})()}),_e,ve),e})()}u([`input`]);export{A as UsersManager};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=new class{baseUrl;csrfToken=null;isRefreshing=!1;constructor(e=`http://localhost:3000`){this.baseUrl=e}async init(){try{await fetch(`${this.baseUrl}/api/v1/auth/me`,{credentials:`include`})}catch{}}async isLoggedIn(){try{return(await fetch(`${this.baseUrl}/api/v1/auth/me`,{credentials:`include`})).ok}catch{return!1}}async getTenantId(){try{let e=await fetch(`${this.baseUrl}/api/v1/auth/me`,{credentials:`include`});return e.ok?(await e.json()).tenantId??null:null}catch{return null}}async getUserLocale(){try{let e=await fetch(`${this.baseUrl}/api/v1/users/me/locale`,{credentials:`include`});return e.ok?(await e.json()).locale??`pt-BR`:`pt-BR`}catch{return`pt-BR`}}async setUserLocale(e){await this.request(`PUT`,`/api/v1/users/me/locale`,{locale:e})}async getMe(){return this.request(`GET`,`/api/v1/auth/me`)}async getAuditLogs(e=8){return this.request(`GET`,`/api/v1/audit-logs?limit=${e}`)}async login(e){return await this.request(`POST`,`/api/v1/auth/login`,e)}async logout(){await this.request(`POST`,`/api/v1/auth/logout`,{}),this.csrfToken=null}async refreshTokens(){if(!this.isRefreshing){this.isRefreshing=!0;try{await this.request(`POST`,`/api/v1/auth/refresh`,{})}finally{this.isRefreshing=!1}}}async request(e,t,n,r){let i=`${this.baseUrl}${t}`,a={"Content-Type":`application/json`,...r};if(![`GET`,`HEAD`,`OPTIONS`].includes(e.toUpperCase())){let e=this.getCsrfToken();e&&(a[`x-csrf-token`]=e)}let o=await fetch(i,{method:e,headers:a,credentials:`include`,body:n?JSON.stringify(n):void 0});if(o.status===401&&!t.includes(`/auth/refresh`)&&!t.includes(`/auth/logout`)&&(await this.refreshTokens(),o=await fetch(i,{method:e,headers:a,credentials:`include`,body:n?JSON.stringify(n):void 0})),!o.ok){let e=await o.json().catch(()=>({error:`Request failed`}));throw Error(e.error??`Request failed: ${o.status}`)}let s=o.headers.get(`set-cookie`);if(s){let e=s.match(/csrf_token=([^;]+)/);e?.[1]&&(this.csrfToken=e[1])}return o.json()}getCsrfToken(){if(this.csrfToken)return this.csrfToken;if(typeof document<`u`){let e=document.cookie.match(/(?:^|;\s*)csrf_token=([^;]+)/);if(e?.[1])return e[1]}return null}async getContent(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.type&&t.set(`type`,e.type),e?.status&&t.set(`status`,e.status),e?.search&&t.set(`search`,e.search),this.request(`GET`,`/api/v1/content?${t.toString()}`)}async getContentById(e){return this.request(`GET`,`/api/v1/content/${e}`)}async createContent(e){return this.request(`POST`,`/api/v1/content`,e)}async updateContent(e,t){return this.request(`PUT`,`/api/v1/content/${e}`,t)}async deleteContent(e){await this.request(`DELETE`,`/api/v1/content/${e}`)}async publishContent(e){let t=await this.request(`POST`,`/api/v1/content/${e}/publish`);return`content`in t?t.content:t}async unpublishContent(e){let t=await this.request(`POST`,`/api/v1/content/${e}/unpublish`);return`content`in t?t.content:t}async publishToggle(e,t){return t?this.unpublishContent(e):this.publishContent(e)}async getContentTypes(){return this.request(`GET`,`/api/v1/content-types`)}async createContentType(e){return this.request(`POST`,`/api/v1/content-types`,e)}async updateContentType(e,t){return this.request(`PUT`,`/api/v1/content-types/${e}`,t)}async deleteContentType(e){await this.request(`DELETE`,`/api/v1/content-types/${e}`)}async getTaxonomies(){return this.request(`GET`,`/api/v1/taxonomies`)}async createTaxonomy(e){return this.request(`POST`,`/api/v1/taxonomies`,e)}async attachTaxonomy(e,t){await this.request(`POST`,`/api/v1/taxonomies/${e}/attach`,{contentType:t})}async detachTaxonomy(e,t){await this.request(`POST`,`/api/v1/taxonomies/${e}/detach`,{contentType:t})}async deleteTaxonomy(e){await this.request(`DELETE`,`/api/v1/taxonomies/${e}`)}async getTaxonomyTerms(e){return this.request(`GET`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms`)}async createTaxonomyTerm(e,t){return this.request(`POST`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms`,t)}async updateTaxonomyTerm(e,t,n){return this.request(`PUT`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms/${t}`,n)}async deleteTaxonomyTerm(e,t){await this.request(`DELETE`,`/api/v1/taxonomies/${encodeURIComponent(e)}/terms/${t}`)}async getCategories(){return this.request(`GET`,`/api/v1/categories`)}async createCategory(e){return this.request(`POST`,`/api/v1/categories`,e)}async updateCategory(e,t){return this.request(`PUT`,`/api/v1/categories/${e}`,t)}async deleteCategory(e){await this.request(`DELETE`,`/api/v1/categories/${e}`)}async getTags(){return this.request(`GET`,`/api/v1/tags`)}async createTag(e){return this.request(`POST`,`/api/v1/tags`,e)}async updateTag(e,t){return this.request(`PUT`,`/api/v1/tags/${e}`,t)}async deleteTag(e){await this.request(`DELETE`,`/api/v1/tags/${e}`)}async getMenus(){return this.request(`GET`,`/api/v1/menus`)}async createMenu(e){return this.request(`POST`,`/api/v1/menus`,e)}async updateMenu(e,t){return this.request(`PUT`,`/api/v1/menus/${e}`,t)}async deleteMenu(e){await this.request(`DELETE`,`/api/v1/menus/${e}`)}async getFieldGroups(e){if(e?.type){let t=new URLSearchParams({type:e.type});for(let[n,r]of Object.entries(e))n!==`type`&&r&&t.set(n,r);return this.request(`GET`,`/api/v1/field-groups?${t.toString()}`)}return this.request(`GET`,`/api/v1/field-groups`)}async getFieldGroup(e){return this.request(`GET`,`/api/v1/field-groups/${e}`)}async createFieldGroup(e){return this.request(`POST`,`/api/v1/field-groups`,e)}async updateFieldGroup(e,t){return this.request(`PUT`,`/api/v1/field-groups/${e}`,t)}async deleteFieldGroup(e){await this.request(`DELETE`,`/api/v1/field-groups/${e}`)}async getFieldTypes(e){let t=e?`?category=${encodeURIComponent(e)}`:``;return this.request(`GET`,`/api/v1/field-types${t}`)}async getWebhooks(){return this.request(`GET`,`/api/v1/webhooks`)}async createWebhook(e){return this.request(`POST`,`/api/v1/webhooks`,e)}async updateWebhook(e,t){return this.request(`PUT`,`/api/v1/webhooks/${e}`,t)}async deleteWebhook(e){await this.request(`DELETE`,`/api/v1/webhooks/${e}`)}async getBuilds(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.status&&t.set(`status`,e.status),this.request(`GET`,`/api/v1/builds?${t.toString()}`)}async createBuild(e){return this.request(`POST`,`/api/v1/builds`,e)}async getDeployments(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.status&&t.set(`status`,e.status),this.request(`GET`,`/api/v1/deployments?${t.toString()}`)}async createDeployment(e){return this.request(`POST`,`/api/v1/deployments`,e)}async rollbackDeployment(e,t){return this.request(`POST`,`/api/v1/deployments/${e}/rollback`,{rollbackToId:t})}async getEvents(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.type&&t.set(`type`,e.type),this.request(`GET`,`/api/v1/events?${t.toString()}`)}async listMedia(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.mimeType&&t.set(`mimeType`,e.mimeType),e?.search&&t.set(`search`,e.search),this.request(`GET`,`/api/v1/media?${t.toString()}`)}async getMedia(e){return this.request(`GET`,`/api/v1/media/${e}`)}async uploadMedia(e,t){let n=new FormData;n.append(`file`,e),t?.alt&&n.append(`alt`,t.alt),t?.caption&&n.append(`caption`,t.caption);let r=`${this.baseUrl}/api/v1/media/upload`,i={},a=this.getCsrfToken();a&&(i[`x-csrf-token`]=a);let o=await fetch(r,{method:`POST`,headers:i,credentials:`include`,body:n});if(!o.ok){let e=await o.json().catch(()=>({error:`Upload failed: ${o.status}`}));throw Error(e.error??`Upload failed: ${o.status}`)}return o.json()}async updateMedia(e,t){return this.request(`PUT`,`/api/v1/media/${e}`,t)}async deleteMedia(e){await this.request(`DELETE`,`/api/v1/media/${e}`)}async listUsers(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.search&&t.set(`search`,e.search),e?.status&&t.set(`status`,e.status),this.request(`GET`,`/api/v1/users?${t.toString()}`)}async getUser(e){return this.request(`GET`,`/api/v1/users/${e}`)}async createUser(e){return this.request(`POST`,`/api/v1/users`,e)}async updateUser(e,t){return this.request(`PUT`,`/api/v1/users/${e}`,t)}async deleteUser(e){await this.request(`DELETE`,`/api/v1/users/${e}`)}async setUserPassword(e,t){await this.request(`PUT`,`/api/v1/users/${e}/password`,{password:t})}async assignRole(e,t){return this.request(`POST`,`/api/v1/users/${e}/roles`,{roleId:t})}async removeRole(e,t){return this.request(`DELETE`,`/api/v1/users/${e}/roles/${t}`)}async listRoles(){return this.request(`GET`,`/api/v1/roles`)}async createRole(e){return this.request(`POST`,`/api/v1/roles`,e)}async updateRole(e,t){return this.request(`PUT`,`/api/v1/roles/${e}`,t)}async deleteRole(e){await this.request(`DELETE`,`/api/v1/roles/${e}`)}async listTenants(e){let t=new URLSearchParams;return e?.page&&t.set(`page`,String(e.page)),e?.limit&&t.set(`limit`,String(e.limit)),e?.search&&t.set(`search`,e.search),this.request(`GET`,`/api/v1/tenants?${t.toString()}`)}async createTenant(e){return this.request(`POST`,`/api/v1/tenants`,e)}async updateTenant(e,t){return this.request(`PUT`,`/api/v1/tenants/${e}`,t)}async deleteTenant(e){await this.request(`DELETE`,`/api/v1/tenants/${e}`)}async getSettings(e){let t=e?`?group=${encodeURIComponent(e)}`:``;return this.request(`GET`,`/api/v1/settings${t}`)}async updateSettings(e){await this.request(`PUT`,`/api/v1/settings`,e)}async healthCheck(){return this.request(`GET`,`/health`)}async getThemes(){return(await this.request(`GET`,`/api/v1/themes`)).map(e=>({id:String(e.id??``),name:String(e.name??``),version:e.version?String(e.version):void 0,status:String(e.status??`INSTALLED`),manifest:e.manifest??null}))}async activateTheme(e){return this.request(`POST`,`/api/v1/themes/${e}/activate`)}async deactivateTheme(e){return this.request(`POST`,`/api/v1/themes/${e}/deactivate`)}async installTheme(e){return this.request(`POST`,`/api/v1/themes/install`,e)}async uninstallTheme(e){await this.request(`DELETE`,`/api/v1/themes/${e}`)}async getPlugins(){return(await this.request(`GET`,`/api/v1/plugins`)).map(e=>({id:String(e.id??``),name:String(e.name??``),version:String(e.version??``),status:String(e.status??`INSTALLED`),manifest:e.manifest??null}))}async activatePlugin(e){return this.request(`POST`,`/api/v1/plugins/${e}/activate`)}async deactivatePlugin(e){return this.request(`POST`,`/api/v1/plugins/${e}/deactivate`)}async installPlugin(e){return this.request(`POST`,`/api/v1/plugins/install`,e)}async uninstallPlugin(e){await this.request(`DELETE`,`/api/v1/plugins/${e}`)}};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={appName:`OkCMS`,admin:`الإدارة`,nav:{dashboard:`لوحة التحكم`,content:`المحتوى`,media:`الوسائط`,users:`المستخدمون`,settings:`الإعدادات`,plugins:`الإضافات`,themes:`القوالب`},actions:{logout:`تسجيل الخروج`,newPost:`منشور جديد`,uploadMedia:`رفع وسائط`,addUser:`إضافة مستخدم`,openSettings:`الإعدادات`}},t={title:`لوحة التحكم`,stats:{totalContent:`إجمالي المحتوى`,published:`منشور`,drafts:`مسودات`,mediaFiles:`ملفات الوسائط`,users:`المستخدمون`},recent:{title:`المحتوى الأخير`,viewAll:`عرض الكل`,empty:`لا يوجد محتوى بعد — أنشئ أول محتوى!`,columns:{title:`العنوان`,type:`النوع`,status:`الحالة`,updated:`تم التحديث`}},widgets:{atGlance:`نظرة عامة`,posts:`المقالات`,postsDesc:`منشور / مسودات / سلة`,pages:`الصفحات`,pagesDesc:`منشور / مسودات / سلة`,media:`الوسائط`,mediaDesc:`الملفات في المكتبة`,users:`المستخدمون`,usersDesc:`الإجمالي / النشطون / غير النشطين`,version:`الإصدار`,storage:`التخزين`,quickDraft:{title:`مسودة سريعة`,heading:`العنوان`,headingPlaceholder:`أعنوان مسودتك`,content:`المحتوى`,contentPlaceholder:`بمَ تفكر؟`,save:`حفظ المسودة`,yourDrafts:`مسوداتك`,noDrafts:`لا توجد مسودات بعد.`},activity:{title:`النشاط`,empty:`لا نشاط بعد.`}}},n={list:{title:`المحتوى`,description:`ابحث، وصّف، وعدّل وانشر محتواك.`,columns:{title:`العنوان`,type:`النوع`,status:`الحالة`,updated:`تم التحديث`},actions:{edit:`تعديل`,publish:`نشر`,unpublish:`إلغاء النشر`,delete:`حذف`},filters:{search:`البحث في المحتوى…`,allTypes:`جميع الأنواع`,allStatus:`جميع الحالات`},buttons:{new:`+ محتوى جديد`,search:`بحث`},empty:`لم يتم العثور على محتوى.`,statuses:{draft:`مسودة`,published:`منشور`,archived:`مؤرشف`},confirmDelete:`حذف "{title}"؟`,toasts:{published:`تم النشر ✓`,unpublished:`تم إلغاء النشر ✓`}},editor:{type:`النوع`,title:`العنوان`,slug:`المعرّف`,excerpt:`المقتطف`,featuredImage:`الصورة الرئيسية (معرف الوسائط)`,status:`الحالة`,statusOptions:{draft:`مسودة`,published:`منشور`,archived:`مؤرشف`},layout:`التخطيط`,layoutAuto:`تلقائي (تسلسل المظهر)`,customFields:`الحقول المخصصة`,inspectTypes:`فحص الأنواع المتاحة`,save:`حفظ`,saved:`تم حفظ المحتوى بنجاح.`}},r={title:`مكتبة الوسائط`,description:"ارفع الصور والفيديوهات والوثائق. الملفات في `uploads/` وتخدم علناً.",upload:{dropzone:`اسحب الملفات إلى هنا أو`,select:`اختر الملفات`,uploading:`جاري الرفع…`,hint:`الصور، الفيديو، الصوت والوثائق · حتى 25MB للملف`},toolbar:{search:`البحث بالاسم أو النص البديل…`,allTypes:`كل الأنواع`,searchBtn:`بحث`},mimeTypes:{png:`PNG`,jpeg:`JPEG`,gif:`GIF`,webp:`WebP`,svg:`SVG`,pdf:`PDF`,mp4:`MP4`,mp3:`MP3`},empty:`لا توجد ملفات بعد. ارفع أول ملف!`,details:{title:`التفاصيل`,file:`الملف`,type:`النوع`,size:`الحجم`,url:`الرابط`,copy:`نسخ`,alt:`النص البديل`,caption:`التعليق`,save:`حفظ التفاصيل`,delete:`حذف`,close:`إغلاق`,confirmDelete:`حذف "{filename}"؟ سيتم حذف الملف من القرص.`,saved:`تم حفظ التفاصيل ✓`,copied:`تم نسخ الرابط ✓`,copyError:`فشل نسخ الرابط`},toasts:{uploaded:`تم رفع {count} ملف(ات) ✓`}},i={title:`المستخدمون`,description:`إدارة الحسابات والأدوار والوصول للمشروع.`,new:`مستخدم جديد`,toolbar:{search:`بحث بالاسم أو البريد…`,allStatus:`كل الحالات`,active:`نشط`,inactive:`غير نشط`,newBtn:`+ مستخدم جديد`,searchBtn:`بحث`},table:{name:`الاسم`,email:`البريد`,role:`الدور`,status:`الحالة`,lastAccess:`آخر دخول`,actions:{manage:`إدارة`,delete:`حذف`}},empty:`لم يتم العثور على مستخدمين.`,noRole:`بدون دور`,detail:{title:`إدارة المستخدم`,fields:{name:`الاسم`,email:`البريد`,status:`الحالة`,role:`الدور`,password:`كلمة المرور`},statusOptions:{active:`نشط`,inactive:`غير نشط`},rolePlaceholder:`— لا دور —`,meta:`أنشئ في {created} · آخر دخول {lastAccess}`,actions:{save:`حفظ`,resetPassword:`إعادة تعيين كلمة المرور`,close:`إغلاق`},passwordPrompt:`كلمة مرور جديدة لـ {email} (8 أحرف على الأقل):`,passwordError:`كلمة المرور يجب أن تكون 8 أحرف على الأقل`,toasts:{roleUpdated:`تم تحديث دور {name} ✓`,passwordChanged:`تم تغيير كلمة مرور {name} ✓`,saved:`تم حفظ المستخدم {name} ✓`,deleted:`تم حذف المستخدم {name} ✓`},confirmDelete:`حذف المستخدم {email}؟`}},a={general:{title:`عام`,description:`معلومات أساسية تظهر على الموقع.`,back:`← كل الإعدادات`,fields:{siteTitle:`عنوان الموقع`,siteTitlePlaceholder:`موقعي`,siteDescription:`الوصف`,siteDescriptionPlaceholder:`موقع جديد بـ OkCMS`,language:`اللغة`,timezone:`المنطقة الزمنية`,timezonePlaceholder:`Asia/Riyadh`},saved:`تم حفظ الإعدادات ✓`,loading:`جاري التحميل…`,save:`حفظ`},postTypes:{title:`أنواع المحتوى`,description:`أنشئ أنواع محتوى مخصصة (CPT) بالإضافة للمقالات والصفحات.`,form:{title:`إنشاء نوع محتوى`,slug:`المعرّف (مفرد، مثال: portfolio)`,slugHint:`حروف صغيرة وأرقام وشرطة سفلية فقط`,singular:`الاسم المفرد`,plural:`الاسم الجمع`,supports:`يدعم`,supportsOptions:{title:`العنوان`,editor:`المحرر`,thumbnail:`الصورة البارزة`,excerpt:`المقتطف`,revisions:`التنقيحات`},hasArchive:`له أرشيف عام (/slug)`,create:`إنشاء`},table:{slug:`المعرّف`,singular:`مفرد`,plural:`جمع`,source:`المصدر`,supports:`يدعم`,archive:`أرشيف`,actions:{remove:`إزالة`}},sources:{admin:`الإدارة`,core:`النواة`}},taxonomies:{title:`التصنيفات`,description:`أنشئ تصنيفات مخصصة واربطها بأنواع المحتوى.`,form:{title:`إنشاء تصنيف`,name:`الاسم (مثال: النوع)`,slug:`المعرّف (اختياري، يُولّد من الاسم)`,slugHint:`حروف صغيرة وأرقام وشرطة سفلية فقط`,hierarchical:`هرمي (يسمح بمصطلحات أب/ابن)`,attachTo:`اربط بأنواع المحتوى`,create:`إنشاء`},table:{taxonomy:`التصنيف`,hierarchical:`هرمي`,attachedTypes:`أنواع المحتوى المرتبطة`,actions:{remove:`إزالة`}}}},o={title:`تسجيل الدخول`,subtitle:`سجّل دخولك إلى حسابك`,email:`البريد الإلكتروني`,password:`كلمة المرور`,submit:`دخول`,failed:`البريد الإلكتروني أو كلمة المرور غير صالحة`},s={save:`حفظ`,cancel:`إلغاء`,delete:`حذف`,edit:`تعديل`,close:`إغلاق`,confirm:`تأكيد`,loading:`جاري التحميل…`,yes:`نعم`,no:`لا`,search:`بحث`,filter:`تصفية`,create:`إنشاء`,update:`تحديث`,remove:`إزالة`,viewAll:`عرض الكل`,back:`رجوع`,next:`التالي`,previous:`السابق`,page:`صفحة`,of:`من`,items:`عناصر`,item:`عنصر`,empty:`لم يتم العثور على {items}.`,toast:{success:`✓`,error:`خطأ: {message}`},status:{active:`نشط`,inactive:`غير نشط`,draft:`مسودة`,published:`منشور`,archived:`مؤرشف`,locked:`مقفل`},language:`اللغة`},c={justNow:`الآن`,minAgo:`دقيقة مضت`,ago:`مضت`,published:`منشور`,updated:`تم التحديث`,newUser:`مستخدم جديد: {name}`},l={mainMenu:`القائمة الرئيسية`,notifications:`الإشعارات`,notificationsEmpty:`لا يوجد نشاط حديث`,settings:`الإعدادات`,toggleSidebar:`تبديل الشريط الجانبي`,userMenu:`قائمة المستخدم`},u={copyright:`© 2026 OkCMS. جميع الحقوق محفوظة.`,links:`الروابط`,website:`الموقع`,github:`GitHub`,docs:`التوثيق`,community:`المجتمع`,poweredBy:`مدعوم من OkCMS`},d={title:`المساعدة`,label:`المساعدة`,tabs:`مواضيع المساعدة`,topics:{overview:{label:`نظرة عامة`,content:`<h4>مرحبًا بك في لوحة تحكم OkCMS</h4><p>تمنحك هذه اللوحة نظرة عامة على محتوى موقعك ونشاطه.</p><h4>الأدوات المتاحة</h4><ul><li><strong>نظرة عامة:</strong> ملخص للمقالات والصفحات والوسائط والمستخدمين</li><li><strong>مسودة سريعة:</strong> حفظ المسودات بسرعة من لوحة التحكم</li><li><strong>النشاط:</strong> آخر أنشطة الموقع وتحديثاته</li></ul>`},content:{label:`إدارة المحتوى`,content:`<h4>إدارة المحتوى</h4><p>أنشئ وحرر وانشر المحتوى من قسم المحتوى.</p><h4>إجراءات سريعة</h4><ul><li>انقر على "محتوى جديد" لإنشاء مقال أو صفحة جديدة</li><li>استخدم عوامل التصفية للعثور على محتوى محدد</li><li>تتوفر إجراءات جماعية لعناصر متعددة</li></ul>`},media:{label:`مكتبة الوسائط`,content:`<h4>إدارة الوسائط</h4><p>ارفع الصور والفيديو والمستندات وأدرها.</p><h4>نصائح</h4><ul><li>اسحب الملفات وأفلتها للرفع</li><li>أضف نصًا بديلًا لسهولة الوصول</li><li>نظّم بمجلدات (قريبًا)</li></ul>`}}},f={title:`خيارات الشاشة`,label:`خيارات الشاشة`,showOnScreen:`إظهار على الشاشة`},p={layout:e,dashboard:t,content:n,media:r,users:i,settings:a,login:o,common:s,activity:c,adminBar:l,footer:u,helpTabs:d,screenOptions:f};export{c as activity,l as adminBar,s as common,n as content,t as dashboard,p as default,u as footer,d as helpTabs,e as layout,o as login,r as media,f as screenOptions,a as settings,i as users};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,a as t,b as n,c as r,h as i,m as a,v as o,w as s,y as c}from"./web.
|
|
1
|
+
import{C as e,a as t,b as n,c as r,h as i,m as a,v as o,w as s,y as c}from"./web.D_vCtCLj.js";var l=Symbol(`store-raw`),u=Symbol(`store-node`),d=Symbol(`store-has`),f=Symbol(`store-self`);function p(e){let t=e[a];if(!t&&(Object.defineProperty(e,a,{value:t=new Proxy(e,x)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e),i=Object.getPrototypeOf(e),a=i!==null&&typeof e==`object`&&!!e&&!Array.isArray(e)&&i!==Object.prototype;if(a){let e=Object.getOwnPropertyDescriptors(i);n.push(...Object.keys(e)),Object.assign(r,e)}for(let i=0,o=n.length;i<o;i++){let o=n[i];a&&o===`constructor`||r[o].get&&Object.defineProperty(e,o,{configurable:!0,enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function m(e){let t;return typeof e==`object`&&!!e&&(e[a]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function h(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[l])return n;if(!m(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=h(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=h(i,t))!==i&&(e[a]=r))}return e}function g(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function _(t,n,r){if(t[n])return t[n];let[i,a]=e(r,{equals:!1,internal:!0});return i.$=a,t[n]=i}function v(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===a||t===u?n:(delete n.value,delete n.writable,n.get=()=>e[a][t],n)}function y(e){s()&&_(g(e,u),f)()}function b(e){return y(e),Reflect.ownKeys(e)}var x={get(e,t,n){if(t===l)return e;if(t===a)return n;if(t===i)return y(e),n;let r=g(e,u),o=r[t],c=o?o():e[t];if(t===u||t===d||t===`__proto__`)return c;if(!o){let n=Object.getOwnPropertyDescriptor(e,t);s()&&(typeof c!=`function`||Object.prototype.hasOwnProperty.call(e,t))&&!(n&&n.get)&&(c=_(r,t,c)())}return m(c)?p(c):c},has(e,t){return t===l||t===a||t===i||t===u||t===d||t===`__proto__`||(s()&&_(g(e,d),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:b,getOwnPropertyDescriptor:v};function S(e,t,n,r=!1){if(t===`__proto__`||!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[d]&&e[d][t]&&i!==void 0&&e[d][t].$()):(e[t]=n,e[d]&&e[d][t]&&i===void 0&&e[d][t].$());let o=g(e,u),s;if((s=_(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=_(o,`length`,a))&&s.$(e.length)}(s=o[f])&&s.$()}function C(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];w(i)||S(e,i,t[i])}}function w(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function T(e,t){if(typeof t==`function`&&(t=t(e)),t=h(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&S(e,n,r)}S(e,`length`,r)}else C(e,t)}function E(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(a===`string`&&(r===`__proto__`||t.length>1&&w(r)))return;if(Array.isArray(r)){for(let i=0;i<r.length;i++)E(e,[r[i]].concat(t),n);return}if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&E(e,[i].concat(t),n);return}if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)E(e,[r].concat(t),n);return}if(t.length>1){E(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||(r!==void 0||a!=null)&&(a=h(a),r===void 0||m(i)&&m(a)&&!Array.isArray(a)?C(i,a):S(e,r,a))}function D(...[e,t]){let n=h(e||{}),r=Array.isArray(n),i=p(n);function a(...e){c(()=>{r&&e.length===1?T(n,e[0]):E(n,e)})}return[i,a]}var O=Symbol(`store-root`);function k(e){return e===`__proto__`||e===`constructor`||e===`prototype`}function A(e,t,n,r,i){if(k(n))return;let a=t[n];if(e===a)return;let o=Array.isArray(e);if(n!==O&&(!m(e)||!m(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){S(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let t,n,o,s,c,l,u,d;for(o=0,s=Math.min(a.length,e.length);o<s&&(a[o]===e[o]||i&&a[o]&&e[o]&&a[o][i]&&a[o][i]===e[o][i]);o++)A(e[o],a,o,r,i);let f=Array(e.length),p=new Map;for(s=a.length-1,c=e.length-1;s>=o&&c>=o&&(a[s]===e[c]||i&&a[s]&&e[c]&&a[s][i]&&a[s][i]===e[c][i]);s--,c--)f[c]=a[s];if(o>c||o>s){for(n=o;n<=c;n++)S(a,n,e[n]);for(;n<e.length;n++)S(a,n,f[n]),A(e[n],a,n,r,i);a.length>e.length&&S(a,`length`,e.length);return}for(u=Array(c+1),n=c;n>=o;n--)l=e[n],d=i&&l?l[i]:l,t=p.get(d),u[n]=t===void 0?-1:t,p.set(d,n);for(t=o;t<=s;t++)l=a[t],d=i&&l?l[i]:l,n=p.get(d),n!==void 0&&n!==-1&&(f[n]=a[t],n=u[n],p.set(d,n));for(n=o;n<e.length;n++)n in f?(S(a,n,f[n]),A(e[n],a,n,r,i)):S(a,n,e[n])}else for(let t=0,n=e.length;t<n;t++)A(e[t],a,t,r,i);a.length>e.length&&S(a,`length`,e.length);return}let s=Object.keys(e);for(let t=0,n=s.length;t<n;t++)k(s[t])||A(e[s[t]],a,s[t],r,i);let c=Object.keys(a);for(let t=0,n=c.length;t<n;t++)e[c[t]]===void 0&&S(a,c[t],void 0)}function j(e,t={}){let{merge:n,key:r=`id`}=t,i=h(e);return e=>{if(!m(e)||!m(i))return i;let t=A(i,{[O]:e},O,n,r);return t===void 0?e:t}}var M=new WeakMap,N=e=>(i,a,s,{client:c})=>{if(!e.hasAttribute(`ssr`))return;let l=c!==`only`,u,d={};if(Object.keys(s).length>0){if(c!==`only`){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,t=>t===e?NodeFilter.FILTER_SKIP:t.nodeName===`ASTRO-SLOT`?NodeFilter.FILTER_ACCEPT:t.nodeName===`ASTRO-ISLAND`?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP);for(;u=t.nextNode();)d[u.getAttribute(`name`)||`default`]=u}for(let[e,t]of Object.entries(s))d[e]||(d[e]=document.createElement(`astro-slot`),e!=="default"&&d[e].setAttribute(`name`,e),d[e].innerHTML=t)}let{default:f,...p}=d,m=e.dataset.solidRenderId;if(M.has(e))M.get(e)(j({...a,...p,children:f}));else{let[s,c]=D({...a,...p,children:f});M.set(e,c);let u=()=>{let e=()=>n(i,s);return l?n(o,{get children(){return e()}}):e()},d;l?d=t(u,e,{renderId:m}):(e.innerHTML=``,d=r(u,e)),e.addEventListener(`astro:unmount`,()=>d(),{once:!0})}};export{N as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.settings-page[data-astro-cid-2wrpkwch] .page-header[data-astro-cid-2wrpkwch]{margin-bottom:1rem}.custom-fields-toolbar[data-astro-cid-2wrpkwch],.section-heading[data-astro-cid-2wrpkwch],.fields-editor-heading[data-astro-cid-2wrpkwch],.editable-field__topline[data-astro-cid-2wrpkwch],.group-row[data-astro-cid-2wrpkwch],.group-row__actions[data-astro-cid-2wrpkwch],.standard-field-control[data-astro-cid-2wrpkwch],.editor-actions[data-astro-cid-2wrpkwch]{align-items:center;display:flex}.custom-fields-toolbar[data-astro-cid-2wrpkwch],.section-heading[data-astro-cid-2wrpkwch],.fields-editor-heading[data-astro-cid-2wrpkwch],.editable-field__topline[data-astro-cid-2wrpkwch],.group-row[data-astro-cid-2wrpkwch],.editor-actions[data-astro-cid-2wrpkwch]{justify-content:space-between;gap:1rem}.custom-fields-toolbar[data-astro-cid-2wrpkwch]{margin-bottom:1rem}.custom-fields-toolbar[data-astro-cid-2wrpkwch] label[data-astro-cid-2wrpkwch],.field-group-editor[data-astro-cid-2wrpkwch] label[data-astro-cid-2wrpkwch],.field-group-editor[data-astro-cid-2wrpkwch] fieldset[data-astro-cid-2wrpkwch]{flex-direction:column;gap:.35rem;display:flex}.custom-fields-toolbar[data-astro-cid-2wrpkwch] label[data-astro-cid-2wrpkwch]{flex-direction:row;align-items:center;gap:.75rem}.custom-fields-toolbar[data-astro-cid-2wrpkwch] .input[data-astro-cid-2wrpkwch]{min-width:220px}.standard-fields-card[data-astro-cid-2wrpkwch],.field-group-editor[data-astro-cid-2wrpkwch],.groups-card[data-astro-cid-2wrpkwch],.section-heading[data-astro-cid-2wrpkwch]{margin-bottom:1rem}.section-heading[data-astro-cid-2wrpkwch] h3[data-astro-cid-2wrpkwch],.fields-editor-heading[data-astro-cid-2wrpkwch] h4[data-astro-cid-2wrpkwch]{margin:0}.section-heading[data-astro-cid-2wrpkwch] p[data-astro-cid-2wrpkwch]{margin-top:.35rem}.standard-fields-list[data-astro-cid-2wrpkwch],.groups-list[data-astro-cid-2wrpkwch],.editable-fields-list[data-astro-cid-2wrpkwch]{gap:.65rem;display:grid}.standard-field-row[data-astro-cid-2wrpkwch],.group-row[data-astro-cid-2wrpkwch]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-hover);justify-content:space-between;gap:1rem;padding:.75rem}.standard-field-row[data-astro-cid-2wrpkwch]>span[data-astro-cid-2wrpkwch]:first-child,.group-row[data-astro-cid-2wrpkwch]>div[data-astro-cid-2wrpkwch]:first-child{gap:.2rem;display:grid}.standard-field-row[data-astro-cid-2wrpkwch] small[data-astro-cid-2wrpkwch],.group-row[data-astro-cid-2wrpkwch] small[data-astro-cid-2wrpkwch]{color:var(--color-muted);font-size:.75rem}.standard-field-control[data-astro-cid-2wrpkwch]{gap:.65rem}.form-grid[data-astro-cid-2wrpkwch],.field-grid[data-astro-cid-2wrpkwch]{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:1rem;margin-bottom:1rem;display:grid}.checkbox-label[data-astro-cid-2wrpkwch]{align-self:end;align-items:center;flex-direction:row!important}.fields-editor-heading[data-astro-cid-2wrpkwch]{margin:1.25rem 0 .75rem}.editable-field[data-astro-cid-2wrpkwch]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-hover);gap:.85rem;padding:1rem;display:grid}.location-rules-editor[data-astro-cid-2wrpkwch]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface-hover);margin:1.25rem 0;padding:1rem}.location-rule-group[data-astro-cid-2wrpkwch]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-white);gap:.65rem;padding:.75rem;display:grid}.location-rule-row[data-astro-cid-2wrpkwch]{grid-template-columns:minmax(150px,1fr) minmax(110px,.7fr) minmax(180px,1.4fr) auto;align-items:center;gap:.65rem;display:grid}.rule-connector[data-astro-cid-2wrpkwch]{color:var(--color-muted);text-align:center;font-size:.75rem;font-weight:700}.rule-add[data-astro-cid-2wrpkwch]{justify-self:start}.editable-field[data-astro-cid-2wrpkwch].is-dragging{opacity:.55;border-color:var(--color-primary)}.editable-field__topline[data-astro-cid-2wrpkwch]{justify-content:flex-start}.editable-field__topline[data-astro-cid-2wrpkwch] .btn-danger[data-astro-cid-2wrpkwch]{margin-left:auto}.drag-handle[data-astro-cid-2wrpkwch]{color:var(--color-muted);cursor:grab;user-select:none;font-size:1.4rem}.field-type-picker[data-astro-cid-2wrpkwch]{position:relative}.field-type-picker__trigger{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-white);width:100%;min-height:2.35rem;color:var(--color-text);text-align:left;padding:.45rem .65rem}.field-type-picker__panel{z-index:20;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-white);width:min(360px,90vw);max-height:320px;box-shadow:var(--shadow-lg);padding:.5rem;position:absolute;overflow:auto}.field-type-picker__search{border:1px solid var(--color-border);border-radius:var(--radius-sm);width:100%;padding:.45rem}.field-type-picker__group-label{color:var(--color-muted);padding:.65rem .4rem .25rem;font-size:.75rem;font-weight:600}.field-type-picker__option{text-align:left;background:0 0;border:0;gap:.5rem;width:100%;padding:.45rem;display:flex}.field-type-picker__option:hover,.field-type-picker__option.is-selected{background:var(--color-primary-soft)}.editor-actions[data-astro-cid-2wrpkwch]{margin-top:1rem}@media (width<=720px){.custom-fields-toolbar[data-astro-cid-2wrpkwch],.group-row[data-astro-cid-2wrpkwch],.custom-fields-toolbar[data-astro-cid-2wrpkwch] label[data-astro-cid-2wrpkwch]{flex-direction:column;align-items:stretch}.custom-fields-toolbar[data-astro-cid-2wrpkwch] .input[data-astro-cid-2wrpkwch]{min-width:0}.group-row__actions[data-astro-cid-2wrpkwch]{flex-wrap:wrap}.location-rule-row[data-astro-cid-2wrpkwch]{grid-template-columns:1fr}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={appName:`OkCMS`,admin:`Admin`,nav:{dashboard:`Panel`,content:`Contenido`,media:`Medios`,users:`Usuarios`,settings:`Ajustes`,plugins:`Plugins`,themes:`Temas`},actions:{logout:`Salir`,newPost:`Nueva Entrada`,uploadMedia:`Subir Medio`,addUser:`Añadir Usuario`,openSettings:`Ajustes`}},t={title:`Panel`,stats:{totalContent:`Total de Contenido`,published:`Publicados`,drafts:`Borradores`,mediaFiles:`Archivos de Medios`,users:`Usuarios`},recent:{title:`Contenido Reciente`,viewAll:`Ver Todo`,empty:`Aún no hay contenido — ¡crea el primero!`,columns:{title:`Título`,type:`Tipo`,status:`Estado`,updated:`Actualizado`}},widgets:{atGlance:`De un vistazo`,posts:`Entradas`,postsDesc:`Publicados / Borradores / Papelera`,pages:`Páginas`,pagesDesc:`Publicadas / Borradores / Papelera`,media:`Medios`,mediaDesc:`Archivos en la biblioteca`,users:`Usuarios`,usersDesc:`Total / Activos / Inactivos`,version:`Versión`,storage:`Almacenamiento`,quickDraft:{title:`Borrador rápido`,heading:`Título`,headingPlaceholder:`Dale un título a tu borrador`,content:`Contenido`,contentPlaceholder:`¿Qué tienes en mente?`,save:`Guardar borrador`,yourDrafts:`Tus borradores`,noDrafts:`Aún no hay borradores.`},activity:{title:`Actividad`,empty:`Sin actividad aún.`}}},n={list:{title:`Contenido`,description:`Busca, filtra, edita y publica tu contenido.`,columns:{title:`Título`,type:`Tipo`,status:`Estado`,updated:`Actualizado`},actions:{edit:`Editar`,publish:`Publicar`,unpublish:`Despublicar`,delete:`Eliminar`},filters:{search:`Buscar contenido…`,allTypes:`Todos los tipos`,allStatus:`Todos los estados`},buttons:{new:`+ Nuevo contenido`,search:`Buscar`},empty:`No se encontró contenido.`,statuses:{draft:`Borrador`,published:`Publicado`,archived:`Archivado`},confirmDelete:`¿Eliminar "{title}"?`,toasts:{published:`Contenido publicado ✓`,unpublished:`Contenido despublicado ✓`}},editor:{type:`Tipo`,title:`Título`,slug:`Slug`,excerpt:`Extracto`,featuredImage:`Imagen Destacada (ID de medio)`,status:`Estado`,statusOptions:{draft:`Borrador`,published:`Publicado`,archived:`Archivado`},layout:`Layout`,layoutAuto:`Automático (jerarquía del tema)`,customFields:`Campos Personalizados`,inspectTypes:`Inspeccionar tipos disponibles`,save:`Guardar`,saved:`Contenido guardado correctamente.`}},r={title:`Biblioteca de Medios`,description:"Sube y gestiona imágenes, videos y documentos. Los archivos se almacenan en `uploads/` y se sirven públicamente.",upload:{dropzone:`Arrastra archivos aquí o`,select:`Seleccionar archivos`,uploading:`Subiendo…`,hint:`Imágenes, videos, audio y documentos · hasta 25MB por archivo`},toolbar:{search:`Buscar por nombre o alt…`,allTypes:`Todos los tipos`,searchBtn:`Buscar`},mimeTypes:{png:`PNG`,jpeg:`JPEG`,gif:`GIF`,webp:`WebP`,svg:`SVG`,pdf:`PDF`,mp4:`MP4`,mp3:`MP3`},empty:`Aún no hay archivos. ¡Sube el primero!`,details:{title:`Detalles`,file:`Archivo`,type:`Tipo`,size:`Tamaño`,url:`URL`,copy:`Copiar`,alt:`Texto alternativo (alt)`,caption:`Leyenda`,save:`Guardar detalles`,delete:`Eliminar`,close:`Cerrar`,confirmDelete:`¿Eliminar "{filename}"? El archivo será eliminado del disco.`,saved:`Detalles guardados ✓`,copied:`URL copiada ✓`,copyError:`No se pudo copiar la URL`},toasts:{uploaded:`{count} archivo(s) subido(s) ✓`}},i={title:`Usuarios`,description:`Gestiona cuentas, roles y accesos del proyecto.`,new:`Nuevo Usuario`,toolbar:{search:`Buscar por nombre o email…`,allStatus:`Todos los estados`,active:`Activos`,inactive:`Inactivos`,newBtn:`+ Nuevo usuario`,searchBtn:`Buscar`},table:{name:`Nombre`,email:`Email`,role:`Rol`,status:`Estado`,lastAccess:`Último acceso`,actions:{manage:`Gestionar`,delete:`Eliminar`}},empty:`No se encontraron usuarios.`,noRole:`Sin rol`,detail:{title:`Gestionar usuario`,fields:{name:`Nombre`,email:`Email`,status:`Estado`,role:`Rol`,password:`Contraseña`},statusOptions:{active:`Activo`,inactive:`Inactivo`},rolePlaceholder:`— sin rol —`,meta:`Creado el {created} · último acceso {lastAccess}`,actions:{save:`Guardar`,resetPassword:`Restablecer contraseña`,close:`Cerrar`},passwordPrompt:`Nueva contraseña para {email} (mínimo 8 caracteres):`,passwordError:`La contraseña debe tener al menos 8 caracteres`,toasts:{roleUpdated:`Rol de {name} actualizado ✓`,passwordChanged:`Contraseña de {name} cambiada ✓`,saved:`Usuario {name} guardado ✓`,deleted:`Usuario {name} eliminado ✓`},confirmDelete:`¿Eliminar usuario {email}?`}},a={general:{title:`General`,description:`Información básica mostrada en el sitio.`,back:`← Todos los ajustes`,fields:{siteTitle:`Título del sitio`,siteTitlePlaceholder:`Mi Sitio`,siteDescription:`Descripción`,siteDescriptionPlaceholder:`Un nuevo sitio hecho con OkCMS`,language:`Idioma`,timezone:`Zona horaria`,timezonePlaceholder:`America/Mexico_City`},saved:`Ajustes guardados ✓`,loading:`Cargando…`,save:`Guardar`},postTypes:{title:`Tipos de Contenido`,description:`Crea tipos de contenido personalizados (CPTs) más allá de Entradas y Páginas.`,form:{title:`Crear Tipo de Contenido`,slug:`Slug (singular, ej.: portfolio)`,slugHint:`Solo letras minúsculas, números y guion bajo`,singular:`Nombre en singular`,plural:`Nombre en plural`,supports:`Soporta`,supportsOptions:{title:`Título`,editor:`Editor`,thumbnail:`Imagen Destacada`,excerpt:`Extracto`,revisions:`Revisiones`},hasArchive:`Tiene archivo público (/slug)`,create:`Crear`},table:{slug:`Slug`,singular:`Singular`,plural:`Plural`,source:`Origen`,supports:`Soporta`,archive:`Archivo`,actions:{remove:`Eliminar`}},sources:{admin:`Admin`,core:`Core`}},taxonomies:{title:`Taxonomías`,description:`Crea taxonomías personalizadas y vínculalas a los tipos de contenido.`,form:{title:`Crear Taxonomía`,name:`Nombre (ej.: Género)`,slug:`Slug (opcional, generado del nombre)`,slugHint:`Solo letras minúsculas, números y guion bajo`,hierarchical:`Jerárquica (permite términos padre/hijo)`,attachTo:`Vincular a tipos de contenido`,create:`Crear`},table:{taxonomy:`Taxonomía`,hierarchical:`Jerárquica`,attachedTypes:`Tipos de contenido vinculados`,actions:{remove:`Eliminar`}}}},o={title:`Iniciar Sesión`,subtitle:`Accede a tu cuenta`,email:`Email`,password:`Contraseña`,submit:`Entrar`,failed:`Correo o contraseña no válidos`},s={save:`Guardar`,cancel:`Cancelar`,delete:`Eliminar`,edit:`Editar`,close:`Cerrar`,confirm:`Confirmar`,loading:`Cargando…`,yes:`Sí`,no:`No`,search:`Buscar`,filter:`Filtrar`,create:`Crear`,update:`Actualizar`,remove:`Eliminar`,viewAll:`Ver Todo`,back:`Volver`,next:`Siguiente`,previous:`Anterior`,page:`Página`,of:`de`,items:`elementos`,item:`elemento`,empty:`No se encontraron {items}.`,toast:{success:`✓`,error:`Error: {message}`},status:{active:`Activo`,inactive:`Inactivo`,draft:`Borrador`,published:`Publicado`,archived:`Archivado`,locked:`Bloqueado`},language:`Idioma`},c={justNow:`ahora mismo`,minAgo:`minutos atrás`,ago:`atrás`,published:`Publicado`,updated:`Actualizado`,newUser:`Nuevo usuario: {name}`},l={mainMenu:`Menú principal`,notifications:`Notificaciones`,notificationsEmpty:`Sin actividad reciente`,settings:`Ajustes`,toggleSidebar:`Alternar barra lateral`,userMenu:`Menú de usuario`},u={copyright:`© 2026 OkCMS. Todos los derechos reservados.`,links:`Enlaces`,website:`Sitio web`,github:`GitHub`,docs:`Documentación`,community:`Comunidad`,poweredBy:`Desarrollado con OkCMS`},d={title:`Ayuda`,label:`Ayuda`,tabs:`Temas de ayuda`,topics:{overview:{label:`De un vistazo`,content:`<h4>Bienvenido al panel de OkCMS</h4><p>Este panel te ofrece una visión general del contenido y la actividad de tu sitio.</p><h4>Widgets disponibles</h4><ul><li><strong>De un vistazo:</strong> resumen de entradas, páginas, medios y usuarios</li><li><strong>Borrador rápido:</strong> guarda borradores rápidamente desde el panel</li><li><strong>Actividad:</strong> actividad y actualizaciones recientes del sitio</li></ul>`},content:{label:`Gestión de contenido`,content:`<h4>Gestionar contenido</h4><p>Crea, edita y publica contenido desde la sección de Contenido.</p><h4>Acciones rápidas</h4><ul><li>Haz clic en "Nuevo contenido" para crear una nueva entrada o página</li><li>Usa filtros para encontrar contenido específico</li><li>Acciones en lote disponibles para varios elementos</li></ul>`},media:{label:`Biblioteca de medios`,content:`<h4>Gestionar medios</h4><p>Sube y gestiona imágenes, vídeos y documentos.</p><h4>Consejos</h4><ul><li>Arrastra y suelta archivos para subirlos</li><li>Añade texto alternativo para accesibilidad</li><li>Organiza con carpetas (próximamente)</li></ul>`}}},f={title:`Opciones de pantalla`,label:`Opciones de pantalla`,showOnScreen:`Mostrar en pantalla`},p={layout:e,dashboard:t,content:n,media:r,users:i,settings:a,login:o,common:s,activity:c,adminBar:l,footer:u,helpTabs:d,screenOptions:f};export{c as activity,l as adminBar,s as common,n as content,t as dashboard,p as default,u as footer,d as helpTabs,e as layout,o as login,r as media,f as screenOptions,a as settings,i as users};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,S as t,T as n,_ as r,b as i,g as a,i as o,n as s,o as c,p as l,r as u,s as d,t as f,u as p}from"./web.D_vCtCLj.js";import{t as m}from"./api.CDW61rqX.js";import"./src.DyLYQxi2.js";var h=l(`<a class=sidebar__link><!$><!/> <!$><!/>`),g=l(`<span aria-hidden=true>`);function _(e){let n=()=>e.extensions.menuPages.filter(t=>e.can(t.capability??`read`));return i(a,{get each(){return n()},children:e=>(()=>{var n=u(h),r=n.firstChild,[i,a]=o(r.nextSibling),s=i.nextSibling.nextSibling,[l,f]=o(s.nextSibling);return c(n,(()=>{var t=d(()=>!!e.icon);return()=>t()?(()=>{var t=u(g);return c(t,()=>e.icon),t})():null})(),i,a),c(n,()=>e.label,l,f),t(()=>p(n,`href`,`/plugins/${e.slug}`)),n})()})}s([`click`]);var v=l(`<div class=sidebar-plugins data-extensions=sidebar><!$><!/><!$><!/>`),y=l(`<div><span>`);function b(){return{menuPages:[],submenuPages:[],dashboardWidgets:[],metaBoxes:[],notices:[],columns:{},columnRenderers:{},actionLinks:[]}}function x(e){let t=b();for(let n of e){if(n.status!==`ACTIVE`&&n.status!==`ACTIVATED`)continue;let e=n.manifest?.admin;if(!e)continue;let r=n.slug??n.name;t.menuPages.push(...e.menuPages?.map(e=>({...e,slug:e.slug.startsWith(`${r}/`)?e.slug:`${r}/${e.slug}`}))??[]),t.dashboardWidgets.push(...e.dashboardWidgets?.map(e=>({...e,id:e.id.includes(`:`)?e.id:`${r}:${e.id}`,componentId:e.componentId.includes(`:`)?e.componentId:`${r}:${e.componentId}`}))??[]),t.notices.push(...e.notices?.map(e=>({...e,id:e.id.includes(`:`)?e.id:`${r}:${e.id}`}))??[])}return t}function S(){let[s,l]=e(b());n(async()=>{try{let e=await m.getPlugins();l(x(e))}catch{}});let d=()=>!0;return i(r,{get when(){return s().menuPages.length>0},get children(){var e=u(v),n=e.firstChild,[r,l]=o(n.nextSibling),m=r.nextSibling,[h,g]=o(m.nextSibling);return c(e,i(a,{get each(){return s().notices},children:e=>(()=>{var n=u(y),r=n.firstChild;return c(r,()=>e.message),t(t=>{var r=`notice notice--${e.level}`,i=e.id.split(`:`)[0];return r!==t.e&&f(n,t.e=r),i!==t.t&&p(n,`data-plugin`,t.t=i),t},{e:void 0,t:void 0}),n})()}),r,l),c(e,i(_,{get extensions(){return s()},can:d}),h,g),e}})}export{S as PluginExtensionsSlot,b as emptyExtensionsState,x as extensionsFromPlugins};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={appName:`OkCMS`,admin:`Admin`,nav:{dashboard:`לוח בקרה`,content:`תוכן`,media:`מדיה`,users:`משתמשים`,settings:`הגדרות`,plugins:`תוספים`,themes:`ערכות נושא`},actions:{logout:`התנתקות`,newPost:`פוסט חדש`,uploadMedia:`העלאת מדיה`,addUser:`הוסף משתמש`,openSettings:`הגדרות`}},t={title:`לוח בקרה`,stats:{totalContent:`סה״כ תוכן`,published:`פורסם`,drafts:`טיוטות`,mediaFiles:`קבצי מדיה`,users:`משתמשים`},recent:{title:`תוכן אחרון`,viewAll:`הצג הכל`,empty:`אין עדיין תוכן — צור את הראשון!`,columns:{title:`כותרת`,type:`סוג`,status:`סטטוס`,updated:`עודכן`}},widgets:{atGlance:`במבט חטוף`,posts:`פוסטים`,postsDesc:`פורסמו / טיוטות / פח`,pages:`עמודים`,pagesDesc:`פורסמו / טיוטות / פח`,media:`מדיה`,mediaDesc:`קבצים בספרייה`,users:`משתמשים`,usersDesc:`סה״כ / פעילים / לא פעילים`,version:`גרסה`,storage:`אחסון`,quickDraft:{title:`טיוטה מהירה`,heading:`כותרת`,headingPlaceholder:`תנו כותרת לטיוטה`,content:`תוכן`,contentPlaceholder:`על מה אתם חושבים?`,save:`שמור טיוטה`,yourDrafts:`הטיוטות שלך`,noDrafts:`עדיין אין טיוטות.`},activity:{title:`פעילות`,empty:`עדיין אין פעילות.`}}},n={list:{title:`תוכן`,description:`חפש, סנן, ערוך ופרסם את התוכן שלך.`,columns:{title:`כותרת`,type:`סוג`,status:`סטטוס`,updated:`עודכן`},actions:{edit:`ערוך`,publish:`פרסם`,unpublish:`בטל פרסום`,delete:`מחק`},filters:{search:`חפש תוכן…`,allTypes:`כל הסוגים`,allStatus:`כל הסטטוסים`},buttons:{new:`+ תוכן חדש`,search:`חפש`},empty:`לא נמצא תוכן.`,statuses:{draft:`טיוטה`,published:`פורסם`,archived:`ארכיון`},confirmDelete:`למחוק "{title}"?`,toasts:{published:`התוכן פורסם ✓`,unpublished:`הפרסום בוטל ✓`}},editor:{type:`סוג`,title:`כותרת`,slug:`Slug`,excerpt:`תקציר`,featuredImage:`תמונה ראשית (מזהה מדיה)`,status:`סטטוס`,statusOptions:{draft:`טיוטה`,published:`פורסם`,archived:`ארכיון`},layout:`פריסה`,layoutAuto:`אוטומטי (היררכיית ערכת נושא)`,customFields:`שדות מותאמים`,inspectTypes:`בדוק סוגים זמינים`,save:`שמור`,saved:`התוכן נשמר בהצלחה.`}},r={title:`ספריית מדיה`,description:"העלה ונהל תמונות, סרטונים ומסמכים. קבצים נשמרים ב-`uploads/` ומוגשים לציבור.",upload:{dropzone:`גרור קבצים לכאן או`,select:`בחר קבצים`,uploading:`מעלה…`,hint:`תמונות, סרטונים, שמע ומסמכים · עד 25MB לקובץ`},toolbar:{search:`חפש לפי שם או alt…`,allTypes:`כל הסוגים`,searchBtn:`חפש`},mimeTypes:{png:`PNG`,jpeg:`JPEG`,gif:`GIF`,webp:`WebP`,svg:`SVG`,pdf:`PDF`,mp4:`MP4`,mp3:`MP3`},empty:`אין עדיין קבצים. העלה את הראשון!`,details:{title:`פרטים`,file:`קובץ`,type:`סוג`,size:`גודל`,url:`כתובת`,copy:`העתק`,alt:`טקסט חלופי`,caption:`כיתוב`,save:`שמור פרטים`,delete:`מחק`,close:`סגור`,confirmDelete:`למחוק "{filename}"? הקובץ יימחק מהדיסק.`,saved:`הפרטים נשמרו ✓`,copied:`הכתובת הועתקה ✓`,copyError:`לא ניתן להעתיק את הכתובת`},toasts:{uploaded:`{count} קובץ(ים) הועלו ✓`}},i={title:`משתמשים`,description:`נהל חשבונות, תפקידים וגישות לפרויקט.`,new:`משתמש חדש`,toolbar:{search:`חפש לפי שם או אימייל…`,allStatus:`כל הסטטוסים`,active:`פעילים`,inactive:`לא פעילים`,newBtn:`+ משתמש חדש`,searchBtn:`חפש`},table:{name:`שם`,email:`אימייל`,role:`תפקיד`,status:`סטטוס`,lastAccess:`גישה אחרונה`,actions:{manage:`נהל`,delete:`מחק`}},empty:`לא נמצאו משתמשים.`,noRole:`ללא תפקיד`,detail:{title:`ניהול משתמש`,fields:{name:`שם`,email:`אימייל`,status:`סטטוס`,role:`תפקיד`,password:`סיסמה`},statusOptions:{active:`פעיל`,inactive:`לא פעיל`},rolePlaceholder:`— ללא תפקיד —`,meta:`נוצר ב-{created} · גישה אחרונה {lastAccess}`,actions:{save:`שמור`,resetPassword:`אפס סיסמה`,close:`סגור`},passwordPrompt:`סיסמה חדשה עבור {email} (מינימום 8 תווים):`,passwordError:`הסיסמה חייבת להיות באורך 8 תווים לפחות`,toasts:{roleUpdated:`התפקיד של {name} עודכן ✓`,passwordChanged:`הסיסמה של {name} שונתה ✓`,saved:`המשתמש {name} נשמר ✓`,deleted:`המשתמש {name} נמחק ✓`},confirmDelete:`למחוק את המשתמש {email}?`}},a={general:{title:`כללי`,description:`מידע בסיסי המוצג באתר.`,back:`← כל ההגדרות`,fields:{siteTitle:`כותרת האתר`,siteTitlePlaceholder:`האתר שלי`,siteDescription:`תיאור`,siteDescriptionPlaceholder:`אתר חדש עם OkCMS`,language:`שפה`,timezone:`אזור זמן`,timezonePlaceholder:`Asia/Jerusalem`},saved:`ההגדרות נשמרו ✓`,loading:`טוען…`,save:`שמור`},postTypes:{title:`סוגי תוכן`,description:`צור סוגי תוכן מותאמים (CPT) מעבר לפוסטים ועמודים.`,form:{title:`צור סוג תוכן`,slug:`Slug (יחיד, למשל: portfolio)`,slugHint:`רק אותיות קטנות, מספרים וקו תחתון`,singular:`שם ביחיד`,plural:`שם ברבים`,supports:`תומך`,supportsOptions:{title:`כותרת`,editor:`עורך`,thumbnail:`תמונה ראשית`,excerpt:`קטע`,revisions:`גרסאות`},hasArchive:`יש דף ארכיון ציבורי (/slug)`,create:`צור`},table:{slug:`Slug`,singular:`יחיד`,plural:`רבים`,source:`מקור`,supports:`תומך`,archive:`ארכיון`,actions:{remove:`הסר`}},sources:{admin:`Admin`,core:`Core`}},taxonomies:{title:`טקסונומיות`,description:`צור טקסונומיות מותאמות וקשר אותן לסוגי תוכן.`,form:{title:`צור טקסונומיה`,name:`שם (למשל: ז'אנר)`,slug:`Slug (אופציונלי, נוצר מהשם)`,slugHint:`רק אותיות קטנות, מספרים וקו תחתון`,hierarchical:`היררכית (מאפשרת מונחי אב/בן)`,attachTo:`קשר לסוגי תוכן`,create:`צור`},table:{taxonomy:`טקסונומיה`,hierarchical:`היררכית`,attachedTypes:`סוגי תוכן מקושרים`,actions:{remove:`הסר`}}}},o={title:`התחברות`,subtitle:`התחבר לחשבונך`,email:`אימייל`,password:`סיסמה`,submit:`התחבר`,failed:`אימייל או סיסמה שגויים`},s={save:`שמור`,cancel:`ביטול`,delete:`מחק`,edit:`ערוך`,close:`סגור`,confirm:`אשר`,loading:`טוען…`,yes:`כן`,no:`לא`,search:`חפש`,filter:`סנן`,create:`צור`,update:`עדכן`,remove:`הסר`,viewAll:`הצג הכל`,back:`חזור`,next:`הבא`,previous:`הקודם`,page:`עמוד`,of:`מתוך`,items:`פריטים`,item:`פריט`,empty:`לא נמצאו {items}.`,toast:{success:`✓`,error:`שגיאה: {message}`},status:{active:`פעיל`,inactive:`לא פעיל`,draft:`טיוטה`,published:`פורסם`,archived:`ארכיון`,locked:`נעול`},language:`שפה`},c={justNow:`עכשיו`,minAgo:`דקות לפני`,ago:`לפני`,published:`פורסם`,updated:`עודכן`,newUser:`משתמש חדש: {name}`},l={mainMenu:`תפריט ראשי`,notifications:`התראות`,notificationsEmpty:`אין פעילות אחרונה`,settings:`הגדרות`,toggleSidebar:`החלף סרגד צד`,userMenu:`תפריט משתמש`},u={copyright:`© 2026 OkCMS. כל הזכויות שמורות.`,links:`קישורים`,website:`אתר`,github:`GitHub`,docs:`תיעוד`,community:`קהילה`,poweredBy:`מונע על ידי OkCMS`},d={title:`עזרה`,label:`עזרה`,tabs:`נושאי עזרה`,topics:{overview:{label:`במבט חטוף`,content:`<h4>ברוכים הבאים ללוח הבקרה של OkCMS</h4><p>לוח הבקרה הזה נותן סקירה כללית של התוכן והפעילות באתר שלך.</p><h4>וידג'טים זמינים</h4><ul><li><strong>במבט חטוף:</strong> סקירת פוסטים, עמודים, מדיה ומשתמשים</li><li><strong>טיוטה מהירה:</strong> שמירת טיוטות במהירות מלוח הבקרה</li><li><strong>פעילות:</strong> פעילות ועדכונים אחרונים של האתר</li></ul>`},content:{label:`ניהול תוכן`,content:`<h4>ניהול תוכן</h4><p>צור, ערוך ופרסם תוכן מאזור התוכן.</p><h4>פעולות מהירות</h4><ul><li>לחץ על "תוכן חדש" כדי ליצור פוסט או עמוד חדש</li><li>השתמש בסינונים כדי למצוא תוכן ספציפי</li><li>פעולות מרובות זמינות לפריטים מרובים</li></ul>`},media:{label:`ספריית מדיה`,content:`<h4>ניהול מדיה</h4><p>העלה ונהל תמונות, וידאו ומסמכים.</p><h4>טיפים</h4><ul><li>גרור קבצים כדי להעלות</li><li>הוסף טקסט חלופי לנגישות</li><li>ארגן בתיקיות (בקרוב)</li></ul>`}}},f={title:`אפשרויות מסך`,label:`אפשרויות מסך`,showOnScreen:`הצג במסך`},p={layout:e,dashboard:t,content:n,media:r,users:i,settings:a,login:o,common:s,activity:c,adminBar:l,footer:u,helpTabs:d,screenOptions:f};export{c as activity,l as adminBar,s as common,n as content,t as dashboard,p as default,u as footer,d as helpTabs,e as layout,o as login,r as media,f as screenOptions,a as settings,i as users};
|