@oktis-works/admin 0.23.2 → 0.23.3
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.Dzoi-bq3.js → ActivityWidget.C8vh6xAH.js} +1 -1
- package/dist/client/_astro/{AdminBar.eT1ch_B6.js → AdminBar.D4zIDpRx.js} +1 -1
- package/dist/client/_astro/{ApiKeysManager.kbTE1CPk.js → ApiKeysManager.Bkuipo9h.js} +1 -1
- package/dist/client/_astro/{AtGlanceWidget.w23IIv06.js → AtGlanceWidget.BwnpX_nn.js} +1 -1
- package/dist/client/_astro/{CommentsManager.BN7i1RHa.js → CommentsManager.B7eut49M.js} +1 -1
- package/dist/client/_astro/ContentEditor.CTopdn_8.js +1 -0
- package/dist/client/_astro/ContentTypeWorkspace.xXST4b7L.js +1 -0
- package/dist/client/_astro/{DashboardHome.DXzu_IXZ.js → DashboardHome.DD8QG8ZW.js} +1 -1
- package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.DmNSzErX.js → DashboardLayout.astro_astro_type_script_index_0_lang.DPDlXZ5o.js} +1 -1
- package/dist/client/_astro/{FieldGroupEditor.DsqphEgt.js → FieldGroupEditor.BBEN5r2U.js} +3 -3
- package/dist/client/_astro/{FieldGroupList.pW2Um9om.js → FieldGroupList.BatiQHnf.js} +1 -1
- package/dist/client/_astro/FieldRenderer.BeF5CSJf.js +3 -0
- package/dist/client/_astro/{Footer.5Lcn2VXz.js → Footer.BdwB3qmM.js} +1 -1
- package/dist/client/_astro/{GeneralSettings.B-H8Rzy7.js → GeneralSettings.BCfrxm6Z.js} +1 -1
- package/dist/client/_astro/{LogsManager.Crd8q2te.js → LogsManager.Bs5CSVoj.js} +1 -1
- package/dist/client/_astro/{MediaLibrary.Cv6Ry3u9.js → MediaLibrary.CHn5f4-T.js} +1 -1
- package/dist/client/_astro/{MenuManager.D25ika09.js → MenuManager.C6SrDqdC.js} +1 -1
- package/dist/client/_astro/{Modal.572hmVvb.js → Modal.DdoTYkUe.js} +1 -1
- package/dist/client/_astro/PluginManager.BLpO1lc5.js +112 -0
- package/dist/client/_astro/PluginPageHost.CuXn-tn7.js +1 -0
- package/dist/client/_astro/{PostTypesManager.C3RbmOZT.js → PostTypesManager.B6XdeNQH.js} +1 -1
- package/dist/client/_astro/{QuickDraftWidget.BtSGzhKq.js → QuickDraftWidget.COnmqwEP.js} +1 -1
- package/dist/client/_astro/{ReadingSettings.ZFDaeo5U.js → ReadingSettings.dAD5fTqQ.js} +1 -1
- package/dist/client/_astro/{ResourceHubs.Cx9fbCv1.js → ResourceHubs.B6txFjmO.js} +1 -1
- package/dist/client/_astro/{TaxonomiesManager.BLsvmjaL.js → TaxonomiesManager.CUiXA1--.js} +1 -1
- package/dist/client/_astro/{TaxonomyTermsManager.C_xEh8Ab.js → TaxonomyTermsManager.egxIFsFi.js} +1 -1
- package/dist/client/_astro/{ThemeCustomizer.BrDHVXLk.js → ThemeCustomizer.Bh3Gj0ud.js} +1 -1
- package/dist/client/_astro/{ThemeManager.BpS3m7Qc.js → ThemeManager.UG7ieOYF.js} +1 -1
- package/dist/client/_astro/{UserCreateForm.BYwgAqKk.js → UserCreateForm.CTbVVXjg.js} +1 -1
- package/dist/client/_astro/{UsersManager.DODMr48D.js → UsersManager.Dk2kJsYG.js} +1 -1
- package/dist/client/_astro/{WebhooksManager.DmWIW272.js → WebhooksManager.DTMl6Bm7.js} +1 -1
- package/dist/client/_astro/{api.53l1ob4Z.js → api.fpBzBw4U.js} +1 -1
- package/dist/client/_astro/extensions.DZ7iomLj.js +1 -0
- package/dist/client/_astro/i18n.DQYU1D_P.js +1 -0
- package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.BLf2Iun3.js → login.astro_astro_type_script_index_0_lang.DA827d72.js} +1 -1
- package/dist/client/_astro/{pt-BR.zZcF2v3X.js → pt-BR.C041vzOT.js} +1 -1
- package/dist/client/_astro/slots.CSARb9TW.js +1 -0
- package/dist/client/_astro/store.CjNcmZUB.js +1 -0
- package/dist/server/chunks/{404_BAOD9OCa.mjs → 404_vQwudBEj.mjs} +1 -1
- package/dist/server/chunks/{BaseLayout_BE8O-LS4.mjs → BaseLayout_CJGULIpb.mjs} +3 -3
- package/dist/server/chunks/{ContentEditor_DPy3I4HM.mjs → ContentEditor_D3hp0Gyo.mjs} +49 -11
- package/dist/server/chunks/{DashboardLayout_D6zphdT0.mjs → DashboardLayout_DvfGK5S9.mjs} +20 -17
- package/dist/server/chunks/{FieldRenderer_D4dcZjgt.mjs → FieldRenderer_hN7BJpMp.mjs} +6 -6
- package/dist/server/chunks/{MediaLibrary_DGmYSSZH.mjs → MediaLibrary_BP42MRyJ.mjs} +2 -2
- package/dist/server/chunks/{Modal_BmuvdwoB.mjs → Modal_Ch2TxBxO.mjs} +1 -1
- package/dist/server/chunks/_.._DuD24v6o.mjs +76 -0
- package/dist/server/chunks/{_id__XEnJ5nS2.mjs → _id__DK_jXL1Q.mjs} +4 -4
- package/dist/server/chunks/{access_B5npG273.mjs → access_pGLFLBaE.mjs} +3 -3
- package/dist/server/chunks/{api-keys_Bs6zIXYm.mjs → api-keys_BPiWCywt.mjs} +3 -3
- package/dist/server/chunks/{comments_zJrnFEjl.mjs → comments_HtxLK4Vu.mjs} +2 -2
- package/dist/server/chunks/{custom-fields_C5EBkR02.mjs → custom-fields_CLqVsj2N.mjs} +2 -2
- package/dist/server/chunks/{customize_CKqMX14y.mjs → customize_C8xbYnPi.mjs} +3 -3
- package/dist/server/chunks/{edit_QKBYgFkJ.mjs → edit_CHln4Kd_.mjs} +2 -2
- package/dist/server/chunks/{i18n_C-sgJSi1.mjs → i18n_BlAR9yiz.mjs} +23 -2
- package/dist/server/chunks/{index_BM_-WBYo.mjs → index_BiKJEUK6.mjs} +2 -2
- package/dist/server/chunks/{index_BletZ9T6.mjs → index_CNk9hfS_.mjs} +3 -3
- package/dist/server/chunks/{index_CDwohy44.mjs → index_COr5MHJ7.mjs} +2 -2
- package/dist/server/chunks/{index_DenKi4a3.mjs → index_DK_fTf2_.mjs} +2 -2
- package/dist/server/chunks/{index_Btvmuytk.mjs → index_T7SwCQJ9.mjs} +2 -2
- package/dist/server/chunks/{login_CtIWLqC2.mjs → login_4_AiN3uA.mjs} +1 -1
- package/dist/server/chunks/{logs_DlTldv5b.mjs → logs_BnmhxL0Y.mjs} +2 -2
- package/dist/server/chunks/{menus_z2d_K44p.mjs → menus_CnlArgBT.mjs} +2 -2
- package/dist/server/chunks/{new_CYvLScge.mjs → new_BLx19-Ni.mjs} +2 -2
- package/dist/server/chunks/{new_Cxp8Mdw4.mjs → new_CtlziJrk.mjs} +2 -2
- package/dist/server/chunks/{plugins_4g6EEkCb.mjs → plugins_CgMxXTGS.mjs} +13 -5
- package/dist/server/chunks/{post-types_7cW4BLBV.mjs → post-types_cQc2Msvm.mjs} +2 -2
- package/dist/server/chunks/{pt-BR_AVNE88MZ.mjs → pt-BR_B8bZo1Id.mjs} +7 -1
- package/dist/server/chunks/{reading_2DqfBhj_.mjs → reading_0A4laJFd.mjs} +2 -2
- package/dist/server/chunks/{taxonomies_D7mMKpNX.mjs → taxonomies_CiAk4uQu.mjs} +2 -2
- package/dist/server/chunks/{taxonomy_64ggDTF9.mjs → taxonomy_C1yrRsga.mjs} +3 -3
- package/dist/server/chunks/{themes_Dscq-5uk.mjs → themes_C8eP1zzS.mjs} +2 -2
- package/dist/server/chunks/{upload_B-DdqpaQ.mjs → upload_BNO83SEC.mjs} +2 -2
- package/dist/server/chunks/{webhooks_D05B4_Rs.mjs → webhooks_BQe0fs4j.mjs} +2 -2
- package/dist/server/entry.mjs +43 -43
- package/dist/server/virtual_astro_middleware.mjs +1 -1
- package/package.json +3 -3
- package/dist/client/_astro/ContentEditor.BlsJ2bwD.js +0 -1
- package/dist/client/_astro/ContentTypeWorkspace.BPVuQgzA.js +0 -1
- package/dist/client/_astro/FieldRenderer.AYtSBfHZ.js +0 -3
- package/dist/client/_astro/PluginManager.DLfgQFPF.js +0 -112
- package/dist/client/_astro/extensions.DzQcQsO9.js +0 -1
- package/dist/client/_astro/i18n.A82w5XQu.js +0 -1
- package/dist/client/_astro/preload-helper.oCYlU9a4.js +0 -1
- package/dist/client/_astro/store.DLCqLxBR.js +0 -1
- package/dist/server/chunks/_slug__BkXrukGe.mjs +0 -34
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,h as t,l as n,p as r,r as i}from"./solid.Ck4Vtfe4.js";import{_ as a,l as o,o as s,p as c,u as l}from"./web.DD6VKaIp.js";import{n as u}from"./i18n.
|
|
1
|
+
import{S as e,h as t,l as n,p as r,r as i}from"./solid.Ck4Vtfe4.js";import{_ as a,l as o,o as s,p as c,u as l}from"./web.DD6VKaIp.js";import{n as u}from"./i18n.DQYU1D_P.js";import{n as d}from"./api.fpBzBw4U.js";var f=a(`<div class=activity-widget data-widget-panel=activity style="grid-column:span 2"><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><div class=styles-container><style>
|
|
2
2
|
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
|
|
3
3
|
.activity-item {
|
|
4
4
|
display: flex; gap: 0.75rem; padding: 0.75rem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,a as o,f as s,i as c,l,o as u,p as d,s as f}from"./web.DD6VKaIp.js";import{a as p,i as m,n as h,o as g}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,a as o,f as s,i as c,l,o as u,p as d,s as f}from"./web.DD6VKaIp.js";import{a as p,i as m,n as h,o as g}from"./i18n.DQYU1D_P.js";import{n as _}from"./api.fpBzBw4U.js";var v=a(`<style>
|
|
2
2
|
#admin-bar {
|
|
3
3
|
position: fixed;
|
|
4
4
|
top: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p,u as m}from"./web.DD6VKaIp.js";import{n as h}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p,u as m}from"./web.DD6VKaIp.js";import{n as h}from"./i18n.DQYU1D_P.js";import{n as g}from"./api.fpBzBw4U.js";import{t as _}from"./Modal.DdoTYkUe.js";var v=o(`<div class="notice notice--error">`),y=o(`<div class="notice notice--success">`),b=o(`<section class=card><h3></h3><form class=resource-form><label><!$><!/><input class=input required type=text></label><label><!$><!/><select class=input></select></label><label><!$><!/><input class=input type=datetime-local></label><label class=checkbox-label><input type=checkbox> <!$><!/></label><p class=muted></p><div><button class="btn btn-primary"type=submit></button> <button class=btn type=button>`),x=o(`<div class=table-scroll><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),S=o(`<div class=modal-body><div class="notice notice--error"></div><label><!$><!/><input class=input readonly type=text data-testid=api-key-plaintext></label><p class=muted></p><pre class=api-key-sample><code></code></pre><div><button class="btn btn-primary"type=button></button> <button class=btn type=button>`),C=o(`<div class="resource-hub api-keys-manager"><!$><!/><!$><!/><div class=card-header-row><div><h3></h3><p class=muted></p></div><button class="btn btn-primary"type=button></button></div><!$><!/><section class=card></section><!$><!/><style>.api-key-sample{background:var(--color-surface-muted,#f5f5f5);border:1px solid var(--color-border,#dcdcde);border-radius:4px;padding:.6rem;overflow:auto;font-size:.8rem;white-space:pre-wrap;word-break:break-all}.api-keys-manager .modal-body{display:grid;gap:.75rem;padding:1rem}`),w=o(`<option value>`),T=o(`<option><!$><!/> (<!$><!/>)`),E=o(`<p>`),D=o(`<span>`),O=o(`<button class="btn btn-danger"type=button>`),k=o(`<tr><td></td><td></td><td><code>okcms_<!$><!/>_…</code></td><td></td><td></td><td>`),A=o(`<span class="notice notice--error">`),j=e=>({name:``,userId:e,oneTime:!1,expiresAt:``});function M(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?`—`:t.toLocaleString()}function N(){let{t:o}=h(),[s,N]=n([]),[P,F]=n([]),[I,L]=n(null),[R,z]=n(null),[B,V]=n(``),[H,U]=n(``),[W,G]=n(!0),[K,q]=n(!1),J=async()=>{G(!0);try{let e=await g.getApiKeys();N(e)}catch(e){V(e instanceof Error?e.message:String(e))}finally{G(!1)}};e(()=>{J(),g.listUsers({limit:100,status:`ACTIVE`}).then(e=>F(e.data??[])).catch(()=>F([]))});let Y=()=>{V(``),U(``),L(j(P()[0]?.id??``))},ee=async e=>{e.preventDefault();let t=I();if(t){if(!t.name.trim()){V(o(`apiKeys.errors.nameRequired`));return}try{let e={name:t.name.trim(),oneTime:t.oneTime};t.userId&&(e.userId=t.userId),t.expiresAt&&(e.expiresAt=new Date(t.expiresAt).toISOString());let n=await g.createApiKey(e);L(null),z(n),q(!1),await J()}catch(e){V(e instanceof Error?e.message:String(e))}}},te=async e=>{if(e.id){V(``);try{await g.deleteApiKey(e.id),U(o(`apiKeys.revoked`)),await J()}catch(e){V(e instanceof Error?e.message:String(e))}}},ne=async()=>{let e=R()?.plaintext;if(e)try{await navigator.clipboard.writeText(e),q(!0)}catch{q(!1)}},X=()=>{z(null),q(!1)},re=e=>{let t=P().find(t=>t.id===e.user_id);return t?t.name:e.user_id??`—`};return(()=>{var e=d(C),n=e.firstChild,[h,g]=p(n.nextSibling),j=h.nextSibling,[N,F]=p(j.nextSibling),z=N.nextSibling,V=z.firstChild,U=V.firstChild,G=U.nextSibling,q=V.nextSibling,J=z.nextSibling,[Z,ie]=p(J.nextSibling),Q=Z.nextSibling,ae=Q.nextSibling,[$,oe]=p(ae.nextSibling);return $.nextSibling,l(e,r(t,{get when(){return B()},get children(){var e=d(v);return l(e,B),e}}),h,g),l(e,r(t,{get when(){return H()},get children(){var e=d(y);return l(e,H),e}}),N,F),l(U,()=>o(`apiKeys.listTitle`)),l(G,()=>o(`apiKeys.howItWorks`)),q.$$click=Y,l(q,()=>o(`apiKeys.new`)),l(e,r(t,{get when(){return I()},get children(){var e=d(b),n=e.firstChild,s=n.nextSibling,m=s.firstChild,h=m.firstChild,[g,_]=p(h.nextSibling),v=g.nextSibling,y=m.nextSibling,x=y.firstChild,[S,C]=p(x.nextSibling),E=S.nextSibling,D=y.nextSibling,O=D.firstChild,[k,A]=p(O.nextSibling),j=k.nextSibling,M=D.nextSibling,N=M.firstChild,F=N.nextSibling.nextSibling,[R,z]=p(F.nextSibling),B=M.nextSibling,V=B.nextSibling.firstChild,H=V.nextSibling.nextSibling;return l(n,()=>o(`apiKeys.create`)),s.addEventListener(`submit`,ee),l(m,()=>o(`apiKeys.form.name`),g,_),v.$$input=e=>I()&&L({...I(),name:e.currentTarget.value}),l(y,()=>o(`apiKeys.form.user`),S,C),E.addEventListener(`change`,e=>I()&&L({...I(),userId:e.currentTarget.value})),l(E,r(t,{get when(){return P().length>0},get fallback(){return(()=>{var e=d(w);return l(e,()=>o(`apiKeys.form.currentUser`)),e})()},get children(){return r(a,{get each(){return P()},children:e=>(()=>{var t=d(T),n=t.firstChild,[r,a]=p(n.nextSibling),o=r.nextSibling.nextSibling,[s,c]=p(o.nextSibling);return s.nextSibling,l(t,()=>e.name,r,a),l(t,()=>e.email,s,c),i(()=>u(t,`value`,e.id)),t})()})}})),l(D,()=>o(`apiKeys.form.expiresAt`),k,A),j.$$input=e=>I()&&L({...I(),expiresAt:e.currentTarget.value}),N.addEventListener(`change`,e=>I()&&L({...I(),oneTime:e.currentTarget.checked})),l(M,()=>o(`apiKeys.form.oneTime`),R,z),l(B,()=>o(`apiKeys.form.oneTimeHint`)),l(V,()=>o(`apiKeys.createSubmit`)),H.$$click=()=>L(null),l(H,()=>o(`common.cancel`)),i(()=>f(v,`placeholder`,o(`apiKeys.form.namePlaceholder`))),i(()=>u(v,`value`,I()?.name??``)),i(()=>u(E,`value`,I()?.userId??``)),i(()=>u(j,`value`,I()?.expiresAt??``)),i(()=>u(N,`checked`,I()?.oneTime??!1)),c(),e}}),Z,ie),l(Q,r(t,{get when(){return!W()},get fallback(){return(()=>{var e=d(E);return l(e,()=>o(`apiKeys.loading`)),e})()},get children(){return r(t,{get when(){return s().length>0},get fallback(){return(()=>{var e=d(E);return l(e,()=>o(`apiKeys.empty`)),e})()},get children(){var e=d(x),n=e.firstChild.firstChild,i=n.firstChild.firstChild,u=i.nextSibling,f=u.nextSibling,h=f.nextSibling,g=h.nextSibling,_=g.nextSibling,v=n.nextSibling;return l(i,()=>o(`apiKeys.form.name`)),l(u,()=>o(`apiKeys.form.user`)),l(f,()=>o(`apiKeys.prefix`)),l(h,()=>o(`apiKeys.lastUsed`)),l(g,()=>o(`apiKeys.status`)),l(_,()=>o(`common.actions`)),l(v,r(a,{get each(){return s()},children:e=>(()=>{var n=d(k),i=n.firstChild,a=i.nextSibling,s=a.nextSibling,u=s.firstChild,f=u.firstChild.nextSibling,[h,g]=p(f.nextSibling);h.nextSibling;var _=s.nextSibling,v=_.nextSibling,y=v.nextSibling;return l(i,()=>e.name),l(a,()=>re(e)),l(u,()=>e.key_prefix,h,g),l(_,(()=>{var t=m(()=>!!e.last_used_at);return()=>t()?M(e.last_used_at):o(`apiKeys.neverUsed`)})()),l(v,r(t,{get when(){return!e.revoked_at},get fallback(){return(()=>{var e=d(A);return l(e,()=>o(`apiKeys.status.revoked`)),e})()},get children(){return r(t,{get when(){return m(()=>!!e.expires_at)()&&new Date(e.expires_at).getTime()<=Date.now()},get fallback(){return(()=>{var t=d(D);return l(t,(()=>{var t=m(()=>!!e.one_time);return()=>t()?o(`apiKeys.status.oneTime`):o(`apiKeys.status.active`)})()),t})()},get children(){var e=d(D);return l(e,()=>o(`apiKeys.status.expired`)),e}})}})),l(y,r(t,{get when(){return!e.revoked_at},get children(){var t=d(O);return t.$$click=()=>void te(e),l(t,()=>o(`apiKeys.revoke`)),c(),t}})),n})()})),e}})}})),l(e,r(_,{get open(){return!!R()},onClose:X,get title(){return o(`apiKeys.created.title`)},get children(){var e=d(S),t=e.firstChild,n=t.nextSibling,r=n.firstChild,[a,s]=p(r.nextSibling),f=a.nextSibling,h=n.nextSibling,g=h.nextSibling,_=g.firstChild,v=g.nextSibling.firstChild,y=v.nextSibling.nextSibling;return l(t,()=>o(`apiKeys.created.warning`)),l(n,()=>o(`apiKeys.created.value`),a,s),f.addEventListener(`focus`,e=>e.currentTarget.select()),l(h,()=>o(`apiKeys.created.howToUse`)),l(_,()=>`POST /api/v1/auth/api-key-login\n{ "apiKey": "${R()?.plaintext??``}" }`),v.$$click=()=>void ne(),l(v,(()=>{var e=m(()=>!!K());return()=>e()?o(`apiKeys.created.copied`):o(`apiKeys.created.copy`)})()),y.$$click=X,l(y,()=>o(`common.close`)),i(()=>u(f,`value`,R()?.plaintext??``)),c(),e}}),$,oe),c(),e})()}s([`click`,`input`]);export{N as ApiKeysManager};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,g as o,i as s,l as c,o as l,p as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i}from"./solid.Ck4Vtfe4.js";import{_ as a,g as o,i as s,l as c,o as l,p as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.DQYU1D_P.js";import{n as f}from"./api.fpBzBw4U.js";var p=a(`<div><div class=dashboard-widget-header><h3 class=dashboard-widget-title></h3></div><div class=dashboard-widget-content></div><style>
|
|
2
2
|
.dashboard-widget {
|
|
3
3
|
background: var(--color-surface);
|
|
4
4
|
border: 1px solid var(--color-border);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p}from"./web.DD6VKaIp.js";import{n as m}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,a as s,f as c,l,m as u,o as d,p as f,s as p}from"./web.DD6VKaIp.js";import{n as m}from"./i18n.DQYU1D_P.js";import{n as h}from"./api.fpBzBw4U.js";var g=o(`<div class="notice notice--error">`),_=o(`<div class=card><table class=table><thead><tr><th></th><th></th><th></th><th></th><th></th></tr></thead><tbody>`),v=o(`<div class=comments-manager><!$><!/><div class=comments-tabs role=tablist><!$><!/><button type=button class="btn btn-secondary btn-sm comments-reload"></button></div><!$><!/><style>
|
|
2
2
|
.comments-tabs { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
|
|
3
3
|
.comments-tab {
|
|
4
4
|
display: inline-flex; align-items: center; gap: 0.4rem;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,a as t,f as n,h as r,l as i,p as a,r as o}from"./solid.Ck4Vtfe4.js";import{_ as s,a as c,f as l,l as u,m as d,o as f,p,s as m,u as h}from"./web.DD6VKaIp.js";import{n as g}from"./i18n.DQYU1D_P.js";import{n as _}from"./api.fpBzBw4U.js";import{r as v,t as y}from"./FieldRenderer.BeF5CSJf.js";import{t as b}from"./clone.oDfZEkVn.js";import{i as x,o as S}from"./slots.CSARb9TW.js";import{n as C,t as w}from"./store.CjNcmZUB.js";var ee=s(`<div class="notice notice--success">`),te=s(`<input class=classic-editor__title required>`),ne=s(`<div class=classic-editor__toolbar role=toolbar><select class=input value><option value></option><option value="<h1>"></option><option value="<h2>"></option><option value="<h3>"></option><option value="<h4>"></option><option value="<blockquote>"></option><option value="<pre>"></option></select><span class=classic-editor__toolbar-divider></span><button type=button><strong></strong></button><button type=button><em></em></button><button type=button><u></u></button><span class=classic-editor__toolbar-divider></span><button type=button></button><button type=button></button><button type=button>`),re=s(`<div class=classic-editor__body data-classic-editor role=textbox aria-multiline=true>`),ie=s(`<div class="plugin-editor plugin-editor--below">`),ae=s(`<label class=classic-editor__excerpt><span></span><textarea class=input rows=4>`),oe=s(`<section class="card custom-fields"><h3></h3><!$><!/>`),se=s(`<section class="card classic-editor__panel"><h3></h3><input class=input><p class=muted>`),ce=s(`<section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value></option><!$><!/>`),le=s(`<section class="card classic-editor__panel plugin-catalog-panel"><h3>Plugin blocks and patterns</h3><!$><!/><!$><!/>`),ue=s(`<form class="content-editor classic-editor"><!$><!/><!$><!/><div class=classic-editor__topbar><div><span class=classic-editor__eyebrow></span><h2></h2></div><div class=classic-editor__actions><a class="btn btn-secondary"></a><button type=submit class="btn btn-primary"></button></div></div><div class=classic-editor__columns><main class=classic-editor__main><section class="card classic-editor__canvas-card"><!$><!/><div class=classic-editor__permalink><span><!$><!/>:</span><input class=input></div><!$><!/><!$><!/><!$><!/></section><!$><!/><!$><!/></main><aside class=classic-editor__sidebar><section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value=DRAFT></option><option value=PUBLISHED></option><option value=ARCHIVED></option></select></label><button type=submit class="btn btn-primary classic-editor__full-button"></button></section><!$><!/><!$><!/><!$><!/><!$><!/></aside></div><!$><!/>`),de=s(`<div class="notice notice--error">`),fe=s(`<div class=plugin-editor>`),pe=s(`<option>`),me=s(`<button type=button class="btn btn-secondary">+ <!$><!/>`);function T(e){if(typeof e==`object`&&e&&!Array.isArray(e)){let t=e;return t.content===void 0&&typeof t.html==`string`&&(t.content=t.html),t}if(typeof e==`string`)try{let t=JSON.parse(e);if(typeof t==`object`&&t&&!Array.isArray(t)){let e=t;return e.content===void 0&&typeof e.html==`string`&&(e.content=e.html),e}}catch{}return{}}function E(s){let{t:c}=g(),[E,D]=r([]),[he,O]=r([]),[k,A]=r([]),[j,M]=r({}),[ge,N]=r([]),[P,F]=r(!1),[_e,I]=r(``),[L,R]=r(w()),[ve,ye]=r([]),[z,B]=r([]),[V,H]=r({type:s.initialType||`post`,title:``,status:`DRAFT`}),U=()=>new Set(E().find(e=>e.slug===V().type)?.supports??[`title`,`editor`]),W=e=>U().has(e),G=n(()=>{let e=V().type;return(L().editors??[]).filter(t=>t.screens.includes(`*`)||t.screens.includes(e)).sort((e,t)=>(e.priority??0)-(t.priority??0))[0]??null}),be=()=>({editorId:G().id,contentType:V().type,contentId:V().id??``,body:q(),setBody:e=>M({...j(),content:e}),disabled:P()}),xe=(e,t)=>t||e[0]?.slug||`post`,Se=()=>{let e=new Set;for(let t of k())for(let n of t.manifest?.provides?.layouts??[])e.add(n);return[...e].sort()},K=async e=>{try{let t=typeof e==`string`?{type:e}:e,n=await _.getFieldGroups(t.type?t:void 0),r=await Promise.all(n.filter(e=>e.active).map(async e=>(await _.getFieldGroup(e.id)).fields??[]));O(b(r.flat()))}catch(e){N([e instanceof Error?e.message:String(e)])}};e(async()=>{C().then(R);let e=[];try{let[t,n,r,i]=await Promise.all([_.getContentTypes(),_.getThemes().catch(()=>[]),_.getBlocks().catch(()=>[]),_.getPatterns().catch(()=>[])]);e=t,D(t),A(n),ye(r),B(i)}catch(e){N([e instanceof Error?e.message:String(e)])}let t=new URLSearchParams(window.location.search).get(`id`);if(t||s.singleton)try{let e=t?await _.getContentById(t):await _.getSingletonContent(V().type);if(!e){await K({type:V().type,status:V().status});return}let n=e;H({id:e.id,type:e.type,title:e.title,slug:e.slug,excerpt:e.excerpt,featuredImageId:n.featuredImageId??n.featured_image_id,status:e.status,layout:e.layout}),M(T(e.body))}catch(e){N([e instanceof Error?e.message:String(e)])}else e.some(e=>e.slug===V().type)||H({...V(),type:xe(e,s.initialType)});await K({type:V().type,slug:V().slug,status:V().status})});let q=()=>{let e=j().content;return typeof e==`string`?e:``},Ce=e=>{M({...j(),content:e.innerHTML})},J=(e,t)=>{document.execCommand(e,!1,t);let n=document.querySelector(`[data-classic-editor]`);n&&Ce(n)},we=e=>{M({...j(),content:`${q()}\n${v(e.content)}`.trim()})},Te=e=>{let t=Array.isArray(j()._blocks)?j()._blocks:[];M({...j(),_blocks:[...t,{type:e.type,attrs:{}}]})},Ee=async e=>{e.preventDefault(),I(``),N([]),F(!0);try{let e=v(q()),t=j(),n={...t,content:e};`html`in t&&(n.html=e);let r={...V(),layout:V().layout||null,body:n,...W(`excerpt`)?{}:{excerpt:void 0},...W(`thumbnail`)?{}:{featuredImageId:void 0}},i=V().id?await _.updateContent(V().id,r):await _.createContent(r);H({...V(),id:i.id}),I(c(`content.editor.saved`))}catch(e){N([e instanceof Error?e.message:String(e)])}finally{F(!1)}};return(()=>{var e=f(ue),n=e.firstChild,[r,s]=m(n.nextSibling),g=r.nextSibling,[_,b]=m(g.nextSibling),C=_.nextSibling,w=C.firstChild,T=w.firstChild,D=T.nextSibling,O=w.nextSibling.firstChild,k=O.nextSibling,A=C.nextSibling,N=A.firstChild,F=N.firstChild,I=F.firstChild,[R,ye]=m(I.nextSibling),B=R.nextSibling,U=B.firstChild,xe=U.firstChild,[K,De]=m(xe.nextSibling);K.nextSibling;var Y=U.nextSibling,Oe=B.nextSibling,[ke,Ae]=m(Oe.nextSibling),je=ke.nextSibling,[Me,Ne]=m(je.nextSibling),Pe=Me.nextSibling,[Fe,Ie]=m(Pe.nextSibling),Le=F.nextSibling,[Re,ze]=m(Le.nextSibling),Be=Re.nextSibling,[Ve,He]=m(Be.nextSibling),X=N.nextSibling,Ue=X.firstChild,We=Ue.firstChild,Z=We.nextSibling,Ge=Z.firstChild,[Ke,qe]=m(Ge.nextSibling),Q=Ke.nextSibling,$=Q.firstChild,Je=$.nextSibling,Ye=Je.nextSibling,Xe=Z.nextSibling,Ze=Ue.nextSibling,[Qe,$e]=m(Ze.nextSibling),et=Qe.nextSibling,[tt,nt]=m(et.nextSibling),rt=tt.nextSibling,[it,at]=m(rt.nextSibling),ot=it.nextSibling,[st,ct]=m(ot.nextSibling),lt=A.nextSibling,[ut,dt]=m(lt.nextSibling);return e.addEventListener(`submit`,Ee),u(e,i(t,{get when(){return ge().length>0},get children(){return i(o,{get each(){return ge()},children:e=>(()=>{var t=f(de);return u(t,e),t})()})}}),r,s),u(e,i(t,{get when(){return _e()},get children(){var e=f(ee);return u(e,_e),e}}),_,b),u(T,()=>E().find(e=>e.slug===V().type)?.singularLabel||V().type),u(D,(()=>{var e=h(()=>!!V().id);return()=>e()?c(`content.editor.editing`):c(`content.editor.adding`)})()),u(O,()=>c(`content.editor.backToList`)),u(k,(()=>{var e=h(()=>!!P());return()=>e()?c(`content.editor.saving`):c(`content.editor.save`)})()),u(F,i(t,{get when(){return W(`title`)},get children(){var e=f(te);return e.$$input=e=>H({...V(),title:e.currentTarget.value}),a(t=>{var n=c(`content.editor.title`),r=c(`content.editor.titlePlaceholder`);return n!==t.e&&p(e,`aria-label`,t.e=n),r!==t.t&&p(e,`placeholder`,t.t=r),t},{e:void 0,t:void 0}),a(()=>d(e,`value`,V().title)),l(),e}}),R,ye),u(U,()=>c(`content.editor.slug`),K,De),Y.$$input=e=>H({...V(),slug:e.currentTarget.value}),u(F,i(t,{get when(){return W(`editor`)},get children(){return i(t,{get when(){return G()?.mode!==`replace-body`},get fallback(){return(()=>{var e=f(fe);return u(e,i(S,{get componentId(){return G().componentId},get extraProps(){return be()}})),a(()=>p(e,`data-plugin-editor`,G().id)),e})()},get children(){return[(()=>{var e=f(ne),t=e.firstChild,n=t.firstChild,r=n.nextSibling,i=r.nextSibling,o=i.nextSibling,s=o.nextSibling,d=s.nextSibling,m=d.nextSibling,h=t.nextSibling.nextSibling,g=h.firstChild,_=h.nextSibling,v=_.firstChild,y=_.nextSibling,b=y.firstChild,x=y.nextSibling.nextSibling,S=x.nextSibling,C=S.nextSibling;return t.addEventListener(`change`,e=>J(`formatBlock`,e.currentTarget.value)),u(n,()=>c(`content.editor.formatParagraph`)),u(r,()=>c(`content.editor.formatH1`)),u(i,()=>c(`content.editor.formatH2`)),u(o,()=>c(`content.editor.formatH3`)),u(s,()=>c(`content.editor.formatH4`)),u(d,()=>c(`content.editor.formatBlockquote`)),u(m,()=>c(`content.editor.formatCode`)),h.$$click=()=>J(`bold`),u(g,()=>c(`content.editor.bold`)),_.$$click=()=>J(`italic`),u(v,()=>c(`content.editor.italic`)),y.$$click=()=>J(`underline`),u(b,()=>c(`content.editor.underline`)),x.$$click=()=>J(`insertUnorderedList`),u(x,()=>c(`content.editor.bulletList`)),S.$$click=()=>J(`insertOrderedList`),u(S,()=>c(`content.editor.numberedList`)),C.$$click=()=>J(`createLink`,window.prompt(c(`content.editor.linkPrompt`))||``),u(C,()=>c(`content.editor.link`)),a(n=>{var r=c(`content.editor.toolbar`),i=c(`content.editor.format`);return r!==n.e&&p(e,`aria-label`,n.e=r),i!==n.t&&p(t,`aria-label`,n.t=i),n},{e:void 0,t:void 0}),l(),e})(),(()=>{var e=f(re);return e.$$input=e=>Ce(e.currentTarget),p(e,`contenteditable`,!0),a(t=>{var n=c(`content.editor.bodyPlaceholder`),r=v(q());return n!==t.e&&p(e,`data-placeholder`,t.e=n),r!==t.t&&d(e,`innerHTML`,t.t=r),t},{e:void 0,t:void 0}),l(),e})()]}})}}),ke,Ae),u(F,i(t,{get when(){return G()?.mode===`below`},get children(){var e=f(ie);return u(e,i(S,{get componentId(){return G().componentId},get extraProps(){return be()}})),a(()=>p(e,`data-plugin-editor`,G().id)),e}}),Me,Ne),u(F,i(t,{get when(){return W(`excerpt`)},get children(){var e=f(ae),t=e.firstChild,n=t.nextSibling;return u(t,()=>c(`content.editor.excerpt`)),n.$$input=e=>H({...V(),excerpt:e.currentTarget.value}),a(()=>d(n,`value`,V().excerpt??``)),l(),e}}),Fe,Ie),u(N,i(t,{get when(){return he().length>0},get children(){var e=f(oe),t=e.firstChild,n=t.nextSibling,[r,a]=m(n.nextSibling);return u(t,()=>c(`content.editor.customFields`)),u(e,i(o,{get each(){return he()},children:e=>i(y,{field:e,get values(){return j()},onChange:(e,t)=>M({...j(),[e]:t}),t:c})}),r,a),e}}),Re,ze),u(N,i(x,{get extensions(){return L()},get screen(){return V().type},context:`normal`}),Ve,He),u(We,()=>c(`content.editor.publishPanel`)),u(Z,()=>c(`content.editor.status`),Ke,qe),Q.addEventListener(`change`,e=>H({...V(),status:e.currentTarget.value})),u($,()=>c(`content.editor.statusOptions.draft`)),u(Je,()=>c(`content.editor.statusOptions.published`)),u(Ye,()=>c(`content.editor.statusOptions.archived`)),u(Xe,(()=>{var e=h(()=>!!P());return()=>e()?c(`content.editor.saving`):c(`content.editor.save`)})()),u(X,i(t,{get when(){return W(`thumbnail`)},get children(){var e=f(se),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;return u(t,()=>c(`content.editor.featuredImage`)),n.$$input=e=>H({...V(),featuredImageId:e.currentTarget.value}),u(r,()=>c(`content.editor.featuredImageHint`)),a(()=>p(n,`placeholder`,c(`content.editor.mediaIdPlaceholder`))),a(()=>d(n,`value`,V().featuredImageId??``)),l(),e}}),Qe,$e),u(X,i(t,{get when(){return Se().length>0},get children(){var e=f(ce),t=e.firstChild,n=t.nextSibling,r=n.firstChild,[s,l]=m(r.nextSibling),p=s.nextSibling,h=p.firstChild,g=h.nextSibling,[_,v]=m(g.nextSibling);return u(t,()=>c(`content.editor.pageAttributes`)),u(n,()=>c(`content.editor.layout`),s,l),p.addEventListener(`change`,e=>H({...V(),layout:e.currentTarget.value||null})),u(h,()=>c(`content.editor.layoutAuto`)),u(p,i(o,{get each(){return Se()},children:e=>(()=>{var t=f(pe);return d(t,`value`,e),u(t,e),t})()}),_,v),a(()=>d(p,`value`,V().layout??``)),e}}),tt,nt),u(X,i(t,{get when(){return ve().length>0||z().length>0},get children(){var e=f(le),t=e.firstChild.nextSibling,[n,r]=m(t.nextSibling),a=n.nextSibling,[s,c]=m(a.nextSibling);return u(e,i(o,{get each(){return ve()},children:e=>(()=>{var t=f(me),n=t.firstChild.nextSibling,[r,i]=m(n.nextSibling);return t.$$click=()=>Te(e),u(t,()=>e.label,r,i),l(),t})()}),n,r),u(e,i(o,{get each(){return z()},children:e=>(()=>{var t=f(me),n=t.firstChild.nextSibling,[r,i]=m(n.nextSibling);return t.$$click=()=>we(e),u(t,()=>e.label,r,i),l(),t})()}),s,c),e}}),it,at),u(X,i(x,{get extensions(){return L()},get screen(){return V().type},context:`side`}),st,ct),u(e,i(x,{get extensions(){return L()},get screen(){return V().type},context:`advanced`}),ut,dt),a(e=>{var t=`/content/${encodeURIComponent(V().type)}`,n=P(),r=c(`content.editor.slugPlaceholder`),i=P();return t!==e.e&&p(O,`href`,e.e=t),n!==e.t&&d(k,`disabled`,e.t=n),r!==e.a&&p(Y,`placeholder`,e.a=r),i!==e.o&&d(Xe,`disabled`,e.o=i),e},{e:void 0,t:void 0,a:void 0,o:void 0}),a(()=>d(Y,`value`,V().slug??``)),a(()=>d(Q,`value`,V().status)),l(),e})()}c([`input`,`click`]);export{E as ContentEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,a as t,f as n,h as r,l as i,p as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u,u as d}from"./web.DD6VKaIp.js";import{n as f}from"./i18n.DQYU1D_P.js";import{n as p}from"./api.fpBzBw4U.js";import{c as m,i as h,n as g,o as _,r as ee,s as te,t as v}from"./src.CYKGYEyR.js";import{o as y,t as b}from"./slots.CSARb9TW.js";import{n as x,t as S}from"./store.CjNcmZUB.js";import{ContentEditor as C}from"./ContentEditor.CTopdn_8.js";var w=o(`<span class=muted>—`),T=o(`<span class=muted>`),E=o(`<span>`),D=o(`<div class=users-table__actions><a class="btn btn-secondary btn-sm"></a><!$><!/><!$><!/>`),ne=o(`<div class="notice notice--error">`),re=o(`<div class=notice>`),ie=o(`<div class=content-list><div class=content-list__heading><div><h2></h2><p class=muted></p></div><a class="btn btn-primary"></a></div><!$><!/><!$><!/><div class=toolbar><!$><!/><!$><!/><!$><!/></div><!$><!/><!$><!/>`);function O(e){return e}function k(e){let t=O(e).updated_at??O(e).updatedAt??O(e).created_at;if(typeof t!=`string`)return`—`;let n=new Date(t);return Number.isNaN(n.getTime())?`—`:n.toLocaleString(`pt-BR`)}function A(o){let{t:d}=f(),[C,A]=r([]),[j,M]=r([]),[N,P]=r(0),[F,I]=r(1),[L,R]=r(``),[z]=r(o.contentType),[B,V]=r(``),[H,U]=r(``),[W,G]=r(``),[K,q]=r(``),[J,Y]=r(S()),X=async()=>{try{let e=await p.getContent({page:F(),limit:20,type:z()||void 0,status:B()||void 0,search:L()||void 0});A(e.data??[]),P(e.total??0)}catch(e){U(e instanceof Error?e.message:String(e))}};e(async()=>{x().then(Y);let e=new URLSearchParams(window.location.search);V(e.get(`status`)??``),R(e.get(`search`)??``),await X();try{M(await p.getContentTypes())}catch{}});let Z=n(()=>j().find(e=>e.slug===z())),ae=n(()=>Z()?.pluralLabel||d(`content.list.title`)),oe=n(()=>`/content/${encodeURIComponent(z())}/new`),Q=async()=>{I(1),await X()},$=async e=>{let t=O(e).status===`PUBLISHED`;q(e.id),U(``),G(``);try{await p.publishToggle(e.id,t),G(d(t?`content.list.toasts.unpublished`:`content.list.toasts.published`)),await X()}catch(e){U(e instanceof Error?e.message:String(e))}finally{q(``)}},se=async e=>{let t=String(O(e).title??e.id);if(confirm(d(`content.list.confirmDelete`,{title:t})))try{await p.deleteContent(e.id),await X()}catch(e){U(e instanceof Error?e.message:String(e))}},ce=n(()=>{let e=J().columns[z()]??[],t=J().columnRenderers[z()]??{},n=e=>({key:e.key,label:e.label,render:(n,r)=>{let a=t[e.key];if(a){let e=a.split(`:`)[0]??``;return i(y,{componentId:a,plugin:e,extraProps:{row:r}})}let o=r[e.key];return o==null?c(w):typeof o==`object`?(()=>{var e=c(T);return s(e,()=>JSON.stringify(o)),e})():(()=>{var e=c(E);return s(e,()=>String(o)),e})()}}),r=e.filter(e=>e.position===`before_title`).map(n),o=e.filter(e=>e.position===`after_title`).map(n),f=e.filter(e=>!e.position).map(n),p=e.filter(e=>e.position===`end`).map(n),m=[{key:`title`,label:d(`content.list.columns.title`)},{key:`type`,label:d(`content.list.columns.type`)},{key:`status`,label:d(`content.list.columns.status`),render:(e,t)=>{let n=String(t.status??``);return i(v,{variant:n===`PUBLISHED`?`success`:n===`ARCHIVED`?`warning`:`secondary`,children:n})}},{key:`updated_at`,label:d(`content.list.columns.updated`),render:(e,t)=>(()=>{var e=c(T);return s(e,()=>k(t)),e})()},{key:`actions`,label:``,render:(e,t)=>{let n=t,r=O(n).status===`PUBLISHED`;return(()=>{var e=c(D),t=e.firstChild,o=t.nextSibling,[f,p]=u(o.nextSibling),m=f.nextSibling,[h,_]=u(m.nextSibling);return s(t,()=>d(`content.list.actions.edit`)),s(e,i(g,{variant:r?`secondary`:`primary`,size:`sm`,get loading(){return K()===n.id},onClick:()=>void $(n),get children(){return d(r?`content.list.actions.unpublish`:`content.list.actions.publish`)}}),f,p),s(e,i(g,{variant:`danger`,size:`sm`,onClick:()=>void se(n),get children(){return d(`content.list.actions.delete`)}}),h,_),a(()=>l(t,`href`,`/content/${encodeURIComponent(n.type||z())}/edit?id=${encodeURIComponent(n.id)}`)),e})()}}];return[...r,m[0],...o,m[1],m[2],m[3],...f,m[4],...p]});return(()=>{var e=c(ie),n=e.firstChild,r=n.firstChild,o=r.firstChild,f=o.nextSibling,p=r.nextSibling,v=n.nextSibling,[y,x]=u(v.nextSibling),S=y.nextSibling,[w,T]=u(S.nextSibling),E=w.nextSibling,D=E.firstChild,[O,k]=u(D.nextSibling),A=O.nextSibling,[j,M]=u(A.nextSibling),P=j.nextSibling,[z,U]=u(P.nextSibling),G=E.nextSibling,[K,q]=u(G.nextSibling),Y=K.nextSibling,[Z,$]=u(Y.nextSibling);return s(o,ae),s(f,()=>d(`content.list.description`)),s(p,()=>d(`content.list.buttons.addNew`)),s(e,i(t,{get when(){return H()},get children(){var e=c(ne);return s(e,H),e}}),y,x),s(e,i(t,{get when(){return W()},get children(){var e=c(re);return s(e,W),e}}),w,T),s(E,i(h,{name:`search`,get placeholder(){return d(`content.list.filters.search`)},get value(){return L()},onInput:e=>{R(e),Q()}}),O,k),s(E,i(te,{name:`status`,get placeholder(){return d(`content.list.filters.allStatus`)},get value(){return B()},get options(){return[{value:`DRAFT`,label:d(`content.list.statuses.draft`)},{value:`PUBLISHED`,label:d(`content.list.statuses.published`)},{value:`ARCHIVED`,label:d(`content.list.statuses.archived`)}]},onChange:e=>{V(e),Q()}}),j,M),s(E,i(g,{variant:`secondary`,onClick:()=>void Q(),get children(){return d(`content.list.buttons.search`)}}),z,U),s(e,i(b,{get extensions(){return J()}}),K,q),s(e,i(ee,{get children(){return[i(m,{get columns(){return ce()},get data(){return C()},get emptyMessage(){return d(`content.list.empty`)}}),i(_,{get page(){return F()},limit:20,get total(){return N()},onPageChange:e=>{I(e),X()}})]}}),Z,$),a(()=>l(p,`href`,oe())),e})()}var j=o(`<div class="notice notice--error">`),M=o(`<div class=card>`);function N(n){let{t:a}=f(),[o,l]=r(null),[u,m]=r(``);return e(async()=>{try{let e=(await p.getContentTypes()).find(e=>e.slug===n.contentType);if(!e){m(a(`content.list.typeNotFound`));return}l(e)}catch(e){m(e instanceof Error?e.message:String(e))}}),i(t,{get when(){return o()},get fallback(){return d(()=>!!u())()?(()=>{var e=c(j);return s(e,u),e})():(()=>{var e=c(M);return s(e,()=>a(`common.loading`)),e})()},children:e=>i(t,{get when(){return e().singleton},get fallback(){return i(A,{get contentType(){return e().slug}})},get children(){return i(C,{get initialType(){return e().slug},singleton:!0})}})})}export{N as ContentTypeWorkspace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.
|
|
1
|
+
import{S as e,a as t,h as n,l as r,p as i,r as a}from"./solid.Ck4Vtfe4.js";import{_ as o,l as s,o as c,p as l,s as u}from"./web.DD6VKaIp.js";import{n as d}from"./i18n.DQYU1D_P.js";import{n as f}from"./api.fpBzBw4U.js";var p=o(`<div class="notice notice--error">`),m=o(`<table class=table><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody>`),h=o(`<div class=dashboard-home><!$><!/><div class=stats-grid><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div><div class="card stat-card"><h3 class=stat-label></h3><p class=stat-value></p></div></div><div class=card><div class=card-header><h3></h3><a href=/content/post class="btn btn-secondary btn-sm"></a></div><!$><!/>`),g=o(`<p class=muted>`),_=o(`<tr><td><a></a></td><td></td><td></td><td class=muted>`);function v(e){return e}function y(e){let t=v(e).updated_at??v(e).updatedAt??v(e).created_at;if(typeof t!=`string`)return`—`;let n=new Date(t);return Number.isNaN(n.getTime())?`—`:n.toLocaleString(`pt-BR`)}function b(){let{t:o}=d(),[b,x]=n({total:`—`,published:`—`,drafts:`—`,media:`—`,users:`—`}),[S,C]=n([]),[w,T]=n(``);return e(async()=>{let[e,t,n,r,i,a]=await Promise.allSettled([f.getContent({limit:1}),f.getContent({limit:1,status:`PUBLISHED`}),f.getContent({limit:1,status:`DRAFT`}),f.listMedia({limit:1}),f.listUsers({limit:1}),f.getContent({limit:5})]),o=e=>e.status===`fulfilled`?String(e.value.total):`?`;x({total:o(e),published:o(t),drafts:o(n),media:o(r),users:o(i)}),a.status===`fulfilled`?C(a.value.data??[]):T(a.reason instanceof Error?a.reason.message:String(a.reason))}),(()=>{var e=c(h),n=e.firstChild,[d,f]=u(n.nextSibling),x=d.nextSibling,C=x.firstChild,T=C.firstChild,E=T.nextSibling,D=C.nextSibling,O=D.firstChild,k=O.nextSibling,A=D.nextSibling,j=A.firstChild,M=j.nextSibling,N=A.nextSibling,P=N.firstChild,F=P.nextSibling,I=N.nextSibling.firstChild,L=I.nextSibling,R=x.nextSibling,z=R.firstChild,B=z.firstChild,V=B.nextSibling,H=z.nextSibling,[U,W]=u(H.nextSibling);return s(e,r(t,{get when(){return w()},get children(){var e=c(p);return s(e,w),e}}),d,f),s(T,()=>o(`dashboard.stats.totalContent`)),s(E,()=>b().total),s(O,()=>o(`dashboard.stats.published`)),s(k,()=>b().published),s(j,()=>o(`dashboard.stats.drafts`)),s(M,()=>b().drafts),s(P,()=>o(`dashboard.stats.mediaFiles`)),s(F,()=>b().media),s(I,()=>o(`dashboard.stats.users`)),s(L,()=>b().users),s(B,()=>o(`dashboard.recent.title`)),s(V,()=>o(`dashboard.recent.viewAll`)),s(R,r(t,{get when(){return S().length>0},get fallback(){return(()=>{var e=c(g);return s(e,()=>o(`dashboard.recent.empty`)),e})()},get children(){var e=c(m),t=e.firstChild,n=t.firstChild.firstChild,u=n.nextSibling,d=u.nextSibling,f=d.nextSibling,p=t.nextSibling;return s(n,()=>o(`dashboard.recent.columns.title`)),s(u,()=>o(`dashboard.recent.columns.type`)),s(d,()=>o(`dashboard.recent.columns.status`)),s(f,()=>o(`dashboard.recent.columns.updated`)),s(p,r(a,{get each(){return S()},children:e=>(()=>{var t=c(_),n=t.firstChild,r=n.firstChild,a=n.nextSibling,o=a.nextSibling,u=o.nextSibling;return s(r,()=>String(v(e).title??`—`)),s(a,()=>String(v(e).type??`—`)),s(o,()=>String(v(e).status??`—`)),s(u,()=>y(e)),i(()=>l(r,`href`,`/content/${encodeURIComponent(String(v(e).type??`post`))}/edit?id=${encodeURIComponent(String(v(e).id??``))}`)),t})()})),e}}),U,W),e})()}export{b as DashboardHome};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./i18n.
|
|
1
|
+
import{t as e}from"./i18n.DQYU1D_P.js";import{n as t,t as n}from"./api.fpBzBw4U.js";import{t as r}from"./lucide.s17cczpi.js";import{t as i}from"./iconsAndAliases.ujTnkhnl.js";(async()=>{let e=document.querySelector(`.layout`)?.dataset.sessionState??`unavailable`;if(e!==`authenticated`){if(e===`anonymous`){window.location.replace(`/login`);return}await t.checkSession()===`unauthenticated`&&window.location.replace(`/login`)}})(),t.installProactiveRefresh(),t.ensureFreshSession();var a=null,o=null,s=e=>{a||(a=document.createElement(`div`),a.className=`okcms-rate-limit-notice`,a.setAttribute(`role`,`status`),a.setAttribute(`aria-live`,`polite`),document.body.append(a)),o&&(a.textContent=e?o(`rateLimit.noticeRetry`,{seconds:e}):o(`rateLimit.notice`)),a.classList.add(`visible`),setTimeout(()=>a?.classList.remove(`visible`),Math.min(1e4,(e??5)*1e3+4e3))};window.addEventListener(n,e=>{s(e.detail?.retryAfter??null)}),(async()=>{try{let t=document.documentElement.lang||`en`;o=await e(t)}catch{}})();try{localStorage.getItem(`sidebar-collapsed`)===`true`&&document.body.classList.add(`sidebar-collapsed`)}catch{}var c=()=>{document.querySelectorAll(`[data-nav-group]`).forEach(e=>{let t=e.querySelector(`:scope > .nav-group-header .nav-group-toggle`);t&&t.dataset.bound!==`true`&&(t.dataset.bound=`true`,t.addEventListener(`click`,()=>{let n=!e.classList.contains(`open`);e.classList.toggle(`open`,n),t.setAttribute(`aria-expanded`,String(n))}))})},l=(e,t,n=`nav-item`,r)=>{let i=document.createElement(`a`);return i.className=n,i.href=t,i.textContent=e,r&&(i.dataset.sidebarI18n=r),i},u=async()=>{let e=document.querySelector(`[data-post-types-menu]`);if(e)try{let[n,a]=await Promise.all([t.getContentTypes(),t.getTaxonomies().catch(()=>[])]);e.replaceChildren();let o=new URLSearchParams(window.location.search);for(let t of n){let n=document.createElement(`div`);n.className=`nav-type-entry`;let r=document.createElement(`div`);r.className=`nav-type-row`;let i=l(t.pluralLabel||t.name,`/content/${encodeURIComponent(t.slug)}`,`nav-item nav-type-link`);i.classList.toggle(`active`,window.location.pathname.startsWith(`/content/${t.slug}`));let s=document.createElement(`i`);s.dataset.lucide=t.menuIcon||`box`,s.className=`nav-type-icon`,s.setAttribute(`aria-hidden`,`true`),i.prepend(s),r.append(i);let c=a.filter(e=>e.attachTo?.includes(t.slug));if(n.append(r),c.length>0){let e=document.createElement(`div`);e.className=`nav-taxonomy-menu`;let r=o.get(`type`)===t.slug||window.location.pathname.startsWith(`/content/${t.slug}`);i.classList.add(`has-taxonomies`);let a=t=>{e.classList.toggle(`open`,t),i.classList.toggle(`is-expanded`,t)};a(r),i.addEventListener(`click`,()=>a(!0));for(let n of c){let r=l(n.labels?.plural_name??n.labels?.name??n.name,`/content/${encodeURIComponent(t.slug)}/taxonomy?taxonomy=${encodeURIComponent(n.slug)}`,`nav-subitem`),i=new URL(r.href,window.location.origin);r.classList.toggle(`active`,window.location.pathname===i.pathname&&o.get(`taxonomy`)===n.slug),e.append(r)}n.append(e)}e.append(n)}r({icons:i})}catch{}};c();{let e=document.querySelector(`[data-nav-group="settings"]`);(e?.querySelector(`:scope > a.nav-item`))?.addEventListener(`click`,()=>e?.classList.add(`open`))}{let e=document.querySelector(`[data-nav-group="themes"]`);(e?.querySelector(`:scope > a.nav-item`))?.addEventListener(`click`,()=>e?.classList.add(`open`))}r({icons:i}),u(),window.addEventListener(`okcms:content-models-changed`,()=>void u());var d=async t=>{let n=await e(t);document.querySelectorAll(`[data-sidebar-i18n]`).forEach(e=>{let t=e.dataset.sidebarI18n;t&&(e.textContent=n(t))})};window.addEventListener(`okcms:locale-changed`,e=>{let t=e.detail?.locale;t&&d(t)});
|