@blinkk/root-cms 3.1.6 → 3.1.7
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/app.js +1 -1
- package/dist/{chunk-U4TMO2LI.js → chunk-NIBAHWGP.js} +2 -2
- package/dist/plugin.js +1 -1
- package/dist/ui/AIPage-XPE7F5AF.js +1 -0
- package/dist/ui/AssetsPage-C3ZEENBO.js +1 -0
- package/dist/ui/CollectionPage-VQ4WJHJB.js +1 -0
- package/dist/ui/ComparePage-VKOXKID4.js +1 -0
- package/dist/ui/{DataPage-YEIS7HBN.js → DataPage-JXZ2Z3DG.js} +1 -1
- package/dist/ui/{DataSourcePage-VD6YBDRW.js → DataSourcePage-X3NSUOTP.js} +1 -1
- package/dist/ui/{DocTranslationsPage-6XLREBPQ.js → DocTranslationsPage-AJGT52XQ.js} +1 -1
- package/dist/ui/DocumentPage-ZFD2KE3A.js +1 -0
- package/dist/ui/{EditDataSourcePage-E4PSKSG3.js → EditDataSourcePage-EMK3F6HD.js} +1 -1
- package/dist/ui/EditReleasePage-3IAERDSH.js +1 -0
- package/dist/ui/EmbeddedAIPage-2W5F7QFL.js +1 -0
- package/dist/ui/EmbeddedDocumentPage-BESFW2YZ.js +1 -0
- package/dist/ui/{ImageEditorDialog-YDKOGVJV.js → ImageEditorDialog-JDXMU2FC.js} +1 -1
- package/dist/ui/LogsPage-KCD4XZ2N.js +1 -0
- package/dist/ui/{NewDataSourcePage-NJJDHGPX.js → NewDataSourcePage-EZDU7HGA.js} +1 -1
- package/dist/ui/NewReleasePage-FFTRUIP4.js +1 -0
- package/dist/ui/{NotFoundPage-CA7XVXUO.js → NotFoundPage-JGG2NTUE.js} +1 -1
- package/dist/ui/{ProjectPage-XUBJSCWB.js → ProjectPage-HT5JKR33.js} +1 -1
- package/dist/ui/ReleasePage-OYWLGV4D.js +1 -0
- package/dist/ui/{ReleasesPage-OY7OKC3C.js → ReleasesPage-XEII7FBC.js} +1 -1
- package/dist/ui/{SettingsPage-5EQUY52A.js → SettingsPage-7GIBTPB5.js} +1 -1
- package/dist/ui/SidebarToolsPage-GQYTZDAC.js +1 -0
- package/dist/ui/TaskPage-SNDDYDZY.js +1 -0
- package/dist/ui/TasksPage-CEVWOY67.js +1 -0
- package/dist/ui/{TranslationsArbPage-PG5USRYB.js → TranslationsArbPage-ADRLLAIW.js} +1 -1
- package/dist/ui/{TranslationsEditPage-GV3ZJXTY.js → TranslationsEditPage-PSKA7K44.js} +1 -1
- package/dist/ui/{TranslationsPage-3AKSMCNF.js → TranslationsPage-NGCLDSK7.js} +2 -2
- package/dist/ui/{chunk-75NMQ3LW.js → chunk-3YBRRPAN.js} +1 -1
- package/dist/ui/{chunk-QLIIVG5Q.js → chunk-5F5XJPKD.js} +1 -1
- package/dist/ui/{chunk-ST6QNIWT.js → chunk-6ZVMJXLE.js} +7 -7
- package/dist/ui/chunk-7OU4ERTS.js +87 -0
- package/dist/ui/chunk-A2JZYRE3.js +1 -0
- package/dist/ui/chunk-B74M7NEV.js +1 -0
- package/dist/ui/{chunk-UOKVF54Y.js → chunk-BLHXP3SR.js} +1 -1
- package/dist/ui/{chunk-UJX25CXD.js → chunk-BOIY4J2R.js} +1 -1
- package/dist/ui/chunk-CEWU5VSJ.js +1 -0
- package/dist/ui/{chunk-34W6H4YG.js → chunk-CXMVFNX3.js} +1 -1
- package/dist/ui/{chunk-F7RQT4XN.js → chunk-EET5AS64.js} +1 -1
- package/dist/ui/{chunk-WASID5UU.js → chunk-GJ7ES2LA.js} +1 -1
- package/dist/ui/{chunk-2RRM4HEQ.js → chunk-H5JL376P.js} +1 -1
- package/dist/ui/{chunk-H37RXS4R.js → chunk-HKCOKHA2.js} +1 -1
- package/dist/ui/{chunk-QGAPMQEJ.js → chunk-HUYP5U4K.js} +1 -1
- package/dist/ui/{chunk-NCZD5IWS.js → chunk-HWON6MV4.js} +1 -1
- package/dist/ui/{chunk-HXSB6YB2.js → chunk-I3H465Z6.js} +1 -1
- package/dist/ui/{chunk-535JU7FU.js → chunk-ILFWJKSS.js} +1 -1
- package/dist/ui/chunk-K7IG7PO2.js +1 -0
- package/dist/ui/{chunk-LAXQZPE3.js → chunk-LKTN7YVM.js} +1 -1
- package/dist/ui/{chunk-PLYSJ7W5.js → chunk-LS2JH5QF.js} +1 -1
- package/dist/ui/{chunk-QFDU6FXP.js → chunk-MALK5YEV.js} +1 -1
- package/dist/ui/{chunk-YP6ZH3MT.js → chunk-MFRPYPCF.js} +1 -1
- package/dist/ui/{chunk-RB23LLKL.js → chunk-OKNBFTYR.js} +1 -1
- package/dist/ui/{chunk-A7IZAHBZ.js → chunk-P2RVKNG4.js} +1 -1
- package/dist/ui/{chunk-JBLSUM6W.js → chunk-P57AFOMR.js} +1 -1
- package/dist/ui/{chunk-HV3JJ5UT.js → chunk-PLTI4NG7.js} +1 -1
- package/dist/ui/chunk-PY4JH5SN.js +1 -0
- package/dist/ui/{chunk-44ZU5WMI.js → chunk-SBAY52SC.js} +1 -1
- package/dist/ui/{chunk-Y5EOMMNI.js → chunk-TCKR2BL4.js} +1 -1
- package/dist/ui/{chunk-C5FRMXDS.js → chunk-TCRDGNM4.js} +1 -1
- package/dist/ui/chunk-TCWN5YRW.js +1 -0
- package/dist/ui/{chunk-U7LSFUHT.js → chunk-TZWCCNSA.js} +1 -1
- package/dist/ui/{chunk-2PTLQRTU.js → chunk-U5OXKKBN.js} +1 -1
- package/dist/ui/{chunk-O7ESOZQO.js → chunk-VZGDXWRK.js} +1 -1
- package/dist/ui/{chunk-3LEYSXZP.js → chunk-X3VDQDHP.js} +1 -1
- package/dist/ui/chunk-XBYMUPZF.js +19 -0
- package/dist/ui/{chunk-QRAFYIAW.js → chunk-XYXL5HSZ.js} +1 -1
- package/dist/ui/chunk-Y7RYSRP7.js +7 -0
- package/dist/ui/{chunk-WRA24P66.js.LEGAL.txt → chunk-Y7RYSRP7.js.LEGAL.txt} +1 -0
- package/dist/ui/chunk-YIKHJONY.js +1 -0
- package/dist/ui/{chunk-UCYWQEAS.js → chunk-ZD3ORGA6.js} +1 -1
- package/dist/ui/{chunk-YBHFGQ3Z.js → chunk-ZQDUWURP.js} +1 -1
- package/dist/ui/{chunk-PIJ3E47R.js → chunk-ZYSR5UIW.js} +1 -1
- package/dist/ui/ui.css +1 -1
- package/dist/ui/ui.js +1 -1
- package/package.json +3 -3
- package/dist/ui/AIPage-EO5WH25R.js +0 -1
- package/dist/ui/AssetsPage-ESLB4R3I.js +0 -1
- package/dist/ui/CollectionPage-MXN7XKUX.js +0 -1
- package/dist/ui/ComparePage-TY7VJVE3.js +0 -1
- package/dist/ui/DocumentPage-2HNNEGRI.js +0 -1
- package/dist/ui/EditReleasePage-DOMXJXCU.js +0 -1
- package/dist/ui/EmbeddedAIPage-U5LONYH2.js +0 -1
- package/dist/ui/EmbeddedDocumentPage-HYV5GPK6.js +0 -1
- package/dist/ui/LogsPage-6KV3CQLH.js +0 -1
- package/dist/ui/NewReleasePage-FXHPFUVG.js +0 -1
- package/dist/ui/ReleasePage-NLGRYJX7.js +0 -1
- package/dist/ui/SidebarToolsPage-FWG6TIDI.js +0 -1
- package/dist/ui/TaskPage-APNRUOYG.js +0 -1
- package/dist/ui/TasksPage-FTEELXVZ.js +0 -1
- package/dist/ui/chunk-235TRWJF.js +0 -81
- package/dist/ui/chunk-56NMZYX6.js +0 -19
- package/dist/ui/chunk-6WJQBFN5.js +0 -1
- package/dist/ui/chunk-EYJ6GKZR.js +0 -1
- package/dist/ui/chunk-G5647K25.js +0 -1
- package/dist/ui/chunk-OWYV43BT.js +0 -1
- package/dist/ui/chunk-QWB6MAPJ.js +0 -7
- package/dist/ui/chunk-VJRMR2JM.js +0 -1
- package/dist/ui/chunk-WRA24P66.js +0 -7
- package/dist/ui/chunk-Z3ZJJWFT.js +0 -1
- package/dist/ui/chunk-ZAJPNVYS.js +0 -1
- /package/dist/ui/{ImageEditorDialog-YDKOGVJV.js.LEGAL.txt → ImageEditorDialog-JDXMU2FC.js.LEGAL.txt} +0 -0
- /package/dist/ui/{chunk-ST6QNIWT.js.LEGAL.txt → chunk-6ZVMJXLE.js.LEGAL.txt} +0 -0
- /package/dist/ui/{chunk-235TRWJF.js.LEGAL.txt → chunk-7OU4ERTS.js.LEGAL.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ne}from"./chunk-44ZU5WMI.js";import{a as _e}from"./chunk-OWYV43BT.js";import{h as O}from"./chunk-ZAJPNVYS.js";import{a as oe,e as te,j as le}from"./chunk-EYJ6GKZR.js";import"./chunk-HV3JJ5UT.js";import{b as F,c as H,d as S,f as A}from"./chunk-G5647K25.js";import"./chunk-VJRMR2JM.js";import{a as x}from"./chunk-QFDU6FXP.js";import"./chunk-JDW4UORS.js";import{a as B}from"./chunk-UJX25CXD.js";import"./chunk-Z2CRNO3I.js";import"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-YDO2EDVY.js";import{b as C}from"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import{b as ee}from"./chunk-W5DOO6ID.js";import{a as Q}from"./chunk-YBHFGQ3Z.js";import"./chunk-2PTLQRTU.js";import"./chunk-PIJ3E47R.js";import"./chunk-NCZD5IWS.js";import{a as ce}from"./chunk-QLIIVG5Q.js";import{c as ie}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import{B as Y,z as Z}from"./chunk-XOWWPE7X.js";import{d as V,e as w}from"./chunk-WASID5UU.js";import{$a as q,Ca as X,Fa as k,Ga as e,Ta as K,Ua as W,V as I,W as M,a as U,ab as G,ba as $,c as E,cb as J,da as D,fb as z,j as me,qa as P,za as j}from"./chunk-WRA24P66.js";import{d as N}from"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";me();var R=[{value:"comfortable",label:"Comfortable",Icon:K},{value:"compact",label:"Compact",Icon:W}];function L(o){let{route:i}=V(),l=window.__ROOT_CTX.rootConfig.projectId;ce(o.collection?o.collection:"Content"),E(()=>{let c=window.__ROOT_CTX.collections,n=`root-cms::${l}::last_collection`;if(o.collection)window.localStorage.setItem(n,o.collection);else{let a=window.localStorage.getItem(n);if(a&&c[a]){i(`/cms/content/${a}`);return}if(window.__ROOT_CTX.collections.Pages){i("/cms/content/Pages");return}let s=Object.keys(window.__ROOT_CTX.collections)||[];if(s.length>0){let h=s[0];i(`/cms/content/${h}`);return}console.warn("no collections")}},[o.collection,l]);let _=window.__ROOT_CTX.collections;return e(ie,{children:e("div",{className:"CollectionPage",children:e("div",{className:"CollectionPage__layout",children:[e("div",{className:"CollectionPage__side",children:e(ne,{collections:_,activeCollectionId:o.collection,projectId:l})}),e("div",{className:"CollectionPage__main",children:o.collection&&e(L.Collection,{collection:o.collection},o.collection)})]})})})}L.Collection=o=>{let{roles:i}=Q(),l=window.firebase.user.email||"",_=ee(i,l),[c,n]=x(`root::CollectionPage:${o.collection}:orderBy`,"modifiedAt"),[a,s]=x(`root::CollectionPage:${o.collection}:showArchived`,!1),[h,m]=U(!1),t=window.__ROOT_CTX.collections[o.collection];if(!t)return route("/cms/content"),e(N,{});let d=!!t.viewOptions?.compact,[r,p]=x("root::CollectionPage:density","comfortable"),g=d?"compact":r,f=g==="compact",v=[{value:"slug",label:"A-Z"},{value:"slugDesc",label:"Z-A"},{value:"title",label:"Title (A-Z)"},{value:"titleDesc",label:"Title (Z-A)"},{value:"newest",label:"Newest"},{value:"oldest",label:"Oldest"},{value:"modifiedAt",label:"Last modified"},{value:"modifiedAtAsc",label:"Least recently modified"},...t.sortOptions?.map(u=>({value:u.id,label:u.label}))||[]],[b,de,T]=te(o.collection,{orderBy:c,includeArchived:a}),re=b&&T.length===0,ge=!b&&T.length===0;return e(N,{children:[e(le,{collection:o.collection,opened:h,onClose:()=>m(!1)}),e("div",{className:"CollectionPage__collection",children:e("div",{className:"CollectionPage__collection__docsTab",children:[e("div",{className:"CollectionPage__collection__docsTab__header",children:[e("div",{className:"CollectionPage__collection__docsTab__header__title",children:t.name||o.collection}),e("div",{className:"CollectionPage__collection__docsTab__controls",children:[e("div",{className:"CollectionPage__collection__docsTab__controls__showArchived",children:e(X,{size:"sm",color:"dark",label:"Show archived:",checked:a,onChange:u=>s(!!u.currentTarget.checked)})}),e("div",{className:"CollectionPage__collection__docsTab__controls__sort",children:[e("div",{className:"CollectionPage__collection__docsTab__controls__sort__label",children:"Sort:"}),e(j,{size:"xs",value:c,onChange:u=>n(u||"modifiedAt"),data:v})]}),e(pe,{density:g,locked:d,onChange:p}),e("div",{className:"CollectionPage__collection__docsTab__controls__newDoc",children:e(B,{label:"You don't have access to create new documents",condition:!_,children:e(D,{color:"dark",size:"xs",leftIcon:e(z,{size:16}),onClick:()=>m(!0),disabled:!_,children:"New"})})})]})]}),e(_e,{className:"CollectionPage__collection__docsTab__content",children:re?e("div",{className:"CollectionPage__collection__docsTab__content__loading",children:e(I,{color:"gray",size:"xl"})}):ge?e("div",{class:"CollectionPage__collection__docsEmpty",children:[e("div",{class:"CollectionPage__collection__docsEmpty__title",children:"Collection is empty."}),e("div",{class:"CollectionPage__collection__docsEmpty__button",children:e(B,{label:"You don't have access to create new documents",condition:!_,children:e(D,{color:"dark",size:"xs",leftIcon:e(z,{size:16}),onClick:()=>m(!0),disabled:!_,children:"New"})})})]}):e("div",{className:"CollectionPage__collection__docsTab__content__list",children:[b&&e("div",{className:"CollectionPage__collection__docsTab__content__reloading",children:e(I,{color:"gray",size:"md"})}),e("div",{className:w("CollectionPage__collection__docsTab__content__items",b&&"CollectionPage__collection__docsTab__content__items--loading"),children:e(L.DocsList,{collection:o.collection,docs:T,compact:f,orderBy:c,onSort:n,reloadDocs:()=>de()})})]})})]})})]})};function pe(o){let l=(R.find(c=>c.value===o.density)||R[0]).Icon,_=e(M,{variant:"default",color:"gray",size:30,disabled:o.locked,"aria-label":"Change view density",children:e(l,{size:16})});return e("div",{className:"CollectionPage__collection__docsTab__controls__density",children:[e("div",{className:"CollectionPage__collection__docsTab__controls__density__label",children:"View:"}),o.locked?e(k,{label:"This collection is locked to the compact view",transition:"pop",withArrow:!0,children:_}):e(P,{position:"bottom",placement:"end",control:_,children:[e(P.Label,{children:"View density"}),R.map(c=>{let n=c.Icon,a=c.value===o.density;return e(P.Item,{icon:e(n,{size:18}),rightSection:a?e(q,{size:14,stroke:2.5}):void 0,onClick:()=>o.onChange(c.value),children:c.label},c.value)})]})]})}var se={slug:{asc:"slug",desc:"slugDesc",defaultDir:"asc"},title:{asc:"title",desc:"titleDesc",defaultDir:"asc"},created:{asc:"oldest",desc:"newest",defaultDir:"desc"},modified:{asc:"modifiedAtAsc",desc:"modifiedAt",defaultDir:"desc"}};function fe(o,i){let l=se[o];return!l||!i?null:i===l.asc?"asc":i===l.desc?"desc":null}function y(o){let i=se[o.column],l=fe(o.column,o.orderBy),_=l!==null;function c(){if(!o.onSort)return;let n;l==="asc"?n="desc":l==="desc"?n="asc":n=i.defaultDir,o.onSort(i[n])}return e("button",{type:"button",className:w("CollectionPage__collection__docsList__header__cell","CollectionPage__collection__docsList__header__cell--sortable",_&&"CollectionPage__collection__docsList__header__cell--active"),onClick:c,"aria-label":`Sort by ${o.label}`,children:[e("span",{children:o.label}),_&&(l==="asc"?e(J,{size:12,stroke:2.5}):e(G,{size:12,stroke:2.5}))]})}L.DocsList=o=>{let i=o.collection,l=window.__ROOT_CTX.collections[o.collection];if(!l)throw new Error(`could not find collection: ${i}`);let _=!!l.url,c=!!o.compact,n=o.docs||[],{getReleasesForDoc:a}=F(),s=c&&n.some(t=>a(t.id).length>0);function h(t){return _?oe({collectionId:i,slug:t}):""}function m(t){(t.action==="archive"||t.action==="copy"||t.action==="unarchive"||t.action==="delete"||t.action==="unpublish"||t.action==="locked"||t.action==="unlocked")&&o.reloadDocs()}return c?e("div",{className:w("CollectionPage__collection__docsList","CollectionPage__collection__docsList--compact",s&&"CollectionPage__collection__docsList--withRelease"),children:[e("div",{className:"CollectionPage__collection__docsList__header",children:[e("div",{className:"CollectionPage__collection__docsList__header__image"}),e(y,{column:"slug",label:"Slug",orderBy:o.orderBy,onSort:o.onSort}),e(y,{column:"title",label:"Title",orderBy:o.orderBy,onSort:o.onSort}),e("div",{className:"CollectionPage__collection__docsList__header__cell",children:"Status"}),s&&e("div",{className:"CollectionPage__collection__docsList__header__cell",children:"Release"}),e(y,{column:"created",label:"Created",orderBy:o.orderBy,onSort:o.onSort}),e(y,{column:"modified",label:"Modified",orderBy:o.orderBy,onSort:o.onSort}),e("div",{className:"CollectionPage__collection__docsList__header__controls"})]}),n.map(t=>{let d=`/cms/content/${i}/${t.slug}`,r=t.fields||{},p=C(r,l.preview?.title||"meta.title"),g=C(r,l.preview?.image||"meta.image")||l.preview?.defaultImage,f=s?a(t.id):[];return e("div",{className:"CollectionPage__collection__docsList__doc",children:[e("a",{className:"CollectionPage__collection__docsList__doc__image",href:d,children:e(A,{file:g,width:48,height:36,withPlaceholder:!g?.src})}),e("a",{className:"CollectionPage__collection__docsList__doc__docId",href:d,children:t.slug}),e("a",{className:"CollectionPage__collection__docsList__doc__title",href:d,children:p||"[UNTITLED]"}),e("div",{className:"CollectionPage__collection__docsList__doc__badges",children:e(S,{doc:t,hideReleases:!0})}),s&&e("div",{className:"CollectionPage__collection__docsList__doc__releases",children:f.map(v=>e(k,{transition:"pop",label:`In release: ${v.id}`,children:e($,{component:"a",href:`/cms/releases/${v.id}`,size:"xs",variant:"gradient",gradient:{from:"violet",to:"grape"},style:{cursor:"pointer"},children:v.id})},v.id))}),e("div",{className:"CollectionPage__collection__docsList__doc__timestamp",children:ae(t?.sys?.createdAt,t?.sys?.createdBy)}),e("div",{className:"CollectionPage__collection__docsList__doc__timestamp",children:ae(t?.sys?.modifiedAt,t?.sys?.modifiedBy)}),e("div",{className:"CollectionPage__collection__docsList__doc__controls",children:e(O,{docId:t.id,data:t,onAction:m})})]},t.id)})]}):e("div",{className:"CollectionPage__collection__docsList",children:n.map(t=>{let d=`/cms/content/${i}/${t.slug}`,r=h(t.slug),p=t.fields||{},g=C(p,l.preview?.title||"meta.title"),f=C(p,l.preview?.image||"meta.image")||l.preview?.defaultImage;return e("div",{className:"CollectionPage__collection__docsList__doc",children:[e("div",{className:"CollectionPage__collection__docsList__doc__image",children:e("a",{href:d,children:e(A,{file:f,width:120,height:90,withPlaceholder:!f?.src})})}),e("a",{className:"CollectionPage__collection__docsList__doc__content",href:d,children:[e("div",{className:"CollectionPage__collection__docsList__doc__content__header",children:[e("div",{className:"CollectionPage__collection__docsList__doc__content__header__docId",children:t.id}),e(S,{doc:t})]}),e("div",{className:"CollectionPage__collection__docsList__doc__content__title",children:g||"[UNTITLED]"}),_&&r&&e("div",{className:"CollectionPage__collection__docsList__doc__content__url",children:r})]}),e("div",{className:"CollectionPage__collection__docsList__doc__controls",children:e(O,{docId:t.id,data:t,onAction:m})})]},t.id)})})};function ae(o,i){return!o||typeof o.toMillis!="function"?e("span",{className:"CollectionPage__collection__docsList__doc__timestamp__value",children:"\u2014"}):e(H,{message:Y(o),user:i,children:e("span",{className:"CollectionPage__collection__docsList__doc__timestamp__value",children:Z(o.toMillis())})})}export{L as CollectionPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as s}from"./chunk-6WJQBFN5.js";import"./chunk-QWB6MAPJ.js";import"./chunk-235TRWJF.js";import"./chunk-5MV6XVGA.js";import"./chunk-NCZD5IWS.js";import{a as m}from"./chunk-QLIIVG5Q.js";import{c as d}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import"./chunk-XOWWPE7X.js";import{d as t}from"./chunk-WASID5UU.js";import{Ga as a,g as i,j as p}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";p();function h(){let{query:r}=t();m("Compare");let o=i(()=>n(r.left||""),[r.left]),e=i(()=>n(r.right||""),[r.right]);return a(d,{children:a("div",{className:"ComparePage",children:o&&e?a(s,{className:"ComparePage__diff",left:o,right:e}):a("div",{className:"ComparePage__error",children:"Invalid params, double check query params."})})})}function n(r){let[o,e]=String(r).split("@");return o&&e?{docId:o,versionId:e}:null}export{h as ComparePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as qe,j as Je,k as Ye,l as G,n as Ge,o as Qe,p as Ze,q as et,s as tt}from"./chunk-ST6QNIWT.js";import"./chunk-UCYWQEAS.js";import"./chunk-MYPLMHFW.js";import"./chunk-U7LSFUHT.js";import"./chunk-6WJQBFN5.js";import"./chunk-34W6H4YG.js";import"./chunk-SYDHFYRC.js";import"./chunk-535JU7FU.js";import"./chunk-FBSBL476.js";import{a as nt}from"./chunk-56NMZYX6.js";import"./chunk-LAXQZPE3.js";import"./chunk-QWB6MAPJ.js";import{c as Ue}from"./chunk-235TRWJF.js";import"./chunk-AAR7DBEN.js";import{b as it}from"./chunk-RB23LLKL.js";import"./chunk-JBLSUM6W.js";import"./chunk-2RRM4HEQ.js";import"./chunk-HXSB6YB2.js";import"./chunk-ZAJPNVYS.js";import{b as je,c as ce,g as Xe}from"./chunk-EYJ6GKZR.js";import"./chunk-HV3JJ5UT.js";import"./chunk-G5647K25.js";import"./chunk-VJRMR2JM.js";import{a as T}from"./chunk-QFDU6FXP.js";import"./chunk-JDW4UORS.js";import{a as fe}from"./chunk-UJX25CXD.js";import"./chunk-Z2CRNO3I.js";import"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-YDO2EDVY.js";import"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import{b as He}from"./chunk-W5DOO6ID.js";import{a as $e}from"./chunk-YBHFGQ3Z.js";import"./chunk-2PTLQRTU.js";import"./chunk-PIJ3E47R.js";import"./chunk-NCZD5IWS.js";import{a as at}from"./chunk-QLIIVG5Q.js";import{c as ot}from"./chunk-A7IZAHBZ.js";import{a as Ke}from"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import"./chunk-XOWWPE7X.js";import{e as E}from"./chunk-WASID5UU.js";import{$a as Ne,$b as Ae,$c as We,Fa as R,Ga as e,Gc as Ve,Ia as Se,Oa as ye,P as ke,Qa as ie,Sa as Ie,W as N,Wa as Ee,_b as Be,a as I,ad as re,ba as De,c as b,da as Y,e as w,g as z,h as D,j as ae,nb as Te,tb as Re,ub as Le,vb as Me,vc as Oe,wb as ze,za as Ce,zc as Fe}from"./chunk-WRA24P66.js";import{d as W,j as be,k as ft}from"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";ae();ae();async function rt(t,o){let a=await(await fetch("/cms/api/check.test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({check:t,docId:o})})).json();if(!a.success)throw new Error(a.error||"Check failed.");return a.data}function ct(t){let o=window.__ROOT_CTX.checks||[],n=t.docId.split("/")[0],a=o.filter(l=>!l.collections||l.collections.includes(n)),[i,c]=I({}),d=D(async l=>{c(h=>({...h,[l]:{loading:!0}}));try{let h=await rt(l,t.docId);c(_=>({..._,[l]:{loading:!1,result:h}}))}catch(h){c(_=>({..._,[l]:{loading:!1,error:h.message||"Unknown error."}}))}},[t.docId]),u=D(async()=>{let l={};for(let h of a)l[h.id]={loading:!0};c(l);for(let h of a)try{let _=await rt(h.id,t.docId);c(f=>({...f,[h.id]:{loading:!1,result:_}}))}catch(_){c(f=>({...f,[h.id]:{loading:!1,error:_.message||"Unknown error."}}))}},[t.docId,a]);return e("div",{className:"ChecksPanel",children:[e("div",{className:"ChecksPanel__header",children:[e("div",{className:"ChecksPanel__header__title",children:"Checks"}),e(Y,{variant:"default",size:"xs",compact:!0,leftIcon:e(Oe,{size:12}),onClick:u,children:"Run All"})]}),e("div",{className:"ChecksPanel__body",children:e("div",{className:"ChecksPanel__checks",children:a.map(l=>{let h=i[l.id];return e(vt,{check:l,state:h,onRun:()=>d(l.id)},l.id)})})})]})}function vt(t){let{check:o,state:n,onRun:a}=t;return e("div",{className:"ChecksPanel__check",children:[e("div",{className:"ChecksPanel__check__header",children:[e("div",{className:"ChecksPanel__check__label",children:[o.label,n?.result&&e(xt,{status:n.result.status})]}),e(Y,{className:"ChecksPanel__check__runButton",variant:"default",size:"xs",compact:!0,loading:n?.loading,onClick:a,children:"Run"})]}),o.description&&e("div",{className:"ChecksPanel__check__description",children:o.description}),n?.result&&e("div",{className:E("ChecksPanel__check__result",`ChecksPanel__check__result--${n.result.status}`),children:e(Ue,{code:n.result.message})}),n?.error&&e("div",{className:"ChecksPanel__check__error",children:n.error})]})}var Pt={success:"green",warning:"yellow",error:"red"},wt={success:Ne,warning:Se,error:re};function xt(t){let o=Pt[t.status],n=wt[t.status],a=t.status.charAt(0).toUpperCase()+t.status.slice(1);return e(De,{className:"ChecksPanel__statusBadge",color:o,size:"sm",variant:"filled",leftSection:e(n,{size:10}),children:a})}function st(t){let{devices:o,multiSelect:n,expandVertically:a,iframeUrl:i,localeOptions:c,selectedLocale:d,onToggleDevice:u,onToggleMultiSelect:l,onToggleExpandVertically:h,onReloadClick:_,onOpenNewTab:f,onLocaleChange:C}=t,g=o.length>0;return e("div",{className:"DocumentPagePreviewBar",children:[e("div",{className:"DocumentPagePreviewBar__devices",children:[e(R,{label:"Mobile",children:e(N,{className:E("DocumentPagePreviewBar__device",o.includes("mobile")&&"active"),"aria-pressed":o.includes("mobile"),onClick:()=>u("mobile"),children:e(ze,{size:16})})}),e(R,{label:"Tablet",children:e(N,{className:E("DocumentPagePreviewBar__device",o.includes("tablet")&&"active"),"aria-pressed":o.includes("tablet"),onClick:()=>u("tablet"),children:e(Me,{size:16})})}),e(R,{label:"Desktop",children:e(N,{className:E("DocumentPagePreviewBar__device",o.includes("desktop")&&"active"),"aria-pressed":o.includes("desktop"),onClick:()=>u("desktop"),children:e(Re,{size:16})})}),e("div",{className:"DocumentPagePreviewBar__divider"}),e(R,{label:"Compare viewports",children:e(N,{className:E("DocumentPagePreviewBar__device",n&&"active"),role:"checkbox","aria-checked":n,onClick:l,children:e(Te,{size:16})})}),e(R,{label:"Expand",children:e(N,{className:E("DocumentPagePreviewBar__device",a&&"active"),"aria-pressed":a,disabled:!g,onClick:h,children:e(Ie,{size:16})})})]}),e("div",{className:"DocumentPagePreviewBar__navbar",children:e("div",{className:"DocumentPagePreviewBar__navbar__url",children:i})}),e("div",{className:"DocumentPagePreviewBar__locales",children:e(Ce,{data:c,placeholder:"Locale",radius:"xl",size:"xs",required:!0,icon:e(We,{size:16,strokeWidth:1.5}),value:d,onChange:v=>{C(v)}})}),e("div",{className:"DocumentPagePreviewBar__buttons",children:[e(R,{label:"Reload",children:e(N,{className:"DocumentPagePreviewBar__button DocumentPagePreviewBar__button--reload",onClick:_,children:e(Fe,{size:16})})}),e(R,{label:"Open new tab",children:e(N,{className:"DocumentPagePreviewBar__button DocumentPagePreviewBar__button--openNewTab",onClick:f,children:e(ie,{size:16})})})]})]})}ae();function lt(t){let o=t.docId.split("/")[0],n=Xe(o),a=G(),i=w(null),[c,d]=I(""),[u,l]=I([]),[h,_]=I(!1),f=w("");f.current=c;let C=w(n.schema?.fields||[]);C.current=n.schema?.fields||[];let g=w(n.schema?.types||{});g.current=n.schema?.types||{};let v=z(()=>Je(p=>{let k=p.trim();if(!k){l([]),_(!1);return}let y=a.controller?.getData()?.fields||{},L=et(k,y,C.current,g.current);l(L),_(!0)},150),[a.controller]);b(()=>{v(c)},[c,v]),Ge(()=>{f.current.trim()&&v(f.current)}),b(()=>{t.autoFocus&&requestAnimationFrame(()=>{i.current?.focus(),i.current?.select()})},[t.autoFocus]),b(()=>{let p=()=>{i.current?.focus(),i.current?.select()};return window.addEventListener("root:focus-search",p),()=>window.removeEventListener("root:focus-search",p)},[]);let P=p=>{Dt(p)};return e("div",{className:"SearchPanel",children:[e("div",{className:"SearchPanel__header",children:[e("div",{className:"SearchPanel__header__title",children:"Search"}),t.onClose&&e(N,{size:"xs",onClick:t.onClose,title:"Close search",children:e(re,{size:14})})]}),e("div",{className:"SearchPanel__searchInput",children:[e("span",{className:"SearchPanel__searchInput__icon",children:e(Ve,{size:14})}),e("input",{ref:i,type:"text",className:"SearchPanel__searchInput__input",value:c,onInput:p=>d(p.currentTarget.value),onKeyDown:p=>{p.key==="Escape"&&t.onClose&&(p.preventDefault(),t.onClose())},placeholder:"Search field values\u2026",autoComplete:"off",spellcheck:!1})]}),e("div",{className:"SearchPanel__body",children:[!h&&!c.trim()&&e("div",{className:"SearchPanel__empty",children:"Type a query above to search field values in this document."}),h&&u.length===0&&e("div",{className:"SearchPanel__empty",children:["No matches for ",e("strong",{children:c}),"."]}),u.length>0&&e(W,{children:[e("div",{className:"SearchPanel__resultsCount",children:[u.length," ",u.length===1?"match":"matches"]}),e("ul",{className:"SearchPanel__results",children:u.map((p,k)=>e(bt,{result:p,onClick:()=>P(p)},`${p.deepKey}:${k}`))})]})]})]})}function bt(t){let{result:o}=t;return e("li",{className:"SearchPanel__result",children:e("button",{type:"button",className:"SearchPanel__result__button",onClick:t.onClick,children:[e("div",{className:"SearchPanel__result__label",children:o.label}),e("div",{className:"SearchPanel__result__snippet",children:kt(o.snippet,o.matches)}),e("div",{className:"SearchPanel__result__meta",children:[e("span",{className:"SearchPanel__result__type",children:o.fieldType}),o.richTextBlock&&e("span",{className:"SearchPanel__result__badge",children:"in block"}),o.richTextInline&&e("span",{className:"SearchPanel__result__badge",children:"inline"})]})]})})}function kt(t,o){if(!o||o.length===0)return t;let n=[],a=0;for(let i of o)i.start>a&&n.push({text:t.slice(a,i.start),match:!1}),n.push({text:t.slice(i.start,i.end),match:!0}),a=i.end;return a<t.length&&n.push({text:t.slice(a),match:!1}),n.map((i,c)=>i.match?e("mark",{children:i.text},c):e("span",{children:i.text},c))}function Dt(t){if(window.postMessage({scrollToDeeplink:{deepKey:t.deepKey}},"*"),t.richTextBlock){let o=t.richTextBlock;setTimeout(()=>{window.dispatchEvent(new CustomEvent(Qe,{detail:o}))},350)}else if(t.richTextInline){let o=t.richTextInline;setTimeout(()=>{window.dispatchEvent(new CustomEvent(Ze,{detail:o}))},350)}}ft();ae();var Ct=be(null);function Q(t){let{className:o,localStorageId:n,children:a}=t,[i,c]=T(`root::SplitPanel:${n}`,350),[d,u]=I(!1),[l,h]=I(0),_=z(()=>new Set,[]),f=w(null),C=w(null),g={onResize:P=>(_.add(P),()=>{_.delete(P)})};if(b(()=>{let P=()=>u(!1);window.addEventListener("mouseup",P);let p=f.current;return p&&h(p.getBoundingClientRect().left),()=>window.removeEventListener("mouseup",P)},[]),b(()=>{let P=p=>{let k=p.clientX-l;c(k),_.forEach(y=>y())};return d&&window.addEventListener("mousemove",P),()=>window.removeEventListener("mousemove",P)},[d]),a?.length!==2)throw new Error("SplitPanel should have two <SplitPanel.Item> children.");let v={"--panel-size":`${i}px`};return e(Ct.Provider,{value:g,children:e("div",{className:E(o,"SplitPanel",d&&"dragging"),ref:f,style:v,children:[a[0],e("div",{className:"SplitPanel__divider",ref:C,onMouseDown:()=>u(!0)}),a[1]]})})}Q.Item=t=>e("div",{className:E("SplitPanel__item",t.className,t.fluid?"fluid":"static"),children:t.children});function ve(t,o,n=""){let a=ce({collectionId:t,slug:o}),i=new URLSearchParams(window.location.search);i.set("preview","true"),i.delete("locale"),i.delete("modal");let c=`${i.toString()}${window.location.hash}`;return n?`${ce({collectionId:t,slug:o,locale:n})}?${c}`:`${a}?${c}`}function St(t,o){let n=new URL(o,window.location.origin);try{let a=t.contentWindow?.location.href;if(a&&!a.startsWith("about:blank")){let i=new URL(a);i.origin===n.origin&&i.pathname===n.pathname&&(i.searchParams.forEach((c,d)=>{n.searchParams.set(d,c)}),n.hash=i.hash)}}catch{}return n.searchParams.set("preview","true"),n.toString()}function dt(t){let o=t.collection,n=t.slug,a=`${o}/${n}`,{roles:i}=$e(),c=window.firebase.user.email||"",d=He(i,c);return e(Ye,{docId:a,readOnly:!d,children:e(yt,{...t,canEdit:d})})}function yt(t){let o=t.canEdit,n=t.collection,a=t.slug,i=`${n}/${a}`;at(i);let c=window.__ROOT_CTX.collections[n],d=G(),u=!!c?.url,[l,h]=T(`root::DocumentPage::previewVisible::${n}`,u),_=z(()=>(window.__ROOT_CTX.checks||[]).some(x=>!x.collections||x.collections.includes(n)),[n]),[f,C]=T("root::DocumentPage::checksVisible",!1),g=w(f);g.current=f;let[v,P]=T("root::DocumentPage::searchVisible",!1),p=w(v);p.current=v;let k=Ke(),[y,L]=T("root::DocumentPage::aiVisible",!1),X=w(y);X.current=y,b(()=>{window.dispatchEvent(new CustomEvent("root:checks-visible",{detail:f}))},[f]),b(()=>{window.dispatchEvent(new CustomEvent("root:search-visible",{detail:v}))},[v]),b(()=>{window.dispatchEvent(new CustomEvent("root:ai-visible",{detail:y}))},[y]);let[A,le]=T("root::DocumentPage::searchPanelWidth",360),[O,q]=I(A),[F,K]=I(!1),Z=w(null);if(b(()=>{let S=()=>{let x=!g.current;C(()=>x),x&&(P(()=>!1),L(()=>!1))};return window.addEventListener("root:toggle-checks",S),()=>window.removeEventListener("root:toggle-checks",S)},[]),b(()=>{let S=()=>{let x=!p.current;P(()=>x),x&&(C(()=>!1),L(()=>!1),requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("root:focus-search"))}))};return window.addEventListener("root:toggle-search",S),()=>window.removeEventListener("root:toggle-search",S)},[]),b(()=>{let S=()=>{let x=!X.current;L(()=>x),x&&(C(()=>!1),P(()=>!1))};return window.addEventListener("root:toggle-ai",S),()=>window.removeEventListener("root:toggle-ai",S)},[]),b(()=>{if(!F)return;let S=H=>{let oe=Z.current;if(!oe)return;let pe=oe.getBoundingClientRect(),J=Math.max(240,Math.min(pe.right-H.clientX,800));q(J)},x=()=>{K(!1),q(H=>(le(()=>H),H))};return window.addEventListener("mousemove",S),window.addEventListener("mouseup",x),()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",x)}},[F]),!c)return e("div",{children:"Could not find collection."});let ee=D(()=>{if(!u)return;let S=ve(n,a),x=window.open(S,"_blank","noopener,noreferrer");x&&x.focus()},[u,n,a]),U=D(()=>{o&&d.controller&&d.controller.flush()},[o,d.controller]),$=qe(),de=D(()=>{let S=d.controller?.getData()?.fields||{};$.open({data:S,onSave:x=>{d.controller&&x&&typeof x=="object"&&(d.controller.updateKey("fields",x),d.controller.flush()),$.close()}})},[d.controller]),ue=D(()=>{window.dispatchEvent(new CustomEvent("root:toggle-search"))},[]),te=D(()=>{k&&window.dispatchEvent(new CustomEvent("root:toggle-ai"))},[k]),me=D(()=>{L(()=>!1)},[L]);return ke([["mod+S",U],["mod+shift+F",ue],["mod+I",te]]),e(ot,{children:e("div",{className:E("DocumentPage__layout",F&&"DocumentPage__layout--dragging"),ref:Z,children:[e(Q,{className:"DocumentPage",localStorageId:"DocumentPage",children:[e(Q.Item,{className:E("DocumentPage__side",(!u||!l)&&"DocumentPage__side--expanded"),children:[e("div",{className:"DocumentPage__side__header",children:[e("div",{className:"DocumentPage__side__header__nav",children:[e("a",{href:`/cms/content/${n}`,children:e(N,{className:"DocumentPage__side__header__back",children:e(ye,{size:16})})}),e("div",{className:"DocumentPage__side__header__docId",children:i})]}),e("div",{className:"DocumentPage__side__header__buttons",children:[e(fe,{label:"You don't have access to edit this document",condition:!o,children:e(Y,{className:"DocumentPage__side__header__saveButton",variant:"filled",color:"dark",size:"xs",compact:!0,leftIcon:e(Le,{size:16}),onClick:()=>U(),disabled:!o,children:"Save"})}),e(fe,{label:"You don't have access to edit this document",condition:!o,children:e(R,{label:"Edit JSON",disabled:!o,children:e(N,{className:"DocumentPage__side__header__editJson",onClick:()=>de(),disabled:!o,children:e(Ee,{size:14})})})}),u&&e(W,{children:[e(R,{label:l?"Hide preview":"Show preview",children:e(N,{className:"DocumentPage__side__header__previewToggle",onClick:()=>h(!l),children:l?e(Be,{size:16}):e(Ae,{size:16})})}),!l&&e(R,{label:"Open preview in new tab",children:e(N,{className:"DocumentPage__side__header__openNewTab",onClick:ee,children:e(ie,{size:16})})})]})]})]}),e("div",{className:E("DocumentPage__side__editor",(!u||!l)&&!f&&!v&&!y&&"DocumentPage__side__editor--centered"),children:e(tt,{docId:i})})]}),e(Q.Item,{className:E("DocumentPage__main",(!u||!l)&&"DocumentPage__main--hidden"),fluid:!0,children:u&&l&&e(dt.Preview,{docId:i},i)})]}),_&&f&&e(Et,{docId:i}),v&&e(W,{children:[e("div",{className:"DocumentPage__searchDivider",onMouseDown:()=>K(!0)}),e("div",{className:"DocumentPage__search",style:{flexBasis:`${O}px`},children:e(lt,{docId:i,autoFocus:!0,onClose:()=>P(()=>!1)})})]}),k&&y&&e(It,{docId:i,onClose:me})]})})}function It(t){let[o,n]=T("root::DocumentPage::aiPanelWidth",420),[a,i]=I(o),c=w(null),d=w(a),u=w(),l=z(()=>e(nt,{variant:"panel",docContext:{docId:t.docId},onClose:t.onClose}),[t.docId,t.onClose]),h=D(()=>{let _=c.current?.parentElement;if(!_)return;d.current=a,_.classList.add("DocumentPage__layout--dragging");let f=v=>{let P=c.current?.parentElement;if(!P)return;let p=P.getBoundingClientRect(),k=Math.max(280,Math.min(p.right-v.clientX,800));d.current=k,i(k)},C=()=>{_.classList.remove("DocumentPage__layout--dragging"),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",g),u.current=void 0},g=()=>{C(),n(()=>d.current)};u.current=C,window.addEventListener("mousemove",f),window.addEventListener("mouseup",g)},[a,n]);return b(()=>()=>u.current?.(),[]),e(W,{children:[e("div",{className:"DocumentPage__aiDivider",ref:c,onMouseDown:h}),e("div",{className:"DocumentPage__ai",style:{flexBasis:`${a}px`},children:l})]})}function Et(t){let[o,n]=T("root::DocumentPage::checksPanelWidth",360),[a,i]=I(o),c=w(null),d=w(a),u=w(),l=z(()=>e(ct,{docId:t.docId}),[t.docId]),h=D(()=>{let _=c.current?.parentElement;if(!_)return;d.current=a,_.classList.add("DocumentPage__layout--dragging");let f=v=>{let P=c.current?.parentElement;if(!P)return;let p=P.getBoundingClientRect(),k=Math.max(200,Math.min(p.right-v.clientX,800));d.current=k,i(k)},C=()=>{_.classList.remove("DocumentPage__layout--dragging"),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",g),u.current=void 0},g=()=>{C(),n(()=>d.current)};u.current=C,window.addEventListener("mousemove",f),window.addEventListener("mouseup",g)},[a,n]);return b(()=>()=>u.current?.(),[]),e(W,{children:[e("div",{className:"DocumentPage__checksDivider",ref:c,onMouseDown:h}),e("div",{className:"DocumentPage__checks",style:{flexBasis:`${a}px`},children:l})]})}var se={mobile:[430,932],tablet:[768,1024],desktop:[1440,800]},Pe=["mobile","tablet","desktop"],Nt="root::DocumentPage::preview::devices",Tt="root::DocumentPage::preview::device";function Rt(){try{let t=window.localStorage.getItem(Tt);if(t){let o=JSON.parse(t);if(Pe.includes(o))return[o]}}catch(t){console.error(t)}return[]}function Lt(t){let o=new Intl.DisplayNames(["en"],{type:"language"}),a=t.split("_")[0];return`${o.of(a)||t} (${t})`}dt.Preview=t=>{let o=G();if(o.loading)return null;let[n,a]=t.docId.split("/"),c=window.__ROOT_CTX.collections[n];if(!c)throw new Error(`collection not found: ${n}`);if(!c.url)return null;let d=c.domain||window.__ROOT_CTX.rootConfig.domain||"https://example.com",u=je({collectionId:n,slug:a}),l=ce({collectionId:n,slug:a}),h=`${d}${u}`,[_,f]=I(h),C=z(Rt,[]),[g,v]=T(Nt,C),[P,p]=T("root::DocumentPage::preview::multiSelect",!1),[k,y]=T("root::DocumentPage::preview::expandVertically",!1),[L,X]=I({scale:1,frameHeight:0}),[A,le]=it("locale",""),O=w(new Map),q=w(new Map),F=w(null),K=w([]),Z=D(r=>{let s=q.current.get(r);return s||(s=m=>{m?O.current.set(r,m):O.current.delete(r)},q.current.set(r,s)),s},[]),ee=o.controller.getLocales()||[],U=ve(n,a,A),$=w(U);$.current=U;let de=z(()=>[{value:"",label:"Select locale"},...ee.map(r=>({value:r,label:Lt(r)}))],[ee]);function ue(r){if(document.hidden)return;let s=St(r,$.current);r.src="about:blank",window.requestAnimationFrame(()=>{r.src!==s?r.src=s:r.contentWindow.location.reload()})}function te(){O.current.forEach(r=>ue(r))}b(()=>{let r=o.controller?.onFlush(()=>{te()});return()=>{r?.()}},[]),b(()=>{O.current.forEach(r=>{r.src=U})},[A]);let me=g.length>0?g.length:1;b(()=>{let r=Array.from(O.current.values());function s(m){let V=m.currentTarget.contentWindow;if(V&&l===u&&!V.location.href.startsWith("about:blank")){let j=V.location;f(`${d}${j.pathname}`)}}return r.forEach(m=>{m.getAttribute("src")||(m.src=$.current),m.addEventListener("load",s)}),()=>{r.forEach(m=>m.removeEventListener("load",s))}},[me]);let S=D(r=>{if(P){v(s=>{if(s.includes(r)){let m=s.filter(M=>M!==r);return m.length===0&&y(!1),m}return Pe.filter(m=>m===r||s.includes(m))});return}v(s=>s.length===1&&s[0]===r?(y(!1),[]):[r])},[P,v,y]),x=D(()=>{p(r=>{let s=!r;return v(s?m=>{if(K.current=m,m.length>=2)return m;let M=m[0]||"desktop",V=M==="desktop"?"mobile":"desktop";return Pe.filter(j=>j===M||j===V)}:()=>K.current),s})},[p,v]),H=D(()=>{g.length!==0&&y(r=>!r)},[g,y]),oe=D(()=>{o.controller&&o.controller.flush().then(()=>te())},[o.controller]),pe=D(()=>{let r=ve(n,a,A),s=window.open(r,"_blank","noopener,noreferrer");s&&s.focus()},[n,a,A]),J=D(()=>{if(g.length===0){X(B=>B.scale===1&&B.frameHeight===0?B:{scale:1,frameHeight:0});return}let r=F.current;if(!r)return;let s=r.getBoundingClientRect(),m=20,M=16,V=28,j=g.length,we=Math.max(s.width-2*m-M*(j-1),0),he=Math.max(s.height-2*m-V,0),_e=0,ne=0;for(let B of g){let[_t,gt]=se[B];_e+=_t,ne=Math.max(ne,gt)}let mt=we>0&&_e>0?we/_e:1,pt=he>0&&ne>0?he/ne:1,ht=Math.min(mt,pt,1),ge=Number(ht.toFixed(4))||1,xe=Math.max(he/ge,0);X(B=>B.scale===ge&&B.frameHeight===xe?B:{scale:ge,frameHeight:xe})},[g]);b(()=>{J();let r=F.current;if(!r)return;let s=0,m=()=>{window.cancelAnimationFrame(s),s=window.requestAnimationFrame(J)},M=new window.ResizeObserver(m);return M.observe(r),window.addEventListener("resize",m),()=>{window.cancelAnimationFrame(s),M.disconnect(),window.removeEventListener("resize",m)}},[J]);let ut=g.length>0?g.map((r,s)=>({slot:s,device:r})):[{slot:0,device:null}];return e("div",{className:"DocumentPage__main__preview",children:[e(st,{devices:g,multiSelect:P,expandVertically:k,iframeUrl:_,localeOptions:de,selectedLocale:A,onToggleDevice:S,onToggleMultiSelect:x,onToggleExpandVertically:H,onReloadClick:oe,onOpenNewTab:pe,onLocaleChange:le}),e("div",{className:"DocumentPage__main__previewFrame","data-device":g.length>0?"device":"full",ref:F,children:e("div",{className:"DocumentPage__main__previewFrame__group",children:ut.map(r=>{let s=r.device,m=s?{"--iframe-width":`${se[s][0]}px`,"--iframe-height":`${k?L.frameHeight:se[s][1]}px`,"--iframe-scale":String(L.scale)}:void 0;return e("div",{className:"DocumentPage__main__previewFrame__item",style:m,children:[e("div",{className:"DocumentPage__main__previewFrame__iframeWrap",children:e("iframe",{ref:Z(r.slot),title:"iframe preview"})}),s&&e("div",{className:"DocumentPage__main__previewFrame__deviceLabel",children:`${s}: ${se[s].join("x")}`})]},r.slot)})})})]})};export{dt as DocumentPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as U}from"./chunk-3LEYSXZP.js";import"./chunk-C5FRMXDS.js";import"./chunk-F7RQT4XN.js";import"./chunk-U7LSFUHT.js";import{a as z}from"./chunk-HXSB6YB2.js";import{a as N}from"./chunk-OWYV43BT.js";import"./chunk-EYJ6GKZR.js";import"./chunk-HV3JJ5UT.js";import"./chunk-G5647K25.js";import{d as s,f as E,g as w}from"./chunk-VJRMR2JM.js";import"./chunk-QFDU6FXP.js";import"./chunk-JDW4UORS.js";import{a as I}from"./chunk-UJX25CXD.js";import"./chunk-Z2CRNO3I.js";import{a as x,c as C}from"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-YDO2EDVY.js";import"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import{a as T}from"./chunk-W5DOO6ID.js";import{a as A}from"./chunk-YBHFGQ3Z.js";import"./chunk-2PTLQRTU.js";import{a as h,b as f}from"./chunk-PIJ3E47R.js";import{a as g}from"./chunk-NCZD5IWS.js";import{a as $}from"./chunk-QLIIVG5Q.js";import{c as k}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import"./chunk-XOWWPE7X.js";import{d as P}from"./chunk-WASID5UU.js";import{Ac as y,Fa as m,Ga as e,La as p,W as c,a as v,c as R,ca as b,j as H}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";H();function de(a){$(`Edit Release: ${a.id}`);let{route:u}=P(),[M,t]=v(null),l=x(),_=C(),{roles:d}=A(),S=window.firebase.user.email||"",o=T(d,S);R(()=>{s(a.id).then(i=>{t(i)})},[a.id]);function L(){let i=`archive-release-${a.id}`,r=l.openConfirmModal({..._,title:"Archive release",children:e(g,{size:"body-sm",weight:"semi-bold",children:["Are you sure you want to archive release ",e("code",{children:a.id}),"?"]}),labels:{confirm:"Archive",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"red",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{h({id:i,title:"Archiving release",message:`Archiving ${a.id}...`,loading:!0,autoClose:!1}),await E(a.id);let n=await s(a.id);t(n),f({id:i,title:"Archived release",message:`Successfully archived ${a.id}`,loading:!1,autoClose:5e3}),l.closeModal(r),u("/cms/releases")}})}function B(){let i=`unarchive-release-${a.id}`,r=l.openConfirmModal({..._,title:"Unarchive release",children:e(g,{size:"body-sm",weight:"semi-bold",children:["Are you sure you want to unarchive release ",e("code",{children:a.id}),"?"]}),labels:{confirm:"Unarchive",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"dark",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!1,onConfirm:async()=>{h({id:i,title:"Unarchiving release",message:`Unarchiving ${a.id}...`,loading:!0,autoClose:!1}),await w(a.id);let n=await s(a.id);t(n),f({id:i,title:"Unarchived release",message:`Successfully unarchived ${a.id}`,loading:!1,autoClose:5e3}),l.closeModal(r),u(`/cms/releases/${a.id}`)}})}return e(k,{children:e("div",{className:"EditReleasePage",children:[e("div",{className:"EditReleasePage__header",children:[e(b,{className:"EditReleasePage__header__breadcrumbs",children:[e("a",{href:"/cms/releases",children:"Releases"}),e("a",{href:`/cms/releases/${a.id}`,children:a.id}),e("div",{children:"Edit"})]}),e("div",{className:"EditReleasePage__header__titleWrap",children:[e(z,{size:"h1",children:["Edit Release: ",a.id]}),e("div",{className:"EditReleasePage__header__controls",children:e(I,{label:"You don't have access to archive releases",condition:!o,children:M?.archivedAt?e(m,{label:"Unarchive",disabled:!o,children:e(c,{onClick:B,loading:!d,disabled:!o,children:e(y,{size:20,stroke:"1.5"})})}):e(m,{label:"Archive",disabled:!o,children:e(c,{onClick:L,loading:!d,disabled:!o,children:e(p,{size:20,stroke:"1.5"})})})})})]})]}),e(N,{className:"EditReleasePage__form",children:e(U,{releaseId:a.id})})]})})}export{de as EditReleasePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as n}from"./chunk-FBSBL476.js";import{a}from"./chunk-56NMZYX6.js";import"./chunk-LAXQZPE3.js";import"./chunk-QWB6MAPJ.js";import"./chunk-235TRWJF.js";import"./chunk-AAR7DBEN.js";import{b as i}from"./chunk-RB23LLKL.js";import"./chunk-YDO2EDVY.js";import"./chunk-5MV6XVGA.js";import{a as f}from"./chunk-QLIIVG5Q.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import"./chunk-XOWWPE7X.js";import"./chunk-WASID5UU.js";import{Ga as o,c as r,e as t,j as m}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";m();function v(){f("Root AI");let[e]=i("docId"),d=t(!1);return r(()=>{d.current||(d.current=!0,n({type:"ready",docId:e||void 0}))},[e]),o("div",{className:"EmbeddedAIPage",children:o(a,{variant:"panel",docContext:e?{docId:e}:void 0})})}export{v as EmbeddedAIPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as E,l as P,m as h,s as S}from"./chunk-ST6QNIWT.js";import"./chunk-UCYWQEAS.js";import"./chunk-MYPLMHFW.js";import"./chunk-U7LSFUHT.js";import"./chunk-6WJQBFN5.js";import"./chunk-34W6H4YG.js";import"./chunk-SYDHFYRC.js";import"./chunk-535JU7FU.js";import{b as s}from"./chunk-FBSBL476.js";import"./chunk-LAXQZPE3.js";import"./chunk-QWB6MAPJ.js";import"./chunk-235TRWJF.js";import"./chunk-AAR7DBEN.js";import"./chunk-JBLSUM6W.js";import"./chunk-2RRM4HEQ.js";import"./chunk-HXSB6YB2.js";import"./chunk-ZAJPNVYS.js";import"./chunk-EYJ6GKZR.js";import"./chunk-HV3JJ5UT.js";import"./chunk-G5647K25.js";import"./chunk-VJRMR2JM.js";import"./chunk-QFDU6FXP.js";import"./chunk-JDW4UORS.js";import"./chunk-UJX25CXD.js";import"./chunk-Z2CRNO3I.js";import"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-YDO2EDVY.js";import"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import{b as p}from"./chunk-W5DOO6ID.js";import{a as D}from"./chunk-YBHFGQ3Z.js";import"./chunk-2PTLQRTU.js";import"./chunk-PIJ3E47R.js";import"./chunk-NCZD5IWS.js";import{a as x}from"./chunk-QLIIVG5Q.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import"./chunk-XOWWPE7X.js";import{e as _}from"./chunk-WASID5UU.js";import{Ga as t,a as v,c as m,da as f,e as u,j as B,ub as b}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";B();function H(e){let o=`${e.collection}/${e.slug}`,{roles:d}=D(),a=window.firebase.user.email||"",n=p(d,a);return t(E,{docId:o,readOnly:!n,autoSave:!1,flushOnStop:!1,children:t(w,{...e,canEdit:n})})}function I(e){return e&&typeof e.toMillis=="function"?e.toMillis():0}function w(e){let o=`${e.collection}/${e.slug}`;x(o);let d=P(),a=d.controller,n=d.loading,[r,y]=v("NO_CHANGES");h(y);let g=u(!1);m(()=>{n||g.current||(g.current=!0,s({type:"ready",docId:o}))},[n,o]);let c=u(0);return m(()=>{let N=[a.onFlush(()=>{s({type:"saved",docId:o,saveState:"SAVED"})}),a.onChange(l=>{let i=I(l?.sys?.publishedAt);if(c.current===0){c.current=i;return}i>c.current&&(c.current=i,s({type:"published",docId:o,publishedAt:i}))})];return()=>N.forEach(l=>l())},[a,o]),t("div",{className:"EmbeddedDocumentPage",children:[e.canEdit&&!n&&t("div",{className:"EmbeddedDocumentPage__saveBar",children:[t(f,{component:"a",className:"EmbeddedDocumentPage__saveBar__docId",href:`/cms/content/${e.collection}/${e.slug}`,target:"_blank",rel:"noreferrer noopener",title:"Open in new tab",compact:!0,size:"xs",variant:"default",children:o}),t("div",{className:"EmbeddedDocumentPage__saveBar__controls",children:[t("div",{className:"EmbeddedDocumentPage__saveBar__saveState",children:[r==="UPDATE_PENDING"&&"unsaved changes",r==="SAVED"&&"saved!",r==="ERROR"&&"error saving"]}),t(f,{color:"dark",compact:!0,size:"xs",leftIcon:t(b,{size:16}),loading:r==="SAVING",disabled:r!=="UPDATE_PENDING"&&r!=="ERROR",onClick:()=>a.flush(),children:"Save"})]})]}),t("div",{className:_("EmbeddedDocumentPage__editor","DocumentPage__side"),children:t(S,{docId:o,hideStatusBar:!0})})]})}export{H as EmbeddedDocumentPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-YP6ZH3MT.js";import"./chunk-2RRM4HEQ.js";import{a}from"./chunk-HXSB6YB2.js";import"./chunk-OWYV43BT.js";import"./chunk-ATTW36EM.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import{a as i}from"./chunk-QLIIVG5Q.js";import{c as g}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-XOWWPE7X.js";import"./chunk-WASID5UU.js";import{Ga as o}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";function L(){return i("Action Logs"),o(g,{children:o("div",{className:"LogsPage",children:[o("div",{className:"LogsPage__header",children:o(a,{size:"h1",children:"Action Logs"})}),o(e,{})]})})}export{L as LogsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-3LEYSXZP.js";import"./chunk-C5FRMXDS.js";import"./chunk-F7RQT4XN.js";import"./chunk-U7LSFUHT.js";import{a as r}from"./chunk-HXSB6YB2.js";import"./chunk-EYJ6GKZR.js";import"./chunk-HV3JJ5UT.js";import"./chunk-G5647K25.js";import"./chunk-VJRMR2JM.js";import"./chunk-QFDU6FXP.js";import"./chunk-JDW4UORS.js";import"./chunk-UJX25CXD.js";import"./chunk-Z2CRNO3I.js";import"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-YDO2EDVY.js";import"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import"./chunk-W5DOO6ID.js";import"./chunk-YBHFGQ3Z.js";import"./chunk-2PTLQRTU.js";import"./chunk-PIJ3E47R.js";import"./chunk-NCZD5IWS.js";import{a as d}from"./chunk-QLIIVG5Q.js";import{c as s}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import"./chunk-XOWWPE7X.js";import"./chunk-WASID5UU.js";import{Ga as e,ca as a}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";function w(){return d("New Release"),e(s,{children:e("div",{className:"NewReleasePage",children:[e("div",{className:"NewReleasePage__header",children:[e(a,{className:"NewReleasePage__header__breadcrumbs",children:[e("a",{href:"/cms/releases",children:"Releases"}),e("div",{children:"New"})]}),e(r,{size:"h1",children:"Add Release"})]}),e(m,{buttonLabel:"Create release"})]})})}export{w as NewReleasePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as K}from"./chunk-Z3ZJJWFT.js";import{a as F}from"./chunk-O7ESOZQO.js";import{a as q}from"./chunk-F7RQT4XN.js";import{c as U}from"./chunk-235TRWJF.js";import{a as h}from"./chunk-HXSB6YB2.js";import{a as R}from"./chunk-OWYV43BT.js";import{g as H}from"./chunk-G5647K25.js";import{d as B,h as E,k as M}from"./chunk-VJRMR2JM.js";import"./chunk-JDW4UORS.js";import{a as P}from"./chunk-UJX25CXD.js";import{c as $}from"./chunk-Z2CRNO3I.js";import{a as k,c as I}from"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import{a as j}from"./chunk-W5DOO6ID.js";import{a as W}from"./chunk-YBHFGQ3Z.js";import{b as D}from"./chunk-2PTLQRTU.js";import{a as v,b as z}from"./chunk-PIJ3E47R.js";import{a as O}from"./chunk-NCZD5IWS.js";import{a as J}from"./chunk-QLIIVG5Q.js";import{c as G}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import{A as T}from"./chunk-XOWWPE7X.js";import"./chunk-WASID5UU.js";import{Da as A,Fa as g,Ga as e,Jc as Y,V as w,W as C,a as u,c as x,ca as N,da as m,j as Z}from"./chunk-WRA24P66.js";import{d as y}from"./chunk-KUCVLANF.js";import"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";Z();function p(t){let[c,i]=u(!0),[a,s]=u(null),[o,l]=u(0),n=t.id;J(`Release: ${n}`);async function _(){i(!0),await D(async()=>{let r=await B(n);s(r),l(T())}),i(!1)}x(()=>{_()},[]);function d(r){console.log("onAction()",r),_()}return e(G,{children:e("div",{className:"ReleasePage",children:[e("div",{className:"ReleasePage__header",children:[e(N,{className:"ReleasePage__header__breadcrumbs",children:[e("a",{href:"/cms/releases",children:"Releases"}),e("div",{children:n})]}),e("div",{className:"ReleasePage__header__titleWrap",children:[e(h,{size:"h1",children:["Release: ",n]}),e("div",{className:"ReleasePage__header__controls",children:e(g,{label:"Configure",children:e(C,{component:"a",href:`/cms/releases/${t.id}/edit`,children:e(Y,{size:24,stroke:"1.5"})})})})]}),a?.description&&e(U,{className:"ReleasePage__header__description",code:a.description})]}),c?e(w,{color:"gray",size:"xl"}):e(y,{children:[a&&e(p.PublishStatus,{release:a,onAction:d}),a&&a.docIds&&a.docIds.length>0&&e(p.DocsList,{release:a},`docs-list-${o}`),a&&a.dataSourceIds&&a.dataSourceIds.length>0&&e(p.DataSourcesList,{release:a},`data-sources-${o}`)]})]})})}p.PublishStatus=t=>{let{roles:c}=W(),i=window.firebase.user.email||"",a=j(c,i),s=t.release,[o,l]=u(!1),n=k(),_=I(),d=F({releaseId:s.id,onScheduled:()=>{t.onAction("scheduled")}});function r(){let f=s.docIds||[],S=s.dataSourceIds||[],b=f.length+S.length;if(b===0){v({title:"Cannot publish release",message:"Error: nothing in the release to publish.",color:"red",autoClose:!1});return}n.openConfirmModal({..._,title:`Publish release: ${s.id}`,children:e(O,{size:"body-sm",weight:"semi-bold",children:["Are you sure you want to publish this release? The ",b," items in the release will go live immediately."]}),labels:{confirm:"Publish",cancel:"Cancel"},cancelProps:{size:"xs"},confirmProps:{color:"dark",size:"xs"},onCancel:()=>console.log("Cancel"),closeOnConfirm:!0,onConfirm:()=>{Q()}})}async function Q(){l(!0),await D(async()=>{let f=`publish-release-${s.id}`,S=s.docIds?.length||0,b=s.dataSourceIds?.length||0,L=S+b;v({id:f,title:"Publishing release",message:`Publishing ${L} items...`,loading:!0,autoClose:!1}),await E(s.id),z({id:f,title:"Published release!",message:`Successfully published ${L} items!`,loading:!1,autoClose:5e3}),t.onAction&&t.onAction("publish")}),l(!1)}function V(){d.open()}async function X(){await M(s.id),t.onAction("cancel-schedule")}return e("div",{className:"ReleasePage__PublishStatus",children:[e(h,{size:"h2",children:"Status"}),e(R,{children:e(A,{className:"ReleasePage__PublishStatus__table",verticalSpacing:"xs",striped:!0,fontSize:"xs",children:[e("thead",{children:e("tr",{children:[e("th",{children:"status"}),e("th",{children:"actions"})]})}),e("tbody",{children:e("tr",{children:[e("td",{children:e(K,{release:s})}),e("td",{children:e("div",{className:"ReleasePage__PublishStatus__actions",children:[!s.archivedAt&&!s.scheduledAt&&e(P,{label:"You don't have access to publish this release",condition:!a,children:e(g,{label:"Publish the release immediately",position:"bottom",withArrow:!0,disabled:!a,children:e(m,{variant:"default",size:"xs",compact:!0,onClick:()=>r(),loading:o,disabled:!a,children:s.publishedAt?"Re-publish":"Publish"})})}),!s.archivedAt&&(s.scheduledAt?e(P,{label:"You don't have access to manage scheduled releases",condition:!a,children:e(g,{label:"Cancel the scheduled release",position:"bottom",withArrow:!0,disabled:!a,children:e(m,{variant:"default",size:"xs",compact:!0,onClick:()=>X(),disabled:!a,children:"Cancel Schedule"})})}):e(P,{label:"You don't have access to manage scheduled releases",condition:!a,children:e(g,{label:"Schedule the release to be published at a future date",position:"bottom",withArrow:!0,wrapLines:!0,width:180,disabled:!a,children:e(m,{variant:"default",size:"xs",compact:!0,onClick:()=>V(),disabled:!a,children:"Schedule"})})}))]})})]})})]})})]})};p.DocsList=t=>{let c=t.release,i=c.docIds||[];return e("div",{className:"ReleasePage__DocsList",children:[e("div",{className:"ReleasePage__DocsList__header",children:[e(h,{size:"h2",children:"Docs"}),e(m,{component:"a",variant:"default",size:"xs",compact:!0,href:`/cms/releases/${c.id}/edit`,children:"Edit"})]}),e(R,{className:"ReleasePage__DocsList__cards",children:i.map(a=>e("div",{className:"ReleasePage__DocsList__card",children:e("a",{href:`/cms/content/${a}`,children:e(H,{docId:a,statusBadges:!0,hideReleases:!0})})},a))})]})};p.DataSourcesList=t=>{let c=t.release,i=c.dataSourceIds||[],[a,s]=u({});return x(()=>{let o=!1;async function l(){let n=await Promise.all(i.map(async d=>{let r=await $(d);return[d,r]}));if(o)return;let _={};for(let[d,r]of n)r&&(_[d]=r);s(_)}return l(),()=>{o=!0}},[i.join(",")]),e("div",{className:"ReleasePage__DataSourcesList",children:[e("div",{className:"ReleasePage__DataSourcesList__header",children:[e(h,{size:"h2",children:"Data Sources"}),e(m,{component:"a",variant:"default",size:"xs",compact:!0,href:`/cms/releases/${c.id}/edit`,children:"Edit"})]}),e(R,{className:"ReleasePage__DataSourcesList__items",children:i.map(o=>{let l=a[o];return e("a",{className:"ReleasePage__DataSourcesList__item",href:`/cms/data/${o}`,children:[e(q,{className:"ReleasePage__DataSourcesList__item__icon",type:l?.type}),e("div",{className:"ReleasePage__DataSourcesList__item__info",children:[e("div",{className:"ReleasePage__DataSourcesList__item__id",children:o}),l?.description&&e("div",{className:"ReleasePage__DataSourcesList__item__description",children:l.description})]})]},o)})})]})};export{p as ReleasePage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as U}from"./chunk-MYPLMHFW.js";import{a as v}from"./chunk-QLIIVG5Q.js";import{c as n}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-WASID5UU.js";import{Ga as r,a as u,c as l,e as L,j as p}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-PVAE643M.js";p();var g="path",R=400;function y(o){return`${o.pathname}${o.search}${o.hash}`}function E(){return new URLSearchParams(window.location.search).get(g)||""}function W(o){let a=(window.__ROOT_CTX.sidebar?.tools||{})[o.id];v(a?.label||o.id);let i=a?.cmsUrl,t=a?.externalUrl;return l(()=>{i?.startsWith("/cms/")&&window.location.replace(i)},[i]),l(()=>{t&&window.open(t,"_blank","noopener,noreferrer")?.focus()},[t]),a?t?r(n,{children:r("div",{className:"SidebarToolsPage SidebarToolsPage--message",children:r("a",{href:t,target:"_blank",rel:"noreferrer noopener",children:["Open ",a.label||o.id," in a new tab"]})})}):i?.startsWith("/cms/")?r(n,{children:r("div",{className:"SidebarToolsPage",children:"redirecting..."})}):i?r(n,{children:r("div",{className:"SidebarToolsPage SidebarToolsPage--error",children:["invalid cmsUrl (must start with /cms/): ",o.id]})}):a.iframeUrl?r(n,{children:r("div",{className:"SidebarToolsPage",children:r(_,{iframeUrl:a.iframeUrl})})}):r(n,{children:r("div",{className:"SidebarToolsPage SidebarToolsPage--error",children:["missing iframeUrl: ",o.id]})}):r(n,{children:r("div",{className:"SidebarToolsPage SidebarToolsPage--error",children:["not found: ",o.id]})})}function _(o){let d=L(null),[a]=u(()=>new URL(o.iframeUrl,window.location.href)),[i]=u(()=>{let t=E();if(!t)return o.iframeUrl;try{return new URL(t,a.origin).toString()}catch{return o.iframeUrl}});return l(()=>{let t=d.current;if(!t)return;let w=y(a),h=null,c=!1,f=e=>{if(e===h)return;h=e;let s=new URL(window.location.href);e&&e!==w?s.searchParams.set(g,e):s.searchParams.delete(g),window.history.replaceState(window.history.state,"",s.toString())},T=()=>{try{let e=t.contentWindow?.location;return!e||e.href==="about:blank"?null:`${e.pathname}${e.search}${e.hash}`}catch{return c=!0,null}},b=()=>{let e=T();e!==null&&f(e)};t.addEventListener("load",b);let m=0,P=()=>{if(!c){let e=T();e!==null&&f(e)}c||(m=window.setTimeout(P,R))};m=window.setTimeout(P,R);let S=e=>{if(e.source===t.contentWindow&&e.origin===a.origin&&U(e.data))try{let s=new URL(e.data.rootTool.url,a.origin);f(y(s))}catch{}};return window.addEventListener("message",S),()=>{t.removeEventListener("load",b),window.clearTimeout(m),window.removeEventListener("message",S)}},[a]),r("iframe",{ref:d,src:i})}export{W as SidebarToolsPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as C,f as oe,g as re,h as le,i as ce,j as me,k as de,l as _e,m as ge,n as pe,o as ue,p as ke,q as fe,r as Te,s as he}from"./chunk-XACLTYBB.js";import{r as ie}from"./chunk-ST6QNIWT.js";import"./chunk-UCYWQEAS.js";import"./chunk-MYPLMHFW.js";import"./chunk-U7LSFUHT.js";import"./chunk-6WJQBFN5.js";import"./chunk-34W6H4YG.js";import"./chunk-SYDHFYRC.js";import"./chunk-535JU7FU.js";import"./chunk-FBSBL476.js";import"./chunk-LAXQZPE3.js";import"./chunk-QWB6MAPJ.js";import{b as R,c as ae}from"./chunk-235TRWJF.js";import"./chunk-AAR7DBEN.js";import"./chunk-JBLSUM6W.js";import"./chunk-2RRM4HEQ.js";import{a as W}from"./chunk-HXSB6YB2.js";import{a as I}from"./chunk-OWYV43BT.js";import"./chunk-ZAJPNVYS.js";import"./chunk-EYJ6GKZR.js";import"./chunk-HV3JJ5UT.js";import"./chunk-G5647K25.js";import"./chunk-VJRMR2JM.js";import"./chunk-QFDU6FXP.js";import"./chunk-JDW4UORS.js";import"./chunk-UJX25CXD.js";import"./chunk-Z2CRNO3I.js";import"./chunk-QRAFYIAW.js";import"./chunk-ATTW36EM.js";import"./chunk-YDO2EDVY.js";import"./chunk-5MV6XVGA.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import"./chunk-W5DOO6ID.js";import"./chunk-YBHFGQ3Z.js";import{a as k}from"./chunk-2PTLQRTU.js";import{a as f}from"./chunk-PIJ3E47R.js";import"./chunk-NCZD5IWS.js";import{a as se}from"./chunk-QLIIVG5Q.js";import{c as ne}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-ISUGBMXC.js";import"./chunk-DZYYWCHX.js";import{a as Y}from"./chunk-XOWWPE7X.js";import{e as x}from"./chunk-WASID5UU.js";import{$a as b,Ab as J,Fa as P,Ga as e,Gb as Q,V,Vc as M,W as h,Ya as Z,_c as te,a as d,ad as A,c as y,ca as U,da as T,e as O,g as D,j as Ie,lc as ee,na as G,pc as F,qb as B,qc as w,ua as S,za as L}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import{h as X}from"./chunk-7SK47HHZ.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";Ie();function H(a){return e(ie,{className:x("TaskCommentEditor",a.className),placeholder:a.placeholder,value:a.value,onChange:a.onChange,autoFocus:a.autoFocus,autosize:!0,variant:"comment"})}var we=[{value:"new",label:"New"},{value:"in-progress",label:"In progress"},{value:"in-review",label:"In review"},{value:"closed",label:"Closed"}],Ce=[{value:"high",label:"High"},{value:"medium",label:"Medium"},{value:"normal",label:"Normal"}];function yt(a){let t=a.id,[i,o]=d(null),[_,g]=d([]),[r,l]=d([]),[n,m]=d(!0),[c,s]=d("");return se(i?`Task: ${i.title}`:`Task: ${t}`),y(()=>{m(!0),s("");let u=[oe(t,p=>{o(p),m(!1)},p=>{s(k(p)),m(!1)}),re(t,p=>g(p),p=>s(k(p))),le(t,p=>l(p),p=>s(k(p)))];return()=>u.forEach(p=>p())},[t]),e(ne,{children:e("div",{className:"TaskPage",children:[e("div",{className:"TaskPage__header",children:[e(U,{className:"TaskPage__header__breadcrumbs",children:[e("a",{href:"/cms/tasks",children:"Tasks"}),e("div",{children:t})]}),e("div",{className:"TaskPage__header__titleWrap",children:[e(Ne,{task:i,taskId:t}),i&&e("span",{className:x("TaskPage__statusBadge",`TaskPage__statusBadge--${je(i.status)}`),children:$e(i.status)})]})]}),n&&e("div",{className:"TaskPage__loading",children:e(V,{color:"gray",size:"xl"})}),!n&&c&&e("div",{className:"TaskPage__error",children:c}),!n&&!c&&!i&&e(I,{className:"TaskPage__notFound",children:"Task not found."}),!n&&!c&&i&&e("div",{className:"TaskPage__body",children:[e("main",{className:"TaskPage__main",children:[e(ze,{task:i}),e(Ae,{task:i}),e(De,{task:i,comments:_,events:r}),e(ye,{taskId:i.id})]}),e("aside",{className:"TaskPage__side",children:e(Ee,{task:i})})]})]})})}function Ne(a){let{task:t}=a,[i,o]=d(!1),[_,g]=d(t?.title||""),[r,l]=d(!1);y(()=>{i||g(t?.title||"")},[t?.title,i]);async function n(){if(!t)return;let m=_.trim();if(!m){f({title:"Could not update title",message:"Task title is required.",color:"red"});return}if(m===t.title){g(t.title),o(!1);return}l(!0);try{await me(t.id,m),o(!1)}catch(c){f({title:"Could not update title",message:k(c),color:"red",autoClose:!1})}finally{l(!1)}}return t?i?e("form",{className:"TaskPage__header__titleForm",onSubmit:m=>{m.preventDefault(),n()},children:[e(S,{autoFocus:!0,className:"TaskPage__header__titleInput",disabled:r,value:_,onChange:m=>g(m.currentTarget.value),onKeyDown:m=>{m.key==="Escape"&&(g(t.title),o(!1))}}),e(T,{compact:!0,size:"xs",color:"dark",type:"submit",loading:r,leftIcon:e(b,{size:14,strokeWidth:"1.8"}),children:"Save"}),e(T,{compact:!0,size:"xs",variant:"default",type:"button",leftIcon:e(A,{size:14,strokeWidth:"1.8"}),onClick:()=>{g(t.title),o(!1)},children:"Cancel"})]}):e("div",{className:"TaskPage__header__titleContent",children:[e(W,{size:"h1",children:t.title}),e(P,{label:"Edit title",children:e(h,{size:"sm",onClick:()=>o(!0),children:e(w,{size:16,strokeWidth:"1.8"})})})]}):e(W,{size:"h1",children:`Task #${a.taskId}`})}function ze(a){let{task:t}=a,[i,o]=d(!1),[_,g]=d(t.description||""),[r,l]=d(!1);y(()=>{i||g(t.description||"")},[t.description,i]);async function n(){l(!0);try{await pe(t.id,_.trim()),o(!1)}catch(m){f({title:"Could not update description",message:k(m),color:"red",autoClose:!1})}finally{l(!1)}}return e(I,{className:"TaskPage__description",children:[e("div",{className:"TaskPage__description__top",children:[e("div",{className:"TaskPage__description__label",children:"Description"}),!i&&e(h,{size:"sm",onClick:()=>o(!0),children:e(w,{size:16,strokeWidth:"1.8"})})]}),i?e("div",{className:"TaskPage__description__edit",children:[e(G,{autosize:!0,autoFocus:!0,minRows:4,value:_,placeholder:"Add task details, scope, and acceptance criteria.",onChange:m=>g(m.currentTarget.value)}),e("div",{className:"TaskPage__description__editActions",children:[e(T,{compact:!0,size:"xs",variant:"default",leftIcon:e(A,{size:14,strokeWidth:"1.8"}),onClick:()=>{o(!1),g(t.description||"")},children:"Cancel"}),e(T,{compact:!0,size:"xs",color:"dark",loading:r,leftIcon:e(b,{size:14,strokeWidth:"1.8"}),onClick:n,children:"Save"})]})]}):e("div",{className:x("TaskPage__description__content",!t.description&&"TaskPage__description__content--empty"),children:t.description||"No description provided."})]})}function Ae(a){let{task:t}=a,i=O(null),[o,_]=d(!1),[g,r]=d(""),l=t.attachments||[];async function n(c){let s=Array.from(c);if(s.length!==0){_(!0);try{for(let u of s){let p=await X(u);await ue(t.id,{...p,filename:p.filename||u.name,contentType:u.type||void 0,size:u.size})}f({message:s.length===1?"File attached.":`${s.length} files attached.`,color:"green"})}catch(u){f({title:"Could not attach file",message:k(u),color:"red",autoClose:!1})}finally{_(!1),i.current&&(i.current.value="")}}}async function m(c){let s=xe(c);if(window.confirm(`Remove ${s} from this task?`)){r(c.id);try{await ke(t.id,c.id)}catch(u){f({title:"Could not remove attachment",message:k(u),color:"red",autoClose:!1})}finally{r("")}}}return e("section",{className:"TaskPage__attachments",children:[e("div",{className:"TaskPage__attachments__top",children:[e("div",{className:"TaskPage__attachments__label",children:"Attachments"}),e(T,{compact:!0,size:"xs",variant:"subtle",type:"button",loading:o,leftIcon:e(F,{size:14,strokeWidth:"1.8"}),onClick:()=>i.current?.click(),children:"Attach files"}),e("input",{ref:i,className:"TaskPage__attachments__input",type:"file",multiple:!0,onChange:c=>{n(c.currentTarget.files||[])}})]}),l.length>0?e("div",{className:"TaskPage__attachments__list",children:l.map(c=>e("div",{className:"TaskPage__attachments__item",children:[e("div",{className:"TaskPage__attachments__itemIcon",children:e(F,{size:16,strokeWidth:"1.8"})}),e("div",{className:"TaskPage__attachments__itemContent",children:[e("a",{href:c.src,target:"_blank",rel:"noreferrer",className:"TaskPage__attachments__itemTitle",children:xe(c)}),e("div",{className:"TaskPage__attachments__itemMeta",children:Re(c)})]}),e("div",{className:"TaskPage__attachments__itemActions",children:[e(P,{label:"Open file",children:e(h,{component:"a",href:c.src,target:"_blank",rel:"noreferrer",size:"sm",children:e(J,{size:16,strokeWidth:"1.8"})})}),e(P,{label:"Remove attachment",children:e(h,{size:"sm",disabled:g===c.id,onClick:()=>m(c),children:e(M,{size:16,strokeWidth:"1.8"})})})]})]},c.id))}):e("div",{className:"TaskPage__attachments__empty",children:"No files attached."})]})}function Ee(a){let{task:t}=a,[i,o]=d(t.assignee||""),[_,g]=d(j(t.targetLaunchDate)),[r,l]=d("");y(()=>{o(t.assignee||""),g(j(t.targetLaunchDate))},[t.assignee,t.targetLaunchDate]);async function n(s,u){l(s);try{await u()}catch(p){f({title:"Could not update task",message:k(p),color:"red",autoClose:!1})}finally{l("")}}function m(){let s=i.trim();(t.assignee||"")!==s&&n("assignee",()=>ce(t.id,s||null))}function c(s){g(s),j(t.targetLaunchDate)!==s&&n("targetLaunchDate",()=>ge(t.id,Ke(s)))}return e(I,{className:"TaskPage__metadata",children:[e("div",{className:"TaskPage__metadata__field",children:[e("label",{children:"Status"}),e(L,{size:"xs",data:we,value:C(t.status),onChange:s=>{s&&s!==C(t.status)&&n("status",()=>de(t.id,s))}})]}),e("div",{className:"TaskPage__metadata__field",children:[e("label",{children:"Assignee"}),e("div",{className:"TaskPage__metadata__assignee",children:e(S,{size:"xs",type:"email",placeholder:"teammate@example.com",value:i,disabled:r==="assignee",onChange:s=>o(s.currentTarget.value),onBlur:()=>m(),onKeyDown:s=>{s.key==="Enter"&&s.currentTarget.blur()}})})]}),e("div",{className:"TaskPage__metadata__field",children:[e("label",{children:"Priority"}),e(L,{size:"xs",data:Ce,value:t.priority||"normal",onChange:s=>{s&&s!==(t.priority||"normal")&&n("priority",()=>_e(t.id,s))}})]}),e("div",{className:"TaskPage__metadata__field",children:[e("label",{children:"Target launch date"}),e("div",{className:"TaskPage__metadata__date",children:e("input",{type:"date",value:_,disabled:r==="targetLaunchDate",onInput:s=>c(s.currentTarget.value)})})]})]})}function De(a){let{task:t,comments:i,events:o}=a,_=D(()=>{let r=new Map;return i.filter(l=>l.parentId).forEach(l=>{let n=l.parentId||"";r.set(n,[...r.get(n)||[],l])}),r.forEach(l=>l.sort((n,m)=>E(n.createdAt)-E(m.createdAt))),r},[i]),g=D(()=>{let r=i.filter(n=>!n.parentId);return[{id:"opened",kind:"opened",createdAt:t.createdAt},...o.map(n=>({id:n.id,kind:"event",event:n,createdAt:n.createdAt})),...r.map(n=>({id:n.id,kind:"comment",comment:n,createdAt:n.createdAt}))].sort((n,m)=>E(n.createdAt)-E(m.createdAt))},[t,i,o]);return e("div",{className:"TaskPage__timeline",children:g.map(r=>r.kind==="opened"?e(Se,{task:t},r.id):r.kind==="event"?e(Le,{event:r.event},r.id):e(ve,{comment:r.comment,replies:_.get(r.comment.id)||[],threadParentId:r.comment.id},r.id))})}function Se(a){let{task:t}=a;return e("div",{className:"TaskPage__timelineItem TaskPage__timelineItem--event",children:[e("div",{className:"TaskPage__timelineItem__marker",children:e(b,{size:15,strokeWidth:"2"})}),e("div",{className:"TaskPage__timelineItem__content",children:[e("b",{children:z(t.createdBy||"unknown")})," opened this task"," ",N(t.createdAt),"."]})]})}function Le(a){let{event:t}=a;return e("div",{className:"TaskPage__timelineItem TaskPage__timelineItem--event",children:[e("div",{className:"TaskPage__timelineItem__marker",children:t.field==="title"?e(w,{size:15,strokeWidth:"2"}):t.field==="assignee"?e(te,{size:15,strokeWidth:"2"}):t.field==="priority"?e(Q,{size:15,strokeWidth:"2"}):t.field==="targetLaunchDate"?e(Z,{size:15,strokeWidth:"2"}):e(b,{size:15,strokeWidth:"2"})}),e("div",{className:"TaskPage__timelineItem__content",children:[e("b",{children:z(t.createdBy||"unknown")})," changed"," ",qe(t.field)," from"," ",e("span",{className:"TaskPage__timelineValue",children:Pe(t.field,t.oldValue)})," ","to"," ",e("span",{className:"TaskPage__timelineValue",children:Pe(t.field,t.newValue)})," ",N(t.createdAt),"."]})]})}function ve(a){let{comment:t}=a,i=window.firebase.user.email||"",[o,_]=d(!1),[g,r]=d(!1),[l,n]=d(t.body||q(t.content)),[m,c]=d(!1),s=t.createdBy===i&&!t.isDeleted,u=a.threadParentId||t.parentId||t.id;y(()=>{n(t.body||q(t.content))},[t.body,t.content]);async function p(){if(l){c(!0);try{await Te(t.taskId,t.id,l),r(!1)}catch(v){f({title:"Could not edit comment",message:k(v),color:"red",autoClose:!1})}finally{c(!1)}}}async function be(){if(window.confirm("Delete this comment?"))try{await he(t.taskId,t.id)}catch(v){f({title:"Could not delete comment",message:k(v),color:"red",autoClose:!1})}}return e("div",{className:x("TaskPage__timelineItem","TaskPage__timelineItem--comment",a.isReply&&"TaskPage__timelineItem--reply"),children:[e("div",{className:"TaskPage__timelineItem__marker",children:a.isReply?e(B,{size:15,strokeWidth:"2"}):e(ee,{size:15,strokeWidth:"2"})}),e("div",{className:"TaskPage__timelineItem__content",children:[e(I,{className:"TaskPage__comment",children:[e("div",{className:"TaskPage__comment__header",children:[e("div",{children:[e("b",{children:z(t.createdBy||"unknown")})," ",e("span",{children:N(t.createdAt)}),t.updatedAt&&!t.isDeleted&&e("span",{children:[" edited ",N(t.updatedAt)]})]}),e("div",{className:"TaskPage__comment__actions",children:[!t.isDeleted&&e(P,{label:"Reply",children:e(h,{size:"sm",onClick:()=>_(!o),children:e(B,{size:16,strokeWidth:"1.8"})})}),s&&e(P,{label:"Edit",children:e(h,{size:"sm",onClick:()=>r(!0),children:e(w,{size:16,strokeWidth:"1.8"})})}),s&&e(P,{label:"Delete",children:e(h,{size:"sm",onClick:be,children:e(M,{size:16,strokeWidth:"1.8"})})})]})]}),g?e("div",{className:"TaskPage__comment__edit",children:[e(H,{value:l,placeholder:"Edit this comment...",onChange:n}),e("div",{className:"TaskPage__comment__editActions",children:[e(T,{compact:!0,size:"xs",variant:"default",leftIcon:e(A,{size:14,strokeWidth:"1.8"}),onClick:()=>{r(!1),n(t.body||q(t.content))},children:"Cancel"}),e(T,{compact:!0,size:"xs",color:"dark",loading:m,disabled:!l,leftIcon:e(b,{size:14,strokeWidth:"1.8"}),onClick:p,children:"Save"})]})]}):e("div",{className:x("TaskPage__comment__body",t.isDeleted&&"TaskPage__comment__body--deleted"),children:t.isDeleted?"Comment deleted.":t.body?e(Be,{className:"TaskPage__comment__richText",data:t.body}):e(ae,{className:"TaskPage__comment__markdown",code:t.content})})]}),o&&e(ye,{taskId:t.taskId,parentId:u,autoFocus:!0,onSubmitted:()=>_(!1),onCancel:()=>_(!1)}),a.replies&&a.replies.length>0&&e("div",{className:"TaskPage__replies",children:a.replies.map(v=>e(ve,{comment:v,isReply:!0,threadParentId:t.id},v.id))})]})]})}function ye(a){let[t,i]=d(null),[o,_]=d(0),[g,r]=d(!1),l=!!a.parentId;async function n(m){if(m.preventDefault(),!!t){r(!0);try{await fe(a.taskId,t,a.parentId),i(null),_(c=>c+1),a.onSubmitted?.()}catch(c){f({title:l?"Could not add reply":"Could not add comment",message:k(c),color:"red",autoClose:!1})}finally{r(!1)}}}return e(I,{className:x("TaskPage__composer",l&&"TaskPage__composer--reply"),children:e("form",{onSubmit:n,children:[e(H,{autoFocus:a.autoFocus,placeholder:l?"Write a reply...":"Leave a comment...",value:t,onChange:i},o),e("div",{className:"TaskPage__composer__actions",children:[a.onCancel&&e(T,{compact:!0,size:"xs",variant:"default",type:"button",onClick:a.onCancel,children:"Cancel"}),e(T,{compact:!0,size:"xs",color:"dark",type:"submit",loading:g,disabled:!t,children:l?"Reply":"Comment"})]})]})})}function Be(a){return e("div",{className:a.className,children:(a.data.blocks||[]).map((t,i)=>e(Fe,{block:t},i))})}function Fe(a){let{block:t}=a;switch(t.type){case"paragraph":return e($,{tag:"p",html:t.data?.text});case"heading":return e($,{tag:"h4",html:t.data?.text});case"quote":return e($,{tag:"blockquote",html:t.data?.text});case"orderedList":return e("ol",{children:(t.data?.items||[]).map((i,o)=>e(K,{item:i},o))});case"unorderedList":return e("ul",{children:(t.data?.items||[]).map((i,o)=>e(K,{item:i},o))});case"image":{let i=t.data?.file;return i?.url?e("img",{src:i.url,width:Number(i.width)||void 0,height:Number(i.height)||void 0,alt:i.alt||""}):null}default:return null}}function $(a){if(!a.html)return null;let t=a.tag;return e(t,{dangerouslySetInnerHTML:{__html:R(a.html)}})}function K(a){return e("li",{children:[a.item.content&&e("span",{dangerouslySetInnerHTML:{__html:R(a.item.content)}}),a.item.items&&a.item.items.length>0&&e("ul",{children:a.item.items.map((t,i)=>e(K,{item:t},i))})]})}function q(a){return a.trim()?{blocks:a.split(/\n{2,}/).map(t=>({type:"paragraph",data:{text:Me(t).replace(/\n/g,"<br>")}})),time:Date.now(),version:"plain-text"}:null}function Me(a){return a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(a){return a?.toMillis?.()||0}function xe(a){let t=a.src.split("?")[0].split("/").filter(Boolean).at(-1)||"",i=a.filename||t||"Attachment";try{return decodeURIComponent(i)}catch{return i}}function Re(a){let t=[We(a.size),a.contentType||"",a.attachedBy?`attached by ${z(a.attachedBy)}`:"",a.attachedAt?N(a.attachedAt):""].filter(Boolean);return t.length>0?t.join(" - "):"Attached file"}function We(a){if(typeof a!="number")return"";if(a<1024)return`${a} B`;let t=["KB","MB","GB"],i=a/1024,o=0;for(;i>=1024&&o<t.length-1;)i=i/1024,o+=1;return`${i.toFixed(i>=10?0:1)} ${t[o]}`}function z(a){return a.split("@")[0]||a}function He(a){return a?.toMillis?new Date(a.toMillis()).toLocaleDateString("en",{month:"short",day:"numeric",year:"numeric"}):"No date"}function N(a){return a?.toMillis?new Date(a.toMillis()).toLocaleString("en",{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"}):"just now"}function $e(a){return C(a).replace(/[-_]/g," ")}function qe(a){return a.replace(/([A-Z])/g," $1").toLowerCase()}function Pe(a,t){return t?t instanceof Y?He(t):a==="assignee"?z(t):a==="title"?t:t.replace(/[-_]/g," "):"none"}function je(a){return C(a).replace(/[^a-z0-9]+/gi,"-").toLowerCase()}function j(a){if(!a?.toMillis)return"";let t=new Date(a.toMillis()),i=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),_=String(t.getDate()).padStart(2,"0");return`${i}-${o}-${_}`}function Ke(a){if(!a)return null;let[t,i,o]=a.split("-").map(Number);return!t||!i||!o?null:new Date(t,i-1,o)}export{yt as TaskPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-Y5EOMMNI.js";import"./chunk-XACLTYBB.js";import{a as e}from"./chunk-HXSB6YB2.js";import"./chunk-OWYV43BT.js";import"./chunk-QFDU6FXP.js";import"./chunk-PLYSJ7W5.js";import"./chunk-H37RXS4R.js";import"./chunk-2PTLQRTU.js";import"./chunk-PIJ3E47R.js";import{a as i}from"./chunk-QLIIVG5Q.js";import{c as s}from"./chunk-A7IZAHBZ.js";import"./chunk-AAHM6RYJ.js";import"./chunk-XOWWPE7X.js";import"./chunk-WASID5UU.js";import{Ga as a}from"./chunk-WRA24P66.js";import"./chunk-KUCVLANF.js";import"./chunk-DTMZLUNY.js";import"./chunk-PVAE643M.js";function k(){return i("Tasks"),a(s,{children:a("div",{className:"TasksPage",children:[a("div",{className:"TasksPage__header",children:a(e,{size:"h1",children:"Tasks"})}),a(g,{variant:"page"})]})})}export{k as TasksPage};
|