decap-cms-app 3.12.0 → 3.12.1
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/decap-cms-app.js +1 -1
- package/dist/esm/index.js +2 -2
- package/package.json +3 -2
package/dist/decap-cms-app.js
CHANGED
|
@@ -496,5 +496,5 @@
|
|
|
496
496
|
|
|
497
497
|
If your repo is under an organization, ensure the organization has granted access to Static
|
|
498
498
|
CMS.
|
|
499
|
-
`,e}))throw new Error("Your Gitea user account does not have access to this repo.");return{name:n.full_name,login:n.login,email:n.email,avatar_url:n.avatar_url,token:e.token}}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}getCursorAndFiles=(e,t)=>{const n=e.length,r=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<r&&(i.push("next"),i.push("last")),{cursor:Ao.create({actions:i,meta:{page:t,count:n,pageSize:20,pageCount:r},data:{files:e}}),files:e.slice(20*(t-1),20*t)}};async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await Uo(()=>this.api.listFiles(e,{repoURL:r,depth:n}).then(e=>{const n=e.filter(e=>ho(e,t)),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}),(e,t)=>this.api.readFile(e,t,{repoURL:r}),this.api.readFileMetadata.bind(this.api),VM);return o[Oo]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL,i=await Uo(()=>this.api.listFiles(e,{repoURL:r,depth:n}).then(e=>e.filter(e=>ho(e,t))),(e,t)=>this.api.readFile(e,t,{repoURL:r}),this.api.readFileMetadata.bind(this.api),VM);return i}entriesByFiles(e){const t=this.api.repoURL;return qo(e,(e,n)=>this.api.readFile(e,n,{repoURL:t}).catch(()=>""),this.api.readFileMetadata.bind(this.api),VM)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then(t=>({file:{path:e,id:null},data:t})).catch(()=>({file:{path:e,id:null},data:""}))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then(e=>e.map(({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"===i}))):[]}async getMediaFile(e){const t=await Ho(e,null,this.api.readFile.bind(this.api)),n=jo(e),r=Wo(n,t),i=URL.createObjectURL(r);return{id:await Eu(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||ko()(10),Vo(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return Go(this.lock,()=>this.api.persistFiles(e.dataFiles,e.assets,t),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:Bs()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const n=e.meta,r=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(r,1);break;case"last":i=this.getCursorAndFiles(r,n.get("pageCount"));break;case"next":i=this.getCursorAndFiles(r,n.get("page")+1);break;case"prev":i=this.getCursorAndFiles(r,n.get("page")-1)}const o=await qo(i.files,(e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch(()=>""),this.api.readFileMetadata.bind(this.api),VM);return{entries:o,cursor:i.cursor}}async unpublishedEntries(){return{}}async unpublishedEntry(){return{}}async unpublishedEntryDataFile(){return{}}async unpublishedEntryMediaFile(){return{}}async updateUnpublishedEntryStatus(){}async publishUnpublishedEntry(){}async deleteUnpublishedEntry(){}async getDeployPreview(){return{}}}),mA.registerBackend("bitbucket",yF),mA.registerBackend("test-repo",class{constructor(e,t={}){this.options=t,this.mediaFolder=e.media_folder}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return Mj}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}traverseCursor(e,t){const{folder:n,extension:r,index:i,pageCount:o,depth:a}=e.data.toObject(),s="next"===t?i+1:"prev"===t?i-1:"first"===t?0:"last"===t?o:0,l=Uj(window.repoFiles,n,r,a).map(e=>({data:e.content,file:{path:e.path,id:e.path}})),u=l.slice(s*Bj,s*Bj+Bj),c=zj(n,r,l,s,a);return Promise.resolve({entries:u,cursor:c})}entriesByFolder(e,t,n){const r=(e?Uj(window.repoFiles,e,t,n):[]).map(e=>({data:e.content,file:{path:e.path,id:e.path}})),i=zj(e,t,r,0,n),o=Oj()(r,Bj);return o[Oo]=i,Promise.resolve(o)}entriesByFiles(e){return Promise.all(e.map(e=>({file:e,data:Nj(e.path,window.repoFiles).content})))}getEntry(e){return Promise.resolve({file:{path:e,id:null},data:Nj(e,window.repoFiles).content})}unpublishedEntries(){return Promise.resolve(Object.keys(window.repoFilesUnpublished))}unpublishedEntry({id:e,collection:t,slug:n}){if(e){const r=e.split("/");t=r[0],n=r[1]}const r=window.repoFilesUnpublished[`${t}/${n}`];return r?Promise.resolve(r):Promise.reject(new Eo("content is not under editorial workflow",!0))}async unpublishedEntryDataFile(e,t,n){const r=window.repoFilesUnpublished[`${e}/${t}`].diffs.find(e=>e.path===n);return r?.content}async unpublishedEntryMediaFile(e,t,n){const r=window.repoFilesUnpublished[`${e}/${t}`].diffs.find(e=>e.path===n);return this.normalizeAsset(r?.content)}deleteUnpublishedEntry(e,t){return delete window.repoFilesUnpublished[`${e}/${t}`],Promise.resolve()}async addOrUpdateUnpublishedEntry(e,t,n,r,i,o){const a=[];t.forEach(t=>{const{path:n,newPath:r,raw:i}=t,o=window.repoFilesUnpublished[e]?.diffs.find(e=>e.path===n),s=o?o.originalPath:n;a.push({originalPath:s,id:r||n,path:r||n,newFile:Us()(Nj(s,window.repoFiles)),status:"added",content:i})}),n.forEach(e=>{const t=this.normalizeAsset(e);a.push({id:t.id,path:t.path,newFile:!0,status:"added",content:t})}),window.repoFilesUnpublished[e]={slug:r,collection:i,status:o,diffs:a,updatedAt:(new Date).toISOString()}}async persistEntry(e,t){if(t.useWorkflow){const n=e.dataFiles[0].slug,r=`${t.collectionName}/${n}`,i=window.repoFilesUnpublished[r],o=i?.status||t.status||this.options.initialWorkflowStatus;return this.addOrUpdateUnpublishedEntry(r,e.dataFiles,e.assets,n,t.collectionName,o),Promise.resolve()}return e.dataFiles.forEach(e=>{const{path:t,raw:n}=e;Fj(t,n,window.repoFiles)}),e.assets.forEach(e=>{Fj(e.path,e,window.repoFiles)}),Promise.resolve()}updateUnpublishedEntryStatus(e,t,n){return window.repoFilesUnpublished[`${e}/${t}`].status=n,Promise.resolve()}publishUnpublishedEntry(e,t){const n=`${e}/${t}`,r=window.repoFilesUnpublished[n];delete window.repoFilesUnpublished[n];const i=window.repoFiles;return r.diffs.forEach(e=>{if(e.originalPath&&!e.newFile){const t=e.originalPath,n=(0,Qo.dirname)(t),r=(0,Qo.dirname)(e.path),o=Uj(i,t.split("/")[0],"",100).filter(e=>e.path.startsWith(n));o.forEach(e=>{jj(e.path,i),Fj(e.path.replace(n,r),e.content,i)})}Fj(e.path,e.content,i)}),Promise.resolve()}getMedia(e=this.mediaFolder){const t=Uj(window.repoFiles,e.split("/")[0],"",100).filter(t=>t.path.startsWith(e)),n=t.map(e=>this.normalizeAsset(e.content));return Promise.resolve(n)}async getMediaFile(e){const t=Nj(e,window.repoFiles).content.toString(),n=jo(e),r=await fetch(t).then(e=>e.blob()),i=new File([r],n);return{id:t,displayURL:t,path:e,name:n,size:i.size,file:i,url:t}}normalizeAsset(e){const t=e.fileObj,{name:n,size:r}=t,i=xi()(window.URL.createObjectURL,t),o=Ti()(i)?"":i;return{id:tl(),name:n,size:r,path:e.path,url:o,displayURL:o,fileObj:t}}persistMedia(e){const t=this.normalizeAsset(e);return Fj(e.path,e,window.repoFiles),Promise.resolve(t)}deleteFiles(e){return e.forEach(e=>{jj(e,window.repoFiles)}),Promise.resolve()}async getDeployPreview(){return null}}),mA.registerBackend("proxy",class{constructor(e,t={}){if(!e.backend.proxy_url)throw new Error('The Proxy backend needs a "proxy_url" in the backend configuration.');this.branch=e.backend.branch||"master",this.proxyUrl=e.backend.proxy_url,this.mediaFolder=e.media_folder,this.options=t,this.cmsLabelPrefix=e.backend.cms_label_prefix}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return Wj}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}async request(e){const t=await po.fetchWithTimeout(this.proxyUrl,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify({branch:this.branch,...e})}),n=await t.json();if(t.ok)return n;throw new fo(n.error,t.status,"Proxy")}entriesByFolder(e,t,n){return this.request({action:"entriesByFolder",params:{branch:this.branch,folder:e,extension:t,depth:n}})}entriesByFiles(e){return this.request({action:"entriesByFiles",params:{branch:this.branch,files:e}})}getEntry(e){return this.request({action:"getEntry",params:{branch:this.branch,path:e}})}unpublishedEntries(){return this.request({action:"unpublishedEntries",params:{branch:this.branch}})}async unpublishedEntry({id:e,collection:t,slug:n}){try{return await this.request({action:"unpublishedEntry",params:{branch:this.branch,id:e,collection:t,slug:n,cmsLabelPrefix:this.cmsLabelPrefix}})}catch(e){if(404===e.status)throw new Eo("content is not under editorial workflow",!0);throw e}}async unpublishedEntryDataFile(e,t,n,r){const{data:i}=await this.request({action:"unpublishedEntryDataFile",params:{branch:this.branch,collection:e,slug:t,path:n,id:r}});return i}async unpublishedEntryMediaFile(e,t,n,r){return Vj(await this.request({action:"unpublishedEntryMediaFile",params:{branch:this.branch,collection:e,slug:t,path:n,id:r}}))}deleteUnpublishedEntry(e,t){return this.request({action:"deleteUnpublishedEntry",params:{branch:this.branch,collection:e,slug:t}})}async persistEntry(e,t){const n=await Promise.all(e.assets.map(Hj));return this.request({action:"persistEntry",params:{branch:this.branch,dataFiles:e.dataFiles,assets:n,options:{...t,status:t.status||this.options.initialWorkflowStatus},cmsLabelPrefix:this.cmsLabelPrefix}})}updateUnpublishedEntryStatus(e,t,n){return this.request({action:"updateUnpublishedEntryStatus",params:{branch:this.branch,collection:e,slug:t,newStatus:n,cmsLabelPrefix:this.cmsLabelPrefix}})}publishUnpublishedEntry(e,t){return this.request({action:"publishUnpublishedEntry",params:{branch:this.branch,collection:e,slug:t}})}async getMedia(e=this.mediaFolder){return(await this.request({action:"getMedia",params:{branch:this.branch,mediaFolder:e}})).map(Vj)}async getMediaFile(e){return Vj(await this.request({action:"getMediaFile",params:{branch:this.branch,path:e}}))}async persistMedia(e,t){const n=await Hj(e);return Vj(await this.request({action:"persistMedia",params:{branch:this.branch,asset:n,options:{commitMessage:t.commitMessage}}}))}deleteFiles(e,t){return this.request({action:"deleteFiles",params:{branch:this.branch,paths:e,options:{commitMessage:t}}})}getDeployPreview(e,t){return this.request({action:"getDeployPreview",params:{branch:this.branch,collection:e,slug:t}})}}),mA.registerWidget([Qj(),rB(),kB(),Eq(),gq.Widget(),hH(),d9(),bfe(),she(),Dfe.Widget(),Rhe(),Lhe(),mSe(),PSe(),JSe(),MLe()]),mA.registerEditorComponent(FLe),mA.registerEditorComponent({id:"code-block",label:"Code Block",widget:"code",type:"code-block"}),Object.keys(n).forEach(e=>{mA.registerLocale(e,n[e])}),"undefined"!=typeof window&&console.log("decap-cms-app 3.12.0");const vMe={...mA}})(),__webpack_exports__=__webpack_exports__.DecapCmsApp,__webpack_exports__})());
|
|
499
|
+
`,e}))throw new Error("Your Gitea user account does not have access to this repo.");return{name:n.full_name,login:n.login,email:n.email,avatar_url:n.avatar_url,token:e.token}}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}getCursorAndFiles=(e,t)=>{const n=e.length,r=Math.ceil(e.length/20),i=[];return t>1&&(i.push("prev"),i.push("first")),t<r&&(i.push("next"),i.push("last")),{cursor:Ao.create({actions:i,meta:{page:t,count:n,pageSize:20,pageCount:r},data:{files:e}}),files:e.slice(20*(t-1),20*t)}};async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await Uo(()=>this.api.listFiles(e,{repoURL:r,depth:n}).then(e=>{const n=e.filter(e=>ho(e,t)),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}),(e,t)=>this.api.readFile(e,t,{repoURL:r}),this.api.readFileMetadata.bind(this.api),VM);return o[Oo]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL,i=await Uo(()=>this.api.listFiles(e,{repoURL:r,depth:n}).then(e=>e.filter(e=>ho(e,t))),(e,t)=>this.api.readFile(e,t,{repoURL:r}),this.api.readFileMetadata.bind(this.api),VM);return i}entriesByFiles(e){const t=this.api.repoURL;return qo(e,(e,n)=>this.api.readFile(e,n,{repoURL:t}).catch(()=>""),this.api.readFileMetadata.bind(this.api),VM)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then(t=>({file:{path:e,id:null},data:t})).catch(()=>({file:{path:e,id:null},data:""}))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then(e=>e.map(({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"===i}))):[]}async getMediaFile(e){const t=await Ho(e,null,this.api.readFile.bind(this.api)),n=jo(e),r=Wo(n,t),i=URL.createObjectURL(r);return{id:await Eu(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||ko()(10),Vo(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return Go(this.lock,()=>this.api.persistFiles(e.dataFiles,e.assets,t),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:Bs()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){const n=e.meta,r=e.data.get("files").toJS();let i;switch(t){case"first":default:i=this.getCursorAndFiles(r,1);break;case"last":i=this.getCursorAndFiles(r,n.get("pageCount"));break;case"next":i=this.getCursorAndFiles(r,n.get("page")+1);break;case"prev":i=this.getCursorAndFiles(r,n.get("page")-1)}const o=await qo(i.files,(e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch(()=>""),this.api.readFileMetadata.bind(this.api),VM);return{entries:o,cursor:i.cursor}}async unpublishedEntries(){return{}}async unpublishedEntry(){return{}}async unpublishedEntryDataFile(){return{}}async unpublishedEntryMediaFile(){return{}}async updateUnpublishedEntryStatus(){}async publishUnpublishedEntry(){}async deleteUnpublishedEntry(){}async getDeployPreview(){return{}}}),mA.registerBackend("bitbucket",yF),mA.registerBackend("test-repo",class{constructor(e,t={}){this.options=t,this.mediaFolder=e.media_folder}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return Mj}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}traverseCursor(e,t){const{folder:n,extension:r,index:i,pageCount:o,depth:a}=e.data.toObject(),s="next"===t?i+1:"prev"===t?i-1:"first"===t?0:"last"===t?o:0,l=Uj(window.repoFiles,n,r,a).map(e=>({data:e.content,file:{path:e.path,id:e.path}})),u=l.slice(s*Bj,s*Bj+Bj),c=zj(n,r,l,s,a);return Promise.resolve({entries:u,cursor:c})}entriesByFolder(e,t,n){const r=(e?Uj(window.repoFiles,e,t,n):[]).map(e=>({data:e.content,file:{path:e.path,id:e.path}})),i=zj(e,t,r,0,n),o=Oj()(r,Bj);return o[Oo]=i,Promise.resolve(o)}entriesByFiles(e){return Promise.all(e.map(e=>({file:e,data:Nj(e.path,window.repoFiles).content})))}getEntry(e){return Promise.resolve({file:{path:e,id:null},data:Nj(e,window.repoFiles).content})}unpublishedEntries(){return Promise.resolve(Object.keys(window.repoFilesUnpublished))}unpublishedEntry({id:e,collection:t,slug:n}){if(e){const r=e.split("/");t=r[0],n=r[1]}const r=window.repoFilesUnpublished[`${t}/${n}`];return r?Promise.resolve(r):Promise.reject(new Eo("content is not under editorial workflow",!0))}async unpublishedEntryDataFile(e,t,n){const r=window.repoFilesUnpublished[`${e}/${t}`].diffs.find(e=>e.path===n);return r?.content}async unpublishedEntryMediaFile(e,t,n){const r=window.repoFilesUnpublished[`${e}/${t}`].diffs.find(e=>e.path===n);return this.normalizeAsset(r?.content)}deleteUnpublishedEntry(e,t){return delete window.repoFilesUnpublished[`${e}/${t}`],Promise.resolve()}async addOrUpdateUnpublishedEntry(e,t,n,r,i,o){const a=[];t.forEach(t=>{const{path:n,newPath:r,raw:i}=t,o=window.repoFilesUnpublished[e]?.diffs.find(e=>e.path===n),s=o?o.originalPath:n;a.push({originalPath:s,id:r||n,path:r||n,newFile:Us()(Nj(s,window.repoFiles)),status:"added",content:i})}),n.forEach(e=>{const t=this.normalizeAsset(e);a.push({id:t.id,path:t.path,newFile:!0,status:"added",content:t})}),window.repoFilesUnpublished[e]={slug:r,collection:i,status:o,diffs:a,updatedAt:(new Date).toISOString()}}async persistEntry(e,t){if(t.useWorkflow){const n=e.dataFiles[0].slug,r=`${t.collectionName}/${n}`,i=window.repoFilesUnpublished[r],o=i?.status||t.status||this.options.initialWorkflowStatus;return this.addOrUpdateUnpublishedEntry(r,e.dataFiles,e.assets,n,t.collectionName,o),Promise.resolve()}return e.dataFiles.forEach(e=>{const{path:t,raw:n}=e;Fj(t,n,window.repoFiles)}),e.assets.forEach(e=>{Fj(e.path,e,window.repoFiles)}),Promise.resolve()}updateUnpublishedEntryStatus(e,t,n){return window.repoFilesUnpublished[`${e}/${t}`].status=n,Promise.resolve()}publishUnpublishedEntry(e,t){const n=`${e}/${t}`,r=window.repoFilesUnpublished[n];delete window.repoFilesUnpublished[n];const i=window.repoFiles;return r.diffs.forEach(e=>{if(e.originalPath&&!e.newFile){const t=e.originalPath,n=(0,Qo.dirname)(t),r=(0,Qo.dirname)(e.path),o=Uj(i,t.split("/")[0],"",100).filter(e=>e.path.startsWith(n));o.forEach(e=>{jj(e.path,i),Fj(e.path.replace(n,r),e.content,i)})}Fj(e.path,e.content,i)}),Promise.resolve()}getMedia(e=this.mediaFolder){const t=Uj(window.repoFiles,e.split("/")[0],"",100).filter(t=>t.path.startsWith(e)),n=t.map(e=>this.normalizeAsset(e.content));return Promise.resolve(n)}async getMediaFile(e){const t=Nj(e,window.repoFiles).content.toString(),n=jo(e),r=await fetch(t).then(e=>e.blob()),i=new File([r],n);return{id:t,displayURL:t,path:e,name:n,size:i.size,file:i,url:t}}normalizeAsset(e){const t=e.fileObj,{name:n,size:r}=t,i=xi()(window.URL.createObjectURL,t),o=Ti()(i)?"":i;return{id:tl(),name:n,size:r,path:e.path,url:o,displayURL:o,fileObj:t}}persistMedia(e){const t=this.normalizeAsset(e);return Fj(e.path,e,window.repoFiles),Promise.resolve(t)}deleteFiles(e){return e.forEach(e=>{jj(e,window.repoFiles)}),Promise.resolve()}async getDeployPreview(){return null}}),mA.registerBackend("proxy",class{constructor(e,t={}){if(!e.backend.proxy_url)throw new Error('The Proxy backend needs a "proxy_url" in the backend configuration.');this.branch=e.backend.branch||"master",this.proxyUrl=e.backend.proxy_url,this.mediaFolder=e.media_folder,this.options=t,this.cmsLabelPrefix=e.backend.cms_label_prefix}isGitBackend(){return!1}status(){return Promise.resolve({auth:{status:!0},api:{status:!0,statusPage:""}})}authComponent(){return Wj}restoreUser(){return this.authenticate()}authenticate(){return Promise.resolve()}logout(){return null}getToken(){return Promise.resolve("")}async request(e){const t=await po.fetchWithTimeout(this.proxyUrl,{method:"POST",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify({branch:this.branch,...e})}),n=await t.json();if(t.ok)return n;throw new fo(n.error,t.status,"Proxy")}entriesByFolder(e,t,n){return this.request({action:"entriesByFolder",params:{branch:this.branch,folder:e,extension:t,depth:n}})}entriesByFiles(e){return this.request({action:"entriesByFiles",params:{branch:this.branch,files:e}})}getEntry(e){return this.request({action:"getEntry",params:{branch:this.branch,path:e}})}unpublishedEntries(){return this.request({action:"unpublishedEntries",params:{branch:this.branch}})}async unpublishedEntry({id:e,collection:t,slug:n}){try{return await this.request({action:"unpublishedEntry",params:{branch:this.branch,id:e,collection:t,slug:n,cmsLabelPrefix:this.cmsLabelPrefix}})}catch(e){if(404===e.status)throw new Eo("content is not under editorial workflow",!0);throw e}}async unpublishedEntryDataFile(e,t,n,r){const{data:i}=await this.request({action:"unpublishedEntryDataFile",params:{branch:this.branch,collection:e,slug:t,path:n,id:r}});return i}async unpublishedEntryMediaFile(e,t,n,r){return Vj(await this.request({action:"unpublishedEntryMediaFile",params:{branch:this.branch,collection:e,slug:t,path:n,id:r}}))}deleteUnpublishedEntry(e,t){return this.request({action:"deleteUnpublishedEntry",params:{branch:this.branch,collection:e,slug:t}})}async persistEntry(e,t){const n=await Promise.all(e.assets.map(Hj));return this.request({action:"persistEntry",params:{branch:this.branch,dataFiles:e.dataFiles,assets:n,options:{...t,status:t.status||this.options.initialWorkflowStatus},cmsLabelPrefix:this.cmsLabelPrefix}})}updateUnpublishedEntryStatus(e,t,n){return this.request({action:"updateUnpublishedEntryStatus",params:{branch:this.branch,collection:e,slug:t,newStatus:n,cmsLabelPrefix:this.cmsLabelPrefix}})}publishUnpublishedEntry(e,t){return this.request({action:"publishUnpublishedEntry",params:{branch:this.branch,collection:e,slug:t}})}async getMedia(e=this.mediaFolder){return(await this.request({action:"getMedia",params:{branch:this.branch,mediaFolder:e}})).map(Vj)}async getMediaFile(e){return Vj(await this.request({action:"getMediaFile",params:{branch:this.branch,path:e}}))}async persistMedia(e,t){const n=await Hj(e);return Vj(await this.request({action:"persistMedia",params:{branch:this.branch,asset:n,options:{commitMessage:t.commitMessage}}}))}deleteFiles(e,t){return this.request({action:"deleteFiles",params:{branch:this.branch,paths:e,options:{commitMessage:t}}})}getDeployPreview(e,t){return this.request({action:"getDeployPreview",params:{branch:this.branch,collection:e,slug:t}})}}),mA.registerWidget([Qj(),rB(),kB(),Eq(),gq.Widget(),hH(),d9(),bfe(),she(),Dfe.Widget(),Rhe(),Lhe(),mSe(),PSe(),JSe(),MLe()]),mA.registerEditorComponent(FLe),mA.registerEditorComponent({id:"code-block",label:"Code Block",widget:"code",type:"code-block"}),Object.keys(n).forEach(e=>{mA.registerLocale(e,n[e])}),"undefined"!=typeof window&&console.log("decap-cms-app 3.12.1");const vMe={...mA}})(),__webpack_exports__=__webpack_exports__.DecapCmsApp,__webpack_exports__})());
|
|
500
500
|
//# sourceMappingURL=decap-cms-app.js.map
|
package/dist/esm/index.js
CHANGED
|
@@ -3,8 +3,8 @@ import './extensions.js';
|
|
|
3
3
|
|
|
4
4
|
// Log version
|
|
5
5
|
if (typeof window !== 'undefined') {
|
|
6
|
-
if (typeof "3.12.
|
|
7
|
-
console.log(`decap-cms-app ${"3.12.
|
|
6
|
+
if (typeof "3.12.1" === 'string') {
|
|
7
|
+
console.log(`decap-cms-app ${"3.12.1"}`);
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export const DecapCmsApp = {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decap-cms-app",
|
|
3
3
|
"description": "An extensible, open source, Git-based, React CMS for static sites. Reusable congiuration with React as peer.",
|
|
4
|
-
"version": "3.12.
|
|
4
|
+
"version": "3.12.1",
|
|
5
5
|
"homepage": "https://www.decapcms.org",
|
|
6
6
|
"repository": "https://github.com/decaporg/decap-cms/tree/main/packages/decap-cms-app",
|
|
7
7
|
"bugs": "https://github.com/decaporg/decap-cms/issues",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"decap-cms-widget-number": "^3.2.0",
|
|
64
64
|
"decap-cms-widget-object": "^3.5.0",
|
|
65
65
|
"decap-cms-widget-relation": "^3.5.2",
|
|
66
|
+
"decap-cms-widget-richtext": "^3.2.0",
|
|
66
67
|
"decap-cms-widget-select": "^3.3.0",
|
|
67
68
|
"decap-cms-widget-string": "^3.2.0",
|
|
68
69
|
"decap-cms-widget-text": "^3.2.0",
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"react-dom": "^19.1.0"
|
|
78
79
|
},
|
|
79
80
|
"incrementToForceBump": 2,
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "69ce240d3f1c0247ddc0b4b0a7aa151f10d7613d"
|
|
81
82
|
}
|