TYPO3 v15 dev-main snapshot ()

This commit is contained in:
2026-08-10 22:31:00 +02:00
commit f9941541b7
1178 changed files with 135377 additions and 0 deletions
@@ -0,0 +1,13 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
class r{constructor(){this.keyPrefix="t3-",this.storage=null}get(t){return this.storage===null?null:this.storage.getItem(this.keyPrefix+t)}getByPrefix(t){if(this.storage===null)return{};const e=Object.entries(this.storage).filter(s=>s[0].startsWith(this.keyPrefix+t)).map(s=>[s[0].substring(this.keyPrefix.length),s[1]]);return Object.fromEntries(e)}set(t,e){this.storage!==null&&this.storage.setItem(this.keyPrefix+t,e)}unset(t){this.storage!==null&&this.storage.removeItem(this.keyPrefix+t)}unsetByPrefix(t){this.storage!==null&&(t=this.keyPrefix+t,Object.keys(this.storage).filter(e=>e.startsWith(t)).forEach(e=>this.storage.removeItem(e)))}clear(){this.storage!==null&&this.storage.clear()}isset(t){return this.storage===null?!1:this.get(t)!==null}}export{r as default};
@@ -0,0 +1,13 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import s from"@typo3/backend/storage/abstract-client-storage.js";class e extends s{constructor(){super(),this.storage=sessionStorage}}var r=new e;export{r as default};
@@ -0,0 +1,13 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import t from"@typo3/backend/storage/abstract-client-storage.js";class e extends t{constructor(){super(),this.storage=localStorage}}var r=new e;export{r as default};
@@ -0,0 +1,13 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
class e{static{this.prefix="t3-module-state-"}static update(s,t){if(t===null&&(t=0),typeof t=="number")t=t.toString(10);else if(typeof t!="string")throw new SyntaxError("identifier must be of type string");const r=e.current(s),n=t===r.identifier?r.treeIdentifier:null,i={identifier:t,treeIdentifier:n};return e.commit(s,"update",i),i}static updateWithTreeIdentifier(s,t,r){if(typeof t=="number")t=t.toString(10);else if(typeof t!="string")throw new SyntaxError("identifier must be of type string");if(typeof r=="number")r=r.toString(10);else if(typeof r!="string")throw new SyntaxError("treeIdentifier must be of type string");const n={identifier:t,treeIdentifier:r};return e.commit(s,"update-with-tree-identifier",n),n}static updateWithCurrentMount(s,t){e.update(s,t)}static current(s){return{...e.getInitialState(),...e.fetch(s)??{}}}static purge(){Object.keys(sessionStorage).filter(s=>s.startsWith(e.prefix)).forEach(s=>sessionStorage.removeItem(s))}static fetch(s){const t=sessionStorage.getItem(e.prefix+s);return t===null?null:JSON.parse(t)}static async commit(s,t,r){const n=e.current(s);sessionStorage.setItem(e.prefix+s,JSON.stringify(r)),top.document.dispatchEvent(new CustomEvent("typo3:module-state-storage:"+t+":"+s,{detail:{state:r,oldState:n}}))}static getInitialState(){return{identifier:"",treeIdentifier:null}}}window.ModuleStateStorage=e;export{e as ModuleStateStorage};
@@ -0,0 +1,13 @@
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
import r from"@typo3/core/ajax/ajax-request.js";class o{constructor(){this.data=null}get(s){return this.data===null&&(this.data=this.loadFromServer()),this.getRecursiveDataByDeepKey(this.data,s.split("."))}set(s,e){return this.data!==null&&(this.data=this.setRecursiveDataByDeepKey(this.data,s.split("."),e)),this.storeOnServer(s,e)}async addToList(s,e){const t=await new r(TYPO3.settings.ajaxUrls.usersettings_process).post({action:"addToList",key:s,value:e});return this.resolveResponse(t)}async removeFromList(s,e){const t=await new r(TYPO3.settings.ajaxUrls.usersettings_process).post({action:"removeFromList",key:s,value:e});return this.resolveResponse(t)}async unset(s){const e=await new r(TYPO3.settings.ajaxUrls.usersettings_process).post({action:"unset",key:s});return this.resolveResponse(e)}clear(){new r(TYPO3.settings.ajaxUrls.usersettings_process).post({action:"clear"}),this.data=null}isset(s){const e=this.get(s);return typeof e<"u"&&e!==null}load(s){this.data=s}loadFromServer(){const s=new URL(location.origin+TYPO3.settings.ajaxUrls.usersettings_process);s.searchParams.set("action","getAll");const e=new XMLHttpRequest;if(e.open("GET",s.toString(),!1),e.send(),e.status===200)return JSON.parse(e.responseText);throw`Unexpected response code ${e.status}, reason: ${e.responseText}`}async storeOnServer(s,e){const t=await new r(TYPO3.settings.ajaxUrls.usersettings_process).post({action:"set",key:s,value:e});return this.resolveResponse(t)}getRecursiveDataByDeepKey(s,e){if(e.length===1)return(s||{})[e[0]];const t=e.shift();return this.getRecursiveDataByDeepKey(s[t]||{},e)}setRecursiveDataByDeepKey(s,e,t){if(e.length===1)s=s||{},s[e[0]]=t;else{const n=e.shift();s[n]=this.setRecursiveDataByDeepKey(s[n]||{},e,t)}return s}async resolveResponse(s){const e=await s.resolve();return this.data=e,e}}var i=new o;export{i as default};