@firecms/core 3.0.0-alpha.14 → 3.0.0-alpha.15
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/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(o,$n){typeof exports=="object"&&typeof module<"u"?$n(exports,require("clsx"),require("tailwind-merge"),require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("notistack"),require("@radix-ui/react-tooltip"),require("@material-design-icons/font/filled.css"),require("@radix-ui/react-collapsible"),require("@radix-ui/react-checkbox"),require("react-datepicker"),require("@radix-ui/react-dialog"),require("react-dropzone"),require("react-fast-compare"),require("markdown-it"),require("@radix-ui/react-dropdown-menu"),require("cmdk"),require("@radix-ui/react-select"),require("react-dom"),require("@radix-ui/react-tabs"),require("date-fns/format"),require("date-fns/locale"),require("object-hash"),require("@hello-pangea/dnd"),require("react-image-file-resizer"),require("formik"),require("react-markdown-editor-lite"),require("yup"),require("react-window"),require("react-use-measure"),require("@radix-ui/react-popover"),require("js-search"),require("@radix-ui/react-portal")):typeof define=="function"&&define.amd?define(["exports","clsx","tailwind-merge","react/jsx-runtime","react","react-router-dom","notistack","@radix-ui/react-tooltip","@material-design-icons/font/filled.css","@radix-ui/react-collapsible","@radix-ui/react-checkbox","react-datepicker","@radix-ui/react-dialog","react-dropzone","react-fast-compare","markdown-it","@radix-ui/react-dropdown-menu","cmdk","@radix-ui/react-select","react-dom","@radix-ui/react-tabs","date-fns/format","date-fns/locale","object-hash","@hello-pangea/dnd","react-image-file-resizer","formik","react-markdown-editor-lite","yup","react-window","react-use-measure","@radix-ui/react-popover","js-search","@radix-ui/react-portal"],$n):(o=typeof globalThis<"u"?globalThis:o||self,$n(o.FireCMS={},o.clsx,o.tailwindMerge,o.jsxRuntime,o.React,o.reactRouterDom,o.notistack,o.TooltipPrimitive,null,o.Collapsible,o.CheckboxPrimitive,o.DatePicker,o.DialogPrimitive,o.reactDropzone,o.equal,o.MarkdownIt,o.DropdownMenu,o.cmdk,o.SelectPrimitive,o.ReactDOM,o.TabsPrimitive,o.format,o.locales,o.hash,o.dnd,o.Resizer,o.formik,o.MdEditor,o.yup,o.reactWindow,o.useMeasure,o.PopoverPrimitive,o.JsSearch,o.Portal))})(this,function(o,$n,Ia,n,f,Ie,Wt,ba,oU,pa,wa,Ro,ka,er,de,Gt,ma,go,va,Ka,Ca,Sa,Ba,zt,Kn,Ea,Fe,_n,Fa,Pa,nr,Da,Na,Ma){"use strict";function Pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,i.get?i:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const ce=Pe(f),jn=Pe(ba),qn=Pe(pa),Ht=Pe(wa),$e=Pe(ka),Jn=Pe(ma),je=Pe(va),Ta=Pe(Ka),or=Pe(Ca),Ut=Pe(Ba),De=Pe(Fa),Zn=Pe(Da),Oa=Pe(Na),La=Pe(Ma);function E(...e){return Ia.twMerge($n.clsx(e))}const Qa={breadcrumbs:[],set:e=>{}},Yt=f.createContext(Qa),Va=({children:e})=>{const[t,c]=f.useState([]),i=l=>{c(l.breadcrumbs)};return n.jsx(Yt.Provider,{value:{breadcrumbs:t,set:i},children:e})},Wa={mode:"light",setMode:e=>{},toggleMode:()=>{}},rr=f.createContext(Wa),Ga=rr.Provider;function za(e){return e.includes("-")||e.includes("_")||!e.includes(" ")?e.replace(/[-_]/g," ").replace(/\w\S*/g,function(c){return c.charAt(0).toUpperCase()+c.substr(1)}):e}function be(e){return $t(jt(e))}function $t(e){return e.startsWith("/")?e.slice(1):e}function jt(e){return e.endsWith("/")?e.slice(0,-1):e}function Ha(e){return e.startsWith("/")?e:`/${e}`}function Ua(e){const t=be(e);if(t.includes("/")){const c=t.split("/");return c[c.length-1]}return t}function tr(e,t){const c=be(e),i=c.split("/");if(i.length%2===0)throw Error(`Collection paths must have an odd number of segments: ${e}`);const l=t.find(s=>s.alias===i[0]);let a;if(l&&(a=l.path),i.length>1){const s=Io(a??i[0],t);if(!s?.subcollections)return c;const d=c.split("/").slice(2).join("/");return(a??i[0])+"/"+i[1]+"/"+tr(d,s.subcollections)}else return a??c}function Io(e,t){const c=be(e).split("/");if(c.length%2===0)throw Error(`Collection paths must have an odd number of segments: ${e}`);const i=bo(c);let l;for(let a=0;a<i.length;a++){const s=i[a],d=t&&t.sort((u,A)=>(u.alias??"").localeCompare(A.alias??"")).find(u=>u.alias===s||u.path===s);if(d){if(s===e)l=d;else if(d.subcollections){const u=e.replace(s,"").split("/").slice(2).join("/");u.length>0&&(l=Io(u,d.subcollections))}}if(l)break}return l}function bo(e){const t=e.length>0&&e.length%2===0?e.splice(0,e.length-1):e,c=t.length,i=[];for(let l=c;l>0;l=l-2)i.push(t.slice(0,l).join("/"));return i}function cr(e){const{path:t,collections:c=[],currentFullPath:i}=e,l=be(t).split("/"),a=bo(l),s=[];for(let d=0;d<a.length;d++){const u=a[d],A=c&&c.find(_=>_.alias===u||_.path===u);if(A){const _=A.alias??A.path,g=i&&i.length>0?i+"/"+_:_;s.push({type:"collection",path:g,collection:A});const y=be(be(t).replace(u,"")),h=y.length>0?y.split("/"):[];if(h.length>0){const I=h[0],b=g+"/"+I;if(s.push({type:"entity",entityId:I,path:g,parentCollection:A}),h.length>1){const p=h.slice(1).join("/");if(!A)throw Error("collection not found resolving path: "+A);const w=A.views,k=w&&w.find(K=>K.key===p);if(k){const K=i&&i.length>0?i+"/"+k.key:k.key;s.push({type:"custom_view",path:K,view:k})}else A.subcollections&&s.push(...cr({path:p,customViews:w,collections:A.subcollections,currentFullPath:b}))}}break}}return s}const qt=f.createContext({}),Qe=()=>f.useContext(qt),Jt=f.createContext({}),Ae=()=>f.useContext(Jt),ir=f.createContext({}),yn=()=>f.useContext(ir),Zt=f.createContext({}),Xn=()=>f.useContext(Zt),Xt=f.createContext({}),Cn=()=>f.useContext(Xt),xt=f.createContext({}),Sn=()=>f.useContext(xt),cn=()=>{const{enqueueSnackbar:e,closeSnackbar:t}=Wt.useSnackbar(),c=f.useCallback(l=>{const{type:a,message:s,autoHideDuration:d}=l;e({message:s,variant:a,autoHideDuration:d})},[]),i=f.useCallback(()=>{t()},[]);return f.useMemo(()=>({open:c,close:i}),[c,i])},Rt=f.createContext(void 0),Bn=()=>f.useContext(Rt),ar=f.createContext({sideDialogsController:{},sideEntityController:{},navigation:{},dataSource:{},storageSource:{},authController:{},snackbarController:{},fields:{}}),re=()=>{const e=f.useContext(ar),t=yn(),c=Xn(),i=Cn(),l=Ae(),a=Qe(),s=Sn(),d=cn(),u=Bn();return{...e,authController:t,sideDialogsController:c,sideEntityController:i,navigation:l,dataSource:a,storageSource:s,snackbarController:d,userConfigPersistence:u}};function ec({path:e,collection:t,filterValues:c,sortBy:i,itemCount:l,searchString:a}){const s=Qe(),u=Ae().resolveAliasesFrom(e),A=i?i[0]:void 0,_=i?i[1]:void 0,g=re(),[y,h]=f.useState([]),[I,b]=f.useState(!1),[p,w]=f.useState(),[k,K]=f.useState(!1);return f.useEffect(()=>{b(!0);const m=async S=>{if(t.callbacks?.onFetch)try{S=await Promise.all(S.map(B=>t.callbacks.onFetch({collection:t,path:u,entity:B,context:g})))}catch(B){console.error(B)}b(!1),w(void 0),h(S.map(B=>({...B}))),K(!l||S.length<l)},v=S=>{console.error("ERROR",S),b(!1),h([]),w(S)};return s.listenCollection?s.listenCollection({path:u,collection:t,onUpdate:m,onError:v,searchString:a,filter:c,limit:l,startAfter:void 0,orderBy:A,order:_}):(s.fetchCollection({path:u,collection:t,searchString:a,filter:c,limit:l,startAfter:void 0,orderBy:A,order:_}).then(m).catch(v),()=>{})},[u,l,_,A,c,a]),{data:y,dataLoading:I,dataLoadingError:p,noMoreToLoad:k}}const lr={};function sr({path:e,entityId:t,collection:c,useCache:i=!1}){const l=Qe(),s=Ae().resolveAliasesFrom(e),d=re(),[u,A]=f.useState(),[_,g]=f.useState(!0),[y,h]=f.useState();return f.useEffect(()=>{g(!0);const I=async p=>{if(c.callbacks?.onFetch&&p)try{p=await c.callbacks.onFetch({collection:c,path:s,entity:p,context:d})}catch(w){console.error(w)}lr[`${s}/${t}`]=p,A(p),g(!1),h(void 0)},b=p=>{console.error("ERROR fetching entity",p),g(!1),A(void 0),h(p)};return t&&i&&lr[`${s}/${t}`]?(A(lr[`${s}/${t}`]),g(!1),h(void 0),()=>{}):t&&s&&c?l.listenEntity?l.listenEntity({path:s,entityId:t,collection:c,onUpdate:I,onError:b}):(l.fetchEntity({path:s,entityId:t,collection:c}).then(I).catch(b),()=>{}):(I(void 0),()=>{})},[t,s]),{entity:u,dataLoading:_,dataLoadingError:y}}async function dr({collection:e,path:t,entityId:c,values:i,previousValues:l,status:a,dataSource:s,context:d,onSaveSuccess:u,onSaveFailure:A,onPreSaveHookError:_,onSaveSuccessHookError:g}){let y;const h=d.navigation.resolveAliasesFrom(t),I=e.callbacks;if(I?.onPreSave)try{const b=Me({collection:e,path:t,values:l,entityId:c,fields:d.fields});y=await I.onPreSave({collection:b,path:t,resolvedPath:h,entityId:c,values:i,previousValues:l,status:a,context:d})}catch(b){console.error(b),_&&_(b);return}else y=i;return s.saveEntity({collection:e,path:h,entityId:c,values:y,previousValues:l,status:a}).then(b=>{try{if(I?.onSaveSuccess){const p=Me({collection:e,path:t,values:y,entityId:c,fields:d.fields});I.onSaveSuccess({collection:p,path:t,resolvedPath:h,entityId:b.id,values:y,previousValues:l,status:a,context:d})}}catch(p){g&&g(p)}u&&u(b)}).catch(b=>{if(I?.onSaveFailure){const p=Me({collection:e,path:t,values:y,entityId:c,fields:d.fields});I.onSaveFailure({collection:p,path:t,resolvedPath:h,entityId:c,values:y,previousValues:l,status:a,context:d})}A&&A(b)})}async function nc({dataSource:e,entity:t,collection:c,callbacks:i,onDeleteSuccess:l,onDeleteFailure:a,onPreDeleteHookError:s,onDeleteSuccessHookError:d,context:u}){console.debug("Deleting entity",t.path,t.id);const A={entity:t,collection:c,entityId:t.id,path:t.path,context:u};if(i?.onPreDelete)try{await i.onPreDelete(A)}catch(_){return console.error(_),s&&s(t,_),!1}return e.deleteEntity({entity:t}).then(()=>{l&&l(t);try{return i?.onDelete&&i.onDelete(A),!0}catch(_){return d&&d(t,_),!1}}).catch(_=>(a&&a(t,_),!1))}function Ne({property:e,value:t,setValue:c}){const i=f.useRef(null);f.useEffect(()=>{typeof e.disabled=="object"&&!!e.disabled.clearOnDisabled?t!=null&&(i.current=t,c(null)):i.current&&(c(i.current),i.current=null)},[e])}function oc({path:e,context:t}){const c=t.dataSource,i=t.navigation;if(!i)throw Error("Calling getNavigationFrom, but main navigation has not yet been initialised");const a=cr({path:e,collections:i.collections??[]}).map(s=>{if(s.type==="collection")return Promise.resolve(s);if(s.type==="entity"){const d=i.getCollection(s.path,s.entityId);if(!d)throw Error(`No collection defined in the navigation for the entity with path ${s.path}`);return c.fetchEntity({path:s.path,entityId:s.entityId,collection:d}).then(u=>{if(u)return{...s,entity:u}})}else{if(s.type==="custom_view")return Promise.resolve(s);throw Error("Unmapped element in useEntitiesFromPath")}}).filter(s=>!!s);return Promise.all(a)}function Ya({path:e}){const t=re(),[c,i]=f.useState(),[l,a]=f.useState(!1),[s,d]=f.useState();return f.useEffect(()=>{t.navigation&&(a(!0),d(void 0),oc({path:e,context:t}).then(A=>{i(A)}).catch(A=>d(A)).finally(()=>a(!1)))},[e,t]),t.navigation?{data:c,dataLoading:l,dataLoadingError:s}:{dataLoading:!0}}const ur=()=>f.useContext(rr),rc=e=>{const{onSuccess:t,onError:c,disableClipboardAPI:i=!1,copiedDuration:l}=e||{},a=f.useRef(null),[s,d]=f.useState(!1),[u,A]=f.useState("");f.useEffect(()=>{l&&setTimeout(()=>d(!1),l)},[s]);const _=()=>navigator.clipboard!==void 0,g=f.useCallback(k=>{if(c)c(k);else throw new Error(k)},[c]),y=f.useCallback(k=>{t&&t(k),d(!0),A(k)},[t]),h=f.useCallback(k=>{navigator.clipboard.writeText(k).then(()=>y(k)).catch(K=>{g(K),d(!1)})},[g,y]),I=()=>{_()&&navigator.clipboard.writeText("")},b=k=>w("copy",typeof k=="object"?void 0:k),p=()=>w("cut"),w=f.useCallback((k="copy",K)=>{const m=a.current,v=m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"),S=a.current;_()&&!i&&(K?h(K):m?v?(h(S.value),k==="cut"&&(S.value="")):h(m.innerText):g("Both the ref & text were undefined"))},[i,h,g]);return{ref:a,isCoppied:s,clipboard:u,clearClipboard:I,isSupported:_,copy:b,cut:p}},fr=()=>f.useContext(Yt),$a={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536,"3xl":1920},Ge=(e="lg")=>{const[t,c]=f.useState(!1);return f.useEffect(()=>{const i=()=>{const l=window.matchMedia(`(min-width: ${$a[e]+1}px)`).matches;c(l)};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),t};function xn(e){const t=Ae(),c=Xn(),i=f.useCallback(()=>{if(e.path){let a=e.collection;if(a||(a=t.getCollection(e.path)),!a)throw Error("Not able to resolve the collection in useReferenceDialog");c.open({key:`reference_${e.path}`,component:n.jsx(ra,{collection:a,...e}),width:"90vw",onClose:()=>{e.onClose?.()}})}else throw Error("useReferenceDialog: You are trying to open a reference dialog, but have not declared the `path`")},[t,e,c]),l=f.useCallback(()=>{c.close()},[c]);return{open:i,close:l}}const ja=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAAB9pJREFUWMONl12obVUVx39jzLk+9j7nHq9y1QT1qpcbSIaXQFGs24PQl3HroSQyqHwJ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25zLzIwMjEtMDUtMTAvOGIxNDNhYjgwODhkMjBlZThkYmUzOTFhN2NkNmQ3NmQuaWNvLnBuZ9msgG0AAAAASUVORK5CYII=
|
|
1
|
+
(function(o,$n){typeof exports=="object"&&typeof module<"u"?$n(exports,require("clsx"),require("tailwind-merge"),require("react/jsx-runtime"),require("react"),require("react-router-dom"),require("notistack"),require("@radix-ui/react-tooltip"),require("@material-design-icons/font/filled.css"),require("@radix-ui/react-collapsible"),require("@radix-ui/react-checkbox"),require("react-datepicker"),require("@radix-ui/react-dialog"),require("react-dropzone"),require("react-fast-compare"),require("markdown-it"),require("@radix-ui/react-dropdown-menu"),require("cmdk"),require("@radix-ui/react-select"),require("react-dom"),require("@radix-ui/react-tabs"),require("date-fns/format"),require("date-fns/locale"),require("object-hash"),require("@hello-pangea/dnd"),require("react-image-file-resizer"),require("formik"),require("react-markdown-editor-lite"),require("yup"),require("react-window"),require("react-use-measure"),require("@radix-ui/react-popover"),require("js-search"),require("@radix-ui/react-portal")):typeof define=="function"&&define.amd?define(["exports","clsx","tailwind-merge","react/jsx-runtime","react","react-router-dom","notistack","@radix-ui/react-tooltip","@material-design-icons/font/filled.css","@radix-ui/react-collapsible","@radix-ui/react-checkbox","react-datepicker","@radix-ui/react-dialog","react-dropzone","react-fast-compare","markdown-it","@radix-ui/react-dropdown-menu","cmdk","@radix-ui/react-select","react-dom","@radix-ui/react-tabs","date-fns/format","date-fns/locale","object-hash","@hello-pangea/dnd","react-image-file-resizer","formik","react-markdown-editor-lite","yup","react-window","react-use-measure","@radix-ui/react-popover","js-search","@radix-ui/react-portal"],$n):(o=typeof globalThis<"u"?globalThis:o||self,$n(o["FireCMS core"]={},o.clsx,o.tailwindMerge,o.jsxRuntime,o.React,o.reactRouterDom,o.notistack,o.TooltipPrimitive,null,o.Collapsible,o.CheckboxPrimitive,o.DatePicker,o.DialogPrimitive,o.reactDropzone,o.equal,o.MarkdownIt,o.DropdownMenu,o.cmdk,o.SelectPrimitive,o.ReactDOM,o.TabsPrimitive,o.format,o.locales,o.hash,o.dnd,o.Resizer,o.formik,o.MdEditor,o.yup,o.reactWindow,o.useMeasure,o.PopoverPrimitive,o.JsSearch,o.Portal))})(this,function(o,$n,Ia,n,f,Ie,Wt,ba,oU,pa,wa,Ro,ka,er,de,Gt,ma,go,va,Ka,Ca,Sa,Ba,zt,Kn,Ea,Fe,_n,Fa,Pa,nr,Da,Na,Ma){"use strict";function Pe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const c in e)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(t,c,i.get?i:{enumerable:!0,get:()=>e[c]})}}return t.default=e,Object.freeze(t)}const ce=Pe(f),jn=Pe(ba),qn=Pe(pa),Ht=Pe(wa),$e=Pe(ka),Jn=Pe(ma),je=Pe(va),Ta=Pe(Ka),or=Pe(Ca),Ut=Pe(Ba),De=Pe(Fa),Zn=Pe(Da),Oa=Pe(Na),La=Pe(Ma);function E(...e){return Ia.twMerge($n.clsx(e))}const Qa={breadcrumbs:[],set:e=>{}},Yt=f.createContext(Qa),Va=({children:e})=>{const[t,c]=f.useState([]),i=l=>{c(l.breadcrumbs)};return n.jsx(Yt.Provider,{value:{breadcrumbs:t,set:i},children:e})},Wa={mode:"light",setMode:e=>{},toggleMode:()=>{}},rr=f.createContext(Wa),Ga=rr.Provider;function za(e){return e.includes("-")||e.includes("_")||!e.includes(" ")?e.replace(/[-_]/g," ").replace(/\w\S*/g,function(c){return c.charAt(0).toUpperCase()+c.substr(1)}):e}function be(e){return $t(jt(e))}function $t(e){return e.startsWith("/")?e.slice(1):e}function jt(e){return e.endsWith("/")?e.slice(0,-1):e}function Ha(e){return e.startsWith("/")?e:`/${e}`}function Ua(e){const t=be(e);if(t.includes("/")){const c=t.split("/");return c[c.length-1]}return t}function tr(e,t){const c=be(e),i=c.split("/");if(i.length%2===0)throw Error(`Collection paths must have an odd number of segments: ${e}`);const l=t.find(s=>s.alias===i[0]);let a;if(l&&(a=l.path),i.length>1){const s=Io(a??i[0],t);if(!s?.subcollections)return c;const d=c.split("/").slice(2).join("/");return(a??i[0])+"/"+i[1]+"/"+tr(d,s.subcollections)}else return a??c}function Io(e,t){const c=be(e).split("/");if(c.length%2===0)throw Error(`Collection paths must have an odd number of segments: ${e}`);const i=bo(c);let l;for(let a=0;a<i.length;a++){const s=i[a],d=t&&t.sort((u,A)=>(u.alias??"").localeCompare(A.alias??"")).find(u=>u.alias===s||u.path===s);if(d){if(s===e)l=d;else if(d.subcollections){const u=e.replace(s,"").split("/").slice(2).join("/");u.length>0&&(l=Io(u,d.subcollections))}}if(l)break}return l}function bo(e){const t=e.length>0&&e.length%2===0?e.splice(0,e.length-1):e,c=t.length,i=[];for(let l=c;l>0;l=l-2)i.push(t.slice(0,l).join("/"));return i}function cr(e){const{path:t,collections:c=[],currentFullPath:i}=e,l=be(t).split("/"),a=bo(l),s=[];for(let d=0;d<a.length;d++){const u=a[d],A=c&&c.find(_=>_.alias===u||_.path===u);if(A){const _=A.alias??A.path,g=i&&i.length>0?i+"/"+_:_;s.push({type:"collection",path:g,collection:A});const y=be(be(t).replace(u,"")),h=y.length>0?y.split("/"):[];if(h.length>0){const I=h[0],b=g+"/"+I;if(s.push({type:"entity",entityId:I,path:g,parentCollection:A}),h.length>1){const p=h.slice(1).join("/");if(!A)throw Error("collection not found resolving path: "+A);const w=A.views,k=w&&w.find(K=>K.key===p);if(k){const K=i&&i.length>0?i+"/"+k.key:k.key;s.push({type:"custom_view",path:K,view:k})}else A.subcollections&&s.push(...cr({path:p,customViews:w,collections:A.subcollections,currentFullPath:b}))}}break}}return s}const qt=f.createContext({}),Qe=()=>f.useContext(qt),Jt=f.createContext({}),Ae=()=>f.useContext(Jt),ir=f.createContext({}),yn=()=>f.useContext(ir),Zt=f.createContext({}),Xn=()=>f.useContext(Zt),Xt=f.createContext({}),Cn=()=>f.useContext(Xt),xt=f.createContext({}),Sn=()=>f.useContext(xt),cn=()=>{const{enqueueSnackbar:e,closeSnackbar:t}=Wt.useSnackbar(),c=f.useCallback(l=>{const{type:a,message:s,autoHideDuration:d}=l;e({message:s,variant:a,autoHideDuration:d})},[]),i=f.useCallback(()=>{t()},[]);return f.useMemo(()=>({open:c,close:i}),[c,i])},Rt=f.createContext(void 0),Bn=()=>f.useContext(Rt),ar=f.createContext({sideDialogsController:{},sideEntityController:{},navigation:{},dataSource:{},storageSource:{},authController:{},snackbarController:{},fields:{}}),re=()=>{const e=f.useContext(ar),t=yn(),c=Xn(),i=Cn(),l=Ae(),a=Qe(),s=Sn(),d=cn(),u=Bn();return{...e,authController:t,sideDialogsController:c,sideEntityController:i,navigation:l,dataSource:a,storageSource:s,snackbarController:d,userConfigPersistence:u}};function ec({path:e,collection:t,filterValues:c,sortBy:i,itemCount:l,searchString:a}){const s=Qe(),u=Ae().resolveAliasesFrom(e),A=i?i[0]:void 0,_=i?i[1]:void 0,g=re(),[y,h]=f.useState([]),[I,b]=f.useState(!1),[p,w]=f.useState(),[k,K]=f.useState(!1);return f.useEffect(()=>{b(!0);const m=async S=>{if(t.callbacks?.onFetch)try{S=await Promise.all(S.map(B=>t.callbacks.onFetch({collection:t,path:u,entity:B,context:g})))}catch(B){console.error(B)}b(!1),w(void 0),h(S.map(B=>({...B}))),K(!l||S.length<l)},v=S=>{console.error("ERROR",S),b(!1),h([]),w(S)};return s.listenCollection?s.listenCollection({path:u,collection:t,onUpdate:m,onError:v,searchString:a,filter:c,limit:l,startAfter:void 0,orderBy:A,order:_}):(s.fetchCollection({path:u,collection:t,searchString:a,filter:c,limit:l,startAfter:void 0,orderBy:A,order:_}).then(m).catch(v),()=>{})},[u,l,_,A,c,a]),{data:y,dataLoading:I,dataLoadingError:p,noMoreToLoad:k}}const lr={};function sr({path:e,entityId:t,collection:c,useCache:i=!1}){const l=Qe(),s=Ae().resolveAliasesFrom(e),d=re(),[u,A]=f.useState(),[_,g]=f.useState(!0),[y,h]=f.useState();return f.useEffect(()=>{g(!0);const I=async p=>{if(c.callbacks?.onFetch&&p)try{p=await c.callbacks.onFetch({collection:c,path:s,entity:p,context:d})}catch(w){console.error(w)}lr[`${s}/${t}`]=p,A(p),g(!1),h(void 0)},b=p=>{console.error("ERROR fetching entity",p),g(!1),A(void 0),h(p)};return t&&i&&lr[`${s}/${t}`]?(A(lr[`${s}/${t}`]),g(!1),h(void 0),()=>{}):t&&s&&c?l.listenEntity?l.listenEntity({path:s,entityId:t,collection:c,onUpdate:I,onError:b}):(l.fetchEntity({path:s,entityId:t,collection:c}).then(I).catch(b),()=>{}):(I(void 0),()=>{})},[t,s]),{entity:u,dataLoading:_,dataLoadingError:y}}async function dr({collection:e,path:t,entityId:c,values:i,previousValues:l,status:a,dataSource:s,context:d,onSaveSuccess:u,onSaveFailure:A,onPreSaveHookError:_,onSaveSuccessHookError:g}){let y;const h=d.navigation.resolveAliasesFrom(t),I=e.callbacks;if(I?.onPreSave)try{const b=Me({collection:e,path:t,values:l,entityId:c,fields:d.fields});y=await I.onPreSave({collection:b,path:t,resolvedPath:h,entityId:c,values:i,previousValues:l,status:a,context:d})}catch(b){console.error(b),_&&_(b);return}else y=i;return s.saveEntity({collection:e,path:h,entityId:c,values:y,previousValues:l,status:a}).then(b=>{try{if(I?.onSaveSuccess){const p=Me({collection:e,path:t,values:y,entityId:c,fields:d.fields});I.onSaveSuccess({collection:p,path:t,resolvedPath:h,entityId:b.id,values:y,previousValues:l,status:a,context:d})}}catch(p){g&&g(p)}u&&u(b)}).catch(b=>{if(I?.onSaveFailure){const p=Me({collection:e,path:t,values:y,entityId:c,fields:d.fields});I.onSaveFailure({collection:p,path:t,resolvedPath:h,entityId:c,values:y,previousValues:l,status:a,context:d})}A&&A(b)})}async function nc({dataSource:e,entity:t,collection:c,callbacks:i,onDeleteSuccess:l,onDeleteFailure:a,onPreDeleteHookError:s,onDeleteSuccessHookError:d,context:u}){console.debug("Deleting entity",t.path,t.id);const A={entity:t,collection:c,entityId:t.id,path:t.path,context:u};if(i?.onPreDelete)try{await i.onPreDelete(A)}catch(_){return console.error(_),s&&s(t,_),!1}return e.deleteEntity({entity:t}).then(()=>{l&&l(t);try{return i?.onDelete&&i.onDelete(A),!0}catch(_){return d&&d(t,_),!1}}).catch(_=>(a&&a(t,_),!1))}function Ne({property:e,value:t,setValue:c}){const i=f.useRef(null);f.useEffect(()=>{typeof e.disabled=="object"&&!!e.disabled.clearOnDisabled?t!=null&&(i.current=t,c(null)):i.current&&(c(i.current),i.current=null)},[e])}function oc({path:e,context:t}){const c=t.dataSource,i=t.navigation;if(!i)throw Error("Calling getNavigationFrom, but main navigation has not yet been initialised");const a=cr({path:e,collections:i.collections??[]}).map(s=>{if(s.type==="collection")return Promise.resolve(s);if(s.type==="entity"){const d=i.getCollection(s.path,s.entityId);if(!d)throw Error(`No collection defined in the navigation for the entity with path ${s.path}`);return c.fetchEntity({path:s.path,entityId:s.entityId,collection:d}).then(u=>{if(u)return{...s,entity:u}})}else{if(s.type==="custom_view")return Promise.resolve(s);throw Error("Unmapped element in useEntitiesFromPath")}}).filter(s=>!!s);return Promise.all(a)}function Ya({path:e}){const t=re(),[c,i]=f.useState(),[l,a]=f.useState(!1),[s,d]=f.useState();return f.useEffect(()=>{t.navigation&&(a(!0),d(void 0),oc({path:e,context:t}).then(A=>{i(A)}).catch(A=>d(A)).finally(()=>a(!1)))},[e,t]),t.navigation?{data:c,dataLoading:l,dataLoadingError:s}:{dataLoading:!0}}const ur=()=>f.useContext(rr),rc=e=>{const{onSuccess:t,onError:c,disableClipboardAPI:i=!1,copiedDuration:l}=e||{},a=f.useRef(null),[s,d]=f.useState(!1),[u,A]=f.useState("");f.useEffect(()=>{l&&setTimeout(()=>d(!1),l)},[s]);const _=()=>navigator.clipboard!==void 0,g=f.useCallback(k=>{if(c)c(k);else throw new Error(k)},[c]),y=f.useCallback(k=>{t&&t(k),d(!0),A(k)},[t]),h=f.useCallback(k=>{navigator.clipboard.writeText(k).then(()=>y(k)).catch(K=>{g(K),d(!1)})},[g,y]),I=()=>{_()&&navigator.clipboard.writeText("")},b=k=>w("copy",typeof k=="object"?void 0:k),p=()=>w("cut"),w=f.useCallback((k="copy",K)=>{const m=a.current,v=m&&(m.tagName==="INPUT"||m.tagName==="TEXTAREA"),S=a.current;_()&&!i&&(K?h(K):m?v?(h(S.value),k==="cut"&&(S.value="")):h(m.innerText):g("Both the ref & text were undefined"))},[i,h,g]);return{ref:a,isCoppied:s,clipboard:u,clearClipboard:I,isSupported:_,copy:b,cut:p}},fr=()=>f.useContext(Yt),$a={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536,"3xl":1920},Ge=(e="lg")=>{const[t,c]=f.useState(!1);return f.useEffect(()=>{const i=()=>{const l=window.matchMedia(`(min-width: ${$a[e]+1}px)`).matches;c(l)};return i(),window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),t};function xn(e){const t=Ae(),c=Xn(),i=f.useCallback(()=>{if(e.path){let a=e.collection;if(a||(a=t.getCollection(e.path)),!a)throw Error("Not able to resolve the collection in useReferenceDialog");c.open({key:`reference_${e.path}`,component:n.jsx(ra,{collection:a,...e}),width:"90vw",onClose:()=>{e.onClose?.()}})}else throw Error("useReferenceDialog: You are trying to open a reference dialog, but have not declared the `path`")},[t,e,c]),l=f.useCallback(()=>{c.close()},[c]);return{open:i,close:l}}const ja=`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAASAAAAEgARslrPgAAB9pJREFUWMONl12obVUVx39jzLk+9j7nHq9y1QT1qpcbSIaXQFGs24PQl3HroSQyqHwJFJF6qaceCsqQoJdELHoIC6EeJCSKsi/TFLGozGsKXksljRLxnrP3WmvOOUYPa+19zsmPWpux5pxrzTX///Exx5hb+B/X1y+/nuIlVKF5m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
2
|
`;function qa(e,t){f.useEffect(()=>{if(document){document.title=`${e} - FireCMS`;let c=document.querySelector("link[rel~='icon']");c||(c=document.createElement("link"),c.rel="icon",document.getElementsByTagName("head")[0].appendChild(c)),c.href=t??ja}},[e,t])}function En(e,t){f.useEffect(()=>{if(!document.getElementById(e)){const i=document.createElement("style");i.id=e,i.innerHTML=t,document.head.appendChild(i)}},[e,t])}const ye=({open:e,side:t="bottom",sideOffset:c,onOpenChange:i,title:l,className:a,style:s,tooltipClassName:d,children:u})=>(En("Tooltip",Ja),l?n.jsx(jn.Provider,{delayDuration:250,children:n.jsxs(jn.Root,{open:e,onOpenChange:i,children:[n.jsx(jn.Trigger,{asChild:!0,children:n.jsx("div",{className:a,style:s,children:u})}),n.jsx(jn.Portal,{children:n.jsx(jn.Content,{className:E("TooltipContent","max-w-lg leading-relaxed","z-50 rounded px-3 py-2 text-xs leading-none bg-gray-700 dark:bg-gray-800 bg-opacity-90 font-medium text-gray-50 shadow-2xl select-none duration-400 ease-in transform opacity-100",d),sideOffset:c===void 0?4:c,side:t,children:l})})]})}):n.jsx(n.Fragment,{children:u})),Ja=`
|
|
3
3
|
|
|
4
4
|
.TooltipContent {
|