@oktis-works/admin 0.13.1 → 0.14.0
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.CCls_jrK.js → ActivityWidget.DmhtX3Xm.js} +2 -2
- package/dist/client/_astro/AdminBar.DKoQ5M3w.js +253 -0
- package/dist/client/_astro/ApiKeysManager.BaPrAyqm.js +1 -0
- package/dist/client/_astro/{AtGlanceWidget.DPkp-rxl.js → AtGlanceWidget.zlWIhmzI.js} +3 -3
- package/dist/client/_astro/{BaseLayout.DAkzjMTq.css → BaseLayout.Cp-O10m_.css} +1 -1
- package/dist/client/_astro/CommentsManager.DROGQRli.js +21 -0
- package/dist/client/_astro/ContentEditor.ChA5r0aE.js +3 -0
- package/dist/client/_astro/ContentEditor.CtCFQb14.js +1 -0
- package/dist/client/_astro/ContentTypeWorkspace.Dj9dP14a.js +1 -0
- package/dist/client/_astro/DashboardHome.Dn6_pJuX.js +1 -0
- package/dist/client/_astro/{DashboardLayout.astro_astro_type_script_index_0_lang.D2eyDf2o.js → DashboardLayout.astro_astro_type_script_index_0_lang.NiobGnWg.js} +1 -1
- package/dist/client/_astro/FbIcon.Bn4e_qFb.js +1 -0
- package/dist/client/_astro/FieldGroupEditor.CiFoYYb2.js +69 -0
- package/dist/client/_astro/FieldGroupList.CdN99hvU.js +1 -0
- package/dist/client/_astro/FieldRenderer.DYMREsip.js +1 -0
- package/dist/client/_astro/FloatingPanel.BetdW5N2.js +1 -0
- package/dist/client/_astro/{Footer.JI2Mqd9V.js → Footer.VGpnxqkW.js} +2 -2
- package/dist/client/_astro/GeneralSettings.mQ7FyhM-.js +1 -0
- package/dist/client/_astro/LogsManager.BUJ7baOa.js +1 -0
- package/dist/client/_astro/MediaLibrary.DMvI8KXX.js +1 -0
- package/dist/client/_astro/MenuManager._4YgarRt.js +1 -0
- package/dist/client/_astro/Modal.DbBPpkbR.js +1 -0
- package/dist/client/_astro/{PluginManager.D_E-lPWP.js → PluginManager.BozI4gXB.js} +2 -2
- package/dist/client/_astro/PostTypesManager.CifIQbeV.js +1 -0
- package/dist/client/_astro/QuickDraftWidget.CsG3_wS2.js +17 -0
- package/dist/client/_astro/ResourceHubs.DedTFbiz.js +1 -0
- package/dist/client/_astro/TaxonomiesManager.JqBPU1pf.js +1 -0
- package/dist/client/_astro/TaxonomyTermsManager.BLGRLt8p.js +1 -0
- package/dist/client/_astro/ThemeCustomizer.DrSQPj4W.js +49 -0
- package/dist/client/_astro/{ThemeManager.C0TKggfZ.js → ThemeManager.Csu39Xjr.js} +2 -2
- package/dist/client/_astro/UserCreateForm.C54wZYbf.js +1 -0
- package/dist/client/_astro/UsersManager.BYTWz2I8.js +1 -0
- package/dist/client/_astro/WebhooksManager.DeJ_f1Gk.js +1 -0
- package/dist/client/_astro/{api.CYg1SW2X.js → api.flUgn70U.js} +1 -1
- package/dist/client/_astro/client.ljtU74WL.js +1 -0
- package/dist/client/_astro/extensions.DtuT3Phu.js +1 -0
- package/dist/client/_astro/i18n.CBexpqud.js +1 -0
- package/dist/client/_astro/{login.astro_astro_type_script_index_0_lang.F2J3xZhK.js → login.astro_astro_type_script_index_0_lang.COYjmQTY.js} +1 -1
- package/dist/client/_astro/preload-helper.oCYlU9a4.js +1 -0
- package/dist/client/_astro/pt-BR.DlIhl4_A.js +1 -0
- package/dist/client/_astro/solid.Ck4Vtfe4.js +1 -0
- package/dist/client/_astro/src.CYKGYEyR.js +1 -0
- package/dist/client/_astro/store.CYzqtRKs.js +1 -0
- package/dist/client/_astro/web.DD6VKaIp.js +1 -0
- package/dist/server/chunks/{404_C9Eokbcv.mjs → 404_BxFvEXYq.mjs} +1 -1
- package/dist/server/chunks/{BaseLayout_DgDmTH8p.mjs → BaseLayout_BTzlA_Yr.mjs} +5 -5
- package/dist/server/chunks/ContentEditor_DStZ4RZE.mjs +655 -0
- package/dist/server/chunks/{DashboardLayout_CrxyUavx.mjs → DashboardLayout_PXoRmnBH.mjs} +354 -91
- package/dist/server/chunks/{ContentEditor_VK16JJMh.mjs → FieldRenderer_BlZgS0Im.mjs} +54 -615
- package/dist/server/chunks/{MediaLibrary_CZuj5byR.mjs → MediaLibrary_D7vu5VMd.mjs} +2 -2
- package/dist/server/chunks/{Modal_BfWFiyry.mjs → Modal_I_mBEOz2.mjs} +1 -1
- package/dist/server/chunks/{_id__BYx77RvL.mjs → _id__DFFoFesR.mjs} +5 -4
- package/dist/server/chunks/{_slug__CR6t9xra.mjs → _slug__DBH2w1la.mjs} +1 -1
- package/dist/server/chunks/{access_Bp3EnO2H.mjs → access_D1rk89Sh.mjs} +3 -3
- package/dist/server/chunks/{api-keys_Dt87wCbg.mjs → api-keys_BqhmvOer.mjs} +3 -3
- package/dist/server/chunks/comments_D_ta2fip.mjs +208 -0
- package/dist/server/chunks/{custom-fields_CC_ZhBpp.mjs → custom-fields_Cl8P-rrK.mjs} +2 -2
- package/dist/server/chunks/customize_DgtzmFmz.mjs +233 -0
- package/dist/server/chunks/{edit_VYWajKgt.mjs → edit_DTk4qFj5.mjs} +3 -3
- package/dist/server/chunks/{general_DtYlpwnZ.mjs → general_B-fEXuQn.mjs} +2 -2
- package/dist/server/chunks/{i18n_B-DWAN0e.mjs → i18n_BmAxDr2Q.mjs} +72 -6
- package/dist/server/chunks/{index_6a-jaApt.mjs → index_BKjRvOw4.mjs} +111 -62
- package/dist/server/chunks/{index_DgVVWosZ.mjs → index_BXnSMGRk.mjs} +2 -2
- package/dist/server/chunks/{index_DXmHKYjS.mjs → index_BcVtYp1L.mjs} +2 -2
- package/dist/server/chunks/{index_ieyhXCVt.mjs → index_DI8jAAVQ.mjs} +1 -1
- package/dist/server/chunks/{index_CDmqkl48.mjs → index_DXsKda1J.mjs} +2 -2
- package/dist/server/chunks/{login_DRJNLDt7.mjs → login_BGPEB2l4.mjs} +1 -1
- package/dist/server/chunks/{logs_CaMNxV6h.mjs → logs_XjDk7dqi.mjs} +2 -2
- package/dist/server/chunks/{menus_BsV0U5D5.mjs → menus_Kqym4CNK.mjs} +2 -2
- package/dist/server/chunks/{new_CyBl1PM1.mjs → new_BiikYmvu.mjs} +2 -2
- package/dist/server/chunks/{new_BQ2d8AHk.mjs → new_Dnp7PIHP.mjs} +3 -3
- package/dist/server/chunks/{plugins_BiaE4So1.mjs → plugins_C6qX0SAE.mjs} +2 -2
- package/dist/server/chunks/{post-types_BBKtACUm.mjs → post-types_Dr4t-TYB.mjs} +2 -2
- package/dist/server/chunks/{pt-BR_Da5G4GOV.mjs → pt-BR_DH_fNjEo.mjs} +49 -5
- package/dist/server/chunks/{taxonomies_gwfTSCOV.mjs → taxonomies_B0YzIdmD.mjs} +2 -2
- package/dist/server/chunks/{taxonomy_BKdLzLps.mjs → taxonomy_CCWZ58qQ.mjs} +64 -19
- package/dist/server/chunks/{themes_CqOUZiNg.mjs → themes_C7G3LcIz.mjs} +2 -2
- package/dist/server/chunks/{upload_keeE9Mn0.mjs → upload_BT3ud_vb.mjs} +2 -2
- package/dist/server/chunks/{webhooks_sTUPF0Xn.mjs → webhooks_CWW0L8EK.mjs} +2 -2
- package/dist/server/entry.mjs +104 -50
- package/dist/server/virtual_astro_middleware.mjs +1 -1
- package/package.json +5 -5
- package/dist/client/_astro/AdminBar.BW8zYZI3.js +0 -253
- package/dist/client/_astro/ApiKeysManager.Cj5tsk4N.js +0 -1
- package/dist/client/_astro/ContentEditor.CByEz10Q.js +0 -3
- package/dist/client/_astro/ContentEditor.kdYzULib.js +0 -1
- package/dist/client/_astro/ContentTypeWorkspace.BMVbiGGy.js +0 -1
- package/dist/client/_astro/DashboardHome.BuDu0DuB.js +0 -1
- package/dist/client/_astro/FbIcon.CUNS6rpP.js +0 -1
- package/dist/client/_astro/FieldGroupEditor.DGjV1n67.js +0 -69
- package/dist/client/_astro/FieldGroupList.BJ2TKSgY.js +0 -1
- package/dist/client/_astro/FloatingPanel.BeCEt_JP.js +0 -1
- package/dist/client/_astro/GeneralSettings.BSObhTfM.js +0 -1
- package/dist/client/_astro/LogsManager.B4-BxzoP.js +0 -1
- package/dist/client/_astro/MediaLibrary.BHVM3oJh.js +0 -1
- package/dist/client/_astro/MenuManager.BAn4_w6-.js +0 -1
- package/dist/client/_astro/Modal.BSZ5IjBl.js +0 -1
- package/dist/client/_astro/PostTypesManager.BHU1d2ta.js +0 -1
- package/dist/client/_astro/QuickDraftWidget.ClSsMYB_.js +0 -17
- package/dist/client/_astro/ResourceHubs.C3suqlP0.js +0 -1
- package/dist/client/_astro/TaxonomiesManager.BXYUiJEA.js +0 -1
- package/dist/client/_astro/TaxonomyTermsManager.obB3lkr3.js +0 -1
- package/dist/client/_astro/UserCreateForm.DaIOqr8v.js +0 -1
- package/dist/client/_astro/UsersManager.B5zFoWmR.js +0 -1
- package/dist/client/_astro/WebhooksManager.BRvVuxLt.js +0 -1
- package/dist/client/_astro/client.DU9Dc2oe.js +0 -1
- package/dist/client/_astro/extensions.Brl6zAPA.js +0 -1
- package/dist/client/_astro/i18n.vdBFsiPK.js +0 -1
- package/dist/client/_astro/pt-BR.CKJnipDe.js +0 -1
- package/dist/client/_astro/solid.D49dPDCT.js +0 -1
- package/dist/client/_astro/src.DXVWCoHp.js +0 -1
- package/dist/client/_astro/web.Bqbl_1YR.js +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
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.CBexpqud.js";import{n as h}from"./api.flUgn70U.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
|
+
.comments-tabs { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
|
|
3
|
+
.comments-tab {
|
|
4
|
+
display: inline-flex; align-items: center; gap: 0.4rem;
|
|
5
|
+
padding: 0.4rem 0.8rem; border: 1px solid var(--color-border);
|
|
6
|
+
border-radius: var(--radius-full); background: transparent;
|
|
7
|
+
color: var(--color-text); cursor: pointer; font-size: 0.8125rem;
|
|
8
|
+
}
|
|
9
|
+
.comments-tab.active { border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
|
|
10
|
+
.comments-count {
|
|
11
|
+
background: var(--color-muted-soft); color: var(--color-muted);
|
|
12
|
+
border-radius: var(--radius-full); padding: 0 0.45rem; font-size: 0.6875rem;
|
|
13
|
+
}
|
|
14
|
+
.comments-reload { margin-left: auto; }
|
|
15
|
+
.comments-author { display: flex; flex-direction: column; gap: 0.15rem; }
|
|
16
|
+
.comments-email { font-size: 0.75rem; }
|
|
17
|
+
.comments-body { max-width: 28rem; }
|
|
18
|
+
.comments-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; }
|
|
19
|
+
.empty-state { padding: 3rem; text-align: center; color: var(--color-muted); }
|
|
20
|
+
.skeleton { padding: 2rem; text-align: center; color: var(--color-muted); }
|
|
21
|
+
`),y=o(`<button type=button class=comments-tab><!$><!/><span class=comments-count>`),b=o(`<div class=skeleton>`),x=o(`<div class=empty-state>`),S=o(`<span class="muted comments-email">`),C=o(`<button type=button class="btn btn-primary btn-sm">`),w=o(`<button type=button class="btn btn-secondary btn-sm">`),T=o(`<tr><td class=comments-author><strong></strong><!$><!/></td><td class=comments-body></td><td class=muted></td><td class=muted></td><td class=comments-actions><!$><!/><!$><!/><!$><!/><button type=button class="btn btn-danger btn-sm">`),E=[`PENDING`,`APPROVED`,`SPAM`,`TRASHED`];function D(){let{t:o}=m(),[s,D]=n([]),[O,k]=n({}),[A,j]=n(`PENDING`),[M,N]=n(!0),[P,F]=n(``),[I,L]=n(null),R=async()=>{F(``);try{N(!0);let e=await h.getComments({status:A(),limit:100});D(e.comments??[]),k(e.counts??{})}catch(e){F(e instanceof Error?e.message:String(e))}finally{N(!1)}};e(R);let z=async e=>{j(e),await R()},B=async(e,t)=>{F(``),L(e.id);try{await h.updateComment(e.id,{status:t}),await R()}catch(e){F(e instanceof Error?e.message:String(e))}finally{L(null)}},V=async e=>{if(confirm(o(`comments.confirmDelete`))){F(``),L(e.id);try{await h.deleteComment(e.id),await R()}catch(e){F(e instanceof Error?e.message:String(e))}finally{L(null)}}},H=e=>e.authorName??e.author_name??`—`,U=e=>e.createdAt??e.created_at??``,W=e=>o(`comments.status.${e.toLowerCase()}`);return(()=>{var e=d(v),n=e.firstChild,[m,h]=p(n.nextSibling),D=m.nextSibling,k=D.firstChild,[j,N]=p(k.nextSibling),F=j.nextSibling,L=D.nextSibling,[G,K]=p(L.nextSibling);return G.nextSibling,l(e,r(t,{get when(){return P()},get children(){var e=d(g);return l(e,P),e}}),m,h),l(D,r(a,{each:E,children:e=>(()=>{var t=d(y),n=t.firstChild,[r,a]=p(n.nextSibling),o=r.nextSibling;return t.$$click=()=>void z(e),l(t,()=>W(e),r,a),l(o,()=>O()[e]??0),i(()=>t.classList.toggle(`active`,A()===e)),c(),t})()}),j,N),F.$$click=()=>void R(),l(F,()=>o(`comments.reload`)),l(e,r(t,{get when(){return!M()},get fallback(){return(()=>{var e=d(b);return l(e,()=>o(`comments.loading`)),e})()},get children(){return r(t,{get when(){return s().length>0},get fallback(){return(()=>{var e=d(x);return l(e,()=>o(`comments.empty`)),e})()},get children(){var e=d(_),n=e.firstChild.firstChild,m=n.firstChild.firstChild,h=m.nextSibling,g=h.nextSibling,v=g.nextSibling,y=n.nextSibling;return l(m,()=>o(`comments.author`)),l(h,()=>o(`comments.comment`)),l(g,()=>o(`comments.inReplyTo`)),l(v,()=>o(`comments.submitted`)),l(y,r(a,{get each(){return s()},children:e=>(()=>{var n=d(T),a=n.firstChild,s=a.firstChild,m=s.nextSibling,[h,g]=p(m.nextSibling),_=a.nextSibling,v=_.nextSibling,y=v.nextSibling,b=y.nextSibling,x=b.firstChild,[E,D]=p(x.nextSibling),O=E.nextSibling,[k,A]=p(O.nextSibling),j=k.nextSibling,[M,N]=p(j.nextSibling),P=M.nextSibling;return l(s,()=>H(e)),l(a,r(t,{get when(){return e.authorEmail},get children(){var t=d(S);return l(t,()=>e.authorEmail),t}}),h,g),l(_,()=>e.body),l(v,()=>e.contentId??e.content_id??`—`),l(y,()=>U(e)),l(b,r(t,{get when(){return e.status!==`APPROVED`},get children(){var t=d(C);return t.$$click=()=>void B(e,`APPROVED`),l(t,()=>o(`comments.approve`)),i(()=>u(t,`disabled`,I()===e.id)),c(),t}}),E,D),l(b,r(t,{get when(){return e.status!==`SPAM`},get children(){var t=d(w);return t.$$click=()=>void B(e,`SPAM`),l(t,()=>o(`comments.spam`)),i(()=>u(t,`disabled`,I()===e.id)),c(),t}}),k,A),l(b,r(t,{get when(){return e.status!==`TRASHED`},get children(){var t=d(w);return t.$$click=()=>void B(e,`TRASHED`),l(t,()=>o(`comments.trash`)),i(()=>u(t,`disabled`,I()===e.id)),c(),t}}),M,N),P.$$click=()=>void V(e),l(P,()=>o(`comments.delete`)),i(t=>{var r=e.status,i=I()===e.id;return r!==t.e&&f(n,`data-comment-status`,t.e=r),i!==t.t&&u(P,`disabled`,t.t=i),t},{e:void 0,t:void 0}),c(),n})()})),e}})}}),G,K),i(()=>u(F,`disabled`,M())),c(),e})()}s([`click`]);export{D as CommentsManager};
|
|
@@ -0,0 +1,3 @@
|
|
|
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.CBexpqud.js";import{n as _}from"./api.flUgn70U.js";import{n as v,t as ee}from"./FieldRenderer.DYMREsip.js";import{c as y,n as b,o as x,t as S}from"./store.CYzqtRKs.js";var C=new Set(`a.abbr.b.blockquote.br.code.dd.div.dl.dt.em.figcaption.figure.h1.h2.h3.h4.h5.h6.hr.i.img.li.ol.p.pre.q.s.span.strong.sub.sup.u.ul`.split(`.`)),w=new Set([`br`,`hr`,`img`]),T=new Set([`script`,`style`,`iframe`,`object`,`embed`,`svg`,`math`,`textarea`,`title`,`noscript`,`template`]),E=new Set([`class`,`title`,`alt`,`width`,`height`,`href`,`src`,`target`,`rel`]),D=new Set([`http`,`https`,`mailto`,`tel`]),O=new Set([`http`,`https`]),k={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,tab:` `,newline:`
|
|
2
|
+
`,sol:`/`,lpar:`(`,rpar:`)`,num:`#`,period:`.`,excl:`!`,comma:`,`};function A(e){return e.replace(/&#x([0-9a-fA-F]+);?/g,(e,t)=>j(parseInt(t,16))).replace(/&#(\d+);?/g,(e,t)=>j(parseInt(t,10))).replace(/&([a-zA-Z][a-zA-Z0-9]{1,30});?/g,(e,t)=>k[t in k?t:t.toLowerCase()]??e)}function j(e){if(!Number.isFinite(e)||e<0||e>1114111)return``;try{return String.fromCodePoint(e)}catch{return``}}function M(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}function N(e){return e.replace(/&(?![a-zA-Z][a-zA-Z0-9]{1,30};|#[0-9]{1,7};|#[xX][0-9a-fA-F]{1,6};)|[<>]/g,e=>e===`&`?`&`:e===`<`?`<`:`>`)}function P(e,t){let n=A(e).replace(/[\t\n\r]/g,``).trim(),r=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(n);return!r||t.has(r[1].toLowerCase())}function F(e){return M(A(e))}function I(e){let t=[],n=e.length,r=0,i=e=>e===` `||e===` `||e===`
|
|
3
|
+
`||e===`\r`||e===`\f`;for(;r<n;){for(;r<n&&(i(e.charAt(r))||e.charAt(r)===`/`);)r++;if(r>=n)break;let a=``;for(;r<n&&!i(e.charAt(r))&&e.charAt(r)!==`=`&&e.charAt(r)!==`>`&&e.charAt(r)!==`/`&&e.charAt(r)!==`<`;)a+=e.charAt(r),r++;if(!a){r++;continue}let o=``,s=r;for(;s<n&&i(e.charAt(s));)s++;if(s<n&&e.charAt(s)===`=`){for(s++;s<n&&i(e.charAt(s));)s++;if(s<n&&(e.charAt(s)===`"`||e.charAt(s)===`'`)){let t=e.charAt(s);s++;let r=s;for(;s<n&&e.charAt(s)!==t;)s++;o=e.slice(r,s),s++}else{let t=s;for(;s<n&&!i(e.charAt(s))&&e.charAt(s)!==`>`;)s++;o=e.slice(t,s)}r=s}t.push([a.toLowerCase(),o])}return t}function L(e,t){let n=[],r=new Set,i=!1;for(let[e,a]of t)if(E.has(e)&&!r.has(e)&&(e!==`href`||P(a,D))&&(e!==`src`||P(a,O))){if(e===`target`){if(F(a)!==`_blank`)continue;i=!0;continue}e!==`rel`&&(r.add(e),n.push(`${e}="${F(a)}"`))}return e===`a`&&i&&(n.push(`target="_blank"`),n.push(`rel="noopener noreferrer"`)),n.length>0?` ${n.join(` `)}`:``}function te(e){if(typeof e!=`string`||e.length===0)return``;let t=e.toLowerCase(),n=e.length,r=[],i=``,a=0;for(;a<n;){let o=e.indexOf(`<`,a);if(o===-1){i+=N(e.slice(a));break}if(o>a&&(i+=N(e.slice(a,o))),e.startsWith(`<!--`,o)){let t=e.indexOf(`-->`,o+4);a=t===-1?n:t+3;continue}if(e.charAt(o+1)===`!`||e.charAt(o+1)===`?`){let t=e.indexOf(`>`,o+2);a=t===-1?n:t+1;continue}let s=/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)(?=[\s/>])/.exec(e.slice(o,Math.min(o+64,n)));if(!s){i+=`<`,a=o+1;continue}let c=s[1]===`/`,l=s[2].toLowerCase(),u=o+s[0].length,d=``;for(;u<n;){let t=e[u];if(d)t===d&&(d=``);else if(t===`"`||t===`'`)d=t;else if(t===`>`)break;u++}if(u>=n)break;let f=e.slice(o+s[0].length,u);if(a=u+1,!c&&T.has(l)){let r=t.indexOf(`</${l}`,a);if(r===-1)break;let i=e.indexOf(`>`,r);a=i===-1?n:i+1;continue}if(c){let e=r.lastIndexOf(l);if(e!==-1){for(let t=r.length-1;t>=e;t--)i+=`</${r[t]}>`;r.length=e}continue}if(!C.has(l))continue;let p=L(l,I(f));w.has(l)?i+=`<${l}${p} />`:(i+=`<${l}${p}>`,r.push(l))}for(let e=r.length-1;e>=0;e--)i+=`</${r[e]}>`;return i}var ne=s(`<div class="notice notice--success">`),re=s(`<input class=classic-editor__title required>`),ie=s(`<div class=classic-editor__toolbar role=toolbar><button type=button><strong>B</strong></button><button type=button><em>I</em></button><button type=button><u>U</u></button><span class=classic-editor__toolbar-divider></span><button type=button>❝</button><button type=button>• List</button><button type=button>1. List</button><button type=button>Link`),ae=s(`<div class=classic-editor__body data-classic-editor role=textbox aria-multiline=true>`),oe=s(`<div class="plugin-editor plugin-editor--below">`),se=s(`<label class=classic-editor__excerpt><span></span><textarea class=input rows=4>`),ce=s(`<section class="card custom-fields"><h3></h3><!$><!/>`),le=s(`<section class="card classic-editor__panel"><h3></h3><input class=input><p class=muted>`),ue=s(`<section class="card classic-editor__panel"><h3></h3><label><!$><!/><select class=input><option value></option><!$><!/>`),de=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><!$><!/>`),fe=s(`<div class="notice notice--error">`),pe=s(`<div class=plugin-editor>`),me=s(`<option>`);function R(s){let{t:c}=g(),[C,w]=r([]),[T,E]=r([]),[D,O]=r([]),[k,A]=r({}),[j,M]=r([]),[N,P]=r(!1),[F,I]=r(``),[L,R]=r(S()),[z,B]=r({type:s.initialType||`post`,title:``,status:`DRAFT`}),V=()=>new Set(C().find(e=>e.slug===z().type)?.supports??[`title`,`editor`]),H=e=>V().has(e),U=n(()=>{let e=z().type;return(L().editors??[]).filter(t=>t.screens.includes(`*`)||t.screens.includes(e)).sort((e,t)=>(e.priority??0)-(t.priority??0))[0]??null}),he=()=>({editorId:U().id,contentType:z().type,contentId:z().id??``,body:G(),setBody:e=>A({...k(),content:e}),disabled:N()}),ge=(e,t)=>t||e[0]?.slug||`post`,_e=()=>{let e=new Set;for(let t of D())for(let n of t.manifest?.provides?.layouts??[])e.add(n);return[...e].sort()},W=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??[]));E(v(r.flat()))}catch(e){M([e instanceof Error?e.message:String(e)])}};e(async()=>{b().then(R);let e=[];try{let[t,n]=await Promise.all([_.getContentTypes(),_.getThemes().catch(()=>[])]);e=t,w(t),O(n)}catch(e){M([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(z().type);if(!e){await W({type:z().type,status:z().status});return}let n=e;B({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}),A(e.body??{})}catch(e){M([e instanceof Error?e.message:String(e)])}else e.some(e=>e.slug===z().type)||B({...z(),type:ge(e,s.initialType)});await W({type:z().type,slug:z().slug,status:z().status})});let G=()=>{let e=k().content;return typeof e==`string`?e:``},ve=e=>{A({...k(),content:e.innerHTML})},K=(e,t)=>{document.execCommand(e,!1,t);let n=document.querySelector(`[data-classic-editor]`);n&&ve(n)},ye=async e=>{e.preventDefault(),I(``),M([]),P(!0);try{let e={...z(),layout:z().layout||null,body:{...k(),content:te(G())},...H(`excerpt`)?{}:{excerpt:void 0},...H(`thumbnail`)?{}:{featuredImageId:void 0}},t=z().id?await _.updateContent(z().id,e):await _.createContent(e);B({...z(),id:t.id}),I(c(`content.editor.saved`))}catch(e){M([e instanceof Error?e.message:String(e)])}finally{P(!1)}};return(()=>{var e=f(de),n=e.firstChild,[r,s]=m(n.nextSibling),g=r.nextSibling,[_,v]=m(g.nextSibling),b=_.nextSibling,S=b.firstChild,w=S.firstChild,E=w.nextSibling,D=S.nextSibling.firstChild,O=D.nextSibling,M=b.nextSibling,P=M.firstChild,I=P.firstChild,R=I.firstChild,[V,ge]=m(R.nextSibling),W=V.nextSibling,q=W.firstChild,be=q.firstChild,[xe,Se]=m(be.nextSibling);xe.nextSibling;var J=q.nextSibling,Ce=W.nextSibling,[we,Te]=m(Ce.nextSibling),Ee=we.nextSibling,[De,Oe]=m(Ee.nextSibling),ke=De.nextSibling,[Ae,je]=m(ke.nextSibling),Me=I.nextSibling,[Ne,Pe]=m(Me.nextSibling),Fe=Ne.nextSibling,[Ie,Le]=m(Fe.nextSibling),Y=P.nextSibling,Re=Y.firstChild,ze=Re.firstChild,X=ze.nextSibling,Be=X.firstChild,[Ve,He]=m(Be.nextSibling),Z=Ve.nextSibling,Q=Z.firstChild,Ue=Q.nextSibling,We=Ue.nextSibling,Ge=X.nextSibling,Ke=Re.nextSibling,[qe,Je]=m(Ke.nextSibling),Ye=qe.nextSibling,[$,Xe]=m(Ye.nextSibling),Ze=$.nextSibling,[Qe,$e]=m(Ze.nextSibling),et=M.nextSibling,[tt,nt]=m(et.nextSibling);return e.addEventListener(`submit`,ye),u(e,i(t,{get when(){return j().length>0},get children(){return i(o,{get each(){return j()},children:e=>(()=>{var t=f(fe);return u(t,e),t})()})}}),r,s),u(e,i(t,{get when(){return F()},get children(){var e=f(ne);return u(e,F),e}}),_,v),u(w,()=>C().find(e=>e.slug===z().type)?.singularLabel||z().type),u(E,(()=>{var e=h(()=>!!z().id);return()=>e()?c(`content.editor.editing`):c(`content.editor.adding`)})()),u(D,()=>c(`content.editor.backToList`)),u(O,(()=>{var e=h(()=>!!N());return()=>e()?c(`content.editor.saving`):c(`content.editor.save`)})()),u(I,i(t,{get when(){return H(`title`)},get children(){var e=f(re);return e.$$input=e=>B({...z(),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`,z().title)),l(),e}}),V,ge),u(q,()=>c(`content.editor.slug`),xe,Se),J.$$input=e=>B({...z(),slug:e.currentTarget.value}),u(I,i(t,{get when(){return H(`editor`)},get children(){return i(t,{get when(){return U()?.mode!==`replace-body`},get fallback(){return(()=>{var e=f(pe);return u(e,i(y,{get componentId(){return U().componentId},get extraProps(){return he()}})),a(()=>p(e,`data-plugin-editor`,U().id)),e})()},get children(){return[(()=>{var e=f(ie),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,i=r.nextSibling.nextSibling,o=i.nextSibling,s=o.nextSibling,u=s.nextSibling;return t.$$click=()=>K(`bold`),n.$$click=()=>K(`italic`),r.$$click=()=>K(`underline`),i.$$click=()=>K(`formatBlock`,`blockquote`),o.$$click=()=>K(`insertUnorderedList`),s.$$click=()=>K(`insertOrderedList`),u.$$click=()=>K(`createLink`,window.prompt(c(`content.editor.linkPrompt`))||``),a(()=>p(e,`aria-label`,c(`content.editor.toolbar`))),l(),e})(),(()=>{var e=f(ae);return e.$$input=e=>ve(e.currentTarget),p(e,`contenteditable`,!0),a(t=>{var n=c(`content.editor.bodyPlaceholder`),r=te(G());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})()]}})}}),we,Te),u(I,i(t,{get when(){return U()?.mode===`below`},get children(){var e=f(oe);return u(e,i(y,{get componentId(){return U().componentId},get extraProps(){return he()}})),a(()=>p(e,`data-plugin-editor`,U().id)),e}}),De,Oe),u(I,i(t,{get when(){return H(`excerpt`)},get children(){var e=f(se),t=e.firstChild,n=t.nextSibling;return u(t,()=>c(`content.editor.excerpt`)),n.$$input=e=>B({...z(),excerpt:e.currentTarget.value}),a(()=>d(n,`value`,z().excerpt??``)),l(),e}}),Ae,je),u(P,i(t,{get when(){return T().length>0},get children(){var e=f(ce),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 T()},children:e=>i(ee,{field:e,get values(){return k()},onChange:(e,t)=>A({...k(),[e]:t}),t:c})}),r,a),e}}),Ne,Pe),u(P,i(x,{get extensions(){return L()},get screen(){return z().type},context:`normal`}),Ie,Le),u(ze,()=>c(`content.editor.publishPanel`)),u(X,()=>c(`content.editor.status`),Ve,He),Z.addEventListener(`change`,e=>B({...z(),status:e.currentTarget.value})),u(Q,()=>c(`content.editor.statusOptions.draft`)),u(Ue,()=>c(`content.editor.statusOptions.published`)),u(We,()=>c(`content.editor.statusOptions.archived`)),u(Ge,(()=>{var e=h(()=>!!N());return()=>e()?c(`content.editor.saving`):c(`content.editor.save`)})()),u(Y,i(t,{get when(){return H(`thumbnail`)},get children(){var e=f(le),t=e.firstChild,n=t.nextSibling,r=n.nextSibling;return u(t,()=>c(`content.editor.featuredImage`)),n.$$input=e=>B({...z(),featuredImageId:e.currentTarget.value}),u(r,()=>c(`content.editor.featuredImageHint`)),a(()=>p(n,`placeholder`,c(`content.editor.mediaIdPlaceholder`))),a(()=>d(n,`value`,z().featuredImageId??``)),l(),e}}),qe,Je),u(Y,i(t,{get when(){return _e().length>0},get children(){var e=f(ue),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=>B({...z(),layout:e.currentTarget.value||null})),u(h,()=>c(`content.editor.layoutAuto`)),u(p,i(o,{get each(){return _e()},children:e=>(()=>{var t=f(me);return d(t,`value`,e),u(t,e),t})()}),_,v),a(()=>d(p,`value`,z().layout??``)),e}}),$,Xe),u(Y,i(x,{get extensions(){return L()},get screen(){return z().type},context:`side`}),Qe,$e),u(e,i(x,{get extensions(){return L()},get screen(){return z().type},context:`advanced`}),tt,nt),a(e=>{var t=`/content/${encodeURIComponent(z().type)}`,n=N(),r=c(`content.editor.slugPlaceholder`),i=N();return t!==e.e&&p(D,`href`,e.e=t),n!==e.t&&d(O,`disabled`,e.t=n),r!==e.a&&p(J,`placeholder`,e.a=r),i!==e.o&&d(Ge,`disabled`,e.o=i),e},{e:void 0,t:void 0,a:void 0,o:void 0}),a(()=>d(J,`value`,z().slug??``)),a(()=>d(Z,`value`,z().status)),l(),e})()}c([`input`,`click`]);export{R as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./ContentEditor.ChA5r0aE.js";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.CBexpqud.js";import{n as p}from"./api.flUgn70U.js";import{c as m,i as h,n as g,o as _,r as v,s as ee,t as y}from"./src.CYKGYEyR.js";import{t as b}from"./ContentEditor.ChA5r0aE.js";import{c as x,n as S,r as te,t as C}from"./store.CYzqtRKs.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(),[b,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(C()),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()=>{S().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(x,{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(y,{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,y=n.nextSibling,[x,S]=u(y.nextSibling),C=x.nextSibling,[w,T]=u(C.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}}),x,S),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(ee,{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(te,{get extensions(){return J()}}),K,q),s(e,i(v,{get children(){return[i(m,{get columns(){return ce()},get data(){return b()},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(b,{get initialType(){return e().slug},singleton:!0})}})})}export{N as ContentTypeWorkspace};
|
|
@@ -0,0 +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.CBexpqud.js";import{n as f}from"./api.flUgn70U.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.CBexpqud.js";import{n as t,t as n}from"./api.flUgn70U.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}`),a=document.createElement(`span`);a.className=`nav-type-caret`,a.setAttribute(`aria-hidden`,`true`),a.textContent=`▾`,i.classList.add(`has-taxonomies`),i.append(a);let s=t=>{e.classList.toggle(`open`,t),i.classList.toggle(`is-expanded`,t)};s(r),i.addEventListener(`click`,()=>s(!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 nav-taxonomy-item`),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 > .nav-group-header 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)});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,p as t}from"./solid.Ck4Vtfe4.js";import{_ as n,i as r,m as i,o as a}from"./web.DD6VKaIp.js";import{t as o}from"./iconsAndAliases.ujTnkhnl.js";var s=n(`<span aria-hidden=true>`),c=e=>e.replace(/(^|[-_])(\w)/g,(e,t,n)=>n.toUpperCase()),l=`xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"`,u=e=>Object.entries(e).map(([e,t])=>`${e}="${String(t).replace(/"/g,`"`)}"`).join(` `);function d(n){let d=e(()=>{let e=o[c(n.name)];return e?`<svg ${l}>${e.map(([e,t])=>`<${e} ${u(t)} />`).join(``)}</svg>`:``});return(()=>{var e=a(s);return t(t=>{var a=n.class,o=d();return a!==t.e&&r(e,t.e=a),o!==t.t&&i(e,`innerHTML`,t.t=o),t},{e:void 0,t:void 0}),e})()}export{d as t};
|